diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 51c63e295e0232f7095a8ee8e03713837e37f419..0000000000000000000000000000000000000000 --- a/.gitattributes +++ /dev/null @@ -1,15 +0,0 @@ -*.tgz filter=lfs diff=lfs merge=lfs -text -*.trp filter=lfs diff=lfs merge=lfs -text -*.apk filter=lfs diff=lfs merge=lfs -text -*.jar filter=lfs diff=lfs merge=lfs -text -*.mp4 filter=lfs diff=lfs merge=lfs -text -*.zip filter=lfs diff=lfs merge=lfs -text -*.asm filter=lfs diff=lfs merge=lfs -text -*.8svn filter=lfs diff=lfs merge=lfs -text -*.9svn filter=lfs diff=lfs merge=lfs -text -*.dylib filter=lfs diff=lfs merge=lfs -text -*.exe filter=lfs diff=lfs merge=lfs -text -*.a filter=lfs diff=lfs merge=lfs -text -*.so filter=lfs diff=lfs merge=lfs -text -*.bin filter=lfs diff=lfs merge=lfs -text -*.dll filter=lfs diff=lfs merge=lfs -text diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2f6d026378c27564876cc35026f94d216403474c..0000000000000000000000000000000000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -**What version of protobuf and what language are you using?** -Version: master/v3.6.0/v3.5.0 etc. -Language: C++/Java/Python/C#/Ruby/PHP/Objective-C/Javascript - -**What operating system (Linux, Windows, ...) and version?** - -**What runtime / compiler are you using (e.g., python version or gcc version)** - -**What did you do?** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**What did you expect to see** - -**What did you see instead?** - -Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs). - -**Anything else we should know about your project / environment** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 722db4ce5904cd0b6c2e24d2934ba3ee98663f76..0000000000000000000000000000000000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- - -**What language does this apply to?** -If it's a proto syntax change, is it for proto2 or proto3? -If it's about generated code change, what programming language? - -**Describe the problem you are trying to solve.** - -**Describe the solution you'd like** - -**Describe alternatives you've considered** - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index bfa6ddea8801277dbf9057533dc5896e146fa8e0..0000000000000000000000000000000000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Question -about: Questions and troubleshooting - ---- - - diff --git a/.github/mergeable.yml b/.github/mergeable.yml deleted file mode 100644 index c4170019c141a8b545308829a23630cda5cd42a3..0000000000000000000000000000000000000000 --- a/.github/mergeable.yml +++ /dev/null @@ -1,18 +0,0 @@ -mergeable: - pull_requests: - label: - and: - - must_exclude: - regex: '^disposition/DO NOT MERGE' - message: 'Pull request marked not mergeable' - - or: - - and: - - must_include: - regex: 'release notes: yes' - message: 'Please include release note: yes' - - must_include: - regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby)' - message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: cleanup, conformance tests, integration.' - - must_include: - regex: 'release notes: no' - message: 'Please include release note: no' diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a7ca0e2438fd8a22f42aa71fd310e459f0d5fee0..0000000000000000000000000000000000000000 --- a/.gitignore +++ /dev/null @@ -1,202 +0,0 @@ -# autogen.sh-generated files -Makefile.in -src/Makefile.in -config.guess -config.h.in -config.sub -configure -depcomp -install-sh -ltmain.sh -missing - -aclocal.m4 -m4/libtool.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -autom4te.cache - -# downloaded files -/gmock - -# in-tree configure-generated files -Makefile -src/Makefile -/config.h -config.log -config.status - -libtool -protobuf-lite.pc -protobuf.pc -.deps -stamp-h1 - -# in-tree build products -*.o -*.lo -*.la -src/.libs -*.so - -.dirstamp - -any_test.pb.* -map*unittest.pb.* -unittest*.pb.* -cpp_test*.pb.* -src/google/protobuf/util/**/*.pb.cc -src/google/protobuf/util/**/*.pb.h - -*.pyc -*.egg-info -*_pb2.py -python/**/*.egg -python/.eggs/ -python/.tox -python/build/ - -src/js_embed -src/protoc -src/unittest_proto_middleman - -# vim generated -*.swp - -# Generated test scaffolding -src/no_warning_test.cc -src/no-warning-test -src/protobuf*-test -src/test_plugin -src/testzip.* -src/zcg*zip -ar-lib - -test-driver -compile - -src/**/*.log -src/**/*.trs - -# JavaBuild output. -java/core/target -java/util/target -javanano/target -java/.idea -java/**/*.iml - -# Windows native output. -cmake/build -build_msvc - -# NuGet packages: we want the repository configuration, but not the -# packages themselves. -/csharp/src/packages/*/ - -# OS X's Finder creates these for state about opened windows/etc. -**/.DS_Store - -# Cocoapods artifacts -# Podfile.lock and the workspace file are tracked, to ease deleting them. That's -# needed to trigger "pod install" to rerun the preinstall commands. -Pods/ - -# Comformance test output -conformance/.libs/ -conformance/com/ -conformance/conformance-cpp -conformance/conformance-csharp -conformance/conformance-java -conformance/conformance-objc -conformance/conformance-test-runner -conformance/conformance.pb.cc -conformance/conformance.pb.h -conformance/Conformance.pbobjc.h -conformance/Conformance.pbobjc.m -conformance/conformance_pb.js -conformance/conformance_pb.rb -conformance/failing_tests.txt -conformance/google/ -conformance/google-protobuf/ -conformance/javac_middleman -conformance/lite/ -conformance/nonexistent_tests.txt -conformance/protoc_middleman -conformance/succeeding_tests.txt -conformance/Conformance/ -conformance/GPBMetadata/ -conformance/Google/ -conformance/Protobuf_test_messages/ -conformance/conformance-php -conformance/conformance-php-c -conformance/*.class - -# php test output -composer.lock -php/tests/generated/ -php/tests/old_protoc -php/tests/protobuf/ -php/ext/google/protobuf/.libs/ -php/ext/google/protobuf/Makefile.fragments -php/ext/google/protobuf/Makefile.global -php/ext/google/protobuf/Makefile.objects -php/ext/google/protobuf/acinclude.m4 -php/ext/google/protobuf/build/ -php/ext/google/protobuf/config.h -php/ext/google/protobuf/config.h.in~ -php/ext/google/protobuf/config.nice -php/ext/google/protobuf/configure.ac -php/ext/google/protobuf/configure.in -php/ext/google/protobuf/mkinstalldirs -php/ext/google/protobuf/run-tests.php -vendor/ - -# JavaScript artifacts -js/commonjs_out/ -js/compatibility_tests/v3.0.0/commonjs_out* -js/compatibility_tests/v3.0.0/protoc -js/compatibility_tests/v3.0.0/testproto_libs1.js -js/compatibility_tests/v3.0.0/testproto_libs1_new.js -js/compatibility_tests/v3.0.0/testproto_libs2.js -js/compatibility_tests/v3.0.0/testproto_libs2_new.js -js/deps.js -js/google-protobuf.js -js/google/ -js/node_modules/ -js/testproto_libs1.js -js/testproto_libs2.js - -# Ignore the bazel symlinks -/bazel-* - -# ruby test output -ruby/lib/ -ruby/tests/basic_test_pb.rb -ruby/tests/basic_test_proto2_pb.rb -ruby/tests/generated_code_pb.rb -ruby/tests/test_import_pb.rb -ruby/tests/test_ruby_package_pb.rb -ruby/tests/generated_code_proto2_pb.rb -ruby/tests/test_import_proto2_pb.rb -ruby/tests/test_ruby_package_proto2_pb.rb -ruby/Gemfile.lock -ruby/compatibility_tests/v3.0.0/protoc -ruby/compatibility_tests/v3.0.0/tests/generated_code_pb.rb -ruby/compatibility_tests/v3.0.0/tests/test_import_pb.rb - -# IntelliJ CLion Config files and build output -cmake/.idea -cmake/cmake-build-debug/ - -# Common build subdirectories. -./.build/ -./_build/ - -# Visual Studio 2017 -.vs - -# IntelliJ -.idea -*.iml diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index bcd125a49582a1d007ec37ad9f11befadd428e73..0000000000000000000000000000000000000000 --- a/.gitmodules +++ /dev/null @@ -1,7 +0,0 @@ -[submodule "third_party/benchmark"] - path = third_party/benchmark - url = https://github.com/google/benchmark.git -[submodule "third_party/googletest"] - path = third_party/googletest - url = https://github.com/google/googletest.git - ignore = dirty diff --git a/BUILD b/BUILD new file mode 100644 index 0000000000000000000000000000000000000000..1124321602b509b1cec561a06d75064c61fd8ed0 --- /dev/null +++ b/BUILD @@ -0,0 +1,1138 @@ +# Bazel (https://bazel.build/) BUILD file for Protobuf. + +load("@bazel_skylib//rules:common_settings.bzl", "string_flag") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") +load("@rules_python//python:defs.bzl", "py_library") +load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test") + +licenses(["notice"]) + +exports_files(["LICENSE"]) + +################################################################################ +# build configuration +################################################################################ + +# TODO(yannic): Remove in 3.14.0. +string_flag( + name = "incompatible_use_com_google_googletest", + build_setting_default = "true", + values = ["true", "false"] +) + +config_setting( + name = "use_com_google_googletest", + flag_values = { + "//:incompatible_use_com_google_googletest": "true" + }, +) + +GTEST = select({ + "//:use_com_google_googletest": [ + "@com_google_googletest//:gtest", + ], + "//conditions:default": [ + "//external:gtest", + ], +}) + +GTEST_MAIN = select({ + "//:use_com_google_googletest": [ + "@com_google_googletest//:gtest_main", + ], + "//conditions:default": [ + "//external:gtest_main", + ], +}) + +################################################################################ +# ZLIB configuration +################################################################################ + +ZLIB_DEPS = ["@zlib//:zlib"] + +################################################################################ +# Protobuf Runtime Library +################################################################################ + +MSVC_COPTS = [ + "/DHAVE_PTHREAD", + "/wd4018", # -Wno-sign-compare + "/wd4065", # switch statement contains 'default' but no 'case' labels + "/wd4146", # unary minus operator applied to unsigned type, result still unsigned + "/wd4244", # 'conversion' conversion from 'type1' to 'type2', possible loss of data + "/wd4251", # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' + "/wd4267", # 'var' : conversion from 'size_t' to 'type', possible loss of data + "/wd4305", # 'identifier' : truncation from 'type1' to 'type2' + "/wd4307", # 'operator' : integral constant overflow + "/wd4309", # 'conversion' : truncation of constant value + "/wd4334", # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) + "/wd4355", # 'this' : used in base member initializer list + "/wd4506", # no definition for inline function 'function' + "/wd4514", # -Wno-unused-function + "/wd4800", # 'type' : forcing value to bool 'true' or 'false' (performance warning) + "/wd4996", # The compiler encountered a deprecated declaration. +] + +COPTS = select({ + ":msvc": MSVC_COPTS, + "//conditions:default": [ + "-DHAVE_PTHREAD", + "-DHAVE_ZLIB", + "-Woverloaded-virtual", + "-Wno-sign-compare", + "-Wno-unused-function", + # Prevents ISO C++ const string assignment warnings for pyext sources. + "-Wno-write-strings", + "-Wno-deprecated-declarations", + ], +}) + +load(":compiler_config_setting.bzl", "create_compiler_config_setting") + +create_compiler_config_setting( + name = "msvc", + value = "msvc-cl", + visibility = [ + # Public, but Protobuf only visibility. + "//:__subpackages__", + ], +) + +config_setting( + name = "android", + values = { + "crosstool_top": "//external:android/crosstool", + }, + visibility = [ + # Public, but Protobuf only visibility. + "//:__subpackages__", + ], +) + +config_setting( + name = "android-libcpp", + values = { + "crosstool_top": "@androidndk//:toolchain-libcpp", + }, + visibility = [ + # Public, but Protobuf only visibility. + "//:__subpackages__", + ], +) + +config_setting( + name = "android-gnu-libstdcpp", + values = { + "crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp", + }, + visibility = [ + # Public, but Protobuf only visibility. + "//:__subpackages__", + ], +) + +# Android and MSVC builds do not need to link in a separate pthread library. +LINK_OPTS = select({ + ":android": [], + ":android-libcpp": [], + ":android-gnu-libstdcpp": [], + ":msvc": [ + # Suppress linker warnings about files with no symbols defined. + "-ignore:4221", + ], + "//conditions:default": [ + "-lpthread", + "-lm", + ], +}) + +load( + ":protobuf.bzl", + "adapt_proto_library", + "cc_proto_library", + "internal_copied_filegroup", + "internal_gen_well_known_protos_java", + "internal_protobuf_py_tests", + "py_proto_library", +) + +cc_library( + name = "protobuf_lite", + srcs = [ + # AUTOGEN(protobuf_lite_srcs) + "src/google/protobuf/any_lite.cc", + "src/google/protobuf/arena.cc", + "src/google/protobuf/arenastring.cc", + "src/google/protobuf/extension_set.cc", + "src/google/protobuf/generated_enum_util.cc", + "src/google/protobuf/generated_message_table_driven_lite.cc", + "src/google/protobuf/generated_message_util.cc", + "src/google/protobuf/implicit_weak_message.cc", + "src/google/protobuf/io/coded_stream.cc", + "src/google/protobuf/io/io_win32.cc", + "src/google/protobuf/io/strtod.cc", + "src/google/protobuf/io/zero_copy_stream.cc", + "src/google/protobuf/io/zero_copy_stream_impl.cc", + "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", + "src/google/protobuf/map.cc", + "src/google/protobuf/message_lite.cc", + "src/google/protobuf/parse_context.cc", + "src/google/protobuf/repeated_field.cc", + "src/google/protobuf/stubs/bytestream.cc", + "src/google/protobuf/stubs/common.cc", + "src/google/protobuf/stubs/int128.cc", + "src/google/protobuf/stubs/status.cc", + "src/google/protobuf/stubs/statusor.cc", + "src/google/protobuf/stubs/stringpiece.cc", + "src/google/protobuf/stubs/stringprintf.cc", + "src/google/protobuf/stubs/structurally_valid.cc", + "src/google/protobuf/stubs/strutil.cc", + "src/google/protobuf/stubs/time.cc", + "src/google/protobuf/wire_format_lite.cc", + ], + hdrs = glob([ + "src/google/protobuf/**/*.h", + "src/google/protobuf/**/*.inc", + ]), + copts = COPTS, + includes = ["src/"], + linkopts = LINK_OPTS, + visibility = ["//visibility:public"], +) + +PROTOBUF_DEPS = select({ + ":msvc": [], + "//conditions:default": ZLIB_DEPS, +}) + +cc_library( + name = "protobuf", + srcs = [ + # AUTOGEN(protobuf_srcs) + "src/google/protobuf/any.cc", + "src/google/protobuf/any.pb.cc", + "src/google/protobuf/api.pb.cc", + "src/google/protobuf/compiler/importer.cc", + "src/google/protobuf/compiler/parser.cc", + "src/google/protobuf/descriptor.cc", + "src/google/protobuf/descriptor.pb.cc", + "src/google/protobuf/descriptor_database.cc", + "src/google/protobuf/duration.pb.cc", + "src/google/protobuf/dynamic_message.cc", + "src/google/protobuf/empty.pb.cc", + "src/google/protobuf/extension_set_heavy.cc", + "src/google/protobuf/field_mask.pb.cc", + "src/google/protobuf/generated_message_reflection.cc", + "src/google/protobuf/generated_message_table_driven.cc", + "src/google/protobuf/io/gzip_stream.cc", + "src/google/protobuf/io/printer.cc", + "src/google/protobuf/io/tokenizer.cc", + "src/google/protobuf/map_field.cc", + "src/google/protobuf/message.cc", + "src/google/protobuf/reflection_ops.cc", + "src/google/protobuf/service.cc", + "src/google/protobuf/source_context.pb.cc", + "src/google/protobuf/struct.pb.cc", + "src/google/protobuf/stubs/substitute.cc", + "src/google/protobuf/text_format.cc", + "src/google/protobuf/timestamp.pb.cc", + "src/google/protobuf/type.pb.cc", + "src/google/protobuf/unknown_field_set.cc", + "src/google/protobuf/util/delimited_message_util.cc", + "src/google/protobuf/util/field_comparator.cc", + "src/google/protobuf/util/field_mask_util.cc", + "src/google/protobuf/util/internal/datapiece.cc", + "src/google/protobuf/util/internal/default_value_objectwriter.cc", + "src/google/protobuf/util/internal/error_listener.cc", + "src/google/protobuf/util/internal/field_mask_utility.cc", + "src/google/protobuf/util/internal/json_escaping.cc", + "src/google/protobuf/util/internal/json_objectwriter.cc", + "src/google/protobuf/util/internal/json_stream_parser.cc", + "src/google/protobuf/util/internal/object_writer.cc", + "src/google/protobuf/util/internal/proto_writer.cc", + "src/google/protobuf/util/internal/protostream_objectsource.cc", + "src/google/protobuf/util/internal/protostream_objectwriter.cc", + "src/google/protobuf/util/internal/type_info.cc", + "src/google/protobuf/util/internal/type_info_test_helper.cc", + "src/google/protobuf/util/internal/utility.cc", + "src/google/protobuf/util/json_util.cc", + "src/google/protobuf/util/message_differencer.cc", + "src/google/protobuf/util/time_util.cc", + "src/google/protobuf/util/type_resolver_util.cc", + "src/google/protobuf/wire_format.cc", + "src/google/protobuf/wrappers.pb.cc", + ], + hdrs = glob([ + "src/**/*.h", + "src/**/*.inc", + ]), + copts = COPTS, + includes = ["src/"], + linkopts = LINK_OPTS, + visibility = ["//visibility:public"], + deps = [":protobuf_lite"] + PROTOBUF_DEPS, +) + +# This provides just the header files for use in projects that need to build +# shared libraries for dynamic loading. This target is available until Bazel +# adds native support for such use cases. +# TODO(keveman): Remove this target once the support gets added to Bazel. +cc_library( + name = "protobuf_headers", + hdrs = glob([ + "src/**/*.h", + "src/**/*.inc", + ]), + includes = ["src/"], + visibility = ["//visibility:public"], +) + +# Map of all well known protos. +# name => (include path, imports) +WELL_KNOWN_PROTO_MAP = { + "any": ("src/google/protobuf/any.proto", []), + "api": ( + "src/google/protobuf/api.proto", + [ + "source_context", + "type", + ], + ), + "compiler_plugin": ( + "src/google/protobuf/compiler/plugin.proto", + ["descriptor"], + ), + "descriptor": ("src/google/protobuf/descriptor.proto", []), + "duration": ("src/google/protobuf/duration.proto", []), + "empty": ("src/google/protobuf/empty.proto", []), + "field_mask": ("src/google/protobuf/field_mask.proto", []), + "source_context": ("src/google/protobuf/source_context.proto", []), + "struct": ("src/google/protobuf/struct.proto", []), + "timestamp": ("src/google/protobuf/timestamp.proto", []), + "type": ( + "src/google/protobuf/type.proto", + [ + "any", + "source_context", + ], + ), + "wrappers": ("src/google/protobuf/wrappers.proto", []), +} + +WELL_KNOWN_PROTOS = [value[0] for value in WELL_KNOWN_PROTO_MAP.values()] + +filegroup( + name = "well_known_protos", + srcs = WELL_KNOWN_PROTOS, + visibility = ["//visibility:public"], +) + +adapt_proto_library( + name = "cc_wkt_protos_genproto", + deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], + visibility = ["//visibility:public"], +) + +cc_library( + name = "cc_wkt_protos", + deprecation = "Only for backward compatibility. Do not use.", + visibility = ["//visibility:public"], +) + +################################################################################ +# Well Known Types Proto Library Rules +# +# These proto_library rules can be used with one of the language specific proto +# library rules i.e. java_proto_library: +# +# java_proto_library( +# name = "any_java_proto", +# deps = ["@com_google_protobuf//:any_proto], +# ) +################################################################################ + +[proto_library( + name = proto[0] + "_proto", + srcs = [proto[1][0]], + strip_import_prefix = "src", + visibility = ["//visibility:public"], + deps = [dep + "_proto" for dep in proto[1][1]], +) for proto in WELL_KNOWN_PROTO_MAP.items()] + +[native_cc_proto_library( + name = proto + "_cc_proto", + deps = [proto + "_proto"], + visibility = ["//visibility:private"], +) for proto in WELL_KNOWN_PROTO_MAP.keys()] + +cc_proto_blacklist_test( + name = "cc_proto_blacklist_test", + deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], + tags = [ + # Exclude this target from wildcard expansion (//...). Due to + # https://github.com/bazelbuild/bazel/issues/10590, this test has to + # be nominated using the `@com_google_protobuf//` prefix. We do that, + # e.g., in kokoro/linux/bazel/build.sh. + # See also https://github.com/protocolbuffers/protobuf/pull/7096. + "manual", + ], +) + +################################################################################ +# Protocol Buffers Compiler +################################################################################ + +cc_library( + name = "protoc_lib", + srcs = [ + # AUTOGEN(protoc_lib_srcs) + "src/google/protobuf/compiler/code_generator.cc", + "src/google/protobuf/compiler/command_line_interface.cc", + "src/google/protobuf/compiler/cpp/cpp_enum.cc", + "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", + "src/google/protobuf/compiler/cpp/cpp_extension.cc", + "src/google/protobuf/compiler/cpp/cpp_field.cc", + "src/google/protobuf/compiler/cpp/cpp_file.cc", + "src/google/protobuf/compiler/cpp/cpp_generator.cc", + "src/google/protobuf/compiler/cpp/cpp_helpers.cc", + "src/google/protobuf/compiler/cpp/cpp_map_field.cc", + "src/google/protobuf/compiler/cpp/cpp_message.cc", + "src/google/protobuf/compiler/cpp/cpp_message_field.cc", + "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc", + "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", + "src/google/protobuf/compiler/cpp/cpp_service.cc", + "src/google/protobuf/compiler/cpp/cpp_string_field.cc", + "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", + "src/google/protobuf/compiler/csharp/csharp_enum.cc", + "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", + "src/google/protobuf/compiler/csharp/csharp_field_base.cc", + "src/google/protobuf/compiler/csharp/csharp_generator.cc", + "src/google/protobuf/compiler/csharp/csharp_helpers.cc", + "src/google/protobuf/compiler/csharp/csharp_map_field.cc", + "src/google/protobuf/compiler/csharp/csharp_message.cc", + "src/google/protobuf/compiler/csharp/csharp_message_field.cc", + "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", + "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", + "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", + "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", + "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", + "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", + "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", + "src/google/protobuf/compiler/java/java_context.cc", + "src/google/protobuf/compiler/java/java_doc_comment.cc", + "src/google/protobuf/compiler/java/java_enum.cc", + "src/google/protobuf/compiler/java/java_enum_field.cc", + "src/google/protobuf/compiler/java/java_enum_field_lite.cc", + "src/google/protobuf/compiler/java/java_enum_lite.cc", + "src/google/protobuf/compiler/java/java_extension.cc", + "src/google/protobuf/compiler/java/java_extension_lite.cc", + "src/google/protobuf/compiler/java/java_field.cc", + "src/google/protobuf/compiler/java/java_file.cc", + "src/google/protobuf/compiler/java/java_generator.cc", + "src/google/protobuf/compiler/java/java_generator_factory.cc", + "src/google/protobuf/compiler/java/java_helpers.cc", + "src/google/protobuf/compiler/java/java_map_field.cc", + "src/google/protobuf/compiler/java/java_map_field_lite.cc", + "src/google/protobuf/compiler/java/java_message.cc", + "src/google/protobuf/compiler/java/java_message_builder.cc", + "src/google/protobuf/compiler/java/java_message_builder_lite.cc", + "src/google/protobuf/compiler/java/java_message_field.cc", + "src/google/protobuf/compiler/java/java_message_field_lite.cc", + "src/google/protobuf/compiler/java/java_message_lite.cc", + "src/google/protobuf/compiler/java/java_name_resolver.cc", + "src/google/protobuf/compiler/java/java_primitive_field.cc", + "src/google/protobuf/compiler/java/java_primitive_field_lite.cc", + "src/google/protobuf/compiler/java/java_service.cc", + "src/google/protobuf/compiler/java/java_shared_code_generator.cc", + "src/google/protobuf/compiler/java/java_string_field.cc", + "src/google/protobuf/compiler/java/java_string_field_lite.cc", + "src/google/protobuf/compiler/js/js_generator.cc", + "src/google/protobuf/compiler/js/well_known_types_embed.cc", + "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", + "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", + "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", + "src/google/protobuf/compiler/objectivec/objectivec_field.cc", + "src/google/protobuf/compiler/objectivec/objectivec_file.cc", + "src/google/protobuf/compiler/objectivec/objectivec_generator.cc", + "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", + "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", + "src/google/protobuf/compiler/objectivec/objectivec_message.cc", + "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", + "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", + "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", + "src/google/protobuf/compiler/php/php_generator.cc", + "src/google/protobuf/compiler/plugin.cc", + "src/google/protobuf/compiler/plugin.pb.cc", + "src/google/protobuf/compiler/python/python_generator.cc", + "src/google/protobuf/compiler/ruby/ruby_generator.cc", + "src/google/protobuf/compiler/subprocess.cc", + "src/google/protobuf/compiler/zip_writer.cc", + ], + copts = COPTS, + includes = ["src/"], + linkopts = LINK_OPTS, + visibility = ["//visibility:public"], + deps = [":protobuf"], +) + +cc_binary( + name = "protoc", + srcs = ["src/google/protobuf/compiler/main.cc"], + linkopts = LINK_OPTS, + visibility = ["//visibility:public"], + deps = [":protoc_lib"], +) + +################################################################################ +# Tests +################################################################################ + +RELATIVE_LITE_TEST_PROTOS = [ + # AUTOGEN(lite_test_protos) + "google/protobuf/map_lite_unittest.proto", + "google/protobuf/unittest_import_lite.proto", + "google/protobuf/unittest_import_public_lite.proto", + "google/protobuf/unittest_lite.proto", +] + +LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS] + +RELATIVE_TEST_PROTOS = [ + # AUTOGEN(test_protos) + "google/protobuf/any_test.proto", + "google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto", + "google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto", + "google/protobuf/map_proto2_unittest.proto", + "google/protobuf/map_unittest.proto", + "google/protobuf/unittest.proto", + "google/protobuf/unittest_arena.proto", + "google/protobuf/unittest_custom_options.proto", + "google/protobuf/unittest_drop_unknown_fields.proto", + "google/protobuf/unittest_embed_optimize_for.proto", + "google/protobuf/unittest_empty.proto", + "google/protobuf/unittest_enormous_descriptor.proto", + "google/protobuf/unittest_import.proto", + "google/protobuf/unittest_import_public.proto", + "google/protobuf/unittest_lazy_dependencies.proto", + "google/protobuf/unittest_lazy_dependencies_custom_option.proto", + "google/protobuf/unittest_lazy_dependencies_enum.proto", + "google/protobuf/unittest_lite_imports_nonlite.proto", + "google/protobuf/unittest_mset.proto", + "google/protobuf/unittest_mset_wire_format.proto", + "google/protobuf/unittest_no_field_presence.proto", + "google/protobuf/unittest_no_generic_services.proto", + "google/protobuf/unittest_optimize_for.proto", + "google/protobuf/unittest_preserve_unknown_enum.proto", + "google/protobuf/unittest_preserve_unknown_enum2.proto", + "google/protobuf/unittest_proto3.proto", + "google/protobuf/unittest_proto3_arena.proto", + "google/protobuf/unittest_proto3_arena_lite.proto", + "google/protobuf/unittest_proto3_lite.proto", + "google/protobuf/unittest_proto3_optional.proto", + "google/protobuf/unittest_well_known_types.proto", + "google/protobuf/util/internal/testdata/anys.proto", + "google/protobuf/util/internal/testdata/books.proto", + "google/protobuf/util/internal/testdata/default_value.proto", + "google/protobuf/util/internal/testdata/default_value_test.proto", + "google/protobuf/util/internal/testdata/field_mask.proto", + "google/protobuf/util/internal/testdata/maps.proto", + "google/protobuf/util/internal/testdata/oneofs.proto", + "google/protobuf/util/internal/testdata/proto3.proto", + "google/protobuf/util/internal/testdata/struct.proto", + "google/protobuf/util/internal/testdata/timestamp_duration.proto", + "google/protobuf/util/internal/testdata/wrappers.proto", + "google/protobuf/util/json_format.proto", + "google/protobuf/util/json_format_proto3.proto", + "google/protobuf/util/message_differencer_unittest.proto", +] + +TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS] + +cc_proto_library( + name = "cc_test_protos", + srcs = LITE_TEST_PROTOS + TEST_PROTOS, + include = "src", + default_runtime = ":protobuf", + protoc = ":protoc", + deps = [":cc_wkt_protos"], +) + +COMMON_TEST_SRCS = [ + # AUTOGEN(common_test_srcs) + "src/google/protobuf/arena_test_util.cc", + "src/google/protobuf/map_test_util.inc", + "src/google/protobuf/test_util.cc", + "src/google/protobuf/test_util.inc", + "src/google/protobuf/testing/file.cc", + "src/google/protobuf/testing/googletest.cc", +] + +cc_binary( + name = "test_plugin", + srcs = [ + # AUTOGEN(test_plugin_srcs) + "src/google/protobuf/compiler/mock_code_generator.cc", + "src/google/protobuf/compiler/test_plugin.cc", + "src/google/protobuf/testing/file.cc", + ], + deps = [ + ":protobuf", + ":protoc_lib", + ] + GTEST, +) + +cc_test( + name = "win32_test", + srcs = ["src/google/protobuf/io/io_win32_unittest.cc"], + tags = [ + "manual", + "windows", + ], + deps = [ + ":protobuf_lite", + ] + GTEST_MAIN, +) + +cc_test( + name = "protobuf_test", + srcs = COMMON_TEST_SRCS + [ + # AUTOGEN(test_srcs) + "src/google/protobuf/any_test.cc", + "src/google/protobuf/arena_unittest.cc", + "src/google/protobuf/arenastring_unittest.cc", + "src/google/protobuf/compiler/annotation_test_util.cc", + "src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc", + "src/google/protobuf/compiler/cpp/cpp_move_unittest.cc", + "src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc", + "src/google/protobuf/compiler/cpp/cpp_unittest.cc", + "src/google/protobuf/compiler/cpp/cpp_unittest.inc", + "src/google/protobuf/compiler/cpp/metadata_test.cc", + "src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc", + "src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc", + "src/google/protobuf/compiler/importer_unittest.cc", + "src/google/protobuf/compiler/java/java_doc_comment_unittest.cc", + "src/google/protobuf/compiler/java/java_plugin_unittest.cc", + "src/google/protobuf/compiler/mock_code_generator.cc", + "src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc", + "src/google/protobuf/compiler/parser_unittest.cc", + "src/google/protobuf/compiler/python/python_plugin_unittest.cc", + "src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc", + "src/google/protobuf/descriptor_database_unittest.cc", + "src/google/protobuf/descriptor_unittest.cc", + "src/google/protobuf/drop_unknown_fields_test.cc", + "src/google/protobuf/dynamic_message_unittest.cc", + "src/google/protobuf/extension_set_unittest.cc", + "src/google/protobuf/generated_message_reflection_unittest.cc", + "src/google/protobuf/io/coded_stream_unittest.cc", + "src/google/protobuf/io/io_win32_unittest.cc", + "src/google/protobuf/io/printer_unittest.cc", + "src/google/protobuf/io/tokenizer_unittest.cc", + "src/google/protobuf/io/zero_copy_stream_unittest.cc", + "src/google/protobuf/map_field_test.cc", + "src/google/protobuf/map_test.cc", + "src/google/protobuf/message_unittest.cc", + "src/google/protobuf/message_unittest.inc", + "src/google/protobuf/no_field_presence_test.cc", + "src/google/protobuf/preserve_unknown_enum_test.cc", + "src/google/protobuf/proto3_arena_lite_unittest.cc", + "src/google/protobuf/proto3_arena_unittest.cc", + "src/google/protobuf/proto3_lite_unittest.cc", + "src/google/protobuf/proto3_lite_unittest.inc", + "src/google/protobuf/reflection_ops_unittest.cc", + "src/google/protobuf/repeated_field_reflection_unittest.cc", + "src/google/protobuf/repeated_field_unittest.cc", + "src/google/protobuf/stubs/bytestream_unittest.cc", + "src/google/protobuf/stubs/common_unittest.cc", + "src/google/protobuf/stubs/int128_unittest.cc", + "src/google/protobuf/stubs/status_test.cc", + "src/google/protobuf/stubs/statusor_test.cc", + "src/google/protobuf/stubs/stringpiece_unittest.cc", + "src/google/protobuf/stubs/stringprintf_unittest.cc", + "src/google/protobuf/stubs/structurally_valid_unittest.cc", + "src/google/protobuf/stubs/strutil_unittest.cc", + "src/google/protobuf/stubs/template_util_unittest.cc", + "src/google/protobuf/stubs/time_test.cc", + "src/google/protobuf/text_format_unittest.cc", + "src/google/protobuf/unknown_field_set_unittest.cc", + "src/google/protobuf/util/delimited_message_util_test.cc", + "src/google/protobuf/util/field_comparator_test.cc", + "src/google/protobuf/util/field_mask_util_test.cc", + "src/google/protobuf/util/internal/default_value_objectwriter_test.cc", + "src/google/protobuf/util/internal/json_objectwriter_test.cc", + "src/google/protobuf/util/internal/json_stream_parser_test.cc", + "src/google/protobuf/util/internal/protostream_objectsource_test.cc", + "src/google/protobuf/util/internal/protostream_objectwriter_test.cc", + "src/google/protobuf/util/internal/type_info_test_helper.cc", + "src/google/protobuf/util/json_util_test.cc", + "src/google/protobuf/util/message_differencer_unittest.cc", + "src/google/protobuf/util/time_util_test.cc", + "src/google/protobuf/util/type_resolver_util_test.cc", + "src/google/protobuf/well_known_types_unittest.cc", + "src/google/protobuf/wire_format_unittest.cc", + ] + select({ + "//conditions:default": [ + # AUTOGEN(non_msvc_test_srcs) + "src/google/protobuf/compiler/command_line_interface_unittest.cc", + ], + ":msvc": [], + }), + copts = COPTS, + data = [ + ":test_plugin", + ] + glob([ + "src/google/protobuf/**/*", + # Files for csharp_bootstrap_unittest.cc. + "conformance/**/*", + "csharp/src/**/*", + ]), + includes = [ + "src/", + ], + linkopts = LINK_OPTS, + deps = [ + ":cc_test_protos", + ":protobuf", + ":protoc_lib", + ] + PROTOBUF_DEPS + GTEST_MAIN, +) + +################################################################################ +# Java support +################################################################################ + +internal_gen_well_known_protos_java( + name = "gen_well_known_protos_java", + deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], + visibility = [ + "//java:__subpackages__", + ], +) + +alias( + name = "protobuf_java", + actual = "//java/core", + visibility = ["//visibility:public"], +) + +alias( + name = "protobuf_javalite", + actual = "//java/lite", + visibility = ["//visibility:public"], +) + +alias( + name = "protobuf_java_util", + actual = "//java/util", + visibility = ["//visibility:public"], +) + +alias( + name = "java_toolchain", + actual = "//java/core:toolchain", + visibility = ["//visibility:public"], +) + +alias( + name = "javalite_toolchain", + actual = "//java/lite:toolchain", + visibility = ["//visibility:public"], +) + +################################################################################ +# Python support +################################################################################ + +py_library( + name = "python_srcs", + srcs = glob( + [ + "python/google/protobuf/**/*.py", + ], + exclude = [ + "python/google/protobuf/internal/*_test.py", + "python/google/protobuf/internal/test_util.py", + ], + ), + imports = ["python"], + srcs_version = "PY2AND3", +) + +cc_binary( + name = "python/google/protobuf/internal/_api_implementation.so", + srcs = ["python/google/protobuf/internal/api_implementation.cc"], + copts = COPTS + [ + "-DPYTHON_PROTO2_CPP_IMPL_V2", + ], + tags = [ + # Exclude this target from wildcard expansion (//...) because it may + # not even be buildable. It will be built if it is needed according + # to :use_fast_cpp_protos. + # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes + "manual", + ], + linkshared = 1, + linkstatic = 1, + deps = select({ + "//conditions:default": [], + ":use_fast_cpp_protos": ["//external:python_headers"], + }), +) + +cc_binary( + name = "python/google/protobuf/pyext/_message.so", + srcs = glob([ + "python/google/protobuf/pyext/*.cc", + "python/google/protobuf/pyext/*.h", + ]), + copts = COPTS + [ + "-DGOOGLE_PROTOBUF_HAS_ONEOF=1", + ] + select({ + "//conditions:default": [], + ":allow_oversize_protos": ["-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1"], + }), + includes = [ + "python/", + "src/", + ], + tags = [ + # Exclude this target from wildcard expansion (//...) because it may + # not even be buildable. It will be built if it is needed according + # to :use_fast_cpp_protos. + # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes + "manual", + ], + linkshared = 1, + linkstatic = 1, + deps = [ + ":protobuf", + ":proto_api", + ] + select({ + "//conditions:default": [], + ":use_fast_cpp_protos": ["//external:python_headers"], + }), +) + +config_setting( + name = "use_fast_cpp_protos", + values = { + "define": "use_fast_cpp_protos=true", + }, + visibility = [ + # Public, but Protobuf only visibility. + "//:__subpackages__", + ], +) + +config_setting( + name = "allow_oversize_protos", + values = { + "define": "allow_oversize_protos=true", + }, + visibility = [ + # Public, but Protobuf only visibility. + "//:__subpackages__", + ], +) + +# Copy the builtin proto files from src/google/protobuf to +# python/google/protobuf. This way, the generated Python sources will be in the +# same directory as the Python runtime sources. This is necessary for the +# modules to be imported correctly since they are all part of the same Python +# package. +internal_copied_filegroup( + name = "protos_python", + srcs = WELL_KNOWN_PROTOS, + dest = "python", + strip_prefix = "src", +) + +# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in +# which case we can simply add :protos_python in srcs. +COPIED_WELL_KNOWN_PROTOS = ["python/" + s[4:] for s in WELL_KNOWN_PROTOS] + +py_proto_library( + name = "protobuf_python", + srcs = COPIED_WELL_KNOWN_PROTOS, + include = "python", + data = select({ + "//conditions:default": [], + ":use_fast_cpp_protos": [ + ":python/google/protobuf/internal/_api_implementation.so", + ":python/google/protobuf/pyext/_message.so", + ], + }), + default_runtime = "", + protoc = ":protoc", + py_libs = [ + ":python_srcs", + "@six//:six", + ], + srcs_version = "PY2AND3", + visibility = ["//visibility:public"], +) + +# Copy the test proto files from src/google/protobuf to +# python/google/protobuf. This way, the generated Python sources will be in the +# same directory as the Python runtime sources. This is necessary for the +# modules to be imported correctly by the tests since they are all part of the +# same Python package. +internal_copied_filegroup( + name = "protos_python_test", + srcs = LITE_TEST_PROTOS + TEST_PROTOS, + dest = "python", + strip_prefix = "src", +) + +# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in +# which case we can simply add :protos_python_test in srcs. +COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS] + +COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS] + +py_proto_library( + name = "python_common_test_protos", + srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS, + include = "python", + default_runtime = "", + protoc = ":protoc", + srcs_version = "PY2AND3", + deps = [":protobuf_python"], +) + +py_proto_library( + name = "python_specific_test_protos", + srcs = glob([ + "python/google/protobuf/internal/*.proto", + "python/google/protobuf/internal/import_test_package/*.proto", + ]), + include = "python", + default_runtime = ":protobuf_python", + protoc = ":protoc", + srcs_version = "PY2AND3", + deps = [":python_common_test_protos"], +) + +py_library( + name = "python_tests", + srcs = glob( + [ + "python/google/protobuf/internal/*_test.py", + "python/google/protobuf/internal/test_util.py", + "python/google/protobuf/internal/import_test_package/__init__.py", + ], + ), + imports = ["python"], + srcs_version = "PY2AND3", + deps = [ + ":protobuf_python", + ":python_common_test_protos", + ":python_specific_test_protos", + ], +) + +internal_protobuf_py_tests( + name = "python_tests_batch", + data = glob([ + "src/google/protobuf/**/*", + ]), + modules = [ + "descriptor_database_test", + "descriptor_pool_test", + "descriptor_test", + "generator_test", + "json_format_test", + "message_factory_test", + "message_test", + "proto_builder_test", + "reflection_test", + "service_reflection_test", + "symbol_database_test", + "text_encoding_test", + "text_format_test", + "unknown_fields_test", + "wire_format_test", + ], + deps = [":python_tests"], +) + +cc_library( + name = "proto_api", + hdrs = ["python/google/protobuf/proto_api.h"], + visibility = ["//visibility:public"], + deps = [ + "//external:python_headers", + ], +) + +proto_lang_toolchain( + name = "cc_toolchain", + blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], + command_line = "--cpp_out=$(OUT)", + runtime = ":protobuf", + visibility = ["//visibility:public"], +) + +alias( + name = "objectivec", + actual = "//objectivec", + visibility = ["//visibility:public"], +) + +alias( + name = "protobuf_objc", + actual = "//objectivec", + visibility = ["//visibility:public"], +) + +################################################################################ +# Test generated proto support +################################################################################ + +genrule( + name = "generated_protos", + srcs = ["src/google/protobuf/unittest_import.proto"], + outs = ["unittest_gen.proto"], + cmd = "cat $(SRCS) | sed 's|google/|src/google/|' > $(OUTS)", +) + +proto_library( + name = "generated_protos_proto", + srcs = [ + "src/google/protobuf/unittest_import_public.proto", + "unittest_gen.proto", + ], +) + +py_proto_library( + name = "generated_protos_py", + srcs = [ + "src/google/protobuf/unittest_import_public.proto", + "unittest_gen.proto", + ], + default_runtime = "", + protoc = ":protoc", +) + +################################################################################ +# Conformance tests +################################################################################ + +proto_library( + name = "test_messages_proto2_proto", + srcs = ["src/google/protobuf/test_messages_proto2.proto"], + visibility = ["//visibility:public"], +) + +proto_library( + name = "test_messages_proto3_proto", + srcs = ["src/google/protobuf/test_messages_proto3.proto"], + visibility = ["//visibility:public"], + deps = [ + ":any_proto", + ":duration_proto", + ":field_mask_proto", + ":struct_proto", + ":timestamp_proto", + ":wrappers_proto", + ], +) + +cc_proto_library( + name = "test_messages_proto2_proto_cc", + srcs = ["src/google/protobuf/test_messages_proto2.proto"], +) + +cc_proto_library( + name = "test_messages_proto3_proto_cc", + srcs = ["src/google/protobuf/test_messages_proto3.proto"], + deps = [ + ":cc_wkt_protos", + ], +) + +proto_library( + name = "conformance_proto", + srcs = ["conformance/conformance.proto"], + visibility = ["//visibility:public"], +) + +cc_proto_library( + name = "conformance_proto_cc", + srcs = ["conformance/conformance.proto"], +) + +cc_library( + name = "jsoncpp", + srcs = ["conformance/third_party/jsoncpp/jsoncpp.cpp"], + hdrs = ["conformance/third_party/jsoncpp/json.h"], + includes = ["conformance"], +) + +cc_library( + name = "conformance_test", + srcs = [ + "conformance/conformance_test.cc", + "conformance/conformance_test_runner.cc", + ], + hdrs = [ + "conformance/conformance_test.h", + ], + includes = [ + "conformance", + "src", + ], + deps = [":conformance_proto_cc"], +) + +cc_library( + name = "binary_json_conformance_suite", + srcs = ["conformance/binary_json_conformance_suite.cc"], + hdrs = ["conformance/binary_json_conformance_suite.h"], + deps = [ + ":conformance_test", + ":jsoncpp", + ":test_messages_proto2_proto_cc", + ":test_messages_proto3_proto_cc", + ], +) + +cc_library( + name = "text_format_conformance_suite", + srcs = ["conformance/text_format_conformance_suite.cc"], + hdrs = ["conformance/text_format_conformance_suite.h"], + deps = [ + ":conformance_test", + ":test_messages_proto2_proto_cc", + ":test_messages_proto3_proto_cc", + ], +) + +cc_binary( + name = "conformance_test_runner", + srcs = ["conformance/conformance_test_main.cc"], + visibility = ["//visibility:public"], + deps = [ + ":binary_json_conformance_suite", + ":conformance_test", + ":text_format_conformance_suite", + ], +) + +sh_test( + name = "build_files_updated_unittest", + srcs = [ + "build_files_updated_unittest.sh", + ], + data = [ + "BUILD", + "cmake/extract_includes.bat.in", + "cmake/libprotobuf.cmake", + "cmake/libprotobuf-lite.cmake", + "cmake/libprotoc.cmake", + "cmake/tests.cmake", + "src/Makefile.am", + "update_file_lists.sh", + ], +) diff --git a/BUILD.gn b/BUILD.gn index a94abf75583a821067ab6b4fb353eb6d5be0a32c..ff911d277eb893dfaa4b3611e5802907748ba156 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -25,6 +25,7 @@ ohos_shared_library("protobuf_lite") { sources = [ "src/google/protobuf/any_lite.cc", "src/google/protobuf/arena.cc", + "src/google/protobuf/arenastring.cc", "src/google/protobuf/extension_set.cc", "src/google/protobuf/generated_enum_util.cc", "src/google/protobuf/generated_message_table_driven_lite.cc", @@ -36,6 +37,7 @@ ohos_shared_library("protobuf_lite") { "src/google/protobuf/io/zero_copy_stream.cc", "src/google/protobuf/io/zero_copy_stream_impl.cc", "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", + "src/google/protobuf/map.cc", "src/google/protobuf/message_lite.cc", "src/google/protobuf/parse_context.cc", "src/google/protobuf/repeated_field.cc", @@ -87,6 +89,7 @@ ohos_static_library("protobuf_lite_static") { sources = [ "src/google/protobuf/any_lite.cc", "src/google/protobuf/arena.cc", + "src/google/protobuf/arenastring.cc", "src/google/protobuf/extension_set.cc", "src/google/protobuf/generated_enum_util.cc", "src/google/protobuf/generated_message_table_driven_lite.cc", @@ -98,6 +101,7 @@ ohos_static_library("protobuf_lite_static") { "src/google/protobuf/io/zero_copy_stream.cc", "src/google/protobuf/io/zero_copy_stream_impl.cc", "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", + "src/google/protobuf/map.cc", "src/google/protobuf/message_lite.cc", "src/google/protobuf/parse_context.cc", "src/google/protobuf/repeated_field.cc", @@ -132,6 +136,9 @@ ohos_static_library("protobuf_lite_static") { "-Wno-sign-compare", "-Wno-deprecated-declarations", ] + if (host_os == "mac" && is_arkui_x) { + cflags_cc += [ "-faligned-allocation" ] + } cflags = [ "-Wno-deprecated-declarations", "-Wno-sign-compare", @@ -151,6 +158,7 @@ ohos_shared_library("protobuf") { "src/google/protobuf/any.cc", "src/google/protobuf/any.pb.cc", "src/google/protobuf/api.pb.cc", + "src/google/protobuf/arenastring.cc", "src/google/protobuf/compiler/importer.cc", "src/google/protobuf/compiler/parser.cc", "src/google/protobuf/descriptor.cc", @@ -166,6 +174,7 @@ ohos_shared_library("protobuf") { "src/google/protobuf/io/gzip_stream.cc", "src/google/protobuf/io/printer.cc", "src/google/protobuf/io/tokenizer.cc", + "src/google/protobuf/map.cc", "src/google/protobuf/map_field.cc", "src/google/protobuf/message.cc", "src/google/protobuf/reflection_ops.cc", @@ -232,6 +241,7 @@ ohos_static_library("protobuf_static") { "src/google/protobuf/any.cc", "src/google/protobuf/any.pb.cc", "src/google/protobuf/api.pb.cc", + "src/google/protobuf/arenastring.cc", "src/google/protobuf/compiler/importer.cc", "src/google/protobuf/compiler/parser.cc", "src/google/protobuf/descriptor.cc", @@ -247,6 +257,7 @@ ohos_static_library("protobuf_static") { "src/google/protobuf/io/gzip_stream.cc", "src/google/protobuf/io/printer.cc", "src/google/protobuf/io/tokenizer.cc", + "src/google/protobuf/map.cc", "src/google/protobuf/map_field.cc", "src/google/protobuf/message.cc", "src/google/protobuf/reflection_ops.cc", @@ -291,6 +302,9 @@ ohos_static_library("protobuf_static") { "-Wno-sign-compare", "-Wno-deprecated-declarations", ] + if (host_os == "mac" && is_arkui_x) { + cflags_cc += [ "-faligned-allocation" ] + } cflags = [ "-Wno-sign-compare", "-D HAVE_PTHREAD", @@ -306,6 +320,7 @@ ohos_static_library("protobuf_static") { ohos_shared_library("protoc_lib") { sources = [ + "src/google/protobuf/arenastring.cc", "src/google/protobuf/compiler/code_generator.cc", "src/google/protobuf/compiler/command_line_interface.cc", "src/google/protobuf/compiler/cpp/cpp_enum.cc", @@ -387,6 +402,7 @@ ohos_shared_library("protoc_lib") { "src/google/protobuf/compiler/ruby/ruby_generator.cc", "src/google/protobuf/compiler/subprocess.cc", "src/google/protobuf/compiler/zip_writer.cc", + "src/google/protobuf/map.cc", ] include_dirs = [ "src/google/protobuf/**/*.h", @@ -398,6 +414,7 @@ ohos_shared_library("protoc_lib") { "-Wno-unused-function", "-Wno-unused-private-field", "-Wno-deprecated-declarations", + "-Wno-inconsistent-missing-override", ] cflags = [ "-Wno-sign-compare", @@ -421,6 +438,7 @@ ohos_shared_library("protoc_lib") { ohos_static_library("protoc_static_lib") { sources = [ + "src/google/protobuf/arenastring.cc", "src/google/protobuf/compiler/code_generator.cc", "src/google/protobuf/compiler/command_line_interface.cc", "src/google/protobuf/compiler/cpp/cpp_enum.cc", @@ -502,6 +520,7 @@ ohos_static_library("protoc_static_lib") { "src/google/protobuf/compiler/ruby/ruby_generator.cc", "src/google/protobuf/compiler/subprocess.cc", "src/google/protobuf/compiler/zip_writer.cc", + "src/google/protobuf/map.cc", ] include_dirs = [ "src/google/protobuf/**/*.h", @@ -519,6 +538,7 @@ ohos_static_library("protoc_static_lib") { "-D HAVE_PTHREAD", "-Wno-unused-function", "-Wno-deprecated-declarations", + "-Wno-inconsistent-missing-override", ] deps = [ diff --git a/CHANGES.txt b/CHANGES.txt index 76910c4d0c3196062a1ffe0a7e5969821e08418a..da3e51bc534ddc935928059bef9515d84a830baa 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,85 @@ -2020-07-14 version 3.13.0-rc1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) +2020-11-11 version 3.14.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Protocol Compiler + * The proto compiler no longer requires a .proto filename when it is not + generating code. + * Added flag `--deterministic_output` to `protoc --encode=...`. + * Fixed deadlock when using google.protobuf.Any embedded in aggregate options. + + C++ + * Arenas are now unconditionally enabled. cc_enable_arenas no longer has + any effect. + * Removed inlined string support, which is incompatible with arenas. + * Fix a memory corruption bug in reflection when mixing optional and + non-optional fields. + * Make SpaceUsed() calculation more thorough for map fields. + * Add stack overflow protection for text format with unknown field values. + * FieldPath::FollowAll() now returns a bool to signal if an out-of-bounds + error was encountered. + * Performance improvements for Map. + * Minor formatting fix when dumping a descriptor to .proto format with + DebugString. + * UBSAN fix in RepeatedField (#2073). + * When running under ASAN, skip a test that makes huge allocations. + * Fixed a crash that could happen when creating more than 256 extensions in + a single message. + * Fix a crash in BuildFile when passing in invalid descriptor proto. + * Parser security fix when operating with CodedInputStream. + * Warn against the use of AllowUnknownExtension. + * Migrated to C++11 for-range loops instead of index-based loops where + possible. This fixes a lot of warnings when compiling with -Wsign-compare. + * Fix segment fault for proto3 optional (#7805) + * Adds a CMake option to build `libprotoc` separately (#7949) + + Java + * Bugfix in mergeFrom() when a oneof has multiple message fields. + * Fix RopeByteString.RopeInputStream.read() returning -1 when told to read + 0 bytes when not at EOF. + * Redefine remove(Object) on primitive repeated field Lists to avoid + autoboxing. + * Support "\u" escapes in textformat string literals. + * Trailing empty spaces are no longer ignored for FieldMask. + * Fix FieldMaskUtil.subtract to recursively remove mask. + * Mark enums with `@java.lang.Deprecated` if the proto enum has option + `deprecated = true;`. + * Adding forgotten duration.proto to the lite library (#7738) + + Python + * Print google.protobuf.NullValue as null instead of "NULL_VALUE" when it is + used outside WKT Value/Struct. + * Fix bug occurring when attempting to deep copy an enum type in python 3. + * Add a setuptools extension for generating Python protobufs (#7783) + * Remove uses of pkg_resources in non-namespace packages. (#7902) + * [bazel/py] Omit google/__init__.py from the Protobuf runtime. (#7908) + * Removed the unnecessary setuptools package dependency for Python package (#7511) + * Fix PyUnknownFields memory leak (#7928) + + PHP + * Added support for "==" to the PHP C extension (#7883) + * Added `==` operators for Map and Array. (#7900) + * Native C well-known types (#7944) + * Optimized away hex2bin() call in generated code (#8006) + * New version of upb, and a new hash function wyhash in third_party. (#8000) + * add missing hasOneof method to check presence of oneof fields (#8003) + + Go: + * Update go_package options to reference google.golang.org/protobuf module. + + C#: + * annotate ByteString.CopyFrom(ReadOnlySpan) as SecuritySafeCritical (#7701) + * Fix C# optional field reflection when there are regular fields too (#7705) + * Fix parsing negative Int32Value that crosses segment boundary (#8035) + + Javascript: + * JS: parse (un)packed fields conditionally (#7379) + +2020-07-14 version 3.13.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + PHP: + * The C extension is completely rewritten. The new C extension has significantly + better parsing performance and fixes a handful of conformance issues. It will + also make it easier to add support for more features like proto2 and proto3 presence. + * The new C extension does not support PHP 5.x. PHP 5.x users can still use pure-PHP. C++: * Removed deprecated unsafe arena string accessors @@ -51,6 +132,11 @@ performance (the legacy generated code will still work, but might incur a slight performance penalty). +2020-07-28 version 3.12.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + +This release contains no significant changes, but exists because 3.12.3 was +mistakenly tagged at the wrong commit. + 2020-06-01 version 3.12.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) Objective-C diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index db1ff31cac6c40aa7956ab974e8902148167a55b..0000000000000000000000000000000000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,98 +0,0 @@ -# Contributing to Protocol Buffers - -We welcome your contributions to protocol buffers. This doc describes the -process to contribute patches to protobuf and the general guidelines we -expect contributors to follow. - -## Before You Start - -We accept patches in the form of github pull requests. If you are new to -github, please read [How to create github pull requests](https://help.github.com/articles/about-pull-requests/) -first. - -### Contributor License Agreements - -Contributions to this project must be accompanied by a Contributor License -Agreement. You (or your employer) retain the copyright to your contribution, -this simply gives us permission to use and redistribute your contributions -as part of the project. - -* If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://cla.developers.google.com/about/google-individual?csw=1). -* If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://cla.developers.google.com/about/google-corporate?csw=1). - -### Coding Style - -This project follows [Google’s Coding Style Guides](https://github.com/google/styleguide). -Before sending out your pull request, please familiarize yourself with the -corresponding style guides and make sure the proposed code change is style -conforming. - -## Contributing Process - -Most pull requests should go to the master branch and the change will be -included in the next major/minor version release (e.g., 3.6.0 release). If you -need to include a bug fix in a patch release (e.g., 3.5.2), make sure it’s -already merged to master, and then create a pull request cherry-picking the -commits from master branch to the release branch (e.g., branch 3.5.x). - -For each pull request, a protobuf team member will be assigned to review the -pull request. For minor cleanups, the pull request may be merged right away -after an initial review. For larger changes, you will likely receive multiple -rounds of comments and it may take some time to complete. We will try to keep -our response time within 7-days but if you don’t get any response in a few -days, feel free to comment on the threads to get our attention. We also expect -you to respond to our comments within a reasonable amount of time. If we don’t -hear from you for 2 weeks or longer, we may close the pull request. You can -still send the pull request again once you have time to work on it. - -Once a pull request is merged, we will take care of the rest and get it into -the final release. - -## Pull Request Guidelines - -* If you are a Googler, it is preferable to first create an internal CL and - have it reviewed and submitted. The code propagation process will deliver the - change to GitHub. -* Create small PRs that are narrowly focused on addressing a single concern. - We often receive PRs that are trying to fix several things at a time, but if - only one fix is considered acceptable, nothing gets merged and both author's - & review's time is wasted. Create more PRs to address different concerns and - everyone will be happy. -* For speculative changes, consider opening an issue and discussing it first. - If you are suggesting a behavioral or API change, make sure you get explicit - support from a protobuf team member before sending us the pull request. -* Provide a good PR description as a record of what change is being made and - why it was made. Link to a GitHub issue if it exists. -* Don't fix code style and formatting unless you are already changing that - line to address an issue. PRs with irrelevant changes won't be merged. If - you do want to fix formatting or style, do that in a separate PR. -* Unless your PR is trivial, you should expect there will be reviewer comments - that you'll need to address before merging. We expect you to be reasonably - responsive to those comments, otherwise the PR will be closed after 2-3 weeks - of inactivity. -* Maintain clean commit history and use meaningful commit messages. PRs with - messy commit history are difficult to review and won't be merged. Use rebase - -i upstream/master to curate your commit history and/or to bring in latest - changes from master (but avoid rebasing in the middle of a code review). -* Keep your PR up to date with upstream/master (if there are merge conflicts, - we can't really merge your change). -* All tests need to be passing before your change can be merged. We recommend - you run tests locally before creating your PR to catch breakages early on. - Ultimately, the green signal will be provided by our testing infrastructure. - The reviewer will help you if there are test failures that seem not related - to the change you are making. - -## Reviewer Guidelines - -* Make sure that all tests are passing before approval. -* Apply the "release notes: yes" label if the pull request's description should - be included in the next release (e.g., any new feature / bug fix). - Apply the "release notes: no" label if the pull request's description should - not be included in the next release (e.g., refactoring changes that does not - change behavior, integration from Google internal, updating tests, etc.). -* Apply the appropriate language label (e.g., C++, Java, Python, etc.) to the - pull request. This will make it easier to identify which languages the pull - request affects, allowing us to better identify appropriate reviewer, create - a better release note, and make it easier to identify issues in the future. diff --git a/Makefile.am b/Makefile.am index ee8b73c6de6978ae365c60856985d3712517a007..908c2d2d8327b0178625978da674bf6fc9b4840c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -552,13 +552,14 @@ java_EXTRA_DIST= java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ - java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ + java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ java/util/src/test/java/com/google/protobuf/util/TimeUtilTest.java \ java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ java/util/src/test/proto/com/google/protobuf/util/json_test.proto objectivec_EXTRA_DIST= \ objectivec/.clang-format \ + objectivec/BUILD \ objectivec/DevTools/check_version_stamps.sh \ objectivec/DevTools/compile_testing_protos.sh \ objectivec/DevTools/full_mac_build.sh \ @@ -772,13 +773,11 @@ php_EXTRA_DIST= \ php/ext/google/protobuf/arena.h \ php/ext/google/protobuf/array.c \ php/ext/google/protobuf/array.h \ - php/ext/google/protobuf/bundled_php.h \ php/ext/google/protobuf/config.m4 \ php/ext/google/protobuf/convert.c \ php/ext/google/protobuf/convert.h \ php/ext/google/protobuf/def.c \ php/ext/google/protobuf/def.h \ - php/ext/google/protobuf/make-preload.php \ php/ext/google/protobuf/map.c \ php/ext/google/protobuf/map.h \ php/ext/google/protobuf/message.c \ @@ -790,8 +789,10 @@ php_EXTRA_DIST= \ php/ext/google/protobuf/php-upb.h \ php/ext/google/protobuf/protobuf.c \ php/ext/google/protobuf/protobuf.h \ + php/ext/google/protobuf/wkt.inc \ php/generate_descriptor_protos.sh \ php/phpunit.xml \ + php/prepare_c_extension.sh \ php/release.sh \ php/src/GPBMetadata/Google/Protobuf/Any.php \ php/src/GPBMetadata/Google/Protobuf/Api.php \ @@ -827,6 +828,7 @@ php_EXTRA_DIST= \ php/src/Google/Protobuf/GPBEmpty.php \ php/src/Google/Protobuf/Int32Value.php \ php/src/Google/Protobuf/Int64Value.php \ + php/src/Google/Protobuf/Internal/AnyBase.php \ php/src/Google/Protobuf/Internal/CodedInputStream.php \ php/src/Google/Protobuf/Internal/CodedOutputStream.php \ php/src/Google/Protobuf/Internal/Descriptor.php \ @@ -886,6 +888,7 @@ php_EXTRA_DIST= \ php/src/Google/Protobuf/Internal/ServiceOptions.php \ php/src/Google/Protobuf/Internal/SourceCodeInfo.php \ php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \ + php/src/Google/Protobuf/Internal/TimestampBase.php \ php/src/Google/Protobuf/Internal/UninterpretedOption.php \ php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \ php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \ @@ -1390,6 +1393,8 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ python/release/wheel/README.md \ third_party/six.BUILD \ third_party/zlib.BUILD \ + third_party/wyhash/LICENSE \ + third_party/wyhash/wyhash.h \ util/python/BUILD diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..c25378841b2e6a9f6b1dedbfd01a035d2b1fe4de --- /dev/null +++ b/Makefile.in @@ -0,0 +1,2337 @@ +# Makefile.in generated by automake 1.16.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_system_extensions.m4 \ + $(top_srcdir)/m4/acx_check_suncc.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_prog_cxx_for_build.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/stl_hash.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = protobuf.pc protobuf-lite.pc +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/protobuf-lite.pc.in $(srcdir)/protobuf.pc.in ar-lib \ + compile config.guess config.sub install-sh ltmain.sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXCPPFLAGS_FOR_BUILD = @CXXCPPFLAGS_FOR_BUILD@ +CXXCPP_FOR_BUILD = @CXXCPP_FOR_BUILD@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIST_LANG = @DIST_LANG@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +ISAINFO = @ISAINFO@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBATOMIC_LIBS = @LIBATOMIC_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POW_LIB = @POW_LIB@ +PROTOBUF_OPT_FLAG = @PROTOBUF_OPT_FLAG@ +PROTOC = @PROTOC@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_CXX_FOR_BUILD = @ac_ct_CXX_FOR_BUILD@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I m4 +AUTOMAKE_OPTIONS = foreign + +# Build . before src so that our all-local and clean-local hooks kicks in at +# the right time. +SUBDIRS = . src + +# Always include third_party directories in distributions. +DIST_SUBDIRS = src conformance benchmarks third_party/googletest +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = protobuf.pc protobuf-lite.pc +csharp_EXTRA_DIST = \ + global.json \ + csharp/.gitignore \ + csharp/CHANGES.txt \ + csharp/Google.Protobuf.Tools.targets \ + csharp/Google.Protobuf.Tools.nuspec \ + csharp/README.md \ + csharp/build_packages.bat \ + csharp/build_tools.sh \ + csharp/buildall.bat \ + csharp/buildall.sh \ + csharp/generate_protos.sh \ + csharp/install_dotnet_sdk.ps1 \ + csharp/keys/Google.Protobuf.public.snk \ + csharp/keys/Google.Protobuf.snk \ + csharp/keys/README.md \ + csharp/protos/README.md \ + csharp/protos/map_unittest_proto3.proto \ + csharp/protos/old_extensions1.proto \ + csharp/protos/old_extensions2.proto \ + csharp/protos/unittest_issue6936_a.proto \ + csharp/protos/unittest_issue6936_b.proto \ + csharp/protos/unittest_issue6936_c.proto \ + csharp/protos/unittest_custom_options_proto3.proto \ + csharp/protos/unittest_import_public_proto3.proto \ + csharp/protos/unittest_import_public.proto \ + csharp/protos/unittest_import_proto3.proto \ + csharp/protos/unittest_import.proto \ + csharp/protos/unittest_issues.proto \ + csharp/protos/unittest_proto3.proto \ + csharp/protos/unittest_selfreferential_options.proto \ + csharp/protos/unittest.proto \ + csharp/src/AddressBook/AddPerson.cs \ + csharp/src/AddressBook/Addressbook.cs \ + csharp/src/AddressBook/AddressBook.csproj \ + csharp/src/AddressBook/ListPeople.cs \ + csharp/src/AddressBook/Program.cs \ + csharp/src/AddressBook/SampleUsage.cs \ + csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \ + csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \ + csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \ + csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \ + csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs \ + csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs \ + csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \ + csharp/src/Google.Protobuf.Benchmarks/Program.cs \ + csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \ + csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \ + csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs \ + csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs \ + csharp/src/Google.Protobuf.Conformance/Conformance.cs \ + csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \ + csharp/src/Google.Protobuf.Conformance/Program.cs \ + csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj \ + csharp/src/Google.Protobuf.JsonDump/Program.cs \ + csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs \ + csharp/src/Google.Protobuf.Test/ByteStringTest.cs \ + csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs \ + csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs \ + csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs \ + csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs \ + csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs \ + csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs \ + csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs \ + csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs \ + csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs \ + csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs \ + csharp/src/Google.Protobuf.Test/EqualityTester.cs \ + csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs \ + csharp/src/Google.Protobuf.Test/FieldCodecTest.cs \ + csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs \ + csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs \ + csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs \ + csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj \ + csharp/src/Google.Protobuf.Test/IssuesTest.cs \ + csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \ + csharp/src/Google.Protobuf.Test/JsonParserTest.cs \ + csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \ + csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs \ + csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs \ + csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs \ + csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs \ + csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs \ + csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \ + csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \ + csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \ + csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs \ + csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs \ + csharp/src/Google.Protobuf.Test/SampleEnum.cs \ + csharp/src/Google.Protobuf.Test/SampleMessages.cs \ + csharp/src/Google.Protobuf.Test/SampleNaNs.cs \ + csharp/src/Google.Protobuf.Test/TestCornerCases.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions1.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions2.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \ + csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \ + csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs \ + csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs \ + csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs \ + csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs \ + csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs \ + csharp/src/Google.Protobuf.Test/testprotos.pb \ + csharp/src/Google.Protobuf.sln \ + csharp/src/Google.Protobuf/ByteArray.cs \ + csharp/src/Google.Protobuf/ByteString.cs \ + csharp/src/Google.Protobuf/CodedInputStream.cs \ + csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs \ + csharp/src/Google.Protobuf/CodedOutputStream.cs \ + csharp/src/Google.Protobuf/Collections/Lists.cs \ + csharp/src/Google.Protobuf/Collections/MapField.cs \ + csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs \ + csharp/src/Google.Protobuf/Collections/ReadOnlyDictionary.cs \ + csharp/src/Google.Protobuf/Collections/RepeatedField.cs \ + csharp/src/Google.Protobuf/Compatibility/MethodInfoExtensions.cs \ + csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs \ + csharp/src/Google.Protobuf/Compatibility/StreamExtensions.cs \ + csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs \ + csharp/src/Google.Protobuf/Extension.cs \ + csharp/src/Google.Protobuf/ExtensionRegistry.cs \ + csharp/src/Google.Protobuf/ExtensionSet.cs \ + csharp/src/Google.Protobuf/ExtensionValue.cs \ + csharp/src/Google.Protobuf/FieldCodec.cs \ + csharp/src/Google.Protobuf/FieldMaskTree.cs \ + csharp/src/Google.Protobuf/FrameworkPortability.cs \ + csharp/src/Google.Protobuf/Google.Protobuf.csproj \ + csharp/src/Google.Protobuf/IBufferMessage.cs \ + csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \ + csharp/src/Google.Protobuf/IDeepCloneable.cs \ + csharp/src/Google.Protobuf/IExtendableMessage.cs \ + csharp/src/Google.Protobuf/IMessage.cs \ + csharp/src/Google.Protobuf/InvalidJsonException.cs \ + csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs \ + csharp/src/Google.Protobuf/JsonFormatter.cs \ + csharp/src/Google.Protobuf/JsonParser.cs \ + csharp/src/Google.Protobuf/JsonToken.cs \ + csharp/src/Google.Protobuf/JsonTokenizer.cs \ + csharp/src/Google.Protobuf/LimitedInputStream.cs \ + csharp/src/Google.Protobuf/MessageExtensions.cs \ + csharp/src/Google.Protobuf/MessageParser.cs \ + csharp/src/Google.Protobuf/ObjectIntPair.cs \ + csharp/src/Google.Protobuf/ParseContext.cs \ + csharp/src/Google.Protobuf/ParserInternalState.cs \ + csharp/src/Google.Protobuf/ParsingPrimitives.cs \ + csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs \ + csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs \ + csharp/src/Google.Protobuf/ProtoPreconditions.cs \ + csharp/src/Google.Protobuf/SegmentedBufferHelper.cs \ + csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \ + csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \ + csharp/src/Google.Protobuf/Reflection/Descriptor.cs \ + csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs \ + csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs \ + csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs \ + csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs \ + csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs \ + csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs \ + csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs \ + csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs \ + csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/FieldType.cs \ + csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs \ + csharp/src/Google.Protobuf/Reflection/IDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs \ + csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs \ + csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs \ + csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs \ + csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs \ + csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs \ + csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs \ + csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs \ + csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Any.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Api.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Type.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/ValuePartial.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs \ + csharp/src/Google.Protobuf/WireFormat.cs \ + csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs \ + csharp/src/Google.Protobuf/WritingPrimitives.cs \ + csharp/src/Google.Protobuf/WriterInternalState.cs \ + csharp/src/Google.Protobuf/WriteContext.cs \ + csharp/src/Google.Protobuf/WriteBufferHelper.cs \ + csharp/src/Google.Protobuf/UnknownField.cs \ + csharp/src/Google.Protobuf/UnknownFieldSet.cs + +java_EXTRA_DIST = \ + java/README.md \ + java/bom/pom.xml \ + java/core/BUILD \ + java/core/generate-sources-build.xml \ + java/core/generate-test-sources-build.xml \ + java/core/pom.xml \ + java/core/src/main/java/com/google/protobuf/AbstractMessage.java \ + java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java \ + java/core/src/main/java/com/google/protobuf/AbstractParser.java \ + java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java \ + java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java \ + java/core/src/main/java/com/google/protobuf/Android.java \ + java/core/src/main/java/com/google/protobuf/ArrayDecoders.java \ + java/core/src/main/java/com/google/protobuf/BinaryReader.java \ + java/core/src/main/java/com/google/protobuf/BinaryWriter.java \ + java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java \ + java/core/src/main/java/com/google/protobuf/BlockingService.java \ + java/core/src/main/java/com/google/protobuf/BooleanArrayList.java \ + java/core/src/main/java/com/google/protobuf/BufferAllocator.java \ + java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java \ + java/core/src/main/java/com/google/protobuf/ByteOutput.java \ + java/core/src/main/java/com/google/protobuf/ByteString.java \ + java/core/src/main/java/com/google/protobuf/CodedInputStream.java \ + java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java \ + java/core/src/main/java/com/google/protobuf/CodedOutputStream.java \ + java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java \ + java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java \ + java/core/src/main/java/com/google/protobuf/Descriptors.java \ + java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java \ + java/core/src/main/java/com/google/protobuf/DoubleArrayList.java \ + java/core/src/main/java/com/google/protobuf/DynamicMessage.java \ + java/core/src/main/java/com/google/protobuf/ExperimentalApi.java \ + java/core/src/main/java/com/google/protobuf/Extension.java \ + java/core/src/main/java/com/google/protobuf/ExtensionLite.java \ + java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java \ + java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java \ + java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java \ + java/core/src/main/java/com/google/protobuf/ExtensionSchema.java \ + java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java \ + java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java \ + java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java \ + java/core/src/main/java/com/google/protobuf/FieldInfo.java \ + java/core/src/main/java/com/google/protobuf/FieldSet.java \ + java/core/src/main/java/com/google/protobuf/FieldType.java \ + java/core/src/main/java/com/google/protobuf/FloatArrayList.java \ + java/core/src/main/java/com/google/protobuf/GeneratedMessage.java \ + java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java \ + java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java \ + java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java \ + java/core/src/main/java/com/google/protobuf/IntArrayList.java \ + java/core/src/main/java/com/google/protobuf/Internal.java \ + java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \ + java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java \ + java/core/src/main/java/com/google/protobuf/JavaType.java \ + java/core/src/main/java/com/google/protobuf/LazyField.java \ + java/core/src/main/java/com/google/protobuf/LazyFieldLite.java \ + java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java \ + java/core/src/main/java/com/google/protobuf/LazyStringList.java \ + java/core/src/main/java/com/google/protobuf/ListFieldSchema.java \ + java/core/src/main/java/com/google/protobuf/LongArrayList.java \ + java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java \ + java/core/src/main/java/com/google/protobuf/MapEntry.java \ + java/core/src/main/java/com/google/protobuf/MapEntryLite.java \ + java/core/src/main/java/com/google/protobuf/MapField.java \ + java/core/src/main/java/com/google/protobuf/MapFieldLite.java \ + java/core/src/main/java/com/google/protobuf/MapFieldSchema.java \ + java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java \ + java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java \ + java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java \ + java/core/src/main/java/com/google/protobuf/Message.java \ + java/core/src/main/java/com/google/protobuf/MessageInfo.java \ + java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java \ + java/core/src/main/java/com/google/protobuf/MessageLite.java \ + java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java \ + java/core/src/main/java/com/google/protobuf/MessageLiteToString.java \ + java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java \ + java/core/src/main/java/com/google/protobuf/MessageReflection.java \ + java/core/src/main/java/com/google/protobuf/MessageSchema.java \ + java/core/src/main/java/com/google/protobuf/MessageSetSchema.java \ + java/core/src/main/java/com/google/protobuf/MutabilityOracle.java \ + java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java \ + java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java \ + java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java \ + java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java \ + java/core/src/main/java/com/google/protobuf/NioByteString.java \ + java/core/src/main/java/com/google/protobuf/OneofInfo.java \ + java/core/src/main/java/com/google/protobuf/Parser.java \ + java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java \ + java/core/src/main/java/com/google/protobuf/ProtoSyntax.java \ + java/core/src/main/java/com/google/protobuf/Protobuf.java \ + java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java \ + java/core/src/main/java/com/google/protobuf/ProtobufLists.java \ + java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java \ + java/core/src/main/java/com/google/protobuf/ProtocolStringList.java \ + java/core/src/main/java/com/google/protobuf/RawMessageInfo.java \ + java/core/src/main/java/com/google/protobuf/Reader.java \ + java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java \ + java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java \ + java/core/src/main/java/com/google/protobuf/RopeByteString.java \ + java/core/src/main/java/com/google/protobuf/RpcCallback.java \ + java/core/src/main/java/com/google/protobuf/RpcChannel.java \ + java/core/src/main/java/com/google/protobuf/RpcController.java \ + java/core/src/main/java/com/google/protobuf/RpcUtil.java \ + java/core/src/main/java/com/google/protobuf/Schema.java \ + java/core/src/main/java/com/google/protobuf/SchemaFactory.java \ + java/core/src/main/java/com/google/protobuf/SchemaUtil.java \ + java/core/src/main/java/com/google/protobuf/Service.java \ + java/core/src/main/java/com/google/protobuf/ServiceException.java \ + java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java \ + java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java \ + java/core/src/main/java/com/google/protobuf/SmallSortedMap.java \ + java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java \ + java/core/src/main/java/com/google/protobuf/TextFormat.java \ + java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java \ + java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java \ + java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java \ + java/core/src/main/java/com/google/protobuf/TypeRegistry.java \ + java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java \ + java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java \ + java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java \ + java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java \ + java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java \ + java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java \ + java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java \ + java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java \ + java/core/src/main/java/com/google/protobuf/UnsafeUtil.java \ + java/core/src/main/java/com/google/protobuf/Utf8.java \ + java/core/src/main/java/com/google/protobuf/WireFormat.java \ + java/core/src/main/java/com/google/protobuf/Writer.java \ + java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java \ + java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java \ + java/core/src/test/java/com/google/protobuf/AbstractProto2SchemaTest.java \ + java/core/src/test/java/com/google/protobuf/AbstractProto3LiteSchemaTest.java \ + java/core/src/test/java/com/google/protobuf/AbstractProto3SchemaTest.java \ + java/core/src/test/java/com/google/protobuf/AbstractSchemaTest.java \ + java/core/src/test/java/com/google/protobuf/AnyTest.java \ + java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java \ + java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java \ + java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java \ + java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java \ + java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java \ + java/core/src/test/java/com/google/protobuf/ByteStringTest.java \ + java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java \ + java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java \ + java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java \ + java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java \ + java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java \ + java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \ + java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java \ + java/core/src/test/java/com/google/protobuf/DescriptorsTest.java \ + java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java \ + java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java \ + java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java \ + java/core/src/test/java/com/google/protobuf/EnumTest.java \ + java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java \ + java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java \ + java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java \ + java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java \ + java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java \ + java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java \ + java/core/src/test/java/com/google/protobuf/ForceFieldBuildersPreRun.java \ + java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java \ + java/core/src/test/java/com/google/protobuf/IntArrayListTest.java \ + java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java \ + java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java \ + java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java \ + java/core/src/test/java/com/google/protobuf/LazyFieldTest.java \ + java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java \ + java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java \ + java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java \ + java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java \ + java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java \ + java/core/src/test/java/com/google/protobuf/LongArrayListTest.java \ + java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java \ + java/core/src/test/java/com/google/protobuf/MapForProto2Test.java \ + java/core/src/test/java/com/google/protobuf/MapLiteTest.java \ + java/core/src/test/java/com/google/protobuf/MapTest.java \ + java/core/src/test/java/com/google/protobuf/MessageTest.java \ + java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java \ + java/core/src/test/java/com/google/protobuf/NioByteStringTest.java \ + java/core/src/test/java/com/google/protobuf/PackedFieldTest.java \ + java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java \ + java/core/src/test/java/com/google/protobuf/ParserLiteTest.java \ + java/core/src/test/java/com/google/protobuf/ParserTest.java \ + java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java \ + java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java \ + java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java \ + java/core/src/test/java/com/google/protobuf/Proto2MessageInfoFactory.java \ + java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java \ + java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java \ + java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java \ + java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java \ + java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java \ + java/core/src/test/java/com/google/protobuf/Proto3MessageInfoFactory.java \ + java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java \ + java/core/src/test/java/com/google/protobuf/Proto3MessageLiteInfoFactory.java \ + java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java \ + java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java \ + java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java \ + java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java \ + java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java \ + java/core/src/test/java/com/google/protobuf/ServiceTest.java \ + java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java \ + java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java \ + java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java \ + java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java \ + java/core/src/test/java/com/google/protobuf/TestSchemas.java \ + java/core/src/test/java/com/google/protobuf/TestSchemasLite.java \ + java/core/src/test/java/com/google/protobuf/TestUtil.java \ + java/core/src/test/java/com/google/protobuf/TestUtilLite.java \ + java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java \ + java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java \ + java/core/src/test/java/com/google/protobuf/TextFormatTest.java \ + java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java \ + java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java \ + java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java \ + java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java \ + java/core/src/test/java/com/google/protobuf/Utf8Test.java \ + java/core/src/test/java/com/google/protobuf/Utf8Utils.java \ + java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java \ + java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java \ + java/core/src/test/java/com/google/protobuf/WireFormatTest.java \ + java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java \ + java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java \ + java/core/src/test/proto/com/google/protobuf/any_test.proto \ + java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto \ + java/core/src/test/proto/com/google/protobuf/deprecated_file.proto \ + java/core/src/test/proto/com/google/protobuf/field_presence_test.proto \ + java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto \ + java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto \ + java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto \ + java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto \ + java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto \ + java/core/src/test/proto/com/google/protobuf/map_lite_test.proto \ + java/core/src/test/proto/com/google/protobuf/map_test.proto \ + java/core/src/test/proto/com/google/protobuf/message_lite_extension_util_test.proto\ + java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto \ + java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto \ + java/core/src/test/proto/com/google/protobuf/nested_extension.proto \ + java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto \ + java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto \ + java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto \ + java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto \ + java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto \ + java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto \ + java/core/src/test/proto/com/google/protobuf/packed_field_test.proto \ + java/core/src/test/proto/com/google/protobuf/proto2_message.proto \ + java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto \ + java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto \ + java/core/src/test/proto/com/google/protobuf/proto3_message.proto \ + java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto \ + java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto \ + java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \ + java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \ + java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \ + java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto \ + java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \ + java/lite.md \ + java/lite/BUILD \ + java/lite/generate-sources-build.xml \ + java/lite/generate-test-sources-build.xml \ + java/lite/lite.awk \ + java/lite/pom.xml \ + java/lite/process-lite-sources-build.xml \ + java/lite/src/test/java/com/google/protobuf/LiteTest.java \ + java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java \ + java/pom.xml \ + java/util/BUILD \ + java/util/pom.xml \ + java/util/src/main/java/com/google/protobuf/util/Durations.java \ + java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java \ + java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java \ + java/util/src/main/java/com/google/protobuf/util/JsonFormat.java \ + java/util/src/main/java/com/google/protobuf/util/TimeUtil.java \ + java/util/src/main/java/com/google/protobuf/util/Structs.java \ + java/util/src/main/java/com/google/protobuf/util/Timestamps.java \ + java/util/src/main/java/com/google/protobuf/util/Values.java \ + java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ + java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ + java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ + java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ + java/util/src/test/java/com/google/protobuf/util/TimeUtilTest.java \ + java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ + java/util/src/test/proto/com/google/protobuf/util/json_test.proto + +objectivec_EXTRA_DIST = \ + objectivec/.clang-format \ + objectivec/BUILD \ + objectivec/DevTools/check_version_stamps.sh \ + objectivec/DevTools/compile_testing_protos.sh \ + objectivec/DevTools/full_mac_build.sh \ + objectivec/DevTools/pddm.py \ + objectivec/DevTools/pddm_tests.py \ + objectivec/generate_well_known_types.sh \ + objectivec/google/protobuf/Any.pbobjc.h \ + objectivec/google/protobuf/Api.pbobjc.h \ + objectivec/google/protobuf/Duration.pbobjc.h \ + objectivec/google/protobuf/Empty.pbobjc.h \ + objectivec/google/protobuf/FieldMask.pbobjc.h \ + objectivec/google/protobuf/SourceContext.pbobjc.h \ + objectivec/google/protobuf/Struct.pbobjc.h \ + objectivec/google/protobuf/Timestamp.pbobjc.h \ + objectivec/google/protobuf/Type.pbobjc.h \ + objectivec/google/protobuf/Wrappers.pbobjc.h \ + objectivec/GPBAny.pbobjc.h \ + objectivec/GPBAny.pbobjc.m \ + objectivec/GPBApi.pbobjc.h \ + objectivec/GPBApi.pbobjc.m \ + objectivec/GPBArray.h \ + objectivec/GPBArray.m \ + objectivec/GPBArray_PackagePrivate.h \ + objectivec/GPBBootstrap.h \ + objectivec/GPBCodedInputStream.h \ + objectivec/GPBCodedInputStream.m \ + objectivec/GPBCodedInputStream_PackagePrivate.h \ + objectivec/GPBCodedOutputStream.h \ + objectivec/GPBCodedOutputStream.m \ + objectivec/GPBCodedOutputStream_PackagePrivate.h \ + objectivec/GPBDescriptor.h \ + objectivec/GPBDescriptor.m \ + objectivec/GPBDescriptor_PackagePrivate.h \ + objectivec/GPBDictionary.h \ + objectivec/GPBDictionary.m \ + objectivec/GPBDictionary_PackagePrivate.h \ + objectivec/GPBDuration.pbobjc.h \ + objectivec/GPBDuration.pbobjc.m \ + objectivec/GPBEmpty.pbobjc.h \ + objectivec/GPBEmpty.pbobjc.m \ + objectivec/GPBExtensionInternals.h \ + objectivec/GPBExtensionInternals.m \ + objectivec/GPBExtensionRegistry.h \ + objectivec/GPBExtensionRegistry.m \ + objectivec/GPBFieldMask.pbobjc.h \ + objectivec/GPBFieldMask.pbobjc.m \ + objectivec/GPBMessage.h \ + objectivec/GPBMessage.m \ + objectivec/GPBMessage_PackagePrivate.h \ + objectivec/GPBProtocolBuffers.h \ + objectivec/GPBProtocolBuffers.m \ + objectivec/GPBProtocolBuffers_RuntimeSupport.h \ + objectivec/GPBRootObject.h \ + objectivec/GPBRootObject.m \ + objectivec/GPBRootObject_PackagePrivate.h \ + objectivec/GPBRuntimeTypes.h \ + objectivec/GPBSourceContext.pbobjc.h \ + objectivec/GPBSourceContext.pbobjc.m \ + objectivec/GPBStruct.pbobjc.h \ + objectivec/GPBStruct.pbobjc.m \ + objectivec/GPBTimestamp.pbobjc.h \ + objectivec/GPBTimestamp.pbobjc.m \ + objectivec/GPBType.pbobjc.h \ + objectivec/GPBType.pbobjc.m \ + objectivec/GPBUnknownField.h \ + objectivec/GPBUnknownField.m \ + objectivec/GPBUnknownField_PackagePrivate.h \ + objectivec/GPBUnknownFieldSet.h \ + objectivec/GPBUnknownFieldSet.m \ + objectivec/GPBUnknownFieldSet_PackagePrivate.h \ + objectivec/GPBUtilities.h \ + objectivec/GPBUtilities.m \ + objectivec/GPBUtilities_PackagePrivate.h \ + objectivec/GPBWellKnownTypes.h \ + objectivec/GPBWellKnownTypes.m \ + objectivec/GPBWireFormat.h \ + objectivec/GPBWireFormat.m \ + objectivec/GPBWrappers.pbobjc.h \ + objectivec/GPBWrappers.pbobjc.m \ + objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj \ + objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ + objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ + objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ + objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ + objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ + objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj \ + objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ + objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ + objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ + objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ + objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ + objectivec/ProtocolBuffers_tvOS.xcodeproj/project.pbxproj \ + objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ + objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ + objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ + objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ + objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ + objectivec/README.md \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.pbxproj \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/OSXCocoaPodsTester.xcscheme \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.h \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.m \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Base.lproj/MainMenu.xib \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Info.plist \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/main.m \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-framework \ + objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-static \ + objectivec/Tests/CocoaPods/README.md \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.pbxproj \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/iOSCocoaPodsTester.xcscheme \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.h \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.m \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/LaunchScreen.storyboard \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/Main.storyboard \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Info.plist \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.h \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.m \ + objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/main.m \ + objectivec/Tests/CocoaPods/run_tests.sh \ + objectivec/Tests/golden_message \ + objectivec/Tests/golden_packed_fields_message \ + objectivec/Tests/GPBARCUnittestProtos.m \ + objectivec/Tests/GPBArrayTests.m \ + objectivec/Tests/GPBCodedInputStreamTests.m \ + objectivec/Tests/GPBCodedOuputStreamTests.m \ + objectivec/Tests/GPBCompileTest01.m \ + objectivec/Tests/GPBCompileTest02.m \ + objectivec/Tests/GPBCompileTest03.m \ + objectivec/Tests/GPBCompileTest04.m \ + objectivec/Tests/GPBCompileTest05.m \ + objectivec/Tests/GPBCompileTest06.m \ + objectivec/Tests/GPBCompileTest07.m \ + objectivec/Tests/GPBCompileTest08.m \ + objectivec/Tests/GPBCompileTest09.m \ + objectivec/Tests/GPBCompileTest10.m \ + objectivec/Tests/GPBCompileTest11.m \ + objectivec/Tests/GPBCompileTest12.m \ + objectivec/Tests/GPBCompileTest13.m \ + objectivec/Tests/GPBCompileTest14.m \ + objectivec/Tests/GPBCompileTest15.m \ + objectivec/Tests/GPBCompileTest16.m \ + objectivec/Tests/GPBCompileTest17.m \ + objectivec/Tests/GPBCompileTest18.m \ + objectivec/Tests/GPBCompileTest19.m \ + objectivec/Tests/GPBCompileTest20.m \ + objectivec/Tests/GPBCompileTest21.m \ + objectivec/Tests/GPBCompileTest22.m \ + objectivec/Tests/GPBCompileTest23.m \ + objectivec/Tests/GPBCompileTest24.m \ + objectivec/Tests/GPBCompileTest25.m \ + objectivec/Tests/GPBConcurrencyTests.m \ + objectivec/Tests/GPBDescriptorTests.m \ + objectivec/Tests/GPBDictionaryTests+Bool.m \ + objectivec/Tests/GPBDictionaryTests+Int32.m \ + objectivec/Tests/GPBDictionaryTests+Int64.m \ + objectivec/Tests/GPBDictionaryTests+String.m \ + objectivec/Tests/GPBDictionaryTests+UInt32.m \ + objectivec/Tests/GPBDictionaryTests+UInt64.m \ + objectivec/Tests/GPBDictionaryTests.m \ + objectivec/Tests/GPBDictionaryTests.pddm \ + objectivec/Tests/GPBExtensionRegistryTest.m \ + objectivec/Tests/GPBMessageTests+ClassNames.m \ + objectivec/Tests/GPBMessageTests+Merge.m \ + objectivec/Tests/GPBMessageTests+Runtime.m \ + objectivec/Tests/GPBMessageTests+Serialization.m \ + objectivec/Tests/GPBMessageTests.m \ + objectivec/Tests/GPBObjectiveCPlusPlusTest.mm \ + objectivec/Tests/GPBPerfTests.m \ + objectivec/Tests/GPBSwiftTests.swift \ + objectivec/Tests/GPBTestUtilities.h \ + objectivec/Tests/GPBTestUtilities.m \ + objectivec/Tests/GPBUnittestProtos.m \ + objectivec/Tests/GPBUnittestProtos2.m \ + objectivec/Tests/GPBUnknownFieldSetTest.m \ + objectivec/Tests/GPBUtilitiesTests.m \ + objectivec/Tests/GPBWellKnownTypesTest.m \ + objectivec/Tests/GPBWireFormatTests.m \ + objectivec/Tests/text_format_extensions_unittest_data.txt \ + objectivec/Tests/text_format_map_unittest_data.txt \ + objectivec/Tests/text_format_unittest_data.txt \ + objectivec/Tests/unittest_cycle.proto \ + objectivec/Tests/unittest_deprecated.proto \ + objectivec/Tests/unittest_deprecated_file.proto \ + objectivec/Tests/unittest_extension_chain_a.proto \ + objectivec/Tests/unittest_extension_chain_b.proto \ + objectivec/Tests/unittest_extension_chain_c.proto \ + objectivec/Tests/unittest_extension_chain_d.proto \ + objectivec/Tests/unittest_extension_chain_e.proto \ + objectivec/Tests/unittest_extension_chain_f.proto \ + objectivec/Tests/unittest_extension_chain_g.proto \ + objectivec/Tests/unittest_objc.proto \ + objectivec/Tests/unittest_objc_options.proto \ + objectivec/Tests/unittest_objc_startup.proto \ + objectivec/Tests/unittest_runtime_proto2.proto \ + objectivec/Tests/unittest_runtime_proto3.proto \ + objectivec/Tests/UnitTests-Bridging-Header.h \ + objectivec/Tests/UnitTests-Info.plist \ + Protobuf.podspec + +php_EXTRA_DIST = \ + composer.json \ + php/README.md \ + php/composer.json \ + php/ext/google/protobuf/arena.c \ + php/ext/google/protobuf/arena.h \ + php/ext/google/protobuf/array.c \ + php/ext/google/protobuf/array.h \ + php/ext/google/protobuf/config.m4 \ + php/ext/google/protobuf/convert.c \ + php/ext/google/protobuf/convert.h \ + php/ext/google/protobuf/def.c \ + php/ext/google/protobuf/def.h \ + php/ext/google/protobuf/map.c \ + php/ext/google/protobuf/map.h \ + php/ext/google/protobuf/message.c \ + php/ext/google/protobuf/message.h \ + php/ext/google/protobuf/names.c \ + php/ext/google/protobuf/names.h \ + php/ext/google/protobuf/package.xml \ + php/ext/google/protobuf/php-upb.c \ + php/ext/google/protobuf/php-upb.h \ + php/ext/google/protobuf/protobuf.c \ + php/ext/google/protobuf/protobuf.h \ + php/ext/google/protobuf/wkt.inc \ + php/generate_descriptor_protos.sh \ + php/phpunit.xml \ + php/prepare_c_extension.sh \ + php/release.sh \ + php/src/GPBMetadata/Google/Protobuf/Any.php \ + php/src/GPBMetadata/Google/Protobuf/Api.php \ + php/src/GPBMetadata/Google/Protobuf/Duration.php \ + php/src/GPBMetadata/Google/Protobuf/FieldMask.php \ + php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php \ + php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php \ + php/src/GPBMetadata/Google/Protobuf/SourceContext.php \ + php/src/GPBMetadata/Google/Protobuf/Struct.php \ + php/src/GPBMetadata/Google/Protobuf/Timestamp.php \ + php/src/GPBMetadata/Google/Protobuf/Type.php \ + php/src/GPBMetadata/Google/Protobuf/Wrappers.php \ + php/src/Google/Protobuf/Any.php \ + php/src/Google/Protobuf/Api.php \ + php/src/Google/Protobuf/BoolValue.php \ + php/src/Google/Protobuf/BytesValue.php \ + php/src/Google/Protobuf/Descriptor.php \ + php/src/Google/Protobuf/DescriptorPool.php \ + php/src/Google/Protobuf/DoubleValue.php \ + php/src/Google/Protobuf/Duration.php \ + php/src/Google/Protobuf/Enum.php \ + php/src/Google/Protobuf/EnumDescriptor.php \ + php/src/Google/Protobuf/EnumValue.php \ + php/src/Google/Protobuf/EnumValueDescriptor.php \ + php/src/Google/Protobuf/Field.php \ + php/src/Google/Protobuf/FieldDescriptor.php \ + php/src/Google/Protobuf/FieldMask.php \ + php/src/Google/Protobuf/Field/Cardinality.php \ + php/src/Google/Protobuf/Field_Cardinality.php \ + php/src/Google/Protobuf/Field/Kind.php \ + php/src/Google/Protobuf/Field_Kind.php \ + php/src/Google/Protobuf/FloatValue.php \ + php/src/Google/Protobuf/GPBEmpty.php \ + php/src/Google/Protobuf/Int32Value.php \ + php/src/Google/Protobuf/Int64Value.php \ + php/src/Google/Protobuf/Internal/AnyBase.php \ + php/src/Google/Protobuf/Internal/CodedInputStream.php \ + php/src/Google/Protobuf/Internal/CodedOutputStream.php \ + php/src/Google/Protobuf/Internal/Descriptor.php \ + php/src/Google/Protobuf/Internal/DescriptorPool.php \ + php/src/Google/Protobuf/Internal/DescriptorProto.php \ + php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php \ + php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php \ + php/src/Google/Protobuf/Internal/EnumBuilderContext.php \ + php/src/Google/Protobuf/Internal/EnumDescriptor.php \ + php/src/Google/Protobuf/Internal/EnumDescriptorProto.php \ + php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php \ + php/src/Google/Protobuf/Internal/EnumOptions.php \ + php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php \ + php/src/Google/Protobuf/Internal/EnumValueOptions.php \ + php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php \ + php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ + php/src/Google/Protobuf/Internal/FieldDescriptor.php \ + php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ + php/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php \ + php/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php \ + php/src/Google/Protobuf/Internal/FieldOptions.php \ + php/src/Google/Protobuf/Internal/FieldOptions/CType.php \ + php/src/Google/Protobuf/Internal/FieldOptions/JSType.php \ + php/src/Google/Protobuf/Internal/FileDescriptor.php \ + php/src/Google/Protobuf/Internal/FileDescriptorProto.php \ + php/src/Google/Protobuf/Internal/FileDescriptorSet.php \ + php/src/Google/Protobuf/Internal/FileOptions.php \ + php/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php \ + php/src/Google/Protobuf/Internal/GPBDecodeException.php \ + php/src/Google/Protobuf/Internal/GPBJsonWire.php \ + php/src/Google/Protobuf/Internal/GPBLabel.php \ + php/src/Google/Protobuf/Internal/GPBType.php \ + php/src/Google/Protobuf/Internal/GPBUtil.php \ + php/src/Google/Protobuf/Internal/GPBWire.php \ + php/src/Google/Protobuf/Internal/GPBWireType.php \ + php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php \ + php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php \ + php/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php \ + php/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php \ + php/src/Google/Protobuf/Internal/MapEntry.php \ + php/src/Google/Protobuf/Internal/MapField.php \ + php/src/Google/Protobuf/Internal/MapFieldIter.php \ + php/src/Google/Protobuf/Internal/Message.php \ + php/src/Google/Protobuf/Internal/MessageBuilderContext.php \ + php/src/Google/Protobuf/Internal/MessageOptions.php \ + php/src/Google/Protobuf/Internal/MethodDescriptorProto.php \ + php/src/Google/Protobuf/Internal/MethodOptions.php \ + php/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php \ + php/src/Google/Protobuf/Internal/OneofDescriptor.php \ + php/src/Google/Protobuf/Internal/OneofDescriptorProto.php \ + php/src/Google/Protobuf/Internal/OneofField.php \ + php/src/Google/Protobuf/Internal/OneofOptions.php \ + php/src/Google/Protobuf/Internal/RawInputStream.php \ + php/src/Google/Protobuf/Internal/RepeatedField.php \ + php/src/Google/Protobuf/Internal/RepeatedFieldIter.php \ + php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php \ + php/src/Google/Protobuf/Internal/ServiceOptions.php \ + php/src/Google/Protobuf/Internal/SourceCodeInfo.php \ + php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \ + php/src/Google/Protobuf/Internal/TimestampBase.php \ + php/src/Google/Protobuf/Internal/UninterpretedOption.php \ + php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \ + php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \ + php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php \ + php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php \ + php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php \ + php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php \ + php/src/Google/Protobuf/Internal/FieldOptions_CType.php \ + php/src/Google/Protobuf/Internal/FieldOptions_JSType.php \ + php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php \ + php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php \ + php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php \ + php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php \ + php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php \ + php/src/Google/Protobuf/ListValue.php \ + php/src/Google/Protobuf/Method.php \ + php/src/Google/Protobuf/Mixin.php \ + php/src/Google/Protobuf/NullValue.php \ + php/src/Google/Protobuf/OneofDescriptor.php \ + php/src/Google/Protobuf/Option.php \ + php/src/Google/Protobuf/SourceContext.php \ + php/src/Google/Protobuf/StringValue.php \ + php/src/Google/Protobuf/Struct.php \ + php/src/Google/Protobuf/Syntax.php \ + php/src/Google/Protobuf/Timestamp.php \ + php/src/Google/Protobuf/Type.php \ + php/src/Google/Protobuf/UInt32Value.php \ + php/src/Google/Protobuf/UInt64Value.php \ + php/src/Google/Protobuf/Value.php \ + php/src/phpdoc.dist.xml \ + php/tests/ArrayTest.php \ + php/tests/autoload.php \ + php/tests/bootstrap_phpunit.php \ + php/tests/compatibility_test.sh \ + php/tests/compile_extension.sh \ + php/tests/DescriptorsTest.php \ + php/tests/EncodeDecodeTest.php \ + php/tests/gdb_test.sh \ + php/tests/generate_protos.sh \ + php/tests/GeneratedClassTest.php \ + php/tests/GeneratedPhpdocTest.php \ + php/tests/GeneratedServiceTest.php \ + php/tests/MapFieldTest.php \ + php/tests/memory_leak_test.php \ + php/tests/multirequest.php \ + php/tests/multirequest.sh \ + php/tests/PhpImplementationTest.php \ + php/tests/proto/empty/echo.proto \ + php/tests/proto/test.proto \ + php/tests/proto/test_descriptors.proto \ + php/tests/proto/test_empty_php_namespace.proto \ + php/tests/proto/test_import_descriptor_proto.proto \ + php/tests/proto/test_include.proto \ + php/tests/proto/test_no_namespace.proto \ + php/tests/proto/test_php_namespace.proto \ + php/tests/proto/test_prefix.proto \ + php/tests/proto/test_reserved_enum_lower.proto \ + php/tests/proto/test_reserved_enum_upper.proto \ + php/tests/proto/test_reserved_enum_value_lower.proto \ + php/tests/proto/test_reserved_enum_value_upper.proto \ + php/tests/proto/test_reserved_message_lower.proto \ + php/tests/proto/test_reserved_message_upper.proto \ + php/tests/proto/test_service.proto \ + php/tests/proto/test_service_namespace.proto \ + php/tests/proto/test_wrapper_type_setters.proto \ + php/tests/test.sh \ + php/tests/test_base.php \ + php/tests/test_util.php \ + php/tests/undefined_test.php \ + php/tests/valgrind.supp \ + php/tests/WellKnownTest.php \ + php/tests/WrapperTypeSettersTest.php + +python_EXTRA_DIST = \ + python/MANIFEST.in \ + python/google/__init__.py \ + python/google/protobuf/__init__.py \ + python/google/protobuf/compiler/__init__.py \ + python/google/protobuf/descriptor.py \ + python/google/protobuf/descriptor_database.py \ + python/google/protobuf/descriptor_pool.py \ + python/google/protobuf/internal/__init__.py \ + python/google/protobuf/internal/_parameterized.py \ + python/google/protobuf/internal/any_test.proto \ + python/google/protobuf/internal/any_test.proto \ + python/google/protobuf/internal/api_implementation.cc \ + python/google/protobuf/internal/api_implementation.py \ + python/google/protobuf/internal/containers.py \ + python/google/protobuf/internal/decoder.py \ + python/google/protobuf/internal/descriptor_database_test.py \ + python/google/protobuf/internal/descriptor_pool_test.py \ + python/google/protobuf/internal/descriptor_pool_test1.proto \ + python/google/protobuf/internal/descriptor_pool_test2.proto \ + python/google/protobuf/internal/descriptor_test.py \ + python/google/protobuf/internal/encoder.py \ + python/google/protobuf/internal/enum_type_wrapper.py \ + python/google/protobuf/internal/extension_dict.py \ + python/google/protobuf/internal/factory_test1.proto \ + python/google/protobuf/internal/factory_test2.proto \ + python/google/protobuf/internal/file_options_test.proto \ + python/google/protobuf/internal/generator_test.py \ + python/google/protobuf/internal/import_test_package/__init__.py \ + python/google/protobuf/internal/import_test_package/inner.proto \ + python/google/protobuf/internal/import_test_package/outer.proto \ + python/google/protobuf/internal/json_format_test.py \ + python/google/protobuf/internal/keywords_test.py \ + python/google/protobuf/internal/message_factory_test.py \ + python/google/protobuf/internal/message_listener.py \ + python/google/protobuf/internal/message_set_extensions.proto \ + python/google/protobuf/internal/message_test.py \ + python/google/protobuf/internal/missing_enum_values.proto \ + python/google/protobuf/internal/more_extensions.proto \ + python/google/protobuf/internal/more_extensions_dynamic.proto \ + python/google/protobuf/internal/more_messages.proto \ + python/google/protobuf/internal/no_package.proto \ + python/google/protobuf/internal/packed_field_test.proto \ + python/google/protobuf/internal/proto_builder_test.py \ + python/google/protobuf/internal/python_message.py \ + python/google/protobuf/internal/python_protobuf.cc \ + python/google/protobuf/internal/reflection_test.py \ + python/google/protobuf/internal/service_reflection_test.py \ + python/google/protobuf/internal/symbol_database_test.py \ + python/google/protobuf/internal/test_bad_identifiers.proto \ + python/google/protobuf/internal/test_proto3_optional.proto \ + python/google/protobuf/internal/test_util.py \ + python/google/protobuf/internal/testing_refleaks.py \ + python/google/protobuf/internal/text_encoding_test.py \ + python/google/protobuf/internal/text_format_test.py \ + python/google/protobuf/internal/type_checkers.py \ + python/google/protobuf/internal/unknown_fields_test.py \ + python/google/protobuf/internal/well_known_types.py \ + python/google/protobuf/internal/well_known_types.py \ + python/google/protobuf/internal/well_known_types_test.py \ + python/google/protobuf/internal/well_known_types_test.py \ + python/google/protobuf/internal/wire_format.py \ + python/google/protobuf/internal/wire_format_test.py \ + python/google/protobuf/json_format.py \ + python/google/protobuf/message.py \ + python/google/protobuf/message_factory.py \ + python/google/protobuf/python_protobuf.h \ + python/google/protobuf/proto_api.h \ + python/google/protobuf/proto_builder.py \ + python/google/protobuf/pyext/README \ + python/google/protobuf/pyext/__init__.py \ + python/google/protobuf/pyext/cpp_message.py \ + python/google/protobuf/pyext/descriptor.cc \ + python/google/protobuf/pyext/descriptor.h \ + python/google/protobuf/pyext/descriptor_containers.cc \ + python/google/protobuf/pyext/descriptor_containers.h \ + python/google/protobuf/pyext/descriptor_database.cc \ + python/google/protobuf/pyext/descriptor_database.h \ + python/google/protobuf/pyext/descriptor_pool.cc \ + python/google/protobuf/pyext/descriptor_pool.h \ + python/google/protobuf/pyext/extension_dict.cc \ + python/google/protobuf/pyext/extension_dict.h \ + python/google/protobuf/pyext/map_container.cc \ + python/google/protobuf/pyext/map_container.h \ + python/google/protobuf/pyext/message.cc \ + python/google/protobuf/pyext/message.h \ + python/google/protobuf/pyext/field.cc \ + python/google/protobuf/pyext/field.h \ + python/google/protobuf/pyext/unknown_fields.cc \ + python/google/protobuf/pyext/unknown_fields.h \ + python/google/protobuf/pyext/message_factory.cc \ + python/google/protobuf/pyext/message_factory.h \ + python/google/protobuf/pyext/message_module.cc \ + python/google/protobuf/pyext/proto2_api_test.proto \ + python/google/protobuf/pyext/python.proto \ + python/google/protobuf/pyext/repeated_composite_container.cc \ + python/google/protobuf/pyext/repeated_composite_container.h \ + python/google/protobuf/pyext/repeated_scalar_container.cc \ + python/google/protobuf/pyext/repeated_scalar_container.h \ + python/google/protobuf/pyext/safe_numerics.h \ + python/google/protobuf/pyext/scoped_pyobject_ptr.h \ + python/google/protobuf/reflection.py \ + python/google/protobuf/service.py \ + python/google/protobuf/service_reflection.py \ + python/google/protobuf/symbol_database.py \ + python/google/protobuf/text_encoding.py \ + python/google/protobuf/text_format.py \ + python/google/protobuf/util/__init__.py \ + python/release.sh \ + python/mox.py \ + python/setup.cfg \ + python/setup.py \ + python/stubout.py \ + python/tox.ini \ + python/README.md + +ruby_EXTRA_DIST = \ + ruby/Gemfile \ + ruby/.gitignore \ + ruby/README.md \ + ruby/Rakefile \ + ruby/compatibility_tests/v3.0.0/tests/test_import.proto \ + ruby/compatibility_tests/v3.0.0/tests/stress.rb \ + ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb \ + ruby/compatibility_tests/v3.0.0/tests/generated_code_test.rb \ + ruby/compatibility_tests/v3.0.0/tests/generated_code.proto \ + ruby/compatibility_tests/v3.0.0/tests/basic.rb \ + ruby/compatibility_tests/v3.0.0/test.sh \ + ruby/compatibility_tests/v3.0.0/Rakefile \ + ruby/compatibility_tests/v3.0.0/README.md \ + ruby/ext/google/protobuf_c/defs.c \ + ruby/ext/google/protobuf_c/encode_decode.c \ + ruby/ext/google/protobuf_c/extconf.rb \ + ruby/ext/google/protobuf_c/map.c \ + ruby/ext/google/protobuf_c/message.c \ + ruby/ext/google/protobuf_c/protobuf.c \ + ruby/ext/google/protobuf_c/protobuf.h \ + ruby/ext/google/protobuf_c/repeated_field.c \ + ruby/ext/google/protobuf_c/storage.c \ + ruby/ext/google/protobuf_c/upb.c \ + ruby/ext/google/protobuf_c/upb.h \ + ruby/ext/google/protobuf_c/wrap_memcpy.c \ + ruby/google-protobuf.gemspec \ + ruby/lib/google/protobuf/message_exts.rb \ + ruby/lib/google/protobuf/repeated_field.rb \ + ruby/lib/google/protobuf/well_known_types.rb \ + ruby/lib/google/protobuf.rb \ + ruby/pom.xml \ + ruby/src/main/java/com/google/protobuf/jruby/RubyBuilder.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptor.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyEnumBuilderContext.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyEnumDescriptor.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyEnum.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyFieldDescriptor.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyMessageBuilderContext.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyOneofBuilderContext.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyOneofDescriptor.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyProtobuf.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java \ + ruby/src/main/java/com/google/protobuf/jruby/SentinelOuterClass.java \ + ruby/src/main/java/com/google/protobuf/jruby/Utils.java \ + ruby/src/main/java/google/ProtobufJavaService.java \ + ruby/src/main/sentinel.proto \ + ruby/tests/basic_proto2.rb \ + ruby/tests/basic_test_proto2.proto \ + ruby/tests/basic_test.proto \ + ruby/tests/basic.rb \ + ruby/tests/common_tests.rb \ + ruby/tests/encode_decode_test.rb \ + ruby/tests/gc_test.rb \ + ruby/tests/repeated_field_test.rb \ + ruby/tests/stress.rb \ + ruby/tests/generated_code_proto2_test.rb \ + ruby/tests/generated_code_proto2.proto \ + ruby/tests/generated_code.proto \ + ruby/tests/test_import_proto2.proto \ + ruby/tests/test_import.proto \ + ruby/tests/test_ruby_package_proto2.proto \ + ruby/tests/test_ruby_package.proto \ + ruby/tests/generated_code_test.rb \ + ruby/tests/well_known_types_test.rb \ + ruby/tests/type_errors.rb \ + ruby/travis-test.sh + +js_EXTRA_DIST = \ + js/README.md \ + js/binary/arith.js \ + js/binary/arith_test.js \ + js/binary/constants.js \ + js/binary/decoder.js \ + js/binary/decoder_test.js \ + js/binary/encoder.js \ + js/binary/message_test.js \ + js/binary/proto_test.js \ + js/binary/reader.js \ + js/binary/reader_test.js \ + js/binary/utils.js \ + js/binary/utils_test.js \ + js/binary/writer.js \ + js/binary/writer_test.js \ + js/commonjs/export.js \ + js/commonjs/export_asserts.js \ + js/commonjs/export_testdeps.js \ + js/commonjs/import_test.js \ + js/commonjs/jasmine.json \ + js/commonjs/rewrite_tests_for_commonjs.js \ + js/commonjs/strict_test.js \ + js/commonjs/test6/test6.proto \ + js/commonjs/test7/test7.proto \ + js/compatibility_tests/v3.0.0/binary/arith_test.js \ + js/compatibility_tests/v3.0.0/binary/decoder_test.js \ + js/compatibility_tests/v3.0.0/binary/proto_test.js \ + js/compatibility_tests/v3.0.0/binary/reader_test.js \ + js/compatibility_tests/v3.0.0/binary/utils_test.js \ + js/compatibility_tests/v3.0.0/binary/writer_test.js \ + js/compatibility_tests/v3.0.0/commonjs/export_asserts.js \ + js/compatibility_tests/v3.0.0/commonjs/export_testdeps.js \ + js/compatibility_tests/v3.0.0/commonjs/import_test.js \ + js/compatibility_tests/v3.0.0/commonjs/jasmine.json \ + js/compatibility_tests/v3.0.0/commonjs/rewrite_tests_for_commonjs.js \ + js/compatibility_tests/v3.0.0/commonjs/test6/test6.proto \ + js/compatibility_tests/v3.0.0/commonjs/test7/test7.proto \ + js/compatibility_tests/v3.0.0/data.proto \ + js/compatibility_tests/v3.0.0/debug_test.js \ + js/compatibility_tests/v3.0.0/jasmine1.json \ + js/compatibility_tests/v3.0.0/jasmine2.json \ + js/compatibility_tests/v3.0.0/jasmine3.json \ + js/compatibility_tests/v3.0.0/message_test.js \ + js/compatibility_tests/v3.0.0/proto3_test.js \ + js/compatibility_tests/v3.0.0/proto3_test.proto \ + js/compatibility_tests/v3.0.0/test2.proto \ + js/compatibility_tests/v3.0.0/test3.proto \ + js/compatibility_tests/v3.0.0/test4.proto \ + js/compatibility_tests/v3.0.0/test5.proto \ + js/compatibility_tests/v3.0.0/testbinary.proto \ + js/compatibility_tests/v3.0.0/testempty.proto \ + js/compatibility_tests/v3.0.0/test.proto \ + js/compatibility_tests/v3.0.0/test.sh \ + js/compatibility_tests/v3.1.0/testempty.proto \ + js/compatibility_tests/v3.1.0/testbinary.proto \ + js/compatibility_tests/v3.1.0/test5.proto \ + js/compatibility_tests/v3.1.0/test4.proto \ + js/compatibility_tests/v3.1.0/test3.proto \ + js/compatibility_tests/v3.1.0/test2.proto \ + js/compatibility_tests/v3.1.0/test.proto \ + js/compatibility_tests/v3.1.0/proto3_test.proto \ + js/compatibility_tests/v3.1.0/proto3_test.js \ + js/compatibility_tests/v3.1.0/message_test.js \ + js/compatibility_tests/v3.1.0/maps_test.js \ + js/compatibility_tests/v3.1.0/debug_test.js \ + js/compatibility_tests/v3.1.0/data.proto \ + js/compatibility_tests/v3.1.0/commonjs/test7/test7.proto \ + js/compatibility_tests/v3.1.0/commonjs/test6/test6.proto \ + js/compatibility_tests/v3.1.0/binary/writer_test.js \ + js/compatibility_tests/v3.1.0/binary/utils_test.js \ + js/compatibility_tests/v3.1.0/binary/reader_test.js \ + js/compatibility_tests/v3.1.0/binary/proto_test.js \ + js/compatibility_tests/v3.1.0/binary/decoder_test.js \ + js/compatibility_tests/v3.1.0/binary/arith_test.js \ + js/data.proto \ + js/debug.js \ + js/debug_test.js \ + js/experimental/runtime/kernel/message_set.js \ + js/experimental/runtime/kernel/message_set_test.js \ + js/experimental/runtime/kernel/tag.js \ + js/experimental/runtime/kernel/tag_test.js \ + js/gulpfile.js \ + js/jasmine.json \ + js/map.js \ + js/maps_test.js \ + js/message.js \ + js/message_test.js \ + js/node_loader.js \ + js/package.json \ + js/proto3_test.js \ + js/proto3_test.proto \ + js/test.proto \ + js/test2.proto \ + js/test3.proto \ + js/test4.proto \ + js/test5.proto \ + js/test8.proto \ + js/test9.proto \ + js/test10.proto \ + js/test11.proto \ + js/test12.proto \ + js/test13.proto \ + js/test14.proto \ + js/test15.proto \ + js/test_bootstrap.js \ + js/testbinary.proto \ + js/testempty.proto \ + js/testlargenumbers.proto \ + js/experimental/runtime/testing/jasmine_protobuf.js \ + js/experimental/runtime/testing/ensure_custom_equality_test.js \ + js/experimental/runtime/testing/binary/test_message.js \ + js/experimental/runtime/kernel/writer_test.js \ + js/experimental/runtime/kernel/writer.js \ + js/experimental/runtime/kernel/wire_type.js \ + js/experimental/runtime/kernel/uint8arrays_test.js \ + js/experimental/runtime/kernel/uint8arrays.js \ + js/experimental/runtime/kernel/uint32_test_pairs.js \ + js/experimental/runtime/kernel/typed_arrays_test.js \ + js/experimental/runtime/kernel/typed_arrays.js \ + js/experimental/runtime/kernel/textencoding_test.js \ + js/experimental/runtime/kernel/textencoding.js \ + js/experimental/runtime/kernel/storage.js \ + js/experimental/runtime/kernel/sint64_test_pairs.js \ + js/experimental/runtime/kernel/sint32_test_pairs.js \ + js/experimental/runtime/kernel/sfixed64_test_pairs.js \ + js/experimental/runtime/kernel/sfixed32_test_pairs.js \ + js/experimental/runtime/kernel/reader_test.js \ + js/experimental/runtime/kernel/reader.js \ + js/experimental/runtime/kernel/packed_uint32_test_pairs.js \ + js/experimental/runtime/kernel/packed_sint64_test_pairs.js \ + js/experimental/runtime/kernel/packed_sint32_test_pairs.js \ + js/experimental/runtime/kernel/packed_sfixed64_test_pairs.js \ + js/experimental/runtime/kernel/packed_sfixed32_test_pairs.js \ + js/experimental/runtime/kernel/packed_int64_test_pairs.js \ + js/experimental/runtime/kernel/packed_int32_test_pairs.js \ + js/experimental/runtime/kernel/packed_float_test_pairs.js \ + js/experimental/runtime/kernel/packed_fixed32_test_pairs.js \ + js/experimental/runtime/kernel/packed_double_test_pairs.js \ + js/experimental/runtime/kernel/packed_bool_test_pairs.js \ + js/experimental/runtime/kernel/kernel_test.js \ + js/experimental/runtime/kernel/kernel_repeated_test.js \ + js/experimental/runtime/kernel/kernel_compatibility_test.js \ + js/experimental/runtime/kernel/kernel.js \ + js/experimental/runtime/kernel/internal_message.js \ + js/experimental/runtime/kernel/int64_test_pairs.js \ + js/experimental/runtime/kernel/int32_test_pairs.js \ + js/experimental/runtime/kernel/indexer_test.js \ + js/experimental/runtime/kernel/indexer.js \ + js/experimental/runtime/kernel/float_test_pairs.js \ + js/experimental/runtime/kernel/fixed32_test_pairs.js \ + js/experimental/runtime/kernel/field.js \ + js/experimental/runtime/kernel/double_test_pairs.js \ + js/experimental/runtime/kernel/conformance/wire_format.js \ + js/experimental/runtime/kernel/conformance/test_all_types_proto3.js \ + js/experimental/runtime/kernel/conformance/test_all_types_proto2.js \ + js/experimental/runtime/kernel/conformance/conformance_testee_runner_node.js \ + js/experimental/runtime/kernel/conformance/conformance_testee.js \ + js/experimental/runtime/kernel/conformance/conformance_response.js \ + js/experimental/runtime/kernel/conformance/conformance_request.js \ + js/experimental/runtime/kernel/buffer_decoder_test.js \ + js/experimental/runtime/kernel/buffer_decoder_helper.js \ + js/experimental/runtime/kernel/buffer_decoder.js \ + js/experimental/runtime/kernel/bool_test_pairs.js \ + js/experimental/runtime/kernel/binary_storage_test.js \ + js/experimental/runtime/kernel/binary_storage.js \ + js/experimental/runtime/internal/checks_test.js \ + js/experimental/runtime/internal/checks.js \ + js/experimental/runtime/int64_test.js \ + js/experimental/runtime/int64.js \ + js/experimental/runtime/bytestring_test.js \ + js/experimental/runtime/bytestring_internal.js \ + js/experimental/runtime/bytestring.js \ + js/experimental/benchmarks/code_size/kernel/popular_types.js \ + js/experimental/benchmarks/code_size/kernel/all_types.js \ + js/experimental/benchmarks/code_size/code_size_base.js \ + js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto3.js \ + js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto2.js \ + js/experimental/benchmarks/code_size/apps_jspb/all_types_proto3.js \ + js/experimental/benchmarks/code_size/apps_jspb/all_types_proto2.js + +all_EXTRA_DIST = $(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) $(js_EXTRA_DIST) +EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ + autogen.sh \ + generate_descriptor_proto.sh \ + README.md \ + LICENSE \ + CONTRIBUTORS.txt \ + CHANGES.txt \ + update_file_lists.sh \ + BUILD \ + WORKSPACE \ + cmake/CMakeLists.txt \ + cmake/README.md \ + cmake/conformance.cmake \ + cmake/examples.cmake \ + cmake/extract_includes.bat.in \ + cmake/install.cmake \ + cmake/libprotobuf.cmake \ + cmake/libprotobuf-lite.cmake \ + cmake/libprotoc.cmake \ + cmake/protobuf-config-version.cmake.in \ + cmake/protobuf-config.cmake.in \ + cmake/protobuf-lite.pc.cmake \ + cmake/protobuf-module.cmake.in \ + cmake/protobuf-options.cmake \ + cmake/protobuf.pc.cmake \ + cmake/protoc.cmake \ + cmake/tests.cmake \ + cmake/version.rc.in \ + compiler_config_setting.bzl \ + build_files_updated_unittest.sh \ + cc_proto_blacklist_test.bzl \ + editors/README.txt \ + editors/proto.vim \ + editors/protobuf-mode.el \ + examples/AddPerson.java \ + examples/BUILD \ + examples/CMakeLists.txt \ + examples/ListPeople.java \ + examples/Makefile \ + examples/README.md \ + examples/WORKSPACE \ + examples/add_person.cc \ + examples/add_person.dart \ + examples/add_person.go \ + examples/add_person.py \ + examples/add_person_test.go \ + examples/addressbook.proto \ + examples/list_people.cc \ + examples/list_people.dart \ + examples/list_people.go \ + examples/list_people.py \ + examples/list_people_test.go \ + examples/pubspec.yaml \ + protobuf.bzl \ + protobuf_deps.bzl \ + python/release/wheel/build_wheel_manylinux.sh \ + python/release/wheel/Dockerfile \ + python/release/wheel/protobuf_optimized_pip.sh \ + python/release/wheel/README.md \ + third_party/six.BUILD \ + third_party/zlib.BUILD \ + third_party/wyhash/LICENSE \ + third_party/wyhash/wyhash.h \ + util/python/BUILD + + +# Deletes all the files generated by autogen.sh. +MAINTAINERCLEANFILES = \ + aclocal.m4 \ + ar-lib \ + config.guess \ + config.sub \ + configure \ + depcomp \ + install-sh \ + ltmain.sh \ + Makefile.in \ + missing \ + mkinstalldirs \ + config.h.in \ + stamp.h.in \ + m4/ltsugar.m4 \ + m4/libtool.m4 \ + m4/ltversion.m4 \ + m4/lt~obsolete.m4 \ + m4/ltoptions.m4 + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +protobuf.pc: $(top_builddir)/config.status $(srcdir)/protobuf.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +protobuf-lite.pc: $(top_builddir)/config.status $(srcdir)/protobuf-lite.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(am__recursive_targets) all check-am install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am check-local clean clean-cscope \ + clean-generic clean-libtool clean-local cscope cscopelist-am \ + ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \ + dist-shar dist-tarZ dist-xz dist-zip dist-zstd distcheck \ + distclean distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + + +# Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS +# because then "make check" would also build and run all of gmock's own tests, +# which takes a lot of time and is generally not useful to us. Also, we don't +# want "make install" to recurse into gmock since we don't want to overwrite +# the installed version of gmock if there is one. +check-local: + @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock" + @cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la + @cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la + +# We would like to clean gmock when "make clean" is invoked. But we have to +# be careful because clean-local is also invoked during "make distclean", but +# "make distclean" already recurses into gmock because it's listed among the +# DIST_SUBDIRS. distclean will delete gmock/Makefile, so if we then try to +# cd to the directory again and "make clean" it will fail. So, check that the +# Makefile exists before recursing. +clean-local: + @if test -e third_party/googletest/Makefile; then \ + echo "Making clean in googletest"; \ + cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \ + fi; \ + if test -e conformance/Makefile; then \ + echo "Making clean in conformance"; \ + cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \ + fi; \ + if test -e benchmarks/Makefile; then \ + echo "Making clean in benchmarks"; \ + cd benchmarks && $(MAKE) $(AM_MAKEFLAGS) clean; \ + fi; \ + if test -e objectivec/DevTools; then \ + echo "Cleaning any ObjC pyc files"; \ + rm -f objectivec/DevTools/*.pyc; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Protobuf.podspec b/Protobuf.podspec new file mode 100644 index 0000000000000000000000000000000000000000..7a7363aaf0fa3a5a6283a2468cbeb70da861cc98 --- /dev/null +++ b/Protobuf.podspec @@ -0,0 +1,42 @@ +# This file describes to Cocoapods how to integrate the Objective-C runtime into a dependent +# project. +# Despite this file being specific to Objective-C, it needs to be on the root of the repository. +# Otherwise, Cocoapods gives trouble like not picking up the license file correctly, or not letting +# dependent projects use the :git notation to refer to the library. +Pod::Spec.new do |s| + s.name = 'Protobuf' + s.version = '3.14.0' + s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' + s.homepage = 'https://github.com/protocolbuffers/protobuf' + s.license = '3-Clause BSD License' + s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' } + s.cocoapods_version = '>= 1.0' + + s.source = { :git => 'https://github.com/protocolbuffers/protobuf.git', + :tag => "v#{s.version}" } + + s.source_files = 'objectivec/*.{h,m}', + 'objectivec/google/protobuf/Any.pbobjc.h', + 'objectivec/google/protobuf/Api.pbobjc.h', + 'objectivec/google/protobuf/Duration.pbobjc.h', + 'objectivec/google/protobuf/Empty.pbobjc.h', + 'objectivec/google/protobuf/FieldMask.pbobjc.h', + 'objectivec/google/protobuf/SourceContext.pbobjc.h', + 'objectivec/google/protobuf/Struct.pbobjc.h', + 'objectivec/google/protobuf/Timestamp.pbobjc.h', + 'objectivec/google/protobuf/Type.pbobjc.h', + 'objectivec/google/protobuf/Wrappers.pbobjc.h' + # The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be + # left out, as it's an umbrella implementation file. + s.exclude_files = 'objectivec/GPBProtocolBuffers.m' + + # Set a CPP symbol so the code knows to use framework imports. + s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' } + s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' } + + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '2.0' + s.requires_arc = false +end diff --git a/README.OpenSource b/README.OpenSource index 5912dc26c5d9b947f13212e45904a408f2ef31ac..5938ce2540f9ee1691b1f61aaf258235e35cb503 100644 --- a/README.OpenSource +++ b/README.OpenSource @@ -1,10 +1,10 @@ [ { - "Name": "google/protobuf", + "Name": "openEuler:protobuf", "License": "BSD 3-Clause License", "License File": "LICENSE", - "Version Number": "3.13.0", - "Upstream URL": "https://github.com/protocolbuffers/protobuf", + "Version Number": "3.14.0-8.oe2203sp3", + "Upstream URL": "https://gitee.com/src-openeuler/protobuf.git", "Description": "Protocol Buffers - Google's data interchange format." } ] diff --git a/WORKSPACE b/WORKSPACE index cb16ae882c1285324af05f97ec55a1e24c7e5a2a..5a767a97c0ac6932f1d5c99fbee930de057638fa 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -29,13 +29,13 @@ bind( actual = "//util/python:python_headers", ) -# TODO(yannic): Remove in 3.13.0. +# TODO(yannic): Remove in 3.14.0. bind( name = "gtest", actual = "@com_google_googletest//:gtest", ) -# TODO(yannic): Remove in 3.13.0. +# TODO(yannic): Remove in 3.14.0. bind( name = "gtest_main", actual = "@com_google_googletest//:gtest_main", diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000000000000000000000000000000000000..391bb38a83a36fcd90968a3e612ceba2bc7dd49c --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1245 @@ +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- + +# Copyright (C) 1996-2020 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.2], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.2])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ac_system_extensions.m4]) +m4_include([m4/acx_check_suncc.m4]) +m4_include([m4/ax_cxx_compile_stdcxx.m4]) +m4_include([m4/ax_prog_cc_for_build.m4]) +m4_include([m4/ax_prog_cxx_for_build.m4]) +m4_include([m4/ax_pthread.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([m4/stl_hash.m4]) diff --git a/appveyor.bat b/appveyor.bat deleted file mode 100644 index 7a35ceb4d678e9c028d4f7ca4cb70da64e816bb6..0000000000000000000000000000000000000000 --- a/appveyor.bat +++ /dev/null @@ -1,48 +0,0 @@ -setlocal - -IF %platform%==MinGW GOTO build_mingw -IF %language%==cpp GOTO build_cpp -IF %language%==csharp GOTO build_csharp - -echo Unsupported language %language% and platform %platform%. Exiting. -goto :error - -:build_mingw -echo Building MinGW -set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=% -mkdir build_mingw -cd build_mingw -cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake -mingw32-make -j8 all || goto error -rem cd %configuration% -rem tests.exe || goto error -goto :EOF - -:build_cpp -echo Building C++ -mkdir build_msvc -cd build_msvc -cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake -msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error -cd %configuration% -tests.exe || goto error -goto :EOF - -:build_csharp -echo Building C# -cd csharp\src -REM The platform environment variable is implicitly used by msbuild; -REM we don't want it. -set platform= -dotnet restore -dotnet build -c %configuration% || goto error - -echo Testing C# -dotnet test -c %configuration% -f netcoreapp2.1 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error -dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error - -goto :EOF - -:error -echo Failed! -EXIT /b %ERRORLEVEL% diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 91f737a8c019f36d979b03724344cb2fac9cb308..0000000000000000000000000000000000000000 --- a/appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -configuration: - - Debug - -environment: - matrix: - # Only test few combinations: "Visual Studio 2015 (14) + Win64/MinGW + Debug + DLL". We can - # test more combinations but AppVeyor just takes too long to finish (each - # combination takes ~15mins). - - platform: MinGW - language: cpp - image: Visual Studio 2015 - - - platform: Win64 - language: cpp - image: Visual Studio 2015 - BUILD_DLL: ON - UNICODE: ON - - - platform: Win64 - language: cpp - image: Visual Studio 2017 - BUILD_DLL: OFF - UNICODE: ON - - - platform: Win64 - language: csharp - image: Visual Studio 2017 - -# Our build scripts run tests automatically; we don't want AppVeyor -# to try to detect them itself. -test: off - -install: - - git submodule update --init --recursive - -before_build: - - if %platform%==MinGW set generator=MinGW Makefiles - - if %platform%==Win32 set generator=Visual Studio 14 - - if %platform%==Win64 set generator=Visual Studio 14 Win64 - - if %platform%==Win32 set vcplatform=Win32 - - if %platform%==Win64 set vcplatform=x64 - -build_script: - - CALL appveyor.bat - -skip_commits: - message: /.*\[skip appveyor\].*/ diff --git a/ar-lib b/ar-lib new file mode 100644 index 0000000000000000000000000000000000000000..1e9388e2ae3aee28242b809b701bd9bc8bdc97e6 --- /dev/null +++ b/ar-lib @@ -0,0 +1,271 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2019-07-04.01; # UTC + +# Copyright (C) 2010-2020 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin | msys) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = cpp-benchmark$(EXEEXT) cpp-no-group-benchmark$(EXEEXT) \ + protoc-gen-gogoproto$(EXEEXT) gogo-data-scrubber$(EXEEXT) \ + protoc-gen-proto2_to_proto3$(EXEEXT) \ + proto3-data-stripper$(EXEEXT) +subdir = benchmarks +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_system_extensions.m4 \ + $(top_srcdir)/m4/acx_check_suncc.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_prog_cxx_for_build.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/stl_hash.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" +PROGRAMS = $(bin_PROGRAMS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +LTLIBRARIES = $(lib_LTLIBRARIES) +libbenchmark_messages_la_DEPENDENCIES = \ + $(top_srcdir)/src/.libs/libprotobuf.la +am__dirstamp = $(am__leading_dot)dirstamp +am_libbenchmark_messages_la_OBJECTS = \ + python/libbenchmark_messages_la-python_benchmark_messages.lo +am__objects_1 = cpp/libbenchmark_messages_la-benchmarks.pb.lo \ + cpp/datasets/google_message1/proto3/libbenchmark_messages_la-benchmark_message1_proto3.pb.lo +am__objects_2 = cpp/datasets/google_message1/proto2/libbenchmark_messages_la-benchmark_message1_proto2.pb.lo \ + cpp/datasets/google_message2/libbenchmark_messages_la-benchmark_message2.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_1.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_2.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_3.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_4.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_5.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_6.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_7.pb.lo \ + cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_8.pb.lo \ + cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4.pb.lo \ + cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_1.pb.lo \ + cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_2.pb.lo \ + cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_3.pb.lo +am__objects_3 = +nodist_libbenchmark_messages_la_OBJECTS = $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) $(am__objects_3) +libbenchmark_messages_la_OBJECTS = \ + $(am_libbenchmark_messages_la_OBJECTS) \ + $(nodist_libbenchmark_messages_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libbenchmark_messages_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(libbenchmark_messages_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_cpp_benchmark_OBJECTS = cpp/benchmark-cpp_benchmark.$(OBJEXT) +am__objects_4 = cpp/benchmark-benchmarks.pb.$(OBJEXT) \ + cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.$(OBJEXT) +am__objects_5 = cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.$(OBJEXT) \ + cpp/datasets/google_message2/benchmark-benchmark_message2.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.$(OBJEXT) \ + cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.$(OBJEXT) \ + cpp/datasets/google_message4/benchmark-benchmark_message4.pb.$(OBJEXT) \ + cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.$(OBJEXT) \ + cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.$(OBJEXT) \ + cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.$(OBJEXT) +nodist_cpp_benchmark_OBJECTS = $(am__objects_4) $(am__objects_5) \ + $(am__objects_3) $(am__objects_3) +cpp_benchmark_OBJECTS = $(am_cpp_benchmark_OBJECTS) \ + $(nodist_cpp_benchmark_OBJECTS) +cpp_benchmark_DEPENDENCIES = $(top_srcdir)/src/libprotobuf.la \ + $(top_srcdir)/third_party/benchmark/src/libbenchmark.a +am_cpp_no_group_benchmark_OBJECTS = gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.$(OBJEXT) +am__objects_6 = gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.$(OBJEXT) +am__objects_7 = gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.$(OBJEXT) \ + gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.$(OBJEXT) +nodist_cpp_no_group_benchmark_OBJECTS = $(am__objects_6) \ + $(am__objects_7) $(am__objects_3) $(am__objects_3) +cpp_no_group_benchmark_OBJECTS = $(am_cpp_no_group_benchmark_OBJECTS) \ + $(nodist_cpp_no_group_benchmark_OBJECTS) +cpp_no_group_benchmark_DEPENDENCIES = \ + $(top_srcdir)/src/libprotobuf.la \ + $(top_srcdir)/third_party/benchmark/src/libbenchmark.a +am_gogo_data_scrubber_OBJECTS = \ + util/gogo_data_scrubber-gogo_data_scrubber.$(OBJEXT) +am__objects_8 = cpp/gogo_data_scrubber-benchmarks.pb.$(OBJEXT) \ + cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.$(OBJEXT) +am__objects_9 = cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.$(OBJEXT) \ + cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.$(OBJEXT) \ + cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.$(OBJEXT) \ + cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.$(OBJEXT) \ + cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.$(OBJEXT) \ + cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.$(OBJEXT) \ + cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.$(OBJEXT) +nodist_gogo_data_scrubber_OBJECTS = $(am__objects_8) $(am__objects_9) \ + $(am__objects_3) $(am__objects_3) +gogo_data_scrubber_OBJECTS = $(am_gogo_data_scrubber_OBJECTS) \ + $(nodist_gogo_data_scrubber_OBJECTS) +gogo_data_scrubber_DEPENDENCIES = $(top_srcdir)/src/libprotobuf.la +am_proto3_data_stripper_OBJECTS = \ + util/proto3_data_stripper-proto3_data_stripper.$(OBJEXT) +am__objects_10 = cpp/proto3_data_stripper-benchmarks.pb.$(OBJEXT) \ + cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.$(OBJEXT) +am__objects_11 = cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.$(OBJEXT) \ + cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.$(OBJEXT) \ + cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.$(OBJEXT) \ + cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.$(OBJEXT) \ + cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.$(OBJEXT) \ + cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.$(OBJEXT) \ + cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.$(OBJEXT) +nodist_proto3_data_stripper_OBJECTS = $(am__objects_10) \ + $(am__objects_11) $(am__objects_3) $(am__objects_3) +proto3_data_stripper_OBJECTS = $(am_proto3_data_stripper_OBJECTS) \ + $(nodist_proto3_data_stripper_OBJECTS) +proto3_data_stripper_DEPENDENCIES = $(top_srcdir)/src/libprotobuf.la +am_protoc_gen_gogoproto_OBJECTS = \ + util/protoc_gen_gogoproto-protoc-gen-gogoproto.$(OBJEXT) +protoc_gen_gogoproto_OBJECTS = $(am_protoc_gen_gogoproto_OBJECTS) +protoc_gen_gogoproto_DEPENDENCIES = $(top_srcdir)/src/libprotobuf.la \ + $(top_srcdir)/src/libprotoc.la +am_protoc_gen_proto2_to_proto3_OBJECTS = util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.$(OBJEXT) +protoc_gen_proto2_to_proto3_OBJECTS = \ + $(am_protoc_gen_proto2_to_proto3_OBJECTS) +protoc_gen_proto2_to_proto3_DEPENDENCIES = \ + $(top_srcdir)/src/libprotobuf.la \ + $(top_srcdir)/src/libprotoc.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = cpp/$(DEPDIR)/benchmark-benchmarks.pb.Po \ + cpp/$(DEPDIR)/benchmark-cpp_benchmark.Po \ + cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Po \ + cpp/$(DEPDIR)/libbenchmark_messages_la-benchmarks.pb.Plo \ + cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Po \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Po \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Po \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto2.pb.Plo \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Po \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Po \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Po \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto3.pb.Plo \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Po \ + cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Po \ + cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Po \ + cpp/datasets/google_message2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message2.pb.Plo \ + cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_1.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_2.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_3.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_4.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_5.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_6.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_7.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_8.pb.Plo \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Po \ + cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4.pb.Plo \ + cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_1.pb.Plo \ + cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_2.pb.Plo \ + cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_3.pb.Plo \ + cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Po \ + cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Po \ + gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Po \ + gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Po \ + gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Po \ + gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Po \ + gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Po \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Po \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Po \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Po \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Po \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Po \ + python/$(DEPDIR)/libbenchmark_messages_la-python_benchmark_messages.Plo \ + util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Po \ + util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Po \ + util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Po \ + util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libbenchmark_messages_la_SOURCES) \ + $(nodist_libbenchmark_messages_la_SOURCES) \ + $(cpp_benchmark_SOURCES) $(nodist_cpp_benchmark_SOURCES) \ + $(cpp_no_group_benchmark_SOURCES) \ + $(nodist_cpp_no_group_benchmark_SOURCES) \ + $(gogo_data_scrubber_SOURCES) \ + $(nodist_gogo_data_scrubber_SOURCES) \ + $(proto3_data_stripper_SOURCES) \ + $(nodist_proto3_data_stripper_SOURCES) \ + $(protoc_gen_gogoproto_SOURCES) \ + $(protoc_gen_proto2_to_proto3_SOURCES) +DIST_SOURCES = $(libbenchmark_messages_la_SOURCES) \ + $(cpp_benchmark_SOURCES) $(cpp_no_group_benchmark_SOURCES) \ + $(gogo_data_scrubber_SOURCES) $(proto3_data_stripper_SOURCES) \ + $(protoc_gen_gogoproto_SOURCES) \ + $(protoc_gen_proto2_to_proto3_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXCPPFLAGS_FOR_BUILD = @CXXCPPFLAGS_FOR_BUILD@ +CXXCPP_FOR_BUILD = @CXXCPP_FOR_BUILD@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIST_LANG = @DIST_LANG@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +ISAINFO = @ISAINFO@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBATOMIC_LIBS = @LIBATOMIC_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POW_LIB = @POW_LIB@ +PROTOBUF_OPT_FLAG = @PROTOBUF_OPT_FLAG@ +PROTOC = @PROTOC@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_CXX_FOR_BUILD = @ac_ct_CXX_FOR_BUILD@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +benchmarks_protoc_inputs_benchmark_wrapper = \ + benchmarks.proto + +benchmarks_protoc_inputs = \ + datasets/google_message1/proto3/benchmark_message1_proto3.proto + +benchmarks_protoc_inputs_proto2 = \ + datasets/google_message1/proto2/benchmark_message1_proto2.proto \ + datasets/google_message2/benchmark_message2.proto \ + datasets/google_message3/benchmark_message3.proto \ + datasets/google_message3/benchmark_message3_1.proto \ + datasets/google_message3/benchmark_message3_2.proto \ + datasets/google_message3/benchmark_message3_3.proto \ + datasets/google_message3/benchmark_message3_4.proto \ + datasets/google_message3/benchmark_message3_5.proto \ + datasets/google_message3/benchmark_message3_6.proto \ + datasets/google_message3/benchmark_message3_7.proto \ + datasets/google_message3/benchmark_message3_8.proto \ + datasets/google_message4/benchmark_message4.proto \ + datasets/google_message4/benchmark_message4_1.proto \ + datasets/google_message4/benchmark_message4_2.proto \ + datasets/google_message4/benchmark_message4_3.proto + +all_data = $$(find $$(cd $(srcdir) && pwd) -type f -name "dataset.*.pb" -not -path "$$(cd $(srcdir) && pwd)/tmp/*") + +############# CPP RULES ############## +benchmarks_protoc_outputs = \ + cpp/benchmarks.pb.cc \ + cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc + +benchmarks_protoc_outputs_header = \ + cpp/benchmarks.pb.h \ + cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h + +benchmarks_protoc_outputs_proto2_header = \ + cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \ + cpp/datasets/google_message2/benchmark_message2.pb.h \ + cpp/datasets/google_message3/benchmark_message3.pb.h \ + cpp/datasets/google_message3/benchmark_message3_1.pb.h \ + cpp/datasets/google_message3/benchmark_message3_2.pb.h \ + cpp/datasets/google_message3/benchmark_message3_3.pb.h \ + cpp/datasets/google_message3/benchmark_message3_4.pb.h \ + cpp/datasets/google_message3/benchmark_message3_5.pb.h \ + cpp/datasets/google_message3/benchmark_message3_6.pb.h \ + cpp/datasets/google_message3/benchmark_message3_7.pb.h \ + cpp/datasets/google_message3/benchmark_message3_8.pb.h \ + cpp/datasets/google_message4/benchmark_message4.pb.h \ + cpp/datasets/google_message4/benchmark_message4_1.pb.h \ + cpp/datasets/google_message4/benchmark_message4_2.pb.h \ + cpp/datasets/google_message4/benchmark_message4_3.pb.h + +benchmarks_protoc_outputs_proto2 = \ + cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \ + cpp/datasets/google_message2/benchmark_message2.pb.cc \ + cpp/datasets/google_message3/benchmark_message3.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_1.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_2.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_3.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_4.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_5.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_6.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_7.pb.cc \ + cpp/datasets/google_message3/benchmark_message3_8.pb.cc \ + cpp/datasets/google_message4/benchmark_message4.pb.cc \ + cpp/datasets/google_message4/benchmark_message4_1.pb.cc \ + cpp/datasets/google_message4/benchmark_message4_2.pb.cc \ + cpp/datasets/google_message4/benchmark_message4_3.pb.cc + +AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare +cpp_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a +cpp_benchmark_SOURCES = cpp/cpp_benchmark.cc +cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(top_srcdir)/third_party/benchmark/include +nodist_cpp_benchmark_SOURCES = \ + $(benchmarks_protoc_outputs) \ + $(benchmarks_protoc_outputs_proto2) \ + $(benchmarks_protoc_outputs_proto2_header) \ + $(benchmarks_protoc_outputs_header) + + +############ CPP RULES END ############ + +############# JAVA RULES ############## +java_benchmark_testing_files = \ + java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java + +python_cpp_pkg_flags = `pkg-config --cflags --libs python` +lib_LTLIBRARIES = libbenchmark_messages.la +libbenchmark_messages_la_SOURCES = python/python_benchmark_messages.cc +libbenchmark_messages_la_LIBADD = $(top_srcdir)/src/.libs/libprotobuf.la +libbenchmark_messages_la_LDFLAGS = -version-info 1:0:0 -export-dynamic +libbenchmark_messages_la_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp $(python_cpp_pkg_flags) +nodist_libbenchmark_messages_la_SOURCES = \ + $(benchmarks_protoc_outputs) \ + $(benchmarks_protoc_outputs_proto2) \ + $(benchmarks_protoc_outputs_proto2_header) \ + $(benchmarks_protoc_outputs_header) + + +############# PYTHON RULES END ############## + +############# GO RULES BEGIN ############## +benchmarks_protoc_inputs_proto2_message1 = \ + datasets/google_message1/proto2/benchmark_message1_proto2.proto + +benchmarks_protoc_inputs_proto2_message2 = \ + datasets/google_message2/benchmark_message2.proto + +benchmarks_protoc_inputs_proto2_message3 = \ + datasets/google_message3/benchmark_message3.proto \ + datasets/google_message3/benchmark_message3_1.proto \ + datasets/google_message3/benchmark_message3_2.proto \ + datasets/google_message3/benchmark_message3_3.proto \ + datasets/google_message3/benchmark_message3_4.proto \ + datasets/google_message3/benchmark_message3_5.proto \ + datasets/google_message3/benchmark_message3_6.proto \ + datasets/google_message3/benchmark_message3_7.proto \ + datasets/google_message3/benchmark_message3_8.proto + +benchmarks_protoc_inputs_proto2_message4 = \ + datasets/google_message4/benchmark_message4.proto \ + datasets/google_message4/benchmark_message4_1.proto \ + datasets/google_message4/benchmark_message4_2.proto \ + datasets/google_message4/benchmark_message4_3.proto + + +############# GO RULES END ############## + +############# GOGO RULES BEGIN ############ +cpp_no_group_benchmarks_protoc_outputs_header = \ + gogo/cpp_no_group/benchmarks.pb.h \ + gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h + +cpp_no_group_benchmarks_protoc_outputs = \ + gogo/cpp_no_group/benchmarks.pb.cc \ + gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc + +cpp_no_group_benchmarks_protoc_outputs_proto2_header = \ + gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \ + gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.h \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.h \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.h \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.h \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.h \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.h + +cpp_no_group_benchmarks_protoc_outputs_proto2 = \ + gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \ + gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc \ + gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc \ + gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc + +cpp_no_group_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a +cpp_no_group_benchmark_SOURCES = gogo/cpp_no_group/cpp_benchmark.cc +cpp_no_group_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/gogo/cpp_no_group -I$(top_srcdir)/third_party/benchmark/include +nodist_cpp_no_group_benchmark_SOURCES = \ + $(cpp_no_group_benchmarks_protoc_outputs_proto2) \ + $(cpp_no_group_benchmarks_protoc_outputs) \ + $(cpp_no_group_benchmarks_protoc_outputs_header) \ + $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) + +gogo_data = $$(for data in $(all_data); do echo "tmp/gogo_data$${data\#$(srcdir)}"; done | xargs) +protoc_gen_gogoproto_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la +protoc_gen_gogoproto_SOURCES = util/protoc-gen-gogoproto.cc +protoc_gen_gogoproto_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util +gogo_data_scrubber_LDADD = $(top_srcdir)/src/libprotobuf.la +gogo_data_scrubber_SOURCES = util/gogo_data_scrubber.cc +gogo_data_scrubber_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util +nodist_gogo_data_scrubber_SOURCES = \ + $(benchmarks_protoc_outputs) \ + $(benchmarks_protoc_outputs_proto2) \ + $(benchmarks_protoc_outputs_proto2_header) \ + $(benchmarks_protoc_outputs_header) + +protoc_gen_proto2_to_proto3_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la +protoc_gen_proto2_to_proto3_SOURCES = util/protoc-gen-proto2_to_proto3.cc +protoc_gen_proto2_to_proto3_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util +proto3_data_stripper_LDADD = $(top_srcdir)/src/libprotobuf.la +proto3_data_stripper_SOURCES = util/proto3_data_stripper.cc +proto3_data_stripper_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util +nodist_proto3_data_stripper_SOURCES = \ + $(benchmarks_protoc_outputs) \ + $(benchmarks_protoc_outputs_proto2) \ + $(benchmarks_protoc_outputs_proto2_header) \ + $(benchmarks_protoc_outputs_header) + +full_srcdir = $$(cd $(srcdir) && pwd) +proto3_data = $$(for data in $(all_data); do echo $(full_srcdir)"/tmp/proto3_data$${data\#$(full_srcdir)}"; done | xargs) + +############ JS RULE END ############# +EXTRA_DIST = \ + $(benchmarks_protoc_inputs_benchmark_wrapper) \ + $(benchmarks_protoc_inputs) \ + $(benchmarks_protoc_inputs_proto2) \ + google_size.proto + +MAINTAINERCLEANFILES = \ + Makefile.in + +CLEANFILES = \ + $(benchmarks_protoc_outputs) \ + $(benchmarks_protoc_outputs_header) \ + $(benchmarks_protoc_outputs_proto2) \ + $(benchmarks_protoc_outputs_proto2_header) \ + initialize_submodule \ + make_tmp_dir \ + protoc_middleman \ + protoc_middleman2 \ + javac_middleman \ + java-benchmark \ + python_cpp_proto_library \ + python-pure-python-benchmark \ + python-cpp-reflection-benchmark \ + python-cpp-generated-code-benchmark \ + go-benchmark \ + go_protoc_middleman \ + make_tmp_dir_gogo \ + gogo_proto_middleman \ + generate_gogo_data \ + go_no_group_protoc_middleman \ + go_no_group \ + go-no-group-benchmark \ + $(cpp_no_group_benchmarks_protoc_outputs_header) \ + $(cpp_no_group_benchmarks_protoc_outputs) \ + $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) \ + $(cpp_no_group_benchmarks_protoc_outputs_proto2) \ + generate_all_gogo_benchmark_code \ + generate-gogo-benchmark-code \ + cpp_no_group_protoc_middleman \ + generate_cpp_no_group_benchmark_code \ + generate_gogo_benchmark_code \ + gogofast_protoc_middleman \ + gogofast \ + gogofaster_protoc_middleman \ + gogofaster \ + gogoslick_protoc_middleman \ + gogoslick \ + gogo-benchmark \ + gogo/cpp_no_group/cpp_benchmark.* \ + proto3_proto_middleman \ + generate_proto3_data \ + php-benchmark \ + php-c-benchmark \ + proto3_middleman_php \ + pbjs_preparation \ + pbjs_middleman \ + pbjs-benchmark \ + js_preparation \ + js_middleman \ + js-benchmark + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu benchmarks/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu benchmarks/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +python/$(am__dirstamp): + @$(MKDIR_P) python + @: > python/$(am__dirstamp) +python/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) python/$(DEPDIR) + @: > python/$(DEPDIR)/$(am__dirstamp) +python/libbenchmark_messages_la-python_benchmark_messages.lo: \ + python/$(am__dirstamp) python/$(DEPDIR)/$(am__dirstamp) +cpp/$(am__dirstamp): + @$(MKDIR_P) cpp + @: > cpp/$(am__dirstamp) +cpp/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cpp/$(DEPDIR) + @: > cpp/$(DEPDIR)/$(am__dirstamp) +cpp/libbenchmark_messages_la-benchmarks.pb.lo: cpp/$(am__dirstamp) \ + cpp/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto3/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message1/proto3 + @: > cpp/datasets/google_message1/proto3/$(am__dirstamp) +cpp/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message1/proto3/$(DEPDIR) + @: > cpp/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto3/libbenchmark_messages_la-benchmark_message1_proto3.pb.lo: \ + cpp/datasets/google_message1/proto3/$(am__dirstamp) \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto2/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message1/proto2 + @: > cpp/datasets/google_message1/proto2/$(am__dirstamp) +cpp/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message1/proto2/$(DEPDIR) + @: > cpp/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto2/libbenchmark_messages_la-benchmark_message1_proto2.pb.lo: \ + cpp/datasets/google_message1/proto2/$(am__dirstamp) \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message2/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message2 + @: > cpp/datasets/google_message2/$(am__dirstamp) +cpp/datasets/google_message2/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message2/$(DEPDIR) + @: > cpp/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message2/libbenchmark_messages_la-benchmark_message2.pb.lo: \ + cpp/datasets/google_message2/$(am__dirstamp) \ + cpp/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message3 + @: > cpp/datasets/google_message3/$(am__dirstamp) +cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message3/$(DEPDIR) + @: > cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_1.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_2.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_3.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_4.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_5.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_6.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_7.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_8.pb.lo: \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message4 + @: > cpp/datasets/google_message4/$(am__dirstamp) +cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cpp/datasets/google_message4/$(DEPDIR) + @: > cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4.pb.lo: \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_1.pb.lo: \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_2.pb.lo: \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_3.pb.lo: \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) + +libbenchmark_messages.la: $(libbenchmark_messages_la_OBJECTS) $(libbenchmark_messages_la_DEPENDENCIES) $(EXTRA_libbenchmark_messages_la_DEPENDENCIES) + $(AM_V_CXXLD)$(libbenchmark_messages_la_LINK) -rpath $(libdir) $(libbenchmark_messages_la_OBJECTS) $(libbenchmark_messages_la_LIBADD) $(LIBS) +cpp/benchmark-cpp_benchmark.$(OBJEXT): cpp/$(am__dirstamp) \ + cpp/$(DEPDIR)/$(am__dirstamp) +cpp/benchmark-benchmarks.pb.$(OBJEXT): cpp/$(am__dirstamp) \ + cpp/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.$(OBJEXT): \ + cpp/datasets/google_message1/proto3/$(am__dirstamp) \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.$(OBJEXT): \ + cpp/datasets/google_message1/proto2/$(am__dirstamp) \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message2/benchmark-benchmark_message2.pb.$(OBJEXT): \ + cpp/datasets/google_message2/$(am__dirstamp) \ + cpp/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/benchmark-benchmark_message4.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) + +cpp-benchmark$(EXEEXT): $(cpp_benchmark_OBJECTS) $(cpp_benchmark_DEPENDENCIES) $(EXTRA_cpp_benchmark_DEPENDENCIES) + @rm -f cpp-benchmark$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(cpp_benchmark_OBJECTS) $(cpp_benchmark_LDADD) $(LIBS) +gogo/cpp_no_group/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group + @: > gogo/cpp_no_group/$(am__dirstamp) +gogo/cpp_no_group/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/$(DEPDIR) + @: > gogo/cpp_no_group/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.$(OBJEXT): \ + gogo/cpp_no_group/$(am__dirstamp) \ + gogo/cpp_no_group/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message1/proto2/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message1/proto2 + @: > gogo/cpp_no_group/datasets/google_message1/proto2/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR) + @: > gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.$(OBJEXT): gogo/cpp_no_group/datasets/google_message1/proto2/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message2/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message2 + @: > gogo/cpp_no_group/datasets/google_message2/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message2/$(DEPDIR) + @: > gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message2/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message3 + @: > gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR) + @: > gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message4/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message4 + @: > gogo/cpp_no_group/datasets/google_message4/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR) + @: > gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message4/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message4/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message4/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.$(OBJEXT): \ + gogo/cpp_no_group/datasets/google_message4/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.$(OBJEXT): \ + gogo/cpp_no_group/$(am__dirstamp) \ + gogo/cpp_no_group/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message1/proto3/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message1/proto3 + @: > gogo/cpp_no_group/datasets/google_message1/proto3/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR) + @: > gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) +gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.$(OBJEXT): gogo/cpp_no_group/datasets/google_message1/proto3/$(am__dirstamp) \ + gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) + +cpp-no-group-benchmark$(EXEEXT): $(cpp_no_group_benchmark_OBJECTS) $(cpp_no_group_benchmark_DEPENDENCIES) $(EXTRA_cpp_no_group_benchmark_DEPENDENCIES) + @rm -f cpp-no-group-benchmark$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(cpp_no_group_benchmark_OBJECTS) $(cpp_no_group_benchmark_LDADD) $(LIBS) +util/$(am__dirstamp): + @$(MKDIR_P) util + @: > util/$(am__dirstamp) +util/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) util/$(DEPDIR) + @: > util/$(DEPDIR)/$(am__dirstamp) +util/gogo_data_scrubber-gogo_data_scrubber.$(OBJEXT): \ + util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) +cpp/gogo_data_scrubber-benchmarks.pb.$(OBJEXT): cpp/$(am__dirstamp) \ + cpp/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.$(OBJEXT): \ + cpp/datasets/google_message1/proto3/$(am__dirstamp) \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.$(OBJEXT): \ + cpp/datasets/google_message1/proto2/$(am__dirstamp) \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.$(OBJEXT): \ + cpp/datasets/google_message2/$(am__dirstamp) \ + cpp/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) + +gogo-data-scrubber$(EXEEXT): $(gogo_data_scrubber_OBJECTS) $(gogo_data_scrubber_DEPENDENCIES) $(EXTRA_gogo_data_scrubber_DEPENDENCIES) + @rm -f gogo-data-scrubber$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(gogo_data_scrubber_OBJECTS) $(gogo_data_scrubber_LDADD) $(LIBS) +util/proto3_data_stripper-proto3_data_stripper.$(OBJEXT): \ + util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) +cpp/proto3_data_stripper-benchmarks.pb.$(OBJEXT): cpp/$(am__dirstamp) \ + cpp/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.$(OBJEXT): \ + cpp/datasets/google_message1/proto3/$(am__dirstamp) \ + cpp/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.$(OBJEXT): \ + cpp/datasets/google_message1/proto2/$(am__dirstamp) \ + cpp/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.$(OBJEXT): \ + cpp/datasets/google_message2/$(am__dirstamp) \ + cpp/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.$(OBJEXT): \ + cpp/datasets/google_message3/$(am__dirstamp) \ + cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.$(OBJEXT): \ + cpp/datasets/google_message4/$(am__dirstamp) \ + cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) + +proto3-data-stripper$(EXEEXT): $(proto3_data_stripper_OBJECTS) $(proto3_data_stripper_DEPENDENCIES) $(EXTRA_proto3_data_stripper_DEPENDENCIES) + @rm -f proto3-data-stripper$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(proto3_data_stripper_OBJECTS) $(proto3_data_stripper_LDADD) $(LIBS) +util/protoc_gen_gogoproto-protoc-gen-gogoproto.$(OBJEXT): \ + util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) + +protoc-gen-gogoproto$(EXEEXT): $(protoc_gen_gogoproto_OBJECTS) $(protoc_gen_gogoproto_DEPENDENCIES) $(EXTRA_protoc_gen_gogoproto_DEPENDENCIES) + @rm -f protoc-gen-gogoproto$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(protoc_gen_gogoproto_OBJECTS) $(protoc_gen_gogoproto_LDADD) $(LIBS) +util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.$(OBJEXT): \ + util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) + +protoc-gen-proto2_to_proto3$(EXEEXT): $(protoc_gen_proto2_to_proto3_OBJECTS) $(protoc_gen_proto2_to_proto3_DEPENDENCIES) $(EXTRA_protoc_gen_proto2_to_proto3_DEPENDENCIES) + @rm -f protoc-gen-proto2_to_proto3$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(protoc_gen_proto2_to_proto3_OBJECTS) $(protoc_gen_proto2_to_proto3_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f cpp/*.$(OBJEXT) + -rm -f cpp/*.lo + -rm -f cpp/datasets/google_message1/proto2/*.$(OBJEXT) + -rm -f cpp/datasets/google_message1/proto2/*.lo + -rm -f cpp/datasets/google_message1/proto3/*.$(OBJEXT) + -rm -f cpp/datasets/google_message1/proto3/*.lo + -rm -f cpp/datasets/google_message2/*.$(OBJEXT) + -rm -f cpp/datasets/google_message2/*.lo + -rm -f cpp/datasets/google_message3/*.$(OBJEXT) + -rm -f cpp/datasets/google_message3/*.lo + -rm -f cpp/datasets/google_message4/*.$(OBJEXT) + -rm -f cpp/datasets/google_message4/*.lo + -rm -f gogo/cpp_no_group/*.$(OBJEXT) + -rm -f gogo/cpp_no_group/datasets/google_message1/proto2/*.$(OBJEXT) + -rm -f gogo/cpp_no_group/datasets/google_message1/proto3/*.$(OBJEXT) + -rm -f gogo/cpp_no_group/datasets/google_message2/*.$(OBJEXT) + -rm -f gogo/cpp_no_group/datasets/google_message3/*.$(OBJEXT) + -rm -f gogo/cpp_no_group/datasets/google_message4/*.$(OBJEXT) + -rm -f python/*.$(OBJEXT) + -rm -f python/*.lo + -rm -f util/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@cpp/$(DEPDIR)/benchmark-benchmarks.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/$(DEPDIR)/benchmark-cpp_benchmark.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/$(DEPDIR)/libbenchmark_messages_la-benchmarks.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto2.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto3.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message2.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_1.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_2.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_3.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_4.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_5.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_6.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_7.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_8.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_1.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_2.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_3.pb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/libbenchmark_messages_la-python_benchmark_messages.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +python/libbenchmark_messages_la-python_benchmark_messages.lo: python/python_benchmark_messages.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT python/libbenchmark_messages_la-python_benchmark_messages.lo -MD -MP -MF python/$(DEPDIR)/libbenchmark_messages_la-python_benchmark_messages.Tpo -c -o python/libbenchmark_messages_la-python_benchmark_messages.lo `test -f 'python/python_benchmark_messages.cc' || echo '$(srcdir)/'`python/python_benchmark_messages.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) python/$(DEPDIR)/libbenchmark_messages_la-python_benchmark_messages.Tpo python/$(DEPDIR)/libbenchmark_messages_la-python_benchmark_messages.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='python/python_benchmark_messages.cc' object='python/libbenchmark_messages_la-python_benchmark_messages.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o python/libbenchmark_messages_la-python_benchmark_messages.lo `test -f 'python/python_benchmark_messages.cc' || echo '$(srcdir)/'`python/python_benchmark_messages.cc + +cpp/libbenchmark_messages_la-benchmarks.pb.lo: cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/libbenchmark_messages_la-benchmarks.pb.lo -MD -MP -MF cpp/$(DEPDIR)/libbenchmark_messages_la-benchmarks.pb.Tpo -c -o cpp/libbenchmark_messages_la-benchmarks.pb.lo `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/libbenchmark_messages_la-benchmarks.pb.Tpo cpp/$(DEPDIR)/libbenchmark_messages_la-benchmarks.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/benchmarks.pb.cc' object='cpp/libbenchmark_messages_la-benchmarks.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/libbenchmark_messages_la-benchmarks.pb.lo `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc + +cpp/datasets/google_message1/proto3/libbenchmark_messages_la-benchmark_message1_proto3.pb.lo: cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto3/libbenchmark_messages_la-benchmark_message1_proto3.pb.lo -MD -MP -MF cpp/datasets/google_message1/proto3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto3.pb.Tpo -c -o cpp/datasets/google_message1/proto3/libbenchmark_messages_la-benchmark_message1_proto3.pb.lo `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto3.pb.Tpo cpp/datasets/google_message1/proto3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto3.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='cpp/datasets/google_message1/proto3/libbenchmark_messages_la-benchmark_message1_proto3.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto3/libbenchmark_messages_la-benchmark_message1_proto3.pb.lo `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc + +cpp/datasets/google_message1/proto2/libbenchmark_messages_la-benchmark_message1_proto2.pb.lo: cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto2/libbenchmark_messages_la-benchmark_message1_proto2.pb.lo -MD -MP -MF cpp/datasets/google_message1/proto2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto2.pb.Tpo -c -o cpp/datasets/google_message1/proto2/libbenchmark_messages_la-benchmark_message1_proto2.pb.lo `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto2.pb.Tpo cpp/datasets/google_message1/proto2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto2.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='cpp/datasets/google_message1/proto2/libbenchmark_messages_la-benchmark_message1_proto2.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto2/libbenchmark_messages_la-benchmark_message1_proto2.pb.lo `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc + +cpp/datasets/google_message2/libbenchmark_messages_la-benchmark_message2.pb.lo: cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message2/libbenchmark_messages_la-benchmark_message2.pb.lo -MD -MP -MF cpp/datasets/google_message2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message2.pb.Tpo -c -o cpp/datasets/google_message2/libbenchmark_messages_la-benchmark_message2.pb.lo `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message2.pb.Tpo cpp/datasets/google_message2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message2.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message2/benchmark_message2.pb.cc' object='cpp/datasets/google_message2/libbenchmark_messages_la-benchmark_message2.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message2/libbenchmark_messages_la-benchmark_message2.pb.lo `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3.pb.lo: cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_1.pb.lo: cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_1.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_1.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_1.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_1.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_1.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_1.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_1.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_1.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_2.pb.lo: cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_2.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_2.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_2.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_2.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_2.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_2.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_2.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_2.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_3.pb.lo: cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_3.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_3.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_3.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_3.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_3.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_3.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_3.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_4.pb.lo: cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_4.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_4.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_4.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_4.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_4.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_4.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_4.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_4.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_5.pb.lo: cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_5.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_5.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_5.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_5.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_5.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_5.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_5.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_5.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_6.pb.lo: cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_6.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_6.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_6.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_6.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_6.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_6.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_6.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_6.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_7.pb.lo: cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_7.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_7.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_7.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_7.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_7.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_7.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_7.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_7.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc + +cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_8.pb.lo: cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_8.pb.lo -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_8.pb.Tpo -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_8.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_8.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_8.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_8.pb.cc' object='cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_8.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/libbenchmark_messages_la-benchmark_message3_8.pb.lo `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc + +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4.pb.lo: cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4.pb.lo -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4.pb.Tpo -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4.pb.cc' object='cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc + +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_1.pb.lo: cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_1.pb.lo -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_1.pb.Tpo -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_1.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_1.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_1.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_1.pb.cc' object='cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_1.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_1.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc + +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_2.pb.lo: cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_2.pb.lo -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_2.pb.Tpo -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_2.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_2.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_2.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_2.pb.cc' object='cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_2.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_2.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc + +cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_3.pb.lo: cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_3.pb.lo -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_3.pb.Tpo -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_3.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_3.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_3.pb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_3.pb.cc' object='cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_3.pb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbenchmark_messages_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/libbenchmark_messages_la-benchmark_message4_3.pb.lo `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc + +cpp/benchmark-cpp_benchmark.o: cpp/cpp_benchmark.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/benchmark-cpp_benchmark.o -MD -MP -MF cpp/$(DEPDIR)/benchmark-cpp_benchmark.Tpo -c -o cpp/benchmark-cpp_benchmark.o `test -f 'cpp/cpp_benchmark.cc' || echo '$(srcdir)/'`cpp/cpp_benchmark.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/benchmark-cpp_benchmark.Tpo cpp/$(DEPDIR)/benchmark-cpp_benchmark.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/cpp_benchmark.cc' object='cpp/benchmark-cpp_benchmark.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/benchmark-cpp_benchmark.o `test -f 'cpp/cpp_benchmark.cc' || echo '$(srcdir)/'`cpp/cpp_benchmark.cc + +cpp/benchmark-cpp_benchmark.obj: cpp/cpp_benchmark.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/benchmark-cpp_benchmark.obj -MD -MP -MF cpp/$(DEPDIR)/benchmark-cpp_benchmark.Tpo -c -o cpp/benchmark-cpp_benchmark.obj `if test -f 'cpp/cpp_benchmark.cc'; then $(CYGPATH_W) 'cpp/cpp_benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/cpp_benchmark.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/benchmark-cpp_benchmark.Tpo cpp/$(DEPDIR)/benchmark-cpp_benchmark.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/cpp_benchmark.cc' object='cpp/benchmark-cpp_benchmark.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/benchmark-cpp_benchmark.obj `if test -f 'cpp/cpp_benchmark.cc'; then $(CYGPATH_W) 'cpp/cpp_benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/cpp_benchmark.cc'; fi` + +cpp/benchmark-benchmarks.pb.o: cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/benchmark-benchmarks.pb.o -MD -MP -MF cpp/$(DEPDIR)/benchmark-benchmarks.pb.Tpo -c -o cpp/benchmark-benchmarks.pb.o `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/benchmark-benchmarks.pb.Tpo cpp/$(DEPDIR)/benchmark-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/benchmarks.pb.cc' object='cpp/benchmark-benchmarks.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/benchmark-benchmarks.pb.o `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc + +cpp/benchmark-benchmarks.pb.obj: cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/benchmark-benchmarks.pb.obj -MD -MP -MF cpp/$(DEPDIR)/benchmark-benchmarks.pb.Tpo -c -o cpp/benchmark-benchmarks.pb.obj `if test -f 'cpp/benchmarks.pb.cc'; then $(CYGPATH_W) 'cpp/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/benchmarks.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/benchmark-benchmarks.pb.Tpo cpp/$(DEPDIR)/benchmark-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/benchmarks.pb.cc' object='cpp/benchmark-benchmarks.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/benchmark-benchmarks.pb.obj `if test -f 'cpp/benchmarks.pb.cc'; then $(CYGPATH_W) 'cpp/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/benchmarks.pb.cc'; fi` + +cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.o: cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.o -MD -MP -MF cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Tpo -c -o cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.o `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Tpo cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.o `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc + +cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.obj: cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.obj -MD -MP -MF cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Tpo -c -o cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.obj `if test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Tpo cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto3/benchmark-benchmark_message1_proto3.pb.obj `if test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` + +cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.o: cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.o -MD -MP -MF cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Tpo -c -o cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.o `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Tpo cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.o `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc + +cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.obj: cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.obj -MD -MP -MF cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Tpo -c -o cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.obj `if test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Tpo cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto2/benchmark-benchmark_message1_proto2.pb.obj `if test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` + +cpp/datasets/google_message2/benchmark-benchmark_message2.pb.o: cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message2/benchmark-benchmark_message2.pb.o -MD -MP -MF cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Tpo -c -o cpp/datasets/google_message2/benchmark-benchmark_message2.pb.o `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Tpo cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message2/benchmark_message2.pb.cc' object='cpp/datasets/google_message2/benchmark-benchmark_message2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message2/benchmark-benchmark_message2.pb.o `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc + +cpp/datasets/google_message2/benchmark-benchmark_message2.pb.obj: cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message2/benchmark-benchmark_message2.pb.obj -MD -MP -MF cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Tpo -c -o cpp/datasets/google_message2/benchmark-benchmark_message2.pb.obj `if test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message2/benchmark_message2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Tpo cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message2/benchmark_message2.pb.cc' object='cpp/datasets/google_message2/benchmark-benchmark_message2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message2/benchmark-benchmark_message2.pb.obj `if test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message2/benchmark_message2.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3.pb.o: cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3.pb.obj: cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.o: cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_1.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.obj: cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_1.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_1.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.o: cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_2.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.obj: cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_2.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_2.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.o: cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_3.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.obj: cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_3.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.o: cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_4.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.obj: cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_4.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_4.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.o: cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_5.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.obj: cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_5.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_5.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.o: cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_6.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.obj: cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_6.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_6.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.o: cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_7.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.obj: cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_7.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_7.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` + +cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.o: cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_8.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc + +cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.obj: cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Tpo -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_8.pb.cc' object='cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/benchmark-benchmark_message3_8.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` + +cpp/datasets/google_message4/benchmark-benchmark_message4.pb.o: cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc + +cpp/datasets/google_message4/benchmark-benchmark_message4.pb.obj: cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4.pb.cc'; fi` + +cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.o: cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_1.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc + +cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.obj: cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_1.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_1.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` + +cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.o: cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_2.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc + +cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.obj: cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_2.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_2.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` + +cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.o: cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_3.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc + +cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.obj: cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Tpo -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_3.pb.cc' object='cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/benchmark-benchmark_message4_3.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` + +gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.o: gogo/cpp_no_group/cpp_benchmark.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.o -MD -MP -MF gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Tpo -c -o gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.o `test -f 'gogo/cpp_no_group/cpp_benchmark.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/cpp_benchmark.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Tpo gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/cpp_benchmark.cc' object='gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.o `test -f 'gogo/cpp_no_group/cpp_benchmark.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/cpp_benchmark.cc + +gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.obj: gogo/cpp_no_group/cpp_benchmark.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.obj -MD -MP -MF gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Tpo -c -o gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.obj `if test -f 'gogo/cpp_no_group/cpp_benchmark.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/cpp_benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/cpp_benchmark.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Tpo gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/cpp_benchmark.cc' object='gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.obj `if test -f 'gogo/cpp_no_group/cpp_benchmark.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/cpp_benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/cpp_benchmark.cc'; fi` + +gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.o: gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Tpo gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc + +gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.obj: gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Tpo gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message1/proto2/cpp_no_group_benchmark-benchmark_message1_proto2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.o: gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Tpo gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc' object='gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc + +gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.obj: gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Tpo gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc' object='gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message2/cpp_no_group_benchmark-benchmark_message2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_1.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_4.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_5.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_6.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_7.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.o: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc + +gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.obj: gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Tpo gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc' object='gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message3/cpp_no_group_benchmark-benchmark_message3_8.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.o: gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.obj: gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.o: gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.obj: gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_1.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.o: gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.obj: gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_2.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.o: gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc + +gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.obj: gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Tpo gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc' object='gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message4/cpp_no_group_benchmark-benchmark_message4_3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` + +gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.o: gogo/cpp_no_group/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.o -MD -MP -MF gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Tpo -c -o gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.o `test -f 'gogo/cpp_no_group/benchmarks.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Tpo gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/benchmarks.pb.cc' object='gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.o `test -f 'gogo/cpp_no_group/benchmarks.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/benchmarks.pb.cc + +gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.obj: gogo/cpp_no_group/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.obj -MD -MP -MF gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Tpo -c -o gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.obj `if test -f 'gogo/cpp_no_group/benchmarks.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/benchmarks.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Tpo gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/benchmarks.pb.cc' object='gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/cpp_no_group_benchmark-benchmarks.pb.obj `if test -f 'gogo/cpp_no_group/benchmarks.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/benchmarks.pb.cc'; fi` + +gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.o: gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.o -MD -MP -MF gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Tpo gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.o `test -f 'gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc + +gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.obj: gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.obj -MD -MP -MF gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Tpo -c -o gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Tpo gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cpp_no_group_benchmark_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gogo/cpp_no_group/datasets/google_message1/proto3/cpp_no_group_benchmark-benchmark_message1_proto3.pb.obj `if test -f 'gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` + +util/gogo_data_scrubber-gogo_data_scrubber.o: util/gogo_data_scrubber.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/gogo_data_scrubber-gogo_data_scrubber.o -MD -MP -MF util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Tpo -c -o util/gogo_data_scrubber-gogo_data_scrubber.o `test -f 'util/gogo_data_scrubber.cc' || echo '$(srcdir)/'`util/gogo_data_scrubber.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Tpo util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/gogo_data_scrubber.cc' object='util/gogo_data_scrubber-gogo_data_scrubber.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/gogo_data_scrubber-gogo_data_scrubber.o `test -f 'util/gogo_data_scrubber.cc' || echo '$(srcdir)/'`util/gogo_data_scrubber.cc + +util/gogo_data_scrubber-gogo_data_scrubber.obj: util/gogo_data_scrubber.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/gogo_data_scrubber-gogo_data_scrubber.obj -MD -MP -MF util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Tpo -c -o util/gogo_data_scrubber-gogo_data_scrubber.obj `if test -f 'util/gogo_data_scrubber.cc'; then $(CYGPATH_W) 'util/gogo_data_scrubber.cc'; else $(CYGPATH_W) '$(srcdir)/util/gogo_data_scrubber.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Tpo util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/gogo_data_scrubber.cc' object='util/gogo_data_scrubber-gogo_data_scrubber.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/gogo_data_scrubber-gogo_data_scrubber.obj `if test -f 'util/gogo_data_scrubber.cc'; then $(CYGPATH_W) 'util/gogo_data_scrubber.cc'; else $(CYGPATH_W) '$(srcdir)/util/gogo_data_scrubber.cc'; fi` + +cpp/gogo_data_scrubber-benchmarks.pb.o: cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/gogo_data_scrubber-benchmarks.pb.o -MD -MP -MF cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Tpo -c -o cpp/gogo_data_scrubber-benchmarks.pb.o `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Tpo cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/benchmarks.pb.cc' object='cpp/gogo_data_scrubber-benchmarks.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/gogo_data_scrubber-benchmarks.pb.o `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc + +cpp/gogo_data_scrubber-benchmarks.pb.obj: cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/gogo_data_scrubber-benchmarks.pb.obj -MD -MP -MF cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Tpo -c -o cpp/gogo_data_scrubber-benchmarks.pb.obj `if test -f 'cpp/benchmarks.pb.cc'; then $(CYGPATH_W) 'cpp/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/benchmarks.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Tpo cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/benchmarks.pb.cc' object='cpp/gogo_data_scrubber-benchmarks.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/gogo_data_scrubber-benchmarks.pb.obj `if test -f 'cpp/benchmarks.pb.cc'; then $(CYGPATH_W) 'cpp/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/benchmarks.pb.cc'; fi` + +cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.o: cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.o -MD -MP -MF cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Tpo -c -o cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.o `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Tpo cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.o `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc + +cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.obj: cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.obj -MD -MP -MF cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Tpo -c -o cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.obj `if test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Tpo cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto3/gogo_data_scrubber-benchmark_message1_proto3.pb.obj `if test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` + +cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.o: cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.o -MD -MP -MF cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Tpo -c -o cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.o `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Tpo cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.o `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc + +cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.obj: cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.obj -MD -MP -MF cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Tpo -c -o cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.obj `if test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Tpo cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto2/gogo_data_scrubber-benchmark_message1_proto2.pb.obj `if test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` + +cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.o: cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.o -MD -MP -MF cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Tpo -c -o cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.o `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Tpo cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message2/benchmark_message2.pb.cc' object='cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.o `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc + +cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.obj: cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.obj -MD -MP -MF cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Tpo -c -o cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.obj `if test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message2/benchmark_message2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Tpo cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message2/benchmark_message2.pb.cc' object='cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message2/gogo_data_scrubber-benchmark_message2.pb.obj `if test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message2/benchmark_message2.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.o: cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.obj: cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.o: cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_1.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.obj: cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_1.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_1.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.o: cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_2.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.obj: cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_2.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_2.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.o: cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_3.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.obj: cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_3.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.o: cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_4.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.obj: cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_4.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_4.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.o: cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_5.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.obj: cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_5.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_5.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.o: cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_6.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.obj: cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_6.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_6.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.o: cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_7.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.obj: cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_7.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_7.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.o: cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_8.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc + +cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.obj: cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Tpo -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_8.pb.cc' object='cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/gogo_data_scrubber-benchmark_message3_8.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.o: cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.obj: cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4.pb.cc'; fi` + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.o: cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_1.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.obj: cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_1.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_1.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.o: cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_2.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.obj: cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_2.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_2.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.o: cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_3.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc + +cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.obj: cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Tpo -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_3.pb.cc' object='cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gogo_data_scrubber_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/gogo_data_scrubber-benchmark_message4_3.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` + +util/proto3_data_stripper-proto3_data_stripper.o: util/proto3_data_stripper.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/proto3_data_stripper-proto3_data_stripper.o -MD -MP -MF util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Tpo -c -o util/proto3_data_stripper-proto3_data_stripper.o `test -f 'util/proto3_data_stripper.cc' || echo '$(srcdir)/'`util/proto3_data_stripper.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Tpo util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/proto3_data_stripper.cc' object='util/proto3_data_stripper-proto3_data_stripper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/proto3_data_stripper-proto3_data_stripper.o `test -f 'util/proto3_data_stripper.cc' || echo '$(srcdir)/'`util/proto3_data_stripper.cc + +util/proto3_data_stripper-proto3_data_stripper.obj: util/proto3_data_stripper.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/proto3_data_stripper-proto3_data_stripper.obj -MD -MP -MF util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Tpo -c -o util/proto3_data_stripper-proto3_data_stripper.obj `if test -f 'util/proto3_data_stripper.cc'; then $(CYGPATH_W) 'util/proto3_data_stripper.cc'; else $(CYGPATH_W) '$(srcdir)/util/proto3_data_stripper.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Tpo util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/proto3_data_stripper.cc' object='util/proto3_data_stripper-proto3_data_stripper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/proto3_data_stripper-proto3_data_stripper.obj `if test -f 'util/proto3_data_stripper.cc'; then $(CYGPATH_W) 'util/proto3_data_stripper.cc'; else $(CYGPATH_W) '$(srcdir)/util/proto3_data_stripper.cc'; fi` + +cpp/proto3_data_stripper-benchmarks.pb.o: cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/proto3_data_stripper-benchmarks.pb.o -MD -MP -MF cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Tpo -c -o cpp/proto3_data_stripper-benchmarks.pb.o `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Tpo cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/benchmarks.pb.cc' object='cpp/proto3_data_stripper-benchmarks.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/proto3_data_stripper-benchmarks.pb.o `test -f 'cpp/benchmarks.pb.cc' || echo '$(srcdir)/'`cpp/benchmarks.pb.cc + +cpp/proto3_data_stripper-benchmarks.pb.obj: cpp/benchmarks.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/proto3_data_stripper-benchmarks.pb.obj -MD -MP -MF cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Tpo -c -o cpp/proto3_data_stripper-benchmarks.pb.obj `if test -f 'cpp/benchmarks.pb.cc'; then $(CYGPATH_W) 'cpp/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/benchmarks.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Tpo cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/benchmarks.pb.cc' object='cpp/proto3_data_stripper-benchmarks.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/proto3_data_stripper-benchmarks.pb.obj `if test -f 'cpp/benchmarks.pb.cc'; then $(CYGPATH_W) 'cpp/benchmarks.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/benchmarks.pb.cc'; fi` + +cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.o: cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.o -MD -MP -MF cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Tpo -c -o cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.o `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Tpo cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.o `test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc + +cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.obj: cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.obj -MD -MP -MF cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Tpo -c -o cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.obj `if test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Tpo cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc' object='cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto3/proto3_data_stripper-benchmark_message1_proto3.pb.obj `if test -f 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc'; fi` + +cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.o: cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.o -MD -MP -MF cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Tpo -c -o cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.o `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Tpo cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.o `test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc + +cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.obj: cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.obj -MD -MP -MF cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Tpo -c -o cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.obj `if test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Tpo cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc' object='cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message1/proto2/proto3_data_stripper-benchmark_message1_proto2.pb.obj `if test -f 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc'; fi` + +cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.o: cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.o -MD -MP -MF cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Tpo -c -o cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.o `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Tpo cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message2/benchmark_message2.pb.cc' object='cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.o `test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message2/benchmark_message2.pb.cc + +cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.obj: cpp/datasets/google_message2/benchmark_message2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.obj -MD -MP -MF cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Tpo -c -o cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.obj `if test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message2/benchmark_message2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Tpo cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message2/benchmark_message2.pb.cc' object='cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message2/proto3_data_stripper-benchmark_message2.pb.obj `if test -f 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message2/benchmark_message2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message2/benchmark_message2.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.o: cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.obj: cpp/datasets/google_message3/benchmark_message3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.o: cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_1.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_1.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.obj: cpp/datasets/google_message3/benchmark_message3_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_1.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_1.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_1.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.o: cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_2.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_2.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.obj: cpp/datasets/google_message3/benchmark_message3_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_2.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_2.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_2.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.o: cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_3.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_3.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.obj: cpp/datasets/google_message3/benchmark_message3_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_3.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_3.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_3.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.o: cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_4.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_4.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.obj: cpp/datasets/google_message3/benchmark_message3_4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_4.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_4.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_4.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.o: cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_5.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_5.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.obj: cpp/datasets/google_message3/benchmark_message3_5.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_5.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_5.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_5.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.o: cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_6.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_6.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.obj: cpp/datasets/google_message3/benchmark_message3_6.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_6.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_6.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_6.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.o: cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_7.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_7.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.obj: cpp/datasets/google_message3/benchmark_message3_7.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_7.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_7.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_7.pb.cc'; fi` + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.o: cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.o -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_8.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.o `test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message3/benchmark_message3_8.pb.cc + +cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.obj: cpp/datasets/google_message3/benchmark_message3_8.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.obj -MD -MP -MF cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Tpo -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Tpo cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message3/benchmark_message3_8.pb.cc' object='cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message3/proto3_data_stripper-benchmark_message3_8.pb.obj `if test -f 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message3/benchmark_message3_8.pb.cc'; fi` + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.o: cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4.pb.cc + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.obj: cpp/datasets/google_message4/benchmark_message4.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4.pb.cc'; fi` + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.o: cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_1.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_1.pb.cc + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.obj: cpp/datasets/google_message4/benchmark_message4_1.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_1.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_1.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_1.pb.cc'; fi` + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.o: cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_2.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_2.pb.cc + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.obj: cpp/datasets/google_message4/benchmark_message4_2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_2.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_2.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_2.pb.cc'; fi` + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.o: cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.o -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_3.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.o `test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc' || echo '$(srcdir)/'`cpp/datasets/google_message4/benchmark_message4_3.pb.cc + +cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.obj: cpp/datasets/google_message4/benchmark_message4_3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.obj -MD -MP -MF cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Tpo -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Tpo cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cpp/datasets/google_message4/benchmark_message4_3.pb.cc' object='cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proto3_data_stripper_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cpp/datasets/google_message4/proto3_data_stripper-benchmark_message4_3.pb.obj `if test -f 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; then $(CYGPATH_W) 'cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/cpp/datasets/google_message4/benchmark_message4_3.pb.cc'; fi` + +util/protoc_gen_gogoproto-protoc-gen-gogoproto.o: util/protoc-gen-gogoproto.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_gogoproto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/protoc_gen_gogoproto-protoc-gen-gogoproto.o -MD -MP -MF util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Tpo -c -o util/protoc_gen_gogoproto-protoc-gen-gogoproto.o `test -f 'util/protoc-gen-gogoproto.cc' || echo '$(srcdir)/'`util/protoc-gen-gogoproto.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Tpo util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/protoc-gen-gogoproto.cc' object='util/protoc_gen_gogoproto-protoc-gen-gogoproto.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_gogoproto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/protoc_gen_gogoproto-protoc-gen-gogoproto.o `test -f 'util/protoc-gen-gogoproto.cc' || echo '$(srcdir)/'`util/protoc-gen-gogoproto.cc + +util/protoc_gen_gogoproto-protoc-gen-gogoproto.obj: util/protoc-gen-gogoproto.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_gogoproto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/protoc_gen_gogoproto-protoc-gen-gogoproto.obj -MD -MP -MF util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Tpo -c -o util/protoc_gen_gogoproto-protoc-gen-gogoproto.obj `if test -f 'util/protoc-gen-gogoproto.cc'; then $(CYGPATH_W) 'util/protoc-gen-gogoproto.cc'; else $(CYGPATH_W) '$(srcdir)/util/protoc-gen-gogoproto.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Tpo util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/protoc-gen-gogoproto.cc' object='util/protoc_gen_gogoproto-protoc-gen-gogoproto.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_gogoproto_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/protoc_gen_gogoproto-protoc-gen-gogoproto.obj `if test -f 'util/protoc-gen-gogoproto.cc'; then $(CYGPATH_W) 'util/protoc-gen-gogoproto.cc'; else $(CYGPATH_W) '$(srcdir)/util/protoc-gen-gogoproto.cc'; fi` + +util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.o: util/protoc-gen-proto2_to_proto3.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_proto2_to_proto3_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.o -MD -MP -MF util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Tpo -c -o util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.o `test -f 'util/protoc-gen-proto2_to_proto3.cc' || echo '$(srcdir)/'`util/protoc-gen-proto2_to_proto3.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Tpo util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/protoc-gen-proto2_to_proto3.cc' object='util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_proto2_to_proto3_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.o `test -f 'util/protoc-gen-proto2_to_proto3.cc' || echo '$(srcdir)/'`util/protoc-gen-proto2_to_proto3.cc + +util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.obj: util/protoc-gen-proto2_to_proto3.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_proto2_to_proto3_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.obj -MD -MP -MF util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Tpo -c -o util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.obj `if test -f 'util/protoc-gen-proto2_to_proto3.cc'; then $(CYGPATH_W) 'util/protoc-gen-proto2_to_proto3.cc'; else $(CYGPATH_W) '$(srcdir)/util/protoc-gen-proto2_to_proto3.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Tpo util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='util/protoc-gen-proto2_to_proto3.cc' object='util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protoc_gen_proto2_to_proto3_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o util/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.obj `if test -f 'util/protoc-gen-proto2_to_proto3.cc'; then $(CYGPATH_W) 'util/protoc-gen-proto2_to_proto3.cc'; else $(CYGPATH_W) '$(srcdir)/util/protoc-gen-proto2_to_proto3.cc'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf cpp/.libs cpp/_libs + -rm -rf cpp/datasets/google_message1/proto2/.libs cpp/datasets/google_message1/proto2/_libs + -rm -rf cpp/datasets/google_message1/proto3/.libs cpp/datasets/google_message1/proto3/_libs + -rm -rf cpp/datasets/google_message2/.libs cpp/datasets/google_message2/_libs + -rm -rf cpp/datasets/google_message3/.libs cpp/datasets/google_message3/_libs + -rm -rf cpp/datasets/google_message4/.libs cpp/datasets/google_message4/_libs + -rm -rf python/.libs python/_libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f cpp/$(DEPDIR)/$(am__dirstamp) + -rm -f cpp/$(am__dirstamp) + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) + -rm -f cpp/datasets/google_message1/proto2/$(am__dirstamp) + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) + -rm -f cpp/datasets/google_message1/proto3/$(am__dirstamp) + -rm -f cpp/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) + -rm -f cpp/datasets/google_message2/$(am__dirstamp) + -rm -f cpp/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) + -rm -f cpp/datasets/google_message3/$(am__dirstamp) + -rm -f cpp/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) + -rm -f cpp/datasets/google_message4/$(am__dirstamp) + -rm -f gogo/cpp_no_group/$(DEPDIR)/$(am__dirstamp) + -rm -f gogo/cpp_no_group/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message1/proto2/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message1/proto3/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message2/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message3/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/$(am__dirstamp) + -rm -f gogo/cpp_no_group/datasets/google_message4/$(am__dirstamp) + -rm -f python/$(DEPDIR)/$(am__dirstamp) + -rm -f python/$(am__dirstamp) + -rm -f util/$(DEPDIR)/$(am__dirstamp) + -rm -f util/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f cpp/$(DEPDIR)/benchmark-benchmarks.pb.Po + -rm -f cpp/$(DEPDIR)/benchmark-cpp_benchmark.Po + -rm -f cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Po + -rm -f cpp/$(DEPDIR)/libbenchmark_messages_la-benchmarks.pb.Plo + -rm -f cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Po + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Po + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Po + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto2.pb.Plo + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Po + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Po + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Po + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto3.pb.Plo + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Po + -rm -f cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Po + -rm -f cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Po + -rm -f cpp/datasets/google_message2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message2.pb.Plo + -rm -f cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_1.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_2.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_3.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_4.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_5.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_6.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_7.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_8.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_1.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_2.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_3.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Po + -rm -f gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Po + -rm -f gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Po + -rm -f gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Po + -rm -f python/$(DEPDIR)/libbenchmark_messages_la-python_benchmark_messages.Plo + -rm -f util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Po + -rm -f util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Po + -rm -f util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Po + -rm -f util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f cpp/$(DEPDIR)/benchmark-benchmarks.pb.Po + -rm -f cpp/$(DEPDIR)/benchmark-cpp_benchmark.Po + -rm -f cpp/$(DEPDIR)/gogo_data_scrubber-benchmarks.pb.Po + -rm -f cpp/$(DEPDIR)/libbenchmark_messages_la-benchmarks.pb.Plo + -rm -f cpp/$(DEPDIR)/proto3_data_stripper-benchmarks.pb.Po + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/benchmark-benchmark_message1_proto2.pb.Po + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto2.pb.Po + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto2.pb.Plo + -rm -f cpp/datasets/google_message1/proto2/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto2.pb.Po + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/benchmark-benchmark_message1_proto3.pb.Po + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/gogo_data_scrubber-benchmark_message1_proto3.pb.Po + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message1_proto3.pb.Plo + -rm -f cpp/datasets/google_message1/proto3/$(DEPDIR)/proto3_data_stripper-benchmark_message1_proto3.pb.Po + -rm -f cpp/datasets/google_message2/$(DEPDIR)/benchmark-benchmark_message2.pb.Po + -rm -f cpp/datasets/google_message2/$(DEPDIR)/gogo_data_scrubber-benchmark_message2.pb.Po + -rm -f cpp/datasets/google_message2/$(DEPDIR)/libbenchmark_messages_la-benchmark_message2.pb.Plo + -rm -f cpp/datasets/google_message2/$(DEPDIR)/proto3_data_stripper-benchmark_message2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_1.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_4.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_5.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_6.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_7.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/benchmark-benchmark_message3_8.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_1.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_4.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_5.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_6.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_7.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/gogo_data_scrubber-benchmark_message3_8.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_1.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_2.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_3.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_4.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_5.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_6.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_7.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/libbenchmark_messages_la-benchmark_message3_8.pb.Plo + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_1.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_2.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_3.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_4.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_5.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_6.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_7.pb.Po + -rm -f cpp/datasets/google_message3/$(DEPDIR)/proto3_data_stripper-benchmark_message3_8.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_1.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_2.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/benchmark-benchmark_message4_3.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_1.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_2.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/gogo_data_scrubber-benchmark_message4_3.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_1.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_2.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/libbenchmark_messages_la-benchmark_message4_3.pb.Plo + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_1.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_2.pb.Po + -rm -f cpp/datasets/google_message4/$(DEPDIR)/proto3_data_stripper-benchmark_message4_3.pb.Po + -rm -f gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-benchmarks.pb.Po + -rm -f gogo/cpp_no_group/$(DEPDIR)/cpp_no_group_benchmark-cpp_benchmark.Po + -rm -f gogo/cpp_no_group/datasets/google_message1/proto2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message1/proto3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message2/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_1.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_3.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_4.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_5.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_6.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_7.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message3/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message3_8.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_1.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_2.pb.Po + -rm -f gogo/cpp_no_group/datasets/google_message4/$(DEPDIR)/cpp_no_group_benchmark-benchmark_message4_3.pb.Po + -rm -f python/$(DEPDIR)/libbenchmark_messages_la-python_benchmark_messages.Plo + -rm -f util/$(DEPDIR)/gogo_data_scrubber-gogo_data_scrubber.Po + -rm -f util/$(DEPDIR)/proto3_data_stripper-proto3_data_stripper.Po + -rm -f util/$(DEPDIR)/protoc_gen_gogoproto-protoc-gen-gogoproto.Po + -rm -f util/$(DEPDIR)/protoc_gen_proto2_to_proto3-protoc-gen-proto2_to_proto3.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-local cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES + +.PRECIOUS: Makefile + + +make_tmp_dir: + mkdir -p 'tmp/java/src/main/java' + touch make_tmp_dir + +# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is +# relative to srcdir, which may not be the same as the current directory when +# building out-of-tree. +protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) ) + touch protoc_middleman + +protoc_middleman2: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs_proto2) $(well_known_type_protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2) ) + touch protoc_middleman2 + +$(benchmarks_protoc_outputs): protoc_middleman +$(benchmarks_protoc_outputs_header): protoc_middleman +$(benchmarks_protoc_outputs_proto2): protoc_middleman2 +$(benchmarks_protoc_outputs_proto2_header): protoc_middleman2 + +initialize_submodule: + oldpwd=`pwd` + cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && \ + cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make + cd $$oldpwd + touch initialize_submodule + +$(top_srcdir)/third_party/benchmark/src/libbenchmark.a: initialize_submodule +# Explicit deps because BUILT_SOURCES are only done before a "make all/check" +# so a direct "make test_cpp" could fail if parallel enough. +# See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually +cpp/cpp_benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a +cpp/benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a + +cpp: protoc_middleman protoc_middleman2 cpp-benchmark initialize_submodule + ./cpp-benchmark $(all_data) + +javac_middleman: $(java_benchmark_testing_files) protoc_middleman protoc_middleman2 + cp -r $(srcdir)/java tmp + mkdir -p tmp/java/lib + cp $(top_srcdir)/java/core/target/*.jar tmp/java/lib/protobuf-java.jar + cd tmp/java && mvn clean compile assembly:single -Dprotobuf.version=$(PACKAGE_VERSION) && cd ../.. + @touch javac_middleman + +java-benchmark: javac_middleman + @echo "Writing shortcut script java-benchmark..." + @echo '#! /bin/bash' > java-benchmark + @echo 'all_data=""' >> java-benchmark + @echo 'conf=()' >> java-benchmark + @echo 'data_files=""' >> java-benchmark + @echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+="$$arg,"; fi; done' >> java-benchmark + @echo 'java -cp '\"tmp/java/target/*:$(top_srcdir)/java/core/target/*:$(top_srcdir)/java/util/target/*\"" \\" >>java-benchmark + @echo ' com.google.caliper.runner.CaliperMain com.google.protobuf.ProtoCaliperBenchmark -i runtime '"\\" >> java-benchmark + @echo ' -b serializeToByteArray,serializeToMemoryStream,deserializeFromByteArray,deserializeFromMemoryStream '"\\" >> java-benchmark + @echo ' -DdataFile=$${data_files:0:-1} $${conf[*]}' >> java-benchmark + @chmod +x java-benchmark + +java: protoc_middleman protoc_middleman2 java-benchmark + ./java-benchmark $(all_data) + +############# JAVA RULES END ############## + +############# PYTHON RULES ############## + +python_add_init: protoc_middleman protoc_middleman2 + all_file=`find tmp -type f -regex '.*\.py'` && \ + for file in $${all_file[@]}; do \ + path="$${file%/*}"; \ + while true; do \ + touch "$$path/__init__.py" && chmod +x "$$path/__init__.py"; \ + if [[ $$path != *"/"* ]]; then break; fi; \ + path=$${path%/*}; \ + done \ + done +libbenchmark_messages_la-python_benchmark_messages.$(OBJEXT): $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) + +python-pure-python-benchmark: python_add_init + @echo "Writing shortcut script python-pure-python-benchmark..." + @echo '#! /bin/bash' > python-pure-python-benchmark + @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark + @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark + @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'python\' >> python-pure-python-benchmark + @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-pure-python-benchmark + @echo python tmp/py_benchmark.py '$$@' >> python-pure-python-benchmark + @chmod +x python-pure-python-benchmark + +python-cpp-reflection-benchmark: python_add_init + @echo "Writing shortcut script python-cpp-reflection-benchmark..." + @echo '#! /bin/bash' > python-cpp-reflection-benchmark + @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark + @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark + @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-reflection-benchmark + @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-reflection-benchmark + @echo python tmp/py_benchmark.py '$$@' >> python-cpp-reflection-benchmark + @chmod +x python-cpp-reflection-benchmark + +python-cpp-generated-code-benchmark: python_add_init libbenchmark_messages.la + @echo "Writing shortcut script python-cpp-generated-code-benchmark..." + @echo '#! /bin/bash' > python-cpp-generated-code-benchmark + @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark + @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark + @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-generated-code-benchmark + @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-generated-code-benchmark + @echo python tmp/py_benchmark.py --cpp_generated '$$@' >> python-cpp-generated-code-benchmark + @chmod +x python-cpp-generated-code-benchmark + +python-pure-python: python-pure-python-benchmark + ./python-pure-python-benchmark $(all_data) + +python-cpp-reflection: python-cpp-reflection-benchmark + ./python-cpp-reflection-benchmark $(all_data) + +python-cpp-generated-code: python-cpp-generated-code-benchmark + ./python-cpp-generated-code-benchmark $(all_data) + +go_protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_proto2_message1) $(benchmarks_protoc_inputs_proto2_message2) $(benchmarks_protoc_inputs_proto2_message3) $(benchmarks_protoc_inputs_proto2_message4) $(well_known_type_protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_benchmark_wrapper) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message1) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message2) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message3) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message4) ) + touch go_protoc_middleman + +go-benchmark: go_protoc_middleman + @echo "Writing shortcut script go-benchmark..." + @echo '#! /bin/bash' > go-benchmark + @echo 'cd $(srcdir)/go' >> go-benchmark + @echo 'all_data=""' >> go-benchmark + @echo 'conf=()' >> go-benchmark + @echo 'data_files=()' >> go-benchmark + @echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+=("$$arg"); fi; done' >> go-benchmark + @echo 'go test -bench=. $${conf[*]} -- $${data_files[*]}' >> go-benchmark + @echo 'cd ..' >> go-benchmark + @chmod +x go-benchmark + +go: go_protoc_middleman go-benchmark + ./go-benchmark $(all_data) + +$(cpp_no_group_benchmarks_protoc_outputs): cpp_no_group_protoc_middleman +$(cpp_no_group_benchmarks_protoc_outputs_header): cpp_no_group_protoc_middleman +$(cpp_no_group_benchmarks_protoc_outputs_proto2): cpp_no_group_protoc_middleman +$(cpp_no_group_benchmarks_protoc_outputs_proto2_header): cpp_no_group_protoc_middleman + +generate_cpp_no_group_benchmark_code: + cp $(srcdir)/cpp/cpp_benchmark.cc gogo/cpp_no_group/cpp_benchmark.cc + sed -i -e "s/\#include \"datasets/\#include \"gogo\/cpp_no_group\/datasets/g" gogo/cpp_no_group/cpp_benchmark.cc + sed -i -e "s/\#include \"benchmarks.pb.h/\#include \"gogo\/cpp_no_group\/benchmarks.pb.h/g" gogo/cpp_no_group/cpp_benchmark.cc + touch generate_cpp_no_group_benchmark_code +# Explicit deps because BUILT_SOURCES are only done before a "make all/check" +# so a direct "make test_cpp" could fail if parallel enough. +# See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually +gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.$(OBJEXT): $(cpp_no_group_benchmarks_protoc_outputs) $(cpp_no_group_benchmarks_protoc_outputs_proto2) $(cpp_no_group_benchmarks_protoc_outputs_header) \ + $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/third_party/benchmark/src/libbenchmark.a generate_cpp_no_group_benchmark_code +gogo/cpp_no_group/cpp_benchmark.cc: generate_cpp_no_group_benchmark_code + +cpp_no_group: cpp_no_group_protoc_middleman generate_gogo_data cpp-no-group-benchmark + ./cpp-no-group-benchmark $(gogo_data) + +gogo_proto_middleman: protoc-gen-gogoproto + mkdir -p "tmp/gogo_proto" + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-gogoproto --gogoproto_out=$$oldpwd/tmp/gogo_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) ) + touch gogo_proto_middleman + +generate_gogo_data: protoc_middleman protoc_middleman2 gogo-data-scrubber + mkdir -p `dirname $(gogo_data)` + ./gogo-data-scrubber $(all_data) $(gogo_data) + touch generate_gogo_data + +make_tmp_dir_gogo: + mkdir -p tmp/go_no_group/benchmark_code + mkdir -p tmp/gogofast/benchmark_code + mkdir -p tmp/gogofaster/benchmark_code + mkdir -p tmp/gogoslick/benchmark_code + touch make_tmp_dir_gogo + +go_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message1) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message2) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message3) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message4) ) + touch go_no_group_protoc_middleman + +cpp_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message1) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message2) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message3) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message4) ) + touch cpp_no_group_protoc_middleman + +gogofast_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_benchmark_wrapper) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message1) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message2) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message3) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message4) ) + touch gogofast_protoc_middleman + +gogofaster_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_benchmark_wrapper) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message1) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message2) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message3) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message4) ) + touch gogofaster_protoc_middleman + +gogoslick_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_benchmark_wrapper) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message1) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message2) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message3) ) + oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message4) ) + touch gogoslick_protoc_middleman + +generate-gogo-benchmark-code: + @echo '#! /bin/bash' > generate-gogo-benchmark-code + @echo 'cp $(srcdir)/go/go_benchmark_test.go tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code + @echo 'sed -i -e "s/\.\.\/tmp/../g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code + @echo 'sed -i -e "s/b\.Run(\"\(.*\)\"/b.Run(\"\1\_$$1\"/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code + @echo 'if [[ $$2 == 1 ]]; then sed -i -e "s/github\.com\/golang/github.com\/gogo/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go; fi ' >> generate-gogo-benchmark-code + @chmod +x generate-gogo-benchmark-code + +generate_all_gogo_benchmark_code: generate-gogo-benchmark-code make_tmp_dir_gogo + ./generate-gogo-benchmark-code go_no_group 0 + ./generate-gogo-benchmark-code gogofast 1 + ./generate-gogo-benchmark-code gogofaster 1 + ./generate-gogo-benchmark-code gogoslick 1 + +gogo-benchmark: + @echo "Writing shortcut script gogo-benchmark..." + @echo '#! /bin/bash' > gogo-benchmark + @echo 'cd tmp/$$1/benchmark_code' >> gogo-benchmark + @echo 'shift' >> gogo-benchmark + @echo 'all_data=""' >> gogo-benchmark + @echo 'for data_file in $$@; do all_data="$$all_data ../../../$$data_file"; done' >> gogo-benchmark + @echo 'go test -bench=. -- $$all_data' >> gogo-benchmark + @echo 'cd ../..' >> gogo-benchmark + @chmod +x gogo-benchmark + +go_no_group: go_no_group_protoc_middleman generate_gogo_data generate_all_gogo_benchmark_code gogo-benchmark + ./gogo-benchmark go_no_group $(gogo_data) + +gogofast: gogofast_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code + ./gogo-benchmark gogofast $(gogo_data) + +gogofaster: gogofaster_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code + ./gogo-benchmark gogofaster $(gogo_data) + +gogoslick: gogoslick_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code + ./gogo-benchmark gogoslick $(gogo_data) +util/gogo_data_scrubber-gogo_data_scrubber.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) +util/proto3_data_stripper-proto3_data_stripper.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) + +############ UTIL RULES END ############ + +############ PROTO3 PREPARATION BEGIN ############# + +proto3_proto_middleman: protoc-gen-proto2_to_proto3 + mkdir -p "tmp/proto3_proto" + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-proto2_to_proto3 --proto2_to_proto3_out=$$oldpwd/tmp/proto3_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) ) + touch proto3_proto_middleman + +generate_proto3_data: protoc_middleman protoc_middleman2 proto3-data-stripper + mkdir -p `dirname $(proto3_data)` + ./proto3-data-stripper $(all_data) $(proto3_data) + touch generate_proto3_data + +############ PROTO3 PREPARATION END ############# + +############ PHP RULES BEGIN ################# + +proto3_middleman_php: proto3_proto_middleman + mkdir -p "tmp/php" + oldpwd=`pwd` && ( cd tmp/proto3_proto && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --php_out=$$oldpwd/tmp/php $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) ) + touch proto3_middleman_php + +php-benchmark: proto3_middleman_php generate_proto3_data + mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark" + cp php/autoload.php "tmp/php" + @echo "Writing shortcut script php-benchmark..." + @echo '#! /bin/bash' > php-benchmark + @echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-benchmark + @echo 'cd tmp/php' >> php-benchmark + @echo 'export CURRENT_DIR=$$(pwd)' >> php-benchmark + @echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-benchmark + @echo 'cd ../..' >> php-benchmark + @chmod +x php-benchmark + +php: php-benchmark proto3_middleman_php + ./php-benchmark --behavior_prefix="php" $(proto3_data) + +php_c_extension: + cd $(top_srcdir)/php/ext/google/protobuf && phpize && ./configure CFLAGS='-O3' && make -j8 + +php-c-benchmark: proto3_middleman_php generate_proto3_data php_c_extension php_c_extension + mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark" + cp php/autoload.php "tmp/php" + @echo "Writing shortcut script php-c-benchmark..." + @echo '#! /bin/bash' > php-c-benchmark + @echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-c-benchmark + @echo 'export PROTOBUF_PHP_EXTDIR="$$PROTOBUF_PHP_SRCDIR/../ext/google/protobuf/modules"' >> php-c-benchmark + @echo 'cd tmp/php' >> php-c-benchmark + @echo 'export CURRENT_DIR=$$(pwd)' >> php-c-benchmark + @echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" -d extension="$$PROTOBUF_PHP_EXTDIR/protobuf.so" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-c-benchmark + @echo 'cd ../..' >> php-c-benchmark + @chmod +x php-c-benchmark + +php_c: php-c-benchmark proto3_middleman_php + ./php-c-benchmark --behavior_prefix="php_c" $(proto3_data) + +############ PHP RULES END ################# + +############ protobuf.js RULE BEGIN ############# + +pbjs_preparation: + mkdir -p tmp/protobuf.js + cd tmp/protobuf.js && git clone https://github.com/dcodeIO/protobuf.js.git && \ + cd protobuf.js && npm install && npm run build + cd tmp/protobuf.js && npm install benchmark + cp protobuf.js/* tmp/protobuf.js + cp js/benchmark_suite.js tmp/protobuf.js + touch pbjs_preparation + +pbjs_middleman: pbjs_preparation + export OLDDIR=$$(pwd) && cd tmp/protobuf.js && node generate_pbjs_files.js --target static-module --include_path=$$OLDDIR -o generated_bundle_code.js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) + touch pbjs_middleman + +pbjs-benchmark: pbjs_middleman + @echo '#! /bin/bash' > pbjs-benchmark + @echo 'cd tmp/protobuf.js' >> pbjs-benchmark + @echo 'sed -i "s/protobufjs/.\/protobuf.js/g" generated_bundle_code.js' >> pbjs-benchmark + @echo 'env NODE_PATH=".:./node_modules:$$NODE_PATH" node protobufjs_benchmark.js $$@' >> pbjs-benchmark + @chmod +x pbjs-benchmark + +pbjs: pbjs-benchmark + ./pbjs-benchmark $(all_data) + +############ protobuf.js RULE END ############# + +############ JS RULE BEGIN ############# + +js_preparation: + mkdir -p tmp/js + oldpwd=$$(pwd) && cd $(top_srcdir)/js && npm install && npm test + cd tmp/js && npm install benchmark + cp js/* tmp/js + touch js_preparation + +js_middleman: js_preparation + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --js_out=import_style=commonjs,binary:$$oldpwd/tmp/js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2)) + touch js_middleman + +js-benchmark: js_middleman + @echo '#! /bin/bash' > js-benchmark + @echo 'export TOP_JS_SRCDIR=$$(cd $(top_srcdir)/js && pwd)' >> js-benchmark + @echo 'cd tmp/js' >> js-benchmark + @echo 'env NODE_PATH="$$TOP_JS_SRCDIR:.:./node_modules:$$NODE_PATH" node --max-old-space-size=4096 js_benchmark.js $$@' >> js-benchmark + @chmod +x js-benchmark + +js: js-benchmark + ./js-benchmark $(all_data) + +clean-local: + -rm -rf tmp/* + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/benchmarks/README.md b/benchmarks/README.md deleted file mode 100644 index 436c148a34d06cf731bf8e2fde611eafcae5ee0c..0000000000000000000000000000000000000000 --- a/benchmarks/README.md +++ /dev/null @@ -1,243 +0,0 @@ - -# Protocol Buffers Benchmarks - -This directory contains benchmarking schemas and data sets that you -can use to test a variety of performance scenarios against your -protobuf language runtime. If you are looking for performance -numbers of officially support languages, see [here]( -https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md) - -## Prerequisite - -First, you need to follow the instruction in the root directory's README to -build your language's protobuf, then: - -### CPP -You need to install [cmake](https://cmake.org/) before building the benchmark. - -We are using [google/benchmark](https://github.com/google/benchmark) as the -benchmark tool for testing cpp. This will be automatically made during build the -cpp benchmark. - -The cpp protobuf performance can be improved by linking with [tcmalloc library]( -https://gperftools.github.io/gperftools/tcmalloc.html). For using tcmalloc, you -need to build [gpertools](https://github.com/gperftools/gperftools) to generate -libtcmallc.so library. - -### Java -We're using maven to build the java benchmarks, which is the same as to build -the Java protobuf. There're no other tools need to install. We're using -[google/caliper](https://github.com/google/caliper) as benchmark tool, which -can be automatically included by maven. - -### Python -We're using python C++ API for testing the generated -CPP proto version of python protobuf, which is also a prerequisite for Python -protobuf cpp implementation. You need to install the correct version of Python -C++ extension package before run generated CPP proto version of Python -protobuf's benchmark. e.g. under Ubuntu, you need to - -``` -$ sudo apt-get install python-dev -$ sudo apt-get install python3-dev -``` -And you also need to make sure `pkg-config` is installed. - -### Go -Go protobufs are maintained at [github.com/golang/protobuf]( -http://github.com/golang/protobuf). If not done already, you need to install the -toolchain and the Go protoc-gen-go plugin for protoc. - -To install protoc-gen-go, run: - -``` -$ go get -u github.com/golang/protobuf/protoc-gen-go -$ export PATH=$PATH:$(go env GOPATH)/bin -``` - -The first command installs `protoc-gen-go` into the `bin` directory in your local `GOPATH`. -The second command adds the `bin` directory to your `PATH` so that `protoc` can locate the plugin later. - -### PHP -PHP benchmark's requirement is the same as PHP protobuf's requirements. The benchmark will automatically -include PHP protobuf's src and build the c extension if required. - -### Node.js -Node.js benchmark need [node](https://nodejs.org/en/)(higher than V6) and [npm](https://www.npmjs.com/) package manager installed. This benchmark is using the [benchmark](https://www.npmjs.com/package/benchmark) framework to test, which needn't to manually install. And another prerequisite is [protobuf js](https://github.com/protocolbuffers/protobuf/tree/master/js), which needn't to manually install either - -### C# -The C# benchmark code is built as part of the main Google.Protobuf -solution. It requires the .NET Core SDK, and depends on -[BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet), which -will be downloaded automatically. - -### Big data - -There's some optional big testing data which is not included in the directory -initially, you need to run the following command to download the testing data: - -``` -$ ./download_data.sh -``` - -After doing this the big data file will automatically generated in the -benchmark directory. - -## Run instructions - -To run all the benchmark dataset: - -### Java: - -``` -$ make java -``` - -### CPP: - -``` -$ make cpp -``` - -For linking with tcmalloc: - -``` -$ env LD_PRELOAD={directory to libtcmalloc.so} make cpp -``` - -### Python: - -We have three versions of python protobuf implementation: pure python, cpp -reflection and cpp generated code. To run these version benchmark, you need to: - -#### Pure Python: - -``` -$ make python-pure-python -``` - -#### CPP reflection: - -``` -$ make python-cpp-reflection -``` - -#### CPP generated code: - -``` -$ make python-cpp-generated-code -``` - -### Go -``` -$ make go -``` - - -### PHP -We have two version of php protobuf implemention: pure php, php with c extension. To run these version benchmark, you need to: -#### Pure PHP -``` -$ make php -``` -#### PHP with c extension -``` -$ make php_c -``` - -### Node.js -``` -$ make js -``` - -To run a specific dataset or run with specific options: - -### Java: - -``` -$ make java-benchmark -$ ./java-benchmark $(specific generated dataset file name) [$(caliper options)] -``` - -### CPP: - -``` -$ make cpp-benchmark -$ ./cpp-benchmark $(specific generated dataset file name) [$(benchmark options)] -``` - -### Python: - -For Python benchmark we have `--json` for outputting the json result - -#### Pure Python: - -``` -$ make python-pure-python-benchmark -$ ./python-pure-python-benchmark [--json] $(specific generated dataset file name) -``` - -#### CPP reflection: - -``` -$ make python-cpp-reflection-benchmark -$ ./python-cpp-reflection-benchmark [--json] $(specific generated dataset file name) -``` - -#### CPP generated code: - -``` -$ make python-cpp-generated-code-benchmark -$ ./python-cpp-generated-code-benchmark [--json] $(specific generated dataset file name) -``` - -### Go: -``` -$ make go-benchmark -$ ./go-benchmark $(specific generated dataset file name) [go testing options] -``` - -### PHP -#### Pure PHP -``` -$ make php-benchmark -$ ./php-benchmark $(specific generated dataset file name) -``` -#### PHP with c extension -``` -$ make php-c-benchmark -$ ./php-c-benchmark $(specific generated dataset file name) -``` - -### Node.js -``` -$ make js-benchmark -$ ./js-benchmark $(specific generated dataset file name) -``` - -### C# -From `csharp/src/Google.Protobuf.Benchmarks`, run: - -``` -$ dotnet run -c Release -``` - -We intend to add support for this within the makefile in due course. - -## Benchmark datasets - -Each data set is in the format of benchmarks.proto: - -1. name is the benchmark dataset's name. -2. message_name is the benchmark's message type full name (including package and message name) -3. payload is the list of raw data. - -The schema for the datasets is described in `benchmarks.proto`. - -Benchmark likely want to run several benchmarks against each data set (parse, -serialize, possibly JSON, possibly using different APIs, etc). - -We would like to add more data sets. In general we will favor data sets -that make the overall suite diverse without being too large or having -too many similar tests. Ideally everyone can run through the entire -suite without the test run getting too long. diff --git a/benchmarks/datasets/google_message1/proto2/dataset.google_message1_proto2.pb b/benchmarks/datasets/google_message1/proto2/dataset.google_message1_proto2.pb deleted file mode 100644 index f6fe7848cb889b65fb2c9465780c2e82b398639b..0000000000000000000000000000000000000000 Binary files a/benchmarks/datasets/google_message1/proto2/dataset.google_message1_proto2.pb and /dev/null differ diff --git a/benchmarks/datasets/google_message1/proto3/dataset.google_message1_proto3.pb b/benchmarks/datasets/google_message1/proto3/dataset.google_message1_proto3.pb deleted file mode 100644 index 4955bed31b5aee2a257a4979edd3c1b6291b335f..0000000000000000000000000000000000000000 Binary files a/benchmarks/datasets/google_message1/proto3/dataset.google_message1_proto3.pb and /dev/null differ diff --git a/benchmarks/datasets/google_message2/dataset.google_message2.pb b/benchmarks/datasets/google_message2/dataset.google_message2.pb deleted file mode 100644 index 3fa0e49e57db704a0f371d2b58a2d5b315acd554..0000000000000000000000000000000000000000 Binary files a/benchmarks/datasets/google_message2/dataset.google_message2.pb and /dev/null differ diff --git a/benchmarks/download_data.sh b/benchmarks/download_data.sh deleted file mode 100644 index fa0729e9a336eb6b11ec04a9ec08ff78950fdc6a..0000000000000000000000000000000000000000 --- a/benchmarks/download_data.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh - -curl -O https://storage.googleapis.com/protobuf_opensource_benchmark_data/datasets.tar.gz -tar -zvxf datasets.tar.gz - diff --git a/benchmarks/go/go_benchmark_test.go b/benchmarks/go/go_benchmark_test.go deleted file mode 100644 index 8c741b710649f38ded160a1e7f5d5f9b65493d18..0000000000000000000000000000000000000000 --- a/benchmarks/go/go_benchmark_test.go +++ /dev/null @@ -1,124 +0,0 @@ -package main - -import ( - benchmarkWrapper "../tmp" - googleMessage1Proto2 "../tmp/datasets/google_message1/proto2" - googleMessage1Proto3 "../tmp/datasets/google_message1/proto3" - googleMessage2 "../tmp/datasets/google_message2" - googleMessage3 "../tmp/datasets/google_message3" - googleMessage4 "../tmp/datasets/google_message4" - "flag" - "github.com/golang/protobuf/proto" - "io/ioutil" - "testing" -) - -// Data is returned by the Load function. -type Dataset struct { - name string - newMessage func() proto.Message - marshaled [][]byte - unmarshaled []proto.Message -} - -var datasets []Dataset - -// This is used to getDefaultInstance for a message type. -func generateNewMessageFunction(dataset benchmarkWrapper.BenchmarkDataset) func() proto.Message { - switch dataset.MessageName { - case "benchmarks.proto3.GoogleMessage1": - return func() proto.Message { return new(googleMessage1Proto3.GoogleMessage1) } - case "benchmarks.proto2.GoogleMessage1": - return func() proto.Message { return new(googleMessage1Proto2.GoogleMessage1) } - case "benchmarks.proto2.GoogleMessage2": - return func() proto.Message { return new(googleMessage2.GoogleMessage2) } - case "benchmarks.google_message3.GoogleMessage3": - return func() proto.Message { return new(googleMessage3.GoogleMessage3) } - case "benchmarks.google_message4.GoogleMessage4": - return func() proto.Message { return new(googleMessage4.GoogleMessage4) } - default: - panic("Unknown message type: " + dataset.MessageName) - } -} - -func init() { - flag.Parse() - for _, f := range flag.Args() { - // Load the benchmark. - b, err := ioutil.ReadFile(f) - if err != nil { - panic(err) - } - - // Parse the benchmark. - var dm benchmarkWrapper.BenchmarkDataset - if err := proto.Unmarshal(b, &dm); err != nil { - panic(err) - } - - // Determine the concrete protobuf message type to use. - var ds Dataset - ds.newMessage = generateNewMessageFunction(dm) - - // Unmarshal each test message. - for _, payload := range dm.Payload { - ds.marshaled = append(ds.marshaled, payload) - m := ds.newMessage() - if err := proto.Unmarshal(payload, m); err != nil { - panic(err) - } - ds.unmarshaled = append(ds.unmarshaled, m) - } - ds.name = f - - datasets = append(datasets, ds) - } -} - -func Benchmark(b *testing.B) { - for _, ds := range datasets { - b.Run(ds.name, func(b *testing.B) { - b.Run("Unmarshal", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for j, payload := range ds.marshaled { - out := ds.newMessage() - if err := proto.Unmarshal(payload, out); err != nil { - b.Fatalf("can't unmarshal message %d %v", j, err) - } - } - } - }) - b.Run("Marshal", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for j, m := range ds.unmarshaled { - if _, err := proto.Marshal(m); err != nil { - b.Fatalf("can't marshal message %d %+v: %v", j, m, err) - } - } - } - }) - b.Run("Size", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, m := range ds.unmarshaled { - proto.Size(m) - } - } - }) - b.Run("Clone", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, m := range ds.unmarshaled { - proto.Clone(m) - } - } - }) - b.Run("Merge", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, m := range ds.unmarshaled { - out := ds.newMessage() - proto.Merge(out, m) - } - } - }) - }) - } -} diff --git a/benchmarks/gogo/cpp_no_group/cpp_benchmark.cc b/benchmarks/gogo/cpp_no_group/cpp_benchmark.cc new file mode 100644 index 0000000000000000000000000000000000000000..84acd804cebd2917ecf64cac43dfad79cf332003 --- /dev/null +++ b/benchmarks/gogo/cpp_no_group/cpp_benchmark.cc @@ -0,0 +1,254 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include "benchmark/benchmark.h" +#include "gogo/cpp_no_group/benchmarks.pb.h" +#include "gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" +#include "gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" +#include "gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.h" +#include "gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.h" +#include "gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.h" + + +#define PREFIX "dataset." +#define SUFFIX ".pb" + +using benchmarks::BenchmarkDataset; +using google::protobuf::Arena; +using google::protobuf::Descriptor; +using google::protobuf::DescriptorPool; +using google::protobuf::Message; +using google::protobuf::MessageFactory; + +class Fixture : public benchmark::Fixture { + public: + Fixture(const BenchmarkDataset& dataset, const std::string& suffix) { + for (int i = 0; i < dataset.payload_size(); i++) { + payloads_.push_back(dataset.payload(i)); + } + + const Descriptor* d = + DescriptorPool::generated_pool()->FindMessageTypeByName( + dataset.message_name()); + + if (!d) { + std::cerr << "Couldn't find message named '" << dataset.message_name() + << "\n"; + } + + prototype_ = MessageFactory::generated_factory()->GetPrototype(d); + SetName((dataset.name() + suffix).c_str()); + } + + protected: + std::vector payloads_; + const Message* prototype_; +}; + +class WrappingCounter { + public: + WrappingCounter(size_t limit) : value_(0), limit_(limit) {} + + size_t Next() { + size_t ret = value_; + if (++value_ == limit_) { + value_ = 0; + } + return ret; + } + + private: + size_t value_; + size_t limit_; +}; + +template +class ParseNewFixture : public Fixture { + public: + ParseNewFixture(const BenchmarkDataset& dataset) + : Fixture(dataset, "_parse_new") {} + + virtual void BenchmarkCase(benchmark::State& state) { + WrappingCounter i(payloads_.size()); + size_t total = 0; + + while (state.KeepRunning()) { + T m; + const std::string& payload = payloads_[i.Next()]; + total += payload.size(); + m.ParseFromString(payload); + } + + state.SetBytesProcessed(total); + } +}; + +template +class ParseNewArenaFixture : public Fixture { + public: + ParseNewArenaFixture(const BenchmarkDataset& dataset) + : Fixture(dataset, "_parse_newarena") {} + + virtual void BenchmarkCase(benchmark::State& state) { + WrappingCounter i(payloads_.size()); + size_t total = 0; + Arena arena; + + while (state.KeepRunning()) { + arena.Reset(); + Message* m = Arena::CreateMessage(&arena); + const std::string& payload = payloads_[i.Next()]; + total += payload.size(); + m->ParseFromString(payload); + } + + state.SetBytesProcessed(total); + } +}; + +template +class ParseReuseFixture : public Fixture { + public: + ParseReuseFixture(const BenchmarkDataset& dataset) + : Fixture(dataset, "_parse_reuse") {} + + virtual void BenchmarkCase(benchmark::State& state) { + T m; + WrappingCounter i(payloads_.size()); + size_t total = 0; + + while (state.KeepRunning()) { + const std::string& payload = payloads_[i.Next()]; + total += payload.size(); + m.ParseFromString(payload); + } + + state.SetBytesProcessed(total); + } +}; + +template +class SerializeFixture : public Fixture { + public: + SerializeFixture(const BenchmarkDataset& dataset) + : Fixture(dataset, "_serialize") { + for (size_t i = 0; i < payloads_.size(); i++) { + message_.push_back(new T); + message_.back()->ParseFromString(payloads_[i]); + } + } + + ~SerializeFixture() { + for (size_t i = 0; i < message_.size(); i++) { + delete message_[i]; + } + } + + virtual void BenchmarkCase(benchmark::State& state) { + size_t total = 0; + std::string str; + WrappingCounter i(payloads_.size()); + + while (state.KeepRunning()) { + str.clear(); + message_[i.Next()]->SerializeToString(&str); + total += str.size(); + } + + state.SetBytesProcessed(total); + } + + private: + std::vector message_; +}; + +std::string ReadFile(const std::string& name) { + std::ifstream file(name.c_str()); + GOOGLE_CHECK(file.is_open()) << "Couldn't find file '" << name << + "', please make sure you are running " + "this command from the benchmarks/ " + "directory.\n"; + return std::string((std::istreambuf_iterator(file)), + std::istreambuf_iterator()); +} + +template +void RegisterBenchmarksForType(const BenchmarkDataset& dataset) { + ::benchmark::internal::RegisterBenchmarkInternal( + new ParseNewFixture(dataset)); + ::benchmark::internal::RegisterBenchmarkInternal( + new ParseReuseFixture(dataset)); + ::benchmark::internal::RegisterBenchmarkInternal( + new ParseNewArenaFixture(dataset)); + ::benchmark::internal::RegisterBenchmarkInternal( + new SerializeFixture(dataset)); +} + +void RegisterBenchmarks(const std::string& dataset_bytes) { + BenchmarkDataset dataset; + GOOGLE_CHECK(dataset.ParseFromString(dataset_bytes)); + + if (dataset.message_name() == "benchmarks.proto3.GoogleMessage1") { + RegisterBenchmarksForType(dataset); + } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage1") { + RegisterBenchmarksForType(dataset); + } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage2") { + RegisterBenchmarksForType(dataset); + } else if (dataset.message_name() == + "benchmarks.google_message3.GoogleMessage3") { + RegisterBenchmarksForType + (dataset); + } else if (dataset.message_name() == + "benchmarks.google_message4.GoogleMessage4") { + RegisterBenchmarksForType + (dataset); + } else { + std::cerr << "Unknown message type: " << dataset.message_name(); + exit(1); + } +} + +int main(int argc, char *argv[]) { + ::benchmark::Initialize(&argc, argv); + if (argc == 1) { + std::cerr << "Usage: ./cpp-benchmark " << std::endl; + std::cerr << "input data is in the format of \"benchmarks.proto\"" + << std::endl; + return 1; + } else { + for (int i = 1; i < argc; i++) { + RegisterBenchmarks(ReadFile(argv[i])); + } + } + + ::benchmark::RunSpecifiedBenchmarks(); +} diff --git a/benchmarks/java/pom.xml b/benchmarks/java/pom.xml deleted file mode 100644 index 570bd6644fd7c3735f720720b2ad8f49da541da9..0000000000000000000000000000000000000000 --- a/benchmarks/java/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - 4.0.0 - protobuf-java-benchmark - com.google.protobuf - 1.0.0 - Protocol Buffers [Benchmark] - The benchmark tools for Protobuf Java. - - - - com.google.protobuf - protobuf-java - ${protobuf.version} - jar - system - ${project.basedir}/lib/protobuf-java.jar - - - com.google.caliper - caliper - 1.0-beta-2 - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.4.1 - - - - jar-with-dependencies - - - - - com.mkyong.core.utils.App - - - - - - make-assembly - - package - - single - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.5.1 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.5 - - - - true - com.google.protocolbuffers.ProtoBench - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.4 - - - attach-sources - - jar-no-fork - - - - - - - - - diff --git a/benchmarks/java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java b/benchmarks/java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java deleted file mode 100644 index a4402481b0a0703251bc918eb6e28819f86d447d..0000000000000000000000000000000000000000 --- a/benchmarks/java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java +++ /dev/null @@ -1,214 +0,0 @@ - -package com.google.protobuf; - -import com.google.caliper.BeforeExperiment; -import com.google.caliper.AfterExperiment; -import com.google.caliper.Benchmark; -import com.google.caliper.Param; -import com.google.caliper.api.VmOptions; -import com.google.protobuf.ByteString; -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.ExtensionRegistry; -import com.google.protobuf.Message; -import com.google.protobuf.benchmarks.Benchmarks.BenchmarkDataset; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.ArrayList; -import java.util.List; - -// Caliper set CICompilerCount to 1 for making sure compilation doesn't run in parallel with itself, -// This makes TieredCompilation not working. We just disable TieredCompilation by default. In master -// branch this has been disabled by default in caliper: -// https://github.com/google/caliper/blob/master/caliper-runner/src/main/java/com/google/caliper/runner/target/Jvm.java#L38:14 -// But this haven't been added into most recent release. -@VmOptions("-XX:-TieredCompilation") -public class ProtoCaliperBenchmark { - public enum BenchmarkMessageType { - GOOGLE_MESSAGE1_PROTO3 { - @Override ExtensionRegistry getExtensionRegistry() { return ExtensionRegistry.newInstance(); } - @Override - Message getDefaultInstance() { - return com.google.protobuf.benchmarks.BenchmarkMessage1Proto3.GoogleMessage1 - .getDefaultInstance(); - } - }, - GOOGLE_MESSAGE1_PROTO2 { - @Override ExtensionRegistry getExtensionRegistry() { return ExtensionRegistry.newInstance(); } - @Override - Message getDefaultInstance() { - return com.google.protobuf.benchmarks.BenchmarkMessage1Proto2.GoogleMessage1 - .getDefaultInstance(); - } - }, - GOOGLE_MESSAGE2 { - @Override ExtensionRegistry getExtensionRegistry() { return ExtensionRegistry.newInstance(); } - @Override - Message getDefaultInstance() { - return com.google.protobuf.benchmarks.BenchmarkMessage2.GoogleMessage2.getDefaultInstance(); - } - }, - GOOGLE_MESSAGE3 { - @Override - ExtensionRegistry getExtensionRegistry() { - ExtensionRegistry extensions = ExtensionRegistry.newInstance(); - com.google.protobuf.benchmarks.BenchmarkMessage38.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage37.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage36.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage35.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage34.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage33.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage32.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage31.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage3.registerAllExtensions(extensions); - return extensions; - } - @Override - Message getDefaultInstance() { - return com.google.protobuf.benchmarks.BenchmarkMessage3.GoogleMessage3.getDefaultInstance(); - } - }, - GOOGLE_MESSAGE4 { - @Override - ExtensionRegistry getExtensionRegistry() { - ExtensionRegistry extensions = ExtensionRegistry.newInstance(); - com.google.protobuf.benchmarks.BenchmarkMessage43.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage42.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage41.registerAllExtensions(extensions); - com.google.protobuf.benchmarks.BenchmarkMessage4.registerAllExtensions(extensions); - return extensions; - } - @Override - Message getDefaultInstance() { - return com.google.protobuf.benchmarks.BenchmarkMessage4.GoogleMessage4.getDefaultInstance(); - } - }; - - abstract ExtensionRegistry getExtensionRegistry(); - abstract Message getDefaultInstance(); - } - - private BenchmarkMessageType benchmarkMessageType; - @Param("") - private String dataFile; - - private byte[] inputData; - private BenchmarkDataset benchmarkDataset; - private Message defaultMessage; - private ExtensionRegistry extensions; - private List inputDataList; - private List inputStreamList; - private List inputStringList; - private List sampleMessageList; - - private BenchmarkMessageType getMessageType() throws IOException { - if (benchmarkDataset.getMessageName().equals("benchmarks.proto3.GoogleMessage1")) { - return BenchmarkMessageType.GOOGLE_MESSAGE1_PROTO3; - } else if (benchmarkDataset.getMessageName().equals("benchmarks.proto2.GoogleMessage1")) { - return BenchmarkMessageType.GOOGLE_MESSAGE1_PROTO2; - } else if (benchmarkDataset.getMessageName().equals("benchmarks.proto2.GoogleMessage2")) { - return BenchmarkMessageType.GOOGLE_MESSAGE2; - } else if (benchmarkDataset.getMessageName(). - equals("benchmarks.google_message3.GoogleMessage3")) { - return BenchmarkMessageType.GOOGLE_MESSAGE3; - } else if (benchmarkDataset.getMessageName(). - equals("benchmarks.google_message4.GoogleMessage4")) { - return BenchmarkMessageType.GOOGLE_MESSAGE4; - } else { - throw new IllegalStateException("Invalid DataFile! There's no testing message named " - + benchmarkDataset.getMessageName()); - } - } - - @BeforeExperiment - void setUp() throws IOException { - if (!dataFile.equals("")) { - RandomAccessFile file = new RandomAccessFile(new File(dataFile), "r"); - inputData = new byte[(int) file.length()]; - file.readFully(inputData); - benchmarkDataset = BenchmarkDataset.parseFrom(inputData); - benchmarkMessageType = getMessageType(); - } else { - inputData = new byte[0]; - benchmarkDataset = BenchmarkDataset.parseFrom(inputData); - benchmarkMessageType = BenchmarkMessageType.GOOGLE_MESSAGE2; - } - defaultMessage = benchmarkMessageType.getDefaultInstance(); - extensions = benchmarkMessageType.getExtensionRegistry(); - inputDataList = new ArrayList(); - inputStreamList = new ArrayList(); - inputStringList = new ArrayList(); - sampleMessageList = new ArrayList(); - - for (int i = 0; i < benchmarkDataset.getPayloadCount(); i++) { - byte[] singleInputData = benchmarkDataset.getPayload(i).toByteArray(); - inputDataList.add(benchmarkDataset.getPayload(i).toByteArray()); - inputStreamList.add(new ByteArrayInputStream( - benchmarkDataset.getPayload(i).toByteArray())); - inputStringList.add(benchmarkDataset.getPayload(i)); - sampleMessageList.add( - defaultMessage.newBuilderForType().mergeFrom(singleInputData, extensions).build()); - } - } - - - @Benchmark - void serializeToByteArray(int reps) throws IOException { - if (sampleMessageList.size() == 0) { - return; - } - for (int i = 0; i < reps; i++) { - for (int j = 0; j < sampleMessageList.size(); j++) { - sampleMessageList.get(j).toByteArray(); - } - } - } - - @Benchmark - void serializeToMemoryStream(int reps) throws IOException { - if (sampleMessageList.size() == 0) { - return; - } - for (int i = 0; i < reps; i++) { - for (int j = 0; j < sampleMessageList.size(); j++) { - ByteArrayOutputStream output = new ByteArrayOutputStream(); - sampleMessageList.get(j).writeTo(output); - } - } - } - - @Benchmark - void deserializeFromByteArray(int reps) throws IOException { - if (inputDataList.size() == 0) { - return; - } - for (int i = 0; i < reps; i++) { - for (int j = 0; j < inputDataList.size(); j++) { - benchmarkMessageType.getDefaultInstance().getParserForType().parseFrom( - inputDataList.get(j), extensions); - } - } - } - - @Benchmark - void deserializeFromMemoryStream(int reps) throws IOException { - if (inputStreamList.size() == 0) { - return; - } - for (int i = 0; i < reps; i++) { - for (int j = 0; j < inputStreamList.size(); j++) { - benchmarkMessageType.getDefaultInstance().getParserForType().parseFrom( - inputStreamList.get(j), extensions); - inputStreamList.get(j).reset(); - } - } - } -} - - diff --git a/benchmarks/js/benchmark_suite.js b/benchmarks/js/benchmark_suite.js deleted file mode 100644 index c5c3e5105a487bd8236a8a9a316bfd4f5dcc9d18..0000000000000000000000000000000000000000 --- a/benchmarks/js/benchmark_suite.js +++ /dev/null @@ -1,33 +0,0 @@ -var benchmark = require("benchmark"); - -function newBenchmark(messageName, filename, language) { - var benches = []; - return { - suite: new benchmark.Suite(messageName + filename + language ) - .on("add", function(event) { - benches.push(event.target); - }) - .on("start", function() { - process.stdout.write( - "benchmarking message " + messageName - + " of dataset file " + filename - + "'s performance ..." + "\n\n"); - }) - .on("cycle", function(event) { - process.stdout.write(String(event.target) + "\n"); - }) - .on("complete", function() { - var getHz = function(bench) { - return 1 / (bench.stats.mean + bench.stats.moe); - } - benches.forEach(function(val, index) { - benches[index] = getHz(val); - }); - }), - benches: benches - } -} - -module.exports = { - newBenchmark: newBenchmark -} diff --git a/benchmarks/js/js_benchmark.js b/benchmarks/js/js_benchmark.js deleted file mode 100644 index c44fee01c39ca9939adc8617c607d84233f8f687..0000000000000000000000000000000000000000 --- a/benchmarks/js/js_benchmark.js +++ /dev/null @@ -1,82 +0,0 @@ -require('./datasets/google_message1/proto2/benchmark_message1_proto2_pb.js'); -require('./datasets/google_message1/proto3/benchmark_message1_proto3_pb.js'); -require('./datasets/google_message2/benchmark_message2_pb.js'); -require('./datasets/google_message3/benchmark_message3_pb.js'); -require('./datasets/google_message4/benchmark_message4_pb.js'); -require('./benchmarks_pb.js'); - -var fs = require('fs'); -var benchmarkSuite = require("./benchmark_suite.js"); - - -function getNewPrototype(name) { - var message = eval("proto." + name); - if (typeof(message) == "undefined") { - throw "type " + name + " is undefined"; - } - return message; -} - -var results = []; -var json_file = ""; - -console.log("#####################################################"); -console.log("Js Benchmark: "); -process.argv.forEach(function(filename, index) { - if (index < 2) { - return; - } - if (filename.indexOf("--json_output") != -1) { - json_file = filename.replace(/^--json_output=/, ''); - return; - } - - var benchmarkDataset = - proto.benchmarks.BenchmarkDataset.deserializeBinary(fs.readFileSync(filename)); - var messageList = []; - var totalBytes = 0; - benchmarkDataset.getPayloadList().forEach(function(onePayload) { - var message = getNewPrototype(benchmarkDataset.getMessageName()); - messageList.push(message.deserializeBinary(onePayload)); - totalBytes += onePayload.length; - }); - - var senarios = benchmarkSuite.newBenchmark( - benchmarkDataset.getMessageName(), filename, "js"); - senarios.suite - .add("js deserialize", function() { - benchmarkDataset.getPayloadList().forEach(function(onePayload) { - var protoType = getNewPrototype(benchmarkDataset.getMessageName()); - protoType.deserializeBinary(onePayload); - }); - }) - .add("js serialize", function() { - var protoType = getNewPrototype(benchmarkDataset.getMessageName()); - messageList.forEach(function(message) { - message.serializeBinary(); - }); - }) - .run({"Async": false}); - - results.push({ - filename: filename, - benchmarks: { - protobufjs_decoding: senarios.benches[0] * totalBytes / 1024 / 1024, - protobufjs_encoding: senarios.benches[1] * totalBytes / 1024 / 1024 - } - }) - - console.log("Throughput for deserialize: " - + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log("Throughput for serialize: " - + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log(""); -}); -console.log("#####################################################"); - -if (json_file != "") { - fs.writeFile(json_file, JSON.stringify(results), (err) => { - if (err) throw err; - }); -} - diff --git a/benchmarks/php/PhpBenchmark.php b/benchmarks/php/PhpBenchmark.php deleted file mode 100644 index d3db61d248dac82454d0f50a08325d329dda1c24..0000000000000000000000000000000000000000 --- a/benchmarks/php/PhpBenchmark.php +++ /dev/null @@ -1,170 +0,0 @@ -getPayload(); - for ($i = $payloads->count() - 1; $i >= 0; $i--) { - (new $args[1]())->mergeFromString($payloads->offsetGet($i)); - } - } - - // $args: array of message - static function serialize(&$args) { - foreach ($args as &$temp_message) { - $temp_message->serializeToString(); - } - } -} - -class Benchmark -{ - private $benchmark_name; - private $args; - private $benchmark_time; - private $total_bytes; - private $coefficient; - - public function __construct($benchmark_name, $args, $total_bytes, - $benchmark_time = 5.0) { - $this->args = $args; - $this->benchmark_name = $benchmark_name; - $this->benchmark_time = $benchmark_time; - $this->total_bytes = $total_bytes; - $this->coefficient = pow (10, 0) / pow(2, 20); - } - - public function runBenchmark() { - $t = $this->runBenchmarkWithTimes(1); - $times = ceil($this->benchmark_time / $t); - return $this->total_bytes * $times / - ($times == 1 ? $t : $this->runBenchmarkWithTimes($times)) * - $this->coefficient; - } - - private function runBenchmarkWithTimes($times) { - $st = microtime(true); - for ($i = 0; $i < $times; $i++) { - call_user_func_array($this->benchmark_name, array(&$this->args)); - } - $en = microtime(true); - return $en - $st; - } -} - -function getMessageName(&$dataset) { - switch ($dataset->getMessageName()) { - case "benchmarks.proto3.GoogleMessage1": - return "\Benchmarks\Proto3\GoogleMessage1"; - case "benchmarks.proto2.GoogleMessage1": - return "\Benchmarks\Proto2\GoogleMessage1"; - case "benchmarks.proto2.GoogleMessage2": - return "\Benchmarks\Proto2\GoogleMessage2"; - case "benchmarks.google_message3.GoogleMessage3": - return "\Benchmarks\Google_message3\GoogleMessage3"; - case "benchmarks.google_message4.GoogleMessage4": - return "\Benchmarks\Google_message4\GoogleMessage4"; - default: - exit("Message " . $dataset->getMessageName() . " not found !"); - } -} - -function runBenchmark($file, $behavior_prefix) { - $datafile = fopen($file, "r") or die("Unable to open file " . $file); - $bytes = fread($datafile, filesize($file)); - $dataset = new BenchmarkDataset(NULL); - $dataset->mergeFromString($bytes); - $message_name = getMessageName($dataset); - $message_list = array(); - $total_bytes = 0; - $payloads = $dataset->getPayload(); - for ($i = $payloads->count() - 1; $i >= 0; $i--) { - $new_message = new $message_name(); - $new_message->mergeFromString($payloads->offsetGet($i)); - array_push($message_list, $new_message); - $total_bytes += strlen($payloads->offsetGet($i)); - } - - $parse_benchmark = new Benchmark( - "\Google\Protobuf\Benchmark\BenchmarkMethod::parse", - array($dataset, $message_name), $total_bytes); - $serialize_benchmark = new Benchmark( - "\Google\Protobuf\Benchmark\BenchmarkMethod::serialize", - $message_list, $total_bytes); - - return array( - "filename" => $file, - "benchmarks" => array( - $behavior_prefix . "_parse" => $parse_benchmark->runBenchmark(), - $behavior_prefix . "_serailize" => $serialize_benchmark->runBenchmark() - ), - "message_name" => $dataset->getMessageName() - ); -} - -// main -$json_output = false; -$results = array(); -$behavior_prefix = ""; - -foreach ($argv as $index => $arg) { - if ($index == 0) { - continue; - } - if ($arg == "--json") { - $json_output = true; - } else if (strpos($arg, "--behavior_prefix") == 0) { - $behavior_prefix = str_replace("--behavior_prefix=", "", $arg); - } -} - -foreach ($argv as $index => $arg) { - if ($index == 0) { - continue; - } - if (substr($arg, 0, 2) == "--") { - continue; - } else { - array_push($results, runBenchmark($arg, $behavior_prefix)); - } -} - -if ($json_output) { - print json_encode($results); -} else { - print "PHP protobuf benchmark result:\n\n"; - foreach ($results as $result) { - printf("result for test data file: %s\n", $result["filename"]); - foreach ($result["benchmarks"] as $benchmark => $throughput) { - printf(" Throughput for benchmark %s: %.2f MB/s\n", - $benchmark, $throughput); - } - } -} - -?> diff --git a/benchmarks/php/autoload.php b/benchmarks/php/autoload.php deleted file mode 100644 index 52a8741f80f0be8e349b95eed6f8287b7cf9124b..0000000000000000000000000000000000000000 --- a/benchmarks/php/autoload.php +++ /dev/null @@ -1,25 +0,0 @@ - 6 && arg.substring(arg.length - 6) == ".proto") { - protoFiles.push(arg); - } else if (arg.length > 15 && arg.substring(0, 15) == "--include_path=") { - prefix = arg.substring(15); - } else if (index >= 2) { - argv.push(arg); - } -}); -protoFiles.forEach(function(val) { - argv.push(prefix + "/" + val); -}); - -pbjs.main(argv, function(err, output){ - if (err) { - console.log(err); - } -}); - diff --git a/benchmarks/protobuf.js/protobufjs_benchmark.js b/benchmarks/protobuf.js/protobufjs_benchmark.js deleted file mode 100644 index 19e54972b86da70154c5fb1d52dea430acb6abbf..0000000000000000000000000000000000000000 --- a/benchmarks/protobuf.js/protobufjs_benchmark.js +++ /dev/null @@ -1,66 +0,0 @@ -var root = require("./generated_bundle_code.js"); -var fs = require('fs'); -var benchmark = require("./node_modules/benchmark"); -var benchmarkSuite = require("./benchmark_suite.js"); - - -function getNewPrototype(name) { - var message = eval("root." + name); - if (typeof(message) == "undefined") { - throw "type " + name + " is undefined"; - } - return message; -} - - -var results = []; - -console.log("#####################################################"); -console.log("ProtobufJs Benchmark: "); -process.argv.forEach(function(filename, index) { - if (index < 2) { - return; - } - var benchmarkDataset = - root.benchmarks.BenchmarkDataset.decode(fs.readFileSync(filename)); - var messageList = []; - var totalBytes = 0; - benchmarkDataset.payload.forEach(function(onePayload) { - var message = getNewPrototype(benchmarkDataset.messageName); - messageList.push(message.decode(onePayload)); - totalBytes += onePayload.length; - }); - - var senarios = benchmarkSuite.newBenchmark( - benchmarkDataset.messageName, filename, "protobufjs"); - senarios.suite - .add("protobuf.js static decoding", function() { - benchmarkDataset.payload.forEach(function(onePayload) { - var protoType = getNewPrototype(benchmarkDataset.messageName); - protoType.decode(onePayload); - }); - }) - .add("protobuf.js static encoding", function() { - var protoType = getNewPrototype(benchmarkDataset.messageName); - messageList.forEach(function(message) { - protoType.encode(message).finish(); - }); - }) - .run({"Async": false}); - - results.push({ - filename: filename, - benchmarks: { - protobufjs_decoding: senarios.benches[0] * totalBytes, - protobufjs_encoding: senarios.benches[1] * totalBytes - } - }) - - console.log("Throughput for decoding: " - + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log("Throughput for encoding: " - + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log(""); -}); -console.log("#####################################################"); - diff --git a/benchmarks/python/__init__.py b/benchmarks/python/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/benchmarks/python/py_benchmark.py b/benchmarks/python/py_benchmark.py deleted file mode 100644 index 60e377e4b8cc4772496333e1cb10454a797b546f..0000000000000000000000000000000000000000 --- a/benchmarks/python/py_benchmark.py +++ /dev/null @@ -1,161 +0,0 @@ -from __future__ import print_function -import sys -import os -import timeit -import math -import argparse -import fnmatch -import json - -parser = argparse.ArgumentParser(description="Python protobuf benchmark") -parser.add_argument("data_files", metavar="dataFile", nargs="+", - help="testing data files.") -parser.add_argument("--json", action="store_const", dest="json", - const="yes", default="no", - help="Whether to output json results") -parser.add_argument("--behavior_prefix", dest="behavior_prefix", - help="The output json format's behavior's name's prefix", - default="") -# BEGIN CPP GENERATED MESSAGE -parser.add_argument("--cpp_generated", action="store_const", - dest="cpp_generated", const="yes", default="no", - help="Whether to link generated code library") -# END CPP GENERATED MESSAGE -args = parser.parse_args() -# BEGIN CPP GENERATED MESSAGE -# CPP generated code must be linked before importing the generated Python code -# for the descriptor can be found in the pool -if args.cpp_generated != "no": - sys.path.append( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) + "/.libs" ) - import libbenchmark_messages - sys.path.append( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) + "/tmp" ) -# END CPP GENERATED MESSAGE - - -import datasets.google_message1.proto2.benchmark_message1_proto2_pb2 as benchmark_message1_proto2_pb2 -import datasets.google_message1.proto3.benchmark_message1_proto3_pb2 as benchmark_message1_proto3_pb2 -import datasets.google_message2.benchmark_message2_pb2 as benchmark_message2_pb2 -import datasets.google_message3.benchmark_message3_pb2 as benchmark_message3_pb2 -import datasets.google_message4.benchmark_message4_pb2 as benchmark_message4_pb2 -import benchmarks_pb2 as benchmarks_pb2 - - -def run_one_test(filename): - data = open(filename, "rb").read() - benchmark_dataset = benchmarks_pb2.BenchmarkDataset() - benchmark_dataset.ParseFromString(data) - total_bytes = 0 - for payload in benchmark_dataset.payload: - total_bytes += len(payload) - benchmark_util = Benchmark(full_iteration=len(benchmark_dataset.payload), - module="py_benchmark", - setup_method="init", - total_bytes=total_bytes) - result={} - result["filename"] = filename - result["message_name"] = benchmark_dataset.message_name - result["benchmarks"] = {} - benchmark_util.set_test_method("parse_from_benchmark") - result["benchmarks"][args.behavior_prefix + "_parse_from_benchmark"] = \ - benchmark_util.run_benchmark(setup_method_args='"%s"' % (filename)) - benchmark_util.set_test_method("serialize_to_benchmark") - result["benchmarks"][args.behavior_prefix + "_serialize_to_benchmark"] = \ - benchmark_util.run_benchmark(setup_method_args='"%s"' % (filename)) - return result - - -def init(filename): - global benchmark_dataset, message_class, message_list, counter, total_bytes - message_list=[] - counter = 0 - total_bytes = 0 - data = open(filename, "rb").read() - benchmark_dataset = benchmarks_pb2.BenchmarkDataset() - benchmark_dataset.ParseFromString(data) - - if benchmark_dataset.message_name == "benchmarks.proto3.GoogleMessage1": - message_class = benchmark_message1_proto3_pb2.GoogleMessage1 - elif benchmark_dataset.message_name == "benchmarks.proto2.GoogleMessage1": - message_class = benchmark_message1_proto2_pb2.GoogleMessage1 - elif benchmark_dataset.message_name == "benchmarks.proto2.GoogleMessage2": - message_class = benchmark_message2_pb2.GoogleMessage2 - elif benchmark_dataset.message_name == "benchmarks.google_message3.GoogleMessage3": - message_class = benchmark_message3_pb2.GoogleMessage3 - elif benchmark_dataset.message_name == "benchmarks.google_message4.GoogleMessage4": - message_class = benchmark_message4_pb2.GoogleMessage4 - else: - raise IOError("Message %s not found!" % (benchmark_dataset.message_name)) - - for one_payload in benchmark_dataset.payload: - temp = message_class() - temp.ParseFromString(one_payload) - message_list.append(temp) - total_bytes += len(one_payload) - - -def parse_from_benchmark(): - global counter, message_class, benchmark_dataset - m = message_class().ParseFromString(benchmark_dataset.payload[counter % len(benchmark_dataset.payload)]) - counter = counter + 1 - - -def serialize_to_benchmark(): - global counter, message_list, message_class - s = message_list[counter % len(benchmark_dataset.payload)].SerializeToString() - counter = counter + 1 - - -class Benchmark: - def __init__(self, module=None, test_method=None, - setup_method=None, total_bytes=None, full_iteration = 1): - self.full_iteration = full_iteration - self.module = module - self.test_method = test_method - self.setup_method = setup_method - self.total_bytes = total_bytes - - def set_test_method(self, test_method): - self.test_method = test_method - - def full_setup_code(self, setup_method_args=''): - setup_code = "" - setup_code += "from %s import %s\n" % (self.module, self.test_method) - setup_code += "from %s import %s\n" % (self.module, self.setup_method) - setup_code += "%s(%s)\n" % (self.setup_method, setup_method_args) - return setup_code - - def dry_run(self, test_method_args='', setup_method_args=''): - return timeit.timeit(stmt="%s(%s)" % (self.test_method, test_method_args), - setup=self.full_setup_code(setup_method_args), - number=self.full_iteration); - - def run_benchmark(self, test_method_args='', setup_method_args=''): - reps = self.full_iteration; - t = self.dry_run(test_method_args, setup_method_args); - if t < 3 : - reps = int(math.ceil(3 / t)) * self.full_iteration - if reps != self.full_iteration: - t = timeit.timeit(stmt="%s(%s)" % (self.test_method, test_method_args), - setup=self.full_setup_code(setup_method_args), - number=reps); - return self.total_bytes * 1.0 / 2 ** 20 / (1.0 * t / reps * self.full_iteration) - - -if __name__ == "__main__": - results = [] - for file in args.data_files: - results.append(run_one_test(file)) - - if args.json != "no": - print(json.dumps(results)) - else: - for result in results: - print("Message %s of dataset file %s" % \ - (result["message_name"], result["filename"])) - print("Average throughput for parse_from_benchmark: %.2f MB/s" % \ - (result["benchmarks"][ \ - args.behavior_prefix + "_parse_from_benchmark"])) - print("Average throughput for serialize_to_benchmark: %.2f MB/s" % \ - (result["benchmarks"][ \ - args.behavior_prefix + "_serialize_to_benchmark"])) - print("") diff --git a/benchmarks/util/__init__.py b/benchmarks/util/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/benchmarks/util/big_query_utils.py b/benchmarks/util/big_query_utils.py deleted file mode 100644 index aea55bbd896399c18a1c7afbd0a22c6f1515a01e..0000000000000000000000000000000000000000 --- a/benchmarks/util/big_query_utils.py +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/env python2.7 - -from __future__ import print_function -import argparse -import json -import uuid -import httplib2 - -from apiclient import discovery -from apiclient.errors import HttpError -from oauth2client.client import GoogleCredentials - -# 30 days in milliseconds -_EXPIRATION_MS = 30 * 24 * 60 * 60 * 1000 -NUM_RETRIES = 3 - - -def create_big_query(): - """Authenticates with cloud platform and gets a BiqQuery service object - """ - creds = GoogleCredentials.get_application_default() - return discovery.build( - 'bigquery', 'v2', credentials=creds, cache_discovery=False) - - -def create_dataset(biq_query, project_id, dataset_id): - is_success = True - body = { - 'datasetReference': { - 'projectId': project_id, - 'datasetId': dataset_id - } - } - - try: - dataset_req = biq_query.datasets().insert( - projectId=project_id, body=body) - dataset_req.execute(num_retries=NUM_RETRIES) - except HttpError as http_error: - if http_error.resp.status == 409: - print('Warning: The dataset %s already exists' % dataset_id) - else: - # Note: For more debugging info, print "http_error.content" - print('Error in creating dataset: %s. Err: %s' % (dataset_id, - http_error)) - is_success = False - return is_success - - -def create_table(big_query, project_id, dataset_id, table_id, table_schema, - description): - fields = [{ - 'name': field_name, - 'type': field_type, - 'description': field_description - } for (field_name, field_type, field_description) in table_schema] - return create_table2(big_query, project_id, dataset_id, table_id, fields, - description) - - -def create_partitioned_table(big_query, - project_id, - dataset_id, - table_id, - table_schema, - description, - partition_type='DAY', - expiration_ms=_EXPIRATION_MS): - """Creates a partitioned table. By default, a date-paritioned table is created with - each partition lasting 30 days after it was last modified. - """ - fields = [{ - 'name': field_name, - 'type': field_type, - 'description': field_description - } for (field_name, field_type, field_description) in table_schema] - return create_table2(big_query, project_id, dataset_id, table_id, fields, - description, partition_type, expiration_ms) - - -def create_table2(big_query, - project_id, - dataset_id, - table_id, - fields_schema, - description, - partition_type=None, - expiration_ms=None): - is_success = True - - body = { - 'description': description, - 'schema': { - 'fields': fields_schema - }, - 'tableReference': { - 'datasetId': dataset_id, - 'projectId': project_id, - 'tableId': table_id - } - } - - if partition_type and expiration_ms: - body["timePartitioning"] = { - "type": partition_type, - "expirationMs": expiration_ms - } - - try: - table_req = big_query.tables().insert( - projectId=project_id, datasetId=dataset_id, body=body) - res = table_req.execute(num_retries=NUM_RETRIES) - print('Successfully created %s "%s"' % (res['kind'], res['id'])) - except HttpError as http_error: - if http_error.resp.status == 409: - print('Warning: Table %s already exists' % table_id) - else: - print('Error in creating table: %s. Err: %s' % (table_id, - http_error)) - is_success = False - return is_success - - -def patch_table(big_query, project_id, dataset_id, table_id, fields_schema): - is_success = True - - body = { - 'schema': { - 'fields': fields_schema - }, - 'tableReference': { - 'datasetId': dataset_id, - 'projectId': project_id, - 'tableId': table_id - } - } - - try: - table_req = big_query.tables().patch( - projectId=project_id, - datasetId=dataset_id, - tableId=table_id, - body=body) - res = table_req.execute(num_retries=NUM_RETRIES) - print('Successfully patched %s "%s"' % (res['kind'], res['id'])) - except HttpError as http_error: - print('Error in creating table: %s. Err: %s' % (table_id, http_error)) - is_success = False - return is_success - - -def insert_rows(big_query, project_id, dataset_id, table_id, rows_list): - is_success = True - body = {'rows': rows_list} - try: - insert_req = big_query.tabledata().insertAll( - projectId=project_id, - datasetId=dataset_id, - tableId=table_id, - body=body) - res = insert_req.execute(num_retries=NUM_RETRIES) - if res.get('insertErrors', None): - print('Error inserting rows! Response: %s' % res) - is_success = False - except HttpError as http_error: - print('Error inserting rows to the table %s' % table_id) - is_success = False - - return is_success - - -def sync_query_job(big_query, project_id, query, timeout=5000): - query_data = {'query': query, 'timeoutMs': timeout} - query_job = None - try: - query_job = big_query.jobs().query( - projectId=project_id, - body=query_data).execute(num_retries=NUM_RETRIES) - except HttpError as http_error: - print('Query execute job failed with error: %s' % http_error) - print(http_error.content) - return query_job - - - # List of (column name, column type, description) tuples -def make_row(unique_row_id, row_values_dict): - """row_values_dict is a dictionary of column name and column value. - """ - return {'insertId': unique_row_id, 'json': row_values_dict} diff --git a/benchmarks/util/data_proto2_to_proto3_util.h b/benchmarks/util/data_proto2_to_proto3_util.h deleted file mode 100644 index 5eea850900ae7b9c81b8d8065d941b8f83ad8d99..0000000000000000000000000000000000000000 --- a/benchmarks/util/data_proto2_to_proto3_util.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef PROTOBUF_BENCHMARKS_UTIL_DATA_PROTO2_TO_PROTO3_UTIL_H_ -#define PROTOBUF_BENCHMARKS_UTIL_DATA_PROTO2_TO_PROTO3_UTIL_H_ - -#include "google/protobuf/message.h" -#include "google/protobuf/descriptor.h" - -using google::protobuf::FieldDescriptor; -using google::protobuf::Message; -using google::protobuf::Reflection; - -namespace google { -namespace protobuf { -namespace util { - -class DataStripper { - public: - void StripMessage(Message *message) { - std::vector set_fields; - const Reflection* reflection = message->GetReflection(); - reflection->ListFields(*message, &set_fields); - - for (size_t i = 0; i < set_fields.size(); i++) { - const FieldDescriptor* field = set_fields[i]; - if (ShouldBeClear(field)) { - reflection->ClearField(message, field); - continue; - } - if (field->type() == FieldDescriptor::TYPE_MESSAGE) { - if (field->is_repeated()) { - for (int j = 0; j < reflection->FieldSize(*message, field); j++) { - StripMessage(reflection->MutableRepeatedMessage(message, field, j)); - } - } else { - StripMessage(reflection->MutableMessage(message, field)); - } - } - } - - reflection->MutableUnknownFields(message)->Clear(); - } - private: - virtual bool ShouldBeClear(const FieldDescriptor *field) = 0; -}; - -class GogoDataStripper : public DataStripper { - private: - virtual bool ShouldBeClear(const FieldDescriptor *field) { - return field->type() == FieldDescriptor::TYPE_GROUP; - } -}; - -class Proto3DataStripper : public DataStripper { - private: - virtual bool ShouldBeClear(const FieldDescriptor *field) { - return field->type() == FieldDescriptor::TYPE_GROUP || - field->is_extension(); - } -}; - -} // namespace util -} // namespace protobuf -} // namespace google - -#endif // PROTOBUF_BENCHMARKS_UTIL_DATA_PROTO2_TO_PROTO3_UTIL_H_ diff --git a/benchmarks/util/result_parser.py b/benchmarks/util/result_parser.py deleted file mode 100644 index b09f387a6b07abad782f56c617b359afa26b5c49..0000000000000000000000000000000000000000 --- a/benchmarks/util/result_parser.py +++ /dev/null @@ -1,300 +0,0 @@ -# This import depends on the automake rule protoc_middleman, please make sure -# protoc_middleman has been built before run this file. -import json -import re -import os.path -# BEGIN OPENSOURCE -import sys -sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) -# END OPENSOURCE -import tmp.benchmarks_pb2 as benchmarks_pb2 - -__file_size_map = {} - -def __get_data_size(filename): - if filename[0] != '/': - filename = os.path.dirname(os.path.abspath(__file__)) + "/../" + filename - if filename in __file_size_map: - return __file_size_map[filename] - benchmark_dataset = benchmarks_pb2.BenchmarkDataset() - benchmark_dataset.ParseFromString( - open(filename, "rb").read()) - size = 0 - count = 0 - for payload in benchmark_dataset.payload: - size += len(payload) - count += 1 - __file_size_map[filename] = (size, 1.0 * size / count) - return size, 1.0 * size / count - - -def __extract_file_name(file_name): - name_list = re.split(r"[/\.]", file_name) - short_file_name = "" - for name in name_list: - if name[:14] == "google_message": - short_file_name = name - return short_file_name - - -__results = [] - - -# CPP results example: -# [ -# "benchmarks": [ -# { -# "bytes_per_second": int, -# "cpu_time_ns": double, -# "iterations": int, -# "name: string, -# "real_time_ns: double, -# ... -# }, -# ... -# ], -# ... -# ] -def __parse_cpp_result(filename): - if filename == "": - return - if filename[0] != '/': - filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: - results = json.loads(f.read()) - for benchmark in results["benchmarks"]: - data_filename = "".join( - re.split("(_parse_|_serialize)", benchmark["name"])[0]) - behavior = benchmark["name"][len(data_filename) + 1:] - if data_filename[:2] == "BM": - data_filename = data_filename[3:] - __results.append({ - "language": "cpp", - "dataFilename": data_filename, - "behavior": behavior, - "throughput": benchmark["bytes_per_second"] / 2.0 ** 20 - }) - - -# Synthetic benchmark results example: -# [ -# "benchmarks": [ -# { -# "cpu_time_ns": double, -# "iterations": int, -# "name: string, -# "real_time_ns: double, -# ... -# }, -# ... -# ], -# ... -# ] -def __parse_synthetic_result(filename): - if filename == "": - return - if filename[0] != "/": - filename = os.path.dirname(os.path.abspath(__file__)) + "/" + filename - with open(filename, "rb") as f: - results = json.loads(f.read()) - for benchmark in results["benchmarks"]: - __results.append({ - "language": "cpp", - "dataFilename": "", - "behavior": "synthetic", - "throughput": 10.0**9 / benchmark["cpu_time_ns"] - }) - - -# Python results example: -# [ -# [ -# { -# "filename": string, -# "benchmarks": { -# behavior: results, -# ... -# }, -# }, -# ... -# ], #pure-python -# ... -# ] -def __parse_python_result(filename): - if filename == "": - return - if filename[0] != '/': - filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: - results_list = json.loads(f.read()) - for results in results_list: - for result in results: - _, avg_size = __get_data_size(result["filename"]) - for behavior in result["benchmarks"]: - __results.append({ - "language": "python", - "dataFilename": __extract_file_name(result["filename"]), - "behavior": behavior, - "throughput": result["benchmarks"][behavior] - }) - - -# Java results example: -# [ -# { -# "id": string, -# "instrumentSpec": {...}, -# "measurements": [ -# { -# "weight": float, -# "value": { -# "magnitude": float, -# "unit": string -# }, -# ... -# }, -# ... -# ], -# "run": {...}, -# "scenario": { -# "benchmarkSpec": { -# "methodName": string, -# "parameters": { -# defined parameters in the benchmark: parameters value -# }, -# ... -# }, -# ... -# } -# -# }, -# ... -# ] -def __parse_java_result(filename): - if filename == "": - return - if filename[0] != '/': - filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: - results = json.loads(f.read()) - for result in results: - total_weight = 0 - total_value = 0 - for measurement in result["measurements"]: - total_weight += measurement["weight"] - total_value += measurement["value"]["magnitude"] - avg_time = total_value * 1.0 / total_weight - total_size, _ = __get_data_size( - result["scenario"]["benchmarkSpec"]["parameters"]["dataFile"]) - __results.append({ - "language": "java", - "throughput": total_size / avg_time * 1e9 / 2 ** 20, - "behavior": result["scenario"]["benchmarkSpec"]["methodName"], - "dataFilename": __extract_file_name( - result["scenario"]["benchmarkSpec"]["parameters"]["dataFile"]) - }) - - -# Go benchmark results: -# -# goos: linux -# goarch: amd64 -# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Unmarshal-12 3000 705784 ns/op -# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Marshal-12 2000 634648 ns/op -# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Size-12 5000 244174 ns/op -# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Clone-12 300 4120954 ns/op -# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Merge-12 300 4108632 ns/op -# PASS -# ok _/usr/local/google/home/yilunchong/mygit/protobuf/benchmarks 124.173s -def __parse_go_result(filename): - if filename == "": - return - if filename[0] != '/': - filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: - for line in f: - result_list = re.split(r"[\ \t]+", line) - if result_list[0][:9] != "Benchmark": - continue - first_slash_index = result_list[0].find('/') - last_slash_index = result_list[0].rfind('/') - full_filename = result_list[0][first_slash_index+1:last_slash_index] - total_bytes, _ = __get_data_size(full_filename) - behavior_with_suffix = result_list[0][last_slash_index+1:] - last_dash = behavior_with_suffix.rfind("-") - if last_dash == -1: - behavior = behavior_with_suffix - else: - behavior = behavior_with_suffix[:last_dash] - __results.append({ - "dataFilename": __extract_file_name(full_filename), - "throughput": total_bytes / float(result_list[2]) * 1e9 / 2 ** 20, - "behavior": behavior, - "language": "go" - }) - - -# Self built json results example: -# -# [ -# { -# "filename": string, -# "benchmarks": { -# behavior: results, -# ... -# }, -# }, -# ... -# ] -def __parse_custom_result(filename, language): - if filename == "": - return - if filename[0] != '/': - filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: - results = json.loads(f.read()) - for result in results: - _, avg_size = __get_data_size(result["filename"]) - for behavior in result["benchmarks"]: - __results.append({ - "language": language, - "dataFilename": __extract_file_name(result["filename"]), - "behavior": behavior, - "throughput": result["benchmarks"][behavior] - }) - - -def __parse_js_result(filename, language): - return __parse_custom_result(filename, language) - -def __parse_php_result(filename, language): - return __parse_custom_result(filename, language) - - -def get_result_from_file(cpp_file="", - java_file="", - python_file="", - go_file="", - synthetic_file="", - node_file="", - php_c_file="", - php_file=""): - results = {} - if cpp_file != "": - __parse_cpp_result(cpp_file) - if java_file != "": - __parse_java_result(java_file) - if python_file != "": - __parse_python_result(python_file) - if go_file != "": - __parse_go_result(go_file) - if synthetic_file != "": - __parse_synthetic_result(synthetic_file) - if node_file != "": - __parse_js_result(node_file, "node") - if php_file != "": - __parse_php_result(php_file, "php") - if php_c_file != "": - __parse_php_result(php_c_file, "php") - - return __results diff --git a/benchmarks/util/result_uploader.py b/benchmarks/util/result_uploader.py deleted file mode 100644 index 2a35d9694d16ddbae774945113d93d7a9a2ede38..0000000000000000000000000000000000000000 --- a/benchmarks/util/result_uploader.py +++ /dev/null @@ -1,107 +0,0 @@ -from __future__ import print_function -from __future__ import absolute_import -import argparse -import os -import re -import copy -import uuid -import calendar -import time -import datetime - -from util import big_query_utils -from util import result_parser - -_PROJECT_ID = 'grpc-testing' -_DATASET = 'protobuf_benchmark_result' -_TABLE = 'opensource_result_v2' -_NOW = "%d%02d%02d" % (datetime.datetime.now().year, - datetime.datetime.now().month, - datetime.datetime.now().day) - -_INITIAL_TIME = calendar.timegm(time.gmtime()) - -def get_metadata(): - build_number = os.getenv('BUILD_NUMBER') - build_url = os.getenv('BUILD_URL') - job_name = os.getenv('JOB_NAME') - git_commit = os.getenv('GIT_COMMIT') - # actual commit is the actual head of PR that is getting tested - git_actual_commit = os.getenv('ghprbActualCommit') - - utc_timestamp = str(calendar.timegm(time.gmtime())) - metadata = {'created': utc_timestamp} - - if build_number: - metadata['buildNumber'] = build_number - if build_url: - metadata['buildUrl'] = build_url - if job_name: - metadata['jobName'] = job_name - if git_commit: - metadata['gitCommit'] = git_commit - if git_actual_commit: - metadata['gitActualCommit'] = git_actual_commit - - return metadata - - -def upload_result(result_list, metadata): - for result in result_list: - new_result = {} - new_result["metric"] = "throughput" - new_result["value"] = result["throughput"] - new_result["unit"] = "MB/s" - new_result["test"] = "protobuf_benchmark" - new_result["product_name"] = "protobuf" - labels_string = "" - for key in result: - labels_string += ",|%s:%s|" % (key, result[key]) - new_result["labels"] = labels_string[1:] - new_result["timestamp"] = _INITIAL_TIME - print(labels_string) - - bq = big_query_utils.create_big_query() - row = big_query_utils.make_row(str(uuid.uuid4()), new_result) - if not big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET, - _TABLE + "$" + _NOW, - [row]): - print('Error when uploading result', new_result) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-cpp", "--cpp_input_file", - help="The CPP benchmark result file's name", - default="") - parser.add_argument("-java", "--java_input_file", - help="The Java benchmark result file's name", - default="") - parser.add_argument("-python", "--python_input_file", - help="The Python benchmark result file's name", - default="") - parser.add_argument("-go", "--go_input_file", - help="The golang benchmark result file's name", - default="") - parser.add_argument("-node", "--node_input_file", - help="The node.js benchmark result file's name", - default="") - parser.add_argument("-php", "--php_input_file", - help="The pure php benchmark result file's name", - default="") - parser.add_argument("-php_c", "--php_c_input_file", - help="The php with c ext benchmark result file's name", - default="") - args = parser.parse_args() - - metadata = get_metadata() - print("uploading results...") - upload_result(result_parser.get_result_from_file( - cpp_file=args.cpp_input_file, - java_file=args.java_input_file, - python_file=args.python_input_file, - go_file=args.go_input_file, - node_file=args.node_input_file, - php_file=args.php_input_file, - php_c_file=args.php_c_input_file, - ), metadata) diff --git a/benchmarks/util/schema_proto2_to_proto3_util.h b/benchmarks/util/schema_proto2_to_proto3_util.h deleted file mode 100644 index 0079f6f1452e82ae4753807daae98b6f59bef6a1..0000000000000000000000000000000000000000 --- a/benchmarks/util/schema_proto2_to_proto3_util.h +++ /dev/null @@ -1,194 +0,0 @@ -#ifndef PROTOBUF_BENCHMARKS_UTIL_SCHEMA_PROTO2_TO_PROTO3_UTIL_H_ -#define PROTOBUF_BENCHMARKS_UTIL_SCHEMA_PROTO2_TO_PROTO3_UTIL_H_ - -#include "google/protobuf/message.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/descriptor.pb.h" - -#include -#include - -using google::protobuf::Descriptor; -using google::protobuf::DescriptorProto; -using google::protobuf::FileDescriptorProto; -using google::protobuf::FieldDescriptorProto; -using google::protobuf::Message; -using google::protobuf::EnumValueDescriptorProto; - -namespace google { -namespace protobuf { -namespace util { - -class SchemaGroupStripper { - - public: - static void StripFile(const FileDescriptor* old_file, - FileDescriptorProto *file) { - for (int i = file->mutable_message_type()->size() - 1; i >= 0; i--) { - if (IsMessageSet(old_file->message_type(i))) { - file->mutable_message_type()->DeleteSubrange(i, 1); - continue; - } - StripMessage(old_file->message_type(i), file->mutable_message_type(i)); - } - for (int i = file->mutable_extension()->size() - 1; i >= 0; i--) { - auto field = old_file->extension(i); - if (field->type() == FieldDescriptor::TYPE_GROUP || - IsMessageSet(field->message_type()) || - IsMessageSet(field->containing_type())) { - file->mutable_extension()->DeleteSubrange(i, 1); - } - } - } - - private: - static bool IsMessageSet(const Descriptor *descriptor) { - if (descriptor != nullptr - && descriptor->options().message_set_wire_format()) { - return true; - } - return false; - } - - static void StripMessage(const Descriptor *old_message, - DescriptorProto *new_message) { - for (int i = new_message->mutable_field()->size() - 1; i >= 0; i--) { - if (old_message->field(i)->type() == FieldDescriptor::TYPE_GROUP || - IsMessageSet(old_message->field(i)->message_type())) { - new_message->mutable_field()->DeleteSubrange(i, 1); - } - } - for (int i = new_message->mutable_extension()->size() - 1; i >= 0; i--) { - auto field_type_name = new_message->mutable_extension(i)->type_name(); - if (old_message->extension(i)->type() == FieldDescriptor::TYPE_GROUP || - IsMessageSet(old_message->extension(i)->containing_type()) || - IsMessageSet(old_message->extension(i)->message_type())) { - new_message->mutable_extension()->DeleteSubrange(i, 1); - } - } - for (int i = 0; i < new_message->mutable_nested_type()->size(); i++) { - StripMessage(old_message->nested_type(i), - new_message->mutable_nested_type(i)); - } - } - -}; - -class EnumScrubber { - - public: - EnumScrubber() - : total_added_(0) { - } - - void ScrubFile(FileDescriptorProto *file) { - for (int i = 0; i < file->enum_type_size(); i++) { - ScrubEnum(file->mutable_enum_type(i)); - } - for (int i = 0; i < file->mutable_message_type()->size(); i++) { - ScrubMessage(file->mutable_message_type(i)); - } - } - - private: - void ScrubEnum(EnumDescriptorProto *enum_type) { - if (enum_type->value(0).number() != 0) { - bool has_zero = false; - for (int j = 0; j < enum_type->value().size(); j++) { - if (enum_type->value(j).number() == 0) { - EnumValueDescriptorProto temp_enum_value; - temp_enum_value.CopyFrom(enum_type->value(j)); - enum_type->mutable_value(j)->CopyFrom(enum_type->value(0)); - enum_type->mutable_value(0)->CopyFrom(temp_enum_value); - has_zero = true; - break; - } - } - if (!has_zero) { - enum_type->mutable_value()->Add(); - for (int i = enum_type->mutable_value()->size() - 1; i > 0; i--) { - enum_type->mutable_value(i)->CopyFrom( - *enum_type->mutable_value(i - 1)); - } - enum_type->mutable_value(0)->set_number(0); - enum_type->mutable_value(0)->set_name("ADDED_ZERO_VALUE_" + - std::to_string(total_added_++)); - } - } - - } - - void ScrubMessage(DescriptorProto *message_type) { - for (int i = 0; i < message_type->mutable_enum_type()->size(); i++) { - ScrubEnum(message_type->mutable_enum_type(i)); - } - for (int i = 0; i < message_type->mutable_nested_type()->size(); i++) { - ScrubMessage(message_type->mutable_nested_type(i)); - } - } - - int total_added_; -}; - -class ExtensionStripper { - public: - static void StripFile(FileDescriptorProto *file) { - for (int i = 0; i < file->mutable_message_type()->size(); i++) { - StripMessage(file->mutable_message_type(i)); - } - file->mutable_extension()->Clear(); - } - private: - static void StripMessage(DescriptorProto *message_type) { - message_type->mutable_extension()->Clear(); - message_type->clear_extension_range(); - for (int i = 0; i < message_type->mutable_nested_type()->size(); i++) { - StripMessage(message_type->mutable_nested_type(i)); - } - } -}; - - -class FieldScrubber { - public: - static void ScrubFile(FileDescriptorProto *file) { - for (int i = 0; i < file->mutable_message_type()->size(); i++) { - ScrubMessage(file->mutable_message_type(i)); - } - for (int i = 0; i < file->mutable_extension()->size(); i++) { - file->mutable_extension(i)->clear_default_value(); - if (ShouldClearLabel(file->mutable_extension(i))) { - file->mutable_extension(i)->clear_label(); - } - } - } - private: - static bool ShouldClearLabel(const FieldDescriptorProto *field) { - return field->label() == FieldDescriptorProto::LABEL_REQUIRED; - } - - static void ScrubMessage(DescriptorProto *message_type) { - message_type->mutable_extension()->Clear(); - for (int i = 0; i < message_type->mutable_extension()->size(); i++) { - message_type->mutable_extension(i)->clear_default_value(); - if (ShouldClearLabel(message_type->mutable_extension(i))) { - message_type->mutable_extension(i)->clear_label(); - } - } - for (int i = 0; i < message_type->mutable_field()->size(); i++) { - message_type->mutable_field(i)->clear_default_value(); - if (ShouldClearLabel(message_type->mutable_field(i))) { - message_type->mutable_field(i)->clear_label(); - } - } - for (int i = 0; i < message_type->mutable_nested_type()->size(); i++) { - ScrubMessage(message_type->mutable_nested_type(i)); - } - } -}; - -} // namespace util -} // namespace protobuf -} // namespace google - -#endif // PROTOBUF_BENCHMARKS_UTIL_SCHEMA_PROTO2_TO_PROTO3_UTIL_H_ diff --git a/bundle.json b/bundle.json index 2394287243efa940fb55d13eac29d8b1a90f2223..0577908a5a7f6c9ad66812faad869d86c4818259 100644 --- a/bundle.json +++ b/bundle.json @@ -1,7 +1,7 @@ { "name": "@ohos/protobuf", "description": "Protocol Buffers - Google's data interchange format.", - "version": "3.1", + "version": "3.14.0", "license": "BSD-3-Clause", "publishAs": "code-segment", "segment": { diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 9ca31ac0bf7140238814f2283a182bb17548be58..52661f522d9978f2465b446cf72dc9cdee1e94fc 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -29,7 +29,7 @@ else() endif() # The Intel compiler isn't able to deal with noinline member functions of -# template classses defined in headers. As such it spams the output with +# template classes defined in headers. As such it spams the output with # warning #2196: routine is both "inline" and "noinline" # This silences that warning. if (CMAKE_CXX_COMPILER_ID MATCHES Intel) @@ -44,6 +44,7 @@ option(protobuf_BUILD_TESTS "Build tests" ON) option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF) option(protobuf_BUILD_EXAMPLES "Build examples" OFF) option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON) +option(protobuf_BUILD_LIBPROTOC "Build libprotoc" OFF) if (BUILD_SHARED_LIBS) set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON) else (BUILD_SHARED_LIBS) @@ -64,8 +65,6 @@ include(protobuf-options.cmake) # Overrides for option dependencies if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS) set(protobuf_BUILD_LIBPROTOC ON) -else() - set(protobuf_BUILD_LIBPROTOC OFF) endif () # Path to main configure script set(protobuf_CONFIGURE_SCRIPT "../configure.ac") diff --git a/cmake/README.md b/cmake/README.md index a78072242c6aa91d698e061b1fd48b753cd62322..89d00c1b6f4f738fe7a3ca5f366c3841e55b0f21 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -66,7 +66,7 @@ Remember to update any submodules if you are using git clone (you can skip this step if you are using a release .tar.gz or .zip package): ```console -C:\Path\to\protobuf> git submodule update --init --recursive +C:\Path\to> git submodule update --init --recursive ``` Now go to *cmake* folder in protobuf sources: diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in index 007cc806694544f2e2059c19cf6e051c35a65621..5c5799efa1e8daf0fb97642e978ff2737870ceaa 100644 --- a/cmake/extract_includes.bat.in +++ b/cmake/extract_includes.bat.in @@ -53,7 +53,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tab copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\implicit_weak_message.h" include\google\protobuf\implicit_weak_message.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\inlined_string_field.h" include\google\protobuf\inlined_string_field.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\io_win32.h" include\google\protobuf\io\io_win32.h @@ -88,7 +87,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\bytestream.h" i copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h diff --git a/cmake/install.cmake b/cmake/install.cmake index be47c54a1e21098fdbbb8c9ecf7adcaa0ad978fb..4091bc8af9866b5bb4ebcc370f3aa83a42ae874a 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -6,9 +6,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY) set(_protobuf_libraries libprotobuf-lite libprotobuf) -if (protobuf_BUILD_PROTOC_BINARIES) +if (protobuf_BUILD_LIBPROTOC) list(APPEND _protobuf_libraries libprotoc) -endif (protobuf_BUILD_PROTOC_BINARIES) +endif (protobuf_BUILD_LIBPROTOC) foreach(_library ${_protobuf_libraries}) set_property(TARGET ${_library} diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake index 6bf86a2770e10cc929da13b445f85111867c0103..6d325d5dcad42f4f8457631836bdbc08ea879d0c 100644 --- a/cmake/libprotobuf-lite.cmake +++ b/cmake/libprotobuf-lite.cmake @@ -1,6 +1,7 @@ set(libprotobuf_lite_files ${protobuf_source_dir}/src/google/protobuf/any_lite.cc ${protobuf_source_dir}/src/google/protobuf/arena.cc + ${protobuf_source_dir}/src/google/protobuf/arenastring.cc ${protobuf_source_dir}/src/google/protobuf/extension_set.cc ${protobuf_source_dir}/src/google/protobuf/generated_enum_util.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc @@ -12,6 +13,7 @@ set(libprotobuf_lite_files ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.cc ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc + ${protobuf_source_dir}/src/google/protobuf/map.cc ${protobuf_source_dir}/src/google/protobuf/message_lite.cc ${protobuf_source_dir}/src/google/protobuf/parse_context.cc ${protobuf_source_dir}/src/google/protobuf/repeated_field.cc @@ -67,6 +69,9 @@ target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT}) if(protobuf_LINK_LIBATOMIC) target_link_libraries(libprotobuf-lite atomic) endif() +if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + target_link_libraries(libprotobuf-lite log) +endif() target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) if(MSVC AND protobuf_BUILD_SHARED_LIBS) target_compile_definitions(libprotobuf-lite diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake index 0c12596c238bc0128465ba29e0780a95e8b7f028..a5be494fb702ef7ea250b401deae7b58f6cb7fbb 100644 --- a/cmake/libprotobuf.cmake +++ b/cmake/libprotobuf.cmake @@ -121,6 +121,9 @@ endif() if(protobuf_LINK_LIBATOMIC) target_link_libraries(libprotobuf atomic) endif() +if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + target_link_libraries(libprotobuf log) +endif() target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) if(MSVC AND protobuf_BUILD_SHARED_LIBS) target_compile_definitions(libprotobuf diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in index 11b85d3c0723f697c19d1ff98922f9861ea055c6..fac5efe44077e2c28dc90f0daa912b8000940d5e 100644 --- a/cmake/protobuf-config.cmake.in +++ b/cmake/protobuf-config.cmake.in @@ -99,13 +99,17 @@ function(protobuf_generate) foreach(_proto ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_proto} ABSOLUTE) get_filename_component(_abs_dir ${_abs_file} DIRECTORY) - get_filename_component(_basename ${_proto} NAME_WLE) + + get_filename_component(_file_full_name ${_proto} NAME) + string(FIND "${_file_full_name}" "." _file_last_ext_pos REVERSE) + string(SUBSTRING "${_file_full_name}" 0 ${_file_last_ext_pos} _basename) set(_suitable_include_found FALSE) foreach(DIR ${_protobuf_include_path}) if(NOT DIR STREQUAL "-I") file(RELATIVE_PATH _rel_dir ${DIR} ${_abs_dir}) - if(NOT "${_rel_dir}" MATCHES "^\.\.[/\\].*") + string(FIND "${_rel_dir}" "../" _is_in_parent_folder) + if (NOT ${_is_in_parent_folder} EQUAL 0) set(_suitable_include_found TRUE) break() endif() diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in index 74c5488729a1bb8de9c32b09152fb1ffe58af69d..810256e54cfb47ced4b0d3673e8b036572376b22 100644 --- a/cmake/protobuf-module.cmake.in +++ b/cmake/protobuf-module.cmake.in @@ -97,6 +97,10 @@ function(_protobuf_find_libraries name filename) else() get_target_property(${name}_LIBRARY_RELEASE protobuf::lib${filename} LOCATION_RELEASE) + get_target_property(${name}_LIBRARY_RELWITHDEBINFO protobuf::lib${filename} + LOCATION_RELWITHDEBINFO) + get_target_property(${name}_LIBRARY_MINSIZEREL protobuf::lib${filename} + LOCATION_MINSIZEREL) get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename} LOCATION_DEBUG) @@ -146,6 +150,14 @@ get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf # Set the protoc Executable get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc IMPORTED_LOCATION_RELEASE) +if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_RELWITHDEBINFO) +endif() +if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_MINSIZEREL) +endif() if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc IMPORTED_LOCATION_DEBUG) diff --git a/cmake/protobuf-options.cmake b/cmake/protobuf-options.cmake index 47fb15825752e544fda411db01c8a4391ed4dd38..93ec898e4a44d58b71393b6987a960dc8534928a 100644 --- a/cmake/protobuf-options.cmake +++ b/cmake/protobuf-options.cmake @@ -2,6 +2,6 @@ option(protobuf_VERBOSE "Enable for verbose output" OFF) mark_as_advanced(protobuf_VERBOSE) -# FindProtobuf module compatibel -option(protobuf_MODULE_COMPATIBLE "CMake build-in FindProtobuf.cmake module compatible" OFF) +# FindProtobuf module compatible +option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF) mark_as_advanced(protobuf_MODULE_COMPATIBLE) diff --git a/compile b/compile new file mode 100644 index 0000000000000000000000000000000000000000..23fcba011321a3a2b3b94a8abb13201dbdd1faa5 --- /dev/null +++ b/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100644 index 0000000000000000000000000000000000000000..f50dcdb6de2af0a2e33f44704da3ec1286e5f291 --- /dev/null +++ b/config.guess @@ -0,0 +1,1480 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-02-24' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > "$dummy.c" ; + for c in cc gcc c89 c99 ; do + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval "$set_cc_for_build" + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval "$set_cc_for_build" + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + then + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ "$HP_ARCH" = hppa2.0w ] + then + eval "$set_cc_for_build" + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + i*86:Minix:*:*) + echo "$UNAME_MACHINE"-pc-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + eval "$set_cc_for_build" + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + if objdump -f /bin/sh | grep -q elf32-x86-64; then + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 + else + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + fi + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-functions 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000000000000000000000000000000000000..76f85e2e4efd0ea1c760c1c6dc66c24b2e62946e --- /dev/null +++ b/config.h.in @@ -0,0 +1,154 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* the name of */ +#undef HASH_MAP_CLASS + +/* the location of or */ +#undef HASH_MAP_H + +/* the namespace of hash_map/hash_set */ +#undef HASH_NAMESPACE + +/* the name of */ +#undef HASH_SET_CLASS + +/* the location of or */ +#undef HASH_SET_H + +/* define if the compiler supports basic C++11 syntax */ +#undef HAVE_CXX11 + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `ftruncate' function. */ +#undef HAVE_FTRUNCATE + +/* define if the compiler has hash_map */ +#undef HAVE_HASH_MAP + +/* define if the compiler has hash_set */ +#undef HAVE_HASH_SET + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `mkdir' function. */ +#undef HAVE_MKDIR + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Enable classes using zlib compression. */ +#undef HAVE_ZLIB + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE diff --git a/config.sub b/config.sub new file mode 100644 index 0000000000000000000000000000000000000000..1d8e98bcee23a0421e4fafe9a6c9ac75180cff25 --- /dev/null +++ b/config.sub @@ -0,0 +1,1801 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-02-22' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-pc + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2*) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + x64) + basic_machine=x86_64-pc + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases that might get confused + # with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4*) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + pru-*) + os=-elf + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` + ;; +esac + +echo "$basic_machine$os" +exit + +# Local variables: +# eval: (add-hook 'write-file-functions 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100644 index 0000000000000000000000000000000000000000..1c9ae16b96bc5dc25cfe127a47dc30e399263fd3 --- /dev/null +++ b/configure @@ -0,0 +1,23484 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for Protocol Buffers 3.14.0. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: protobuf@googlegroups.com about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='Protocol Buffers' +PACKAGE_TARNAME='protobuf' +PACKAGE_VERSION='3.14.0' +PACKAGE_STRING='Protocol Buffers 3.14.0' +PACKAGE_BUGREPORT='protobuf@googlegroups.com' +PACKAGE_URL='' + +ac_unique_file="src/google/protobuf/message.cc" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +enable_option_checking=no +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +subdirs +OBJC_CONFORMANCE_TEST_FALSE +OBJC_CONFORMANCE_TEST_TRUE +HAVE_PTHREAD_FALSE +HAVE_PTHREAD_TRUE +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config +USE_EXTERNAL_PROTOC_FALSE +USE_EXTERNAL_PROTOC_TRUE +PROTOC +LIBATOMIC_LIBS +HAVE_CXX11 +HAVE_ZLIB_FALSE +HAVE_ZLIB_TRUE +POW_LIB +LIBOBJS +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +ISAINFO +PROTOBUF_OPT_FLAG +am__fastdepOBJC_FALSE +am__fastdepOBJC_TRUE +OBJCDEPMODE +ac_ct_OBJC +OBJCFLAGS +OBJC +GCC_FALSE +GCC_TRUE +ac_ct_AR +AR +EGREP +GREP +CXXCPPFLAGS_FOR_BUILD +CXXFLAGS_FOR_BUILD +CXXCPP_FOR_BUILD +ac_ct_CXX_FOR_BUILD +CXX_FOR_BUILD +CXXCPP +LDFLAGS_FOR_BUILD +CPPFLAGS_FOR_BUILD +CFLAGS_FOR_BUILD +BUILD_OBJEXT +BUILD_EXEEXT +CPP_FOR_BUILD +ac_ct_CC_FOR_BUILD +CC_FOR_BUILD +CPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +DIST_LANG +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_silent_rules +with_zlib +with_zlib_include +with_zlib_lib +with_protoc +enable_dependency_tracking +enable_64bit_solaris +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +' + ac_precious_vars='build_alias +host_alias +target_alias +DIST_LANG +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP +CXXCPP +OBJC +OBJCFLAGS +LT_SYS_LIBRARY_PATH' +ac_subdirs_all='third_party/googletest' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures Protocol Buffers 3.14.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/protobuf] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of Protocol Buffers 3.14.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-maintainer-mode + disable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-64bit-solaris Build 64 bit binary on Solaris [default=on] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-zlib include classes for streaming compressed data in and + out [default=check] + --with-zlib-include=PATH + zlib include directory + --with-zlib-lib=PATH zlib lib directory + --with-protoc=COMMAND use the given protoc command instead of building a + new one when building tests (useful for + cross-compiling) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + +Some influential environment variables: + DIST_LANG language to include in the distribution package (i.e., make + dist) + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + OBJC Objective C compiler command + OBJCFLAGS Objective C compiler flags + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +Protocol Buffers configure 3.14.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------------- ## +## Report this to protobuf@googlegroups.com ## +## ---------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_mongrel + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_compile + +# ac_fn_objc_try_compile LINENO +# ----------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_objc_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_objc_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_objc_try_compile + +# ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES +# ----------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_cxx_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_decl + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_cxx_check_func LINENO FUNC VAR +# ------------------------------------ +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_cxx_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by Protocol Buffers $as_me 3.14.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + +# The config file is generated but not used by the source code, since we only +# need very few of them, e.g. HAVE_PTHREAD and HAVE_ZLIB. Those macros are +# passed down in CXXFLAGS manually in src/Makefile.am +ac_config_headers="$ac_config_headers config.h" + + + + +case "$DIST_LANG" in + "") DIST_LANG=all ;; + all | cpp | csharp | java | python | javanano | objectivec | ruby | js | php) ;; + *) { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "unknown language: $DIST_LANG +See \`config.log' for more details" "$LINENO" 5; } ;; +esac + + +# autoconf's default CXXFLAGS are usually "-g -O2". These aren't necessarily +# the best choice for libprotobuf. +if test "x${ac_cv_env_CFLAGS_set}" = "x"; then : + CFLAGS="" +fi +if test "x${ac_cv_env_CXXFLAGS_set}" = "x"; then : + CXXFLAGS="" +fi + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +am__api_version='1.16' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='protobuf' + VERSION='3.14.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test $am_uid -le $am_max_uid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test $am_gid -le $am_max_gid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if ${am_cv_prog_tar_ustar+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_ustar=$_am_tool +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +$as_echo "$am_cv_prog_tar_ustar" >&6; } + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +# Silent rules enabled: the output is minimal but informative. +# In particular, the warnings from the compiler stick out very clearly. +# To see all logs, use the --disable-silent-rules on configure or via make V=1 +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + + +# Check whether --with-zlib was given. +if test "${with_zlib+set}" = set; then : + withval=$with_zlib; +else + with_zlib=check +fi + + + +# Check whether --with-zlib-include was given. +if test "${with_zlib_include+set}" = set; then : + withval=$with_zlib_include; CPPFLAGS="-I$withval $CPPFLAGS" +fi + + + +# Check whether --with-zlib-lib was given. +if test "${with_zlib_lib+set}" = set; then : + withval=$with_zlib_lib; LDFLAGS="-L$withval $LDFLAGS" +fi + + + +# Check whether --with-protoc was given. +if test "${with_protoc+set}" = set; then : + withval=$with_protoc; +else + with_protoc=no +fi + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +save_cross_compiling=$cross_compiling +save_ac_tool_prefix=$ac_tool_prefix +cross_compiling=no +ac_tool_prefix= + +ac_ext=c +ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC_FOR_BUILD"; then + ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC_FOR_BUILD"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD +if test -n "$ac_ct_CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 +$as_echo "$ac_ct_CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC_FOR_BUILD" = x; then + CC_FOR_BUILD="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD + fi +else + CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" +fi + +if test -z "$CC_FOR_BUILD"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC_FOR_BUILD"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC_FOR_BUILD="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC_FOR_BUILD + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC_FOR_BUILD to just the basename; use the full file name. + shift + ac_cv_prog_CC_FOR_BUILD="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC_FOR_BUILD"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC_FOR_BUILD"; then + ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC_FOR_BUILD="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +$as_echo "$CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC_FOR_BUILD" && break + done +fi +if test -z "$CC_FOR_BUILD"; then + ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC_FOR_BUILD"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD +if test -n "$ac_ct_CC_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 +$as_echo "$ac_ct_CC_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC_FOR_BUILD" && break +done + + if test "x$ac_ct_CC_FOR_BUILD" = x; then + CC_FOR_BUILD="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD + fi +fi + +fi + + +test -z "$CC_FOR_BUILD" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_build_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS_FOR_BUILD+set} +ac_save_CFLAGS=$CFLAGS_FOR_BUILD +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD accepts -g" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD accepts -g... " >&6; } +if ${ac_cv_build_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_build_prog_cc_g=no + CFLAGS_FOR_BUILD="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_build_prog_cc_g=yes +else + CFLAGS_FOR_BUILD="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS_FOR_BUILD="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_build_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_build_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 +$as_echo "$ac_cv_build_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS_FOR_BUILD=$ac_save_CFLAGS +elif test $ac_cv_build_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS_FOR_BUILD="-g -O2" + else + CFLAGS_FOR_BUILD="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS_FOR_BUILD="-O2" + else + CFLAGS_FOR_BUILD= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to accept ISO C89" >&5 +$as_echo_n "checking for $CC_FOR_BUILD option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC_FOR_BUILD +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC_FOR_BUILD="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_build_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC_FOR_BUILD=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD understands -c and -o together" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext" >&5 + ($CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_build_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC_FOR_BUILD="$am_aux_dir/compile $CC_FOR_BUILD" +fi +ac_ext=c +ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC_FOR_BUILD" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then + CPP_FOR_BUILD= +fi +if test -z "$CPP_FOR_BUILD"; then + if ${ac_cv_build_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_build_prog_CPP=$CPP_FOR_BUILD + +fi + CPP_FOR_BUILD=$ac_cv_build_prog_CPP +else + ac_cv_build_prog_CPP=$CPP_FOR_BUILD +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP_FOR_BUILD" >&5 +$as_echo "$CPP_FOR_BUILD" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_tool_prefix=$save_ac_tool_prefix +cross_compiling=$save_cross_compiling + + +BUILD_EXEEXT=$ac_build_exeext +BUILD_OBJEXT=$ac_build_objext + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +save_cross_compiling=$cross_compiling +save_ac_tool_prefix=$ac_tool_prefix +cross_compiling=no +ac_tool_prefix= + +ac_ext=cpp +ac_cpp='$CXXCPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CXX_FOR_BUILD -c $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CXX_FOR_BUILD -o conftest$ac_exeext $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX_FOR_BUILD"; then + if test -n "$CCC"; then + CXX_FOR_BUILD=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX_FOR_BUILD"; then + ac_cv_prog_CXX_FOR_BUILD="$CXX_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX_FOR_BUILD="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX_FOR_BUILD=$ac_cv_prog_CXX_FOR_BUILD +if test -n "$CXX_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX_FOR_BUILD" >&5 +$as_echo "$CXX_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX_FOR_BUILD" && break + done +fi +if test -z "$CXX_FOR_BUILD"; then + ac_ct_CXX_FOR_BUILD=$CXX_FOR_BUILD + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX_FOR_BUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX_FOR_BUILD"; then + ac_cv_prog_ac_ct_CXX_FOR_BUILD="$ac_ct_CXX_FOR_BUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX_FOR_BUILD="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX_FOR_BUILD=$ac_cv_prog_ac_ct_CXX_FOR_BUILD +if test -n "$ac_ct_CXX_FOR_BUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX_FOR_BUILD" >&5 +$as_echo "$ac_ct_CXX_FOR_BUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX_FOR_BUILD" && break +done + + if test "x$ac_ct_CXX_FOR_BUILD" = x; then + CXX_FOR_BUILD="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX_FOR_BUILD=$ac_ct_CXX_FOR_BUILD + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_build_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS_FOR_BUILD+set} +ac_save_CXXFLAGS=$CXXFLAGS_FOR_BUILD +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX_FOR_BUILD accepts -g" >&5 +$as_echo_n "checking whether $CXX_FOR_BUILD accepts -g... " >&6; } +if ${ac_cv_build_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_build_prog_cxx_g=no + CXXFLAGS_FOR_BUILD="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_build_prog_cxx_g=yes +else + CXXFLAGS_FOR_BUILD="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS_FOR_BUILD="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_build_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cxx_g" >&5 +$as_echo "$ac_cv_build_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS_FOR_BUILD=$ac_save_CXXFLAGS +elif test $ac_cv_build_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS_FOR_BUILD="-g -O2" + else + CXXFLAGS_FOR_BUILD="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS_FOR_BUILD="-O2" + else + CXXFLAGS_FOR_BUILD= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC -c $CFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX_FOR_BUILD" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CXX_FOR_BUILD -c $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CXX_FOR_BUILD -o conftest$ac_exeext $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP_FOR_BUILD"; then + if ${ac_cv_build_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP_FOR_BUILD in "$CXX_FOR_BUILD -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_build_prog_CXXCPP=$CXXCPP_FOR_BUILD + +fi + CXXCPP_FOR_BUILD=$ac_cv_build_prog_CXXCPP +else + ac_cv_build_prog_CXXCPP=$CXXCPP_FOR_BUILD +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP_FOR_BUILD" >&5 +$as_echo "$CXXCPP_FOR_BUILD" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP_FOR_BUILD\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS_FOR_BUILD' +ac_build_compile='$CC -c $CFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' +ac_build_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_tool_prefix=$save_ac_tool_prefix +cross_compiling=$save_cross_compiling + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_cxx_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + + if test "$GCC" = yes; then + GCC_TRUE= + GCC_FALSE='#' +else + GCC_TRUE='#' + GCC_FALSE= +fi + # let the Makefile know if we're gcc +ac_ext=m +ac_cpp='$OBJCPP $CPPFLAGS' +ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_objc_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in gcc objcc objc cc CC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJC"; then + ac_cv_prog_OBJC="$OBJC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJC=$ac_cv_prog_OBJC +if test -n "$OBJC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJC" >&5 +$as_echo "$OBJC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OBJC" && break + done +fi +if test -z "$OBJC"; then + ac_ct_OBJC=$OBJC + for ac_prog in gcc objcc objc cc CC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJC"; then + ac_cv_prog_ac_ct_OBJC="$ac_ct_OBJC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJC=$ac_cv_prog_ac_ct_OBJC +if test -n "$ac_ct_OBJC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJC" >&5 +$as_echo "$ac_ct_OBJC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_OBJC" && break +done + + if test "x$ac_ct_OBJC" = x; then + OBJC="gcc" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJC=$ac_ct_OBJC + fi +fi + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for Objective C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Objective C compiler" >&5 +$as_echo_n "checking whether we are using the GNU Objective C compiler... " >&6; } +if ${ac_cv_objc_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_objc_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_objc_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objc_compiler_gnu" >&5 +$as_echo "$ac_cv_objc_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GOBJC=yes +else + GOBJC= +fi +ac_test_OBJCFLAGS=${OBJCFLAGS+set} +ac_save_OBJCFLAGS=$OBJCFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $OBJC accepts -g" >&5 +$as_echo_n "checking whether $OBJC accepts -g... " >&6; } +if ${ac_cv_prog_objc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_objc_werror_flag=$ac_objc_werror_flag + ac_objc_werror_flag=yes + ac_cv_prog_objc_g=no + OBJCFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_objc_try_compile "$LINENO"; then : + ac_cv_prog_objc_g=yes +else + OBJCFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_objc_try_compile "$LINENO"; then : + +else + ac_objc_werror_flag=$ac_save_objc_werror_flag + OBJCFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_objc_try_compile "$LINENO"; then : + ac_cv_prog_objc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_objc_werror_flag=$ac_save_objc_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_objc_g" >&5 +$as_echo "$ac_cv_prog_objc_g" >&6; } +if test "$ac_test_OBJCFLAGS" = set; then + OBJCFLAGS=$ac_save_OBJCFLAGS +elif test $ac_cv_prog_objc_g = yes; then + if test "$GOBJC" = yes; then + OBJCFLAGS="-g -O2" + else + OBJCFLAGS="-g" + fi +else + if test "$GOBJC" = yes; then + OBJCFLAGS="-O2" + else + OBJCFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$OBJC" am_compiler_list='gcc3 gcc' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_OBJC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_OBJC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_OBJC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_OBJC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_OBJC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_OBJC_dependencies_compiler_type" >&6; } +OBJCDEPMODE=depmode=$am_cv_OBJC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_OBJC_dependencies_compiler_type" = gcc3; then + am__fastdepOBJC_TRUE= + am__fastdepOBJC_FALSE='#' +else + am__fastdepOBJC_TRUE='#' + am__fastdepOBJC_FALSE= +fi + + + +# test_util.cc takes forever to compile with GCC and optimization turned on. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking C++ compiler flags..." >&5 +$as_echo_n "checking C++ compiler flags...... " >&6; } +if test "x${ac_cv_env_CXXFLAGS_set}" = "x"; then : + + if test "$GCC" = "yes"; then : + + PROTOBUF_OPT_FLAG="-O2" + CXXFLAGS="${CXXFLAGS} -g" + +fi + + # Protocol Buffers contains several checks that are intended to be used only + # for debugging and which might hurt performance. Most users are probably + # end users who don't want these checks, so add -DNDEBUG by default. + CXXFLAGS="$CXXFLAGS -std=c++11 -DNDEBUG" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: use default: $PROTOBUF_OPT_FLAG $CXXFLAGS" >&5 +$as_echo "use default: $PROTOBUF_OPT_FLAG $CXXFLAGS" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: use user-supplied: $CXXFLAGS" >&5 +$as_echo "use user-supplied: $CXXFLAGS" >&6; } + +fi + + + + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_fn_cxx_check_decl "$LINENO" "__SUNPRO_CC" "ac_cv_have_decl___SUNPRO_CC" "$ac_includes_default" +if test "x$ac_cv_have_decl___SUNPRO_CC" = xyes; then : + SUNCC="yes" +else + SUNCC="no" +fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + # Check whether --enable-64bit-solaris was given. +if test "${enable_64bit_solaris+set}" = set; then : + enableval=$enable_64bit_solaris; ac_enable_64bit="$enableval" +else + ac_enable_64bit="yes" +fi + + + if test "$SUNCC" = "yes" -a "x${ac_cv_env_CXXFLAGS_set}" = "x"; then : + + CXXFLAGS="-g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -template=no%extdef ${CXXFLAGS}" + +fi + + case $host_os in + *solaris*) + for ac_prog in isainfo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ISAINFO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ISAINFO"; then + ac_cv_prog_ISAINFO="$ISAINFO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ISAINFO="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ISAINFO=$ac_cv_prog_ISAINFO +if test -n "$ISAINFO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ISAINFO" >&5 +$as_echo "$ISAINFO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ISAINFO" && break +done +test -n "$ISAINFO" || ISAINFO="no" + + if test "x$ISAINFO" != "xno"; then : + isainfo_b=`${ISAINFO} -b` +else + isainfo_b="x" +fi + + if test "$isainfo_b" != "x"; then : + + + isainfo_k=`${ISAINFO} -k` + + if test "x$ac_enable_64bit" = "xyes"; then : + + + if test "x$libdir" = "x\${exec_prefix}/lib"; then : + + libdir="${libdir}/${isainfo_k}" + +fi + + CXXFLAGS="${CXXFLAGS} -m64" + ac_cv_env_CXXFLAGS_set=set + ac_cv_env_CXXFLAGS_value='-m64' + + CFLAGS="${CFLAGS} -m64" + ac_cv_env_CFLAGS_set=set + ac_cv_env_CFLAGS_value='-m64' + + if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ; then : + + CXXFLAGS="-xmemalign=8s ${CXXFLAGS}" + +fi + +fi + +fi + ;; + esac + + if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ; then : + + CXXFLAGS="-xregs=no%appl ${CXXFLAGS}" + +fi + + +# Have to do libtool after SUNCC, other wise it "helpfully" adds Crun Cstd +# to the link +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cr} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cr libconftest.a conftest.o" >&5 + $AR cr libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + link_all_deplibs=no + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen=shl_load +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen=dlopen +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs_CXX=no + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Check whether the linker supports version scripts +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker supports version scripts" >&5 +$as_echo_n "checking whether the linker supports version scripts... " >&6; } +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" +cat > conftest.map <conftest.$ac_ext +/* end confdefs.h. */ +int main() { return 0; } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_ld_version_script=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + have_ld_version_script=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LDFLAGS=$save_LDFLAGS + if test "$have_ld_version_script" == "yes"; then + HAVE_LD_VERSION_SCRIPT_TRUE= + HAVE_LD_VERSION_SCRIPT_FALSE='#' +else + HAVE_LD_VERSION_SCRIPT_TRUE='#' + HAVE_LD_VERSION_SCRIPT_FALSE= +fi + + +# Checks for header files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in fcntl.h inttypes.h limits.h stdlib.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if ${ac_cv_func_memcmp_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_memcmp_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if ${ac_cv_func_strtod+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_cxx_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + +for ac_func in ftruncate memset mkdir strchr strerror strtol +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Check for zlib. +HAVE_ZLIB=0 +if test "$with_zlib" != no; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking zlib version" >&5 +$as_echo_n "checking zlib version... " >&6; } + + # First check the zlib header version. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204) + # error zlib version too old + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (1.2.0.4 or later)" >&5 +$as_echo "ok (1.2.0.4 or later)" >&6; } + + # Also need to add -lz to the linker flags and make sure this succeeds. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5 +$as_echo_n "checking for library containing zlibVersion... " >&6; } +if ${ac_cv_search_zlibVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + return 0; +} +_ACEOF +for ac_lib in '' z; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_zlibVersion=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_zlibVersion+:} false; then : + break +fi +done +if ${ac_cv_search_zlibVersion+:} false; then : + +else + ac_cv_search_zlibVersion=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5 +$as_echo "$ac_cv_search_zlibVersion" >&6; } +ac_res=$ac_cv_search_zlibVersion +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + + +$as_echo "#define HAVE_ZLIB 1" >>confdefs.h + + HAVE_ZLIB=1 + +else + + if test "$with_zlib" != check; then : + + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "--with-zlib was given, but no working zlib library was found +See \`config.log' for more details" "$LINENO" 5; } + +fi + +fi + + +else + + if test "$with_zlib" = check; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: headers missing or too old (requires 1.2.0.4)" >&5 +$as_echo "headers missing or too old (requires 1.2.0.4)" >&6; } + +else + + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "--with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4) +See \`config.log' for more details" "$LINENO" 5; } + +fi + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + if test $HAVE_ZLIB = 1; then + HAVE_ZLIB_TRUE= + HAVE_ZLIB_FALSE='#' +else + HAVE_ZLIB_TRUE='#' + HAVE_ZLIB_FALSE= +fi + + +# Add -std=c++11 if necesssary. It is important for us to do this before the +# libatomic check below, since that also depends on C++11. + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 +$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } +if ${ax_cv_cxx_compile_cxx11+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +#include + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + + namespace test_std_move_and_forward + { + struct message {}; + char foo(message&) { return '\0'; } + int foo(message&&) { return 0; } + + template + void check(Arg&& arg, RT rt) { + static_assert(sizeof(rt) == sizeof(foo(std::forward(arg))), ""); + } + void test() { + message a; + check(a, char()); + check(std::move(a), int()); + } + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_cxx_compile_cxx11=yes +else + ax_cv_cxx_compile_cxx11=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 +$as_echo "$ax_cv_cxx_compile_cxx11" >&6; } + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval \${$cachevar+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +#include + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + + namespace test_std_move_and_forward + { + struct message {}; + char foo(message&) { return '\0'; } + int foo(message&&) { return 0; } + + template + void check(Arg&& arg, RT rt) { + static_assert(sizeof(rt) == sizeof(foo(std::forward(arg))), ""); + } + void test() { + message a; + check(a, char()); + check(std::move(a), int()); + } + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval $cachevar=yes +else + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX11=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +$as_echo "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 + +$as_echo "#define HAVE_CXX11 1" >>confdefs.h + + fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -latomic is needed" >&5 +$as_echo_n "checking whether -latomic is needed... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + std::atomic v; + int main() { + return v; + } + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + STD_ATOMIC_NEED_LIBATOMIC=no +else + STD_ATOMIC_NEED_LIBATOMIC=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $STD_ATOMIC_NEED_LIBATOMIC" >&5 +$as_echo "$STD_ATOMIC_NEED_LIBATOMIC" >&6; } +if test "x$STD_ATOMIC_NEED_LIBATOMIC" = xyes; then + LIBATOMIC_LIBS="-latomic" +fi + + +if test "$with_protoc" != "no"; then : + + PROTOC=$with_protoc + if test "$with_protoc" = "yes"; then : + + # No argument given. Use system protoc. + PROTOC=protoc + +fi + if echo "$PROTOC" | grep -q '^[^/].*/'; then : + + # Does not start with a slash, but contains a slash. So, it's a relative + # path (as opposed to an absolute path or an executable in $PATH). + # Since it will actually be executed from the src directory, prefix with + # the current directory. We also insert $ac_top_build_prefix in case this + # is a nested package and --with-protoc was actually given on the outer + # package's configure script. + PROTOC=`pwd`/${ac_top_build_prefix}$PROTOC + +fi + + +fi + if test "$with_protoc" != "no"; then + USE_EXTERNAL_PROTOC_TRUE= + USE_EXTERNAL_PROTOC_FALSE='#' +else + USE_EXTERNAL_PROTOC_TRUE='#' + USE_EXTERNAL_PROTOC_FALSE= +fi + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + if test "x$PTHREAD_CC" != "x"; then : + CC="$PTHREAD_CC" +fi + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 +$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 +$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} +fi +rm -f conftest* + + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ;; +esac + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +if test "x$GCC" = "xyes"; then : + ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" +fi + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix* | freebsd*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +if test "x$ax_pthread_check_macro" = "x--"; then : + ax_pthread_check_cond=0 +else + ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +fi + +# Are we compiling with Clang? + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 +$as_echo_n "checking whether $CC is Clang... " >&6; } +if ${ax_cv_PTHREAD_CLANG+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : + ax_cv_PTHREAD_CLANG=yes +fi +rm -f conftest* + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 +$as_echo "$ax_cv_PTHREAD_CLANG" >&6; } +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + +ax_pthread_clang_warning=no + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + PTHREAD_CFLAGS="-pthread" + PTHREAD_LIBS= + + ax_pthread_ok=yes + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 +$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } +if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + if test "x$ax_pthread_try" = "xunknown"; then : + break +fi + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_link="$ax_pthread_2step_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + if test "x$ax_pthread_try" = "x"; then : + ax_pthread_try=no +fi + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 +$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -mt,pthread) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 +$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } + PTHREAD_CFLAGS="-mt" + PTHREAD_LIBS="-lpthread" + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 +$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$ax_pthread_config" = "xno"; then : + continue +fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 +$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; } +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xyes"; then : + break +fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } +if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int attr = $ax_pthread_attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 +$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } + if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR +_ACEOF + + ax_pthread_joinable_attr_defined=yes + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 +$as_echo_n "checking whether more special flags are required for pthreads... " >&6; } +if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 +$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } + if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"; then : + PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = PTHREAD_PRIO_INHERIT; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : + +$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + + ax_pthread_prio_inherit_defined=yes + +fi + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + case "x/$CC" in #( + x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : + #handle absolute path differently from PATH based program lookup + case "x$CC" in #( + x/*) : + if as_fn_executable_p ${CC}_r; then : + PTHREAD_CC="${CC}_r" +fi ;; #( + *) : + for ac_prog in ${CC}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + ;; +esac ;; #( + *) : + ;; +esac + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + if test "x$ax_pthread_ok" = "xyes"; then + HAVE_PTHREAD_TRUE= + HAVE_PTHREAD_FALSE='#' +else + HAVE_PTHREAD_TRUE='#' + HAVE_PTHREAD_FALSE= +fi + +# We still keep this for improving pbconfig.h for unsupported platforms. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the location of hash_map" >&5 +$as_echo_n "checking the location of hash_map... " >&6; } + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_cv_cxx_hash_map="" + # First try unordered_map, but not on gcc's before 4.2 -- I've + # seen unexplainable unordered_map bugs with -O2 on older gcc's. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)) + # error GCC too old for unordered_map + #endif + +int +main () +{ +/* no program body necessary */ + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + stl_hash_old_gcc=no +else + stl_hash_old_gcc=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + for location in unordered_map tr1/unordered_map; do + for namespace in std std::tr1; do + if test -z "$ac_cv_cxx_hash_map" -a "$stl_hash_old_gcc" != yes; then + # Some older gcc's have a buggy tr1, so test a bit of code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$location> +int +main () +{ +const ${namespace}::unordered_map t; + return t.find(5) == t.end(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_hash_map="<$location>"; + ac_cv_cxx_hash_namespace="$namespace"; + ac_cv_cxx_hash_map_class="unordered_map"; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + done + done + # Now try hash_map + for location in ext/hash_map hash_map; do + for namespace in __gnu_cxx "" std stdext; do + if test -z "$ac_cv_cxx_hash_map"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$location> +int +main () +{ +${namespace}::hash_map t + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_cxx_hash_map="<$location>"; + ac_cv_cxx_hash_namespace="$namespace"; + ac_cv_cxx_hash_map_class="hash_map"; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + done + done + ac_cv_cxx_hash_set=`echo "$ac_cv_cxx_hash_map" | sed s/map/set/`; + ac_cv_cxx_hash_set_class=`echo "$ac_cv_cxx_hash_map_class" | sed s/map/set/`; + if test -n "$ac_cv_cxx_hash_map"; then + +$as_echo "#define HAVE_HASH_MAP 1" >>confdefs.h + + +$as_echo "#define HAVE_HASH_SET 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define HASH_MAP_H $ac_cv_cxx_hash_map +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HASH_SET_H $ac_cv_cxx_hash_set +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HASH_NAMESPACE $ac_cv_cxx_hash_namespace +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HASH_MAP_CLASS $ac_cv_cxx_hash_map_class +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HASH_SET_CLASS $ac_cv_cxx_hash_set_class +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_hash_map" >&5 +$as_echo "$ac_cv_cxx_hash_map" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find an STL hash_map" >&5 +$as_echo "$as_me: WARNING: could not find an STL hash_map" >&2;} + fi + + +# Enable ObjC support for conformance directory on OS X. +OBJC_CONFORMANCE_TEST=0 +case "$target_os" in + darwin*) + OBJC_CONFORMANCE_TEST=1 + ;; +esac + if test $OBJC_CONFORMANCE_TEST = 1; then + OBJC_CONFORMANCE_TEST_TRUE= + OBJC_CONFORMANCE_TEST_FALSE='#' +else + OBJC_CONFORMANCE_TEST_TRUE='#' + OBJC_CONFORMANCE_TEST_FALSE= +fi + + +# HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS, +# since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock +# too. +export CFLAGS +export CXXFLAGS + + +subdirs="$subdirs third_party/googletest" + + +ac_config_files="$ac_config_files Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then + as_fn_error $? "conditional \"GCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepOBJC_TRUE}" && test -z "${am__fastdepOBJC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepOBJC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_EXTERNAL_PROTOC_TRUE}" && test -z "${USE_EXTERNAL_PROTOC_FALSE}"; then + as_fn_error $? "conditional \"USE_EXTERNAL_PROTOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_PTHREAD_TRUE}" && test -z "${HAVE_PTHREAD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_PTHREAD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OBJC_CONFORMANCE_TEST_TRUE}" && test -z "${OBJC_CONFORMANCE_TEST_FALSE}"; then + as_fn_error $? "conditional \"OBJC_CONFORMANCE_TEST\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by Protocol Buffers $as_me 3.14.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +Protocol Buffers config.status 3.14.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "benchmarks/Makefile") CONFIG_FILES="$CONFIG_FILES benchmarks/Makefile" ;; + "conformance/Makefile") CONFIG_FILES="$CONFIG_FILES conformance/Makefile" ;; + "protobuf.pc") CONFIG_FILES="$CONFIG_FILES protobuf.pc" ;; + "protobuf-lite.pc") CONFIG_FILES="$CONFIG_FILES protobuf-lite.pc" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file, --srcdir, and --disable-option-checking arguments + # so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + --disable-option-checking) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_sub_configure_args " '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi + + # Always prepend --disable-option-checking to silence warnings, since + # different subdirs can have different --enable and --with options. + ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" + $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + $as_echo "$ac_msg" >&6 + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + cd "$ac_dir" + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f "$ac_srcdir/configure.gnu"; then + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + elif test -f "$ac_srcdir/configure.in"; then + # This should be Cygnus configure. + ac_sub_configure=$ac_aux_dir/configure + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative name. + ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 + fi + + cd "$ac_popdir" + done +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac index 2f82be284b7828f4427b29582c906e25c5e35269..2ef16684aaae8d2485bc3d602b76a6ec96cdb91b 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.13.0],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.14.0],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) @@ -72,6 +72,13 @@ AC_ARG_WITH([protoc], [use the given protoc command instead of building a new one when building tests (useful for cross-compiling)])], [],[with_protoc=no]) +AC_ARG_ENABLE([coverage], + [AS_HELP_STRING([--enable-coverage], + [generate coverage report])], + [coverage=yes],[coverage=no]) + +AM_CONDITIONAL([HAVE_COVERAGE], [test "x$coverage" == "xyes"]) + # Checks for programs. AC_PROG_CC AC_PROG_CXX diff --git a/conformance/Makefile.am b/conformance/Makefile.am index 6815c733a52228f6973365d6255cc3e0e31642c8..0b6fd535f534779858471db56d6d460d9652bb3e 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -333,7 +333,7 @@ conformance-php-c: # Targets for actually running tests. test_cpp: protoc_middleman conformance-test-runner conformance-cpp - ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt ./conformance-cpp + ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt --text_format_failure_list text_format_failure_list_cpp.txt ./conformance-cpp test_java: protoc_middleman conformance-test-runner conformance-java ./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt --text_format_failure_list text_format_failure_list_java.txt ./conformance-java @@ -353,16 +353,27 @@ test_php: protoc_middleman conformance-test-runner conformance-php $(other_langu test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c -test_php_c_32: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) - ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c_32.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c - # These depend on library paths being properly set up. The easiest way to # run them is to just use "tox" from the python dir. test_python: protoc_middleman conformance-test-runner - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py + VERSION="$(shell python --version 2>&1)"; \ + if [[ "$$VERSION" == "Python 2.7"* ]]; then \ + echo "Using Python 2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python_2.7.txt ./conformance_python.py; \ + else \ + echo "Using Python >2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py; \ + fi test_python_cpp: protoc_middleman conformance-test-runner - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt ./conformance_python.py + VERSION="$(shell python --version 2>&1)"; \ + if [[ "$$VERSION" == "Python 2.7"* ]]; then \ + echo "Using Python 2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp_2.7.txt ./conformance_python.py; \ + else \ + echo "Using Python >2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp.txt ./conformance_python.py; \ + fi test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js diff --git a/conformance/Makefile.in b/conformance/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..44c749117db2e9a531b1f4f05802fb11df08e5a2 --- /dev/null +++ b/conformance/Makefile.in @@ -0,0 +1,1557 @@ +# Makefile.in generated by automake 1.16.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = conformance-test-runner$(EXEEXT) \ + conformance-cpp$(EXEEXT) $(am__EXEEXT_1) +@OBJC_CONFORMANCE_TEST_TRUE@am__append_1 = conformance-objc +subdir = conformance +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_system_extensions.m4 \ + $(top_srcdir)/m4/acx_check_suncc.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_prog_cxx_for_build.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/stl_hash.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@OBJC_CONFORMANCE_TEST_TRUE@am__EXEEXT_1 = conformance-objc$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_conformance_cpp_OBJECTS = \ + conformance_cpp-conformance_cpp.$(OBJEXT) +am__dirstamp = $(am__leading_dot)dirstamp +nodist_conformance_cpp_OBJECTS = \ + conformance_cpp-conformance.pb.$(OBJEXT) \ + google/protobuf/conformance_cpp-test_messages_proto3.pb.$(OBJEXT) \ + google/protobuf/conformance_cpp-test_messages_proto2.pb.$(OBJEXT) +conformance_cpp_OBJECTS = $(am_conformance_cpp_OBJECTS) \ + $(nodist_conformance_cpp_OBJECTS) +conformance_cpp_DEPENDENCIES = $(top_srcdir)/src/libprotobuf.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am__conformance_objc_SOURCES_DIST = conformance_objc.m \ + ../objectivec/GPBProtocolBuffers.m +@OBJC_CONFORMANCE_TEST_TRUE@am_conformance_objc_OBJECTS = conformance_objc-conformance_objc.$(OBJEXT) \ +@OBJC_CONFORMANCE_TEST_TRUE@ ../objectivec/conformance_objc-GPBProtocolBuffers.$(OBJEXT) +@OBJC_CONFORMANCE_TEST_TRUE@nodist_conformance_objc_OBJECTS = conformance_objc-Conformance.pbobjc.$(OBJEXT) \ +@OBJC_CONFORMANCE_TEST_TRUE@ google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.$(OBJEXT) \ +@OBJC_CONFORMANCE_TEST_TRUE@ google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.$(OBJEXT) +conformance_objc_OBJECTS = $(am_conformance_objc_OBJECTS) \ + $(nodist_conformance_objc_OBJECTS) +conformance_objc_LDADD = $(LDADD) +conformance_objc_LINK = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(OBJCLD) $(AM_OBJCFLAGS) \ + $(OBJCFLAGS) $(conformance_objc_LDFLAGS) $(LDFLAGS) -o $@ +am_conformance_test_runner_OBJECTS = \ + conformance_test_runner-conformance_test.$(OBJEXT) \ + conformance_test_runner-conformance_test_main.$(OBJEXT) \ + conformance_test_runner-binary_json_conformance_suite.$(OBJEXT) \ + conformance_test_runner-text_format_conformance_suite.$(OBJEXT) \ + conformance_test_runner-conformance_test_runner.$(OBJEXT) \ + third_party/jsoncpp/conformance_test_runner-jsoncpp.$(OBJEXT) +nodist_conformance_test_runner_OBJECTS = \ + conformance_test_runner-conformance.pb.$(OBJEXT) \ + google/protobuf/conformance_test_runner-test_messages_proto3.pb.$(OBJEXT) \ + google/protobuf/conformance_test_runner-test_messages_proto2.pb.$(OBJEXT) +conformance_test_runner_OBJECTS = \ + $(am_conformance_test_runner_OBJECTS) \ + $(nodist_conformance_test_runner_OBJECTS) +conformance_test_runner_DEPENDENCIES = \ + $(top_srcdir)/src/libprotobuf.la +conformance_test_runner_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Po \ + ./$(DEPDIR)/conformance_cpp-conformance.pb.Po \ + ./$(DEPDIR)/conformance_cpp-conformance_cpp.Po \ + ./$(DEPDIR)/conformance_objc-Conformance.pbobjc.Po \ + ./$(DEPDIR)/conformance_objc-conformance_objc.Po \ + ./$(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Po \ + ./$(DEPDIR)/conformance_test_runner-conformance.pb.Po \ + ./$(DEPDIR)/conformance_test_runner-conformance_test.Po \ + ./$(DEPDIR)/conformance_test_runner-conformance_test_main.Po \ + ./$(DEPDIR)/conformance_test_runner-conformance_test_runner.Po \ + ./$(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Po \ + google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Po \ + google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Po \ + google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Po \ + google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Po \ + google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Po \ + google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Po \ + third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +OBJCCOMPILE = $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) +LTOBJCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(OBJC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_OBJCFLAGS) $(OBJCFLAGS) +AM_V_OBJC = $(am__v_OBJC_@AM_V@) +am__v_OBJC_ = $(am__v_OBJC_@AM_DEFAULT_V@) +am__v_OBJC_0 = @echo " OBJC " $@; +am__v_OBJC_1 = +OBJCLD = $(OBJC) +OBJCLINK = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_OBJCLD = $(am__v_OBJCLD_@AM_V@) +am__v_OBJCLD_ = $(am__v_OBJCLD_@AM_DEFAULT_V@) +am__v_OBJCLD_0 = @echo " OBJCLD " $@; +am__v_OBJCLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(conformance_cpp_SOURCES) $(nodist_conformance_cpp_SOURCES) \ + $(conformance_objc_SOURCES) $(nodist_conformance_objc_SOURCES) \ + $(conformance_test_runner_SOURCES) \ + $(nodist_conformance_test_runner_SOURCES) +DIST_SOURCES = $(conformance_cpp_SOURCES) \ + $(am__conformance_objc_SOURCES_DIST) \ + $(conformance_test_runner_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXCPPFLAGS_FOR_BUILD = @CXXCPPFLAGS_FOR_BUILD@ +CXXCPP_FOR_BUILD = @CXXCPP_FOR_BUILD@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIST_LANG = @DIST_LANG@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +ISAINFO = @ISAINFO@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBATOMIC_LIBS = @LIBATOMIC_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POW_LIB = @POW_LIB@ +PROTOBUF_OPT_FLAG = @PROTOBUF_OPT_FLAG@ +PROTOC = @PROTOC@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_CXX_FOR_BUILD = @ac_ct_CXX_FOR_BUILD@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +conformance_protoc_inputs = \ + conformance.proto \ + $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto + + +# proto2 input files, should be separated with proto3, as we +# can't generate proto2 files for ruby, php and objc +conformance_proto2_protoc_inputs = \ + $(top_srcdir)/src/google/protobuf/test_messages_proto2.proto + +well_known_type_protoc_inputs = \ + $(top_srcdir)/src/google/protobuf/any.proto \ + $(top_srcdir)/src/google/protobuf/duration.proto \ + $(top_srcdir)/src/google/protobuf/field_mask.proto \ + $(top_srcdir)/src/google/protobuf/struct.proto \ + $(top_srcdir)/src/google/protobuf/timestamp.proto \ + $(top_srcdir)/src/google/protobuf/wrappers.proto + +protoc_outputs = \ + conformance.pb.cc \ + conformance.pb.h + +other_language_protoc_outputs = \ + conformance_pb2.py \ + Conformance.pbobjc.h \ + Conformance.pbobjc.m \ + conformance_pb.js \ + conformance_pb.rb \ + com/google/protobuf/Any.java \ + com/google/protobuf/AnyOrBuilder.java \ + com/google/protobuf/AnyProto.java \ + com/google/protobuf/BoolValue.java \ + com/google/protobuf/BoolValueOrBuilder.java \ + com/google/protobuf/BytesValue.java \ + com/google/protobuf/BytesValueOrBuilder.java \ + com/google/protobuf/conformance/Conformance.java \ + com/google/protobuf/DoubleValue.java \ + com/google/protobuf/DoubleValueOrBuilder.java \ + com/google/protobuf/Duration.java \ + com/google/protobuf/DurationOrBuilder.java \ + com/google/protobuf/DurationProto.java \ + com/google/protobuf/FieldMask.java \ + com/google/protobuf/FieldMaskOrBuilder.java \ + com/google/protobuf/FieldMaskProto.java \ + com/google/protobuf/FloatValue.java \ + com/google/protobuf/FloatValueOrBuilder.java \ + com/google/protobuf/Int32Value.java \ + com/google/protobuf/Int32ValueOrBuilder.java \ + com/google/protobuf/Int64Value.java \ + com/google/protobuf/Int64ValueOrBuilder.java \ + com/google/protobuf/ListValue.java \ + com/google/protobuf/ListValueOrBuilder.java \ + com/google/protobuf/NullValue.java \ + com/google/protobuf/StringValue.java \ + com/google/protobuf/StringValueOrBuilder.java \ + com/google/protobuf/Struct.java \ + com/google/protobuf/StructOrBuilder.java \ + com/google/protobuf/StructProto.java \ + com/google/protobuf/Timestamp.java \ + com/google/protobuf/TimestampOrBuilder.java \ + com/google/protobuf/TimestampProto.java \ + com/google/protobuf/UInt32Value.java \ + com/google/protobuf/UInt32ValueOrBuilder.java \ + com/google/protobuf/UInt64Value.java \ + com/google/protobuf/UInt64ValueOrBuilder.java \ + com/google/protobuf/Value.java \ + com/google/protobuf/ValueOrBuilder.java \ + com/google/protobuf/WrappersProto.java \ + com/google/protobuf_test_messages/proto3/TestMessagesProto3.java \ + com/google/protobuf_test_messages/proto2/TestMessagesProto2.java \ + google/protobuf/any.pb.cc \ + google/protobuf/any.pb.h \ + google/protobuf/any.rb \ + google/protobuf/any_pb2.py \ + google/protobuf/duration.pb.cc \ + google/protobuf/duration.pb.h \ + google/protobuf/duration.rb \ + google/protobuf/duration_pb2.py \ + google/protobuf/field_mask.pb.cc \ + google/protobuf/field_mask.pb.h \ + google/protobuf/field_mask.rb \ + google/protobuf/field_mask_pb2.py \ + google/protobuf/struct.pb.cc \ + google/protobuf/struct.pb.h \ + google/protobuf/struct.rb \ + google/protobuf/struct_pb2.py \ + google/protobuf/TestMessagesProto2.pbobjc.h \ + google/protobuf/TestMessagesProto2.pbobjc.m \ + google/protobuf/TestMessagesProto3.pbobjc.h \ + google/protobuf/TestMessagesProto3.pbobjc.m \ + google/protobuf/test_messages_proto3.pb.cc \ + google/protobuf/test_messages_proto3.pb.h \ + google/protobuf/test_messages_proto2.pb.cc \ + google/protobuf/test_messages_proto2.pb.h \ + google/protobuf/test_messages_proto3_pb.rb \ + google/protobuf/test_messages_proto3_pb2.py \ + google/protobuf/test_messages_proto2_pb2.py \ + google/protobuf/timestamp.pb.cc \ + google/protobuf/timestamp.pb.h \ + google/protobuf/timestamp.rb \ + google/protobuf/timestamp_pb2.py \ + google/protobuf/wrappers.pb.cc \ + google/protobuf/wrappers.pb.h \ + google/protobuf/wrappers.rb \ + google/protobuf/wrappers_pb2.py \ + Conformance/ConformanceRequest.php \ + Conformance/ConformanceResponse.php \ + Conformance/FailureSet.php \ + Conformance/WireFormat.php \ + GPBMetadata/Conformance.php \ + GPBMetadata/Google/Protobuf/Any.php \ + GPBMetadata/Google/Protobuf/Duration.php \ + GPBMetadata/Google/Protobuf/FieldMask.php \ + GPBMetadata/Google/Protobuf/Struct.php \ + GPBMetadata/Google/Protobuf/TestMessagesProto3.php \ + GPBMetadata/Google/Protobuf/Timestamp.php \ + GPBMetadata/Google/Protobuf/Wrappers.php \ + Google/Protobuf/Any.php \ + Google/Protobuf/BoolValue.php \ + Google/Protobuf/BytesValue.php \ + Google/Protobuf/DoubleValue.php \ + Google/Protobuf/Duration.php \ + Google/Protobuf/FieldMask.php \ + Google/Protobuf/FloatValue.php \ + Google/Protobuf/Int32Value.php \ + Google/Protobuf/Int64Value.php \ + Google/Protobuf/ListValue.php \ + Google/Protobuf/NullValue.php \ + Google/Protobuf/StringValue.php \ + Google/Protobuf/Struct.php \ + Google/Protobuf/Timestamp.php \ + Google/Protobuf/UInt32Value.php \ + Google/Protobuf/UInt64Value.php \ + Google/Protobuf/Value.php \ + Protobuf_test_messages/Proto3/ForeignEnum.php \ + Protobuf_test_messages/Proto3/ForeignMessage.php \ + Protobuf_test_messages/Proto3/TestAllTypes_NestedEnum.php \ + Protobuf_test_messages/Proto3/TestAllTypes_NestedMessage.php \ + Protobuf_test_messages/Proto3/TestAllTypes.php + + +# All source files excepet C++/Objective-C ones should be explicitly listed +# here because the autoconf tools don't include files of other languages +# automatically. +EXTRA_DIST = \ + ConformanceJava.java \ + ConformanceJavaLite.java \ + README.md \ + conformance.proto \ + conformance_python.py \ + conformance_ruby.rb \ + conformance_php.php \ + failure_list_cpp.txt \ + failure_list_csharp.txt \ + failure_list_java.txt \ + failure_list_js.txt \ + failure_list_objc.txt \ + failure_list_python.txt \ + failure_list_python_cpp.txt \ + failure_list_python-post26.txt \ + failure_list_ruby.txt \ + failure_list_php.txt \ + failure_list_php_c.txt + +conformance_test_runner_LDADD = $(top_srcdir)/src/libprotobuf.la +conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \ + conformance_test_main.cc \ + binary_json_conformance_suite.h \ + binary_json_conformance_suite.cc \ + text_format_conformance_suite.h \ + text_format_conformance_suite.cc \ + conformance_test_runner.cc \ + third_party/jsoncpp/json.h \ + third_party/jsoncpp/jsoncpp.cpp + +nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc +conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) +conformance_test_runner_CXXFLAGS = -std=c++11 +conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la +conformance_cpp_SOURCES = conformance_cpp.cc +nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc +conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src +@OBJC_CONFORMANCE_TEST_TRUE@conformance_objc_SOURCES = conformance_objc.m ../objectivec/GPBProtocolBuffers.m +@OBJC_CONFORMANCE_TEST_TRUE@nodist_conformance_objc_SOURCES = Conformance.pbobjc.m google/protobuf/TestMessagesProto2.pbobjc.m google/protobuf/TestMessagesProto3.pbobjc.m +# On travis, the build fails without the isysroot because whatever system +# headers are being found don't include generics support for +# NSArray/NSDictionary, the only guess is their image at one time had an odd +# setup for Xcode and old frameworks are being found. +@OBJC_CONFORMANCE_TEST_TRUE@conformance_objc_CPPFLAGS = -I$(top_srcdir)/objectivec -isysroot `xcrun --sdk macosx --show-sdk-path` +@OBJC_CONFORMANCE_TEST_TRUE@conformance_objc_LDFLAGS = -framework Foundation +CLEANFILES = $(protoc_outputs) protoc_middleman javac_middleman conformance-java javac_middleman_lite conformance-java-lite conformance-csharp conformance-php conformance-php-c $(other_language_protoc_outputs) +MAINTAINERCLEANFILES = \ + Makefile.in + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .cpp .lo .m .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu conformance/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu conformance/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +google/protobuf/$(am__dirstamp): + @$(MKDIR_P) google/protobuf + @: > google/protobuf/$(am__dirstamp) +google/protobuf/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) google/protobuf/$(DEPDIR) + @: > google/protobuf/$(DEPDIR)/$(am__dirstamp) +google/protobuf/conformance_cpp-test_messages_proto3.pb.$(OBJEXT): \ + google/protobuf/$(am__dirstamp) \ + google/protobuf/$(DEPDIR)/$(am__dirstamp) +google/protobuf/conformance_cpp-test_messages_proto2.pb.$(OBJEXT): \ + google/protobuf/$(am__dirstamp) \ + google/protobuf/$(DEPDIR)/$(am__dirstamp) + +conformance-cpp$(EXEEXT): $(conformance_cpp_OBJECTS) $(conformance_cpp_DEPENDENCIES) $(EXTRA_conformance_cpp_DEPENDENCIES) + @rm -f conformance-cpp$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(conformance_cpp_OBJECTS) $(conformance_cpp_LDADD) $(LIBS) +../objectivec/$(am__dirstamp): + @$(MKDIR_P) ../objectivec + @: > ../objectivec/$(am__dirstamp) +../objectivec/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ../objectivec/$(DEPDIR) + @: > ../objectivec/$(DEPDIR)/$(am__dirstamp) +../objectivec/conformance_objc-GPBProtocolBuffers.$(OBJEXT): \ + ../objectivec/$(am__dirstamp) \ + ../objectivec/$(DEPDIR)/$(am__dirstamp) +google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.$(OBJEXT): \ + google/protobuf/$(am__dirstamp) \ + google/protobuf/$(DEPDIR)/$(am__dirstamp) +google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.$(OBJEXT): \ + google/protobuf/$(am__dirstamp) \ + google/protobuf/$(DEPDIR)/$(am__dirstamp) + +conformance-objc$(EXEEXT): $(conformance_objc_OBJECTS) $(conformance_objc_DEPENDENCIES) $(EXTRA_conformance_objc_DEPENDENCIES) + @rm -f conformance-objc$(EXEEXT) + $(AM_V_OBJCLD)$(conformance_objc_LINK) $(conformance_objc_OBJECTS) $(conformance_objc_LDADD) $(LIBS) +third_party/jsoncpp/$(am__dirstamp): + @$(MKDIR_P) third_party/jsoncpp + @: > third_party/jsoncpp/$(am__dirstamp) +third_party/jsoncpp/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) third_party/jsoncpp/$(DEPDIR) + @: > third_party/jsoncpp/$(DEPDIR)/$(am__dirstamp) +third_party/jsoncpp/conformance_test_runner-jsoncpp.$(OBJEXT): \ + third_party/jsoncpp/$(am__dirstamp) \ + third_party/jsoncpp/$(DEPDIR)/$(am__dirstamp) +google/protobuf/conformance_test_runner-test_messages_proto3.pb.$(OBJEXT): \ + google/protobuf/$(am__dirstamp) \ + google/protobuf/$(DEPDIR)/$(am__dirstamp) +google/protobuf/conformance_test_runner-test_messages_proto2.pb.$(OBJEXT): \ + google/protobuf/$(am__dirstamp) \ + google/protobuf/$(DEPDIR)/$(am__dirstamp) + +conformance-test-runner$(EXEEXT): $(conformance_test_runner_OBJECTS) $(conformance_test_runner_DEPENDENCIES) $(EXTRA_conformance_test_runner_DEPENDENCIES) + @rm -f conformance-test-runner$(EXEEXT) + $(AM_V_CXXLD)$(conformance_test_runner_LINK) $(conformance_test_runner_OBJECTS) $(conformance_test_runner_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f ../objectivec/*.$(OBJEXT) + -rm -f google/protobuf/*.$(OBJEXT) + -rm -f third_party/jsoncpp/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_cpp-conformance.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_cpp-conformance_cpp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_objc-Conformance.pbobjc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_objc-conformance_objc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_test_runner-conformance.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_test_runner-conformance_test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_test_runner-conformance_test_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_test_runner-conformance_test_runner.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +conformance_cpp-conformance_cpp.o: conformance_cpp.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT conformance_cpp-conformance_cpp.o -MD -MP -MF $(DEPDIR)/conformance_cpp-conformance_cpp.Tpo -c -o conformance_cpp-conformance_cpp.o `test -f 'conformance_cpp.cc' || echo '$(srcdir)/'`conformance_cpp.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_cpp-conformance_cpp.Tpo $(DEPDIR)/conformance_cpp-conformance_cpp.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_cpp.cc' object='conformance_cpp-conformance_cpp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o conformance_cpp-conformance_cpp.o `test -f 'conformance_cpp.cc' || echo '$(srcdir)/'`conformance_cpp.cc + +conformance_cpp-conformance_cpp.obj: conformance_cpp.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT conformance_cpp-conformance_cpp.obj -MD -MP -MF $(DEPDIR)/conformance_cpp-conformance_cpp.Tpo -c -o conformance_cpp-conformance_cpp.obj `if test -f 'conformance_cpp.cc'; then $(CYGPATH_W) 'conformance_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_cpp.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_cpp-conformance_cpp.Tpo $(DEPDIR)/conformance_cpp-conformance_cpp.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_cpp.cc' object='conformance_cpp-conformance_cpp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o conformance_cpp-conformance_cpp.obj `if test -f 'conformance_cpp.cc'; then $(CYGPATH_W) 'conformance_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_cpp.cc'; fi` + +conformance_cpp-conformance.pb.o: conformance.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT conformance_cpp-conformance.pb.o -MD -MP -MF $(DEPDIR)/conformance_cpp-conformance.pb.Tpo -c -o conformance_cpp-conformance.pb.o `test -f 'conformance.pb.cc' || echo '$(srcdir)/'`conformance.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_cpp-conformance.pb.Tpo $(DEPDIR)/conformance_cpp-conformance.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance.pb.cc' object='conformance_cpp-conformance.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o conformance_cpp-conformance.pb.o `test -f 'conformance.pb.cc' || echo '$(srcdir)/'`conformance.pb.cc + +conformance_cpp-conformance.pb.obj: conformance.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT conformance_cpp-conformance.pb.obj -MD -MP -MF $(DEPDIR)/conformance_cpp-conformance.pb.Tpo -c -o conformance_cpp-conformance.pb.obj `if test -f 'conformance.pb.cc'; then $(CYGPATH_W) 'conformance.pb.cc'; else $(CYGPATH_W) '$(srcdir)/conformance.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_cpp-conformance.pb.Tpo $(DEPDIR)/conformance_cpp-conformance.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance.pb.cc' object='conformance_cpp-conformance.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o conformance_cpp-conformance.pb.obj `if test -f 'conformance.pb.cc'; then $(CYGPATH_W) 'conformance.pb.cc'; else $(CYGPATH_W) '$(srcdir)/conformance.pb.cc'; fi` + +google/protobuf/conformance_cpp-test_messages_proto3.pb.o: google/protobuf/test_messages_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_cpp-test_messages_proto3.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Tpo -c -o google/protobuf/conformance_cpp-test_messages_proto3.pb.o `test -f 'google/protobuf/test_messages_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Tpo google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto3.pb.cc' object='google/protobuf/conformance_cpp-test_messages_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_cpp-test_messages_proto3.pb.o `test -f 'google/protobuf/test_messages_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto3.pb.cc + +google/protobuf/conformance_cpp-test_messages_proto3.pb.obj: google/protobuf/test_messages_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_cpp-test_messages_proto3.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Tpo -c -o google/protobuf/conformance_cpp-test_messages_proto3.pb.obj `if test -f 'google/protobuf/test_messages_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Tpo google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto3.pb.cc' object='google/protobuf/conformance_cpp-test_messages_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_cpp-test_messages_proto3.pb.obj `if test -f 'google/protobuf/test_messages_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto3.pb.cc'; fi` + +google/protobuf/conformance_cpp-test_messages_proto2.pb.o: google/protobuf/test_messages_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_cpp-test_messages_proto2.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Tpo -c -o google/protobuf/conformance_cpp-test_messages_proto2.pb.o `test -f 'google/protobuf/test_messages_proto2.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Tpo google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto2.pb.cc' object='google/protobuf/conformance_cpp-test_messages_proto2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_cpp-test_messages_proto2.pb.o `test -f 'google/protobuf/test_messages_proto2.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto2.pb.cc + +google/protobuf/conformance_cpp-test_messages_proto2.pb.obj: google/protobuf/test_messages_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_cpp-test_messages_proto2.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Tpo -c -o google/protobuf/conformance_cpp-test_messages_proto2.pb.obj `if test -f 'google/protobuf/test_messages_proto2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Tpo google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto2.pb.cc' object='google/protobuf/conformance_cpp-test_messages_proto2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_cpp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_cpp-test_messages_proto2.pb.obj `if test -f 'google/protobuf/test_messages_proto2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto2.pb.cc'; fi` + +conformance_test_runner-conformance_test.o: conformance_test.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance_test.o -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance_test.Tpo -c -o conformance_test_runner-conformance_test.o `test -f 'conformance_test.cc' || echo '$(srcdir)/'`conformance_test.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance_test.Tpo $(DEPDIR)/conformance_test_runner-conformance_test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_test.cc' object='conformance_test_runner-conformance_test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance_test.o `test -f 'conformance_test.cc' || echo '$(srcdir)/'`conformance_test.cc + +conformance_test_runner-conformance_test.obj: conformance_test.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance_test.obj -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance_test.Tpo -c -o conformance_test_runner-conformance_test.obj `if test -f 'conformance_test.cc'; then $(CYGPATH_W) 'conformance_test.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_test.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance_test.Tpo $(DEPDIR)/conformance_test_runner-conformance_test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_test.cc' object='conformance_test_runner-conformance_test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance_test.obj `if test -f 'conformance_test.cc'; then $(CYGPATH_W) 'conformance_test.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_test.cc'; fi` + +conformance_test_runner-conformance_test_main.o: conformance_test_main.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance_test_main.o -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance_test_main.Tpo -c -o conformance_test_runner-conformance_test_main.o `test -f 'conformance_test_main.cc' || echo '$(srcdir)/'`conformance_test_main.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance_test_main.Tpo $(DEPDIR)/conformance_test_runner-conformance_test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_test_main.cc' object='conformance_test_runner-conformance_test_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance_test_main.o `test -f 'conformance_test_main.cc' || echo '$(srcdir)/'`conformance_test_main.cc + +conformance_test_runner-conformance_test_main.obj: conformance_test_main.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance_test_main.obj -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance_test_main.Tpo -c -o conformance_test_runner-conformance_test_main.obj `if test -f 'conformance_test_main.cc'; then $(CYGPATH_W) 'conformance_test_main.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_test_main.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance_test_main.Tpo $(DEPDIR)/conformance_test_runner-conformance_test_main.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_test_main.cc' object='conformance_test_runner-conformance_test_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance_test_main.obj `if test -f 'conformance_test_main.cc'; then $(CYGPATH_W) 'conformance_test_main.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_test_main.cc'; fi` + +conformance_test_runner-binary_json_conformance_suite.o: binary_json_conformance_suite.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-binary_json_conformance_suite.o -MD -MP -MF $(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Tpo -c -o conformance_test_runner-binary_json_conformance_suite.o `test -f 'binary_json_conformance_suite.cc' || echo '$(srcdir)/'`binary_json_conformance_suite.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Tpo $(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='binary_json_conformance_suite.cc' object='conformance_test_runner-binary_json_conformance_suite.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-binary_json_conformance_suite.o `test -f 'binary_json_conformance_suite.cc' || echo '$(srcdir)/'`binary_json_conformance_suite.cc + +conformance_test_runner-binary_json_conformance_suite.obj: binary_json_conformance_suite.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-binary_json_conformance_suite.obj -MD -MP -MF $(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Tpo -c -o conformance_test_runner-binary_json_conformance_suite.obj `if test -f 'binary_json_conformance_suite.cc'; then $(CYGPATH_W) 'binary_json_conformance_suite.cc'; else $(CYGPATH_W) '$(srcdir)/binary_json_conformance_suite.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Tpo $(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='binary_json_conformance_suite.cc' object='conformance_test_runner-binary_json_conformance_suite.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-binary_json_conformance_suite.obj `if test -f 'binary_json_conformance_suite.cc'; then $(CYGPATH_W) 'binary_json_conformance_suite.cc'; else $(CYGPATH_W) '$(srcdir)/binary_json_conformance_suite.cc'; fi` + +conformance_test_runner-text_format_conformance_suite.o: text_format_conformance_suite.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-text_format_conformance_suite.o -MD -MP -MF $(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Tpo -c -o conformance_test_runner-text_format_conformance_suite.o `test -f 'text_format_conformance_suite.cc' || echo '$(srcdir)/'`text_format_conformance_suite.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Tpo $(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='text_format_conformance_suite.cc' object='conformance_test_runner-text_format_conformance_suite.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-text_format_conformance_suite.o `test -f 'text_format_conformance_suite.cc' || echo '$(srcdir)/'`text_format_conformance_suite.cc + +conformance_test_runner-text_format_conformance_suite.obj: text_format_conformance_suite.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-text_format_conformance_suite.obj -MD -MP -MF $(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Tpo -c -o conformance_test_runner-text_format_conformance_suite.obj `if test -f 'text_format_conformance_suite.cc'; then $(CYGPATH_W) 'text_format_conformance_suite.cc'; else $(CYGPATH_W) '$(srcdir)/text_format_conformance_suite.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Tpo $(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='text_format_conformance_suite.cc' object='conformance_test_runner-text_format_conformance_suite.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-text_format_conformance_suite.obj `if test -f 'text_format_conformance_suite.cc'; then $(CYGPATH_W) 'text_format_conformance_suite.cc'; else $(CYGPATH_W) '$(srcdir)/text_format_conformance_suite.cc'; fi` + +conformance_test_runner-conformance_test_runner.o: conformance_test_runner.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance_test_runner.o -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance_test_runner.Tpo -c -o conformance_test_runner-conformance_test_runner.o `test -f 'conformance_test_runner.cc' || echo '$(srcdir)/'`conformance_test_runner.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance_test_runner.Tpo $(DEPDIR)/conformance_test_runner-conformance_test_runner.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_test_runner.cc' object='conformance_test_runner-conformance_test_runner.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance_test_runner.o `test -f 'conformance_test_runner.cc' || echo '$(srcdir)/'`conformance_test_runner.cc + +conformance_test_runner-conformance_test_runner.obj: conformance_test_runner.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance_test_runner.obj -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance_test_runner.Tpo -c -o conformance_test_runner-conformance_test_runner.obj `if test -f 'conformance_test_runner.cc'; then $(CYGPATH_W) 'conformance_test_runner.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_test_runner.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance_test_runner.Tpo $(DEPDIR)/conformance_test_runner-conformance_test_runner.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance_test_runner.cc' object='conformance_test_runner-conformance_test_runner.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance_test_runner.obj `if test -f 'conformance_test_runner.cc'; then $(CYGPATH_W) 'conformance_test_runner.cc'; else $(CYGPATH_W) '$(srcdir)/conformance_test_runner.cc'; fi` + +third_party/jsoncpp/conformance_test_runner-jsoncpp.o: third_party/jsoncpp/jsoncpp.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT third_party/jsoncpp/conformance_test_runner-jsoncpp.o -MD -MP -MF third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Tpo -c -o third_party/jsoncpp/conformance_test_runner-jsoncpp.o `test -f 'third_party/jsoncpp/jsoncpp.cpp' || echo '$(srcdir)/'`third_party/jsoncpp/jsoncpp.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Tpo third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='third_party/jsoncpp/jsoncpp.cpp' object='third_party/jsoncpp/conformance_test_runner-jsoncpp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o third_party/jsoncpp/conformance_test_runner-jsoncpp.o `test -f 'third_party/jsoncpp/jsoncpp.cpp' || echo '$(srcdir)/'`third_party/jsoncpp/jsoncpp.cpp + +third_party/jsoncpp/conformance_test_runner-jsoncpp.obj: third_party/jsoncpp/jsoncpp.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT third_party/jsoncpp/conformance_test_runner-jsoncpp.obj -MD -MP -MF third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Tpo -c -o third_party/jsoncpp/conformance_test_runner-jsoncpp.obj `if test -f 'third_party/jsoncpp/jsoncpp.cpp'; then $(CYGPATH_W) 'third_party/jsoncpp/jsoncpp.cpp'; else $(CYGPATH_W) '$(srcdir)/third_party/jsoncpp/jsoncpp.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Tpo third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='third_party/jsoncpp/jsoncpp.cpp' object='third_party/jsoncpp/conformance_test_runner-jsoncpp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o third_party/jsoncpp/conformance_test_runner-jsoncpp.obj `if test -f 'third_party/jsoncpp/jsoncpp.cpp'; then $(CYGPATH_W) 'third_party/jsoncpp/jsoncpp.cpp'; else $(CYGPATH_W) '$(srcdir)/third_party/jsoncpp/jsoncpp.cpp'; fi` + +conformance_test_runner-conformance.pb.o: conformance.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance.pb.o -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance.pb.Tpo -c -o conformance_test_runner-conformance.pb.o `test -f 'conformance.pb.cc' || echo '$(srcdir)/'`conformance.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance.pb.Tpo $(DEPDIR)/conformance_test_runner-conformance.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance.pb.cc' object='conformance_test_runner-conformance.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance.pb.o `test -f 'conformance.pb.cc' || echo '$(srcdir)/'`conformance.pb.cc + +conformance_test_runner-conformance.pb.obj: conformance.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT conformance_test_runner-conformance.pb.obj -MD -MP -MF $(DEPDIR)/conformance_test_runner-conformance.pb.Tpo -c -o conformance_test_runner-conformance.pb.obj `if test -f 'conformance.pb.cc'; then $(CYGPATH_W) 'conformance.pb.cc'; else $(CYGPATH_W) '$(srcdir)/conformance.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_test_runner-conformance.pb.Tpo $(DEPDIR)/conformance_test_runner-conformance.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='conformance.pb.cc' object='conformance_test_runner-conformance.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o conformance_test_runner-conformance.pb.obj `if test -f 'conformance.pb.cc'; then $(CYGPATH_W) 'conformance.pb.cc'; else $(CYGPATH_W) '$(srcdir)/conformance.pb.cc'; fi` + +google/protobuf/conformance_test_runner-test_messages_proto3.pb.o: google/protobuf/test_messages_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_test_runner-test_messages_proto3.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Tpo -c -o google/protobuf/conformance_test_runner-test_messages_proto3.pb.o `test -f 'google/protobuf/test_messages_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Tpo google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto3.pb.cc' object='google/protobuf/conformance_test_runner-test_messages_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_test_runner-test_messages_proto3.pb.o `test -f 'google/protobuf/test_messages_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto3.pb.cc + +google/protobuf/conformance_test_runner-test_messages_proto3.pb.obj: google/protobuf/test_messages_proto3.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_test_runner-test_messages_proto3.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Tpo -c -o google/protobuf/conformance_test_runner-test_messages_proto3.pb.obj `if test -f 'google/protobuf/test_messages_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto3.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Tpo google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto3.pb.cc' object='google/protobuf/conformance_test_runner-test_messages_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_test_runner-test_messages_proto3.pb.obj `if test -f 'google/protobuf/test_messages_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto3.pb.cc'; fi` + +google/protobuf/conformance_test_runner-test_messages_proto2.pb.o: google/protobuf/test_messages_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_test_runner-test_messages_proto2.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Tpo -c -o google/protobuf/conformance_test_runner-test_messages_proto2.pb.o `test -f 'google/protobuf/test_messages_proto2.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Tpo google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto2.pb.cc' object='google/protobuf/conformance_test_runner-test_messages_proto2.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_test_runner-test_messages_proto2.pb.o `test -f 'google/protobuf/test_messages_proto2.pb.cc' || echo '$(srcdir)/'`google/protobuf/test_messages_proto2.pb.cc + +google/protobuf/conformance_test_runner-test_messages_proto2.pb.obj: google/protobuf/test_messages_proto2.pb.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/conformance_test_runner-test_messages_proto2.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Tpo -c -o google/protobuf/conformance_test_runner-test_messages_proto2.pb.obj `if test -f 'google/protobuf/test_messages_proto2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto2.pb.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Tpo google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_messages_proto2.pb.cc' object='google/protobuf/conformance_test_runner-test_messages_proto2.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_test_runner_CPPFLAGS) $(CPPFLAGS) $(conformance_test_runner_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/conformance_test_runner-test_messages_proto2.pb.obj `if test -f 'google/protobuf/test_messages_proto2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/test_messages_proto2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_messages_proto2.pb.cc'; fi` + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +.m.o: +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepOBJC_TRUE@ $(OBJCCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepOBJC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJCCOMPILE) -c -o $@ $< + +.m.obj: +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepOBJC_TRUE@ $(OBJCCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepOBJC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.m.lo: +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepOBJC_TRUE@ $(LTOBJCCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepOBJC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(LTOBJCCOMPILE) -c -o $@ $< + +conformance_objc-conformance_objc.o: conformance_objc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT conformance_objc-conformance_objc.o -MD -MP -MF $(DEPDIR)/conformance_objc-conformance_objc.Tpo -c -o conformance_objc-conformance_objc.o `test -f 'conformance_objc.m' || echo '$(srcdir)/'`conformance_objc.m +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_objc-conformance_objc.Tpo $(DEPDIR)/conformance_objc-conformance_objc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='conformance_objc.m' object='conformance_objc-conformance_objc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o conformance_objc-conformance_objc.o `test -f 'conformance_objc.m' || echo '$(srcdir)/'`conformance_objc.m + +conformance_objc-conformance_objc.obj: conformance_objc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT conformance_objc-conformance_objc.obj -MD -MP -MF $(DEPDIR)/conformance_objc-conformance_objc.Tpo -c -o conformance_objc-conformance_objc.obj `if test -f 'conformance_objc.m'; then $(CYGPATH_W) 'conformance_objc.m'; else $(CYGPATH_W) '$(srcdir)/conformance_objc.m'; fi` +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_objc-conformance_objc.Tpo $(DEPDIR)/conformance_objc-conformance_objc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='conformance_objc.m' object='conformance_objc-conformance_objc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o conformance_objc-conformance_objc.obj `if test -f 'conformance_objc.m'; then $(CYGPATH_W) 'conformance_objc.m'; else $(CYGPATH_W) '$(srcdir)/conformance_objc.m'; fi` + +../objectivec/conformance_objc-GPBProtocolBuffers.o: ../objectivec/GPBProtocolBuffers.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT ../objectivec/conformance_objc-GPBProtocolBuffers.o -MD -MP -MF ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Tpo -c -o ../objectivec/conformance_objc-GPBProtocolBuffers.o `test -f '../objectivec/GPBProtocolBuffers.m' || echo '$(srcdir)/'`../objectivec/GPBProtocolBuffers.m +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Tpo ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='../objectivec/GPBProtocolBuffers.m' object='../objectivec/conformance_objc-GPBProtocolBuffers.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o ../objectivec/conformance_objc-GPBProtocolBuffers.o `test -f '../objectivec/GPBProtocolBuffers.m' || echo '$(srcdir)/'`../objectivec/GPBProtocolBuffers.m + +../objectivec/conformance_objc-GPBProtocolBuffers.obj: ../objectivec/GPBProtocolBuffers.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT ../objectivec/conformance_objc-GPBProtocolBuffers.obj -MD -MP -MF ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Tpo -c -o ../objectivec/conformance_objc-GPBProtocolBuffers.obj `if test -f '../objectivec/GPBProtocolBuffers.m'; then $(CYGPATH_W) '../objectivec/GPBProtocolBuffers.m'; else $(CYGPATH_W) '$(srcdir)/../objectivec/GPBProtocolBuffers.m'; fi` +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Tpo ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='../objectivec/GPBProtocolBuffers.m' object='../objectivec/conformance_objc-GPBProtocolBuffers.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o ../objectivec/conformance_objc-GPBProtocolBuffers.obj `if test -f '../objectivec/GPBProtocolBuffers.m'; then $(CYGPATH_W) '../objectivec/GPBProtocolBuffers.m'; else $(CYGPATH_W) '$(srcdir)/../objectivec/GPBProtocolBuffers.m'; fi` + +conformance_objc-Conformance.pbobjc.o: Conformance.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT conformance_objc-Conformance.pbobjc.o -MD -MP -MF $(DEPDIR)/conformance_objc-Conformance.pbobjc.Tpo -c -o conformance_objc-Conformance.pbobjc.o `test -f 'Conformance.pbobjc.m' || echo '$(srcdir)/'`Conformance.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_objc-Conformance.pbobjc.Tpo $(DEPDIR)/conformance_objc-Conformance.pbobjc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='Conformance.pbobjc.m' object='conformance_objc-Conformance.pbobjc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o conformance_objc-Conformance.pbobjc.o `test -f 'Conformance.pbobjc.m' || echo '$(srcdir)/'`Conformance.pbobjc.m + +conformance_objc-Conformance.pbobjc.obj: Conformance.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT conformance_objc-Conformance.pbobjc.obj -MD -MP -MF $(DEPDIR)/conformance_objc-Conformance.pbobjc.Tpo -c -o conformance_objc-Conformance.pbobjc.obj `if test -f 'Conformance.pbobjc.m'; then $(CYGPATH_W) 'Conformance.pbobjc.m'; else $(CYGPATH_W) '$(srcdir)/Conformance.pbobjc.m'; fi` +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/conformance_objc-Conformance.pbobjc.Tpo $(DEPDIR)/conformance_objc-Conformance.pbobjc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='Conformance.pbobjc.m' object='conformance_objc-Conformance.pbobjc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o conformance_objc-Conformance.pbobjc.obj `if test -f 'Conformance.pbobjc.m'; then $(CYGPATH_W) 'Conformance.pbobjc.m'; else $(CYGPATH_W) '$(srcdir)/Conformance.pbobjc.m'; fi` + +google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.o: google/protobuf/TestMessagesProto2.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.o -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Tpo -c -o google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.o `test -f 'google/protobuf/TestMessagesProto2.pbobjc.m' || echo '$(srcdir)/'`google/protobuf/TestMessagesProto2.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Tpo google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='google/protobuf/TestMessagesProto2.pbobjc.m' object='google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.o `test -f 'google/protobuf/TestMessagesProto2.pbobjc.m' || echo '$(srcdir)/'`google/protobuf/TestMessagesProto2.pbobjc.m + +google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.obj: google/protobuf/TestMessagesProto2.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.obj -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Tpo -c -o google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.obj `if test -f 'google/protobuf/TestMessagesProto2.pbobjc.m'; then $(CYGPATH_W) 'google/protobuf/TestMessagesProto2.pbobjc.m'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/TestMessagesProto2.pbobjc.m'; fi` +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Tpo google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='google/protobuf/TestMessagesProto2.pbobjc.m' object='google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o google/protobuf/conformance_objc-TestMessagesProto2.pbobjc.obj `if test -f 'google/protobuf/TestMessagesProto2.pbobjc.m'; then $(CYGPATH_W) 'google/protobuf/TestMessagesProto2.pbobjc.m'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/TestMessagesProto2.pbobjc.m'; fi` + +google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.o: google/protobuf/TestMessagesProto3.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.o -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Tpo -c -o google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.o `test -f 'google/protobuf/TestMessagesProto3.pbobjc.m' || echo '$(srcdir)/'`google/protobuf/TestMessagesProto3.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Tpo google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='google/protobuf/TestMessagesProto3.pbobjc.m' object='google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.o `test -f 'google/protobuf/TestMessagesProto3.pbobjc.m' || echo '$(srcdir)/'`google/protobuf/TestMessagesProto3.pbobjc.m + +google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.obj: google/protobuf/TestMessagesProto3.pbobjc.m +@am__fastdepOBJC_TRUE@ $(AM_V_OBJC)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -MT google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.obj -MD -MP -MF google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Tpo -c -o google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.obj `if test -f 'google/protobuf/TestMessagesProto3.pbobjc.m'; then $(CYGPATH_W) 'google/protobuf/TestMessagesProto3.pbobjc.m'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/TestMessagesProto3.pbobjc.m'; fi` +@am__fastdepOBJC_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Tpo google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ $(AM_V_OBJC)source='google/protobuf/TestMessagesProto3.pbobjc.m' object='google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(AM_V_OBJC@am__nodep@)$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(conformance_objc_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) -c -o google/protobuf/conformance_objc-TestMessagesProto3.pbobjc.obj `if test -f 'google/protobuf/TestMessagesProto3.pbobjc.m'; then $(CYGPATH_W) 'google/protobuf/TestMessagesProto3.pbobjc.m'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/TestMessagesProto3.pbobjc.m'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f ../objectivec/$(DEPDIR)/$(am__dirstamp) + -rm -f ../objectivec/$(am__dirstamp) + -rm -f google/protobuf/$(DEPDIR)/$(am__dirstamp) + -rm -f google/protobuf/$(am__dirstamp) + -rm -f third_party/jsoncpp/$(DEPDIR)/$(am__dirstamp) + -rm -f third_party/jsoncpp/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Po + -rm -f ./$(DEPDIR)/conformance_cpp-conformance.pb.Po + -rm -f ./$(DEPDIR)/conformance_cpp-conformance_cpp.Po + -rm -f ./$(DEPDIR)/conformance_objc-Conformance.pbobjc.Po + -rm -f ./$(DEPDIR)/conformance_objc-conformance_objc.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance.pb.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance_test.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance_test_main.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance_test_runner.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Po + -rm -f third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ../objectivec/$(DEPDIR)/conformance_objc-GPBProtocolBuffers.Po + -rm -f ./$(DEPDIR)/conformance_cpp-conformance.pb.Po + -rm -f ./$(DEPDIR)/conformance_cpp-conformance_cpp.Po + -rm -f ./$(DEPDIR)/conformance_objc-Conformance.pbobjc.Po + -rm -f ./$(DEPDIR)/conformance_objc-conformance_objc.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-binary_json_conformance_suite.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance.pb.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance_test.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance_test_main.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-conformance_test_runner.Po + -rm -f ./$(DEPDIR)/conformance_test_runner-text_format_conformance_suite.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto2.pb.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_cpp-test_messages_proto3.pb.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto2.pbobjc.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_objc-TestMessagesProto3.pbobjc.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto2.pb.Po + -rm -f google/protobuf/$(DEPDIR)/conformance_test_runner-test_messages_proto3.pb.Po + -rm -f third_party/jsoncpp/$(DEPDIR)/conformance_test_runner-jsoncpp.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + # lite/com/google/protobuf/Any.java \ + # lite/com/google/protobuf/AnyOrBuilder.java \ + # lite/com/google/protobuf/AnyProto.java \ + # lite/com/google/protobuf/BoolValue.java \ + # lite/com/google/protobuf/BoolValueOrBuilder.java \ + # lite/com/google/protobuf/BytesValue.java \ + # lite/com/google/protobuf/BytesValueOrBuilder.java \ + # lite/com/google/protobuf/conformance/Conformance.java \ + # lite/com/google/protobuf/DoubleValue.java \ + # lite/com/google/protobuf/DoubleValueOrBuilder.java \ + # lite/com/google/protobuf/Duration.java \ + # lite/com/google/protobuf/DurationOrBuilder.java \ + # lite/com/google/protobuf/DurationProto.java \ + # lite/com/google/protobuf/FieldMask.java \ + # lite/com/google/protobuf/FieldMaskOrBuilder.java \ + # lite/com/google/protobuf/FieldMaskProto.java \ + # lite/com/google/protobuf/FloatValue.java \ + # lite/com/google/protobuf/FloatValueOrBuilder.java \ + # lite/com/google/protobuf/Int32Value.java \ + # lite/com/google/protobuf/Int32ValueOrBuilder.java \ + # lite/com/google/protobuf/Int64Value.java \ + # lite/com/google/protobuf/Int64ValueOrBuilder.java \ + # lite/com/google/protobuf/ListValue.java \ + # lite/com/google/protobuf/ListValueOrBuilder.java \ + # lite/com/google/protobuf/NullValue.java \ + # lite/com/google/protobuf/StringValue.java \ + # lite/com/google/protobuf/StringValueOrBuilder.java \ + # lite/com/google/protobuf/Struct.java \ + # lite/com/google/protobuf/StructOrBuilder.java \ + # lite/com/google/protobuf/StructProto.java \ + # lite/com/google/protobuf/Timestamp.java \ + # lite/com/google/protobuf/TimestampOrBuilder.java \ + # lite/com/google/protobuf/TimestampProto.java \ + # lite/com/google/protobuf/UInt32Value.java \ + # lite/com/google/protobuf/UInt32ValueOrBuilder.java \ + # lite/com/google/protobuf/UInt64Value.java \ + # lite/com/google/protobuf/UInt64ValueOrBuilder.java \ + # lite/com/google/protobuf/Value.java \ + # lite/com/google/protobuf/ValueOrBuilder.java \ + # lite/com/google/protobuf/WrappersProto.java +# Explicit deps because BUILT_SOURCES are only done before a "make all/check" +# so a direct "make test_cpp" could fail if parallel enough. +conformance_test_runner-conformance_test.$(OBJEXT): conformance.pb.h +conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h +# Explicit dep because BUILT_SOURCES are only done before a "make all/check" +# so a direct "make test_cpp" could fail if parallel enough. +conformance_cpp-conformance_cpp.$(OBJEXT): conformance.pb.h +# Explicit dep because BUILT_SOURCES are only done before a "make all/check" +# so a direct "make test_objc" could fail if parallel enough. +@OBJC_CONFORMANCE_TEST_TRUE@conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h google/protobuf/TestMessagesProto2.pbobjc.h google/protobuf/TestMessagesProto3.pbobjc.h + +# JavaScript well-known types are expected to be in a directory called +# google-protobuf, because they are usually in the google-protobuf npm +# package. But we want to use the sources from our tree, so we recreate +# that directory structure here. +google-protobuf: + mkdir google-protobuf + +# Some implementations include pre-generated versions of well-known types. +@USE_EXTERNAL_PROTOC_TRUE@protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf +@USE_EXTERNAL_PROTOC_TRUE@ $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:. $(conformance_protoc_inputs) +@USE_EXTERNAL_PROTOC_TRUE@ $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --objc_out=. --python_out=. --js_out=import_style=commonjs,binary:. $(conformance_proto2_protoc_inputs) +@USE_EXTERNAL_PROTOC_TRUE@ $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. --js_out=import_style=commonjs,binary:google-protobuf $(well_known_type_protoc_inputs) +@USE_EXTERNAL_PROTOC_TRUE@ touch protoc_middleman + +# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is +# relative to srcdir, which may not be the same as the current directory when +# building out-of-tree. +@USE_EXTERNAL_PROTOC_FALSE@protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf +@USE_EXTERNAL_PROTOC_FALSE@ oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_protoc_inputs) ) +@USE_EXTERNAL_PROTOC_FALSE@ oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --objc_out=. --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_proto2_protoc_inputs) ) +@USE_EXTERNAL_PROTOC_FALSE@ oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd/google-protobuf $(well_known_type_protoc_inputs) ) +@USE_EXTERNAL_PROTOC_FALSE@ touch protoc_middleman + +$(protoc_outputs): protoc_middleman + +$(other_language_protoc_outputs): protoc_middleman + +javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs) + jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java com/google/protobuf_test_messages/proto3/TestMessagesProto3.java com/google/protobuf_test_messages/proto2/TestMessagesProto2.java + @touch javac_middleman + +conformance-java: javac_middleman + @echo "Writing shortcut script conformance-java..." + @echo '#! /bin/sh' > conformance-java + @jar=`ls ../java/util/target/*jar-with-dependencies.jar` && echo java -classpath .:../java/target/classes:$$jar ConformanceJava '$$@' >> conformance-java + @chmod +x conformance-java + +javac_middleman_lite: ConformanceJavaLite.java protoc_middleman $(other_language_protoc_outputs) + javac -classpath ../java/lite/target/classes:lite ConformanceJavaLite.java lite/com/google/protobuf/conformance/Conformance.java + @touch javac_middleman_lite + +conformance-java-lite: javac_middleman_lite + @echo "Writing shortcut script conformance-java-lite..." + @echo '#! /bin/sh' > conformance-java-lite + @echo java -classpath .:../java/lite/target/classes:lite ConformanceJavaLite '$$@' >> conformance-java-lite + @chmod +x conformance-java-lite + +# Currently the conformance code is alongside the rest of the C# +# source, as it's easier to maintain there. We assume we've already +# built that, so we just need a script to run it. +conformance-csharp: $(other_language_protoc_outputs) + @echo "Writing shortcut script conformance-csharp..." + @echo '#! /bin/sh' > conformance-csharp + @echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp2.1/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp + @chmod +x conformance-csharp + +conformance-php: + @echo "Writing shortcut script conformance-php..." + @echo '#! /bin/sh' > conformance-php + @echo 'php -d auto_prepend_file=autoload.php ./conformance_php.php' >> conformance-php + @chmod +x conformance-php + +conformance-php-c: + @echo "Writing shortcut script conformance-php-c..." + @echo '#! /bin/sh' > conformance-php-c + @echo 'php -dextension=../php/ext/google/protobuf/modules/protobuf.so ./conformance_php.php' >> conformance-php-c + @chmod +x conformance-php-c + +# Targets for actually running tests. +test_cpp: protoc_middleman conformance-test-runner conformance-cpp + ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt --text_format_failure_list text_format_failure_list_cpp.txt ./conformance-cpp + +test_java: protoc_middleman conformance-test-runner conformance-java + ./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt --text_format_failure_list text_format_failure_list_java.txt ./conformance-java + +test_java_lite: protoc_middleman conformance-test-runner conformance-java-lite + ./conformance-test-runner --enforce_recommended ./conformance-java-lite + +test_csharp: protoc_middleman conformance-test-runner conformance-csharp + ./conformance-test-runner --enforce_recommended --failure_list failure_list_csharp.txt --text_format_failure_list text_format_failure_list_csharp.txt ./conformance-csharp + +test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) + RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt --text_format_failure_list text_format_failure_list_ruby.txt ./conformance_ruby.rb + +test_php: protoc_middleman conformance-test-runner conformance-php $(other_language_protoc_outputs) + ./conformance-test-runner --enforce_recommended --failure_list failure_list_php.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php + +test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) + ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c + +# These depend on library paths being properly set up. The easiest way to +# run them is to just use "tox" from the python dir. +test_python: protoc_middleman conformance-test-runner + VERSION="$(shell python --version 2>&1)"; \ + if [[ "$$VERSION" == "Python 2.7"* ]]; then \ + echo "Using Python 2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python_2.7.txt ./conformance_python.py; \ + else \ + echo "Using Python >2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py; \ + fi + +test_python_cpp: protoc_middleman conformance-test-runner + VERSION="$(shell python --version 2>&1)"; \ + if [[ "$$VERSION" == "Python 2.7"* ]]; then \ + echo "Using Python 2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp_2.7.txt ./conformance_python.py; \ + else \ + echo "Using Python >2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp.txt ./conformance_python.py; \ + fi + +test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) + NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js + +@OBJC_CONFORMANCE_TEST_TRUE@test_objc: protoc_middleman conformance-test-runner conformance-objc +@OBJC_CONFORMANCE_TEST_TRUE@ ./conformance-test-runner --enforce_recommended --failure_list failure_list_objc.txt ./conformance-objc + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/conformance/autoload.php b/conformance/autoload.php deleted file mode 100644 index 0f49aecb16aede62ec3b8a0167ac061b7483b25d..0000000000000000000000000000000000000000 --- a/conformance/autoload.php +++ /dev/null @@ -1,21 +0,0 @@ -{"String", "Bytes"}) { + const std::string field_name = + field_type == "String" ? "optional_string" : "optional_bytes"; + RunValidTextFormatTest( + StrCat("StringLiteralConcat", field_type), REQUIRED, + StrCat(field_name, ": 'first' \"second\"\n'third'")); + RunValidTextFormatTest( + StrCat("StringLiteralBasicEscapes", field_type), REQUIRED, + StrCat(field_name, ": '\\a\\b\\f\\n\\r\\t\\v\\?\\\\\\'\\\"'")); + RunValidTextFormatTest( + StrCat("StringLiteralOctalEscapes", field_type), REQUIRED, + StrCat(field_name, ": '\\341\\210\\264'")); + RunValidTextFormatTest(StrCat("StringLiteralHexEscapes", field_type), + REQUIRED, + StrCat(field_name, ": '\\xe1\\x88\\xb4'")); + RunValidTextFormatTest( + StrCat("StringLiteralShortUnicodeEscape", field_type), + RECOMMENDED, StrCat(field_name, ": '\\u1234'")); + RunValidTextFormatTest( + StrCat("StringLiteralLongUnicodeEscapes", field_type), + RECOMMENDED, StrCat(field_name, ": '\\U00001234\\U00010437'")); + // String literals don't include line feeds. + ExpectParseFailure(StrCat("StringLiteralIncludesLF", field_type), + REQUIRED, + StrCat(field_name, ": 'first line\nsecond line'")); + // Unicode escapes don't include code points that lie beyond the planes + // (> 0x10ffff). + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeTooLarge", field_type), + REQUIRED, StrCat(field_name, ": '\\U00110000'")); + // Unicode escapes don't include surrogates. + ExpectParseFailure( + StrCat("StringLiteralShortUnicodeEscapeSurrogatePair", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\ud801\\udc37'")); + ExpectParseFailure( + StrCat("StringLiteralShortUnicodeEscapeSurrogateFirstOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\ud800'")); + ExpectParseFailure( + StrCat("StringLiteralShortUnicodeEscapeSurrogateSecondOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\udc00'")); + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeSurrogateFirstOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000d800'")); + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeSurrogateSecondOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000dc00'")); + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeSurrogatePair", field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000d801\\U00000dc37'")); + ExpectParseFailure( + StrCat("StringLiteralUnicodeEscapeSurrogatePairLongShort", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000d801\\udc37'")); + ExpectParseFailure( + StrCat("StringLiteralUnicodeEscapeSurrogatePairShortLong", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\ud801\\U0000dc37'")); + + // The following method depend on the type of field, as strings have extra + // validation. + const auto test_method = + field_type == "String" + ? &TextFormatConformanceTestSuite::ExpectParseFailure + : &TextFormatConformanceTestSuite::RunValidTextFormatTest; + + // String fields reject invalid UTF-8 byte sequences; bytes fields don't. + (this->*test_method)(StrCat(field_type, "FieldBadUTF8Octal"), + REQUIRED, StrCat(field_name, ": '\\300'")); + (this->*test_method)(StrCat(field_type, "FieldBadUTF8Hex"), REQUIRED, + StrCat(field_name, ": '\\xc0'")); + } + // Group fields RunValidTextFormatTestProto2("GroupFieldNoColon", REQUIRED, "Data { group_int32: 1 }"); diff --git a/conformance/text_format_failure_list_csharp.txt b/conformance/text_format_failure_list_csharp.txt deleted file mode 100644 index 404b64a58431380c2d64fe8c0b108ec435250ffb..0000000000000000000000000000000000000000 --- a/conformance/text_format_failure_list_csharp.txt +++ /dev/null @@ -1,8 +0,0 @@ -Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.GroupUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.MessageUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Print.TextFormatOutput diff --git a/conformance/text_format_failure_list_java.txt b/conformance/text_format_failure_list_java.txt deleted file mode 100644 index 81433b441a4ecafd75781c7003ea9f4f94444d92..0000000000000000000000000000000000000000 --- a/conformance/text_format_failure_list_java.txt +++ /dev/null @@ -1,6 +0,0 @@ -Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput -Required.Proto3.TextFormatInput.AnyField.ProtobufOutput -Required.Proto3.TextFormatInput.AnyField.TextFormatOutput diff --git a/conformance/text_format_failure_list_php.txt b/conformance/text_format_failure_list_php.txt deleted file mode 100644 index 404b64a58431380c2d64fe8c0b108ec435250ffb..0000000000000000000000000000000000000000 --- a/conformance/text_format_failure_list_php.txt +++ /dev/null @@ -1,8 +0,0 @@ -Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.GroupUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.MessageUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Print.TextFormatOutput diff --git a/conformance/text_format_failure_list_python.txt b/conformance/text_format_failure_list_python.txt deleted file mode 100644 index b2db95e7de3ffe8440a3896efe7fe88a007a8a71..0000000000000000000000000000000000000000 --- a/conformance/text_format_failure_list_python.txt +++ /dev/null @@ -1,5 +0,0 @@ -# This is the list of text format conformance tests that are known to fail right -# now. -# TODO: These should be fixed. -Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput -Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput diff --git a/conformance/text_format_failure_list_ruby.txt b/conformance/text_format_failure_list_ruby.txt deleted file mode 100644 index 404b64a58431380c2d64fe8c0b108ec435250ffb..0000000000000000000000000000000000000000 --- a/conformance/text_format_failure_list_ruby.txt +++ /dev/null @@ -1,8 +0,0 @@ -Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.GroupUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.MessageUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Print.TextFormatOutput -Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput -Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Print.TextFormatOutput diff --git a/conformance/third_party/jsoncpp/json.h b/conformance/third_party/jsoncpp/json.h index 5639c92451b4dc4ef3e40495883812ecd336e3e9..373ec98bde97a54249aee48d8714380f3bdef820 100644 --- a/conformance/third_party/jsoncpp/json.h +++ b/conformance/third_party/jsoncpp/json.h @@ -1371,7 +1371,7 @@ public: */ std::string getFormattedErrorMessages() const; - /** \brief Returns a vector of structured errors encounted while parsing. + /** \brief Returns a vector of structured errors encountered while parsing. * \return A (possibly empty) vector of StructuredError objects. Currently * only one error can be returned, but the caller should tolerate * multiple @@ -1867,7 +1867,7 @@ private: * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * - * If the Value have comments then they are outputed according to their + * If the Value have comments then they are outputted according to their *#CommentPlacement. * * \sa Reader, Value, Value::setComment() @@ -1928,7 +1928,7 @@ private: * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * - * If the Value have comments then they are outputed according to their + * If the Value have comments then they are outputted according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. diff --git a/conformance/third_party/jsoncpp/jsoncpp.cpp b/conformance/third_party/jsoncpp/jsoncpp.cpp index d313d0563cdfca84671d6e417f946df1e2348aa8..78919eac0f0c769e914042f75a15f326393dedcb 100644 --- a/conformance/third_party/jsoncpp/jsoncpp.cpp +++ b/conformance/third_party/jsoncpp/jsoncpp.cpp @@ -142,7 +142,7 @@ enum { typedef char UIntToStringBuffer[uintToStringBufferSize]; /** Converts an unsigned integer to string. - * @param value Unsigned interger to convert to string + * @param value Unsigned integer to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ diff --git a/csharp/.editorconfig b/csharp/.editorconfig deleted file mode 100644 index a2bf78c3318ac05a355b8447ae47965add091d61..0000000000000000000000000000000000000000 --- a/csharp/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -# Remove the line below if you want to inherit .editorconfig settings from higher directories -root = true - -# C# files -[*.cs] - -#### Core EditorConfig Options #### - -# Indentation and spacing -indent_size = 4 -indent_style = space -tab_width = 4 - -# New line preferences -end_of_line = lf -insert_final_newline = false -trim_trailing_whitespace = true - -[*.cs] -csharp_space_after_cast = true diff --git a/csharp/.gitignore b/csharp/.gitignore index 56ac1494d63a7f37ad27de8c6aa7a8af36a5567d..d0d7ae04f73b919155ff720f39e4e04288872155 100644 --- a/csharp/.gitignore +++ b/csharp/.gitignore @@ -18,7 +18,6 @@ lib/NUnit # Untracked files # .vs -.cr *.user *.suo *.nupkg @@ -33,8 +32,3 @@ lib/protoc.exe # Benchmark output BenchmarkDotNet.Artifacts/ - -# Reinstate generated code for test files -!any_test.pb.* -!map*unittest.pb.* -!unittest*.pb.* diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel deleted file mode 100644 index 481a492cc960727bec300285dad38f660fe88158..0000000000000000000000000000000000000000 --- a/csharp/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -# Protobuf C# runtime -# -# See also code generation logic under /src/google/protobuf/compiler/csharp. - -load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") -load("//build_defs:internal_shell.bzl", "inline_sh_test") -load("//conformance:defs.bzl", "conformance_test") - -################################################################################ -# Tests -################################################################################ - -conformance_test( - name = "conformance_test", - failure_list = "//conformance:failure_list_csharp.txt", - testee = "//conformance:conformance_csharp", - text_format_failure_list = "//conformance:text_format_failure_list_csharp.txt", -) - -################################################################################ -# CSharp Runtime -################################################################################ - -filegroup( - name = "srcs", - srcs = glob( - [ - "keys/*", - "protos/*", - "src/**/*.cs*", # .cs and .csproj - ], - exclude = [ - # Exclude generated files. - "src/*/obj/**/*", - ], - ) + [ - "src/Directory.Build.props", - "src/Google.Protobuf.Test/testprotos.pb", - "src/Google.Protobuf.sln", - ], - visibility = [ - "//conformance:__subpackages__", - "//csharp:__subpackages__", - ], -) - -filegroup( - name = "wkt_cs_srcs", - srcs = [ - "src/Google.Protobuf/Reflection/Descriptor.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Any.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Api.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Duration.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Empty.pb.cs", - "src/Google.Protobuf/WellKnownTypes/FieldMask.pb.cs", - "src/Google.Protobuf/WellKnownTypes/SourceContext.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Struct.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Timestamp.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Type.pb.cs", - "src/Google.Protobuf/WellKnownTypes/Wrappers.pb.cs", - ], - visibility = ["//src/google/protobuf/compiler/csharp:__pkg__"], -) - -inline_sh_test( - name = "tests", - srcs = [ - "src/Google.Protobuf.sln", - ":srcs", - "//conformance:conformance_csharp_proto", - "//csharp/src/Google.Protobuf.Conformance:srcs", - ], - cmd = """ - cp $(rootpath //conformance:conformance_csharp_proto) `dirname $(location src/Google.Protobuf.sln)`/Google.Protobuf.Conformance/ - pushd `dirname $(location src/Google.Protobuf.sln)`/.. - dotnet restore src/Google.Protobuf.sln - dotnet build -c Release src/Google.Protobuf.sln - dotnet test -c Release -f net6.0 src/Google.Protobuf.Test/Google.Protobuf.Test.csproj - popd - """, -) - -################################################################################ -# Distribution files -################################################################################ - -pkg_files( - name = "dist_files", - srcs = [ - ".editorconfig", - ".gitignore", - "BUILD.bazel", - "CHANGES.txt", - "Google.Protobuf.Tools.nuspec", - "Google.Protobuf.Tools.targets", - "NuGet.Config", - "README.md", - "build_packages.bat", - "build_release.sh", - "build_tools.sh", - "buildall.bat", - "buildall.sh", - "generate_protos.sh", - "install_dotnet_sdk.ps1", - ":srcs", - "//csharp/src/Google.Protobuf.Conformance:dist_files", - ], - strip_prefix = strip_prefix.from_root(""), - visibility = ["//pkg:__pkg__"], -) - -sh_binary( - name = "release", - srcs = ["build_release.sh"], - args = ["$(location build_release.sh)"], -) diff --git a/csharp/CHANGES.txt b/csharp/CHANGES.txt index 4edc569aff657958d6946c5648eb5ff034d51ec5..8574b7c4a35db5e515cb3a60ae946e39dcd462e5 100644 --- a/csharp/CHANGES.txt +++ b/csharp/CHANGES.txt @@ -72,7 +72,7 @@ Features: custom implementation of writers with both speed and size optimizations. - Addition of the "Google.ProtoBuffers.Serialization" assembly to support reading and writing messages to/from XML, JSON, IDictionary<,> and others. -- Several performance related fixes and tweaks +- Several performance related fixes and tweeks - Issue 3: Add option to mark generated code with attribute - Issue 20: Support for decorating classes [Serializable] - Issue 21: Decorate fields with [deprecated=true] as [System.Obsolete] @@ -145,4 +145,4 @@ RELEASE NOTES - Version 0.9.0 - Initial release -=============================================================================== +=============================================================================== \ No newline at end of file diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index ea87941499b01435ca9c28ff3b69317a75b731ba..0fb4b15093bdc99b9a1598637bd65d2f699a6712 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -5,10 +5,10 @@ Google Protocol Buffers tools Tools for Protocol Buffers - Google's data interchange format. See project site for more info. - 3.25.2 + 3.14.0 Google Inc. protobuf-packages - https://github.com/protocolbuffers/protobuf/blob/main/LICENSE + https://github.com/protocolbuffers/protobuf/blob/master/LICENSE https://github.com/protocolbuffers/protobuf false Tools for Protocol Buffers @@ -16,22 +16,22 @@ Protocol Buffers Binary Serialization Format Google proto proto3 - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/csharp/Google.Protobuf.Tools.targets b/csharp/Google.Protobuf.Tools.targets index 4dcb8f95cb37dafd8a1bfc4b71d2656f453c3f58..682e11b024f21d80f6a78802eeba82b9d5eb8df3 100644 --- a/csharp/Google.Protobuf.Tools.targets +++ b/csharp/Google.Protobuf.Tools.targets @@ -1,11 +1,11 @@ - - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/../tools/')) - $([System.IO.Path]::GetFullPath('$(protoc_tools)/linux_x64/protoc')) - $([System.IO.Path]::GetFullPath('$(protoc_tools)/linux_x86/protoc')) - $([System.IO.Path]::GetFullPath('$(protoc_tools)/macosx_x64/protoc')) - $([System.IO.Path]::GetFullPath('$(protoc_tools)/macosx_x86/protoc')) - $([System.IO.Path]::GetFullPath('$(protoc_tools)/windows_x64/protoc.exe')) - $([System.IO.Path]::GetFullPath('$(protoc_tools)/windows_x86/protoc.exe')) - - + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)/../tools/')) + $([System.IO.Path]::GetFullPath('$(protoc_tools)/linux_x64/protoc')) + $([System.IO.Path]::GetFullPath('$(protoc_tools)/linux_x86/protoc')) + $([System.IO.Path]::GetFullPath('$(protoc_tools)/macosx_x64/protoc')) + $([System.IO.Path]::GetFullPath('$(protoc_tools)/macosx_x86/protoc')) + $([System.IO.Path]::GetFullPath('$(protoc_tools)/windows_x64/protoc.exe')) + $([System.IO.Path]::GetFullPath('$(protoc_tools)/windows_x86/protoc.exe')) + + diff --git a/csharp/NuGet.Config b/csharp/NuGet.Config deleted file mode 100644 index b04b00689fcb4f213d09265986ea5bae02967e48..0000000000000000000000000000000000000000 --- a/csharp/NuGet.Config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/csharp/README.md b/csharp/README.md index 02abb7cee0e03f5ce9199dcf4bfd82d685fc3dd5..9aab782da19a926a3bb41ecb973465fdcaf63cc7 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -16,32 +16,36 @@ To generate C# files from your `.proto` files, invoke `protoc` with the Supported platforms =================== -The runtime library is built as a class library, supporting targets of: +The runtime library is built as a portable class library, supporting: -- .NET 4.5+ (`net45`) -- .NET Standard 1.1 and 2.0 (`netstandard1.1` and `netstandard2.0`) -- .NET 5+ (`net50`) +- .NET 4.5 +- Windows 8 +- Windows Phone Silverlight 8 +- Windows Phone 8.1 +- .NET Core You should be able to use Protocol Buffers in Visual Studio 2012 and all later versions. This includes all code generated by `protoc`, -which only uses features from C# 3 and earlier. When compiling generated -code with old compilers (before C# 7.2) you need to define the -`GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE` symbol in your project -so that the generated classes don't implement `IBufferMessage`, which uses -`ref struct` types. +which only uses features from C# 3 and earlier. Building ======== -Open the `src/Google.Protobuf.sln` solution in Visual Studio 2022 or +Open the `src/Google.Protobuf.sln` solution in Visual Studio 2017 or later. Although *users* of this project are only expected to have Visual Studio 2012 or later, *developers* of the library are required to -have Visual Studio 2022 or later, as the library uses C# 10 features -in its implementation and runs tests under .NET 6. These features -have no impact when using the compiled code - they're only relevant -when building the `Google.Protobuf` assembly. +have Visual Studio 2017 or later, as the library uses C# 6 features +in its implementation, as well as the new Visual Studio 2017 csproj +format. These features have no impact when using the compiled code - +they're only relevant when building the `Google.Protobuf` assembly. + +In order to run and debug the AddressBook example in the IDE, you must +install the optional component, ".Net Core 1.0 - 1.1 development tools +for Web" (as it's labelled in current versions of the VS2017 +installer), above and beyond the main .NET Core cross-platform +development feature. Testing ======= @@ -52,11 +56,20 @@ run using the Visual Studio Test Explorer or `dotnet test`. .NET 3.5 ======== -We don't support .NET 3.5. It *used* to be feasible to build this library -targeting .NET 3.5, but a number of changes requiring newer runtime/framework -features have been added over time. While it would no doubt be *possible* to -rework the current implementation to allow most of the functionality to be built -in .NET 3.5, this would create an undue maintenance burden. +We don't officially support .NET 3.5. However, there has been some effort +to make enabling .NET 3.5 support relatively painless in case you require it. +There's no guarantee that this will continue in the future, so rely on .NET +3.5 support at your peril. + +To enable .NET 3.5 support, you must edit the `TargetFrameworks` elements of +[src/Google.Protobuf/Google.Protobuf.csproj](src/Google.Protobuf/Google.Protobuf.csproj) +(and [src/Google.Protobuf.Test/Google.Protobuf.Test.csproj](src/Google.Protobuf.Test/Google.Protobuf.Test.csproj) +if you want to run the unit tests): + +Open the .csproj file in a text editor and simply add `net35` to the list of +target frameworks, noting that the `TargetFrameworks` element appears twice in +the file (once in the first `PropertyGroup` element, and again in the second +`PropertyGroup` element, i.e., the one with the conditional). History of C# protobufs ======================= @@ -68,9 +81,9 @@ and maintained by Google. All the development will be done in open, under this r The previous project differs from this project in a number of ways: -- The old code only supported proto2; the new code initially only supported +- The old code only supported proto2; the new code only supports proto3 (so no unknown fields, no required/optional distinction, no -extensions); since then proto2 support has been added +extensions) - The old code was based on immutable message types and builders for them - The old code did not support maps or `oneof` diff --git a/csharp/build_packages.bat b/csharp/build_packages.bat index 9e68229037f5ab0448acb7c93a144ac76fb35f32..d7205659f103a4655a606bbfe0adfe15eab69d78 100644 --- a/csharp/build_packages.bat +++ b/csharp/build_packages.bat @@ -1,7 +1,7 @@ @rem Builds Google.Protobuf NuGet packages dotnet restore src/Google.Protobuf.sln -dotnet pack -c Release src/Google.Protobuf.sln -p:ContinuousIntegrationBuild=true || goto :error +dotnet pack -c Release src/Google.Protobuf.sln || goto :error goto :EOF diff --git a/csharp/build_release.sh b/csharp/build_release.sh deleted file mode 100644 index 8a641b21b32ae9089bd778f96f976ff7104ef34d..0000000000000000000000000000000000000000 --- a/csharp/build_release.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -cd $(dirname $(readlink $BASH_SOURCE)) - -# Disable some unwanted dotnet options -set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true -set DOTNET_CLI_TELEMETRY_OPTOUT=true - -# Builds Google.Protobuf NuGet packages -dotnet restore -s /lib/csharp/ src/Google.Protobuf/Google.Protobuf.csproj -dotnet pack --no-restore -c Release src/Google.Protobuf.sln -p:ContinuousIntegrationBuild=true diff --git a/csharp/buildall.sh b/csharp/buildall.sh index c9525eb0e94a5401400eac4c0a3ed4ff67e77264..43b5ac3ffb29adad76c19bdc629725766811c686 100644 --- a/csharp/buildall.sh +++ b/csharp/buildall.sh @@ -10,8 +10,8 @@ dotnet restore $SRC/Google.Protobuf.sln dotnet build -c $CONFIG $SRC/Google.Protobuf.sln echo Running tests. -# Only test net6.0, which uses the .NET runtime. +# Only test netcoreapp2.1, which uses the .NET Core runtime. # If we want to test the .NET 4.5 version separately, we could # run Mono explicitly. However, we don't have any differences between # the .NET 4.5 and netstandard2.1 assemblies. -dotnet test -c $CONFIG -f net6.0 $SRC/Google.Protobuf.Test/Google.Protobuf.Test.csproj +dotnet test -c $CONFIG -f netcoreapp2.1 $SRC/Google.Protobuf.Test/Google.Protobuf.Test.csproj diff --git a/csharp/compatibility_tests/v3.0.0/BUILD.bazel b/csharp/compatibility_tests/v3.0.0/BUILD.bazel deleted file mode 100644 index f7c1b26666bdfe4eae6c1b5b2ec46fb1ed29521f..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -load("//build_defs:internal_shell.bzl", "inline_sh_test") - -# Run csharp compatibility test between 3.0.0 and the current version. -inline_sh_test( - name = "tests", - srcs = ["test.sh"], - cmd = "$(location test.sh) 3.0.0 $(rootpath //:protoc)", - tools = ["//:protoc"], - deps = glob([ - "src/**/*.cs*", # .cs and .csproj - "protos/**/*.proto", - ]) + [ - "//:well_known_protos", - "//csharp:srcs", - ], -) diff --git a/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto b/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto deleted file mode 100644 index 1ffc73573df440429a6cfc49bc1c727bf69495e5..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto +++ /dev/null @@ -1,133 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto3"; - -// These proto descriptors have at one time been reported as an issue or defect. -// They are kept here to replicate the issue, and continue to verify the fix. - -// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified -option csharp_namespace = "UnitTest.Issues.TestProtos"; - -package unittest_issues; -option optimize_for = SPEED; - -// Issue 307: when generating doubly-nested types, any references -// should be of the form A.Types.B.Types.C. -message Issue307 { - message NestedOnce { - message NestedTwice { - } - } -} - -// Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 -// New issue 309: https://github.com/protocolbuffers/protobuf/issues/309 - -// message A { -// optional int32 _A = 1; -// } - -// message B { -// optional int32 B_ = 1; -// } - -//message AB { -// optional int32 a_b = 1; -//} - -// Similar issue with numeric names -// Java code failed too, so probably best for this to be a restriction. -// See https://github.com/protocolbuffers/protobuf/issues/308 -// message NumberField { -// optional int32 _01 = 1; -// } - -// issue 19 - negative enum values - -enum NegativeEnum { - NEGATIVE_ENUM_ZERO = 0; - FiveBelow = -5; - MinusOne = -1; -} - -message NegativeEnumMessage { - NegativeEnum value = 1; - repeated NegativeEnum values = 2 [packed = false]; - repeated NegativeEnum packed_values = 3 [packed=true]; -} - -// Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21 -// Decorate fields with [deprecated=true] as [System.Obsolete] - -message DeprecatedChild { -} - -enum DeprecatedEnum { - DEPRECATED_ZERO = 0; - one = 1; -} - -message DeprecatedFieldsMessage { - int32 PrimitiveValue = 1 [deprecated = true]; - repeated int32 PrimitiveArray = 2 [deprecated = true]; - - DeprecatedChild MessageValue = 3 [deprecated = true]; - repeated DeprecatedChild MessageArray = 4 [deprecated = true]; - - DeprecatedEnum EnumValue = 5 [deprecated = true]; - repeated DeprecatedEnum EnumArray = 6 [deprecated = true]; -} - -// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 -message ItemField { - int32 item = 1; -} - -message ReservedNames { - // Force a nested type called Types - message SomeNestedType { - } - - int32 types = 1; - int32 descriptor = 2; -} - -message TestJsonFieldOrdering { - // These fields are deliberately not declared in numeric - // order, and the oneof fields aren't contiguous either. - // This allows for reasonably robust tests of JSON output - // ordering. - // TestFieldOrderings in unittest_proto3.proto is similar, - // but doesn't include oneofs. - // TODO: Consider adding oneofs to TestFieldOrderings, although - // that will require fixing other tests in multiple platforms. - // Alternatively, consider just adding this to - // unittest_proto3.proto if multiple platforms want it. - - int32 plain_int32 = 4; - - oneof o1 { - string o1_string = 2; - int32 o1_int32 = 5; - } - - string plain_string = 1; - - oneof o2 { - int32 o2_int32 = 6; - string o2_string = 3; - } - -} - -message TestJsonName { - // Message for testing the effects for of the json_name option - string name = 1; - string description = 2 [json_name = "desc"]; - string guid = 3 [json_name = "exid"]; -} diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/map_unittest_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/map_unittest_proto3.proto deleted file mode 100644 index a4a4dea91b4f789415614815d29dab52f28e433e..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/map_unittest_proto3.proto +++ /dev/null @@ -1,97 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -// This file is mostly equivalent to map_unittest.proto, but imports -// unittest_proto3.proto instead of unittest.proto, so that it only -// uses proto3 messages. This makes it suitable for testing -// implementations which only support proto3. -// The TestRequiredMessageMap message has been removed as there are no -// required fields in proto3. -syntax = "proto3"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Protobuf.TestProtos"; - -import "google/protobuf/unittest_proto3.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In map_test_util.h we do "using namespace unittest = protobuf_unittest". -package protobuf_unittest; - -// Tests maps. -message TestMap { - map map_int32_int32 = 1; - map map_int64_int64 = 2; - map map_uint32_uint32 = 3; - map map_uint64_uint64 = 4; - map map_sint32_sint32 = 5; - map map_sint64_sint64 = 6; - map map_fixed32_fixed32 = 7; - map map_fixed64_fixed64 = 8; - map map_sfixed32_sfixed32 = 9; - map map_sfixed64_sfixed64 = 10; - map map_int32_float = 11; - map map_int32_double = 12; - map map_bool_bool = 13; - map map_string_string = 14; - map map_int32_bytes = 15; - map map_int32_enum = 16; - map map_int32_foreign_message = 17; -} - -message TestMapSubmessage { - TestMap test_map = 1; -} - -message TestMessageMap { - map map_int32_message = 1; -} - -// Two map fields share the same entry default instance. -message TestSameTypeMap { - map map1 = 1; - map map2 = 2; -} - -enum MapEnum { - MAP_ENUM_FOO = 0; - MAP_ENUM_BAR = 1; - MAP_ENUM_BAZ = 2; -} - -message TestArenaMap { - map map_int32_int32 = 1; - map map_int64_int64 = 2; - map map_uint32_uint32 = 3; - map map_uint64_uint64 = 4; - map map_sint32_sint32 = 5; - map map_sint64_sint64 = 6; - map map_fixed32_fixed32 = 7; - map map_fixed64_fixed64 = 8; - map map_sfixed32_sfixed32 = 9; - map map_sfixed64_sfixed64 = 10; - map map_int32_float = 11; - map map_int32_double = 12; - map map_bool_bool = 13; - map map_int32_enum = 14; - map map_int32_foreign_message = 15; -} - -// Previously, message containing enum called Type cannot be used as value of -// map field. -message MessageContainingEnumCalledType { - enum Type { - TYPE_FOO = 0; - } - map type = 1; -} - -// Previously, message cannot contain map field called "entry". -message MessageContainingMapCalledEntry { - map entry = 1; -} diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_proto3.proto deleted file mode 100644 index 0a5dba10d2b925316d5a76006069a3bd5d588a81..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_proto3.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which is imported by unittest_proto3.proto to test importing. - -syntax = "proto3"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do -// "using namespace unittest_import = protobuf_unittest_import". -package protobuf_unittest_import; - -option optimize_for = SPEED; -option cc_enable_arenas = true; - -// Exercise the java_package option. -option java_package = "com.google.protobuf.test"; -option csharp_namespace = "Google.Protobuf.TestProtos"; - -// Do not set a java_outer_classname here to verify that Proto2 works without -// one. - -// Test public import -import public "google/protobuf/unittest_import_public_proto3.proto"; - -message ImportMessage { - int32 d = 1; -} - -enum ImportEnum { - IMPORT_ENUM_UNSPECIFIED = 0; - IMPORT_FOO = 7; - IMPORT_BAR = 8; - IMPORT_BAZ = 9; -} - diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_public_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_public_proto3.proto deleted file mode 100644 index dd239b95aaa82e57d80fafa91628e1ce209938e5..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_public_proto3.proto +++ /dev/null @@ -1,19 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -// Author: liujisi@google.com (Pherl Liu) - -syntax = "proto3"; - -package protobuf_unittest_import; - -option java_package = "com.google.protobuf.test"; -option csharp_namespace = "Google.Protobuf.TestProtos"; - -message PublicImportMessage { - int32 e = 1; -} diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_proto3.proto deleted file mode 100644 index 8ec75d2e3d9fd567fd88712181c5c31a5058076d..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_proto3.proto +++ /dev/null @@ -1,365 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file we will use for unit testing. - -syntax = "proto3"; - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; // auto-added -option cc_enable_arenas = true; -option csharp_namespace = "Google.Protobuf.TestProtos"; - -import "google/protobuf/unittest_import_proto3.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do "using namespace unittest = protobuf_unittest". -package protobuf_unittest; - -// Protos optimized for SPEED use a strict superset of the generated code -// of equivalent ones optimized for CODE_SIZE, so we should optimize all our -// tests for speed unless explicitly testing code size optimization. -option optimize_for = SPEED; - -option java_outer_classname = "UnittestProto"; - -// This proto includes every type of field in both singular and repeated -// forms. -message TestAllTypes { - message NestedMessage { - // The field name "b" fails to compile in proto1 because it conflicts with - // a local variable named "b" in one of the generated methods. Doh. - // This file needs to compile in proto1 to test backwards-compatibility. - int32 bb = 1; - } - - enum NestedEnum { - NESTED_ENUM_UNSPECIFIED = 0; - FOO = 1; - BAR = 2; - BAZ = 3; - NEG = -1; // Intentionally negative. - } - - // Singular - int32 single_int32 = 1; - int64 single_int64 = 2; - uint32 single_uint32 = 3; - uint64 single_uint64 = 4; - sint32 single_sint32 = 5; - sint64 single_sint64 = 6; - fixed32 single_fixed32 = 7; - fixed64 single_fixed64 = 8; - sfixed32 single_sfixed32 = 9; - sfixed64 single_sfixed64 = 10; - float single_float = 11; - double single_double = 12; - bool single_bool = 13; - string single_string = 14; - bytes single_bytes = 15; - - NestedMessage single_nested_message = 18; - ForeignMessage single_foreign_message = 19; - protobuf_unittest_import.ImportMessage single_import_message = 20; - - NestedEnum single_nested_enum = 21; - ForeignEnum single_foreign_enum = 22; - protobuf_unittest_import.ImportEnum single_import_enum = 23; - - // Defined in unittest_import_public.proto - protobuf_unittest_import.PublicImportMessage - single_public_import_message = 26; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; - // Defined in unittest_import_public.proto - repeated protobuf_unittest_import.PublicImportMessage - repeated_public_import_message = 54; - - // For oneof test - oneof oneof_field { - uint32 oneof_uint32 = 111; - NestedMessage oneof_nested_message = 112; - string oneof_string = 113; - bytes oneof_bytes = 114; - } -} - -// This proto includes a recursively nested message. -message NestedTestAllTypes { - NestedTestAllTypes child = 1; - TestAllTypes payload = 2; - repeated NestedTestAllTypes repeated_child = 3; -} - -message TestDeprecatedFields { - int32 deprecated_int32 = 1 [deprecated=true]; -} - -// Define these after TestAllTypes to make sure the compiler can handle -// that. -message ForeignMessage { - int32 c = 1; -} - -enum ForeignEnum { - FOREIGN_UNSPECIFIED = 0; - FOREIGN_FOO = 4; - FOREIGN_BAR = 5; - FOREIGN_BAZ = 6; -} - -message TestReservedFields { - reserved 2, 15, 9 to 11; - reserved "bar", "baz"; -} - - -// Test that we can use NestedMessage from outside TestAllTypes. -message TestForeignNested { - TestAllTypes.NestedMessage foreign_nested = 1; -} - -// Test that really large tag numbers don't break anything. -message TestReallyLargeTagNumber { - // The largest possible tag number is 2^28 - 1, since the wire format uses - // three bits to communicate wire type. - int32 a = 1; - int32 bb = 268435455; -} - -message TestRecursiveMessage { - TestRecursiveMessage a = 1; - int32 i = 2; -} - -// Test that mutual recursion works. -message TestMutualRecursionA { - TestMutualRecursionB bb = 1; -} - -message TestMutualRecursionB { - TestMutualRecursionA a = 1; - int32 optional_int32 = 2; -} - - -// Test an enum that has multiple values with the same number. -enum TestEnumWithDupValue { - TEST_ENUM_WITH_DUP_VALUE_UNSPECIFIED = 0; - option allow_alias = true; - - FOO1 = 1; - BAR1 = 2; - BAZ = 3; - FOO2 = 1; - BAR2 = 2; -} - -// Test an enum with large, unordered values. -enum TestSparseEnum { - TEST_SPARSE_ENUM_UNSPECIFIED = 0; - SPARSE_A = 123; - SPARSE_B = 62374; - SPARSE_C = 12589234; - SPARSE_D = -15; - SPARSE_E = -53452; - // In proto3, value 0 must be the first one specified - // SPARSE_F = 0; - SPARSE_G = 2; -} - -// Test message with CamelCase field names. This violates Protocol Buffer -// standard style. -message TestCamelCaseFieldNames { - int32 PrimitiveField = 1; - string StringField = 2; - ForeignEnum EnumField = 3; - ForeignMessage MessageField = 4; - - repeated int32 RepeatedPrimitiveField = 7; - repeated string RepeatedStringField = 8; - repeated ForeignEnum RepeatedEnumField = 9; - repeated ForeignMessage RepeatedMessageField = 10; -} - - -// We list fields out of order, to ensure that we're using field number and not -// field index to determine serialization order. -message TestFieldOrderings { - string my_string = 11; - int64 my_int = 1; - float my_float = 101; - message NestedMessage { - int64 oo = 2; - // The field name "b" fails to compile in proto1 because it conflicts with - // a local variable named "b" in one of the generated methods. Doh. - // This file needs to compile in proto1 to test backwards-compatibility. - int32 bb = 1; - } - - NestedMessage single_nested_message = 200; -} - -message SparseEnumMessage { - TestSparseEnum sparse_enum = 1; -} - -// Test String and Bytes: string is for valid UTF-8 strings -message OneString { - string data = 1; -} - -message MoreString { - repeated string data = 1; -} - -message OneBytes { - bytes data = 1; -} - -message MoreBytes { - bytes data = 1; -} - -// Test int32, uint32, int64, uint64, and bool are all compatible -message Int32Message { - int32 data = 1; -} - -message Uint32Message { - uint32 data = 1; -} - -message Int64Message { - int64 data = 1; -} - -message Uint64Message { - uint64 data = 1; -} - -message BoolMessage { - bool data = 1; -} - -// Test oneofs. -message TestOneof { - oneof foo { - int32 foo_int = 1; - string foo_string = 2; - TestAllTypes foo_message = 3; - } -} - -// Test messages for packed fields - -message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; -} - -// A message with the same fields as TestPackedTypes, but without packing. Used -// to test packed <-> unpacked wire compatibility. -message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; -} - -message TestRepeatedScalarDifferentTagSizes { - // Parsing repeated fixed size values used to fail. This message needs to be - // used in order to get a tag of the right size; all of the repeated fields - // in TestAllTypes didn't trigger the check. - repeated fixed32 repeated_fixed32 = 12; - // Check for a varint type, just for good measure. - repeated int32 repeated_int32 = 13; - - // These have two-byte tags. - repeated fixed64 repeated_fixed64 = 2046; - repeated int64 repeated_int64 = 2047; - - // Three byte tags. - repeated float repeated_float = 262142; - repeated uint64 repeated_uint64 = 262143; -} - -message TestCommentInjectionMessage { - // */ <- This should not close the generated doc comment - string a = 1; -} - - -// Test that RPC services work. -message FooRequest {} -message FooResponse {} - -message FooClientMessage {} -message FooServerMessage{} - -service TestService { - rpc Foo(FooRequest) returns (FooResponse); - rpc Bar(BarRequest) returns (BarResponse); -} - - -message BarRequest {} -message BarResponse {} - diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_well_known_types.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_well_known_types.proto deleted file mode 100644 index 05f25d6ad9ecbe8d0b1123b0c7c7b253b88b58ea..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_well_known_types.proto +++ /dev/null @@ -1,121 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto3"; - -package protobuf_unittest; - -option csharp_namespace = "Google.Protobuf.TestProtos"; -option java_multiple_files = true; -option java_package = "com.google.protobuf.test"; - -import "google/protobuf/any.proto"; -import "google/protobuf/api.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/source_context.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/type.proto"; -import "google/protobuf/wrappers.proto"; - -// Test that we can include all well-known types. -// Each wrapper type is included separately, as languages -// map handle different wrappers in different ways. -message TestWellKnownTypes { - google.protobuf.Any any_field = 1; - google.protobuf.Api api_field = 2; - google.protobuf.Duration duration_field = 3; - google.protobuf.Empty empty_field = 4; - google.protobuf.FieldMask field_mask_field = 5; - google.protobuf.SourceContext source_context_field = 6; - google.protobuf.Struct struct_field = 7; - google.protobuf.Timestamp timestamp_field = 8; - google.protobuf.Type type_field = 9; - google.protobuf.DoubleValue double_field = 10; - google.protobuf.FloatValue float_field = 11; - google.protobuf.Int64Value int64_field = 12; - google.protobuf.UInt64Value uint64_field = 13; - google.protobuf.Int32Value int32_field = 14; - google.protobuf.UInt32Value uint32_field = 15; - google.protobuf.BoolValue bool_field = 16; - google.protobuf.StringValue string_field = 17; - google.protobuf.BytesValue bytes_field = 18; - // Part of struct, but useful to be able to test separately - google.protobuf.Value value_field = 19; -} - -// A repeated field for each well-known type. -message RepeatedWellKnownTypes { - repeated google.protobuf.Any any_field = 1; - repeated google.protobuf.Api api_field = 2; - repeated google.protobuf.Duration duration_field = 3; - repeated google.protobuf.Empty empty_field = 4; - repeated google.protobuf.FieldMask field_mask_field = 5; - repeated google.protobuf.SourceContext source_context_field = 6; - repeated google.protobuf.Struct struct_field = 7; - repeated google.protobuf.Timestamp timestamp_field = 8; - repeated google.protobuf.Type type_field = 9; - // These don't actually make a lot of sense, but they're not prohibited... - repeated google.protobuf.DoubleValue double_field = 10; - repeated google.protobuf.FloatValue float_field = 11; - repeated google.protobuf.Int64Value int64_field = 12; - repeated google.protobuf.UInt64Value uint64_field = 13; - repeated google.protobuf.Int32Value int32_field = 14; - repeated google.protobuf.UInt32Value uint32_field = 15; - repeated google.protobuf.BoolValue bool_field = 16; - repeated google.protobuf.StringValue string_field = 17; - repeated google.protobuf.BytesValue bytes_field = 18; -} - -message OneofWellKnownTypes { - oneof oneof_field { - google.protobuf.Any any_field = 1; - google.protobuf.Api api_field = 2; - google.protobuf.Duration duration_field = 3; - google.protobuf.Empty empty_field = 4; - google.protobuf.FieldMask field_mask_field = 5; - google.protobuf.SourceContext source_context_field = 6; - google.protobuf.Struct struct_field = 7; - google.protobuf.Timestamp timestamp_field = 8; - google.protobuf.Type type_field = 9; - google.protobuf.DoubleValue double_field = 10; - google.protobuf.FloatValue float_field = 11; - google.protobuf.Int64Value int64_field = 12; - google.protobuf.UInt64Value uint64_field = 13; - google.protobuf.Int32Value int32_field = 14; - google.protobuf.UInt32Value uint32_field = 15; - google.protobuf.BoolValue bool_field = 16; - google.protobuf.StringValue string_field = 17; - google.protobuf.BytesValue bytes_field = 18; - } -} - -// A map field for each well-known type. We only -// need to worry about the value part of the map being the -// well-known types, as messages can't be map keys. -message MapWellKnownTypes { - map any_field = 1; - map api_field = 2; - map duration_field = 3; - map empty_field = 4; - map field_mask_field = 5; - map source_context_field = 6; - map struct_field = 7; - map timestamp_field = 8; - map type_field = 9; - map double_field = 10; - map float_field = 11; - map int64_field = 12; - map uint64_field = 13; - map int32_field = 14; - map uint32_field = 15; - map bool_field = 16; - map string_field = 17; - map bytes_field = 18; -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/ByteStringTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/ByteStringTest.cs deleted file mode 100644 index 245ed2175582cfda24990632fc482d969e3cf4a2..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/ByteStringTest.cs +++ /dev/null @@ -1,148 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Text; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class ByteStringTest - { - [Test] - public void Equality() - { - ByteString b1 = ByteString.CopyFrom(1, 2, 3); - ByteString b2 = ByteString.CopyFrom(1, 2, 3); - ByteString b3 = ByteString.CopyFrom(1, 2, 4); - ByteString b4 = ByteString.CopyFrom(1, 2, 3, 4); - EqualityTester.AssertEquality(b1, b1); - EqualityTester.AssertEquality(b1, b2); - EqualityTester.AssertInequality(b1, b3); - EqualityTester.AssertInequality(b1, b4); - EqualityTester.AssertInequality(b1, null); -#pragma warning disable 1718 // Deliberately calling ==(b1, b1) and !=(b1, b1) - Assert.IsTrue(b1 == b1); - Assert.IsTrue(b1 == b2); - Assert.IsFalse(b1 == b3); - Assert.IsFalse(b1 == b4); - Assert.IsFalse(b1 == null); - Assert.IsTrue((ByteString) null == null); - Assert.IsFalse(b1 != b1); - Assert.IsFalse(b1 != b2); -#pragma warning disable 1718 - Assert.IsTrue(b1 != b3); - Assert.IsTrue(b1 != b4); - Assert.IsTrue(b1 != null); - Assert.IsFalse((ByteString) null != null); - } - - [Test] - public void EmptyByteStringHasZeroSize() - { - Assert.AreEqual(0, ByteString.Empty.Length); - } - - [Test] - public void CopyFromStringWithExplicitEncoding() - { - ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode); - Assert.AreEqual(4, bs.Length); - Assert.AreEqual(65, bs[0]); - Assert.AreEqual(0, bs[1]); - Assert.AreEqual(66, bs[2]); - Assert.AreEqual(0, bs[3]); - } - - [Test] - public void IsEmptyWhenEmpty() - { - Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty); - } - - [Test] - public void IsEmptyWhenNotEmpty() - { - Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty); - } - - [Test] - public void CopyFromByteArrayCopiesContents() - { - byte[] data = new byte[1]; - data[0] = 10; - ByteString bs = ByteString.CopyFrom(data); - Assert.AreEqual(10, bs[0]); - data[0] = 5; - Assert.AreEqual(10, bs[0]); - } - - [Test] - public void ToByteArrayCopiesContents() - { - ByteString bs = ByteString.CopyFromUtf8("Hello"); - byte[] data = bs.ToByteArray(); - Assert.AreEqual((byte)'H', data[0]); - Assert.AreEqual((byte)'H', bs[0]); - data[0] = 0; - Assert.AreEqual(0, data[0]); - Assert.AreEqual((byte)'H', bs[0]); - } - - [Test] - public void CopyFromUtf8UsesUtf8() - { - ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(0xe2, bs[0]); - Assert.AreEqual(0x82, bs[1]); - Assert.AreEqual(0xac, bs[2]); - } - - [Test] - public void CopyFromPortion() - { - byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; - ByteString bs = ByteString.CopyFrom(data, 2, 3); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(2, bs[0]); - Assert.AreEqual(3, bs[1]); - } - - [Test] - public void ToStringUtf8() - { - ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual("\u20ac", bs.ToStringUtf8()); - } - - [Test] - public void ToStringWithExplicitEncoding() - { - ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode); - Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode)); - } - - [Test] - public void FromBase64_WithText() - { - byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; - string base64 = Convert.ToBase64String(data); - ByteString bs = ByteString.FromBase64(base64); - Assert.AreEqual(data, bs.ToByteArray()); - } - - [Test] - public void FromBase64_Empty() - { - // Optimization which also fixes issue 61. - Assert.AreSame(ByteString.Empty, ByteString.FromBase64("")); - } - } -} \ No newline at end of file diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs deleted file mode 100644 index 6cacd805837080434657926abc95ba2929d0bcb7..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using NUnit.Framework; - -namespace Google.Protobuf -{ - internal static class CodedInputStreamExtensions - { - public static void AssertNextTag(this CodedInputStream input, uint expectedTag) - { - uint tag = input.ReadTag(); - Assert.AreEqual(expectedTag, tag); - } - - public static T ReadMessage(this CodedInputStream stream, MessageParser parser) - where T : IMessage - { - var message = parser.CreateTemplate(); - stream.ReadMessage(message); - return message; - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs deleted file mode 100644 index 157ef4f095f945b073413e888f6c2f43ba686e73..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs +++ /dev/null @@ -1,575 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using Google.Protobuf.TestProtos; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class CodedInputStreamTest - { - /// - /// Helper to construct a byte array from a bunch of bytes. The inputs are - /// actually ints so that I can use hex notation and not get stupid errors - /// about precision. - /// - private static byte[] Bytes(params int[] bytesAsInts) - { - byte[] bytes = new byte[bytesAsInts.Length]; - for (int i = 0; i < bytesAsInts.Length; i++) - { - bytes[i] = (byte) bytesAsInts[i]; - } - return bytes; - } - - /// - /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() - /// - private static void AssertReadVarint(byte[] data, ulong value) - { - CodedInputStream input = new CodedInputStream(data); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); - - input = new CodedInputStream(data); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); - - // Try different block sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); - - input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); - } - - // Try reading directly from a MemoryStream. We want to verify that it - // doesn't read past the end of the input, so write an extra byte - this - // lets us test the position at the end. - MemoryStream memoryStream = new MemoryStream(); - memoryStream.Write(data, 0, data.Length); - memoryStream.WriteByte(0); - memoryStream.Position = 0; - Assert.AreEqual((uint) value, CodedInputStream.ReadRawVarint32(memoryStream)); - Assert.AreEqual(data.Length, memoryStream.Position); - } - - /// - /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and - /// expects them to fail with an InvalidProtocolBufferException whose - /// description matches the given one. - /// - private static void AssertReadVarintFailure(InvalidProtocolBufferException expected, byte[] data) - { - CodedInputStream input = new CodedInputStream(data); - var exception = Assert.Throws(() => input.ReadRawVarint32()); - Assert.AreEqual(expected.Message, exception.Message); - - input = new CodedInputStream(data); - exception = Assert.Throws(() => input.ReadRawVarint64()); - Assert.AreEqual(expected.Message, exception.Message); - - // Make sure we get the same error when reading directly from a Stream. - exception = Assert.Throws(() => CodedInputStream.ReadRawVarint32(new MemoryStream(data))); - Assert.AreEqual(expected.Message, exception.Message); - } - - [Test] - public void ReadVarint() - { - AssertReadVarint(Bytes(0x00), 0); - AssertReadVarint(Bytes(0x01), 1); - AssertReadVarint(Bytes(0x7f), 127); - // 14882 - AssertReadVarint(Bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); - // 2961488830 - AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - AssertReadVarint(Bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49)); - // 11964378330978735131 - AssertReadVarint(Bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), - (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bUL << 28) | (0x56UL << 35) | (0x00UL << 42) | - (0x05UL << 49) | (0x26UL << 56) | (0x01UL << 63)); - - // Failures - AssertReadVarintFailure( - InvalidProtocolBufferException.MalformedVarint(), - Bytes(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x00)); - AssertReadVarintFailure( - InvalidProtocolBufferException.TruncatedMessage(), - Bytes(0x80)); - } - - /// - /// Parses the given bytes using ReadRawLittleEndian32() and checks - /// that the result matches the given value. - /// - private static void AssertReadLittleEndian32(byte[] data, uint value) - { - CodedInputStream input = new CodedInputStream(data); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - input = new CodedInputStream( - new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); - } - } - - /// - /// Parses the given bytes using ReadRawLittleEndian64() and checks - /// that the result matches the given value. - /// - private static void AssertReadLittleEndian64(byte[] data, ulong value) - { - CodedInputStream input = new CodedInputStream(data); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - input = new CodedInputStream( - new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); - } - } - - [Test] - public void ReadLittleEndian() - { - AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); - AssertReadLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); - - AssertReadLittleEndian64(Bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), - 0x123456789abcdef0L); - AssertReadLittleEndian64( - Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL); - } - - [Test] - public void DecodeZigZag32() - { - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(0)); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(1)); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(2)); - Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag32(3)); - Assert.AreEqual(0x3FFFFFFF, ParsingPrimitives.DecodeZigZag32(0x7FFFFFFE)); - Assert.AreEqual(unchecked((int) 0xC0000000), ParsingPrimitives.DecodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0x7FFFFFFF, ParsingPrimitives.DecodeZigZag32(0xFFFFFFFE)); - Assert.AreEqual(unchecked((int) 0x80000000), ParsingPrimitives.DecodeZigZag32(0xFFFFFFFF)); - } - - [Test] - public void DecodeZigZag64() - { - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(0)); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(1)); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(2)); - Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag64(3)); - Assert.AreEqual(0x000000003FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFFL)); - Assert.AreEqual(0x000000007FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFFL)); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0x8000000000000000L), ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); - } - - [Test] - public void ReadWholeMessage_VaryingBlockSizes() - { - TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); - - byte[] rawBytes = message.ToByteArray(); - Assert.AreEqual(rawBytes.Length, message.CalculateSize()); - TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(rawBytes); - Assert.AreEqual(message, message2); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) - { - message2 = TestAllTypes.Parser.ParseFrom(new SmallBlockInputStream(rawBytes, blockSize)); - Assert.AreEqual(message, message2); - } - } - - [Test] - public void ReadHugeBlob() - { - // Allocate and initialize a 1MB blob. - byte[] blob = new byte[1 << 20]; - for (int i = 0; i < blob.Length; i++) - { - blob[i] = (byte) i; - } - - // Make a message containing it. - var message = new TestAllTypes { SingleBytes = ByteString.CopyFrom(blob) }; - - // Serialize and parse it. Make sure to parse from an InputStream, not - // directly from a ByteString, so that CodedInputStream uses buffered - // reading. - TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(message.ToByteString()); - - Assert.AreEqual(message, message2); - } - - [Test] - public void ReadMaliciouslyLargeBlob() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(0x7FFFFFFF); - output.WriteRawBytes(new byte[32]); // Pad with a few random bytes. - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms); - Assert.AreEqual(tag, input.ReadTag()); - - Assert.Throws(() => input.ReadBytes()); - } - - internal static TestRecursiveMessage MakeRecursiveMessage(int depth) - { - if (depth == 0) - { - return new TestRecursiveMessage { I = 5 }; - } - else - { - return new TestRecursiveMessage { A = MakeRecursiveMessage(depth - 1) }; - } - } - - internal static void AssertMessageDepth(TestRecursiveMessage message, int depth) - { - if (depth == 0) - { - Assert.IsNull(message.A); - Assert.AreEqual(5, message.I); - } - else - { - Assert.IsNotNull(message.A); - AssertMessageDepth(message.A, depth - 1); - } - } - - [Test] - public void MaliciousRecursion() - { - ByteString atRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit).ToByteString(); - ByteString beyondRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit + 1).ToByteString(); - - AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(atRecursiveLimit), CodedInputStream.DefaultRecursionLimit); - - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(beyondRecursiveLimit)); - - CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(atRecursiveLimit.ToByteArray()), 1000000, CodedInputStream.DefaultRecursionLimit - 1); - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(input)); - } - - [Test] - public void SizeLimit() - { - // Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't - // apply to the latter case. - MemoryStream ms = new MemoryStream(SampleMessages.CreateFullTestAllTypes().ToByteArray()); - CodedInputStream input = CodedInputStream.CreateWithLimits(ms, 16, 100); - Assert.Throws(() => TestAllTypes.Parser.ParseFrom(input)); - } - - /// - /// Tests that if we read an string that contains invalid UTF-8, no exception - /// is thrown. Instead, the invalid bytes are replaced with the Unicode - /// "replacement character" U+FFFD. - /// - [Test] - public void ReadInvalidUtf8() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(1); - output.WriteRawBytes(new byte[] {0x80}); - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms); - - Assert.AreEqual(tag, input.ReadTag()); - string text = input.ReadString(); - Assert.AreEqual('\ufffd', text[0]); - } - - /// - /// A stream which limits the number of bytes it reads at a time. - /// We use this to make sure that CodedInputStream doesn't screw up when - /// reading in small blocks. - /// - private sealed class SmallBlockInputStream : MemoryStream - { - private readonly int blockSize; - - public SmallBlockInputStream(byte[] data, int blockSize) - : base(data) - { - this.blockSize = blockSize; - } - - public override int Read(byte[] buffer, int offset, int count) - { - return base.Read(buffer, offset, Math.Min(count, blockSize)); - } - } - - [Test] - public void TestNegativeEnum() - { - byte[] bytes = { 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01 }; - CodedInputStream input = new CodedInputStream(bytes); - Assert.AreEqual((int)SampleEnum.NegativeValue, input.ReadEnum()); - Assert.IsTrue(input.IsAtEnd); - } - - //Issue 71: CodedInputStream.ReadBytes go to slow path unnecessarily - [Test] - public void TestSlowPathAvoidance() - { - using (var ms = new MemoryStream()) - { - CodedOutputStream output = new CodedOutputStream(ms); - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteBytes(ByteString.CopyFrom(new byte[100])); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteBytes(ByteString.CopyFrom(new byte[100])); - output.Flush(); - - ms.Position = 0; - CodedInputStream input = new CodedInputStream(ms, new byte[ms.Length / 2], 0, 0, false); - - uint tag = input.ReadTag(); - Assert.AreEqual(1, WireFormat.GetTagFieldNumber(tag)); - Assert.AreEqual(100, input.ReadBytes().Length); - - tag = input.ReadTag(); - Assert.AreEqual(2, WireFormat.GetTagFieldNumber(tag)); - Assert.AreEqual(100, input.ReadBytes().Length); - } - } - - [Test] - public void Tag0Throws() - { - var input = new CodedInputStream(new byte[] { 0 }); - Assert.Throws(() => input.ReadTag()); - } - - [Test] - public void SkipGroup() - { - // Create an output stream with a group in: - // Field 1: string "field 1" - // Field 2: group containing: - // Field 1: fixed int32 value 100 - // Field 2: string "ignore me" - // Field 3: nested group containing - // Field 1: fixed int64 value 1000 - // Field 3: string "field 3" - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteString("field 1"); - - // The outer group... - output.WriteTag(2, WireFormat.WireType.StartGroup); - output.WriteTag(1, WireFormat.WireType.Fixed32); - output.WriteFixed32(100); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteString("ignore me"); - // The nested group... - output.WriteTag(3, WireFormat.WireType.StartGroup); - output.WriteTag(1, WireFormat.WireType.Fixed64); - output.WriteFixed64(1000); - // Note: Not sure the field number is relevant for end group... - output.WriteTag(3, WireFormat.WireType.EndGroup); - - // End the outer group - output.WriteTag(2, WireFormat.WireType.EndGroup); - - output.WriteTag(3, WireFormat.WireType.LengthDelimited); - output.WriteString("field 3"); - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag()); - Assert.AreEqual("field 1", input.ReadString()); - Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag()); - input.SkipLastField(); // Should consume the whole group, including the nested one. - Assert.AreEqual(WireFormat.MakeTag(3, WireFormat.WireType.LengthDelimited), input.ReadTag()); - Assert.AreEqual("field 3", input.ReadString()); - } - - [Test] - public void SkipGroup_WrongEndGroupTag() - { - // Create an output stream with: - // Field 1: string "field 1" - // Start group 2 - // Field 3: fixed int32 - // End group 4 (should give an error) - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteString("field 1"); - - // The outer group... - output.WriteTag(2, WireFormat.WireType.StartGroup); - output.WriteTag(3, WireFormat.WireType.Fixed32); - output.WriteFixed32(100); - output.WriteTag(4, WireFormat.WireType.EndGroup); - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag()); - Assert.AreEqual("field 1", input.ReadString()); - Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag()); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void RogueEndGroupTag() - { - // If we have an end-group tag without a leading start-group tag, generated - // code will just call SkipLastField... so that should fail. - - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.EndGroup); - output.Flush(); - stream.Position = 0; - - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.EndGroup), input.ReadTag()); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void EndOfStreamReachedWhileSkippingGroup() - { - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.StartGroup); - output.WriteTag(2, WireFormat.WireType.StartGroup); - output.WriteTag(2, WireFormat.WireType.EndGroup); - - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - input.ReadTag(); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void RecursionLimitAppliedWhileSkippingGroup() - { - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++) - { - output.WriteTag(1, WireFormat.WireType.StartGroup); - } - for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++) - { - output.WriteTag(1, WireFormat.WireType.EndGroup); - } - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.StartGroup), input.ReadTag()); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void Construction_Invalid() - { - Assert.Throws(() => new CodedInputStream((byte[]) null)); - Assert.Throws(() => new CodedInputStream(null, 0, 0)); - Assert.Throws(() => new CodedInputStream((Stream) null)); - Assert.Throws(() => new CodedInputStream(new byte[10], 100, 0)); - Assert.Throws(() => new CodedInputStream(new byte[10], 5, 10)); - } - - [Test] - public void CreateWithLimits_InvalidLimits() - { - var stream = new MemoryStream(); - Assert.Throws(() => CodedInputStream.CreateWithLimits(stream, 0, 1)); - Assert.Throws(() => CodedInputStream.CreateWithLimits(stream, 1, 0)); - } - - [Test] - public void Dispose_DisposesUnderlyingStream() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanRead); - using (var cis = new CodedInputStream(memoryStream)) - { - } - Assert.IsFalse(memoryStream.CanRead); // Disposed - } - - [Test] - public void Dispose_WithLeaveOpen() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanRead); - using (var cis = new CodedInputStream(memoryStream, true)) - { - } - Assert.IsTrue(memoryStream.CanRead); // We left the stream open - } - } -} \ No newline at end of file diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs deleted file mode 100644 index ebfa6f93f8a6484bb3d6f699af11b154155ec8aa..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs +++ /dev/null @@ -1,396 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using Google.Protobuf.TestProtos; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class CodedOutputStreamTest - { - /// - /// Writes the given value using WriteRawVarint32() and WriteRawVarint64() and - /// checks that the result matches the given bytes - /// - private static void AssertWriteVarint(byte[] data, ulong value) - { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >> 32) == 0) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawVarint32((uint) value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); - } - - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawVarint64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); - } - - // Try different buffer sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >> 32) == 0) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = - new CodedOutputStream(rawOutput, bufferSize); - output.WriteRawVarint32((uint) value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - } - - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput, bufferSize); - output.WriteRawVarint64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - } - } - } - - /// - /// Tests WriteRawVarint32() and WriteRawVarint64() - /// - [Test] - public void WriteVarint() - { - AssertWriteVarint(new byte[] {0x00}, 0); - AssertWriteVarint(new byte[] {0x01}, 1); - AssertWriteVarint(new byte[] {0x7f}, 127); - // 14882 - AssertWriteVarint(new byte[] {0xa2, 0x74}, (0x22 << 0) | (0x74 << 7)); - // 2961488830 - AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x0b}, - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x1b}, - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - AssertWriteVarint( - new byte[] {0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49}, - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43UL << 28) | (0x49L << 35) | (0x24UL << 42) | (0x49UL << 49)); - // 11964378330978735131 - AssertWriteVarint( - new byte[] {0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01}, - unchecked((ulong) - ((0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bL << 28) | (0x56L << 35) | (0x00L << 42) | - (0x05L << 49) | (0x26L << 56) | (0x01L << 63)))); - } - - /// - /// Parses the given bytes using WriteRawLittleEndian32() and checks - /// that the result matches the given value. - /// - private static void AssertWriteLittleEndian32(byte[] data, uint value) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawLittleEndian32(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - // Try different buffer sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - rawOutput = new MemoryStream(); - output = new CodedOutputStream(rawOutput, bufferSize); - output.WriteRawLittleEndian32(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - } - } - - /// - /// Parses the given bytes using WriteRawLittleEndian64() and checks - /// that the result matches the given value. - /// - private static void AssertWriteLittleEndian64(byte[] data, ulong value) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawLittleEndian64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - rawOutput = new MemoryStream(); - output = new CodedOutputStream(rawOutput, blockSize); - output.WriteRawLittleEndian64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - } - } - - /// - /// Tests writeRawLittleEndian32() and writeRawLittleEndian64(). - /// - [Test] - public void WriteLittleEndian() - { - AssertWriteLittleEndian32(new byte[] {0x78, 0x56, 0x34, 0x12}, 0x12345678); - AssertWriteLittleEndian32(new byte[] {0xf0, 0xde, 0xbc, 0x9a}, 0x9abcdef0); - - AssertWriteLittleEndian64( - new byte[] {0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12}, - 0x123456789abcdef0L); - AssertWriteLittleEndian64( - new byte[] {0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a}, - 0x9abcdef012345678UL); - } - - [Test] - public void WriteWholeMessage_VaryingBlockSizes() - { - TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); - - byte[] rawBytes = message.ToByteArray(); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput, blockSize); - message.WriteTo(output); - output.Flush(); - Assert.AreEqual(rawBytes, rawOutput.ToArray()); - } - } - - [Test] - public void EncodeZigZag32() - { - Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag32(0)); - Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag32(-1)); - Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag32(1)); - Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag32(-2)); - Assert.AreEqual(0x7FFFFFFEu, WritingPrimitives.EncodeZigZag32(0x3FFFFFFF)); - Assert.AreEqual(0x7FFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0xC0000000))); - Assert.AreEqual(0xFFFFFFFEu, WritingPrimitives.EncodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0xFFFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0x80000000))); - } - - [Test] - public void EncodeZigZag64() - { - Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag64(0)); - Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag64(-1)); - Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag64(1)); - Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag64(-2)); - Assert.AreEqual(0x000000007FFFFFFEuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); - Assert.AreEqual(0x000000007FFFFFFFuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); - Assert.AreEqual(0x00000000FFFFFFFEuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); - Assert.AreEqual(0x00000000FFFFFFFFuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); - } - - [Test] - public void RoundTripZigZag32() - { - // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) - // were chosen semi-randomly via keyboard bashing. - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(0))); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(1))); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-1))); - Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(14927))); - Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-3612))); - } - - [Test] - public void RoundTripZigZag64() - { - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(0))); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(1))); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-1))); - Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(14927))); - Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-3612))); - - Assert.AreEqual(856912304801416L, - ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(856912304801416L))); - Assert.AreEqual(-75123905439571256L, - ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-75123905439571256L))); - } - - [Test] - public void TestNegativeEnumNoTag() - { - Assert.AreEqual(10, CodedOutputStream.ComputeInt32Size(-2)); - Assert.AreEqual(10, CodedOutputStream.ComputeEnumSize((int) SampleEnum.NegativeValue)); - - byte[] bytes = new byte[10]; - CodedOutputStream output = new CodedOutputStream(bytes); - output.WriteEnum((int) SampleEnum.NegativeValue); - - Assert.AreEqual(0, output.SpaceLeft); - Assert.AreEqual("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); - } - - [Test] - public void TestCodedInputOutputPosition() - { - byte[] content = new byte[110]; - for (int i = 0; i < content.Length; i++) - content[i] = (byte)i; - - byte[] child = new byte[120]; - { - MemoryStream ms = new MemoryStream(child); - CodedOutputStream cout = new CodedOutputStream(ms, 20); - // Field 11: numeric value: 500 - cout.WriteTag(11, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); - cout.WriteInt32(500); - Assert.AreEqual(3, cout.Position); - //Field 12: length delimited 120 bytes - cout.WriteTag(12, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); - cout.WriteBytes(ByteString.CopyFrom(content)); - Assert.AreEqual(115, cout.Position); - // Field 13: fixed numeric value: 501 - cout.WriteTag(13, WireFormat.WireType.Fixed32); - Assert.AreEqual(116, cout.Position); - cout.WriteSFixed32(501); - Assert.AreEqual(120, cout.Position); - cout.Flush(); - } - - byte[] bytes = new byte[130]; - { - CodedOutputStream cout = new CodedOutputStream(bytes); - // Field 1: numeric value: 500 - cout.WriteTag(1, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); - cout.WriteInt32(500); - Assert.AreEqual(3, cout.Position); - //Field 2: length delimited 120 bytes - cout.WriteTag(2, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); - cout.WriteBytes(ByteString.CopyFrom(child)); - Assert.AreEqual(125, cout.Position); - // Field 3: fixed numeric value: 500 - cout.WriteTag(3, WireFormat.WireType.Fixed32); - Assert.AreEqual(126, cout.Position); - cout.WriteSFixed32(501); - Assert.AreEqual(130, cout.Position); - cout.Flush(); - } - // Now test Input stream: - { - CodedInputStream cin = new CodedInputStream(new MemoryStream(bytes), new byte[50], 0, 0, false); - Assert.AreEqual(0, cin.Position); - // Field 1: - uint tag = cin.ReadTag(); - Assert.AreEqual(1, tag >> 3); - Assert.AreEqual(1, cin.Position); - Assert.AreEqual(500, cin.ReadInt32()); - Assert.AreEqual(3, cin.Position); - //Field 2: - tag = cin.ReadTag(); - Assert.AreEqual(2, tag >> 3); - Assert.AreEqual(4, cin.Position); - int childlen = cin.ReadLength(); - Assert.AreEqual(120, childlen); - Assert.AreEqual(5, cin.Position); - int oldlimit = cin.PushLimit((int)childlen); - Assert.AreEqual(5, cin.Position); - // Now we are reading child message - { - // Field 11: numeric value: 500 - tag = cin.ReadTag(); - Assert.AreEqual(11, tag >> 3); - Assert.AreEqual(6, cin.Position); - Assert.AreEqual(500, cin.ReadInt32()); - Assert.AreEqual(8, cin.Position); - //Field 12: length delimited 120 bytes - tag = cin.ReadTag(); - Assert.AreEqual(12, tag >> 3); - Assert.AreEqual(9, cin.Position); - ByteString bstr = cin.ReadBytes(); - Assert.AreEqual(110, bstr.Length); - Assert.AreEqual((byte) 109, bstr[109]); - Assert.AreEqual(120, cin.Position); - // Field 13: fixed numeric value: 501 - tag = cin.ReadTag(); - Assert.AreEqual(13, tag >> 3); - // ROK - Previously broken here, this returned 126 failing to account for bufferSizeAfterLimit - Assert.AreEqual(121, cin.Position); - Assert.AreEqual(501, cin.ReadSFixed32()); - Assert.AreEqual(125, cin.Position); - Assert.IsTrue(cin.IsAtEnd); - } - cin.PopLimit(oldlimit); - Assert.AreEqual(125, cin.Position); - // Field 3: fixed numeric value: 501 - tag = cin.ReadTag(); - Assert.AreEqual(3, tag >> 3); - Assert.AreEqual(126, cin.Position); - Assert.AreEqual(501, cin.ReadSFixed32()); - Assert.AreEqual(130, cin.Position); - Assert.IsTrue(cin.IsAtEnd); - } - } - - [Test] - public void Dispose_DisposesUnderlyingStream() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanWrite); - using (var cos = new CodedOutputStream(memoryStream)) - { - cos.WriteRawBytes(new byte[] {0}); - Assert.AreEqual(0, memoryStream.Position); // Not flushed yet - } - Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to MemoryStream - Assert.IsFalse(memoryStream.CanWrite); // Disposed - } - - [Test] - public void Dispose_WithLeaveOpen() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanWrite); - using (var cos = new CodedOutputStream(memoryStream, true)) - { - cos.WriteRawBytes(new byte[] {0}); - Assert.AreEqual(0, memoryStream.Position); // Not flushed yet - } - Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream - Assert.IsTrue(memoryStream.CanWrite); // We left the stream open - } - } -} \ No newline at end of file diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/MapFieldTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/MapFieldTest.cs deleted file mode 100644 index 41ca3e8606ea20f7b39338b67b4ddee62e69ec0e..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/MapFieldTest.cs +++ /dev/null @@ -1,509 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Collections.Generic; -using Google.Protobuf.TestProtos; -using NUnit.Framework; -using System.Collections; -using System.Linq; - -namespace Google.Protobuf.Collections -{ - /// - /// Tests for MapField which aren't reliant on the encoded format - - /// tests for serialization/deserialization are part of GeneratedMessageTest. - /// - public class MapFieldTest - { - [Test] - public void Clone_ClonesMessages() - { - var message = new ForeignMessage { C = 20 }; - var map = new MapField { { "x", message } }; - var clone = map.Clone(); - map["x"].C = 30; - Assert.AreEqual(20, clone["x"].C); - } - - [Test] - public void NullValuesProhibited() - { - TestNullValues(0); - TestNullValues(""); - TestNullValues(new TestAllTypes()); - } - - private void TestNullValues(T nonNullValue) - { - var map = new MapField(); - var nullValue = (T) (object) null; - Assert.Throws(() => map.Add(0, nullValue)); - Assert.Throws(() => map[0] = nullValue); - map.Add(1, nonNullValue); - map[1] = nonNullValue; - } - - [Test] - public void Add_ForbidsNullKeys() - { - var map = new MapField(); - Assert.Throws(() => map.Add(null, new ForeignMessage())); - } - - [Test] - public void Indexer_ForbidsNullKeys() - { - var map = new MapField(); - Assert.Throws(() => map[null] = new ForeignMessage()); - } - - [Test] - public void AddPreservesInsertionOrder() - { - var map = new MapField(); - map.Add("a", "v1"); - map.Add("b", "v2"); - map.Add("c", "v3"); - map.Remove("b"); - map.Add("d", "v4"); - CollectionAssert.AreEqual(new[] { "a", "c", "d" }, map.Keys); - CollectionAssert.AreEqual(new[] { "v1", "v3", "v4" }, map.Values); - } - - [Test] - public void EqualityIsOrderInsensitive() - { - var map1 = new MapField(); - map1.Add("a", "v1"); - map1.Add("b", "v2"); - - var map2 = new MapField(); - map2.Add("b", "v2"); - map2.Add("a", "v1"); - - EqualityTester.AssertEquality(map1, map2); - } - - [Test] - public void EqualityIsKeySensitive() - { - var map1 = new MapField(); - map1.Add("first key", "v1"); - map1.Add("second key", "v2"); - - var map2 = new MapField(); - map2.Add("third key", "v1"); - map2.Add("fourth key", "v2"); - - EqualityTester.AssertInequality(map1, map2); - } - - [Test] - public void Equality_Simple() - { - var map = new MapField(); - EqualityTester.AssertEquality(map, map); - EqualityTester.AssertInequality(map, null); - Assert.IsFalse(map.Equals(new object())); - } - - [Test] - public void EqualityIsValueSensitive() - { - // Note: Without some care, it's a little easier than one might - // hope to see hash collisions, but only in some environments... - var map1 = new MapField(); - map1.Add("a", "first value"); - map1.Add("b", "second value"); - - var map2 = new MapField(); - map2.Add("a", "third value"); - map2.Add("b", "fourth value"); - - EqualityTester.AssertInequality(map1, map2); - } - - [Test] - public void Add_Dictionary() - { - var map1 = new MapField - { - { "x", "y" }, - { "a", "b" } - }; - var map2 = new MapField - { - { "before", "" }, - map1, - { "after", "" } - }; - var expected = new MapField - { - { "before", "" }, - { "x", "y" }, - { "a", "b" }, - { "after", "" } - }; - Assert.AreEqual(expected, map2); - CollectionAssert.AreEqual(new[] { "before", "x", "a", "after" }, map2.Keys); - } - - // General IDictionary behavior tests - [Test] - public void Add_KeyAlreadyExists() - { - var map = new MapField(); - map.Add("foo", "bar"); - Assert.Throws(() => map.Add("foo", "baz")); - } - - [Test] - public void Add_Pair() - { - var map = new MapField(); - ICollection> collection = map; - collection.Add(NewKeyValuePair("x", "y")); - Assert.AreEqual("y", map["x"]); - Assert.Throws(() => collection.Add(NewKeyValuePair("x", "z"))); - } - - [Test] - public void Contains_Pair() - { - var map = new MapField { { "x", "y" } }; - ICollection> collection = map; - Assert.IsTrue(collection.Contains(NewKeyValuePair("x", "y"))); - Assert.IsFalse(collection.Contains(NewKeyValuePair("x", "z"))); - Assert.IsFalse(collection.Contains(NewKeyValuePair("z", "y"))); - } - - [Test] - public void Remove_Key() - { - var map = new MapField(); - map.Add("foo", "bar"); - Assert.AreEqual(1, map.Count); - Assert.IsFalse(map.Remove("missing")); - Assert.AreEqual(1, map.Count); - Assert.IsTrue(map.Remove("foo")); - Assert.AreEqual(0, map.Count); - Assert.Throws(() => map.Remove(null)); - } - - [Test] - public void Remove_Pair() - { - var map = new MapField(); - map.Add("foo", "bar"); - ICollection> collection = map; - Assert.AreEqual(1, map.Count); - Assert.IsFalse(collection.Remove(NewKeyValuePair("wrong key", "bar"))); - Assert.AreEqual(1, map.Count); - Assert.IsFalse(collection.Remove(NewKeyValuePair("foo", "wrong value"))); - Assert.AreEqual(1, map.Count); - Assert.IsTrue(collection.Remove(NewKeyValuePair("foo", "bar"))); - Assert.AreEqual(0, map.Count); - Assert.Throws(() => collection.Remove(new KeyValuePair(null, ""))); - } - - [Test] - public void CopyTo_Pair() - { - var map = new MapField(); - map.Add("foo", "bar"); - ICollection> collection = map; - KeyValuePair[] array = new KeyValuePair[3]; - collection.CopyTo(array, 1); - Assert.AreEqual(NewKeyValuePair("foo", "bar"), array[1]); - } - - [Test] - public void Clear() - { - var map = new MapField { { "x", "y" } }; - Assert.AreEqual(1, map.Count); - map.Clear(); - Assert.AreEqual(0, map.Count); - map.Add("x", "y"); - Assert.AreEqual(1, map.Count); - } - - [Test] - public void Indexer_Get() - { - var map = new MapField { { "x", "y" } }; - Assert.AreEqual("y", map["x"]); - Assert.Throws(() => { var ignored = map["z"]; }); - } - - [Test] - public void Indexer_Set() - { - var map = new MapField(); - map["x"] = "y"; - Assert.AreEqual("y", map["x"]); - map["x"] = "z"; // This won't throw, unlike Add. - Assert.AreEqual("z", map["x"]); - } - - [Test] - public void GetEnumerator_NonGeneric() - { - IEnumerable map = new MapField { { "x", "y" } }; - CollectionAssert.AreEqual(new[] { new KeyValuePair("x", "y") }, - map.Cast().ToList()); - } - - // Test for the explicitly-implemented non-generic IDictionary interface - [Test] - public void IDictionary_GetEnumerator() - { - IDictionary map = new MapField { { "x", "y" } }; - var enumerator = map.GetEnumerator(); - - // Commented assertions show an ideal situation - it looks like - // the LinkedList enumerator doesn't throw when you ask for the current entry - // at an inappropriate time; fixing this would be more work than it's worth. - // Assert.Throws(() => enumerator.Current.GetHashCode()); - Assert.IsTrue(enumerator.MoveNext()); - Assert.AreEqual("x", enumerator.Key); - Assert.AreEqual("y", enumerator.Value); - Assert.AreEqual(new DictionaryEntry("x", "y"), enumerator.Current); - Assert.AreEqual(new DictionaryEntry("x", "y"), enumerator.Entry); - Assert.IsFalse(enumerator.MoveNext()); - // Assert.Throws(() => enumerator.Current.GetHashCode()); - enumerator.Reset(); - // Assert.Throws(() => enumerator.Current.GetHashCode()); - Assert.IsTrue(enumerator.MoveNext()); - Assert.AreEqual("x", enumerator.Key); // Assume the rest are okay - } - - [Test] - public void IDictionary_Add() - { - var map = new MapField { { "x", "y" } }; - IDictionary dictionary = map; - dictionary.Add("a", "b"); - Assert.AreEqual("b", map["a"]); - Assert.Throws(() => dictionary.Add("a", "duplicate")); - Assert.Throws(() => dictionary.Add(new object(), "key is bad")); - Assert.Throws(() => dictionary.Add("value is bad", new object())); - } - - [Test] - public void IDictionary_Contains() - { - var map = new MapField { { "x", "y" } }; - IDictionary dictionary = map; - - Assert.IsFalse(dictionary.Contains("a")); - Assert.IsFalse(dictionary.Contains(5)); - // Surprising, but IDictionary.Contains is only about keys. - Assert.IsFalse(dictionary.Contains(new DictionaryEntry("x", "y"))); - Assert.IsTrue(dictionary.Contains("x")); - } - - [Test] - public void IDictionary_Remove() - { - var map = new MapField { { "x", "y" } }; - IDictionary dictionary = map; - dictionary.Remove("a"); - Assert.AreEqual(1, dictionary.Count); - dictionary.Remove(5); - Assert.AreEqual(1, dictionary.Count); - dictionary.Remove(new DictionaryEntry("x", "y")); - Assert.AreEqual(1, dictionary.Count); - dictionary.Remove("x"); - Assert.AreEqual(0, dictionary.Count); - Assert.Throws(() => dictionary.Remove(null)); - } - - [Test] - public void IDictionary_CopyTo() - { - var map = new MapField { { "x", "y" } }; - IDictionary dictionary = map; - var array = new DictionaryEntry[3]; - dictionary.CopyTo(array, 1); - CollectionAssert.AreEqual(new[] { default(DictionaryEntry), new DictionaryEntry("x", "y"), default(DictionaryEntry) }, - array); - var objectArray = new object[3]; - dictionary.CopyTo(objectArray, 1); - CollectionAssert.AreEqual(new object[] { null, new DictionaryEntry("x", "y"), null }, - objectArray); - } - - [Test] - public void IDictionary_IsFixedSize() - { - var map = new MapField { { "x", "y" } }; - IDictionary dictionary = map; - Assert.IsFalse(dictionary.IsFixedSize); - } - - [Test] - public void IDictionary_Keys() - { - IDictionary dictionary = new MapField { { "x", "y" } }; - CollectionAssert.AreEqual(new[] { "x" }, dictionary.Keys); - } - - [Test] - public void IDictionary_Values() - { - IDictionary dictionary = new MapField { { "x", "y" } }; - CollectionAssert.AreEqual(new[] { "y" }, dictionary.Values); - } - - [Test] - public void IDictionary_IsSynchronized() - { - IDictionary dictionary = new MapField { { "x", "y" } }; - Assert.IsFalse(dictionary.IsSynchronized); - } - - [Test] - public void IDictionary_SyncRoot() - { - IDictionary dictionary = new MapField { { "x", "y" } }; - Assert.AreSame(dictionary, dictionary.SyncRoot); - } - - [Test] - public void IDictionary_Indexer_Get() - { - IDictionary dictionary = new MapField { { "x", "y" } }; - Assert.AreEqual("y", dictionary["x"]); - Assert.IsNull(dictionary["a"]); - Assert.IsNull(dictionary[5]); - Assert.Throws(() => dictionary[null].GetHashCode()); - } - - [Test] - public void IDictionary_Indexer_Set() - { - var map = new MapField { { "x", "y" } }; - IDictionary dictionary = map; - map["a"] = "b"; - Assert.AreEqual("b", map["a"]); - map["a"] = "c"; - Assert.AreEqual("c", map["a"]); - Assert.Throws(() => dictionary[5] = "x"); - Assert.Throws(() => dictionary["x"] = 5); - Assert.Throws(() => dictionary[null] = "z"); - Assert.Throws(() => dictionary["x"] = null); - } - - [Test] - public void KeysReturnsLiveView() - { - var map = new MapField(); - var keys = map.Keys; - CollectionAssert.AreEqual(new string[0], keys); - map["foo"] = "bar"; - map["x"] = "y"; - CollectionAssert.AreEqual(new[] { "foo", "x" }, keys); - } - - [Test] - public void ValuesReturnsLiveView() - { - var map = new MapField(); - var values = map.Values; - CollectionAssert.AreEqual(new string[0], values); - map["foo"] = "bar"; - map["x"] = "y"; - CollectionAssert.AreEqual(new[] { "bar", "y" }, values); - } - - // Just test keys - we know the implementation is the same for values - [Test] - public void ViewsAreReadOnly() - { - var map = new MapField(); - var keys = map.Keys; - Assert.IsTrue(keys.IsReadOnly); - Assert.Throws(() => keys.Clear()); - Assert.Throws(() => keys.Remove("a")); - Assert.Throws(() => keys.Add("a")); - } - - // Just test keys - we know the implementation is the same for values - [Test] - public void ViewCopyTo() - { - var map = new MapField { { "foo", "bar" }, { "x", "y" } }; - var keys = map.Keys; - var array = new string[4]; - Assert.Throws(() => keys.CopyTo(array, 3)); - Assert.Throws(() => keys.CopyTo(array, -1)); - keys.CopyTo(array, 1); - CollectionAssert.AreEqual(new[] { null, "foo", "x", null }, array); - } - - // Just test keys - we know the implementation is the same for values - [Test] - public void NonGenericViewCopyTo() - { - IDictionary map = new MapField { { "foo", "bar" }, { "x", "y" } }; - ICollection keys = map.Keys; - // Note the use of the Array type here rather than string[] - Array array = new string[4]; - Assert.Throws(() => keys.CopyTo(array, 3)); - Assert.Throws(() => keys.CopyTo(array, -1)); - keys.CopyTo(array, 1); - CollectionAssert.AreEqual(new[] { null, "foo", "x", null }, array); - } - - [Test] - public void KeysContains() - { - var map = new MapField { { "foo", "bar" }, { "x", "y" } }; - var keys = map.Keys; - Assert.IsTrue(keys.Contains("foo")); - Assert.IsFalse(keys.Contains("bar")); // It's a value! - Assert.IsFalse(keys.Contains("1")); - // Keys can't be null, so we should prevent contains check - Assert.Throws(() => keys.Contains(null)); - } - - [Test] - public void ValuesContains() - { - var map = new MapField { { "foo", "bar" }, { "x", "y" } }; - var values = map.Values; - Assert.IsTrue(values.Contains("bar")); - Assert.IsFalse(values.Contains("foo")); // It's a key! - Assert.IsFalse(values.Contains("1")); - // Values can be null, so this makes sense - Assert.IsFalse(values.Contains(null)); - } - - [Test] - public void ToString_StringToString() - { - var map = new MapField { { "foo", "bar" }, { "x", "y" } }; - Assert.AreEqual("{ \"foo\": \"bar\", \"x\": \"y\" }", map.ToString()); - } - - [Test] - public void ToString_UnsupportedKeyType() - { - var map = new MapField { { 10, "foo" } }; - Assert.Throws(() => map.ToString()); - } - - private static KeyValuePair NewKeyValuePair(TKey key, TValue value) - { - return new KeyValuePair(key, value); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs deleted file mode 100644 index 18070e335684cc7996b29d73b3986c7d4477d2c9..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs +++ /dev/null @@ -1,723 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Google.Protobuf.TestProtos; -using Google.Protobuf.WellKnownTypes; -using NUnit.Framework; - -namespace Google.Protobuf.Collections -{ - public class RepeatedFieldTest - { - [Test] - public void NullValuesRejected() - { - var list = new RepeatedField(); - Assert.Throws(() => list.Add((string)null)); - Assert.Throws(() => list.Add((IEnumerable)null)); - Assert.Throws(() => list.Add((RepeatedField)null)); - Assert.Throws(() => list.Contains(null)); - Assert.Throws(() => list.IndexOf(null)); - } - - [Test] - public void Add_SingleItem() - { - var list = new RepeatedField(); - list.Add("foo"); - Assert.AreEqual(1, list.Count); - Assert.AreEqual("foo", list[0]); - } - - [Test] - public void Add_Sequence() - { - var list = new RepeatedField(); - list.Add(new[] { "foo", "bar" }); - Assert.AreEqual(2, list.Count); - Assert.AreEqual("foo", list[0]); - Assert.AreEqual("bar", list[1]); - } - - [Test] - public void AddRange_SlowPath() - { - var list = new RepeatedField(); - list.AddRange(new[] { "foo", "bar" }.Select(x => x)); - Assert.AreEqual(2, list.Count); - Assert.AreEqual("foo", list[0]); - Assert.AreEqual("bar", list[1]); - } - - [Test] - public void AddRange_SlowPath_NullsProhibited_ReferenceType() - { - var list = new RepeatedField(); - // It's okay for this to throw ArgumentNullException if necessary. - // It's not ideal, but not awful. - Assert.Catch(() => list.AddRange(new[] { "foo", null }.Select(x => x))); - } - - [Test] - public void AddRange_SlowPath_NullsProhibited_NullableValueType() - { - var list = new RepeatedField(); - // It's okay for this to throw ArgumentNullException if necessary. - // It's not ideal, but not awful. - Assert.Catch(() => list.AddRange(new[] { 20, (int?)null }.Select(x => x))); - } - - [Test] - public void AddRange_Optimized_NonNullableValueType() - { - var list = new RepeatedField(); - list.AddRange(new List { 20, 30 }); - Assert.AreEqual(2, list.Count); - Assert.AreEqual(20, list[0]); - Assert.AreEqual(30, list[1]); - } - - [Test] - public void AddRange_Optimized_ReferenceType() - { - var list = new RepeatedField(); - list.AddRange(new List { "foo", "bar" }); - Assert.AreEqual(2, list.Count); - Assert.AreEqual("foo", list[0]); - Assert.AreEqual("bar", list[1]); - } - - [Test] - public void AddRange_Optimized_NullableValueType() - { - var list = new RepeatedField(); - list.AddRange(new List { 20, 30 }); - Assert.AreEqual(2, list.Count); - Assert.AreEqual((int?) 20, list[0]); - Assert.AreEqual((int?) 30, list[1]); - } - - [Test] - public void AddRange_Optimized_NullsProhibited_ReferenceType() - { - // We don't just trust that a collection with a nullable element type doesn't contain nulls - var list = new RepeatedField(); - // It's okay for this to throw ArgumentNullException if necessary. - // It's not ideal, but not awful. - Assert.Catch(() => list.AddRange(new List { "foo", null })); - } - - [Test] - public void AddRange_Optimized_NullsProhibited_NullableValueType() - { - // We don't just trust that a collection with a nullable element type doesn't contain nulls - var list = new RepeatedField(); - // It's okay for this to throw ArgumentNullException if necessary. - // It's not ideal, but not awful. - Assert.Catch(() => list.AddRange(new List { 20, null })); - } - - [Test] - public void AddRange_AlreadyNotEmpty() - { - var list = new RepeatedField { 1, 2, 3 }; - list.AddRange(new List { 4, 5, 6 }); - CollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6 }, list); - } - - [Test] - public void AddRange_RepeatedField() - { - var list = new RepeatedField { "original" }; - list.AddRange(new RepeatedField { "foo", "bar" }); - Assert.AreEqual(3, list.Count); - Assert.AreEqual("original", list[0]); - Assert.AreEqual("foo", list[1]); - Assert.AreEqual("bar", list[2]); - } - - [Test] - public void RemoveAt_Valid() - { - var list = new RepeatedField { "first", "second", "third" }; - list.RemoveAt(1); - CollectionAssert.AreEqual(new[] { "first", "third" }, list); - // Just check that these don't throw... - list.RemoveAt(list.Count - 1); // Now the count will be 1... - list.RemoveAt(0); - Assert.AreEqual(0, list.Count); - } - - [Test] - public void RemoveAt_Invalid() - { - var list = new RepeatedField { "first", "second", "third" }; - Assert.Throws(() => list.RemoveAt(-1)); - Assert.Throws(() => list.RemoveAt(3)); - } - - [Test] - public void Insert_Valid() - { - var list = new RepeatedField { "first", "second" }; - list.Insert(1, "middle"); - CollectionAssert.AreEqual(new[] { "first", "middle", "second" }, list); - list.Insert(3, "end"); - CollectionAssert.AreEqual(new[] { "first", "middle", "second", "end" }, list); - list.Insert(0, "start"); - CollectionAssert.AreEqual(new[] { "start", "first", "middle", "second", "end" }, list); - } - - [Test] - public void Insert_Invalid() - { - var list = new RepeatedField { "first", "second" }; - Assert.Throws(() => list.Insert(-1, "foo")); - Assert.Throws(() => list.Insert(3, "foo")); - Assert.Throws(() => list.Insert(0, null)); - } - - [Test] - public void Equals_RepeatedField() - { - var list = new RepeatedField { "first", "second" }; - Assert.IsFalse(list.Equals((RepeatedField) null)); - Assert.IsTrue(list.Equals(list)); - Assert.IsFalse(list.Equals(new RepeatedField { "first", "third" })); - Assert.IsFalse(list.Equals(new RepeatedField { "first" })); - Assert.IsTrue(list.Equals(new RepeatedField { "first", "second" })); - } - - [Test] - public void Equals_Object() - { - var list = new RepeatedField { "first", "second" }; - Assert.IsFalse(list.Equals((object) null)); - Assert.IsTrue(list.Equals((object) list)); - Assert.IsFalse(list.Equals((object) new RepeatedField { "first", "third" })); - Assert.IsFalse(list.Equals((object) new RepeatedField { "first" })); - Assert.IsTrue(list.Equals((object) new RepeatedField { "first", "second" })); - Assert.IsFalse(list.Equals(new object())); - } - - [Test] - public void GetEnumerator_GenericInterface() - { - IEnumerable list = new RepeatedField { "first", "second" }; - // Select gets rid of the optimizations in ToList... - CollectionAssert.AreEqual(new[] { "first", "second" }, list.Select(x => x).ToList()); - } - - [Test] - public void GetEnumerator_NonGenericInterface() - { - IEnumerable list = new RepeatedField { "first", "second" }; - CollectionAssert.AreEqual(new[] { "first", "second" }, list.Cast().ToList()); - } - - [Test] - public void CopyTo() - { - var list = new RepeatedField { "first", "second" }; - string[] stringArray = new string[4]; - list.CopyTo(stringArray, 1); - CollectionAssert.AreEqual(new[] { null, "first", "second", null }, stringArray); - } - - [Test] - public void Indexer_Get() - { - var list = new RepeatedField { "first", "second" }; - Assert.AreEqual("first", list[0]); - Assert.AreEqual("second", list[1]); - Assert.Throws(() => list[-1].GetHashCode()); - Assert.Throws(() => list[2].GetHashCode()); - } - - [Test] - public void Indexer_Set() - { - var list = new RepeatedField { "first", "second" }; - list[0] = "changed"; - Assert.AreEqual("changed", list[0]); - Assert.Throws(() => list[0] = null); - Assert.Throws(() => list[-1] = "bad"); - Assert.Throws(() => list[2] = "bad"); - } - - [Test] - public void Clone_ReturnsMutable() - { - var list = new RepeatedField { 0 }; - var clone = list.Clone(); - clone[0] = 1; - } - - [Test] - public void Enumerator() - { - var list = new RepeatedField { "first", "second" }; - using (var enumerator = list.GetEnumerator()) - { - Assert.IsTrue(enumerator.MoveNext()); - Assert.AreEqual("first", enumerator.Current); - Assert.IsTrue(enumerator.MoveNext()); - Assert.AreEqual("second", enumerator.Current); - Assert.IsFalse(enumerator.MoveNext()); - Assert.IsFalse(enumerator.MoveNext()); - } - } - - [Test] - public void AddEntriesFrom_PackedInt32() - { - uint packedTag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - var length = CodedOutputStream.ComputeInt32Size(10) - + CodedOutputStream.ComputeInt32Size(999) - + CodedOutputStream.ComputeInt32Size(-1000); - output.WriteTag(packedTag); - output.WriteRawVarint32((uint) length); - output.WriteInt32(10); - output.WriteInt32(999); - output.WriteInt32(-1000); - output.Flush(); - stream.Position = 0; - - // Deliberately "expecting" a non-packed tag, but we detect that the data is - // actually packed. - uint nonPackedTag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var field = new RepeatedField(); - var input = new CodedInputStream(stream); - input.AssertNextTag(packedTag); - field.AddEntriesFrom(input, FieldCodec.ForInt32(nonPackedTag)); - CollectionAssert.AreEqual(new[] { 10, 999, -1000 }, field); - Assert.IsTrue(input.IsAtEnd); - } - - [Test] - public void AddEntriesFrom_NonPackedInt32() - { - uint nonPackedTag = WireFormat.MakeTag(10, WireFormat.WireType.Varint); - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(nonPackedTag); - output.WriteInt32(10); - output.WriteTag(nonPackedTag); - output.WriteInt32(999); - output.WriteTag(nonPackedTag); - output.WriteInt32(-1000); // Just for variety... - output.Flush(); - stream.Position = 0; - - // Deliberately "expecting" a packed tag, but we detect that the data is - // actually not packed. - uint packedTag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var field = new RepeatedField(); - var input = new CodedInputStream(stream); - input.AssertNextTag(nonPackedTag); - field.AddEntriesFrom(input, FieldCodec.ForInt32(packedTag)); - CollectionAssert.AreEqual(new[] { 10, 999, -1000 }, field); - Assert.IsTrue(input.IsAtEnd); - } - - [Test] - public void AddEntriesFrom_String() - { - uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(tag); - output.WriteString("Foo"); - output.WriteTag(tag); - output.WriteString(""); - output.WriteTag(tag); - output.WriteString("Bar"); - output.Flush(); - stream.Position = 0; - - var field = new RepeatedField(); - var input = new CodedInputStream(stream); - input.AssertNextTag(tag); - field.AddEntriesFrom(input, FieldCodec.ForString(tag)); - CollectionAssert.AreEqual(new[] { "Foo", "", "Bar" }, field); - Assert.IsTrue(input.IsAtEnd); - } - - [Test] - public void AddEntriesFrom_Message() - { - var message1 = new ForeignMessage { C = 2000 }; - var message2 = new ForeignMessage { C = -250 }; - - uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(tag); - output.WriteMessage(message1); - output.WriteTag(tag); - output.WriteMessage(message2); - output.Flush(); - stream.Position = 0; - - var field = new RepeatedField(); - var input = new CodedInputStream(stream); - input.AssertNextTag(tag); - field.AddEntriesFrom(input, FieldCodec.ForMessage(tag, ForeignMessage.Parser)); - CollectionAssert.AreEqual(new[] { message1, message2}, field); - Assert.IsTrue(input.IsAtEnd); - } - - [Test] - public void WriteTo_PackedInt32() - { - uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var field = new RepeatedField { 10, 1000, 1000000 }; - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - field.WriteTo(output, FieldCodec.ForInt32(tag)); - output.Flush(); - stream.Position = 0; - - var input = new CodedInputStream(stream); - input.AssertNextTag(tag); - var length = input.ReadLength(); - Assert.AreEqual(10, input.ReadInt32()); - Assert.AreEqual(1000, input.ReadInt32()); - Assert.AreEqual(1000000, input.ReadInt32()); - Assert.IsTrue(input.IsAtEnd); - Assert.AreEqual(1 + CodedOutputStream.ComputeLengthSize(length) + length, stream.Length); - } - - [Test] - public void WriteTo_NonPackedInt32() - { - uint tag = WireFormat.MakeTag(10, WireFormat.WireType.Varint); - var field = new RepeatedField { 10, 1000, 1000000}; - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - field.WriteTo(output, FieldCodec.ForInt32(tag)); - output.Flush(); - stream.Position = 0; - - var input = new CodedInputStream(stream); - input.AssertNextTag(tag); - Assert.AreEqual(10, input.ReadInt32()); - input.AssertNextTag(tag); - Assert.AreEqual(1000, input.ReadInt32()); - input.AssertNextTag(tag); - Assert.AreEqual(1000000, input.ReadInt32()); - Assert.IsTrue(input.IsAtEnd); - } - - [Test] - public void WriteTo_String() - { - uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var field = new RepeatedField { "Foo", "", "Bar" }; - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - field.WriteTo(output, FieldCodec.ForString(tag)); - output.Flush(); - stream.Position = 0; - - var input = new CodedInputStream(stream); - input.AssertNextTag(tag); - Assert.AreEqual("Foo", input.ReadString()); - input.AssertNextTag(tag); - Assert.AreEqual("", input.ReadString()); - input.AssertNextTag(tag); - Assert.AreEqual("Bar", input.ReadString()); - Assert.IsTrue(input.IsAtEnd); - } - - [Test] - public void WriteTo_Message() - { - var message1 = new ForeignMessage { C = 20 }; - var message2 = new ForeignMessage { C = 25 }; - uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); - var field = new RepeatedField { message1, message2 }; - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - field.WriteTo(output, FieldCodec.ForMessage(tag, ForeignMessage.Parser)); - output.Flush(); - stream.Position = 0; - - var input = new CodedInputStream(stream); - input.AssertNextTag(tag); - Assert.AreEqual(message1, input.ReadMessage(ForeignMessage.Parser)); - input.AssertNextTag(tag); - Assert.AreEqual(message2, input.ReadMessage(ForeignMessage.Parser)); - Assert.IsTrue(input.IsAtEnd); - } - - [Test] - public void CalculateSize_VariableSizeNonPacked() - { - var list = new RepeatedField { 1, 500, 1 }; - var tag = WireFormat.MakeTag(1, WireFormat.WireType.Varint); - // 2 bytes for the first entry, 3 bytes for the second, 2 bytes for the third - Assert.AreEqual(7, list.CalculateSize(FieldCodec.ForInt32(tag))); - } - - [Test] - public void CalculateSize_FixedSizeNonPacked() - { - var list = new RepeatedField { 1, 500, 1 }; - var tag = WireFormat.MakeTag(1, WireFormat.WireType.Fixed32); - // 5 bytes for the each entry - Assert.AreEqual(15, list.CalculateSize(FieldCodec.ForSFixed32(tag))); - } - - [Test] - public void CalculateSize_VariableSizePacked() - { - var list = new RepeatedField { 1, 500, 1}; - var tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - // 1 byte for the tag, 1 byte for the length, - // 1 byte for the first entry, 2 bytes for the second, 1 byte for the third - Assert.AreEqual(6, list.CalculateSize(FieldCodec.ForInt32(tag))); - } - - [Test] - public void CalculateSize_FixedSizePacked() - { - var list = new RepeatedField { 1, 500, 1 }; - var tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - // 1 byte for the tag, 1 byte for the length, 4 bytes per entry - Assert.AreEqual(14, list.CalculateSize(FieldCodec.ForSFixed32(tag))); - } - - [Test] - public void TestNegativeEnumArray() - { - int arraySize = 1 + 1 + (11 * 5); - int msgSize = arraySize; - byte[] bytes = new byte[msgSize]; - CodedOutputStream output = new CodedOutputStream(bytes); - uint tag = WireFormat.MakeTag(8, WireFormat.WireType.Varint); - for (int i = 0; i >= -5; i--) - { - output.WriteTag(tag); - output.WriteEnum(i); - } - - Assert.AreEqual(0, output.SpaceLeft); - - CodedInputStream input = new CodedInputStream(bytes); - tag = input.ReadTag(); - - RepeatedField values = new RepeatedField(); - values.AddEntriesFrom(input, FieldCodec.ForEnum(tag, x => (int)x, x => (SampleEnum)x)); - - Assert.AreEqual(6, values.Count); - Assert.AreEqual(SampleEnum.None, values[0]); - Assert.AreEqual(((SampleEnum)(-1)), values[1]); - Assert.AreEqual(SampleEnum.NegativeValue, values[2]); - Assert.AreEqual(((SampleEnum)(-3)), values[3]); - Assert.AreEqual(((SampleEnum)(-4)), values[4]); - Assert.AreEqual(((SampleEnum)(-5)), values[5]); - } - - - [Test] - public void TestNegativeEnumPackedArray() - { - int arraySize = 1 + (10 * 5); - int msgSize = 1 + 1 + arraySize; - byte[] bytes = new byte[msgSize]; - CodedOutputStream output = new CodedOutputStream(bytes); - // Length-delimited to show we want the packed representation - uint tag = WireFormat.MakeTag(8, WireFormat.WireType.LengthDelimited); - output.WriteTag(tag); - int size = 0; - for (int i = 0; i >= -5; i--) - { - size += CodedOutputStream.ComputeEnumSize(i); - } - output.WriteRawVarint32((uint)size); - for (int i = 0; i >= -5; i--) - { - output.WriteEnum(i); - } - Assert.AreEqual(0, output.SpaceLeft); - - CodedInputStream input = new CodedInputStream(bytes); - tag = input.ReadTag(); - - RepeatedField values = new RepeatedField(); - values.AddEntriesFrom(input, FieldCodec.ForEnum(tag, x => (int)x, x => (SampleEnum)x)); - - Assert.AreEqual(6, values.Count); - Assert.AreEqual(SampleEnum.None, values[0]); - Assert.AreEqual(((SampleEnum)(-1)), values[1]); - Assert.AreEqual(SampleEnum.NegativeValue, values[2]); - Assert.AreEqual(((SampleEnum)(-3)), values[3]); - Assert.AreEqual(((SampleEnum)(-4)), values[4]); - Assert.AreEqual(((SampleEnum)(-5)), values[5]); - } - - // Fairly perfunctory tests for the non-generic IList implementation - [Test] - public void IList_Indexer() - { - var field = new RepeatedField { "first", "second" }; - IList list = field; - Assert.AreEqual("first", list[0]); - list[1] = "changed"; - Assert.AreEqual("changed", field[1]); - } - - [Test] - public void IList_Contains() - { - IList list = new RepeatedField { "first", "second" }; - Assert.IsTrue(list.Contains("second")); - Assert.IsFalse(list.Contains("third")); - Assert.IsFalse(list.Contains(new object())); - } - - [Test] - public void IList_Add() - { - IList list = new RepeatedField { "first", "second" }; - list.Add("third"); - CollectionAssert.AreEqual(new[] { "first", "second", "third" }, list); - } - - [Test] - public void IList_Remove() - { - IList list = new RepeatedField { "first", "second" }; - list.Remove("third"); // No-op, no exception - list.Remove(new object()); // No-op, no exception - list.Remove("first"); - CollectionAssert.AreEqual(new[] { "second" }, list); - } - - [Test] - public void IList_IsFixedSize() - { - var field = new RepeatedField { "first", "second" }; - IList list = field; - Assert.IsFalse(list.IsFixedSize); - } - - [Test] - public void IList_IndexOf() - { - IList list = new RepeatedField { "first", "second" }; - Assert.AreEqual(1, list.IndexOf("second")); - Assert.AreEqual(-1, list.IndexOf("third")); - Assert.AreEqual(-1, list.IndexOf(new object())); - } - - [Test] - public void IList_SyncRoot() - { - IList list = new RepeatedField { "first", "second" }; - Assert.AreSame(list, list.SyncRoot); - } - - [Test] - public void IList_CopyTo() - { - IList list = new RepeatedField { "first", "second" }; - string[] stringArray = new string[4]; - list.CopyTo(stringArray, 1); - CollectionAssert.AreEqual(new[] { null, "first", "second", null }, stringArray); - - object[] objectArray = new object[4]; - list.CopyTo(objectArray, 1); - CollectionAssert.AreEqual(new[] { null, "first", "second", null }, objectArray); - - Assert.Throws(() => list.CopyTo(new StringBuilder[4], 1)); - Assert.Throws(() => list.CopyTo(new int[4], 1)); - } - - [Test] - public void IList_IsSynchronized() - { - IList list = new RepeatedField { "first", "second" }; - Assert.IsFalse(list.IsSynchronized); - } - - [Test] - public void IList_Insert() - { - IList list = new RepeatedField { "first", "second" }; - list.Insert(1, "middle"); - CollectionAssert.AreEqual(new[] { "first", "middle", "second" }, list); - } - - [Test] - public void ToString_Integers() - { - var list = new RepeatedField { 5, 10, 20 }; - var text = list.ToString(); - Assert.AreEqual("[ 5, 10, 20 ]", text); - } - - [Test] - public void ToString_Strings() - { - var list = new RepeatedField { "x", "y", "z" }; - var text = list.ToString(); - Assert.AreEqual("[ \"x\", \"y\", \"z\" ]", text); - } - - [Test] - public void ToString_Messages() - { - var list = new RepeatedField { new TestAllTypes { SingleDouble = 1.5 }, new TestAllTypes { SingleInt32 = 10 } }; - var text = list.ToString(); - Assert.AreEqual("[ { \"singleDouble\": 1.5 }, { \"singleInt32\": 10 } ]", text); - } - - [Test] - public void ToString_Empty() - { - var list = new RepeatedField { }; - var text = list.ToString(); - Assert.AreEqual("[ ]", text); - } - - [Test] - public void ToString_InvalidElementType() - { - var list = new RepeatedField { 15m }; - Assert.Throws(() => list.ToString()); - } - - [Test] - public void ToString_Timestamp() - { - var list = new RepeatedField { Timestamp.FromDateTime(new DateTime(2015, 10, 1, 12, 34, 56, DateTimeKind.Utc)) }; - var text = list.ToString(); - Assert.AreEqual("[ \"2015-10-01T12:34:56Z\" ]", text); - } - - [Test] - public void ToString_Struct() - { - var message = new Struct { Fields = { { "foo", new Value { NumberValue = 20 } } } }; - var list = new RepeatedField { message }; - var text = list.ToString(); - Assert.AreEqual(text, "[ { \"foo\": 20 } ]", message.ToString()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs deleted file mode 100644 index 483cd295749be5761217965c0274a04ede57b686..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs +++ /dev/null @@ -1,75 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using NUnit.Framework; -using System.Reflection; - -namespace Google.Protobuf.Compatibility -{ - public class PropertyInfoExtensionsTest - { - public string PublicReadWrite { get; set; } - private string PrivateReadWrite { get; set; } - public string PublicReadPrivateWrite { get; private set; } - public string PrivateReadPublicWrite { private get; set; } - public string PublicReadOnly { get { return null; } } - private string PrivateReadOnly { get { return null; } } - public string PublicWriteOnly { set { } } - private string PrivateWriteOnly { set { } } - - [Test] - [TestCase("PublicReadWrite")] - [TestCase("PublicReadPrivateWrite")] - [TestCase("PublicReadOnly")] - public void GetGetMethod_Success(string name) - { - var propertyInfo = typeof(PropertyInfoExtensionsTest) - .GetProperty(name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - Assert.IsNotNull(PropertyInfoExtensions.GetGetMethod(propertyInfo)); - } - - [Test] - [TestCase("PrivateReadWrite")] - [TestCase("PrivateReadPublicWrite")] - [TestCase("PrivateReadOnly")] - [TestCase("PublicWriteOnly")] - [TestCase("PrivateWriteOnly")] - public void GetGetMethod_NoAccessibleGetter(string name) - { - var propertyInfo = typeof(PropertyInfoExtensionsTest) - .GetProperty(name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - Assert.IsNull(PropertyInfoExtensions.GetGetMethod(propertyInfo)); - } - - [Test] - [TestCase("PublicReadWrite")] - [TestCase("PrivateReadPublicWrite")] - [TestCase("PublicWriteOnly")] - public void GetSetMethod_Success(string name) - { - var propertyInfo = typeof(PropertyInfoExtensionsTest) - .GetProperty(name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - Assert.IsNotNull(PropertyInfoExtensions.GetSetMethod(propertyInfo)); - } - - [Test] - [TestCase("PublicReadPrivateWrite")] - [TestCase("PrivateReadWrite")] - [TestCase("PrivateReadOnly")] - [TestCase("PublicReadOnly")] - [TestCase("PrivateWriteOnly")] - public void GetSetMethod_NoAccessibleGetter(string name) - { - var propertyInfo = typeof(PropertyInfoExtensionsTest) - .GetProperty(name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - Assert.IsNull(PropertyInfoExtensions.GetSetMethod(propertyInfo)); - } - } - -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs deleted file mode 100644 index 8092d106c9b22cca2679de35396161cb7e548e7e..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs +++ /dev/null @@ -1,94 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Reflection; - -#if !DOTNET35 -namespace Google.Protobuf.Compatibility -{ - public class TypeExtensionsTest - { - public class DerivedList : List { } - public string PublicProperty { get; set; } - private string PrivateProperty { get; set; } - - public void PublicMethod() - { - } - - private void PrivateMethod() - { - } - - [Test] - [TestCase(typeof(object), typeof(string), true)] - [TestCase(typeof(object), typeof(int), true)] - [TestCase(typeof(string), typeof(string), true)] - [TestCase(typeof(string), typeof(object), false)] - [TestCase(typeof(string), typeof(int), false)] - [TestCase(typeof(int), typeof(int), true)] - [TestCase(typeof(ValueType), typeof(int), true)] - [TestCase(typeof(long), typeof(int), false)] // - public void IsAssignableFrom(Type target, Type argument, bool expected) - { - Assert.AreEqual(expected, TypeExtensions.IsAssignableFrom(target, argument)); - } - - [Test] - [TestCase(typeof(DerivedList), "Count")] // Go up the type hierarchy - [TestCase(typeof(List), "Count")] - [TestCase(typeof(List<>), "Count")] - [TestCase(typeof(TypeExtensionsTest), "PublicProperty")] - public void GetProperty_Success(Type type, string name) - { - var property = TypeExtensions.GetProperty(type, name); - Assert.IsNotNull(property); - Assert.AreEqual(name, property.Name); - } - - [Test] - [TestCase(typeof(TypeExtensionsTest), "PrivateProperty")] - [TestCase(typeof(TypeExtensionsTest), "Garbage")] - public void GetProperty_NoSuchProperty(Type type, string name) - { - var property = TypeExtensions.GetProperty(type, name); - Assert.IsNull(property); - } - - [Test] - [TestCase(typeof(DerivedList), "RemoveAt")] // Go up the type hierarchy - [TestCase(typeof(List<>), "RemoveAt")] - [TestCase(typeof(TypeExtensionsTest), "PublicMethod")] - public void GetMethod_Success(Type type, string name) - { - var method = TypeExtensions.GetMethod(type, name); - Assert.IsNotNull(method); - Assert.AreEqual(name, method.Name); - } - - [Test] - [TestCase(typeof(TypeExtensionsTest), "PrivateMethod")] - [TestCase(typeof(TypeExtensionsTest), "GarbageMethod")] - public void GetMethod_NoSuchMethod(Type type, string name) - { - var method = TypeExtensions.GetMethod(type, name); - Assert.IsNull(method); - } - - [Test] - [TestCase(typeof(List), "IndexOf")] - public void GetMethod_Ambiguous(Type type, string name) - { - Assert.Throws(() => TypeExtensions.GetMethod(type, name)); - } - } -} -#endif diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/DeprecatedMemberTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/DeprecatedMemberTest.cs deleted file mode 100644 index cb7dd2b05de03e5a530abe054cd476103e17042d..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/DeprecatedMemberTest.cs +++ /dev/null @@ -1,32 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Reflection; -using Google.Protobuf.TestProtos; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class DeprecatedMemberTest - { - private static void AssertIsDeprecated(MemberInfo member) - { - Assert.NotNull(member); - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); - } - - [Test] - public void TestDepreatedPrimitiveValue() - { - AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty("DeprecatedInt32")); - } - - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/EqualityTester.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/EqualityTester.cs deleted file mode 100644 index 49725da5253ca74aefb6b6d67d68453da64ab631..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/EqualityTester.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using NUnit.Framework; - -namespace Google.Protobuf -{ - /// - /// Helper methods when testing equality. NUnit's Assert.AreEqual and - /// Assert.AreNotEqual methods try to be clever with collections, which can - /// be annoying... - /// - internal static class EqualityTester - { - public static void AssertEquality(T first, T second) where T : IEquatable - { - Assert.IsTrue(first.Equals(second)); - Assert.IsTrue(first.Equals((object) second)); - Assert.AreEqual(first.GetHashCode(), second.GetHashCode()); - } - - public static void AssertInequality(T first, T second) where T : IEquatable - { - Assert.IsFalse(first.Equals(second)); - Assert.IsFalse(first.Equals((object) second)); - // While this isn't a requirement, the chances of this test failing due to - // coincidence rather than a bug are very small. - if (first != null && second != null) - { - Assert.AreNotEqual(first.GetHashCode(), second.GetHashCode()); - } - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs deleted file mode 100644 index a79db979d9766a3142e1755960260e09bad6f50f..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs +++ /dev/null @@ -1,191 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using Google.Protobuf.TestProtos; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class FieldCodecTest - { -#pragma warning disable 0414 // Used by tests via reflection - do not remove! - private static readonly List Codecs = new List - { - new FieldCodecTestData(FieldCodec.ForBool(100), true, "FixedBool"), - new FieldCodecTestData(FieldCodec.ForString(100), "sample", "String"), - new FieldCodecTestData(FieldCodec.ForBytes(100), ByteString.CopyFrom(1, 2, 3), "Bytes"), - new FieldCodecTestData(FieldCodec.ForInt32(100), -1000, "Int32"), - new FieldCodecTestData(FieldCodec.ForSInt32(100), -1000, "SInt32"), - new FieldCodecTestData(FieldCodec.ForSFixed32(100), -1000, "SFixed32"), - new FieldCodecTestData(FieldCodec.ForUInt32(100), 1234, "UInt32"), - new FieldCodecTestData(FieldCodec.ForFixed32(100), 1234, "Fixed32"), - new FieldCodecTestData(FieldCodec.ForInt64(100), -1000, "Int64"), - new FieldCodecTestData(FieldCodec.ForSInt64(100), -1000, "SInt64"), - new FieldCodecTestData(FieldCodec.ForSFixed64(100), -1000, "SFixed64"), - new FieldCodecTestData(FieldCodec.ForUInt64(100), 1234, "UInt64"), - new FieldCodecTestData(FieldCodec.ForFixed64(100), 1234, "Fixed64"), - new FieldCodecTestData(FieldCodec.ForFloat(100), 1234.5f, "FixedFloat"), - new FieldCodecTestData(FieldCodec.ForDouble(100), 1234567890.5d, "FixedDouble"), - new FieldCodecTestData( - FieldCodec.ForEnum(100, t => (int) t, t => (ForeignEnum) t), ForeignEnum.ForeignBaz, "Enum"), - new FieldCodecTestData( - FieldCodec.ForMessage(100, ForeignMessage.Parser), new ForeignMessage { C = 10 }, "Message"), - }; -#pragma warning restore 0414 - - [Test, TestCaseSource("Codecs")] - public void RoundTripWithTag(ICodecTestData codec) - { - codec.TestRoundTripWithTag(); - } - - [Test, TestCaseSource("Codecs")] - public void RoundTripRaw(ICodecTestData codec) - { - codec.TestRoundTripRaw(); - } - - [Test, TestCaseSource("Codecs")] - public void CalculateSize(ICodecTestData codec) - { - codec.TestCalculateSizeWithTag(); - } - - [Test, TestCaseSource("Codecs")] - public void DefaultValue(ICodecTestData codec) - { - codec.TestDefaultValue(); - } - - [Test, TestCaseSource("Codecs")] - public void FixedSize(ICodecTestData codec) - { - codec.TestFixedSize(); - } - - // This is ugly, but it means we can have a non-generic interface. - // It feels like NUnit should support this better, but I don't know - // of any better ways right now. - public interface ICodecTestData - { - void TestRoundTripRaw(); - void TestRoundTripWithTag(); - void TestCalculateSizeWithTag(); - void TestDefaultValue(); - void TestFixedSize(); - } - - public class FieldCodecTestData : ICodecTestData - { - private readonly FieldCodec codec; - private readonly T sampleValue; - private readonly string name; - - public FieldCodecTestData(FieldCodec codec, T sampleValue, string name) - { - this.codec = codec; - this.sampleValue = sampleValue; - this.name = name; - } - - public void TestRoundTripRaw() - { - var stream = new MemoryStream(); - var codedOutput = new CodedOutputStream(stream); - WriteContext.Initialize(codedOutput, out WriteContext ctx); - try - { - // only write the value using the codec - codec.ValueWriter(ref ctx, sampleValue); - } - finally - { - ctx.CopyStateTo(codedOutput); - } - codedOutput.Flush(); - stream.Position = 0; - var codedInput = new CodedInputStream(stream); - Assert.AreEqual(sampleValue, codec.Read(codedInput)); - Assert.IsTrue(codedInput.IsAtEnd); - } - - public void TestRoundTripWithTag() - { - var stream = new MemoryStream(); - var codedOutput = new CodedOutputStream(stream); - codec.WriteTagAndValue(codedOutput, sampleValue); - codedOutput.Flush(); - stream.Position = 0; - var codedInput = new CodedInputStream(stream); - codedInput.AssertNextTag(codec.Tag); - Assert.AreEqual(sampleValue, codec.Read(codedInput)); - Assert.IsTrue(codedInput.IsAtEnd); - } - - public void TestCalculateSizeWithTag() - { - var stream = new MemoryStream(); - var codedOutput = new CodedOutputStream(stream); - codec.WriteTagAndValue(codedOutput, sampleValue); - codedOutput.Flush(); - Assert.AreEqual(stream.Position, codec.CalculateSizeWithTag(sampleValue)); - } - - public void TestDefaultValue() - { - // WriteTagAndValue ignores default values - var stream = new MemoryStream(); - var codedOutput = new CodedOutputStream(stream); - codec.WriteTagAndValue(codedOutput, codec.DefaultValue); - codedOutput.Flush(); - Assert.AreEqual(0, stream.Position); - Assert.AreEqual(0, codec.CalculateSizeWithTag(codec.DefaultValue)); - if (typeof(T).GetTypeInfo().IsValueType) - { - Assert.AreEqual(default(T), codec.DefaultValue); - } - - // The plain ValueWriter/ValueReader delegates don't. - if (codec.DefaultValue != null) // This part isn't appropriate for message types. - { - codedOutput = new CodedOutputStream(stream); - WriteContext.Initialize(codedOutput, out WriteContext ctx); - try - { - // only write the value using the codec - codec.ValueWriter(ref ctx, codec.DefaultValue); - } - finally - { - ctx.CopyStateTo(codedOutput); - } - codedOutput.Flush(); - Assert.AreNotEqual(0, stream.Position); - Assert.AreEqual(stream.Position, codec.ValueSizeCalculator(codec.DefaultValue)); - stream.Position = 0; - var codedInput = new CodedInputStream(stream); - Assert.AreEqual(codec.DefaultValue, codec.Read(codedInput)); - } - } - - public void TestFixedSize() - { - Assert.AreEqual(name.Contains("Fixed"), codec.FixedSize != 0); - } - - public override string ToString() - { - return name; - } - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/GeneratedMessageTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/GeneratedMessageTest.cs deleted file mode 100644 index d064c3bb3c1ea8cf33e77632c7086d3ffae4ae8a..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/GeneratedMessageTest.cs +++ /dev/null @@ -1,702 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using Google.Protobuf.TestProtos; -using NUnit.Framework; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Google.Protobuf.WellKnownTypes; - -namespace Google.Protobuf -{ - /// - /// Tests around the generated TestAllTypes message. - /// - public class GeneratedMessageTest - { - [Test] - public void EmptyMessageFieldDistinctFromMissingMessageField() - { - // This demonstrates what we're really interested in... - var message1 = new TestAllTypes { SingleForeignMessage = new ForeignMessage() }; - var message2 = new TestAllTypes(); // SingleForeignMessage is null - EqualityTester.AssertInequality(message1, message2); - } - - [Test] - public void DefaultValues() - { - // Single fields - var message = new TestAllTypes(); - Assert.AreEqual(false, message.SingleBool); - Assert.AreEqual(ByteString.Empty, message.SingleBytes); - Assert.AreEqual(0.0, message.SingleDouble); - Assert.AreEqual(0, message.SingleFixed32); - Assert.AreEqual(0L, message.SingleFixed64); - Assert.AreEqual(0.0f, message.SingleFloat); - Assert.AreEqual(ForeignEnum.ForeignUnspecified, message.SingleForeignEnum); - Assert.IsNull(message.SingleForeignMessage); - Assert.AreEqual(ImportEnum.Unspecified, message.SingleImportEnum); - Assert.IsNull(message.SingleImportMessage); - Assert.AreEqual(0, message.SingleInt32); - Assert.AreEqual(0L, message.SingleInt64); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.Unspecified, message.SingleNestedEnum); - Assert.IsNull(message.SingleNestedMessage); - Assert.IsNull(message.SinglePublicImportMessage); - Assert.AreEqual(0, message.SingleSfixed32); - Assert.AreEqual(0L, message.SingleSfixed64); - Assert.AreEqual(0, message.SingleSint32); - Assert.AreEqual(0L, message.SingleSint64); - Assert.AreEqual("", message.SingleString); - Assert.AreEqual(0U, message.SingleUint32); - Assert.AreEqual(0UL, message.SingleUint64); - - // Repeated fields - Assert.AreEqual(0, message.RepeatedBool.Count); - Assert.AreEqual(0, message.RepeatedBytes.Count); - Assert.AreEqual(0, message.RepeatedDouble.Count); - Assert.AreEqual(0, message.RepeatedFixed32.Count); - Assert.AreEqual(0, message.RepeatedFixed64.Count); - Assert.AreEqual(0, message.RepeatedFloat.Count); - Assert.AreEqual(0, message.RepeatedForeignEnum.Count); - Assert.AreEqual(0, message.RepeatedForeignMessage.Count); - Assert.AreEqual(0, message.RepeatedImportEnum.Count); - Assert.AreEqual(0, message.RepeatedImportMessage.Count); - Assert.AreEqual(0, message.RepeatedNestedEnum.Count); - Assert.AreEqual(0, message.RepeatedNestedMessage.Count); - Assert.AreEqual(0, message.RepeatedPublicImportMessage.Count); - Assert.AreEqual(0, message.RepeatedSfixed32.Count); - Assert.AreEqual(0, message.RepeatedSfixed64.Count); - Assert.AreEqual(0, message.RepeatedSint32.Count); - Assert.AreEqual(0, message.RepeatedSint64.Count); - Assert.AreEqual(0, message.RepeatedString.Count); - Assert.AreEqual(0, message.RepeatedUint32.Count); - Assert.AreEqual(0, message.RepeatedUint64.Count); - - // Oneof fields - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - } - - [Test] - public void NullStringAndBytesRejected() - { - var message = new TestAllTypes(); - Assert.Throws(() => message.SingleString = null); - Assert.Throws(() => message.OneofString = null); - Assert.Throws(() => message.SingleBytes = null); - Assert.Throws(() => message.OneofBytes = null); - } - - [Test] - public void RoundTrip_Empty() - { - var message = new TestAllTypes(); - // Without setting any values, there's nothing to write. - byte[] bytes = message.ToByteArray(); - Assert.AreEqual(0, bytes.Length); - TestAllTypes parsed = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); - } - - [Test] - public void RoundTrip_SingleValues() - { - var message = new TestAllTypes - { - SingleBool = true, - SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), - SingleDouble = 23.5, - SingleFixed32 = 23, - SingleFixed64 = 1234567890123, - SingleFloat = 12.25f, - SingleForeignEnum = ForeignEnum.ForeignBar, - SingleForeignMessage = new ForeignMessage { C = 10 }, - SingleImportEnum = ImportEnum.ImportBaz, - SingleImportMessage = new ImportMessage { D = 20 }, - SingleInt32 = 100, - SingleInt64 = 3210987654321, - SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, - SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 35 }, - SinglePublicImportMessage = new PublicImportMessage { E = 54 }, - SingleSfixed32 = -123, - SingleSfixed64 = -12345678901234, - SingleSint32 = -456, - SingleSint64 = -12345678901235, - SingleString = "test", - SingleUint32 = uint.MaxValue, - SingleUint64 = ulong.MaxValue - }; - - byte[] bytes = message.ToByteArray(); - TestAllTypes parsed = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); - } - - [Test] - public void RoundTrip_RepeatedValues() - { - var message = new TestAllTypes - { - RepeatedBool = { true, false }, - RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.CopyFrom(5, 6) }, - RepeatedDouble = { -12.25, 23.5 }, - RepeatedFixed32 = { uint.MaxValue, 23 }, - RepeatedFixed64 = { ulong.MaxValue, 1234567890123 }, - RepeatedFloat = { 100f, 12.25f }, - RepeatedForeignEnum = { ForeignEnum.ForeignFoo, ForeignEnum.ForeignBar }, - RepeatedForeignMessage = { new ForeignMessage(), new ForeignMessage { C = 10 } }, - RepeatedImportEnum = { ImportEnum.ImportBaz, ImportEnum.Unspecified }, - RepeatedImportMessage = { new ImportMessage { D = 20 }, new ImportMessage { D = 25 } }, - RepeatedInt32 = { 100, 200 }, - RepeatedInt64 = { 3210987654321, long.MaxValue }, - RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAllTypes.Types.NestedEnum.Neg }, - RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage { Bb = 35 }, new TestAllTypes.Types.NestedMessage { Bb = 10 } }, - RepeatedPublicImportMessage = { new PublicImportMessage { E = 54 }, new PublicImportMessage { E = -1 } }, - RepeatedSfixed32 = { -123, 123 }, - RepeatedSfixed64 = { -12345678901234, 12345678901234 }, - RepeatedSint32 = { -456, 100 }, - RepeatedSint64 = { -12345678901235, 123 }, - RepeatedString = { "foo", "bar" }, - RepeatedUint32 = { uint.MaxValue, uint.MinValue }, - RepeatedUint64 = { ulong.MaxValue, uint.MinValue } - }; - - byte[] bytes = message.ToByteArray(); - TestAllTypes parsed = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); - } - - // Note that not every map within map_unittest_proto3 is used. They all go through very - // similar code paths. The fact that all maps are present is validation that we have codecs - // for every type. - [Test] - public void RoundTrip_Maps() - { - var message = new TestMap - { - MapBoolBool = { - { false, true }, - { true, false } - }, - MapInt32Bytes = { - { 5, ByteString.CopyFrom(6, 7, 8) }, - { 25, ByteString.CopyFrom(1, 2, 3, 4, 5) }, - { 10, ByteString.Empty } - }, - MapInt32ForeignMessage = { - { 0, new ForeignMessage { C = 10 } }, - { 5, new ForeignMessage() }, - }, - MapInt32Enum = { - { 1, MapEnum.Bar }, - { 2000, MapEnum.Foo } - } - }; - - byte[] bytes = message.ToByteArray(); - TestMap parsed = TestMap.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); - } - - [Test] - public void MapWithEmptyEntry() - { - var message = new TestMap - { - MapInt32Bytes = { { 0, ByteString.Empty } } - }; - - byte[] bytes = message.ToByteArray(); - Assert.AreEqual(2, bytes.Length); // Tag for field entry (1 byte), length of entry (0; 1 byte) - - var parsed = TestMap.Parser.ParseFrom(bytes); - Assert.AreEqual(1, parsed.MapInt32Bytes.Count); - Assert.AreEqual(ByteString.Empty, parsed.MapInt32Bytes[0]); - } - - [Test] - public void MapWithOnlyValue() - { - // Hand-craft the stream to contain a single entry with just a value. - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - output.WriteTag(TestMap.MapInt32ForeignMessageFieldNumber, WireFormat.WireType.LengthDelimited); - var nestedMessage = new ForeignMessage { C = 20 }; - // Size of the entry (tag, size written by WriteMessage, data written by WriteMessage) - output.WriteLength(2 + nestedMessage.CalculateSize()); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteMessage(nestedMessage); - output.Flush(); - - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(nestedMessage, parsed.MapInt32ForeignMessage[0]); - } - - [Test] - public void MapWithOnlyKey_PrimitiveValue() - { - // Hand-craft the stream to contain a single entry with just a key. - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - output.WriteTag(TestMap.MapInt32DoubleFieldNumber, WireFormat.WireType.LengthDelimited); - int key = 10; - output.WriteLength(1 + CodedOutputStream.ComputeInt32Size(key)); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.Flush(); - - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(0.0, parsed.MapInt32Double[key]); - } - - [Test] - public void MapWithOnlyKey_MessageValue() - { - // Hand-craft the stream to contain a single entry with just a key. - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - output.WriteTag(TestMap.MapInt32ForeignMessageFieldNumber, WireFormat.WireType.LengthDelimited); - int key = 10; - output.WriteLength(1 + CodedOutputStream.ComputeInt32Size(key)); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.Flush(); - - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(new ForeignMessage(), parsed.MapInt32ForeignMessage[key]); - } - - [Test] - public void MapIgnoresExtraFieldsWithinEntryMessages() - { - // Hand-craft the stream to contain a single entry with three fields - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - - var key = 10; // Field 1 - var value = 20; // Field 2 - var extra = 30; // Field 3 - - // Each field can be represented in a single byte, with a single byte tag. - // Total message size: 6 bytes. - output.WriteLength(6); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value); - output.WriteTag(3, WireFormat.WireType.Varint); - output.WriteInt32(extra); - output.Flush(); - - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(value, parsed.MapInt32Int32[key]); - } - - [Test] - public void MapFieldOrderIsIrrelevant() - { - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - - var key = 10; - var value = 20; - - // Each field can be represented in a single byte, with a single byte tag. - // Total message size: 4 bytes. - output.WriteLength(4); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.Flush(); - - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(value, parsed.MapInt32Int32[key]); - } - - [Test] - public void MapNonContiguousEntries() - { - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - // Message structure: - // Entry for MapInt32Int32 - // Entry for MapStringString - // Entry for MapInt32Int32 - - // First entry - var key1 = 10; - var value1 = 20; - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key1); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value1); - - // Second entry - var key2 = "a"; - var value2 = "b"; - output.WriteTag(TestMap.MapStringStringFieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(6); // 3 bytes per entry: tag, size, character - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteString(key2); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteString(value2); - - // Third entry - var key3 = 15; - var value3 = 25; - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key3); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value3); - - output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - var expected = new TestMap - { - MapInt32Int32 = { { key1, value1 }, { key3, value3 } }, - MapStringString = { { key2, value2 } } - }; - Assert.AreEqual(expected, parsed); - } - - [Test] - public void DuplicateKeys_LastEntryWins() - { - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - var key = 10; - var value1 = 20; - var value2 = 30; - - // First entry - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value1); - - // Second entry - same key, different value - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value2); - output.Flush(); - - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(value2, parsed.MapInt32Int32[key]); - } - - [Test] - public void CloneSingleNonMessageValues() - { - var original = new TestAllTypes - { - SingleBool = true, - SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), - SingleDouble = 23.5, - SingleFixed32 = 23, - SingleFixed64 = 1234567890123, - SingleFloat = 12.25f, - SingleInt32 = 100, - SingleInt64 = 3210987654321, - SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, - SingleSfixed32 = -123, - SingleSfixed64 = -12345678901234, - SingleSint32 = -456, - SingleSint64 = -12345678901235, - SingleString = "test", - SingleUint32 = uint.MaxValue, - SingleUint64 = ulong.MaxValue - }; - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreEqual(original, clone); - // Just as a single example - clone.SingleInt32 = 150; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneRepeatedNonMessageValues() - { - var original = new TestAllTypes - { - RepeatedBool = { true, false }, - RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.CopyFrom(5, 6) }, - RepeatedDouble = { -12.25, 23.5 }, - RepeatedFixed32 = { uint.MaxValue, 23 }, - RepeatedFixed64 = { ulong.MaxValue, 1234567890123 }, - RepeatedFloat = { 100f, 12.25f }, - RepeatedInt32 = { 100, 200 }, - RepeatedInt64 = { 3210987654321, long.MaxValue }, - RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAllTypes.Types.NestedEnum.Neg }, - RepeatedSfixed32 = { -123, 123 }, - RepeatedSfixed64 = { -12345678901234, 12345678901234 }, - RepeatedSint32 = { -456, 100 }, - RepeatedSint64 = { -12345678901235, 123 }, - RepeatedString = { "foo", "bar" }, - RepeatedUint32 = { uint.MaxValue, uint.MinValue }, - RepeatedUint64 = { ulong.MaxValue, uint.MinValue } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreEqual(original, clone); - // Just as a single example - clone.RepeatedDouble.Add(25.5); - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneSingleMessageField() - { - var original = new TestAllTypes - { - SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 20 } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreNotSame(original.SingleNestedMessage, clone.SingleNestedMessage); - Assert.AreEqual(original, clone); - - clone.SingleNestedMessage.Bb = 30; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneRepeatedMessageField() - { - var original = new TestAllTypes - { - RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage { Bb = 20 } } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreNotSame(original.RepeatedNestedMessage, clone.RepeatedNestedMessage); - Assert.AreNotSame(original.RepeatedNestedMessage[0], clone.RepeatedNestedMessage[0]); - Assert.AreEqual(original, clone); - - clone.RepeatedNestedMessage[0].Bb = 30; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneOneofField() - { - var original = new TestAllTypes - { - OneofNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 20 } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreEqual(original, clone); - - // We should have cloned the message - original.OneofNestedMessage.Bb = 30; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void OneofProperties() - { - // Switch the oneof case between each of the different options, and check everything behaves - // as expected in each case. - var message = new TestAllTypes(); - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - - message.OneofString = "sample"; - Assert.AreEqual("sample", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofString, message.OneofFieldCase); - - var bytes = ByteString.CopyFrom(1, 2, 3); - message.OneofBytes = bytes; - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(bytes, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofBytes, message.OneofFieldCase); - - message.OneofUint32 = 20; - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(20, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message.OneofFieldCase); - - var nestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 25 }; - message.OneofNestedMessage = nestedMessage; - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.AreEqual(nestedMessage, message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofNestedMessage, message.OneofFieldCase); - - message.ClearOneofField(); - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - } - - [Test] - public void Oneof_DefaultValuesNotEqual() - { - var message1 = new TestAllTypes { OneofString = "" }; - var message2 = new TestAllTypes { OneofUint32 = 0 }; - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofString, message1.OneofFieldCase); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message2.OneofFieldCase); - Assert.AreNotEqual(message1, message2); - } - - [Test] - public void OneofSerialization_NonDefaultValue() - { - var message = new TestAllTypes(); - message.OneofString = "this would take a bit of space"; - message.OneofUint32 = 10; - var bytes = message.ToByteArray(); - Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - no string! - - var message2 = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, message2); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message2.OneofFieldCase); - } - - [Test] - public void OneofSerialization_DefaultValue() - { - var message = new TestAllTypes(); - message.OneofString = "this would take a bit of space"; - message.OneofUint32 = 0; // This is the default value for UInt32; normally wouldn't be serialized - var bytes = message.ToByteArray(); - Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - it's still serialized - - var message2 = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, message2); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message2.OneofFieldCase); - } - - [Test] - public void DiscardUnknownFields_RealDataStillRead() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - var unusedFieldNumber = 23456; - Assert.IsFalse(TestAllTypes.Descriptor.Fields.InDeclarationOrder().Select(x => x.FieldNumber).Contains(unusedFieldNumber)); - output.WriteTag(unusedFieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteString("ignore me"); - message.WriteTo(output); - output.Flush(); - - stream.Position = 0; - var parsed = TestAllTypes.Parser.ParseFrom(stream); - // TODO: Add test back after DiscardUnknownFields is supported - // Assert.AreEqual(message, parsed); - } - - [Test] - public void DiscardUnknownFields_AllTypes() - { - // Simple way of ensuring we can skip all kinds of fields. - var data = SampleMessages.CreateFullTestAllTypes().ToByteArray(); - var empty = Empty.Parser.ParseFrom(data); - // TODO: Add test back after DiscardUnknownField is supported. - // Assert.AreEqual(new Empty(), empty); - } - - // This was originally seen as a conformance test failure. - [Test] - public void TruncatedMessageFieldThrows() - { - // 130, 3 is the message tag - // 1 is the data length - but there's no data. - var data = new byte[] { 130, 3, 1 }; - Assert.Throws(() => TestAllTypes.Parser.ParseFrom(data)); - } - - /// - /// Demonstrates current behaviour with an extraneous end group tag - see issue 688 - /// for details; we may want to change this. - /// - [Test] - public void ExtraEndGroupThrows() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - - output.WriteTag(TestAllTypes.SingleFixed32FieldNumber, WireFormat.WireType.Fixed32); - output.WriteFixed32(123); - output.WriteTag(100, WireFormat.WireType.EndGroup); - - output.Flush(); - - stream.Position = 0; - Assert.Throws(() => TestAllTypes.Parser.ParseFrom(stream)); - } - - [Test] - public void CustomDiagnosticMessage_DirectToStringCall() - { - var message = new ForeignMessage { C = 31 }; - Assert.AreEqual("{ \"c\": 31, \"@cInHex\": \"1f\" }", message.ToString()); - Assert.AreEqual("{ \"c\": 31 }", JsonFormatter.Default.Format(message)); - } - - [Test] - public void CustomDiagnosticMessage_Nested() - { - var message = new TestAllTypes { SingleForeignMessage = new ForeignMessage { C = 16 } }; - Assert.AreEqual("{ \"singleForeignMessage\": { \"c\": 16, \"@cInHex\": \"10\" } }", message.ToString()); - Assert.AreEqual("{ \"singleForeignMessage\": { \"c\": 16 } }", JsonFormatter.Default.Format(message)); - } - - [Test] - public void CustomDiagnosticMessage_DirectToTextWriterCall() - { - var message = new ForeignMessage { C = 31 }; - var writer = new StringWriter(); - JsonFormatter.Default.Format(message, writer); - Assert.AreEqual("{ \"c\": 31 }", writer.ToString()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/IssuesTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/IssuesTest.cs deleted file mode 100644 index 2e5617b00397ddcf54361edfd94056afd0e8e28e..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/IssuesTest.cs +++ /dev/null @@ -1,59 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.Reflection; -using UnitTest.Issues.TestProtos; -using NUnit.Framework; - - -namespace Google.Protobuf -{ - /// - /// Tests for issues which aren't easily compartmentalized into other unit tests. - /// - public class IssuesTest - { - // Issue 45 - [Test] - public void FieldCalledItem() - { - ItemField message = new ItemField { Item = 3 }; - FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item"); - Assert.NotNull(field); - Assert.AreEqual(3, (int)field.Accessor.GetValue(message)); - } - - [Test] - public void ReservedNames() - { - var message = new ReservedNames { Types_ = 10, Descriptor_ = 20 }; - // Underscores aren't reflected in the JSON. - Assert.AreEqual("{ \"types\": 10, \"descriptor\": 20 }", message.ToString()); - } - - [Test] - public void JsonNameParseTest() - { - var settings = new JsonParser.Settings(10, TypeRegistry.FromFiles(UnittestIssuesReflection.Descriptor)); - var parser = new JsonParser(settings); - - // It is safe to use either original field name or explicitly specified json_name - Assert.AreEqual(new TestJsonName { Name = "test", Description = "test2", Guid = "test3" }, - parser.Parse("{ \"name\": \"test\", \"desc\": \"test2\", \"guid\": \"test3\" }")); - } - - [Test] - public void JsonNameFormatTest() - { - var message = new TestJsonName { Name = "test", Description = "test2", Guid = "test3" }; - Assert.AreEqual("{ \"name\": \"test\", \"desc\": \"test2\", \"exid\": \"test3\" }", - JsonFormatter.Default.Format(message)); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonParserTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonParserTest.cs deleted file mode 100644 index 2419eacb3004451ad419372eec0b7f10181c9ca0..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonParserTest.cs +++ /dev/null @@ -1,916 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.Reflection; -using Google.Protobuf.TestProtos; -using Google.Protobuf.WellKnownTypes; -using NUnit.Framework; -using System; - -namespace Google.Protobuf -{ - /// - /// Unit tests for JSON parsing. - /// - public class JsonParserTest - { - // Sanity smoke test - [Test] - public void AllTypesRoundtrip() - { - AssertRoundtrip(SampleMessages.CreateFullTestAllTypes()); - } - - [Test] - public void Maps() - { - AssertRoundtrip(new TestMap { MapStringString = { { "with spaces", "bar" }, { "a", "b" } } }); - AssertRoundtrip(new TestMap { MapInt32Int32 = { { 0, 1 }, { 2, 3 } } }); - AssertRoundtrip(new TestMap { MapBoolBool = { { false, true }, { true, false } } }); - } - - [Test] - [TestCase(" 1 ")] - [TestCase("+1")] - [TestCase("1,000")] - [TestCase("1.5")] - public void IntegerMapKeysAreStrict(string keyText) - { - // Test that integer parsing is strict. We assume that if this is correct for int32, - // it's correct for other numeric key types. - var json = "{ \"mapInt32Int32\": { \"" + keyText + "\" : \"1\" } }"; - Assert.Throws(() => JsonParser.Default.Parse(json)); - } - - [Test] - public void OriginalFieldNameAccepted() - { - var json = "{ \"single_int32\": 10 }"; - var expected = new TestAllTypes { SingleInt32 = 10 }; - Assert.AreEqual(expected, TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - public void SourceContextRoundtrip() - { - AssertRoundtrip(new SourceContext { FileName = "foo.proto" }); - } - - [Test] - public void SingularWrappers_DefaultNonNullValues() - { - var message = new TestWellKnownTypes - { - StringField = "", - BytesField = ByteString.Empty, - BoolField = false, - FloatField = 0f, - DoubleField = 0d, - Int32Field = 0, - Int64Field = 0, - Uint32Field = 0, - Uint64Field = 0 - }; - AssertRoundtrip(message); - } - - [Test] - public void SingularWrappers_NonDefaultValues() - { - var message = new TestWellKnownTypes - { - StringField = "x", - BytesField = ByteString.CopyFrom(1, 2, 3), - BoolField = true, - FloatField = 12.5f, - DoubleField = 12.25d, - Int32Field = 1, - Int64Field = 2, - Uint32Field = 3, - Uint64Field = 4 - }; - AssertRoundtrip(message); - } - - [Test] - public void SingularWrappers_ExplicitNulls() - { - // When we parse the "valueField": null part, we remember it... basically, it's one case - // where explicit default values don't fully roundtrip. - var message = new TestWellKnownTypes { ValueField = Value.ForNull() }; - var json = new JsonFormatter(new JsonFormatter.Settings(true)).Format(message); - var parsed = JsonParser.Default.Parse(json); - Assert.AreEqual(message, parsed); - } - - [Test] - [TestCase(typeof(BoolValue), "true", true)] - [TestCase(typeof(Int32Value), "32", 32)] - [TestCase(typeof(Int64Value), "32", 32L)] - [TestCase(typeof(Int64Value), "\"32\"", 32L)] - [TestCase(typeof(UInt32Value), "32", 32U)] - [TestCase(typeof(UInt64Value), "\"32\"", 32UL)] - [TestCase(typeof(UInt64Value), "32", 32UL)] - [TestCase(typeof(StringValue), "\"foo\"", "foo")] - [TestCase(typeof(FloatValue), "1.5", 1.5f)] - [TestCase(typeof(DoubleValue), "1.5", 1.5d)] - public void Wrappers_Standalone(System.Type wrapperType, string json, object expectedValue) - { - IMessage parsed = (IMessage)Activator.CreateInstance(wrapperType); - IMessage expected = (IMessage)Activator.CreateInstance(wrapperType); - JsonParser.Default.Merge(parsed, "null"); - Assert.AreEqual(expected, parsed); - - JsonParser.Default.Merge(parsed, json); - expected.Descriptor.Fields[WrappersReflection.WrapperValueFieldNumber].Accessor.SetValue(expected, expectedValue); - Assert.AreEqual(expected, parsed); - } - - [Test] - public void ExplicitNullValue() - { - string json = "{\"valueField\": null}"; - var message = JsonParser.Default.Parse(json); - Assert.AreEqual(new TestWellKnownTypes { ValueField = Value.ForNull() }, message); - } - - [Test] - public void BytesWrapper_Standalone() - { - ByteString data = ByteString.CopyFrom(1, 2, 3); - // Can't do this with attributes... - var parsed = JsonParser.Default.Parse(WrapInQuotes(data.ToBase64())); - var expected = new BytesValue { Value = data }; - Assert.AreEqual(expected, parsed); - } - - [Test] - public void RepeatedWrappers() - { - var message = new RepeatedWellKnownTypes - { - BoolField = { true, false }, - BytesField = { ByteString.CopyFrom(1, 2, 3), ByteString.CopyFrom(4, 5, 6), ByteString.Empty }, - DoubleField = { 12.5, -1.5, 0d }, - FloatField = { 123.25f, -20f, 0f }, - Int32Field = { int.MaxValue, int.MinValue, 0 }, - Int64Field = { long.MaxValue, long.MinValue, 0L }, - StringField = { "First", "Second", "" }, - Uint32Field = { uint.MaxValue, uint.MinValue, 0U }, - Uint64Field = { ulong.MaxValue, ulong.MinValue, 0UL }, - }; - AssertRoundtrip(message); - } - - [Test] - public void RepeatedField_NullElementProhibited() - { - string json = "{ \"repeated_foreign_message\": [null] }"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - public void RepeatedField_NullOverallValueAllowed() - { - string json = "{ \"repeated_foreign_message\": null }"; - Assert.AreEqual(new TestAllTypes(), TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("{ \"mapInt32Int32\": { \"10\": null }")] - [TestCase("{ \"mapStringString\": { \"abc\": null }")] - [TestCase("{ \"mapInt32ForeignMessage\": { \"10\": null }")] - public void MapField_NullValueProhibited(string json) - { - Assert.Throws(() => TestMap.Parser.ParseJson(json)); - } - - [Test] - public void MapField_NullOverallValueAllowed() - { - string json = "{ \"mapInt32Int32\": null }"; - Assert.AreEqual(new TestMap(), TestMap.Parser.ParseJson(json)); - } - - [Test] - public void IndividualWrapperTypes() - { - Assert.AreEqual(new StringValue { Value = "foo" }, StringValue.Parser.ParseJson("\"foo\"")); - Assert.AreEqual(new Int32Value { Value = 1 }, Int32Value.Parser.ParseJson("1")); - // Can parse strings directly too - Assert.AreEqual(new Int32Value { Value = 1 }, Int32Value.Parser.ParseJson("\"1\"")); - } - - private static void AssertRoundtrip(T message) where T : IMessage, new() - { - var clone = message.Clone(); - var json = JsonFormatter.Default.Format(message); - var parsed = JsonParser.Default.Parse(json); - Assert.AreEqual(clone, parsed); - } - - [Test] - [TestCase("0", 0)] - [TestCase("-0", 0)] // Not entirely clear whether we intend to allow this... - [TestCase("1", 1)] - [TestCase("-1", -1)] - [TestCase("2147483647", 2147483647)] - [TestCase("-2147483648", -2147483648)] - public void StringToInt32_Valid(string jsonValue, int expectedParsedValue) - { - string json = "{ \"singleInt32\": \"" + jsonValue + "\"}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleInt32); - } - - [Test] - [TestCase("+0")] - [TestCase(" 1")] - [TestCase("1 ")] - [TestCase("00")] - [TestCase("-00")] - [TestCase("--1")] - [TestCase("+1")] - [TestCase("1.5")] - [TestCase("1e10")] - [TestCase("2147483648")] - [TestCase("-2147483649")] - public void StringToInt32_Invalid(string jsonValue) - { - string json = "{ \"singleInt32\": \"" + jsonValue + "\"}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0U)] - [TestCase("1", 1U)] - [TestCase("4294967295", 4294967295U)] - public void StringToUInt32_Valid(string jsonValue, uint expectedParsedValue) - { - string json = "{ \"singleUint32\": \"" + jsonValue + "\"}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleUint32); - } - - // Assume that anything non-bounds-related is covered in the Int32 case - [Test] - [TestCase("-1")] - [TestCase("4294967296")] - public void StringToUInt32_Invalid(string jsonValue) - { - string json = "{ \"singleUint32\": \"" + jsonValue + "\"}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0L)] - [TestCase("1", 1L)] - [TestCase("-1", -1L)] - [TestCase("9223372036854775807", 9223372036854775807)] - [TestCase("-9223372036854775808", -9223372036854775808)] - public void StringToInt64_Valid(string jsonValue, long expectedParsedValue) - { - string json = "{ \"singleInt64\": \"" + jsonValue + "\"}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleInt64); - } - - // Assume that anything non-bounds-related is covered in the Int32 case - [Test] - [TestCase("-9223372036854775809")] - [TestCase("9223372036854775808")] - public void StringToInt64_Invalid(string jsonValue) - { - string json = "{ \"singleInt64\": \"" + jsonValue + "\"}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0UL)] - [TestCase("1", 1UL)] - [TestCase("18446744073709551615", 18446744073709551615)] - public void StringToUInt64_Valid(string jsonValue, ulong expectedParsedValue) - { - string json = "{ \"singleUint64\": \"" + jsonValue + "\"}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleUint64); - } - - // Assume that anything non-bounds-related is covered in the Int32 case - [Test] - [TestCase("-1")] - [TestCase("18446744073709551616")] - public void StringToUInt64_Invalid(string jsonValue) - { - string json = "{ \"singleUint64\": \"" + jsonValue + "\"}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0d)] - [TestCase("1", 1d)] - [TestCase("1.000000", 1d)] - [TestCase("1.0000000000000000000000001", 1d)] // We don't notice that we haven't preserved the exact value - [TestCase("-1", -1d)] - [TestCase("1e1", 10d)] - [TestCase("1e01", 10d)] // Leading decimals are allowed in exponents - [TestCase("1E1", 10d)] // Either case is fine - [TestCase("-1e1", -10d)] - [TestCase("1.5e1", 15d)] - [TestCase("-1.5e1", -15d)] - [TestCase("15e-1", 1.5d)] - [TestCase("-15e-1", -1.5d)] - [TestCase("1.79769e308", 1.79769e308)] - [TestCase("-1.79769e308", -1.79769e308)] - [TestCase("Infinity", double.PositiveInfinity)] - [TestCase("-Infinity", double.NegativeInfinity)] - [TestCase("NaN", double.NaN)] - public void StringToDouble_Valid(string jsonValue, double expectedParsedValue) - { - string json = "{ \"singleDouble\": \"" + jsonValue + "\"}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleDouble); - } - - [Test] - [TestCase("1.7977e308")] - [TestCase("-1.7977e308")] - [TestCase("1e309")] - [TestCase("1,0")] - [TestCase("1.0.0")] - [TestCase("+1")] - [TestCase("00")] - [TestCase("01")] - [TestCase("-00")] - [TestCase("-01")] - [TestCase("--1")] - [TestCase(" Infinity")] - [TestCase(" -Infinity")] - [TestCase("NaN ")] - [TestCase("Infinity ")] - [TestCase("-Infinity ")] - [TestCase(" NaN")] - [TestCase("INFINITY")] - [TestCase("nan")] - [TestCase("\u00BD")] // 1/2 as a single Unicode character. Just sanity checking... - public void StringToDouble_Invalid(string jsonValue) - { - string json = "{ \"singleDouble\": \"" + jsonValue + "\"}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0f)] - [TestCase("1", 1f)] - [TestCase("1.000000", 1f)] - [TestCase("-1", -1f)] - [TestCase("3.402823e38", 3.402823e38f)] - [TestCase("-3.402823e38", -3.402823e38f)] - [TestCase("1.5e1", 15f)] - [TestCase("15e-1", 1.5f)] - public void StringToFloat_Valid(string jsonValue, float expectedParsedValue) - { - string json = "{ \"singleFloat\": \"" + jsonValue + "\"}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleFloat); - } - - [Test] - [TestCase("3.402824e38")] - [TestCase("-3.402824e38")] - [TestCase("1,0")] - [TestCase("1.0.0")] - [TestCase("+1")] - [TestCase("00")] - [TestCase("--1")] - public void StringToFloat_Invalid(string jsonValue) - { - string json = "{ \"singleFloat\": \"" + jsonValue + "\"}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0)] - [TestCase("-0", 0)] // Not entirely clear whether we intend to allow this... - [TestCase("1", 1)] - [TestCase("-1", -1)] - [TestCase("2147483647", 2147483647)] - [TestCase("-2147483648", -2147483648)] - [TestCase("1e1", 10)] - [TestCase("-1e1", -10)] - [TestCase("10.00", 10)] - [TestCase("-10.00", -10)] - public void NumberToInt32_Valid(string jsonValue, int expectedParsedValue) - { - string json = "{ \"singleInt32\": " + jsonValue + "}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleInt32); - } - - [Test] - [TestCase("+0", typeof(InvalidJsonException))] - [TestCase("00", typeof(InvalidJsonException))] - [TestCase("-00", typeof(InvalidJsonException))] - [TestCase("--1", typeof(InvalidJsonException))] - [TestCase("+1", typeof(InvalidJsonException))] - [TestCase("1.5", typeof(InvalidProtocolBufferException))] - // Value is out of range - [TestCase("1e10", typeof(InvalidProtocolBufferException))] - [TestCase("2147483648", typeof(InvalidProtocolBufferException))] - [TestCase("-2147483649", typeof(InvalidProtocolBufferException))] - public void NumberToInt32_Invalid(string jsonValue, System.Type expectedExceptionType) - { - string json = "{ \"singleInt32\": " + jsonValue + "}"; - Assert.Throws(expectedExceptionType, () => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0U)] - [TestCase("1", 1U)] - [TestCase("4294967295", 4294967295U)] - public void NumberToUInt32_Valid(string jsonValue, uint expectedParsedValue) - { - string json = "{ \"singleUint32\": " + jsonValue + "}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleUint32); - } - - // Assume that anything non-bounds-related is covered in the Int32 case - [Test] - [TestCase("-1")] - [TestCase("4294967296")] - public void NumberToUInt32_Invalid(string jsonValue) - { - string json = "{ \"singleUint32\": " + jsonValue + "}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0L)] - [TestCase("1", 1L)] - [TestCase("-1", -1L)] - // long.MaxValue isn't actually representable as a double. This string value is the highest - // representable value which isn't greater than long.MaxValue. - [TestCase("9223372036854774784", 9223372036854774784)] - [TestCase("-9223372036854775808", -9223372036854775808)] - public void NumberToInt64_Valid(string jsonValue, long expectedParsedValue) - { - string json = "{ \"singleInt64\": " + jsonValue + "}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleInt64); - } - - // Assume that anything non-bounds-related is covered in the Int32 case - [Test] - [TestCase("9223372036854775808")] - // Theoretical bound would be -9223372036854775809, but when that is parsed to a double - // we end up with the exact value of long.MinValue due to lack of precision. The value here - // is the "next double down". - [TestCase("-9223372036854780000")] - public void NumberToInt64_Invalid(string jsonValue) - { - string json = "{ \"singleInt64\": " + jsonValue + "}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0UL)] - [TestCase("1", 1UL)] - // ulong.MaxValue isn't representable as a double. This value is the largest double within - // the range of ulong. - [TestCase("18446744073709549568", 18446744073709549568UL)] - public void NumberToUInt64_Valid(string jsonValue, ulong expectedParsedValue) - { - string json = "{ \"singleUint64\": " + jsonValue + "}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleUint64); - } - - // Assume that anything non-bounds-related is covered in the Int32 case - [Test] - [TestCase("-1")] - [TestCase("18446744073709551616")] - public void NumberToUInt64_Invalid(string jsonValue) - { - string json = "{ \"singleUint64\": " + jsonValue + "}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0d)] - [TestCase("1", 1d)] - [TestCase("1.000000", 1d)] - [TestCase("1.0000000000000000000000001", 1d)] // We don't notice that we haven't preserved the exact value - [TestCase("-1", -1d)] - [TestCase("1e1", 10d)] - [TestCase("1e01", 10d)] // Leading decimals are allowed in exponents - [TestCase("1E1", 10d)] // Either case is fine - [TestCase("-1e1", -10d)] - [TestCase("1.5e1", 15d)] - [TestCase("-1.5e1", -15d)] - [TestCase("15e-1", 1.5d)] - [TestCase("-15e-1", -1.5d)] - [TestCase("1.79769e308", 1.79769e308)] - [TestCase("-1.79769e308", -1.79769e308)] - public void NumberToDouble_Valid(string jsonValue, double expectedParsedValue) - { - string json = "{ \"singleDouble\": " + jsonValue + "}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleDouble); - } - - [Test] - [TestCase("1.7977e308")] - [TestCase("-1.7977e308")] - [TestCase("1e309")] - [TestCase("1,0")] - [TestCase("1.0.0")] - [TestCase("+1")] - [TestCase("00")] - [TestCase("--1")] - [TestCase("\u00BD")] // 1/2 as a single Unicode character. Just sanity checking... - public void NumberToDouble_Invalid(string jsonValue) - { - string json = "{ \"singleDouble\": " + jsonValue + "}"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("0", 0f)] - [TestCase("1", 1f)] - [TestCase("1.000000", 1f)] - [TestCase("-1", -1f)] - [TestCase("3.402823e38", 3.402823e38f)] - [TestCase("-3.402823e38", -3.402823e38f)] - [TestCase("1.5e1", 15f)] - [TestCase("15e-1", 1.5f)] - public void NumberToFloat_Valid(string jsonValue, float expectedParsedValue) - { - string json = "{ \"singleFloat\": " + jsonValue + "}"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(expectedParsedValue, parsed.SingleFloat); - } - - [Test] - [TestCase("3.402824e38", typeof(InvalidProtocolBufferException))] - [TestCase("-3.402824e38", typeof(InvalidProtocolBufferException))] - [TestCase("1,0", typeof(InvalidJsonException))] - [TestCase("1.0.0", typeof(InvalidJsonException))] - [TestCase("+1", typeof(InvalidJsonException))] - [TestCase("00", typeof(InvalidJsonException))] - [TestCase("--1", typeof(InvalidJsonException))] - public void NumberToFloat_Invalid(string jsonValue, System.Type expectedExceptionType) - { - string json = "{ \"singleFloat\": " + jsonValue + "}"; - Assert.Throws(expectedExceptionType, () => TestAllTypes.Parser.ParseJson(json)); - } - - // The simplest way of testing that the value has parsed correctly is to reformat it, - // as we trust the formatting. In many cases that will give the same result as the input, - // so in those cases we accept an expectedFormatted value of null. Sometimes the results - // will be different though, due to a different number of digits being provided. - [Test] - // Z offset - [TestCase("2015-10-09T14:46:23.123456789Z", null)] - [TestCase("2015-10-09T14:46:23.123456Z", null)] - [TestCase("2015-10-09T14:46:23.123Z", null)] - [TestCase("2015-10-09T14:46:23Z", null)] - [TestCase("2015-10-09T14:46:23.123456000Z", "2015-10-09T14:46:23.123456Z")] - [TestCase("2015-10-09T14:46:23.1234560Z", "2015-10-09T14:46:23.123456Z")] - [TestCase("2015-10-09T14:46:23.123000000Z", "2015-10-09T14:46:23.123Z")] - [TestCase("2015-10-09T14:46:23.1230Z", "2015-10-09T14:46:23.123Z")] - [TestCase("2015-10-09T14:46:23.00Z", "2015-10-09T14:46:23Z")] - - // +00:00 offset - [TestCase("2015-10-09T14:46:23.123456789+00:00", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-09T14:46:23.123456+00:00", "2015-10-09T14:46:23.123456Z")] - [TestCase("2015-10-09T14:46:23.123+00:00", "2015-10-09T14:46:23.123Z")] - [TestCase("2015-10-09T14:46:23+00:00", "2015-10-09T14:46:23Z")] - [TestCase("2015-10-09T14:46:23.123456000+00:00", "2015-10-09T14:46:23.123456Z")] - [TestCase("2015-10-09T14:46:23.1234560+00:00", "2015-10-09T14:46:23.123456Z")] - [TestCase("2015-10-09T14:46:23.123000000+00:00", "2015-10-09T14:46:23.123Z")] - [TestCase("2015-10-09T14:46:23.1230+00:00", "2015-10-09T14:46:23.123Z")] - [TestCase("2015-10-09T14:46:23.00+00:00", "2015-10-09T14:46:23Z")] - - // Other offsets (assume by now that the subsecond handling is okay) - [TestCase("2015-10-09T15:46:23.123456789+01:00", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-09T13:46:23.123456789-01:00", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-09T15:16:23.123456789+00:30", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-09T14:16:23.123456789-00:30", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-09T16:31:23.123456789+01:45", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-09T13:01:23.123456789-01:45", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-10T08:46:23.123456789+18:00", "2015-10-09T14:46:23.123456789Z")] - [TestCase("2015-10-08T20:46:23.123456789-18:00", "2015-10-09T14:46:23.123456789Z")] - - // Leap years and min/max - [TestCase("2016-02-29T14:46:23.123456789Z", null)] - [TestCase("2000-02-29T14:46:23.123456789Z", null)] - [TestCase("0001-01-01T00:00:00Z", null)] - [TestCase("9999-12-31T23:59:59.999999999Z", null)] - public void Timestamp_Valid(string jsonValue, string expectedFormatted) - { - expectedFormatted = expectedFormatted ?? jsonValue; - string json = WrapInQuotes(jsonValue); - var parsed = Timestamp.Parser.ParseJson(json); - Assert.AreEqual(WrapInQuotes(expectedFormatted), parsed.ToString()); - } - - [Test] - [TestCase("2015-10-09 14:46:23.123456789Z", Description = "No T between date and time")] - [TestCase("2015/10/09T14:46:23.123456789Z", Description = "Wrong date separators")] - [TestCase("2015-10-09T14.46.23.123456789Z", Description = "Wrong time separators")] - [TestCase("2015-10-09T14:46:23,123456789Z", Description = "Wrong fractional second separators (valid ISO-8601 though)")] - [TestCase(" 2015-10-09T14:46:23.123456789Z", Description = "Whitespace at start")] - [TestCase("2015-10-09T14:46:23.123456789Z ", Description = "Whitespace at end")] - [TestCase("2015-10-09T14:46:23.1234567890", Description = "Too many digits")] - [TestCase("2015-10-09T14:46:23.123456789", Description = "No offset")] - [TestCase("2015-13-09T14:46:23.123456789Z", Description = "Invalid month")] - [TestCase("2015-10-32T14:46:23.123456789Z", Description = "Invalid day")] - [TestCase("2015-10-09T24:00:00.000000000Z", Description = "Invalid hour (valid ISO-8601 though)")] - [TestCase("2015-10-09T14:60:23.123456789Z", Description = "Invalid minutes")] - [TestCase("2015-10-09T14:46:60.123456789Z", Description = "Invalid seconds")] - [TestCase("2015-10-09T14:46:23.123456789+18:01", Description = "Offset too large (positive)")] - [TestCase("2015-10-09T14:46:23.123456789-18:01", Description = "Offset too large (negative)")] - [TestCase("2015-10-09T14:46:23.123456789-00:00", Description = "Local offset (-00:00) makes no sense here")] - [TestCase("0001-01-01T00:00:00+00:01", Description = "Value before earliest when offset applied")] - [TestCase("9999-12-31T23:59:59.999999999-00:01", Description = "Value after latest when offset applied")] - [TestCase("2100-02-29T14:46:23.123456789Z", Description = "Feb 29th on a non-leap-year")] - public void Timestamp_Invalid(string jsonValue) - { - string json = WrapInQuotes(jsonValue); - Assert.Throws(() => Timestamp.Parser.ParseJson(json)); - } - - [Test] - public void StructValue_Null() - { - Assert.AreEqual(new Value { NullValue = 0 }, Value.Parser.ParseJson("null")); - } - - [Test] - public void StructValue_String() - { - Assert.AreEqual(new Value { StringValue = "hi" }, Value.Parser.ParseJson("\"hi\"")); - } - - [Test] - public void StructValue_Bool() - { - Assert.AreEqual(new Value { BoolValue = true }, Value.Parser.ParseJson("true")); - Assert.AreEqual(new Value { BoolValue = false }, Value.Parser.ParseJson("false")); - } - - [Test] - public void StructValue_List() - { - Assert.AreEqual(Value.ForList(Value.ForNumber(1), Value.ForString("x")), Value.Parser.ParseJson("[1, \"x\"]")); - } - - [Test] - public void ParseListValue() - { - Assert.AreEqual(new ListValue { Values = { Value.ForNumber(1), Value.ForString("x") } }, ListValue.Parser.ParseJson("[1, \"x\"]")); - } - - [Test] - public void StructValue_Struct() - { - Assert.AreEqual( - Value.ForStruct(new Struct { Fields = { { "x", Value.ForNumber(1) }, { "y", Value.ForString("z") } } }), - Value.Parser.ParseJson("{ \"x\": 1, \"y\": \"z\" }")); - } - - [Test] - public void ParseStruct() - { - Assert.AreEqual(new Struct { Fields = { { "x", Value.ForNumber(1) }, { "y", Value.ForString("z") } } }, - Struct.Parser.ParseJson("{ \"x\": 1, \"y\": \"z\" }")); - } - - // TODO for duration parsing: upper and lower bounds. - // +/- 315576000000 seconds - - [Test] - [TestCase("1.123456789s", null)] - [TestCase("1.123456s", null)] - [TestCase("1.123s", null)] - [TestCase("1.12300s", "1.123s")] - [TestCase("1.12345s", "1.123450s")] - [TestCase("1s", null)] - [TestCase("-1.123456789s", null)] - [TestCase("-1.123456s", null)] - [TestCase("-1.123s", null)] - [TestCase("-1s", null)] - [TestCase("0.123s", null)] - [TestCase("-0.123s", null)] - [TestCase("123456.123s", null)] - [TestCase("-123456.123s", null)] - // Upper and lower bounds - [TestCase("315576000000s", null)] - [TestCase("-315576000000s", null)] - public void Duration_Valid(string jsonValue, string expectedFormatted) - { - expectedFormatted = expectedFormatted ?? jsonValue; - string json = WrapInQuotes(jsonValue); - var parsed = Duration.Parser.ParseJson(json); - Assert.AreEqual(WrapInQuotes(expectedFormatted), parsed.ToString()); - } - - // The simplest way of testing that the value has parsed correctly is to reformat it, - // as we trust the formatting. In many cases that will give the same result as the input, - // so in those cases we accept an expectedFormatted value of null. Sometimes the results - // will be different though, due to a different number of digits being provided. - [Test] - [TestCase("1.1234567890s", Description = "Too many digits")] - [TestCase("1.123456789", Description = "No suffix")] - [TestCase("1.123456789ss", Description = "Too much suffix")] - [TestCase("1.123456789S", Description = "Upper case suffix")] - [TestCase("+1.123456789s", Description = "Leading +")] - [TestCase(".123456789s", Description = "No integer before the fraction")] - [TestCase("1,123456789s", Description = "Comma as decimal separator")] - [TestCase("1x1.123456789s", Description = "Non-digit in integer part")] - [TestCase("1.1x3456789s", Description = "Non-digit in fractional part")] - [TestCase(" 1.123456789s", Description = "Whitespace before fraction")] - [TestCase("1.123456789s ", Description = "Whitespace after value")] - [TestCase("01.123456789s", Description = "Leading zero (positive)")] - [TestCase("-01.123456789s", Description = "Leading zero (negative)")] - [TestCase("--0.123456789s", Description = "Double minus sign")] - // Violate upper/lower bounds in various ways - [TestCase("315576000001s", Description = "Integer part too large")] - [TestCase("3155760000000s", Description = "Integer part too long (positive)")] - [TestCase("-3155760000000s", Description = "Integer part too long (negative)")] - public void Duration_Invalid(string jsonValue) - { - string json = WrapInQuotes(jsonValue); - Assert.Throws(() => Duration.Parser.ParseJson(json)); - } - - // Not as many tests for field masks as I'd like; more to be added when we have more - // detailed specifications. - - [Test] - [TestCase("")] - [TestCase("foo", "foo")] - [TestCase("foo,bar", "foo", "bar")] - [TestCase("foo.bar", "foo.bar")] - [TestCase("fooBar", "foo_bar")] - [TestCase("fooBar.bazQux", "foo_bar.baz_qux")] - public void FieldMask_Valid(string jsonValue, params string[] expectedPaths) - { - string json = WrapInQuotes(jsonValue); - var parsed = FieldMask.Parser.ParseJson(json); - CollectionAssert.AreEqual(expectedPaths, parsed.Paths); - } - - [Test] - [TestCase("foo_bar")] - public void FieldMask_Invalid(string jsonValue) - { - string json = WrapInQuotes(jsonValue); - Assert.Throws(() => FieldMask.Parser.ParseJson(json)); - } - - [Test] - public void Any_RegularMessage() - { - var registry = TypeRegistry.FromMessages(TestAllTypes.Descriptor); - var formatter = new JsonFormatter(new JsonFormatter.Settings(false, TypeRegistry.FromMessages(TestAllTypes.Descriptor))); - var message = new TestAllTypes { SingleInt32 = 10, SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 20 } }; - var original = Any.Pack(message); - var json = formatter.Format(original); // This is tested in JsonFormatterTest - var parser = new JsonParser(new JsonParser.Settings(10, registry)); - Assert.AreEqual(original, parser.Parse(json)); - string valueFirstJson = "{ \"singleInt32\": 10, \"singleNestedMessage\": { \"bb\": 20 }, \"@type\": \"type.googleapis.com/protobuf_unittest.TestAllTypes\" }"; - Assert.AreEqual(original, parser.Parse(valueFirstJson)); - } - - [Test] - public void Any_CustomPrefix() - { - var registry = TypeRegistry.FromMessages(TestAllTypes.Descriptor); - var message = new TestAllTypes { SingleInt32 = 10 }; - var original = Any.Pack(message, "custom.prefix/middle-part"); - var parser = new JsonParser(new JsonParser.Settings(10, registry)); - string json = "{ \"@type\": \"custom.prefix/middle-part/protobuf_unittest.TestAllTypes\", \"singleInt32\": 10 }"; - Assert.AreEqual(original, parser.Parse(json)); - } - - [Test] - public void Any_UnknownType() - { - string json = "{ \"@type\": \"type.googleapis.com/bogus\" }"; - Assert.Throws(() => Any.Parser.ParseJson(json)); - } - - [Test] - public void Any_NoTypeUrl() - { - string json = "{ \"foo\": \"bar\" }"; - Assert.Throws(() => Any.Parser.ParseJson(json)); - } - - [Test] - public void Any_WellKnownType() - { - var registry = TypeRegistry.FromMessages(Timestamp.Descriptor); - var formatter = new JsonFormatter(new JsonFormatter.Settings(false, registry)); - var timestamp = new DateTime(1673, 6, 19, 12, 34, 56, DateTimeKind.Utc).ToTimestamp(); - var original = Any.Pack(timestamp); - var json = formatter.Format(original); // This is tested in JsonFormatterTest - var parser = new JsonParser(new JsonParser.Settings(10, registry)); - Assert.AreEqual(original, parser.Parse(json)); - string valueFirstJson = "{ \"value\": \"1673-06-19T12:34:56Z\", \"@type\": \"type.googleapis.com/google.protobuf.Timestamp\" }"; - Assert.AreEqual(original, parser.Parse(valueFirstJson)); - } - - [Test] - public void Any_Nested() - { - var registry = TypeRegistry.FromMessages(TestWellKnownTypes.Descriptor, TestAllTypes.Descriptor); - var formatter = new JsonFormatter(new JsonFormatter.Settings(false, registry)); - var parser = new JsonParser(new JsonParser.Settings(10, registry)); - var doubleNestedMessage = new TestAllTypes { SingleInt32 = 20 }; - var nestedMessage = Any.Pack(doubleNestedMessage); - var message = new TestWellKnownTypes { AnyField = Any.Pack(nestedMessage) }; - var json = formatter.Format(message); - // Use the descriptor-based parser just for a change. - Assert.AreEqual(message, parser.Parse(json, TestWellKnownTypes.Descriptor)); - } - - [Test] - public void DataAfterObject() - { - string json = "{} 10"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - /// - /// JSON equivalent to - /// - [Test] - public void MaliciousRecursion() - { - string data64 = CodedInputStreamTest.MakeRecursiveMessage(64).ToString(); - string data65 = CodedInputStreamTest.MakeRecursiveMessage(65).ToString(); - - var parser64 = new JsonParser(new JsonParser.Settings(64)); - CodedInputStreamTest.AssertMessageDepth(parser64.Parse(data64), 64); - Assert.Throws(() => parser64.Parse(data65)); - - var parser63 = new JsonParser(new JsonParser.Settings(63)); - Assert.Throws(() => parser63.Parse(data64)); - } - - [Test] - [TestCase("AQI")] - [TestCase("_-==")] - public void Bytes_InvalidBase64(string badBase64) - { - string json = "{ \"singleBytes\": \"" + badBase64 + "\" }"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - [TestCase("\"FOREIGN_BAR\"", ForeignEnum.ForeignBar)] - [TestCase("5", ForeignEnum.ForeignBar)] - [TestCase("100", (ForeignEnum)100)] - public void EnumValid(string value, ForeignEnum expectedValue) - { - string json = "{ \"singleForeignEnum\": " + value + " }"; - var parsed = TestAllTypes.Parser.ParseJson(json); - Assert.AreEqual(new TestAllTypes { SingleForeignEnum = expectedValue }, parsed); - } - - [Test] - [TestCase("\"NOT_A_VALID_VALUE\"")] - [TestCase("5.5")] - public void Enum_Invalid(string value) - { - string json = "{ \"singleForeignEnum\": " + value + " }"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - [Test] - public void OneofDuplicate_Invalid() - { - string json = "{ \"oneofString\": \"x\", \"oneofUint32\": 10 }"; - Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); - } - - /// - /// Various tests use strings which have quotes round them for parsing or as the result - /// of formatting, but without those quotes being specified in the tests (for the sake of readability). - /// This method simply returns the input, wrapped in double quotes. - /// - internal static string WrapInQuotes(string text) - { - return '"' + text + '"'; - } - } -} \ No newline at end of file diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonTokenizerTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonTokenizerTest.cs deleted file mode 100644 index 753d5aafef3390c51ffb7762142c6c2ccecb1ac6..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonTokenizerTest.cs +++ /dev/null @@ -1,385 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion -using NUnit.Framework; -using System; -using System.IO; - -namespace Google.Protobuf -{ - public class JsonTokenizerTest - { - [Test] - public void EmptyObjectValue() - { - AssertTokens("{}", JsonToken.StartObject, JsonToken.EndObject); - } - - [Test] - public void EmptyArrayValue() - { - AssertTokens("[]", JsonToken.StartArray, JsonToken.EndArray); - } - - [Test] - [TestCase("foo", "foo")] - [TestCase("tab\\t", "tab\t")] - [TestCase("line\\nfeed", "line\nfeed")] - [TestCase("carriage\\rreturn", "carriage\rreturn")] - [TestCase("back\\bspace", "back\bspace")] - [TestCase("form\\ffeed", "form\ffeed")] - [TestCase("escaped\\/slash", "escaped/slash")] - [TestCase("escaped\\\\backslash", "escaped\\backslash")] - [TestCase("escaped\\\"quote", "escaped\"quote")] - [TestCase("foo {}[] bar", "foo {}[] bar")] - [TestCase("foo\\u09aFbar", "foo\u09afbar")] // Digits, upper hex, lower hex - [TestCase("ab\ud800\udc00cd", "ab\ud800\udc00cd")] - [TestCase("ab\\ud800\\udc00cd", "ab\ud800\udc00cd")] - public void StringValue(string json, string expectedValue) - { - AssertTokensNoReplacement("\"" + json + "\"", JsonToken.Value(expectedValue)); - } - - // Valid surrogate pairs, with mixed escaping. These test cases can't be expressed - // using TestCase as they have no valid UTF-8 representation. - // It's unclear exactly how we should handle a mixture of escaped or not: that can't - // come from UTF-8 text, but could come from a .NET string. For the moment, - // treat it as valid in the obvious way. - [Test] - public void MixedSurrogatePairs() - { - string expected = "\ud800\udc00"; - AssertTokens("'\\ud800\udc00'", JsonToken.Value(expected)); - AssertTokens("'\ud800\\udc00'", JsonToken.Value(expected)); - } - - [Test] - public void ObjectDepth() - { - string json = "{ \"foo\": { \"x\": 1, \"y\": [ 0 ] } }"; - var tokenizer = JsonTokenizer.FromTextReader(new StringReader(json)); - // If we had more tests like this, I'd introduce a helper method... but for one test, it's not worth it. - Assert.AreEqual(0, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.StartObject, tokenizer.Next()); - Assert.AreEqual(1, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.Name("foo"), tokenizer.Next()); - Assert.AreEqual(1, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.StartObject, tokenizer.Next()); - Assert.AreEqual(2, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.Name("x"), tokenizer.Next()); - Assert.AreEqual(2, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.Value(1), tokenizer.Next()); - Assert.AreEqual(2, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.Name("y"), tokenizer.Next()); - Assert.AreEqual(2, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.StartArray, tokenizer.Next()); - Assert.AreEqual(2, tokenizer.ObjectDepth); // Depth hasn't changed in array - Assert.AreEqual(JsonToken.Value(0), tokenizer.Next()); - Assert.AreEqual(2, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.EndArray, tokenizer.Next()); - Assert.AreEqual(2, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.EndObject, tokenizer.Next()); - Assert.AreEqual(1, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.EndObject, tokenizer.Next()); - Assert.AreEqual(0, tokenizer.ObjectDepth); - Assert.AreEqual(JsonToken.EndDocument, tokenizer.Next()); - Assert.AreEqual(0, tokenizer.ObjectDepth); - } - - [Test] - public void ObjectDepth_WithPushBack() - { - string json = "{}"; - var tokenizer = JsonTokenizer.FromTextReader(new StringReader(json)); - Assert.AreEqual(0, tokenizer.ObjectDepth); - var token = tokenizer.Next(); - Assert.AreEqual(1, tokenizer.ObjectDepth); - // When we push back a "start object", we should effectively be back to the previous depth. - tokenizer.PushBack(token); - Assert.AreEqual(0, tokenizer.ObjectDepth); - // Read the same token again, and get back to depth 1 - token = tokenizer.Next(); - Assert.AreEqual(1, tokenizer.ObjectDepth); - - // Now the same in reverse, with EndObject - token = tokenizer.Next(); - Assert.AreEqual(0, tokenizer.ObjectDepth); - tokenizer.PushBack(token); - Assert.AreEqual(1, tokenizer.ObjectDepth); - tokenizer.Next(); - Assert.AreEqual(0, tokenizer.ObjectDepth); - } - - [Test] - [TestCase("embedded tab\t")] - [TestCase("embedded CR\r")] - [TestCase("embedded LF\n")] - [TestCase("embedded bell\u0007")] - [TestCase("bad escape\\a")] - [TestCase("incomplete escape\\")] - [TestCase("incomplete Unicode escape\\u000")] - [TestCase("invalid Unicode escape\\u000H")] - // Surrogate pair handling, both in raw .NET strings and escaped. We only need - // to detect this in strings, as non-ASCII characters anywhere other than in strings - // will already lead to parsing errors. - [TestCase("\\ud800")] - [TestCase("\\udc00")] - [TestCase("\\ud800x")] - [TestCase("\\udc00x")] - [TestCase("\\udc00\\ud800y")] - public void InvalidStringValue(string json) - { - AssertThrowsAfter("\"" + json + "\""); - } - - // Tests for invalid strings that can't be expressed in attributes, - // as the constants can't be expressed as UTF-8 strings. - [Test] - public void InvalidSurrogatePairs() - { - AssertThrowsAfter("\"\ud800x\""); - AssertThrowsAfter("\"\udc00y\""); - AssertThrowsAfter("\"\udc00\ud800y\""); - } - - [Test] - [TestCase("0", 0)] - [TestCase("-0", 0)] // We don't distinguish between positive and negative 0 - [TestCase("1", 1)] - [TestCase("-1", -1)] - // From here on, assume leading sign is okay... - [TestCase("1.125", 1.125)] - [TestCase("1.0", 1)] - [TestCase("1e5", 100000)] - [TestCase("1e000000", 1)] // Weird, but not prohibited by the spec - [TestCase("1E5", 100000)] - [TestCase("1e+5", 100000)] - [TestCase("1E-5", 0.00001)] - [TestCase("123E-2", 1.23)] - [TestCase("123.45E3", 123450)] - [TestCase(" 1 ", 1)] - public void NumberValue(string json, double expectedValue) - { - AssertTokens(json, JsonToken.Value(expectedValue)); - } - - [Test] - [TestCase("00")] - [TestCase(".5")] - [TestCase("1.")] - [TestCase("1e")] - [TestCase("1e-")] - [TestCase("--")] - [TestCase("--1")] - [TestCase("-1.7977e308")] - [TestCase("1.7977e308")] - public void InvalidNumberValue(string json) - { - AssertThrowsAfter(json); - } - - [Test] - [TestCase("nul")] - [TestCase("nothing")] - [TestCase("truth")] - [TestCase("fALSEhood")] - public void InvalidLiterals(string json) - { - AssertThrowsAfter(json); - } - - [Test] - public void NullValue() - { - AssertTokens("null", JsonToken.Null); - } - - [Test] - public void TrueValue() - { - AssertTokens("true", JsonToken.True); - } - - [Test] - public void FalseValue() - { - AssertTokens("false", JsonToken.False); - } - - [Test] - public void SimpleObject() - { - AssertTokens("{'x': 'y'}", - JsonToken.StartObject, JsonToken.Name("x"), JsonToken.Value("y"), JsonToken.EndObject); - } - - [Test] - [TestCase("[10, 20", 3)] - [TestCase("[10,", 2)] - [TestCase("[10:20]", 2)] - [TestCase("[", 1)] - [TestCase("[,", 1)] - [TestCase("{", 1)] - [TestCase("{,", 1)] - [TestCase("{[", 1)] - [TestCase("{{", 1)] - [TestCase("{0", 1)] - [TestCase("{null", 1)] - [TestCase("{false", 1)] - [TestCase("{true", 1)] - [TestCase("}", 0)] - [TestCase("]", 0)] - [TestCase(",", 0)] - [TestCase("'foo' 'bar'", 1)] - [TestCase(":", 0)] - [TestCase("'foo", 0)] // Incomplete string - [TestCase("{ 'foo' }", 2)] - [TestCase("{ x:1", 1)] // Property names must be quoted - [TestCase("{]", 1)] - [TestCase("[}", 1)] - [TestCase("[1,", 2)] - [TestCase("{'x':0]", 3)] - [TestCase("{ 'foo': }", 2)] - [TestCase("{ 'foo':'bar', }", 3)] - public void InvalidStructure(string json, int expectedValidTokens) - { - // Note: we don't test that the earlier tokens are exactly as expected, - // partly because that's hard to parameterize. - var reader = new StringReader(json.Replace('\'', '"')); - var tokenizer = JsonTokenizer.FromTextReader(reader); - for (int i = 0; i < expectedValidTokens; i++) - { - Assert.IsNotNull(tokenizer.Next()); - } - Assert.Throws(() => tokenizer.Next()); - } - - [Test] - public void ArrayMixedType() - { - AssertTokens("[1, 'foo', null, false, true, [2], {'x':'y' }]", - JsonToken.StartArray, - JsonToken.Value(1), - JsonToken.Value("foo"), - JsonToken.Null, - JsonToken.False, - JsonToken.True, - JsonToken.StartArray, - JsonToken.Value(2), - JsonToken.EndArray, - JsonToken.StartObject, - JsonToken.Name("x"), - JsonToken.Value("y"), - JsonToken.EndObject, - JsonToken.EndArray); - } - - [Test] - public void ObjectMixedType() - { - AssertTokens(@"{'a': 1, 'b': 'bar', 'c': null, 'd': false, 'e': true, - 'f': [2], 'g': {'x':'y' }}", - JsonToken.StartObject, - JsonToken.Name("a"), - JsonToken.Value(1), - JsonToken.Name("b"), - JsonToken.Value("bar"), - JsonToken.Name("c"), - JsonToken.Null, - JsonToken.Name("d"), - JsonToken.False, - JsonToken.Name("e"), - JsonToken.True, - JsonToken.Name("f"), - JsonToken.StartArray, - JsonToken.Value(2), - JsonToken.EndArray, - JsonToken.Name("g"), - JsonToken.StartObject, - JsonToken.Name("x"), - JsonToken.Value("y"), - JsonToken.EndObject, - JsonToken.EndObject); - } - - [Test] - public void NextAfterEndDocumentThrows() - { - var tokenizer = JsonTokenizer.FromTextReader(new StringReader("null")); - Assert.AreEqual(JsonToken.Null, tokenizer.Next()); - Assert.AreEqual(JsonToken.EndDocument, tokenizer.Next()); - Assert.Throws(() => tokenizer.Next()); - } - - [Test] - public void CanPushBackEndDocument() - { - var tokenizer = JsonTokenizer.FromTextReader(new StringReader("null")); - Assert.AreEqual(JsonToken.Null, tokenizer.Next()); - Assert.AreEqual(JsonToken.EndDocument, tokenizer.Next()); - tokenizer.PushBack(JsonToken.EndDocument); - Assert.AreEqual(JsonToken.EndDocument, tokenizer.Next()); - Assert.Throws(() => tokenizer.Next()); - } - - /// - /// Asserts that the specified JSON is tokenized into the given sequence of tokens. - /// All apostrophes are first converted to double quotes, allowing any tests - /// that don't need to check actual apostrophe handling to use apostrophes in the JSON, avoiding - /// messy string literal escaping. The "end document" token is not specified in the list of - /// expected tokens, but is implicit. - /// - private static void AssertTokens(string json, params JsonToken[] expectedTokens) - { - AssertTokensNoReplacement(json.Replace('\'', '"'), expectedTokens); - } - - /// - /// Asserts that the specified JSON is tokenized into the given sequence of tokens. - /// Unlike , this does not perform any character - /// replacement on the specified JSON, and should be used when the text contains apostrophes which - /// are expected to be used *as* apostrophes. The "end document" token is not specified in the list of - /// expected tokens, but is implicit. - /// - private static void AssertTokensNoReplacement(string json, params JsonToken[] expectedTokens) - { - var reader = new StringReader(json); - var tokenizer = JsonTokenizer.FromTextReader(reader); - for (int i = 0; i < expectedTokens.Length; i++) - { - var actualToken = tokenizer.Next(); - if (actualToken == JsonToken.EndDocument) - { - Assert.Fail("Expected {0} but reached end of token stream", expectedTokens[i]); - } - Assert.AreEqual(expectedTokens[i], actualToken); - } - var finalToken = tokenizer.Next(); - if (finalToken != JsonToken.EndDocument) - { - Assert.Fail("Expected token stream to be exhausted; received {0}", finalToken); - } - } - - private static void AssertThrowsAfter(string json, params JsonToken[] expectedTokens) - { - var reader = new StringReader(json); - var tokenizer = JsonTokenizer.FromTextReader(reader); - for (int i = 0; i < expectedTokens.Length; i++) - { - var actualToken = tokenizer.Next(); - if (actualToken == JsonToken.EndDocument) - { - Assert.Fail("Expected {0} but reached end of document", expectedTokens[i]); - } - Assert.AreEqual(expectedTokens[i], actualToken); - } - Assert.Throws(() => tokenizer.Next()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Program.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Program.cs deleted file mode 100644 index 8c1db9dd7da546e7af2b919cf20b7ab557151179..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2017 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion -using NUnitLite; -using System.Reflection; - -// Note: this file wasn't in the actual 3.0, but is required due to build -// system changes - -namespace Google.Protobuf.Test -{ - class Program - { - public static int Main(string[] args) - { - return new AutoRun(typeof(Program).GetTypeInfo().Assembly).Execute(args); - } - } -} \ No newline at end of file diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs deleted file mode 100644 index 51c981485d03e042601c8310405278119734ee04..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs +++ /dev/null @@ -1,236 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System.Linq; -using Google.Protobuf.TestProtos; -using NUnit.Framework; -using UnitTest.Issues.TestProtos; - -namespace Google.Protobuf.Reflection -{ - /// - /// Tests for descriptors. (Not in its own namespace or broken up into individual classes as the - /// size doesn't warrant it. On the other hand, this makes me feel a bit dirty...) - /// - public class DescriptorsTest - { - [Test] - public void FileDescriptor() - { - FileDescriptor file = UnittestProto3Reflection.Descriptor; - - Assert.AreEqual("google/protobuf/unittest_proto3.proto", file.Name); - Assert.AreEqual("protobuf_unittest", file.Package); - - Assert.AreEqual("UnittestProto", file.Proto.Options.JavaOuterClassname); - Assert.AreEqual("google/protobuf/unittest_proto3.proto", file.Proto.Name); - - // unittest.proto doesn't have any public imports, but unittest_import.proto does. - Assert.AreEqual(0, file.PublicDependencies.Count); - Assert.AreEqual(1, UnittestImportProto3Reflection.Descriptor.PublicDependencies.Count); - Assert.AreEqual(UnittestImportPublicProto3Reflection.Descriptor, UnittestImportProto3Reflection.Descriptor.PublicDependencies[0]); - - Assert.AreEqual(1, file.Dependencies.Count); - Assert.AreEqual(UnittestImportProto3Reflection.Descriptor, file.Dependencies[0]); - - MessageDescriptor messageType = TestAllTypes.Descriptor; - Assert.AreSame(typeof(TestAllTypes), messageType.ClrType); - Assert.AreSame(TestAllTypes.Parser, messageType.Parser); - Assert.AreEqual(messageType, file.MessageTypes[0]); - Assert.AreEqual(messageType, file.FindTypeByName("TestAllTypes")); - Assert.Null(file.FindTypeByName("NoSuchType")); - Assert.Null(file.FindTypeByName("protobuf_unittest.TestAllTypes")); - for (int i = 0; i < file.MessageTypes.Count; i++) - { - Assert.AreEqual(i, file.MessageTypes[i].Index); - } - - Assert.AreEqual(file.EnumTypes[0], file.FindTypeByName("ForeignEnum")); - Assert.Null(file.FindTypeByName("NoSuchType")); - Assert.Null(file.FindTypeByName("protobuf_unittest.ForeignEnum")); - Assert.AreEqual(1, UnittestImportProto3Reflection.Descriptor.EnumTypes.Count); - Assert.AreEqual("ImportEnum", UnittestImportProto3Reflection.Descriptor.EnumTypes[0].Name); - for (int i = 0; i < file.EnumTypes.Count; i++) - { - Assert.AreEqual(i, file.EnumTypes[i].Index); - } - - Assert.AreEqual(10, file.SerializedData[0]); - } - - [Test] - public void MessageDescriptor() - { - MessageDescriptor messageType = TestAllTypes.Descriptor; - MessageDescriptor nestedType = TestAllTypes.Types.NestedMessage.Descriptor; - - Assert.AreEqual("TestAllTypes", messageType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes", messageType.FullName); - Assert.AreEqual(UnittestProto3Reflection.Descriptor, messageType.File); - Assert.IsNull(messageType.ContainingType); - Assert.IsNull(messageType.Proto.Options); - - Assert.AreEqual("TestAllTypes", messageType.Name); - - Assert.AreEqual("NestedMessage", nestedType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedMessage", nestedType.FullName); - Assert.AreEqual(UnittestProto3Reflection.Descriptor, nestedType.File); - Assert.AreEqual(messageType, nestedType.ContainingType); - - FieldDescriptor field = messageType.Fields.InDeclarationOrder()[0]; - Assert.AreEqual("single_int32", field.Name); - Assert.AreEqual(field, messageType.FindDescriptor("single_int32")); - Assert.Null(messageType.FindDescriptor("no_such_field")); - Assert.AreEqual(field, messageType.FindFieldByNumber(1)); - Assert.Null(messageType.FindFieldByNumber(571283)); - var fieldsInDeclarationOrder = messageType.Fields.InDeclarationOrder(); - for (int i = 0; i < fieldsInDeclarationOrder.Count; i++) - { - Assert.AreEqual(i, fieldsInDeclarationOrder[i].Index); - } - - Assert.AreEqual(nestedType, messageType.NestedTypes[0]); - Assert.AreEqual(nestedType, messageType.FindDescriptor("NestedMessage")); - Assert.Null(messageType.FindDescriptor("NoSuchType")); - for (int i = 0; i < messageType.NestedTypes.Count; i++) - { - Assert.AreEqual(i, messageType.NestedTypes[i].Index); - } - - Assert.AreEqual(messageType.EnumTypes[0], messageType.FindDescriptor("NestedEnum")); - Assert.Null(messageType.FindDescriptor("NoSuchType")); - for (int i = 0; i < messageType.EnumTypes.Count; i++) - { - Assert.AreEqual(i, messageType.EnumTypes[i].Index); - } - } - - [Test] - public void FieldDescriptor() - { - MessageDescriptor messageType = TestAllTypes.Descriptor; - FieldDescriptor primitiveField = messageType.FindDescriptor("single_int32"); - FieldDescriptor enumField = messageType.FindDescriptor("single_nested_enum"); - FieldDescriptor messageField = messageType.FindDescriptor("single_foreign_message"); - - Assert.AreEqual("single_int32", primitiveField.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.single_int32", - primitiveField.FullName); - Assert.AreEqual(1, primitiveField.FieldNumber); - Assert.AreEqual(messageType, primitiveField.ContainingType); - Assert.AreEqual(UnittestProto3Reflection.Descriptor, primitiveField.File); - Assert.AreEqual(FieldType.Int32, primitiveField.FieldType); - Assert.IsNull(primitiveField.Proto.Options); - - Assert.AreEqual("single_nested_enum", enumField.Name); - Assert.AreEqual(FieldType.Enum, enumField.FieldType); - // Assert.AreEqual(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType); - - Assert.AreEqual("single_foreign_message", messageField.Name); - Assert.AreEqual(FieldType.Message, messageField.FieldType); - Assert.AreEqual(ForeignMessage.Descriptor, messageField.MessageType); - } - - [Test] - public void FieldDescriptorLabel() - { - FieldDescriptor singleField = - TestAllTypes.Descriptor.FindDescriptor("single_int32"); - FieldDescriptor repeatedField = - TestAllTypes.Descriptor.FindDescriptor("repeated_int32"); - - Assert.IsFalse(singleField.IsRepeated); - Assert.IsTrue(repeatedField.IsRepeated); - } - - [Test] - public void EnumDescriptor() - { - // Note: this test is a bit different to the Java version because there's no static way of getting to the descriptor - EnumDescriptor enumType = UnittestProto3Reflection.Descriptor.FindTypeByName("ForeignEnum"); - EnumDescriptor nestedType = TestAllTypes.Descriptor.FindDescriptor("NestedEnum"); - - Assert.AreEqual("ForeignEnum", enumType.Name); - Assert.AreEqual("protobuf_unittest.ForeignEnum", enumType.FullName); - Assert.AreEqual(UnittestProto3Reflection.Descriptor, enumType.File); - Assert.Null(enumType.ContainingType); - Assert.Null(enumType.Proto.Options); - - Assert.AreEqual("NestedEnum", nestedType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedEnum", - nestedType.FullName); - Assert.AreEqual(UnittestProto3Reflection.Descriptor, nestedType.File); - Assert.AreEqual(TestAllTypes.Descriptor, nestedType.ContainingType); - - EnumValueDescriptor value = enumType.FindValueByName("FOREIGN_FOO"); - Assert.AreEqual(value, enumType.Values[1]); - Assert.AreEqual("FOREIGN_FOO", value.Name); - Assert.AreEqual(4, value.Number); - Assert.AreEqual((int) ForeignEnum.ForeignFoo, value.Number); - Assert.AreEqual(value, enumType.FindValueByNumber(4)); - Assert.Null(enumType.FindValueByName("NO_SUCH_VALUE")); - for (int i = 0; i < enumType.Values.Count; i++) - { - Assert.AreEqual(i, enumType.Values[i].Index); - } - } - - [Test] - public void OneofDescriptor() - { - OneofDescriptor descriptor = TestAllTypes.Descriptor.FindDescriptor("oneof_field"); - Assert.AreEqual("oneof_field", descriptor.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.oneof_field", descriptor.FullName); - - var expectedFields = new[] { - TestAllTypes.OneofBytesFieldNumber, - TestAllTypes.OneofNestedMessageFieldNumber, - TestAllTypes.OneofStringFieldNumber, - TestAllTypes.OneofUint32FieldNumber } - .Select(fieldNumber => TestAllTypes.Descriptor.FindFieldByNumber(fieldNumber)) - .ToList(); - foreach (var field in expectedFields) - { - Assert.AreSame(descriptor, field.ContainingOneof); - } - - CollectionAssert.AreEquivalent(expectedFields, descriptor.Fields); - } - - [Test] - public void MapEntryMessageDescriptor() - { - var descriptor = MapWellKnownTypes.Descriptor.NestedTypes[0]; - Assert.IsNull(descriptor.Parser); - Assert.IsNull(descriptor.ClrType); - Assert.IsNull(descriptor.Fields[1].Accessor); - } - - // From TestFieldOrdering: - // string my_string = 11; - // int64 my_int = 1; - // float my_float = 101; - // NestedMessage single_nested_message = 200; - [Test] - public void FieldListOrderings() - { - var fields = TestFieldOrderings.Descriptor.Fields; - Assert.AreEqual(new[] { 11, 1, 101, 200 }, fields.InDeclarationOrder().Select(x => x.FieldNumber)); - Assert.AreEqual(new[] { 1, 11, 101, 200 }, fields.InFieldNumberOrder().Select(x => x.FieldNumber)); - } - - - [Test] - public void DescriptorProtoFileDescriptor() - { - var descriptor = Google.Protobuf.Reflection.FileDescriptor.DescriptorProtoFileDescriptor; - Assert.AreEqual("google/protobuf/descriptor.proto", descriptor.Name); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs deleted file mode 100644 index 4c498ee5e7e9ee3291b14bd78ef3919ab4e1170b..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs +++ /dev/null @@ -1,195 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.TestProtos; -using NUnit.Framework; -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Google.Protobuf.Reflection -{ - public class FieldAccessTest - { - [Test] - public void GetValue() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var fields = TestAllTypes.Descriptor.Fields; - Assert.AreEqual(message.SingleBool, fields[TestAllTypes.SingleBoolFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleBytes, fields[TestAllTypes.SingleBytesFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleDouble, fields[TestAllTypes.SingleDoubleFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleFixed32, fields[TestAllTypes.SingleFixed32FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleFixed64, fields[TestAllTypes.SingleFixed64FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleFloat, fields[TestAllTypes.SingleFloatFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleForeignEnum, fields[TestAllTypes.SingleForeignEnumFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleForeignMessage, fields[TestAllTypes.SingleForeignMessageFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleImportEnum, fields[TestAllTypes.SingleImportEnumFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleImportMessage, fields[TestAllTypes.SingleImportMessageFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleInt32, fields[TestAllTypes.SingleInt32FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleInt64, fields[TestAllTypes.SingleInt64FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleNestedEnum, fields[TestAllTypes.SingleNestedEnumFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleNestedMessage, fields[TestAllTypes.SingleNestedMessageFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SinglePublicImportMessage, fields[TestAllTypes.SinglePublicImportMessageFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleSint32, fields[TestAllTypes.SingleSint32FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleSint64, fields[TestAllTypes.SingleSint64FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleString, fields[TestAllTypes.SingleStringFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleSfixed32, fields[TestAllTypes.SingleSfixed32FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleSfixed64, fields[TestAllTypes.SingleSfixed64FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleUint32, fields[TestAllTypes.SingleUint32FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.SingleUint64, fields[TestAllTypes.SingleUint64FieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.OneofBytes, fields[TestAllTypes.OneofBytesFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.OneofString, fields[TestAllTypes.OneofStringFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.OneofNestedMessage, fields[TestAllTypes.OneofNestedMessageFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(message.OneofUint32, fields[TestAllTypes.OneofUint32FieldNumber].Accessor.GetValue(message)); - - // Just one example for repeated fields - they're all just returning the list - var list = (IList) fields[TestAllTypes.RepeatedInt32FieldNumber].Accessor.GetValue(message); - Assert.AreEqual(message.RepeatedInt32, list); - Assert.AreEqual(message.RepeatedInt32[0], list[0]); // Just in case there was any doubt... - - // Just a single map field, for the same reason - var mapMessage = new TestMap { MapStringString = { { "key1", "value1" }, { "key2", "value2" } } }; - fields = TestMap.Descriptor.Fields; - var dictionary = (IDictionary) fields[TestMap.MapStringStringFieldNumber].Accessor.GetValue(mapMessage); - Assert.AreEqual(mapMessage.MapStringString, dictionary); - Assert.AreEqual("value1", dictionary["key1"]); - } - - [Test] - public void Clear() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var fields = TestAllTypes.Descriptor.Fields; - fields[TestAllTypes.SingleBoolFieldNumber].Accessor.Clear(message); - fields[TestAllTypes.SingleInt32FieldNumber].Accessor.Clear(message); - fields[TestAllTypes.SingleStringFieldNumber].Accessor.Clear(message); - fields[TestAllTypes.SingleBytesFieldNumber].Accessor.Clear(message); - fields[TestAllTypes.SingleForeignEnumFieldNumber].Accessor.Clear(message); - fields[TestAllTypes.SingleForeignMessageFieldNumber].Accessor.Clear(message); - fields[TestAllTypes.RepeatedDoubleFieldNumber].Accessor.Clear(message); - - var expected = new TestAllTypes(SampleMessages.CreateFullTestAllTypes()) - { - SingleBool = false, - SingleInt32 = 0, - SingleString = "", - SingleBytes = ByteString.Empty, - SingleForeignEnum = 0, - SingleForeignMessage = null, - }; - expected.RepeatedDouble.Clear(); - - Assert.AreEqual(expected, message); - - // Separately, maps. - var mapMessage = new TestMap { MapStringString = { { "key1", "value1" }, { "key2", "value2" } } }; - fields = TestMap.Descriptor.Fields; - fields[TestMap.MapStringStringFieldNumber].Accessor.Clear(mapMessage); - Assert.AreEqual(0, mapMessage.MapStringString.Count); - } - - [Test] - public void SetValue_SingleFields() - { - // Just a sample (primitives, messages, enums, strings, byte strings) - var message = SampleMessages.CreateFullTestAllTypes(); - var fields = TestAllTypes.Descriptor.Fields; - fields[TestAllTypes.SingleBoolFieldNumber].Accessor.SetValue(message, false); - fields[TestAllTypes.SingleInt32FieldNumber].Accessor.SetValue(message, 500); - fields[TestAllTypes.SingleStringFieldNumber].Accessor.SetValue(message, "It's a string"); - fields[TestAllTypes.SingleBytesFieldNumber].Accessor.SetValue(message, ByteString.CopyFrom(99, 98, 97)); - fields[TestAllTypes.SingleForeignEnumFieldNumber].Accessor.SetValue(message, ForeignEnum.ForeignFoo); - fields[TestAllTypes.SingleForeignMessageFieldNumber].Accessor.SetValue(message, new ForeignMessage { C = 12345 }); - fields[TestAllTypes.SingleDoubleFieldNumber].Accessor.SetValue(message, 20150701.5); - - var expected = new TestAllTypes(SampleMessages.CreateFullTestAllTypes()) - { - SingleBool = false, - SingleInt32 = 500, - SingleString = "It's a string", - SingleBytes = ByteString.CopyFrom(99, 98, 97), - SingleForeignEnum = ForeignEnum.ForeignFoo, - SingleForeignMessage = new ForeignMessage { C = 12345 }, - SingleDouble = 20150701.5 - }; - - Assert.AreEqual(expected, message); - } - - [Test] - public void SetValue_SingleFields_WrongType() - { - IMessage message = SampleMessages.CreateFullTestAllTypes(); - var fields = message.Descriptor.Fields; - Assert.Throws(() => fields[TestAllTypes.SingleBoolFieldNumber].Accessor.SetValue(message, "This isn't a bool")); - } - - [Test] - public void SetValue_MapFields() - { - IMessage message = new TestMap(); - var fields = message.Descriptor.Fields; - Assert.Throws(() => fields[TestMap.MapStringStringFieldNumber].Accessor.SetValue(message, new Dictionary())); - } - - [Test] - public void SetValue_RepeatedFields() - { - IMessage message = SampleMessages.CreateFullTestAllTypes(); - var fields = message.Descriptor.Fields; - Assert.Throws(() => fields[TestAllTypes.RepeatedDoubleFieldNumber].Accessor.SetValue(message, new double[10])); - } - - [Test] - public void GetValue_IncorrectType() - { - IMessage message = SampleMessages.CreateFullTestAllTypes(); - var fields = message.Descriptor.Fields; - Assert.Throws(() => fields[TestAllTypes.SingleBoolFieldNumber].Accessor.GetValue(new TestMap())); - } - - [Test] - public void Oneof() - { - var message = new TestAllTypes(); - var descriptor = TestAllTypes.Descriptor; - Assert.AreEqual(1, descriptor.Oneofs.Count); - var oneof = descriptor.Oneofs[0]; - Assert.AreEqual("oneof_field", oneof.Name); - Assert.IsNull(oneof.Accessor.GetCaseFieldDescriptor(message)); - - message.OneofString = "foo"; - Assert.AreSame(descriptor.Fields[TestAllTypes.OneofStringFieldNumber], oneof.Accessor.GetCaseFieldDescriptor(message)); - - message.OneofUint32 = 10; - Assert.AreSame(descriptor.Fields[TestAllTypes.OneofUint32FieldNumber], oneof.Accessor.GetCaseFieldDescriptor(message)); - - oneof.Accessor.Clear(message); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - } - - [Test] - public void FieldDescriptor_ByName() - { - var descriptor = TestAllTypes.Descriptor; - Assert.AreSame( - descriptor.Fields[TestAllTypes.SingleBoolFieldNumber], - descriptor.Fields["single_bool"]); - } - - [Test] - public void FieldDescriptor_NotFound() - { - var descriptor = TestAllTypes.Descriptor; - Assert.Throws(() => descriptor.Fields[999999].ToString()); - Assert.Throws(() => descriptor.Fields["not found"].ToString()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs deleted file mode 100644 index 5739cf8a746e0bd4073dbdf0ef642ad7c1b1b01b..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs +++ /dev/null @@ -1,71 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.TestProtos; -using Google.Protobuf.WellKnownTypes; -using NUnit.Framework; - -namespace Google.Protobuf.Reflection -{ - public class TypeRegistryTest - { - // Most of our tests use messages. Simple test that we really can use files... - [Test] - public void CreateWithFileDescriptor() - { - var registry = TypeRegistry.FromFiles(DurationReflection.Descriptor, StructReflection.Descriptor); - AssertDescriptorPresent(registry, Duration.Descriptor); - AssertDescriptorPresent(registry, ListValue.Descriptor); - AssertDescriptorAbsent(registry, Timestamp.Descriptor); - } - - [Test] - public void TypesFromSameFile() - { - // Just for kicks, let's start with a nested type - var registry = TypeRegistry.FromMessages(TestAllTypes.Types.NestedMessage.Descriptor); - // Top-level... - AssertDescriptorPresent(registry, TestFieldOrderings.Descriptor); - // ... and nested (not the same as the original NestedMessage!) - AssertDescriptorPresent(registry, TestFieldOrderings.Types.NestedMessage.Descriptor); - } - - [Test] - public void DependenciesAreIncluded() - { - var registry = TypeRegistry.FromMessages(TestAllTypes.Descriptor); - // Direct dependencies - AssertDescriptorPresent(registry, ImportMessage.Descriptor); - // Public dependencies - AssertDescriptorPresent(registry, PublicImportMessage.Descriptor); - } - - [Test] - public void DuplicateFiles() - { - // Duplicates via dependencies and simply via repetition - var registry = TypeRegistry.FromFiles( - UnittestProto3Reflection.Descriptor, UnittestImportProto3Reflection.Descriptor, - TimestampReflection.Descriptor, TimestampReflection.Descriptor); - AssertDescriptorPresent(registry, TestAllTypes.Descriptor); - AssertDescriptorPresent(registry, ImportMessage.Descriptor); - AssertDescriptorPresent(registry, Timestamp.Descriptor); - } - - private static void AssertDescriptorPresent(TypeRegistry registry, MessageDescriptor descriptor) - { - Assert.AreSame(descriptor, registry.Find(descriptor.FullName)); - } - - private static void AssertDescriptorAbsent(TypeRegistry registry, MessageDescriptor descriptor) - { - Assert.IsNull(registry.Find(descriptor.FullName)); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleEnum.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleEnum.cs deleted file mode 100644 index d7bfee175416ad870cab2ff35482b6bb83e5539b..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleEnum.cs +++ /dev/null @@ -1,19 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -namespace Google.Protobuf -{ - // Just a sample enum with positive and negative values to be used in tests. - internal enum SampleEnum - { - NegativeValue = -2, - None = 0, - PositiveValue = 3 - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleMessages.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleMessages.cs deleted file mode 100644 index 01df9848ffe4aa5015071dd90129bc06d3fbc9ac..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleMessages.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using Google.Protobuf.TestProtos; - -namespace Google.Protobuf -{ - /// - /// Helper methods to create sample instances of types generated from unit test messages. - /// - public class SampleMessages - { - /// - /// Creates a new sample TestAllTypes message with all fields populated. - /// The "oneof" field is populated with the string property (OneofString). - /// - public static TestAllTypes CreateFullTestAllTypes() - { - return new TestAllTypes - { - SingleBool = true, - SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), - SingleDouble = 23.5, - SingleFixed32 = 23, - SingleFixed64 = 1234567890123, - SingleFloat = 12.25f, - SingleForeignEnum = ForeignEnum.ForeignBar, - SingleForeignMessage = new ForeignMessage { C = 10 }, - SingleImportEnum = ImportEnum.ImportBaz, - SingleImportMessage = new ImportMessage { D = 20 }, - SingleInt32 = 100, - SingleInt64 = 3210987654321, - SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, - SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 35 }, - SinglePublicImportMessage = new PublicImportMessage { E = 54 }, - SingleSfixed32 = -123, - SingleSfixed64 = -12345678901234, - SingleSint32 = -456, - SingleSint64 = -12345678901235, - SingleString = "test", - SingleUint32 = UInt32.MaxValue, - SingleUint64 = UInt64.MaxValue, - RepeatedBool = { true, false }, - RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.CopyFrom(5, 6), ByteString.CopyFrom(new byte[1000]) }, - RepeatedDouble = { -12.25, 23.5 }, - RepeatedFixed32 = { UInt32.MaxValue, 23 }, - RepeatedFixed64 = { UInt64.MaxValue, 1234567890123 }, - RepeatedFloat = { 100f, 12.25f }, - RepeatedForeignEnum = { ForeignEnum.ForeignFoo, ForeignEnum.ForeignBar }, - RepeatedForeignMessage = { new ForeignMessage(), new ForeignMessage { C = 10 } }, - RepeatedImportEnum = { ImportEnum.ImportBaz, ImportEnum.Unspecified }, - RepeatedImportMessage = { new ImportMessage { D = 20 }, new ImportMessage { D = 25 } }, - RepeatedInt32 = { 100, 200 }, - RepeatedInt64 = { 3210987654321, Int64.MaxValue }, - RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAllTypes.Types.NestedEnum.Neg }, - RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage { Bb = 35 }, new TestAllTypes.Types.NestedMessage { Bb = 10 } }, - RepeatedPublicImportMessage = { new PublicImportMessage { E = 54 }, new PublicImportMessage { E = -1 } }, - RepeatedSfixed32 = { -123, 123 }, - RepeatedSfixed64 = { -12345678901234, 12345678901234 }, - RepeatedSint32 = { -456, 100 }, - RepeatedSint64 = { -12345678901235, 123 }, - RepeatedString = { "foo", "bar" }, - RepeatedUint32 = { UInt32.MaxValue, UInt32.MinValue }, - RepeatedUint64 = { UInt64.MaxValue, UInt32.MinValue }, - OneofString = "Oneof string" - }; - } - } -} \ No newline at end of file diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/TestCornerCases.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/TestCornerCases.cs deleted file mode 100644 index 5bab71cd9d345e38d50928615125047e86a0dd82..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/TestCornerCases.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using UnitTest.Issues.TestProtos; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class TestCornerCases - { - [Test] - public void TestRoundTripNegativeEnums() - { - NegativeEnumMessage msg = new NegativeEnumMessage - { - Value = NegativeEnum.MinusOne, - Values = { NegativeEnum.Zero, NegativeEnum.MinusOne, NegativeEnum.FiveBelow }, - PackedValues = { NegativeEnum.Zero, NegativeEnum.MinusOne, NegativeEnum.FiveBelow } - }; - - Assert.AreEqual(58, msg.CalculateSize()); - - byte[] bytes = new byte[58]; - CodedOutputStream output = new CodedOutputStream(bytes); - - msg.WriteTo(output); - Assert.AreEqual(0, output.SpaceLeft); - - NegativeEnumMessage copy = NegativeEnumMessage.Parser.ParseFrom(bytes); - Assert.AreEqual(msg, copy); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/TestProtos/ForeignMessagePartial.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/TestProtos/ForeignMessagePartial.cs deleted file mode 100644 index d715220dff8ce67be8b9cb2e053ec1829ddf4904..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/TestProtos/ForeignMessagePartial.cs +++ /dev/null @@ -1,22 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2016 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -namespace Google.Protobuf.TestProtos -{ - /// - /// A message with custom diagnostics (to test that they work). - /// - public partial class ForeignMessage : ICustomDiagnosticMessage - { - public string ToDiagnosticString() - { - return $"{{ \"c\": {C}, \"@cInHex\": \"{C:x}\" }}"; - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs deleted file mode 100644 index 4d24344c87d74473df815c099cefaf938abc9192..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs +++ /dev/null @@ -1,93 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.TestProtos; -using NUnit.Framework; - -namespace Google.Protobuf.WellKnownTypes -{ - public class AnyTest - { - [Test] - public void Pack() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var any = Any.Pack(message); - Assert.AreEqual("type.googleapis.com/protobuf_unittest.TestAllTypes", any.TypeUrl); - Assert.AreEqual(message.CalculateSize(), any.Value.Length); - } - - [Test] - public void Pack_WithCustomPrefix() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var any = Any.Pack(message, "foo.bar/baz"); - Assert.AreEqual("foo.bar/baz/protobuf_unittest.TestAllTypes", any.TypeUrl); - Assert.AreEqual(message.CalculateSize(), any.Value.Length); - } - - [Test] - public void Pack_WithCustomPrefixTrailingSlash() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var any = Any.Pack(message, "foo.bar/baz/"); - Assert.AreEqual("foo.bar/baz/protobuf_unittest.TestAllTypes", any.TypeUrl); - Assert.AreEqual(message.CalculateSize(), any.Value.Length); - } - - [Test] - public void Unpack_WrongType() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var any = Any.Pack(message); - Assert.Throws(() => any.Unpack()); - } - - [Test] - public void Unpack_Success() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var any = Any.Pack(message); - var unpacked = any.Unpack(); - Assert.AreEqual(message, unpacked); - } - - [Test] - public void Unpack_CustomPrefix_Success() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var any = Any.Pack(message, "foo.bar/baz"); - var unpacked = any.Unpack(); - Assert.AreEqual(message, unpacked); - } - - [Test] - public void ToString_WithValues() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var any = Any.Pack(message); - var text = any.ToString(); - Assert.That(text, Does.Contain("\"@value\": \"" + message.ToByteString().ToBase64() + "\"")); - } - - [Test] - public void ToString_Empty() - { - var any = new Any(); - Assert.AreEqual("{ \"@type\": \"\", \"@value\": \"\" }", any.ToString()); - } - - [Test] - public void ToString_MessageContainingAny() - { - var message = new TestWellKnownTypes { AnyField = new Any() }; - Assert.AreEqual("{ \"anyField\": { \"@type\": \"\", \"@value\": \"\" } }", message.ToString()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs deleted file mode 100644 index dfa6fa1584f8fa04c843455859a760974be519d3..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs +++ /dev/null @@ -1,109 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using NUnit.Framework; -using System; - -namespace Google.Protobuf.WellKnownTypes -{ - public class DurationTest - { - [Test] - public void ToTimeSpan() - { - Assert.AreEqual(TimeSpan.FromSeconds(1), new Duration { Seconds = 1 }.ToTimeSpan()); - Assert.AreEqual(TimeSpan.FromSeconds(-1), new Duration { Seconds = -1 }.ToTimeSpan()); - Assert.AreEqual(TimeSpan.FromMilliseconds(1), new Duration { Nanos = 1000000 }.ToTimeSpan()); - Assert.AreEqual(TimeSpan.FromMilliseconds(-1), new Duration { Nanos = -1000000 }.ToTimeSpan()); - Assert.AreEqual(TimeSpan.FromTicks(1), new Duration { Nanos = 100 }.ToTimeSpan()); - Assert.AreEqual(TimeSpan.FromTicks(-1), new Duration { Nanos = -100 }.ToTimeSpan()); - - // Rounding is towards 0 - Assert.AreEqual(TimeSpan.FromTicks(2), new Duration { Nanos = 250 }.ToTimeSpan()); - Assert.AreEqual(TimeSpan.FromTicks(-2), new Duration { Nanos = -250 }.ToTimeSpan()); - } - - [Test] - public void Addition() - { - Assert.AreEqual(new Duration { Seconds = 2, Nanos = 100000000 }, - new Duration { Seconds = 1, Nanos = 600000000 } + new Duration { Nanos = 500000000 }); - Assert.AreEqual(new Duration { Seconds = -2, Nanos = -100000000 }, - new Duration { Seconds = -1, Nanos = -600000000 } + new Duration { Nanos = -500000000 }); - Assert.AreEqual(new Duration { Seconds = 1, Nanos = 100000000 }, - new Duration { Seconds = 1, Nanos = 600000000 } + new Duration { Nanos = -500000000 }); - - // Non-normalized durations, or non-normalized intermediate results - Assert.AreEqual(new Duration { Seconds = 1 }, - new Duration { Seconds = 1, Nanos = -500000000 } + new Duration { Nanos = 500000000 }); - - Assert.AreEqual(new Duration { Nanos = -900000000 }, - new Duration { Seconds = -1, Nanos = -100000000 } + new Duration { Nanos = 200000000 }); - Assert.AreEqual(new Duration { Nanos = 900000000 }, - new Duration { Seconds = 1, Nanos = 100000000 } + new Duration { Nanos = -200000000 }); - } - - [Test] - public void Subtraction() - { - Assert.AreEqual(new Duration { Seconds = 1, Nanos = 100000000 }, - new Duration { Seconds = 1, Nanos = 600000000 } - new Duration { Nanos = 500000000 }); - Assert.AreEqual(new Duration { Seconds = -1, Nanos = -100000000 }, - new Duration { Seconds = -1, Nanos = -600000000 } - new Duration { Nanos = -500000000 }); - Assert.AreEqual(new Duration { Seconds = 2, Nanos = 100000000 }, - new Duration { Seconds = 1, Nanos = 600000000 } - new Duration { Nanos = -500000000 }); - - // Non-normalized durations - Assert.AreEqual(new Duration(), - new Duration { Seconds = 1, Nanos = -500000000 } - new Duration { Nanos = 500000000 }); - Assert.AreEqual(new Duration { Seconds = 1 }, - new Duration { Nanos = 2000000000 } - new Duration { Nanos = 1000000000 }); - } - - [Test] - public void FromTimeSpan() - { - Assert.AreEqual(new Duration { Seconds = 1 }, Duration.FromTimeSpan(TimeSpan.FromSeconds(1))); - Assert.AreEqual(new Duration { Nanos = Duration.NanosecondsPerTick }, Duration.FromTimeSpan(TimeSpan.FromTicks(1))); - } - - [Test] - [TestCase(0, Duration.MaxNanoseconds + 1)] - [TestCase(0, Duration.MinNanoseconds - 1)] - [TestCase(Duration.MinSeconds - 1, 0)] - [TestCase(Duration.MaxSeconds + 1, 0)] - [TestCase(1, -1)] - [TestCase(-1, 1)] - public void ToTimeSpan_Invalid(long seconds, int nanoseconds) - { - var duration = new Duration { Seconds = seconds, Nanos = nanoseconds }; - Assert.Throws(() => duration.ToTimeSpan()); - } - - [Test] - [TestCase(0, Duration.MaxNanoseconds)] - [TestCase(0, Duration.MinNanoseconds)] - [TestCase(Duration.MinSeconds, Duration.MinNanoseconds)] - [TestCase(Duration.MaxSeconds, Duration.MaxNanoseconds)] - public void ToTimeSpan_Valid(long seconds, int nanoseconds) - { - // Only testing that these values don't throw, unlike their similar tests in ToTimeSpan_Invalid - var duration = new Duration { Seconds = seconds, Nanos = nanoseconds }; - duration.ToTimeSpan(); - } - - [Test] - public void ToString_NonNormalized() - { - // Just a single example should be sufficient... - var duration = new Duration { Seconds = 1, Nanos = -1 }; - Assert.AreEqual("{ \"@warning\": \"Invalid Duration\", \"seconds\": \"1\", \"nanos\": -1 }", duration.ToString()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs deleted file mode 100644 index 27ce54aeadcb1fe057b534bb2e0812aab838baec..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2016 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - - -using NUnit.Framework; - -namespace Google.Protobuf.WellKnownTypes -{ - public class FieldMaskTest - { - [Test] - [TestCase("foo__bar")] - [TestCase("foo_3_ar")] - [TestCase("fooBar")] - public void ToString_Invalid(string input) - { - var mask = new FieldMask { Paths = { input } }; - var text = mask.ToString(); - // More specific test below - Assert.That(text, Does.Contain("@warning")); - Assert.That(text, Does.Contain(input)); - } - - [Test] - public void ToString_Invalid_Precise() - { - var mask = new FieldMask { Paths = { "x", "foo__bar", @"x\y" } }; - Assert.AreEqual( - "{ \"@warning\": \"Invalid FieldMask\", \"paths\": [ \"x\", \"foo__bar\", \"x\\\\y\" ] }", - mask.ToString()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs deleted file mode 100644 index f4ea1c992ec157e65873ff6f8fa284449d853487..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs +++ /dev/null @@ -1,92 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using NUnit.Framework; -using System; - -namespace Google.Protobuf.WellKnownTypes -{ - public class TimestampTest - { - [Test] - public void FromAndToDateTime() - { - DateTime utcMin = DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc); - DateTime utcMax = DateTime.SpecifyKind(DateTime.MaxValue, DateTimeKind.Utc); - AssertRoundtrip(new Timestamp { Seconds = -62135596800 }, utcMin); - AssertRoundtrip(new Timestamp { Seconds = 253402300799, Nanos = 999999900 }, utcMax); - AssertRoundtrip(new Timestamp(), new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)); - AssertRoundtrip(new Timestamp { Nanos = 1000000}, new DateTime(1970, 1, 1, 0, 0, 0, 1, DateTimeKind.Utc)); - AssertRoundtrip(new Timestamp { Seconds = -1, Nanos = 999000000 }, new DateTime(1969, 12, 31, 23, 59, 59, 999, DateTimeKind.Utc)); - AssertRoundtrip(new Timestamp { Seconds = 3600 }, new DateTime(1970, 1, 1, 1, 0, 0, DateTimeKind.Utc)); - AssertRoundtrip(new Timestamp { Seconds = -3600 }, new DateTime(1969, 12, 31, 23, 0, 0, DateTimeKind.Utc)); - } - - [Test] - public void ToDateTimeTruncation() - { - var t1 = new Timestamp { Seconds = 1, Nanos = 1000000 + Duration.NanosecondsPerTick - 1 }; - Assert.AreEqual(new DateTime(1970, 1, 1, 0, 0, 1, DateTimeKind.Utc).AddMilliseconds(1), t1.ToDateTime()); - - var t2 = new Timestamp { Seconds = -1, Nanos = 1000000 + Duration.NanosecondsPerTick - 1 }; - Assert.AreEqual(new DateTime(1969, 12, 31, 23, 59, 59).AddMilliseconds(1), t2.ToDateTime()); - } - - [Test] - [TestCase(Timestamp.UnixSecondsAtBclMinValue - 1, Timestamp.MaxNanos)] - [TestCase(Timestamp.UnixSecondsAtBclMaxValue + 1, 0)] - [TestCase(0, -1)] - [TestCase(0, Timestamp.MaxNanos + 1)] - public void ToDateTime_OutOfRange(long seconds, int nanoseconds) - { - var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; - Assert.Throws(() => value.ToDateTime()); - } - - // 1ns larger or smaller than the above values - [Test] - [TestCase(Timestamp.UnixSecondsAtBclMinValue, 0)] - [TestCase(Timestamp.UnixSecondsAtBclMaxValue, Timestamp.MaxNanos)] - [TestCase(0, 0)] - [TestCase(0, Timestamp.MaxNanos)] - public void ToDateTime_ValidBoundaries(long seconds, int nanoseconds) - { - var value = new Timestamp { Seconds = seconds, Nanos = nanoseconds }; - value.ToDateTime(); - } - - private static void AssertRoundtrip(Timestamp timestamp, DateTime dateTime) - { - Assert.AreEqual(timestamp, Timestamp.FromDateTime(dateTime)); - Assert.AreEqual(dateTime, timestamp.ToDateTime()); - Assert.AreEqual(DateTimeKind.Utc, timestamp.ToDateTime().Kind); - } - - [Test] - public void Arithmetic() - { - Timestamp t1 = new Timestamp { Seconds = 10000, Nanos = 5000 }; - Timestamp t2 = new Timestamp { Seconds = 8000, Nanos = 10000 }; - Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 }; - Assert.AreEqual(difference, t1 - t2); - Assert.AreEqual(-difference, t2 - t1); - - Assert.AreEqual(t1, t2 + difference); - Assert.AreEqual(t2, t1 - difference); - } - - [Test] - public void ToString_NonNormalized() - { - // Just a single example should be sufficient... - var duration = new Timestamp { Seconds = 1, Nanos = -1 }; - Assert.AreEqual("{ \"@warning\": \"Invalid Timestamp\", \"seconds\": \"1\", \"nanos\": -1 }", duration.ToString()); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs deleted file mode 100644 index bf34c314dc732fb53749587c775981b5adcceb98..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs +++ /dev/null @@ -1,398 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using Google.Protobuf.TestProtos; -using NUnit.Framework; -using System.Collections; -using System.IO; - -namespace Google.Protobuf.WellKnownTypes -{ - public class WrappersTest - { - [Test] - public void NullIsDefault() - { - var message = new TestWellKnownTypes(); - Assert.IsNull(message.StringField); - Assert.IsNull(message.BytesField); - Assert.IsNull(message.BoolField); - Assert.IsNull(message.FloatField); - Assert.IsNull(message.DoubleField); - Assert.IsNull(message.Int32Field); - Assert.IsNull(message.Int64Field); - Assert.IsNull(message.Uint32Field); - Assert.IsNull(message.Uint64Field); - } - - [Test] - public void NonDefaultSingleValues() - { - var message = new TestWellKnownTypes - { - StringField = "x", - BytesField = ByteString.CopyFrom(1, 2, 3), - BoolField = true, - FloatField = 12.5f, - DoubleField = 12.25d, - Int32Field = 1, - Int64Field = 2, - Uint32Field = 3, - Uint64Field = 4 - }; - - var bytes = message.ToByteArray(); - var parsed = TestWellKnownTypes.Parser.ParseFrom(bytes); - - Assert.AreEqual("x", parsed.StringField); - Assert.AreEqual(ByteString.CopyFrom(1, 2, 3), parsed.BytesField); - Assert.AreEqual(true, parsed.BoolField); - Assert.AreEqual(12.5f, parsed.FloatField); - Assert.AreEqual(12.25d, parsed.DoubleField); - Assert.AreEqual(1, parsed.Int32Field); - Assert.AreEqual(2L, parsed.Int64Field); - Assert.AreEqual(3U, parsed.Uint32Field); - Assert.AreEqual(4UL, parsed.Uint64Field); - } - - [Test] - public void NonNullDefaultIsPreservedThroughSerialization() - { - var message = new TestWellKnownTypes - { - StringField = "", - BytesField = ByteString.Empty, - BoolField = false, - FloatField = 0f, - DoubleField = 0d, - Int32Field = 0, - Int64Field = 0, - Uint32Field = 0, - Uint64Field = 0 - }; - - var bytes = message.ToByteArray(); - var parsed = TestWellKnownTypes.Parser.ParseFrom(bytes); - - Assert.AreEqual("", parsed.StringField); - Assert.AreEqual(ByteString.Empty, parsed.BytesField); - Assert.AreEqual(false, parsed.BoolField); - Assert.AreEqual(0f, parsed.FloatField); - Assert.AreEqual(0d, parsed.DoubleField); - Assert.AreEqual(0, parsed.Int32Field); - Assert.AreEqual(0L, parsed.Int64Field); - Assert.AreEqual(0U, parsed.Uint32Field); - Assert.AreEqual(0UL, parsed.Uint64Field); - } - - [Test] - public void RepeatedWrappersProhibitNullItems() - { - var message = new RepeatedWellKnownTypes(); - Assert.Throws(() => message.BoolField.Add((bool?) null)); - Assert.Throws(() => message.Int32Field.Add((int?) null)); - Assert.Throws(() => message.StringField.Add((string) null)); - Assert.Throws(() => message.BytesField.Add((ByteString) null)); - } - - [Test] - public void RepeatedWrappersSerializeDeserialize() - { - var message = new RepeatedWellKnownTypes - { - BoolField = { true, false }, - BytesField = { ByteString.CopyFrom(1, 2, 3), ByteString.CopyFrom(4, 5, 6), ByteString.Empty }, - DoubleField = { 12.5, -1.5, 0d }, - FloatField = { 123.25f, -20f, 0f }, - Int32Field = { int.MaxValue, int.MinValue, 0 }, - Int64Field = { long.MaxValue, long.MinValue, 0L }, - StringField = { "First", "Second", "" }, - Uint32Field = { uint.MaxValue, uint.MinValue, 0U }, - Uint64Field = { ulong.MaxValue, ulong.MinValue, 0UL }, - }; - var bytes = message.ToByteArray(); - var parsed = RepeatedWellKnownTypes.Parser.ParseFrom(bytes); - - Assert.AreEqual(message, parsed); - // Just to test a single value for sanity... - Assert.AreEqual("Second", message.StringField[1]); - } - - [Test] - public void RepeatedWrappersBinaryFormat() - { - // At one point we accidentally used a packed format for repeated wrappers, which is wrong (and weird). - // This test is just to prove that we use the right format. - - var rawOutput = new MemoryStream(); - var output = new CodedOutputStream(rawOutput); - // Write a value of 5 - output.WriteTag(RepeatedWellKnownTypes.Int32FieldFieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(2); - output.WriteTag(WrappersReflection.WrapperValueFieldNumber, WireFormat.WireType.Varint); - output.WriteInt32(5); - // Write a value of 0 (empty message) - output.WriteTag(RepeatedWellKnownTypes.Int32FieldFieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(0); - output.Flush(); - var expectedBytes = rawOutput.ToArray(); - - var message = new RepeatedWellKnownTypes { Int32Field = { 5, 0 } }; - var actualBytes = message.ToByteArray(); - Assert.AreEqual(expectedBytes, actualBytes); - } - - [Test] - public void MapWrappersSerializeDeserialize() - { - // Note: no null values here, as they are prohibited in map fields - // (despite being representable). - var message = new MapWellKnownTypes - { - BoolField = { { 10, false }, { 20, true } }, - BytesField = { - { -1, ByteString.CopyFrom(1, 2, 3) }, - { 10, ByteString.CopyFrom(4, 5, 6) }, - { 1000, ByteString.Empty }, - }, - DoubleField = { { 1, 12.5 }, { 10, -1.5 }, { 20, 0d } }, - FloatField = { { 2, 123.25f }, { 3, -20f }, { 4, 0f } }, - Int32Field = { { 5, int.MaxValue }, { 6, int.MinValue }, { 7, 0 } }, - Int64Field = { { 8, long.MaxValue }, { 9, long.MinValue }, { 10, 0L } }, - StringField = { { 11, "First" }, { 12, "Second" }, { 13, "" } }, - Uint32Field = { { 15, uint.MaxValue }, { 16, uint.MinValue }, { 17, 0U } }, - Uint64Field = { { 18, ulong.MaxValue }, { 19, ulong.MinValue }, { 20, 0UL } }, - }; - - var bytes = message.ToByteArray(); - var parsed = MapWellKnownTypes.Parser.ParseFrom(bytes); - - Assert.AreEqual(message, parsed); - // Just to test a single value for sanity... - Assert.AreEqual("Second", message.StringField[12]); - } - - [Test] - public void Reflection_SingleValues() - { - var message = new TestWellKnownTypes - { - StringField = "x", - BytesField = ByteString.CopyFrom(1, 2, 3), - BoolField = true, - FloatField = 12.5f, - DoubleField = 12.25d, - Int32Field = 1, - Int64Field = 2, - Uint32Field = 3, - Uint64Field = 4 - }; - var fields = TestWellKnownTypes.Descriptor.Fields; - - Assert.AreEqual("x", fields[TestWellKnownTypes.StringFieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(ByteString.CopyFrom(1, 2, 3), fields[TestWellKnownTypes.BytesFieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(true, fields[TestWellKnownTypes.BoolFieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(12.5f, fields[TestWellKnownTypes.FloatFieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(12.25d, fields[TestWellKnownTypes.DoubleFieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(1, fields[TestWellKnownTypes.Int32FieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(2L, fields[TestWellKnownTypes.Int64FieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(3U, fields[TestWellKnownTypes.Uint32FieldFieldNumber].Accessor.GetValue(message)); - Assert.AreEqual(4UL, fields[TestWellKnownTypes.Uint64FieldFieldNumber].Accessor.GetValue(message)); - - // And a couple of null fields... - message.StringField = null; - message.FloatField = null; - Assert.IsNull(fields[TestWellKnownTypes.StringFieldFieldNumber].Accessor.GetValue(message)); - Assert.IsNull(fields[TestWellKnownTypes.FloatFieldFieldNumber].Accessor.GetValue(message)); - } - - [Test] - public void Reflection_RepeatedFields() - { - // Just a single example... note that we can't have a null value here - var message = new RepeatedWellKnownTypes { Int32Field = { 1, 2 } }; - var fields = RepeatedWellKnownTypes.Descriptor.Fields; - var list = (IList) fields[RepeatedWellKnownTypes.Int32FieldFieldNumber].Accessor.GetValue(message); - CollectionAssert.AreEqual(new[] { 1, 2 }, list); - } - - [Test] - public void Reflection_MapFields() - { - // Just a single example... note that we can't have a null value here despite the value type being int? - var message = new MapWellKnownTypes { Int32Field = { { 1, 2 } } }; - var fields = MapWellKnownTypes.Descriptor.Fields; - var dictionary = (IDictionary) fields[MapWellKnownTypes.Int32FieldFieldNumber].Accessor.GetValue(message); - Assert.AreEqual(2, dictionary[1]); - } - - [Test] - public void Oneof() - { - var message = new OneofWellKnownTypes { EmptyField = new Empty() }; - // Start off with a non-wrapper - Assert.AreEqual(OneofWellKnownTypes.OneofFieldOneofCase.EmptyField, message.OneofFieldCase); - AssertOneofRoundTrip(message); - - message.StringField = "foo"; - Assert.AreEqual(OneofWellKnownTypes.OneofFieldOneofCase.StringField, message.OneofFieldCase); - AssertOneofRoundTrip(message); - - message.StringField = "foo"; - Assert.AreEqual(OneofWellKnownTypes.OneofFieldOneofCase.StringField, message.OneofFieldCase); - AssertOneofRoundTrip(message); - - message.DoubleField = 0.0f; - Assert.AreEqual(OneofWellKnownTypes.OneofFieldOneofCase.DoubleField, message.OneofFieldCase); - AssertOneofRoundTrip(message); - - message.DoubleField = 1.0f; - Assert.AreEqual(OneofWellKnownTypes.OneofFieldOneofCase.DoubleField, message.OneofFieldCase); - AssertOneofRoundTrip(message); - - message.ClearOneofField(); - Assert.AreEqual(OneofWellKnownTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - AssertOneofRoundTrip(message); - } - - private void AssertOneofRoundTrip(OneofWellKnownTypes message) - { - // Normal roundtrip, but explicitly checking the case... - var bytes = message.ToByteArray(); - var parsed = OneofWellKnownTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); - Assert.AreEqual(message.OneofFieldCase, parsed.OneofFieldCase); - } - - [Test] - [TestCase("x", "y", "y")] - [TestCase("x", "", "x")] - [TestCase("x", null, "x")] - [TestCase("", "y", "y")] - [TestCase("", "", "")] - [TestCase("", null, "")] - [TestCase(null, "y", "y")] - [TestCase(null, "", "")] - [TestCase(null, null, null)] - public void Merging(string original, string merged, string expected) - { - var originalMessage = new TestWellKnownTypes { StringField = original }; - var mergingMessage = new TestWellKnownTypes { StringField = merged }; - originalMessage.MergeFrom(mergingMessage); - Assert.AreEqual(expected, originalMessage.StringField); - - // Try it using MergeFrom(CodedInputStream) too... - originalMessage = new TestWellKnownTypes { StringField = original }; - originalMessage.MergeFrom(mergingMessage.ToByteArray()); - Assert.AreEqual(expected, originalMessage.StringField); - } - - // Merging is odd with wrapper types, due to the way that default values aren't emitted in - // the binary stream. In fact we cheat a little bit - a message with an explicitly present default - // value will have that default value ignored. See issue 615. Fixing this would require significant upheaval to - // the FieldCodec side of things. - [Test] - public void MergingStreamExplicitValue() - { - var message = new TestWellKnownTypes { Int32Field = 5 }; - - // Create a byte array which has the data of an Int32Value explicitly containing a value of 0. - // This wouldn't normally happen. - byte[] bytes; - var wrapperTag = WireFormat.MakeTag(TestWellKnownTypes.Int32FieldFieldNumber, WireFormat.WireType.LengthDelimited); - var valueTag = WireFormat.MakeTag(Int32Value.ValueFieldNumber, WireFormat.WireType.Varint); - using (var stream = new MemoryStream()) - { - var coded = new CodedOutputStream(stream); - coded.WriteTag(wrapperTag); - coded.WriteLength(2); // valueTag + a value 0, each one byte - coded.WriteTag(valueTag); - coded.WriteInt32(0); - coded.Flush(); - bytes = stream.ToArray(); - } - - message.MergeFrom(bytes); - // A normal implementation would have 0 now, as the explicit default would have been overwritten the 5. - // With the FieldCodec for Nullable, we can't tell the difference between an implicit 0 and an explicit 0. - Assert.AreEqual(5, message.Int32Field); - } - - [Test] - public void MergingStreamNoValue() - { - var message = new TestWellKnownTypes { Int32Field = 5 }; - - // Create a byte array which an Int32 field, but with no value. - var bytes = new TestWellKnownTypes { Int32Field = 0 }.ToByteArray(); - Assert.AreEqual(2, bytes.Length); // The tag for Int32Field is a single byte, then a byte indicating a 0-length message. - message.MergeFrom(bytes); - - // The "implicit" 0 did *not* overwrite the value. - // (This is the correct behaviour.) - Assert.AreEqual(5, message.Int32Field); - } - - // All permutations of origin/merging value being null, zero (default) or non-default. - // As this is the in-memory version, we don't need to worry about the difference between implicit and explicit 0. - [Test] - [TestCase(null, null, null)] - [TestCase(null, 0, 0)] - [TestCase(null, 5, 5)] - [TestCase(0, null, 0)] - [TestCase(0, 0, 0)] - [TestCase(0, 5, 5)] - [TestCase(5, null, 5)] - [TestCase(5, 0, 5)] - [TestCase(5, 10, 10)] - public void MergingMessageWithZero(int? originValue, int? mergingValue, int? expectedResult) - { - // This differs from the MergingStreamCornerCase because when we merge message *objects*, - // we ignore default values from the "source". - var message1 = new TestWellKnownTypes { Int32Field = originValue }; - var message2 = new TestWellKnownTypes { Int32Field = mergingValue }; - message1.MergeFrom(message2); - Assert.AreEqual(expectedResult, message1.Int32Field); - } - - [Test] - public void UnknownFieldInWrapper() - { - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - var wrapperTag = WireFormat.MakeTag(TestWellKnownTypes.Int32FieldFieldNumber, WireFormat.WireType.LengthDelimited); - var unknownTag = WireFormat.MakeTag(15, WireFormat.WireType.Varint); - var valueTag = WireFormat.MakeTag(Int32Value.ValueFieldNumber, WireFormat.WireType.Varint); - - output.WriteTag(wrapperTag); - output.WriteLength(4); // unknownTag + value 5 + valueType + value 6, each 1 byte - output.WriteTag(unknownTag); - output.WriteInt32((int) valueTag); // Sneakily "pretend" it's a tag when it's really a value - output.WriteTag(valueTag); - output.WriteInt32(6); - - output.Flush(); - stream.Position = 0; - - var message = TestWellKnownTypes.Parser.ParseFrom(stream); - Assert.AreEqual(6, message.Int32Field); - } - - [Test] - public void ClearWithReflection() - { - // String and Bytes are the tricky ones here, as the CLR type of the property - // is the same between the wrapper and non-wrapper types. - var message = new TestWellKnownTypes { StringField = "foo" }; - TestWellKnownTypes.Descriptor.Fields[TestWellKnownTypes.StringFieldFieldNumber].Accessor.Clear(message); - Assert.IsNull(message.StringField); - } - } -} diff --git a/csharp/compatibility_tests/v3.0.0/test.sh b/csharp/compatibility_tests/v3.0.0/test.sh deleted file mode 100644 index ddf844a4f5cb25f1789e1719c69dab85045907c1..0000000000000000000000000000000000000000 --- a/csharp/compatibility_tests/v3.0.0/test.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -function run_test() { - # Generate test proto files. - $1 -Iprotos/src -I../../../src/ --csharp_out=src/Google.Protobuf.Test \ - --csharp_opt=base_namespace=Google.Protobuf \ - protos/src/google/protobuf/unittest_import_proto3.proto \ - protos/src/google/protobuf/unittest_import_public_proto3.proto \ - protos/src/google/protobuf/unittest_well_known_types.proto - - $1 -Iprotos/csharp --csharp_out=src/Google.Protobuf.Test \ - --csharp_opt=base_namespace=UnitTest.Issues \ - protos/csharp/protos/unittest_issues.proto - - $2 -Iprotos/src --csharp_out=src/Google.Protobuf.Test \ - --csharp_opt=base_namespace=Google.Protobuf \ - protos/src/google/protobuf/unittest_proto3.proto \ - protos/src/google/protobuf/map_unittest_proto3.proto - - # Build and test. - dotnet restore src/Google.Protobuf/Google.Protobuf.csproj - dotnet restore src/Google.Protobuf.Test/Google.Protobuf.Test.csproj - dotnet build -c Release src/Google.Protobuf/Google.Protobuf.csproj - dotnet build -c Release src/Google.Protobuf.Test/Google.Protobuf.Test.csproj - dotnet run -c Release -f net6.0 -p src/Google.Protobuf.Test/Google.Protobuf.Test.csproj -} - -set -ex - -PROTOC=$(realpath ${2:-../../../bazel-bin/protoc}) - -# Change to the script's directory. -cd $(dirname $0) - -# Version of the tests (i.e., the version of protobuf from where we extracted -# these tests). -TEST_VERSION=3.0.0 - -# The old version of protobuf that we are testing compatibility against. This -# is usually the same as TEST_VERSION (i.e., we use the tests extracted from -# that version to test compatibility of the newest runtime against it), but it -# is also possible to use this same test set to test the compatibility of the -# latest version against other versions. -OLD_VERSION=$1 -OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe - -echo "Running compatibility tests with $OLD_VERSION" - -# Check protoc -[ -f $PROTOC ] || { - echo "[ERROR]: Please build protoc first." - exit 1 -} - -# Download old version protoc compiler (for linux). -wget $OLD_VERSION_PROTOC -O old_protoc -chmod +x old_protoc - -# Test source compatibility. In these tests we recompile everything against -# the new runtime (including old version generated code). -# Copy the new runtime and keys. -cp ../../src/Google.Protobuf src/Google.Protobuf -r -cp ../../keys . -r - -# Test A.1: -# proto set 1: use old version -# proto set 2 which may import protos in set 1: use old version -run_test "./old_protoc" "./old_protoc" - -# Test A.2: -# proto set 1: use new version -# proto set 2 which may import protos in set 1: use old version -run_test "$PROTOC" "./old_protoc" - -# Test A.3: -# proto set 1: use old version -# proto set 2 which may import protos in set 1: use new version -run_test "./old_protoc" "$PROTOC" - -rm old_protoc -rm keys -r -rm src/Google.Protobuf -r diff --git a/csharp/generate_protos.sh b/csharp/generate_protos.sh index d747bff501e1f98c4818cae10d3f3e18fc298398..b663138d10871f6006717e6e808b9f527c17c95d 100644 --- a/csharp/generate_protos.sh +++ b/csharp/generate_protos.sh @@ -11,19 +11,15 @@ pushd $(dirname $0)/.. # Protocol buffer compiler to use. If the PROTOC variable is set, # use that. Otherwise, probe for expected locations under both # Windows and Unix. -PROTOC_LOCATIONS=( - "bazel-bin/protoc" - "solution/Debug/protoc.exe" - "cmake/build/Debug/protoc.exe" - "cmake/build/Release/protoc.exe" -) if [ -z "$PROTOC" ]; then - for protoc in "${PROTOC_LOCATIONS[@]}"; do - if [ -x "$protoc" ]; then - PROTOC="$protoc" - fi - done - if [ -z "$PROTOC" ]; then + # TODO(jonskeet): Use an array and a for loop instead? + if [ -x cmake/build/Debug/protoc.exe ]; then + PROTOC=cmake/build/Debug/protoc.exe + elif [ -x cmake/build/Release/protoc.exe ]; then + PROTOC=cmake/build/Release/protoc.exe + elif [ -x src/protoc ]; then + PROTOC=src/protoc + else echo "Unable to find protocol buffer compiler." exit 1 fi @@ -32,7 +28,6 @@ fi # descriptor.proto and well-known types $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \ --csharp_opt=base_namespace=Google.Protobuf \ - --csharp_opt=file_extension=.pb.cs \ src/google/protobuf/descriptor.proto \ src/google/protobuf/any.proto \ src/google/protobuf/api.proto \ @@ -43,17 +38,15 @@ $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \ src/google/protobuf/struct.proto \ src/google/protobuf/timestamp.proto \ src/google/protobuf/type.proto \ - src/google/protobuf/wrappers.proto \ - src/google/protobuf/compiler/plugin.proto + src/google/protobuf/wrappers.proto # Test protos # Note that this deliberately does *not* include old_extensions1.proto # and old_extensions2.proto, which are generated with an older version # of protoc. -$PROTOC -Isrc -I. \ +$PROTOC -Isrc -Icsharp/protos \ --experimental_allow_proto3_optional \ --csharp_out=csharp/src/Google.Protobuf.Test.TestProtos \ - --csharp_opt=file_extension=.pb.cs \ --descriptor_set_out=csharp/src/Google.Protobuf.Test/testprotos.pb \ --include_source_info \ --include_imports \ @@ -73,15 +66,22 @@ $PROTOC -Isrc -I. \ src/google/protobuf/unittest_well_known_types.proto \ src/google/protobuf/test_messages_proto3.proto \ src/google/protobuf/test_messages_proto2.proto \ - src/google/protobuf/unittest_proto3_optional.proto \ - src/google/protobuf/unittest_retention.proto + src/google/protobuf/unittest_proto3_optional.proto # AddressBook sample protos $PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \ - --csharp_opt=file_extension=.pb.cs \ examples/addressbook.proto -# Conformance tests -$PROTOC -I. --csharp_out=csharp/src/Google.Protobuf.Conformance \ - --csharp_opt=file_extension=.pb.cs \ +$PROTOC -Iconformance -Isrc --csharp_out=csharp/src/Google.Protobuf.Conformance \ conformance/conformance.proto + +# Benchmark protos +$PROTOC -Ibenchmarks \ + benchmarks/datasets/google_message1/proto3/*.proto \ + benchmarks/benchmarks.proto \ + --csharp_out=csharp/src/Google.Protobuf.Benchmarks + +# C# only benchmark protos +$PROTOC -Isrc -Icsharp/src/Google.Protobuf.Benchmarks \ + csharp/src/Google.Protobuf.Benchmarks/*.proto \ + --csharp_out=csharp/src/Google.Protobuf.Benchmarks diff --git a/csharp/install_dotnet_sdk.ps1 b/csharp/install_dotnet_sdk.ps1 index f9dc0d9d7ac38ec7b4565c10dcb0df78aeb3b5e1..8bc967c9f4d6838b254f68fd5e668eef0f110bcc 100644 --- a/csharp/install_dotnet_sdk.ps1 +++ b/csharp/install_dotnet_sdk.ps1 @@ -16,5 +16,5 @@ Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath # The SDK versions to install should be kept in sync with versions # installed by kokoro/linux/dockerfile/test/csharp/Dockerfile -&$InstallScriptPath -Version 3.1.415 -&$InstallScriptPath -Version 6.0.100 +&$InstallScriptPath -Version 2.1.802 +&$InstallScriptPath -Version 3.1.301 diff --git a/csharp/protos/map_unittest_proto3.proto b/csharp/protos/map_unittest_proto3.proto index 2516286393ab0fb851d4cad94ba6054e645ba210..e43e858bc1fd63dce238dc3b271aa074f7acbcce 100644 --- a/csharp/protos/map_unittest_proto3.proto +++ b/csharp/protos/map_unittest_proto3.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // This file is mostly equivalent to map_unittest.proto, but imports // unittest_proto3.proto instead of unittest.proto, so that it only @@ -13,31 +36,31 @@ // required fields in proto3. syntax = "proto3"; -package protobuf_unittest3; +option csharp_namespace = "Google.Protobuf.TestProtos"; -import "csharp/protos/unittest_proto3.proto"; +import "unittest_proto3.proto"; -option csharp_namespace = "Google.Protobuf.TestProtos"; +package protobuf_unittest3; // Tests maps. message TestMap { - map map_int32_int32 = 1; - map map_int64_int64 = 2; - map map_uint32_uint32 = 3; - map map_uint64_uint64 = 4; - map map_sint32_sint32 = 5; - map map_sint64_sint64 = 6; - map map_fixed32_fixed32 = 7; - map map_fixed64_fixed64 = 8; + map map_int32_int32 = 1; + map map_int64_int64 = 2; + map map_uint32_uint32 = 3; + map map_uint64_uint64 = 4; + map map_sint32_sint32 = 5; + map map_sint64_sint64 = 6; + map map_fixed32_fixed32 = 7; + map map_fixed64_fixed64 = 8; map map_sfixed32_sfixed32 = 9; map map_sfixed64_sfixed64 = 10; - map map_int32_float = 11; - map map_int32_double = 12; - map map_bool_bool = 13; - map map_string_string = 14; - map map_int32_bytes = 15; - map map_int32_enum = 16; - map map_int32_foreign_message = 17; + map map_int32_float = 11; + map map_int32_double = 12; + map map_bool_bool = 13; + map map_string_string = 14; + map map_int32_bytes = 15; + map map_int32_enum = 16; + map map_int32_foreign_message = 17; } message TestMapSubmessage { @@ -61,21 +84,21 @@ enum MapEnum { } message TestArenaMap { - map map_int32_int32 = 1; - map map_int64_int64 = 2; - map map_uint32_uint32 = 3; - map map_uint64_uint64 = 4; - map map_sint32_sint32 = 5; - map map_sint64_sint64 = 6; - map map_fixed32_fixed32 = 7; - map map_fixed64_fixed64 = 8; + map map_int32_int32 = 1; + map map_int64_int64 = 2; + map map_uint32_uint32 = 3; + map map_uint64_uint64 = 4; + map map_sint32_sint32 = 5; + map map_sint64_sint64 = 6; + map map_fixed32_fixed32 = 7; + map map_fixed64_fixed64 = 8; map map_sfixed32_sfixed32 = 9; map map_sfixed64_sfixed64 = 10; - map map_int32_float = 11; - map map_int32_double = 12; - map map_bool_bool = 13; - map map_int32_enum = 14; - map map_int32_foreign_message = 15; + map map_int32_float = 11; + map map_int32_double = 12; + map map_bool_bool = 13; + map map_int32_enum = 14; + map map_int32_foreign_message = 15; } // Previously, message containing enum called Type cannot be used as value of diff --git a/csharp/protos/old_extensions1.proto b/csharp/protos/old_extensions1.proto index 2b0b93ae2ae44b1f2be99d0f82c02c5cfbb0c48c..58f6eb580c9a7487e3042d252f85ba84a1990f2f 100644 --- a/csharp/protos/old_extensions1.proto +++ b/csharp/protos/old_extensions1.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -20,9 +43,10 @@ syntax = "proto3"; // Import the proto file containing the extension. We don't use it, // but the import is what caused the issue. -import "csharp/protos/old_extensions2.proto"; +import "old_extensions2.proto"; option csharp_namespace = "Google.Protobuf.TestProtos.OldGenerator"; // We don't use this message other than to get its descriptor. -message TestMessage {} +message TestMessage { +} diff --git a/csharp/protos/old_extensions2.proto b/csharp/protos/old_extensions2.proto index 5b80b1931d61029faa0cfe42d1154fd7e2328dd4..78f732a8ad43fdfcff51a6d5f7ba8e968549f352 100644 --- a/csharp/protos/old_extensions2.proto +++ b/csharp/protos/old_extensions2.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by diff --git a/csharp/protos/unittest.proto b/csharp/protos/unittest.proto index 5af95f6fbffd5e21e611ceafd86b5b42e1ac8a74..9628b9e0f448445962e99cec44556763ef00f50d 100644 --- a/csharp/protos/unittest.proto +++ b/csharp/protos/unittest.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -17,12 +40,12 @@ syntax = "proto2"; // Some generic_services option(s) added automatically. // See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; // auto-added +option cc_generic_services = true; // auto-added +option java_generic_services = true; // auto-added +option py_generic_services = true; // auto-added option cc_enable_arenas = true; -import "csharp/protos/unittest_import.proto"; +import "unittest_import.proto"; // We don't put this in a package within proto2 because we need to make sure // that the generated code doesn't depend on being in the proto2 namespace. @@ -54,104 +77,101 @@ message TestAllTypes { } // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; optional group OptionalGroup = 16 { optional int32 a = 17; } - optional NestedMessage optional_nested_message = 18; - optional ForeignMessage optional_foreign_message = 19; - optional protobuf_unittest_import_proto2.ImportMessage - optional_import_message = 20; + optional NestedMessage optional_nested_message = 18; + optional ForeignMessage optional_foreign_message = 19; + optional protobuf_unittest_import_proto2.ImportMessage optional_import_message = 20; - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; - optional protobuf_unittest_import_proto2.ImportEnum optional_import_enum = 23; + optional NestedEnum optional_nested_enum = 21; + optional ForeignEnum optional_foreign_enum = 22; + optional protobuf_unittest_import_proto2.ImportEnum optional_import_enum = 23; - optional string optional_string_piece = 24 [ctype = STRING_PIECE]; - optional string optional_cord = 25 [ctype = CORD]; + optional string optional_string_piece = 24 [ctype=STRING_PIECE]; + optional string optional_cord = 25 [ctype=CORD]; // Defined in unittest_import_public.proto optional protobuf_unittest_import_proto2.PublicImportMessage optional_public_import_message = 26; - optional NestedMessage optional_lazy_message = 27 [lazy = true]; + optional NestedMessage optional_lazy_message = 27 [lazy=true]; // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; repeated sfixed32 repeated_sfixed32 = 39; repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; repeated group RepeatedGroup = 46 { optional int32 a = 47; } - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; - repeated protobuf_unittest_import_proto2.ImportMessage - repeated_import_message = 50; + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + repeated protobuf_unittest_import_proto2.ImportMessage repeated_import_message = 50; - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated protobuf_unittest_import_proto2.ImportEnum repeated_import_enum = 53; + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + repeated protobuf_unittest_import_proto2.ImportEnum repeated_import_enum = 53; - repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; - repeated string repeated_cord = 55 [ctype = CORD]; + repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; + repeated string repeated_cord = 55 [ctype=CORD]; - repeated NestedMessage repeated_lazy_message = 57 [lazy = true]; + repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; // Singular with defaults - optional int32 default_int32 = 61 [default = 41]; - optional int64 default_int64 = 62 [default = 42]; - optional uint32 default_uint32 = 63 [default = 43]; - optional uint64 default_uint64 = 64 [default = 44]; - optional sint32 default_sint32 = 65 [default = -45]; - optional sint64 default_sint64 = 66 [default = 46]; - optional fixed32 default_fixed32 = 67 [default = 47]; - optional fixed64 default_fixed64 = 68 [default = 48]; - optional sfixed32 default_sfixed32 = 69 [default = 49]; - optional sfixed64 default_sfixed64 = 70 [default = -50]; - optional float default_float = 71 [default = 51.5]; - optional double default_double = 72 [default = 52e3]; - optional bool default_bool = 73 [default = true]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR]; + optional int32 default_int32 = 61 [default = 41 ]; + optional int64 default_int64 = 62 [default = 42 ]; + optional uint32 default_uint32 = 63 [default = 43 ]; + optional uint64 default_uint64 = 64 [default = 44 ]; + optional sint32 default_sint32 = 65 [default = -45 ]; + optional sint64 default_sint64 = 66 [default = 46 ]; + optional fixed32 default_fixed32 = 67 [default = 47 ]; + optional fixed64 default_fixed64 = 68 [default = 48 ]; + optional sfixed32 default_sfixed32 = 69 [default = 49 ]; + optional sfixed64 default_sfixed64 = 70 [default = -50 ]; + optional float default_float = 71 [default = 51.5 ]; + optional double default_double = 72 [default = 52e3 ]; + optional bool default_bool = 73 [default = true ]; + optional string default_string = 74 [default = "hello"]; + optional bytes default_bytes = 75 [default = "world"]; + + optional NestedEnum default_nested_enum = 81 [default = BAR ]; optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import_proto2.ImportEnum default_import_enum = 83 - [default = IMPORT_BAR]; + optional protobuf_unittest_import_proto2.ImportEnum + default_import_enum = 83 [default = IMPORT_BAR]; - optional string default_string_piece = 84 - [ctype = STRING_PIECE, default = "abc"]; - optional string default_cord = 85 [ctype = CORD, default = "123"]; + optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; + optional string default_cord = 85 [ctype=CORD,default="123"]; // For oneof test oneof oneof_field { @@ -170,9 +190,9 @@ message NestedTestAllTypes { } message TestDeprecatedFields { - optional int32 deprecated_int32 = 1 [deprecated = true]; + optional int32 deprecated_int32 = 1 [deprecated=true]; oneof oneof_fields { - int32 deprecated_int32_in_oneof = 2 [deprecated = true]; + int32 deprecated_int32_in_oneof = 2 [deprecated=true]; } } @@ -204,21 +224,21 @@ message TestAllExtensions { extend TestAllExtensions { // Singular - optional int32 optional_int32_extension = 1; - optional int64 optional_int64_extension = 2; - optional uint32 optional_uint32_extension = 3; - optional uint64 optional_uint64_extension = 4; - optional sint32 optional_sint32_extension = 5; - optional sint64 optional_sint64_extension = 6; - optional fixed32 optional_fixed32_extension = 7; - optional fixed64 optional_fixed64_extension = 8; - optional sfixed32 optional_sfixed32_extension = 9; + optional int32 optional_int32_extension = 1; + optional int64 optional_int64_extension = 2; + optional uint32 optional_uint32_extension = 3; + optional uint64 optional_uint64_extension = 4; + optional sint32 optional_sint32_extension = 5; + optional sint64 optional_sint64_extension = 6; + optional fixed32 optional_fixed32_extension = 7; + optional fixed64 optional_fixed64_extension = 8; + optional sfixed32 optional_sfixed32_extension = 9; optional sfixed64 optional_sfixed64_extension = 10; - optional float optional_float_extension = 11; - optional double optional_double_extension = 12; - optional bool optional_bool_extension = 13; - optional string optional_string_extension = 14; - optional bytes optional_bytes_extension = 15; + optional float optional_float_extension = 11; + optional double optional_double_extension = 12; + optional bool optional_bool_extension = 13; + optional string optional_string_extension = 14; + optional bytes optional_bytes_extension = 15; optional group OptionalGroup_extension = 16 { optional int32 a = 17; @@ -227,38 +247,38 @@ extend TestAllExtensions { optional TestAllTypes.NestedMessage optional_nested_message_extension = 18; optional ForeignMessage optional_foreign_message_extension = 19; optional protobuf_unittest_import_proto2.ImportMessage - optional_import_message_extension = 20; + optional_import_message_extension = 20; optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21; optional ForeignEnum optional_foreign_enum_extension = 22; optional protobuf_unittest_import_proto2.ImportEnum - optional_import_enum_extension = 23; + optional_import_enum_extension = 23; - optional string optional_string_piece_extension = 24 [ctype = STRING_PIECE]; - optional string optional_cord_extension = 25; + optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE]; + optional string optional_cord_extension = 25 [ctype=CORD]; optional protobuf_unittest_import_proto2.PublicImportMessage - optional_public_import_message_extension = 26; + optional_public_import_message_extension = 26; - optional TestAllTypes.NestedMessage optional_lazy_message_extension = 27 - [lazy = true]; + optional TestAllTypes.NestedMessage + optional_lazy_message_extension = 27 [lazy=true]; // Repeated - repeated int32 repeated_int32_extension = 31; - repeated int64 repeated_int64_extension = 32; - repeated uint32 repeated_uint32_extension = 33; - repeated uint64 repeated_uint64_extension = 34; - repeated sint32 repeated_sint32_extension = 35; - repeated sint64 repeated_sint64_extension = 36; - repeated fixed32 repeated_fixed32_extension = 37; - repeated fixed64 repeated_fixed64_extension = 38; + repeated int32 repeated_int32_extension = 31; + repeated int64 repeated_int64_extension = 32; + repeated uint32 repeated_uint32_extension = 33; + repeated uint64 repeated_uint64_extension = 34; + repeated sint32 repeated_sint32_extension = 35; + repeated sint64 repeated_sint64_extension = 36; + repeated fixed32 repeated_fixed32_extension = 37; + repeated fixed64 repeated_fixed64_extension = 38; repeated sfixed32 repeated_sfixed32_extension = 39; repeated sfixed64 repeated_sfixed64_extension = 40; - repeated float repeated_float_extension = 41; - repeated double repeated_double_extension = 42; - repeated bool repeated_bool_extension = 43; - repeated string repeated_string_extension = 44; - repeated bytes repeated_bytes_extension = 45; + repeated float repeated_float_extension = 41; + repeated double repeated_double_extension = 42; + repeated bool repeated_bool_extension = 43; + repeated string repeated_string_extension = 44; + repeated bytes repeated_bytes_extension = 45; repeated group RepeatedGroup_extension = 46 { optional int32 a = 47; @@ -267,46 +287,46 @@ extend TestAllExtensions { repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48; repeated ForeignMessage repeated_foreign_message_extension = 49; repeated protobuf_unittest_import_proto2.ImportMessage - repeated_import_message_extension = 50; + repeated_import_message_extension = 50; repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51; repeated ForeignEnum repeated_foreign_enum_extension = 52; repeated protobuf_unittest_import_proto2.ImportEnum - repeated_import_enum_extension = 53; + repeated_import_enum_extension = 53; - repeated string repeated_string_piece_extension = 54 [ctype = STRING_PIECE]; - repeated string repeated_cord_extension = 55; + repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE]; + repeated string repeated_cord_extension = 55 [ctype=CORD]; - repeated TestAllTypes.NestedMessage repeated_lazy_message_extension = 57 - [lazy = true]; + repeated TestAllTypes.NestedMessage + repeated_lazy_message_extension = 57 [lazy=true]; // Singular with defaults - optional int32 default_int32_extension = 61 [default = 41]; - optional int64 default_int64_extension = 62 [default = 42]; - optional uint32 default_uint32_extension = 63 [default = 43]; - optional uint64 default_uint64_extension = 64 [default = 44]; - optional sint32 default_sint32_extension = 65 [default = -45]; - optional sint64 default_sint64_extension = 66 [default = 46]; - optional fixed32 default_fixed32_extension = 67 [default = 47]; - optional fixed64 default_fixed64_extension = 68 [default = 48]; - optional sfixed32 default_sfixed32_extension = 69 [default = 49]; - optional sfixed64 default_sfixed64_extension = 70 [default = -50]; - optional float default_float_extension = 71 [default = 51.5]; - optional double default_double_extension = 72 [default = 52e3]; - optional bool default_bool_extension = 73 [default = true]; - optional string default_string_extension = 74 [default = "hello"]; - optional bytes default_bytes_extension = 75 [default = "world"]; - - optional TestAllTypes.NestedEnum default_nested_enum_extension = 81 - [default = BAR]; - optional ForeignEnum default_foreign_enum_extension = 82 - [default = FOREIGN_BAR]; + optional int32 default_int32_extension = 61 [default = 41 ]; + optional int64 default_int64_extension = 62 [default = 42 ]; + optional uint32 default_uint32_extension = 63 [default = 43 ]; + optional uint64 default_uint64_extension = 64 [default = 44 ]; + optional sint32 default_sint32_extension = 65 [default = -45 ]; + optional sint64 default_sint64_extension = 66 [default = 46 ]; + optional fixed32 default_fixed32_extension = 67 [default = 47 ]; + optional fixed64 default_fixed64_extension = 68 [default = 48 ]; + optional sfixed32 default_sfixed32_extension = 69 [default = 49 ]; + optional sfixed64 default_sfixed64_extension = 70 [default = -50 ]; + optional float default_float_extension = 71 [default = 51.5 ]; + optional double default_double_extension = 72 [default = 52e3 ]; + optional bool default_bool_extension = 73 [default = true ]; + optional string default_string_extension = 74 [default = "hello"]; + optional bytes default_bytes_extension = 75 [default = "world"]; + + optional TestAllTypes.NestedEnum + default_nested_enum_extension = 81 [default = BAR]; + optional ForeignEnum + default_foreign_enum_extension = 82 [default = FOREIGN_BAR]; optional protobuf_unittest_import_proto2.ImportEnum - default_import_enum_extension = 83 [default = IMPORT_BAR]; + default_import_enum_extension = 83 [default = IMPORT_BAR]; - optional string default_string_piece_extension = 84 - [ctype = STRING_PIECE, default = "abc"]; - optional string default_cord_extension = 85 [default = "123"]; + optional string default_string_piece_extension = 84 [ctype=STRING_PIECE, + default="abc"]; + optional string default_cord_extension = 85 [ctype=CORD, default="123"]; // For oneof test optional uint32 oneof_uint32_extension = 111; @@ -330,7 +350,7 @@ message TestNestedExtension { extend TestAllExtensions { // Check for bug where string extensions declared in tested scope did not // compile. - optional string test = 1002 [default = "test"]; + optional string test = 1002 [default="test"]; // Used to test if generated extension name is correct when there are // underscores. optional string nested_string_extension = 1003; @@ -356,17 +376,17 @@ message TestRequired { extend TestAllExtensions { optional TestRequired single = 1000; - repeated TestRequired multi = 1001; + repeated TestRequired multi = 1001; } // Pad the field count to 32 so that we can test that IsInitialized() // properly checks multiple elements of has_bits_. - optional int32 dummy4 = 4; - optional int32 dummy5 = 5; - optional int32 dummy6 = 6; - optional int32 dummy7 = 7; - optional int32 dummy8 = 8; - optional int32 dummy9 = 9; + optional int32 dummy4 = 4; + optional int32 dummy5 = 5; + optional int32 dummy6 = 6; + optional int32 dummy7 = 7; + optional int32 dummy8 = 8; + optional int32 dummy9 = 9; optional int32 dummy10 = 10; optional int32 dummy11 = 11; optional int32 dummy12 = 12; @@ -412,7 +432,8 @@ message TestForeignNested { } // TestEmptyMessage is used to test unknown field support. -message TestEmptyMessage {} +message TestEmptyMessage { +} // Like above, but declare all field numbers as potential extensions. No // actual extensions should ever be defined for this type. @@ -466,25 +487,21 @@ message TestIsInitialized { } // Test that groups have disjoint field numbers from their siblings and -// parents. This is NOT possible in proto1; only google.protobuf. When -// attempting to compile with proto1, this will emit an error; so we only -// include it in protobuf_unittest_proto. -message TestDupFieldNumber { // NO_PROTO1 - optional int32 a = 1; // NO_PROTO1 - optional group Foo = 2 { - optional int32 a = 1; - } // NO_PROTO1 - optional group Bar = 3 { - optional int32 a = 1; - } // NO_PROTO1 -} // NO_PROTO1 +// parents. This is NOT possible in proto1; only google.protobuf. When attempting +// to compile with proto1, this will emit an error; so we only include it +// in protobuf_unittest_proto. +message TestDupFieldNumber { // NO_PROTO1 + optional int32 a = 1; // NO_PROTO1 + optional group Foo = 2 { optional int32 a = 1; } // NO_PROTO1 + optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1 +} // NO_PROTO1 // Additional messages for testing lazy fields. message TestEagerMessage { - optional TestAllTypes sub_message = 1 [lazy = false]; + optional TestAllTypes sub_message = 1 [lazy=false]; } message TestLazyMessage { - optional TestAllTypes sub_message = 1 [lazy = true]; + optional TestAllTypes sub_message = 1 [lazy=true]; } // Needed for a Python test. @@ -496,6 +513,7 @@ message TestNestedMessageHasBits { optional NestedMessage optional_nested_message = 1; } + // Test an enum that has multiple values with the same number. enum TestEnumWithDupValue { option allow_alias = true; @@ -525,17 +543,18 @@ message TestCamelCaseFieldNames { optional string StringField = 2; optional ForeignEnum EnumField = 3; optional ForeignMessage MessageField = 4; - optional string StringPieceField = 5 [ctype = STRING_PIECE]; - optional string CordField = 6 [ctype = CORD]; + optional string StringPieceField = 5 [ctype=STRING_PIECE]; + optional string CordField = 6 [ctype=CORD]; repeated int32 RepeatedPrimitiveField = 7; repeated string RepeatedStringField = 8; repeated ForeignEnum RepeatedEnumField = 9; repeated ForeignMessage RepeatedMessageField = 10; - repeated string RepeatedStringPieceField = 11 [ctype = STRING_PIECE]; - repeated string RepeatedCordField = 12 [ctype = CORD]; + repeated string RepeatedStringPieceField = 11 [ctype=STRING_PIECE]; + repeated string RepeatedCordField = 12 [ctype=CORD]; } + // We list fields out of order, to ensure that we're using field number and not // field index to determine serialization order. message TestFieldOrderings { @@ -552,7 +571,7 @@ message TestFieldOrderings { optional int32 bb = 1; } - optional NestedMessage optional_nested_message = 200; + optional NestedMessage optional_nested_message = 200; } extend TestFieldOrderings { @@ -584,10 +603,10 @@ message TestExtremeDefaultValues { optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"]; optional uint32 large_uint32 = 2 [default = 0xFFFFFFFF]; optional uint64 large_uint64 = 3 [default = 0xFFFFFFFFFFFFFFFF]; - optional int32 small_int32 = 4 [default = -0x7FFFFFFF]; - optional int64 small_int64 = 5 [default = -0x7FFFFFFFFFFFFFFF]; - optional int32 really_small_int32 = 21 [default = -0x80000000]; - optional int64 really_small_int64 = 22 [default = -0x8000000000000000]; + optional int32 small_int32 = 4 [default = -0x7FFFFFFF]; + optional int64 small_int64 = 5 [default = -0x7FFFFFFFFFFFFFFF]; + optional int32 really_small_int32 = 21 [default = -0x80000000]; + optional int64 really_small_int64 = 22 [default = -0x8000000000000000]; // The default value here is UTF-8 for "\u1234". (We could also just type // the UTF-8 text directly into this text file rather than escape it, but @@ -620,12 +639,13 @@ message TestExtremeDefaultValues { optional string cpp_trigraph = 20 [default = "? \? ?? \?? \??? ??/ ?\?-"]; // String defaults containing the character '\000' - optional string string_with_zero = 23 [default = "hel\000lo"]; - optional bytes bytes_with_zero = 24 [default = "wor\000ld"]; - optional string string_piece_with_zero = 25 - [ctype = STRING_PIECE, default = "ab\000c"]; - optional string cord_with_zero = 26 [ctype = CORD, default = "12\0003"]; - optional string replacement_string = 27 [default = "${unknown}"]; + optional string string_with_zero = 23 [default = "hel\000lo"]; + optional bytes bytes_with_zero = 24 [default = "wor\000ld"]; + optional string string_piece_with_zero = 25 [ctype=STRING_PIECE, + default="ab\000c"]; + optional string cord_with_zero = 26 [ctype=CORD, + default="12\0003"]; + optional string replacement_string = 27 [default="${unknown}"]; } message SparseEnumMessage { @@ -697,8 +717,8 @@ message TestOneof2 { oneof foo { int32 foo_int = 1; string foo_string = 2; - string foo_cord = 3 [ctype = CORD]; - string foo_string_piece = 4 [ctype = STRING_PIECE]; + string foo_cord = 3 [ctype=CORD]; + string foo_string_piece = 4 [ctype=STRING_PIECE]; bytes foo_bytes = 5; NestedEnum foo_enum = 6; NestedMessage foo_message = 7; @@ -706,14 +726,14 @@ message TestOneof2 { optional int32 a = 9; optional string b = 10; } - NestedMessage foo_lazy_message = 11 [lazy = true]; + NestedMessage foo_lazy_message = 11 [lazy=true]; } oneof bar { int32 bar_int = 12 [default = 5]; string bar_string = 13 [default = "STRING"]; - string bar_cord = 14 [ctype = CORD, default = "CORD"]; - string bar_string_piece = 15 [ctype = STRING_PIECE, default = "SPIECE"]; + string bar_cord = 14 [ctype=CORD, default = "CORD"]; + string bar_string_piece = 15 [ctype=STRING_PIECE, default = "SPIECE"]; bytes bar_bytes = 16 [default = "BYTES"]; NestedEnum bar_enum = 17 [default = BAR]; } @@ -754,39 +774,39 @@ message TestRequiredMap { // Test messages for packed fields message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnum packed_enum = 103 [packed = true]; } // A message with the same fields as TestPackedTypes, but without packing. Used // to test packed <-> unpacked wire compatibility. message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; + repeated int32 unpacked_int32 = 90 [packed = false]; + repeated int64 unpacked_int64 = 91 [packed = false]; + repeated uint32 unpacked_uint32 = 92 [packed = false]; + repeated uint64 unpacked_uint64 = 93 [packed = false]; + repeated sint32 unpacked_sint32 = 94 [packed = false]; + repeated sint64 unpacked_sint64 = 95 [packed = false]; + repeated fixed32 unpacked_fixed32 = 96 [packed = false]; + repeated fixed64 unpacked_fixed64 = 97 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; + repeated float unpacked_float = 100 [packed = false]; + repeated double unpacked_double = 101 [packed = false]; + repeated bool unpacked_bool = 102 [packed = false]; + repeated ForeignEnum unpacked_enum = 103 [packed = false]; } message TestPackedExtensions { @@ -794,20 +814,20 @@ message TestPackedExtensions { } extend TestPackedExtensions { - repeated int32 packed_int32_extension = 90 [packed = true]; - repeated int64 packed_int64_extension = 91 [packed = true]; - repeated uint32 packed_uint32_extension = 92 [packed = true]; - repeated uint64 packed_uint64_extension = 93 [packed = true]; - repeated sint32 packed_sint32_extension = 94 [packed = true]; - repeated sint64 packed_sint64_extension = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension = 99 [packed = true]; - repeated float packed_float_extension = 100 [packed = true]; - repeated double packed_double_extension = 101 [packed = true]; - repeated bool packed_bool_extension = 102 [packed = true]; - repeated ForeignEnum packed_enum_extension = 103 [packed = true]; + repeated int32 packed_int32_extension = 90 [packed = true]; + repeated int64 packed_int64_extension = 91 [packed = true]; + repeated uint32 packed_uint32_extension = 92 [packed = true]; + repeated uint64 packed_uint64_extension = 93 [packed = true]; + repeated sint32 packed_sint32_extension = 94 [packed = true]; + repeated sint64 packed_sint64_extension = 95 [packed = true]; + repeated fixed32 packed_fixed32_extension = 96 [packed = true]; + repeated fixed64 packed_fixed64_extension = 97 [packed = true]; + repeated sfixed32 packed_sfixed32_extension = 98 [packed = true]; + repeated sfixed64 packed_sfixed64_extension = 99 [packed = true]; + repeated float packed_float_extension = 100 [packed = true]; + repeated double packed_double_extension = 101 [packed = true]; + repeated bool packed_bool_extension = 102 [packed = true]; + repeated ForeignEnum packed_enum_extension = 103 [packed = true]; } message TestUnpackedExtensions { @@ -815,20 +835,20 @@ message TestUnpackedExtensions { } extend TestUnpackedExtensions { - repeated int32 unpacked_int32_extension = 90 [packed = false]; - repeated int64 unpacked_int64_extension = 91 [packed = false]; - repeated uint32 unpacked_uint32_extension = 92 [packed = false]; - repeated uint64 unpacked_uint64_extension = 93 [packed = false]; - repeated sint32 unpacked_sint32_extension = 94 [packed = false]; - repeated sint64 unpacked_sint64_extension = 95 [packed = false]; - repeated fixed32 unpacked_fixed32_extension = 96 [packed = false]; - repeated fixed64 unpacked_fixed64_extension = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32_extension = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64_extension = 99 [packed = false]; - repeated float unpacked_float_extension = 100 [packed = false]; - repeated double unpacked_double_extension = 101 [packed = false]; - repeated bool unpacked_bool_extension = 102 [packed = false]; - repeated ForeignEnum unpacked_enum_extension = 103 [packed = false]; + repeated int32 unpacked_int32_extension = 90 [packed = false]; + repeated int64 unpacked_int64_extension = 91 [packed = false]; + repeated uint32 unpacked_uint32_extension = 92 [packed = false]; + repeated uint64 unpacked_uint64_extension = 93 [packed = false]; + repeated sint32 unpacked_sint32_extension = 94 [packed = false]; + repeated sint64 unpacked_sint64_extension = 95 [packed = false]; + repeated fixed32 unpacked_fixed32_extension = 96 [packed = false]; + repeated fixed64 unpacked_fixed64_extension = 97 [packed = false]; + repeated sfixed32 unpacked_sfixed32_extension = 98 [packed = false]; + repeated sfixed64 unpacked_sfixed64_extension = 99 [packed = false]; + repeated float unpacked_float_extension = 100 [packed = false]; + repeated double unpacked_double_extension = 101 [packed = false]; + repeated bool unpacked_bool_extension = 102 [packed = false]; + repeated ForeignEnum unpacked_enum_extension = 103 [packed = false]; } // Used by ExtensionSetTest/DynamicExtensions. The test actually builds @@ -861,15 +881,15 @@ message TestRepeatedScalarDifferentTagSizes { // in TestAllTypes didn't trigger the check. repeated fixed32 repeated_fixed32 = 12; // Check for a varint type, just for good measure. - repeated int32 repeated_int32 = 13; + repeated int32 repeated_int32 = 13; // These have two-byte tags. repeated fixed64 repeated_fixed64 = 2046; - repeated int64 repeated_int64 = 2047; + repeated int64 repeated_int64 = 2047; // Three byte tags. - repeated float repeated_float = 262142; - repeated uint64 repeated_uint64 = 262143; + repeated float repeated_float = 262142; + repeated uint64 repeated_uint64 = 262143; } // Test that if an optional or required message/group field appears multiple @@ -911,22 +931,24 @@ message TestParsingMerge { message TestCommentInjectionMessage { // */ <- This should not close the generated doc comment - optional string a = 1 [default = "*/ <- Neither should this."]; + optional string a = 1 [default="*/ <- Neither should this."]; } + // Test that RPC services work. -message FooRequest {} +message FooRequest {} message FooResponse {} message FooClientMessage {} -message FooServerMessage {} +message FooServerMessage{} service TestService { rpc Foo(FooRequest) returns (FooResponse); rpc Bar(BarRequest) returns (BarResponse); } -message BarRequest {} + +message BarRequest {} message BarResponse {} message TestJsonName { @@ -962,11 +984,7 @@ message TestHugeFieldNumbers { bytes oneof_bytes = 536870014; } - extensions 536860000 to 536869999 [declaration = { - number: 536860000 - full_name: ".protobuf_unittest_proto2.test_all_types" - type: ".protobuf_unittest_proto2.TestAllTypes" - }]; + extensions 536860000 to 536869999; } extend TestHugeFieldNumbers { @@ -1092,4 +1110,4 @@ enum VeryLargeEnum { ENUM_LABEL_98 = 98; ENUM_LABEL_99 = 99; ENUM_LABEL_100 = 100; -} +}; diff --git a/csharp/protos/unittest_custom_options_proto3.proto b/csharp/protos/unittest_custom_options_proto3.proto index 339e1cf9ef717d922b3986d73b849a68e614329e..0e7c2e276c87e8ba33e79e76c5a8fac2cf0624d8 100644 --- a/csharp/protos/unittest_custom_options_proto3.proto +++ b/csharp/protos/unittest_custom_options_proto3.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: benjy@google.com (Benjy Weinberger) // Based on original Protocol Buffers design by @@ -18,6 +41,7 @@ // proto2 syntax. It's cut down significantly as proto3 only supports // extensions for options. + syntax = "proto3"; // A custom file option (defined below). @@ -74,34 +98,39 @@ extend google.protobuf.MethodOptions { // regular options, to make sure they interact nicely). message TestMessageWithCustomOptions { option message_set_wire_format = false; + option (message_opt1) = -56; - string field1 = 1 [ctype = CORD, (field_opt1) = 8765432109]; + string field1 = 1 [ctype=CORD, + (field_opt1)=8765432109]; oneof AnOneof { option (oneof_opt1) = -99; - int32 oneof_field = 2; } enum AnEnum { option (enum_opt1) = -789; - ANENUM_UNSPECIFIED = 0; ANENUM_VAL1 = 1; ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; } } + // A test RPC service with custom options at all possible locations (and also // some regular options, to make sure they interact nicely). -message CustomOptionFooRequest {} +message CustomOptionFooRequest { +} -message CustomOptionFooResponse {} +message CustomOptionFooResponse { +} -message CustomOptionFooClientMessage {} +message CustomOptionFooClientMessage { +} -message CustomOptionFooServerMessage {} +message CustomOptionFooServerMessage { +} service TestServiceWithCustomOptions { option (service_opt1) = -9876543210; @@ -111,6 +140,8 @@ service TestServiceWithCustomOptions { } } + + // Options of every possible field type, so we can test them all exhaustively. message DummyMessageContainingEnum { @@ -121,73 +152,74 @@ message DummyMessageContainingEnum { } } -message DummyMessageInvalidAsOptionType {} +message DummyMessageInvalidAsOptionType { +} extend google.protobuf.MessageOptions { - bool bool_opt = 7706090; - int32 int32_opt = 7705709; - int64 int64_opt = 7705542; - uint32 uint32_opt = 7704880; - uint64 uint64_opt = 7702367; - sint32 sint32_opt = 7701568; - sint64 sint64_opt = 7700863; - fixed32 fixed32_opt = 7700307; - fixed64 fixed64_opt = 7700194; - sfixed32 sfixed32_opt = 7698645; - sfixed64 sfixed64_opt = 7685475; - float float_opt = 7675390; - double double_opt = 7673293; - string string_opt = 7673285; - bytes bytes_opt = 7673238; + bool bool_opt = 7706090; + int32 int32_opt = 7705709; + int64 int64_opt = 7705542; + uint32 uint32_opt = 7704880; + uint64 uint64_opt = 7702367; + sint32 sint32_opt = 7701568; + sint64 sint64_opt = 7700863; + fixed32 fixed32_opt = 7700307; + fixed64 fixed64_opt = 7700194; + sfixed32 sfixed32_opt = 7698645; + sfixed64 sfixed64_opt = 7685475; + float float_opt = 7675390; + double double_opt = 7673293; + string string_opt = 7673285; + bytes bytes_opt = 7673238; DummyMessageContainingEnum.TestEnumType enum_opt = 7673233; DummyMessageInvalidAsOptionType message_type_opt = 7665967; } message CustomOptionMinIntegerValues { - option (bool_opt) = false; - option (int32_opt) = -0x80000000; - option (int64_opt) = -0x8000000000000000; - option (uint32_opt) = 0; - option (uint64_opt) = 0; - option (sint32_opt) = -0x80000000; - option (sint64_opt) = -0x8000000000000000; - option (fixed32_opt) = 0; - option (fixed64_opt) = 0; + option (bool_opt) = false; + option (int32_opt) = -0x80000000; + option (int64_opt) = -0x8000000000000000; + option (uint32_opt) = 0; + option (uint64_opt) = 0; + option (sint32_opt) = -0x80000000; + option (sint64_opt) = -0x8000000000000000; + option (fixed32_opt) = 0; + option (fixed64_opt) = 0; option (sfixed32_opt) = -0x80000000; option (sfixed64_opt) = -0x8000000000000000; } message CustomOptionMaxIntegerValues { - option (bool_opt) = true; - option (int32_opt) = 0x7FFFFFFF; - option (int64_opt) = 0x7FFFFFFFFFFFFFFF; - option (uint32_opt) = 0xFFFFFFFF; - option (uint64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sint32_opt) = 0x7FFFFFFF; - option (sint64_opt) = 0x7FFFFFFFFFFFFFFF; - option (fixed32_opt) = 0xFFFFFFFF; - option (fixed64_opt) = 0xFFFFFFFFFFFFFFFF; + option (bool_opt) = true; + option (int32_opt) = 0x7FFFFFFF; + option (int64_opt) = 0x7FFFFFFFFFFFFFFF; + option (uint32_opt) = 0xFFFFFFFF; + option (uint64_opt) = 0xFFFFFFFFFFFFFFFF; + option (sint32_opt) = 0x7FFFFFFF; + option (sint64_opt) = 0x7FFFFFFFFFFFFFFF; + option (fixed32_opt) = 0xFFFFFFFF; + option (fixed64_opt) = 0xFFFFFFFFFFFFFFFF; option (sfixed32_opt) = 0x7FFFFFFF; option (sfixed64_opt) = 0x7FFFFFFFFFFFFFFF; } message CustomOptionOtherValues { - option (int32_opt) = -100; // To test sign-extension. - option (float_opt) = 12.3456789; + option (int32_opt) = -100; // To test sign-extension. + option (float_opt) = 12.3456789; option (double_opt) = 1.234567890123456789; option (string_opt) = "Hello, \"World\""; - option (bytes_opt) = "Hello\0World"; - option (enum_opt) = TEST_OPTION_ENUM_TYPE2; + option (bytes_opt) = "Hello\0World"; + option (enum_opt) = TEST_OPTION_ENUM_TYPE2; } message SettingRealsFromPositiveInts { - option (float_opt) = 12; + option (float_opt) = 12; option (double_opt) = 154; } message SettingRealsFromNegativeInts { - option (float_opt) = -12; - option (double_opt) = -154; + option (float_opt) = -12; + option (double_opt) = -154; } // Options of complex message types, themselves combined and extended in @@ -235,12 +267,8 @@ message VariousComplexOptions { option (complex_opt2).bar.foo = 743; option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971; option (complex_opt2).fred.waldo = 321; - option (complex_opt2).barney = { - waldo: 101 - }; - option (complex_opt2).barney = { - waldo: 212 - }; + option (complex_opt2).barney = { waldo: 101 }; + option (complex_opt2).barney = { waldo: 212 }; option (protobuf_unittest.complex_opt3).qux = 9; } @@ -259,79 +287,50 @@ message Aggregate { // Allow Aggregate to be used as an option at all possible locations // in the .proto grammar. -extend google.protobuf.FileOptions { - Aggregate fileopt = 15478479; -} -extend google.protobuf.MessageOptions { - Aggregate msgopt = 15480088; -} -extend google.protobuf.FieldOptions { - Aggregate fieldopt = 15481374; -} -extend google.protobuf.EnumOptions { - Aggregate enumopt = 15483218; -} -extend google.protobuf.EnumValueOptions { - Aggregate enumvalopt = 15486921; -} -extend google.protobuf.ServiceOptions { - Aggregate serviceopt = 15497145; -} -extend google.protobuf.MethodOptions { - Aggregate methodopt = 15512713; -} +extend google.protobuf.FileOptions { Aggregate fileopt = 15478479; } +extend google.protobuf.MessageOptions { Aggregate msgopt = 15480088; } +extend google.protobuf.FieldOptions { Aggregate fieldopt = 15481374; } +extend google.protobuf.EnumOptions { Aggregate enumopt = 15483218; } +extend google.protobuf.EnumValueOptions { Aggregate enumvalopt = 15486921; } +extend google.protobuf.ServiceOptions { Aggregate serviceopt = 15497145; } +extend google.protobuf.MethodOptions { Aggregate methodopt = 15512713; } // Try using AggregateOption at different points in the proto grammar option (fileopt) = { s: 'FileAnnotation' // Also test the handling of comments - /* of both types */ - i: 100 + /* of both types */ i: 100 sub { s: 'NestedFileAnnotation' } }; message AggregateMessage { - option (msgopt) = { - i: 101 - s: 'MessageAnnotation' - }; - - int32 fieldname = 1 [(fieldopt) = { s: 'FieldAnnotation' }]; + option (msgopt) = { i:101 s:'MessageAnnotation' }; + int32 fieldname = 1 [(fieldopt) = { s:'FieldAnnotation' }]; } service AggregateService { - option (serviceopt) = { - s: 'ServiceAnnotation' - }; - - rpc Method(AggregateMessage) returns (AggregateMessage) { - option (methodopt) = { - s: 'MethodAnnotation' - }; + option (serviceopt) = { s:'ServiceAnnotation' }; + rpc Method (AggregateMessage) returns (AggregateMessage) { + option (methodopt) = { s:'MethodAnnotation' }; } } enum AggregateEnum { - option (enumopt) = { - s: 'EnumAnnotation' - }; - + option (enumopt) = { s:'EnumAnnotation' }; UNSPECIFIED = 0; - VALUE = 1 [(enumvalopt) = { s: 'EnumValueAnnotation' }]; + VALUE = 1 [(enumvalopt) = { s:'EnumValueAnnotation' }]; } // Test custom options for nested type. message NestedOptionType { message NestedMessage { option (message_opt1) = 1001; - int32 nested_field = 1 [(field_opt1) = 1002]; } enum NestedEnum { - option (enum_opt1) = 1003; - UNSPECIFIED = 0; + option (enum_opt1) = 1003; NESTED_ENUM_VALUE = 1 [(enum_value_opt1) = 1004]; } } diff --git a/csharp/protos/unittest_import.proto b/csharp/protos/unittest_import.proto index 5969e228a9f24145c36fcc1d7dc170eacbbf4aa1..a0198c34f11cf85550c83d207eb4b67187ae14d8 100644 --- a/csharp/protos/unittest_import.proto +++ b/csharp/protos/unittest_import.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -21,10 +44,11 @@ package protobuf_unittest_import_proto2; option optimize_for = SPEED; option cc_enable_arenas = true; + option csharp_namespace = "Google.Protobuf.TestProtos.Proto2"; // Test public import -import public "csharp/protos/unittest_import_public.proto"; +import public "unittest_import_public.proto"; message ImportMessage { optional int32 d = 1; @@ -36,6 +60,7 @@ enum ImportEnum { IMPORT_BAZ = 9; } + // To use an enum in a map, it must has the first value as 0. enum ImportEnumForMap { UNKNOWN = 0; diff --git a/csharp/protos/unittest_import_proto3.proto b/csharp/protos/unittest_import_proto3.proto index 013b344e995fa8563235351e8bcbf1db43f5ff3b..2e6668228663b5fb15d3f072af12cfbecb92040e 100644 --- a/csharp/protos/unittest_import_proto3.proto +++ b/csharp/protos/unittest_import_proto3.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -18,7 +41,7 @@ package protobuf_unittest_import; option csharp_namespace = "Google.Protobuf.TestProtos"; // Test public import -import public "csharp/protos/unittest_import_public_proto3.proto"; +import public "unittest_import_public_proto3.proto"; message ImportMessage { int32 d = 1; @@ -30,3 +53,4 @@ enum ImportEnum { IMPORT_BAR = 8; IMPORT_BAZ = 9; } + diff --git a/csharp/protos/unittest_import_public.proto b/csharp/protos/unittest_import_public.proto index 55a73dedf28045a184a1b08d909f06e0002c1987..6ae34efec60a1dec21d9acc78bf434707bc04d13 100644 --- a/csharp/protos/unittest_import_public.proto +++ b/csharp/protos/unittest_import_public.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: liujisi@google.com (Pherl Liu) diff --git a/csharp/protos/unittest_import_public_proto3.proto b/csharp/protos/unittest_import_public_proto3.proto index f7d798dbe542c9319eda70199f8b93a923e5370f..88c20799ae928973cc55515bcf25852af5729f13 100644 --- a/csharp/protos/unittest_import_public_proto3.proto +++ b/csharp/protos/unittest_import_public_proto3.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: liujisi@google.com (Pherl Liu) diff --git a/csharp/protos/unittest_issue6936_a.proto b/csharp/protos/unittest_issue6936_a.proto index 601dbdff65c9a4ff5c27acf731d509267b2ffd1c..097d083a98a73776aae150d95ae3364f1fff3701 100644 --- a/csharp/protos/unittest_issue6936_a.proto +++ b/csharp/protos/unittest_issue6936_a.proto @@ -1,10 +1,3 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - syntax = "proto3"; package unittest_issues; @@ -12,11 +5,11 @@ package unittest_issues; option csharp_namespace = "UnitTest.Issues.TestProtos"; // This file is used as part of a unit test for issue 6936 -// We don't need to use it, we just have to import it in both +// We don't need to use it, we just have to import it in both // "extensions_issue6936_b.proto" and "extensions_issue6936_c.proto" import "google/protobuf/descriptor.proto"; extend google.protobuf.MessageOptions { - string opt = 50000; -} + string opt = 50000; +} \ No newline at end of file diff --git a/csharp/protos/unittest_issue6936_b.proto b/csharp/protos/unittest_issue6936_b.proto index d022664b5c67bfecd02f198f4267688ec68b6f19..8f71683ba675a4a579b7e06ab798ef2d9f03e6e3 100644 --- a/csharp/protos/unittest_issue6936_b.proto +++ b/csharp/protos/unittest_issue6936_b.proto @@ -1,22 +1,14 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - syntax = "proto3"; -package unittest_issues; +import "unittest_issue6936_a.proto"; -import "csharp/protos/unittest_issue6936_a.proto"; +package unittest_issues; option csharp_namespace = "UnitTest.Issues.TestProtos"; // This file is used as part of a unit test for issue 6936 -// We don't need to use it, we just have to import it in -// "unittest_issue6936_c.proto" +// We don't need to use it, we just have to import it in "unittest_issue6936_c.proto" message Foo { - option (opt) = "foo"; -} + option (opt) = "foo"; +} \ No newline at end of file diff --git a/csharp/protos/unittest_issue6936_c.proto b/csharp/protos/unittest_issue6936_c.proto index f391e00323686e6803b08037b8062560e9fa3027..40004ecaaee3ae91b3df95dcd9cb2cadc9737172 100644 --- a/csharp/protos/unittest_issue6936_c.proto +++ b/csharp/protos/unittest_issue6936_c.proto @@ -1,16 +1,9 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - syntax = "proto3"; -package unittest_issues; +import "unittest_issue6936_a.proto"; +import "unittest_issue6936_b.proto"; -import "csharp/protos/unittest_issue6936_a.proto"; -import "csharp/protos/unittest_issue6936_b.proto"; +package unittest_issues; option csharp_namespace = "UnitTest.Issues.TestProtos"; @@ -18,7 +11,6 @@ option csharp_namespace = "UnitTest.Issues.TestProtos"; // We don't need to use it, we just have to load it at runtime message Bar { - option (opt) = "bar"; - - Foo foo = 1; -} + option (opt) = "bar"; + Foo foo = 1; +} \ No newline at end of file diff --git a/csharp/protos/unittest_issues.proto b/csharp/protos/unittest_issues.proto index 883e0c85c303f90ee0c3c5ccda11878a4aef3ae2..388998f0a0ea1863f33cc12179ddb71ed5494b91 100644 --- a/csharp/protos/unittest_issues.proto +++ b/csharp/protos/unittest_issues.proto @@ -1,34 +1,26 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - syntax = "proto3"; // These proto descriptors have at one time been reported as an issue or defect. // They are kept here to replicate the issue, and continue to verify the fix. -// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer -// library types are qualified +// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified +option csharp_namespace = "UnitTest.Issues.TestProtos"; + package unittest_issues; import "google/protobuf/struct.proto"; -option csharp_namespace = "UnitTest.Issues.TestProtos"; - // Issue 307: when generating doubly-nested types, any references // should be of the form A.Types.B.Types.C. message Issue307 { message NestedOnce { - message NestedTwice {} + message NestedTwice { + } } } -// Old issue 13: -// http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 New issue -// 309: https://github.com/protocolbuffers/protobuf/issues/309 +// Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 +// New issue 309: https://github.com/protocolbuffers/protobuf/issues/309 // message A { // optional int32 _A = 1; @@ -38,9 +30,9 @@ message Issue307 { // optional int32 B_ = 1; // } -// message AB { -// optional int32 a_b = 1; -// } +//message AB { +// optional int32 a_b = 1; +//} // Similar issue with numeric names // Java code failed too, so probably best for this to be a restriction. @@ -52,40 +44,37 @@ message Issue307 { // issue 19 - negative enum values enum NegativeEnum { - NEGATIVE_ENUM_ZERO = 0; - FiveBelow = -5; - MinusOne = -1; + NEGATIVE_ENUM_ZERO = 0; + FiveBelow = -5; + MinusOne = -1; } message NegativeEnumMessage { - NegativeEnum value = 1; - repeated NegativeEnum values = 2 [packed = false]; - repeated NegativeEnum packed_values = 3 [packed = true]; + NegativeEnum value = 1; + repeated NegativeEnum values = 2 [packed = false]; + repeated NegativeEnum packed_values = 3 [packed=true]; } // Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21 // Decorate fields with [deprecated=true] as [System.Obsolete] message DeprecatedChild { - option deprecated = true; } enum DeprecatedEnum { - option deprecated = true; - - DEPRECATED_ZERO = 0 [deprecated = true]; - one = 1; + DEPRECATED_ZERO = 0; + one = 1; } message DeprecatedFieldsMessage { - int32 PrimitiveValue = 1 [deprecated = true]; - repeated int32 PrimitiveArray = 2 [deprecated = true]; + int32 PrimitiveValue = 1 [deprecated = true]; + repeated int32 PrimitiveArray = 2 [deprecated = true]; - DeprecatedChild MessageValue = 3 [deprecated = true]; - repeated DeprecatedChild MessageArray = 4 [deprecated = true]; + DeprecatedChild MessageValue = 3 [deprecated = true]; + repeated DeprecatedChild MessageArray = 4 [deprecated = true]; - DeprecatedEnum EnumValue = 5 [deprecated = true]; - repeated DeprecatedEnum EnumArray = 6 [deprecated = true]; + DeprecatedEnum EnumValue = 5 [deprecated = true]; + repeated DeprecatedEnum EnumArray = 6 [deprecated = true]; } // Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 @@ -95,7 +84,8 @@ message ItemField { message ReservedNames { // Force a nested type called Types - message SomeNestedType {} + message SomeNestedType { + } int32 types = 1; int32 descriptor = 2; @@ -126,6 +116,7 @@ message TestJsonFieldOrdering { int32 o2_int32 = 6; string o2_string = 3; } + } message TestJsonName { @@ -165,39 +156,3 @@ message MixedRegularAndOptional { string regular_field = 1; optional string optional_field = 2; } - -message OneofWithNoneField { - oneof test { - string x = 1; - string none = 2; - } -} - -message OneofWithNoneName { - oneof none { - string x = 1; - string y = 2; - } -} - -// Issue 8810 -message DisambiguateCommonMembers { - int32 disambiguate_common_members = 1; - int32 types = 2; - int32 descriptor = 3; - int32 equals = 4; - int32 to_string = 5; - int32 get_hash_code = 6; - int32 write_to = 7; - int32 clone = 8; - int32 calculate_size = 9; - int32 merge_from = 10; - int32 on_construction = 11; - int32 parser = 12; -} - -message Issue11987Message { - int32 a = 1 [json_name = 'b']; - int32 b = 2 [json_name = 'a']; - int32 c = 3 [json_name = 'd']; -} diff --git a/csharp/protos/unittest_proto3.proto b/csharp/protos/unittest_proto3.proto index 5e375c2367fe5825a7b11afc962987db0540f5b4..8c2f2c9e365f66f6f39ee370594eb037577b434c 100644 --- a/csharp/protos/unittest_proto3.proto +++ b/csharp/protos/unittest_proto3.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -19,7 +42,7 @@ option csharp_namespace = "Google.Protobuf.TestProtos"; // of a non-C# option) option java_outer_classname = "UnittestProto"; -import "csharp/protos/unittest_import_proto3.proto"; +import "unittest_import_proto3.proto"; package protobuf_unittest3; @@ -67,33 +90,33 @@ message TestAllTypes { protobuf_unittest_import.ImportEnum single_import_enum = 23; // Defined in unittest_import_public.proto - protobuf_unittest_import.PublicImportMessage single_public_import_message = - 26; + protobuf_unittest_import.PublicImportMessage + single_public_import_message = 26; // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; repeated sfixed32 repeated_sfixed32 = 39; repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; // Defined in unittest_import_public.proto repeated protobuf_unittest_import.PublicImportMessage repeated_public_import_message = 54; @@ -115,7 +138,7 @@ message NestedTestAllTypes { } message TestDeprecatedFields { - int32 deprecated_int32 = 1 [deprecated = true]; + int32 deprecated_int32 = 1 [deprecated=true]; } // Define these after TestAllTypes to make sure the compiler can handle @@ -136,6 +159,7 @@ message TestReservedFields { reserved "bar", "baz"; } + // Test that we can use NestedMessage from outside TestAllTypes. message TestForeignNested { TestAllTypes.NestedMessage foreign_nested = 1; @@ -170,9 +194,8 @@ message TestEnumAllowAlias { // Test an enum that has multiple values with the same number. enum TestEnumWithDupValue { - option allow_alias = true; - TEST_ENUM_WITH_DUP_VALUE_UNSPECIFIED = 0; + option allow_alias = true; FOO1 = 1; BAR1 = 2; @@ -208,6 +231,7 @@ message TestCamelCaseFieldNames { repeated ForeignMessage RepeatedMessageField = 10; } + // We list fields out of order, to ensure that we're using field number and not // field index to determine serialization order. message TestFieldOrderings { @@ -222,7 +246,7 @@ message TestFieldOrderings { int32 bb = 1; } - NestedMessage single_nested_message = 200; + NestedMessage single_nested_message = 200; } message SparseEnumMessage { @@ -279,39 +303,39 @@ message TestOneof { // Test messages for packed fields message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnum packed_enum = 103 [packed = true]; } // A message with the same fields as TestPackedTypes, but without packing. Used // to test packed <-> unpacked wire compatibility. message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; + repeated int32 unpacked_int32 = 90 [packed = false]; + repeated int64 unpacked_int64 = 91 [packed = false]; + repeated uint32 unpacked_uint32 = 92 [packed = false]; + repeated uint64 unpacked_uint64 = 93 [packed = false]; + repeated sint32 unpacked_sint32 = 94 [packed = false]; + repeated sint64 unpacked_sint64 = 95 [packed = false]; + repeated fixed32 unpacked_fixed32 = 96 [packed = false]; + repeated fixed64 unpacked_fixed64 = 97 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; + repeated float unpacked_float = 100 [packed = false]; + repeated double unpacked_double = 101 [packed = false]; + repeated bool unpacked_bool = 102 [packed = false]; + repeated ForeignEnum unpacked_enum = 103 [packed = false]; } message TestRepeatedScalarDifferentTagSizes { @@ -320,15 +344,15 @@ message TestRepeatedScalarDifferentTagSizes { // in TestAllTypes didn't trigger the check. repeated fixed32 repeated_fixed32 = 12; // Check for a varint type, just for good measure. - repeated int32 repeated_int32 = 13; + repeated int32 repeated_int32 = 13; // These have two-byte tags. repeated fixed64 repeated_fixed64 = 2046; - repeated int64 repeated_int64 = 2047; + repeated int64 repeated_int64 = 2047; // Three byte tags. - repeated float repeated_float = 262142; - repeated uint64 repeated_uint64 = 262143; + repeated float repeated_float = 262142; + repeated uint64 repeated_uint64 = 262143; } message TestCommentInjectionMessage { @@ -336,12 +360,13 @@ message TestCommentInjectionMessage { string a = 1; } + // Test that RPC services work. -message FooRequest {} +message FooRequest {} message FooResponse {} message FooClientMessage {} -message FooServerMessage {} +message FooServerMessage{} // This is a test service service TestService { @@ -350,7 +375,8 @@ service TestService { rpc Bar(BarRequest) returns (BarResponse); } -message BarRequest {} + +message BarRequest {} message BarResponse {} message TestEmptyMessage {} @@ -374,7 +400,7 @@ message CommentMessage { } // Leading field comment - string text = 1; // Trailing field comment + string text = 1; // Trailing field comment } // Leading enum comment diff --git a/csharp/protos/unittest_selfreferential_options.proto b/csharp/protos/unittest_selfreferential_options.proto index d0dc95958c00799421e949a65fef2c5267be9084..22f16cfbf5a88cfa8bdc29289524a2f2b4ebd01e 100644 --- a/csharp/protos/unittest_selfreferential_options.proto +++ b/csharp/protos/unittest_selfreferential_options.proto @@ -1,28 +1,52 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; package protobuf_unittest_selfreferential_options; +option csharp_namespace = "UnitTest.Issues.TestProtos.SelfreferentialOptions"; import "google/protobuf/descriptor.proto"; -option csharp_namespace = "UnitTest.Issues.TestProtos.SelfreferentialOptions"; - message FooOptions { // Custom field option used in definition of the extension message. optional int32 int_opt = 1 [(foo_options) = { int_opt: 1 [foo_int_opt]: 2 - [foo_foo_opt]: { int_opt: 3 } + [foo_foo_opt]: { + int_opt: 3 + } }]; // Custom field option used in definition of the custom option's message. - optional int32 foo = 2 [(foo_options) = { foo: 1234 }]; + optional int32 foo = 2 [(foo_options) = {foo: 1234}]; extensions 1000 to max; } @@ -35,6 +59,6 @@ extend google.protobuf.FieldOptions { } extend FooOptions { - optional int32 foo_int_opt = 1000; - optional FooOptions foo_foo_opt = 1001; + optional int32 foo_int_opt = 1000; + optional FooOptions foo_foo_opt = 1001; } diff --git a/csharp/src/AddressBook/AddPerson.cs b/csharp/src/AddressBook/AddPerson.cs index dc8660d15f5081868bc3b12b2f0dd5b0c595434b..62d1788d55a79564124e860f0c5a826ce9430eca 100644 --- a/csharp/src/AddressBook/AddPerson.cs +++ b/csharp/src/AddressBook/AddPerson.cs @@ -1,107 +1,132 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; - -namespace Google.Protobuf.Examples.AddressBook -{ - internal class AddPerson - { - /// - /// Builds a person based on user input - /// - private static Person PromptForAddress(TextReader input, TextWriter output) - { - Person person = new Person(); - - output.Write("Enter person ID: "); - person.Id = int.Parse(input.ReadLine()); - - output.Write("Enter name: "); - person.Name = input.ReadLine(); - - output.Write("Enter email address (blank for none): "); - string email = input.ReadLine(); - if (email.Length > 0) - { - person.Email = email; - } - - while (true) - { - output.Write("Enter a phone number (or leave blank to finish): "); - string number = input.ReadLine(); - if (number.Length == 0) - { - break; - } - - Person.Types.PhoneNumber phoneNumber = new Person.Types.PhoneNumber { Number = number }; - - output.Write("Is this a mobile, home, or work phone? "); - String type = input.ReadLine(); - switch (type) - { - case "mobile": - phoneNumber.Type = Person.Types.PhoneType.Mobile; - break; - case "home": - phoneNumber.Type = Person.Types.PhoneType.Home; - break; - case "work": - phoneNumber.Type = Person.Types.PhoneType.Work; - break; - default: - output.Write("Unknown phone type. Using default."); - break; - } - - person.Phones.Add(phoneNumber); - } - return person; - } - - /// - /// Entry point - loads an existing addressbook or creates a new one, - /// then writes it back to the file. - /// - public static int Main(string[] args) - { - if (args.Length != 1) - { - Console.Error.WriteLine("Usage: AddPerson ADDRESS_BOOK_FILE"); - return -1; - } - - AddressBook addressBook; - - if (File.Exists(args[0])) - { - using Stream file = File.OpenRead(args[0]); - addressBook = AddressBook.Parser.ParseFrom(file); - } - else - { - Console.WriteLine("{0}: File not found. Creating a new file.", args[0]); - addressBook = new AddressBook(); - } - - // Add an address. - addressBook.People.Add(PromptForAddress(Console.In, Console.Out)); - - // Write the new address book back to disk. - using (Stream output = File.OpenWrite(args[0])) - { - addressBook.WriteTo(output); - } - return 0; - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; + +namespace Google.Protobuf.Examples.AddressBook +{ + internal class AddPerson + { + /// + /// Builds a person based on user input + /// + private static Person PromptForAddress(TextReader input, TextWriter output) + { + Person person = new Person(); + + output.Write("Enter person ID: "); + person.Id = int.Parse(input.ReadLine()); + + output.Write("Enter name: "); + person.Name = input.ReadLine(); + + output.Write("Enter email address (blank for none): "); + string email = input.ReadLine(); + if (email.Length > 0) + { + person.Email = email; + } + + while (true) + { + output.Write("Enter a phone number (or leave blank to finish): "); + string number = input.ReadLine(); + if (number.Length == 0) + { + break; + } + + Person.Types.PhoneNumber phoneNumber = new Person.Types.PhoneNumber { Number = number }; + + output.Write("Is this a mobile, home, or work phone? "); + String type = input.ReadLine(); + switch (type) + { + case "mobile": + phoneNumber.Type = Person.Types.PhoneType.Mobile; + break; + case "home": + phoneNumber.Type = Person.Types.PhoneType.Home; + break; + case "work": + phoneNumber.Type = Person.Types.PhoneType.Work; + break; + default: + output.Write("Unknown phone type. Using default."); + break; + } + + person.Phones.Add(phoneNumber); + } + return person; + } + + /// + /// Entry point - loads an existing addressbook or creates a new one, + /// then writes it back to the file. + /// + public static int Main(string[] args) + { + if (args.Length != 1) + { + Console.Error.WriteLine("Usage: AddPerson ADDRESS_BOOK_FILE"); + return -1; + } + + AddressBook addressBook; + + if (File.Exists(args[0])) + { + using (Stream file = File.OpenRead(args[0])) + { + addressBook = AddressBook.Parser.ParseFrom(file); + } + } + else + { + Console.WriteLine("{0}: File not found. Creating a new file.", args[0]); + addressBook = new AddressBook(); + } + + // Add an address. + addressBook.People.Add(PromptForAddress(Console.In, Console.Out)); + + // Write the new address book back to disk. + using (Stream output = File.OpenWrite(args[0])) + { + addressBook.WriteTo(output); + } + return 0; + } + } } \ No newline at end of file diff --git a/csharp/src/AddressBook/AddressBook.csproj b/csharp/src/AddressBook/AddressBook.csproj index a50fc470338db5aa810178f26d41cb6737a04a48..f3268c0acf3e3b05e377630d6538f834570a2ec6 100644 --- a/csharp/src/AddressBook/AddressBook.csproj +++ b/csharp/src/AddressBook/AddressBook.csproj @@ -1,7 +1,7 @@  - net6.0 + netcoreapp2.1 Exe Google.Protobuf.Examples.AddressBook.Program False diff --git a/csharp/src/AddressBook/Addressbook.pb.cs b/csharp/src/AddressBook/Addressbook.pb.cs deleted file mode 100644 index 744bc62da79880491778c7161f715c81815bb3e9..0000000000000000000000000000000000000000 --- a/csharp/src/AddressBook/Addressbook.pb.cs +++ /dev/null @@ -1,819 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: addressbook.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.Examples.AddressBook { - - /// Holder for reflection information generated from addressbook.proto - public static partial class AddressbookReflection { - - #region Descriptor - /// File descriptor for addressbook.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static AddressbookReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaH2dvb2dsZS9wcm90b2J1", - "Zi90aW1lc3RhbXAucHJvdG8ihwIKBlBlcnNvbhIMCgRuYW1lGAEgASgJEgoK", - "AmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25lcxgEIAMoCzIcLnR1", - "dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchIwCgxsYXN0X3VwZGF0ZWQYBSAB", - "KAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wGkcKC1Bob25lTnVtYmVy", - "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy", - "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N", - "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy", - "EC50dXRvcmlhbC5QZXJzb25ClQEKG2NvbS5leGFtcGxlLnR1dG9yaWFsLnBy", - "b3Rvc0IRQWRkcmVzc0Jvb2tQcm90b3NQAVo6Z2l0aHViLmNvbS9wcm90b2Nv", - "bGJ1ZmZlcnMvcHJvdG9idWYvZXhhbXBsZXMvZ28vdHV0b3JpYWxwYqoCJEdv", - "b2dsZS5Qcm90b2J1Zi5FeGFtcGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person), global::Google.Protobuf.Examples.AddressBook.Person.Parser, new[]{ "Name", "Id", "Email", "Phones", "LastUpdated" }, null, new[]{ typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser, new[]{ "Number", "Type" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.AddressBook.Parser, new[]{ "People" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// [START messages] - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Person : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Person()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Person() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Person(Person other) : this() { - name_ = other.name_; - id_ = other.id_; - email_ = other.email_; - phones_ = other.phones_.Clone(); - lastUpdated_ = other.lastUpdated_ != null ? other.lastUpdated_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Person Clone() { - return new Person(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "id" field. - public const int IdFieldNumber = 2; - private int id_; - /// - /// Unique ID number for this person. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Id { - get { return id_; } - set { - id_ = value; - } - } - - /// Field number for the "email" field. - public const int EmailFieldNumber = 3; - private string email_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Email { - get { return email_; } - set { - email_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "phones" field. - public const int PhonesFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_phones_codec - = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); - private readonly pbc::RepeatedField phones_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Phones { - get { return phones_; } - } - - /// Field number for the "last_updated" field. - public const int LastUpdatedFieldNumber = 5; - private global::Google.Protobuf.WellKnownTypes.Timestamp lastUpdated_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Timestamp LastUpdated { - get { return lastUpdated_; } - set { - lastUpdated_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Person); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Person other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (Id != other.Id) return false; - if (Email != other.Email) return false; - if(!phones_.Equals(other.phones_)) return false; - if (!object.Equals(LastUpdated, other.LastUpdated)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (Id != 0) hash ^= Id.GetHashCode(); - if (Email.Length != 0) hash ^= Email.GetHashCode(); - hash ^= phones_.GetHashCode(); - if (lastUpdated_ != null) hash ^= LastUpdated.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (Id != 0) { - output.WriteRawTag(16); - output.WriteInt32(Id); - } - if (Email.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Email); - } - phones_.WriteTo(output, _repeated_phones_codec); - if (lastUpdated_ != null) { - output.WriteRawTag(42); - output.WriteMessage(LastUpdated); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (Id != 0) { - output.WriteRawTag(16); - output.WriteInt32(Id); - } - if (Email.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Email); - } - phones_.WriteTo(ref output, _repeated_phones_codec); - if (lastUpdated_ != null) { - output.WriteRawTag(42); - output.WriteMessage(LastUpdated); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (Id != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); - } - if (Email.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Email); - } - size += phones_.CalculateSize(_repeated_phones_codec); - if (lastUpdated_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(LastUpdated); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Person other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.Id != 0) { - Id = other.Id; - } - if (other.Email.Length != 0) { - Email = other.Email; - } - phones_.Add(other.phones_); - if (other.lastUpdated_ != null) { - if (lastUpdated_ == null) { - LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - LastUpdated.MergeFrom(other.LastUpdated); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Id = input.ReadInt32(); - break; - } - case 26: { - Email = input.ReadString(); - break; - } - case 34: { - phones_.AddEntriesFrom(input, _repeated_phones_codec); - break; - } - case 42: { - if (lastUpdated_ == null) { - LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(LastUpdated); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Id = input.ReadInt32(); - break; - } - case 26: { - Email = input.ReadString(); - break; - } - case 34: { - phones_.AddEntriesFrom(ref input, _repeated_phones_codec); - break; - } - case 42: { - if (lastUpdated_ == null) { - LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - input.ReadMessage(LastUpdated); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the Person message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum PhoneType { - [pbr::OriginalName("MOBILE")] Mobile = 0, - [pbr::OriginalName("HOME")] Home = 1, - [pbr::OriginalName("WORK")] Work = 2, - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class PhoneNumber : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhoneNumber()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhoneNumber() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhoneNumber(PhoneNumber other) : this() { - number_ = other.number_; - type_ = other.type_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhoneNumber Clone() { - return new PhoneNumber(this); - } - - /// Field number for the "number" field. - public const int NumberFieldNumber = 1; - private string number_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Number { - get { return number_; } - set { - number_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "type" field. - public const int TypeFieldNumber = 2; - private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { - get { return type_; } - set { - type_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as PhoneNumber); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(PhoneNumber other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Number != other.Number) return false; - if (Type != other.Type) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Number.Length != 0) hash ^= Number.GetHashCode(); - if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) hash ^= Type.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Number.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Number); - } - if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { - output.WriteRawTag(16); - output.WriteEnum((int) Type); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Number.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Number); - } - if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { - output.WriteRawTag(16); - output.WriteEnum((int) Type); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Number.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Number); - } - if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(PhoneNumber other) { - if (other == null) { - return; - } - if (other.Number.Length != 0) { - Number = other.Number; - } - if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { - Type = other.Type; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Number = input.ReadString(); - break; - } - case 16: { - Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Number = input.ReadString(); - break; - } - case 16: { - Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - /// - /// Our address book file is just one of these. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class AddressBook : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressBook()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AddressBook() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AddressBook(AddressBook other) : this() { - people_ = other.people_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AddressBook Clone() { - return new AddressBook(this); - } - - /// Field number for the "people" field. - public const int PeopleFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_people_codec - = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); - private readonly pbc::RepeatedField people_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField People { - get { return people_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as AddressBook); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(AddressBook other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!people_.Equals(other.people_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= people_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - people_.WriteTo(output, _repeated_people_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - people_.WriteTo(ref output, _repeated_people_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += people_.CalculateSize(_repeated_people_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(AddressBook other) { - if (other == null) { - return; - } - people_.Add(other.people_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - people_.AddEntriesFrom(input, _repeated_people_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - people_.AddEntriesFrom(ref input, _repeated_people_codec); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/AddressBook/ListPeople.cs b/csharp/src/AddressBook/ListPeople.cs index d7add29875049497a9899d66e718aeb9e8958fb1..3758c1bce5f85290d20a7a391364fb5ad39dcf14 100644 --- a/csharp/src/AddressBook/ListPeople.cs +++ b/csharp/src/AddressBook/ListPeople.cs @@ -1,76 +1,99 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; - -namespace Google.Protobuf.Examples.AddressBook -{ - internal class ListPeople - { - /// - /// Iterates though all people in the AddressBook and prints info about them. - /// - private static void Print(AddressBook addressBook) - { - foreach (Person person in addressBook.People) - { - Console.WriteLine("Person ID: {0}", person.Id); - Console.WriteLine(" Name: {0}", person.Name); - if (person.Email != "") - { - Console.WriteLine(" E-mail address: {0}", person.Email); - } - - foreach (Person.Types.PhoneNumber phoneNumber in person.Phones) - { - switch (phoneNumber.Type) - { - case Person.Types.PhoneType.Mobile: - Console.Write(" Mobile phone #: "); - break; - case Person.Types.PhoneType.Home: - Console.Write(" Home phone #: "); - break; - case Person.Types.PhoneType.Work: - Console.Write(" Work phone #: "); - break; - } - Console.WriteLine(phoneNumber.Number); - } - } - } - - /// - /// Entry point - loads the addressbook and then displays it. - /// - public static int Main(string[] args) - { - if (args.Length != 1) - { - Console.Error.WriteLine("Usage: ListPeople ADDRESS_BOOK_FILE"); - return 1; - } - - if (!File.Exists(args[0])) - { - Console.WriteLine("{0} doesn't exist. Add a person to create the file first.", args[0]); - return 0; - } - - // Read the existing address book. - using (Stream stream = File.OpenRead(args[0])) - { - AddressBook addressBook = AddressBook.Parser.ParseFrom(stream); - Print(addressBook); - } - return 0; - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; + +namespace Google.Protobuf.Examples.AddressBook +{ + internal class ListPeople + { + /// + /// Iterates though all people in the AddressBook and prints info about them. + /// + private static void Print(AddressBook addressBook) + { + foreach (Person person in addressBook.People) + { + Console.WriteLine("Person ID: {0}", person.Id); + Console.WriteLine(" Name: {0}", person.Name); + if (person.Email != "") + { + Console.WriteLine(" E-mail address: {0}", person.Email); + } + + foreach (Person.Types.PhoneNumber phoneNumber in person.Phones) + { + switch (phoneNumber.Type) + { + case Person.Types.PhoneType.Mobile: + Console.Write(" Mobile phone #: "); + break; + case Person.Types.PhoneType.Home: + Console.Write(" Home phone #: "); + break; + case Person.Types.PhoneType.Work: + Console.Write(" Work phone #: "); + break; + } + Console.WriteLine(phoneNumber.Number); + } + } + } + + /// + /// Entry point - loads the addressbook and then displays it. + /// + public static int Main(string[] args) + { + if (args.Length != 1) + { + Console.Error.WriteLine("Usage: ListPeople ADDRESS_BOOK_FILE"); + return 1; + } + + if (!File.Exists(args[0])) + { + Console.WriteLine("{0} doesn't exist. Add a person to create the file first.", args[0]); + return 0; + } + + // Read the existing address book. + using (Stream stream = File.OpenRead(args[0])) + { + AddressBook addressBook = AddressBook.Parser.ParseFrom(stream); + Print(addressBook); + } + return 0; + } + } } \ No newline at end of file diff --git a/csharp/src/AddressBook/Program.cs b/csharp/src/AddressBook/Program.cs index 328ffac6dd91fcf72ac76855774778e88e2a0555..de4867a0ce21738c427ae9f0161e4fc406a80057 100644 --- a/csharp/src/AddressBook/Program.cs +++ b/csharp/src/AddressBook/Program.cs @@ -1,72 +1,95 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; - -namespace Google.Protobuf.Examples.AddressBook -{ - /// - /// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour - /// to individual actions. Each action has its own Main method, so that it can be used as an - /// individual complete program. - /// - internal class Program - { - private static int Main(string[] args) - { - if (args.Length > 1) - { - Console.Error.WriteLine("Usage: AddressBook [file]"); - Console.Error.WriteLine("If the filename isn't specified, \"addressbook.data\" is used instead."); - return 1; - } - string addressBookFile = args.Length > 0 ? args[0] : "addressbook.data"; - - bool stopping = false; - while (!stopping) - { - Console.WriteLine("Options:"); - Console.WriteLine(" L: List contents"); - Console.WriteLine(" A: Add new person"); - Console.WriteLine(" Q: Quit"); - Console.Write("Action? "); - Console.Out.Flush(); - char choice = Console.ReadKey().KeyChar; - Console.WriteLine(); - try - { - switch (choice) - { - case 'A': - case 'a': - AddPerson.Main(new string[] {addressBookFile}); - break; - case 'L': - case 'l': - ListPeople.Main(new string[] {addressBookFile}); - break; - case 'Q': - case 'q': - stopping = true; - break; - default: - Console.WriteLine("Unknown option: {0}", choice); - break; - } - } - catch (Exception e) - { - Console.WriteLine("Exception executing action: {0}", e); - } - Console.WriteLine(); - } - return 0; - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; + +namespace Google.Protobuf.Examples.AddressBook +{ + /// + /// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour + /// to individual actions. Each action has its own Main method, so that it can be used as an + /// individual complete program. + /// + internal class Program + { + private static int Main(string[] args) + { + if (args.Length > 1) + { + Console.Error.WriteLine("Usage: AddressBook [file]"); + Console.Error.WriteLine("If the filename isn't specified, \"addressbook.data\" is used instead."); + return 1; + } + string addressBookFile = args.Length > 0 ? args[0] : "addressbook.data"; + + bool stopping = false; + while (!stopping) + { + Console.WriteLine("Options:"); + Console.WriteLine(" L: List contents"); + Console.WriteLine(" A: Add new person"); + Console.WriteLine(" Q: Quit"); + Console.Write("Action? "); + Console.Out.Flush(); + char choice = Console.ReadKey().KeyChar; + Console.WriteLine(); + try + { + switch (choice) + { + case 'A': + case 'a': + AddPerson.Main(new string[] {addressBookFile}); + break; + case 'L': + case 'l': + ListPeople.Main(new string[] {addressBookFile}); + break; + case 'Q': + case 'q': + stopping = true; + break; + default: + Console.WriteLine("Unknown option: {0}", choice); + break; + } + } + catch (Exception e) + { + Console.WriteLine("Exception executing action: {0}", e); + } + Console.WriteLine(); + } + return 0; + } + } } \ No newline at end of file diff --git a/csharp/src/AddressBook/SampleUsage.cs b/csharp/src/AddressBook/SampleUsage.cs index 02e24569137d9e7a3b6526538b25b7647fe85be1..941d865aa48b27f89446696ec5f72f4dcea86193 100644 --- a/csharp/src/AddressBook/SampleUsage.cs +++ b/csharp/src/AddressBook/SampleUsage.cs @@ -1,50 +1,73 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; - -namespace Google.Protobuf.Examples.AddressBook -{ - internal class SampleUsage - { - private static void Main() - { - byte[] bytes; - // Create a new person - Person person = new Person - { - Id = 1, - Name = "Foo", - Email = "foo@bar", - Phones = { new Person.Types.PhoneNumber { Number = "555-1212" } } - }; - using (MemoryStream stream = new MemoryStream()) - { - // Save the person to a stream - person.WriteTo(stream); - bytes = stream.ToArray(); - } - Person copy = Person.Parser.ParseFrom(bytes); - - AddressBook book = new AddressBook - { - People = { copy } - }; - bytes = book.ToByteArray(); - // And read the address book back again - AddressBook restored = AddressBook.Parser.ParseFrom(bytes); - // The message performs a deep-comparison on equality: - if (restored.People.Count != 1 || !person.Equals(restored.People[0])) - { - throw new Exception("There is a bad person in here!"); - } - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; + +namespace Google.Protobuf.Examples.AddressBook +{ + internal class SampleUsage + { + private static void Main() + { + byte[] bytes; + // Create a new person + Person person = new Person + { + Id = 1, + Name = "Foo", + Email = "foo@bar", + Phones = { new Person.Types.PhoneNumber { Number = "555-1212" } } + }; + using (MemoryStream stream = new MemoryStream()) + { + // Save the person to a stream + person.WriteTo(stream); + bytes = stream.ToArray(); + } + Person copy = Person.Parser.ParseFrom(bytes); + + AddressBook book = new AddressBook + { + People = { copy } + }; + bytes = book.ToByteArray(); + // And read the address book back again + AddressBook restored = AddressBook.Parser.ParseFrom(bytes); + // The message performs a deep-comparison on equality: + if (restored.People.Count != 1 || !person.Equals(restored.People[0])) + { + throw new Exception("There is a bad person in here!"); + } + } + } } \ No newline at end of file diff --git a/csharp/src/Directory.Build.props b/csharp/src/Directory.Build.props deleted file mode 100644 index dd6946202faa3ca70bc8d23cc46cbb781efd871f..0000000000000000000000000000000000000000 --- a/csharp/src/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - 10.0 - - - diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/RopeByteStringTest.java b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs similarity index 40% rename from java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/RopeByteStringTest.java rename to csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs index 19098de660a27276d70858aec758221df3d867bc..c0754190b6c9bd5a17a4e9e89c80e8ee16531cb3 100644 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/RopeByteStringTest.java +++ b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs @@ -1,6 +1,7 @@ +#region Copyright notice and license // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -27,58 +28,62 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion -package com.google.protobuf.test; -import com.google.protobuf.*; +using Benchmarks; +using Google.Protobuf.Reflection; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; -import java.io.UnsupportedEncodingException; -import java.util.Arrays; -import java.util.Iterator; +namespace Google.Protobuf.Benchmarks +{ + /// + /// The configuration for a single serialization test, loaded from a dataset. + /// + public class BenchmarkDatasetConfig + { + private static readonly Dictionary parsersByMessageName = + typeof(GoogleMessageBenchmark).Assembly.GetTypes() + .Where(t => typeof(IMessage).IsAssignableFrom(t)) + .ToDictionary( + t => ((MessageDescriptor) t.GetProperty("Descriptor", BindingFlags.Static | BindingFlags.Public).GetValue(null)).FullName, + t => ((MessageParser) t.GetProperty("Parser", BindingFlags.Static | BindingFlags.Public).GetValue(null))); -/** - * This class tests {@link RopeByteString} by inheriting the tests from - * {@link LiteralByteStringTest}. Only a couple of methods are overridden. - * - *

A full test of the result of {@link RopeByteString#substring(int, int)} is found in the - * separate class {@link RopeByteStringSubstringTest}. - * - * @author carlanton@google.com (Carl Haverl) - */ -public class RopeByteStringTest extends LiteralByteStringTest { + public MessageParser Parser { get; } + public List Payloads { get; } + public string Name { get; } - @Override - protected void setUp() throws Exception { - classUnderTest = "RopeByteString"; - referenceBytes = ByteStringTest.getTestBytes(22341, 22337766L); - Iterator iter = ByteStringTest.makeConcretePieces(referenceBytes).iterator(); - stringUnderTest = iter.next(); - while (iter.hasNext()) { - stringUnderTest = stringUnderTest.concat(iter.next()); - } - expectedHashCode = -1214197238; - } + public BenchmarkDatasetConfig(string resource, string shortName = null) + { + var data = LoadData(resource); + var dataset = BenchmarkDataset.Parser.ParseFrom(data); - public void testBalance() { - int numberOfPieces = 10000; - int pieceSize = 64; - byte[] testBytes = ByteStringTest.getTestBytes(numberOfPieces * pieceSize, 113377L); + if (!parsersByMessageName.TryGetValue(dataset.MessageName, out var parser)) + { + throw new ArgumentException($"No parser for message {dataset.MessageName} in this assembly"); + } + Parser = parser; + Payloads = new List(dataset.Payload.Select(p => p.ToByteArray())); + Name = shortName ?? dataset.Name; + } - // Build up a big ByteString from smaller pieces to force a rebalance - ByteString concatenated = ByteString.EMPTY; - for (int i = 0; i < numberOfPieces; ++i) { - concatenated = concatenated.concat(ByteString.copyFrom(testBytes, i * pieceSize, pieceSize)); - } + private static byte[] LoadData(string resource) + { + using (var stream = typeof(GoogleMessageBenchmark).Assembly.GetManifestResourceStream($"Google.Protobuf.Benchmarks.{resource}")) + { + if (stream == null) + { + throw new ArgumentException($"Unable to load embedded resource {resource}"); + } + var copy = new MemoryStream(); + stream.CopyTo(copy); + return copy.ToArray(); + } + } - assertEquals(classUnderTest + " from string must have the expected type", - classUnderTest, getActualClassName(concatenated)); - assertTrue(classUnderTest + " underlying bytes must match after balancing", - Arrays.equals(testBytes, concatenated.toByteArray())); - ByteString testString = ByteString.copyFrom(testBytes); - assertTrue(classUnderTest + " balanced string must equal flat string", - concatenated.equals(testString)); - assertTrue(classUnderTest + " flat string must equal balanced string", - testString.equals(concatenated)); - assertEquals(classUnderTest + " balanced string must have same hash code as flat string", - testString.hashCode(), concatenated.hashCode()); - } + public override string ToString() => Name; + } } diff --git a/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs new file mode 100644 index 0000000000000000000000000000000000000000..027da02a10b5cddd6eae2b66f00d9521bf17ae29 --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs @@ -0,0 +1,2539 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: datasets/google_message1/proto3/benchmark_message1_proto3.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Benchmarks.Proto3 { + + ///

Holder for reflection information generated from datasets/google_message1/proto3/benchmark_message1_proto3.proto + public static partial class BenchmarkMessage1Proto3Reflection { + + #region Descriptor + /// File descriptor for datasets/google_message1/proto3/benchmark_message1_proto3.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static BenchmarkMessage1Proto3Reflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cj9kYXRhc2V0cy9nb29nbGVfbWVzc2FnZTEvcHJvdG8zL2JlbmNobWFya19t", + "ZXNzYWdlMV9wcm90bzMucHJvdG8SEWJlbmNobWFya3MucHJvdG8zIoMGCg5H", + "b29nbGVNZXNzYWdlMRIOCgZmaWVsZDEYASABKAkSDgoGZmllbGQ5GAkgASgJ", + "Eg8KB2ZpZWxkMTgYEiABKAkSDwoHZmllbGQ4MBhQIAEoCBIPCgdmaWVsZDgx", + "GFEgASgIEg4KBmZpZWxkMhgCIAEoBRIOCgZmaWVsZDMYAyABKAUSEQoIZmll", + "bGQyODAYmAIgASgFEg4KBmZpZWxkNhgGIAEoBRIPCgdmaWVsZDIyGBYgASgD", + "Eg4KBmZpZWxkNBgEIAEoCRIOCgZmaWVsZDUYBSADKAYSDwoHZmllbGQ1ORg7", + "IAEoCBIOCgZmaWVsZDcYByABKAkSDwoHZmllbGQxNhgQIAEoBRIRCghmaWVs", + "ZDEzMBiCASABKAUSDwoHZmllbGQxMhgMIAEoCBIPCgdmaWVsZDE3GBEgASgI", + "Eg8KB2ZpZWxkMTMYDSABKAgSDwoHZmllbGQxNBgOIAEoCBIQCghmaWVsZDEw", + "NBhoIAEoBRIQCghmaWVsZDEwMBhkIAEoBRIQCghmaWVsZDEwMRhlIAEoBRIQ", + "CghmaWVsZDEwMhhmIAEoCRIQCghmaWVsZDEwMxhnIAEoCRIPCgdmaWVsZDI5", + "GB0gASgFEg8KB2ZpZWxkMzAYHiABKAgSDwoHZmllbGQ2MBg8IAEoBRIRCghm", + "aWVsZDI3MRiPAiABKAUSEQoIZmllbGQyNzIYkAIgASgFEhEKCGZpZWxkMTUw", + "GJYBIAEoBRIPCgdmaWVsZDIzGBcgASgFEg8KB2ZpZWxkMjQYGCABKAgSDwoH", + "ZmllbGQyNRgZIAEoBRI8CgdmaWVsZDE1GA8gASgLMisuYmVuY2htYXJrcy5w", + "cm90bzMuR29vZ2xlTWVzc2FnZTFTdWJNZXNzYWdlEg8KB2ZpZWxkNzgYTiAB", + "KAgSDwoHZmllbGQ2NxhDIAEoBRIPCgdmaWVsZDY4GEQgASgFEhEKCGZpZWxk", + "MTI4GIABIAEoBRIRCghmaWVsZDEyORiBASABKAkSEQoIZmllbGQxMzEYgwEg", + "ASgFIvcCChhHb29nbGVNZXNzYWdlMVN1Yk1lc3NhZ2USDgoGZmllbGQxGAEg", + "ASgFEg4KBmZpZWxkMhgCIAEoBRIOCgZmaWVsZDMYAyABKAUSDwoHZmllbGQx", + "NRgPIAEoCRIPCgdmaWVsZDEyGAwgASgIEg8KB2ZpZWxkMTMYDSABKAMSDwoH", + "ZmllbGQxNBgOIAEoAxIPCgdmaWVsZDE2GBAgASgFEg8KB2ZpZWxkMTkYEyAB", + "KAUSDwoHZmllbGQyMBgUIAEoCBIPCgdmaWVsZDI4GBwgASgIEg8KB2ZpZWxk", + "MjEYFSABKAYSDwoHZmllbGQyMhgWIAEoBRIPCgdmaWVsZDIzGBcgASgIEhEK", + "CGZpZWxkMjA2GM4BIAEoCBIRCghmaWVsZDIwMxjLASABKAcSEQoIZmllbGQy", + "MDQYzAEgASgFEhEKCGZpZWxkMjA1GM0BIAEoCRIRCghmaWVsZDIwNxjPASAB", + "KAQSEQoIZmllbGQzMDAYrAIgASgEQiUKHmNvbS5nb29nbGUucHJvdG9idWYu", + "YmVuY2htYXJrc0gB+AEBYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Benchmarks.Proto3.GoogleMessage1), global::Benchmarks.Proto3.GoogleMessage1.Parser, new[]{ "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Benchmarks.Proto3.GoogleMessage1SubMessage), global::Benchmarks.Proto3.GoogleMessage1SubMessage.Parser, new[]{ "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class GoogleMessage1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Benchmarks.Proto3.BenchmarkMessage1Proto3Reflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GoogleMessage1() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GoogleMessage1(GoogleMessage1 other) : this() { + field1_ = other.field1_; + field9_ = other.field9_; + field18_ = other.field18_; + field80_ = other.field80_; + field81_ = other.field81_; + field2_ = other.field2_; + field3_ = other.field3_; + field280_ = other.field280_; + field6_ = other.field6_; + field22_ = other.field22_; + field4_ = other.field4_; + field5_ = other.field5_.Clone(); + field59_ = other.field59_; + field7_ = other.field7_; + field16_ = other.field16_; + field130_ = other.field130_; + field12_ = other.field12_; + field17_ = other.field17_; + field13_ = other.field13_; + field14_ = other.field14_; + field104_ = other.field104_; + field100_ = other.field100_; + field101_ = other.field101_; + field102_ = other.field102_; + field103_ = other.field103_; + field29_ = other.field29_; + field30_ = other.field30_; + field60_ = other.field60_; + field271_ = other.field271_; + field272_ = other.field272_; + field150_ = other.field150_; + field23_ = other.field23_; + field24_ = other.field24_; + field25_ = other.field25_; + field15_ = other.field15_ != null ? other.field15_.Clone() : null; + field78_ = other.field78_; + field67_ = other.field67_; + field68_ = other.field68_; + field128_ = other.field128_; + field129_ = other.field129_; + field131_ = other.field131_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GoogleMessage1 Clone() { + return new GoogleMessage1(this); + } + + /// Field number for the "field1" field. + public const int Field1FieldNumber = 1; + private string field1_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field1 { + get { return field1_; } + set { + field1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field9" field. + public const int Field9FieldNumber = 9; + private string field9_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field9 { + get { return field9_; } + set { + field9_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field18" field. + public const int Field18FieldNumber = 18; + private string field18_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field18 { + get { return field18_; } + set { + field18_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field80" field. + public const int Field80FieldNumber = 80; + private bool field80_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field80 { + get { return field80_; } + set { + field80_ = value; + } + } + + /// Field number for the "field81" field. + public const int Field81FieldNumber = 81; + private bool field81_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field81 { + get { return field81_; } + set { + field81_ = value; + } + } + + /// Field number for the "field2" field. + public const int Field2FieldNumber = 2; + private int field2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field2 { + get { return field2_; } + set { + field2_ = value; + } + } + + /// Field number for the "field3" field. + public const int Field3FieldNumber = 3; + private int field3_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field3 { + get { return field3_; } + set { + field3_ = value; + } + } + + /// Field number for the "field280" field. + public const int Field280FieldNumber = 280; + private int field280_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field280 { + get { return field280_; } + set { + field280_ = value; + } + } + + /// Field number for the "field6" field. + public const int Field6FieldNumber = 6; + private int field6_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field6 { + get { return field6_; } + set { + field6_ = value; + } + } + + /// Field number for the "field22" field. + public const int Field22FieldNumber = 22; + private long field22_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Field22 { + get { return field22_; } + set { + field22_ = value; + } + } + + /// Field number for the "field4" field. + public const int Field4FieldNumber = 4; + private string field4_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field4 { + get { return field4_; } + set { + field4_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field5" field. + public const int Field5FieldNumber = 5; + private static readonly pb::FieldCodec _repeated_field5_codec + = pb::FieldCodec.ForFixed64(42); + private readonly pbc::RepeatedField field5_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Field5 { + get { return field5_; } + } + + /// Field number for the "field59" field. + public const int Field59FieldNumber = 59; + private bool field59_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field59 { + get { return field59_; } + set { + field59_ = value; + } + } + + /// Field number for the "field7" field. + public const int Field7FieldNumber = 7; + private string field7_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field7 { + get { return field7_; } + set { + field7_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field16" field. + public const int Field16FieldNumber = 16; + private int field16_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field16 { + get { return field16_; } + set { + field16_ = value; + } + } + + /// Field number for the "field130" field. + public const int Field130FieldNumber = 130; + private int field130_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field130 { + get { return field130_; } + set { + field130_ = value; + } + } + + /// Field number for the "field12" field. + public const int Field12FieldNumber = 12; + private bool field12_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field12 { + get { return field12_; } + set { + field12_ = value; + } + } + + /// Field number for the "field17" field. + public const int Field17FieldNumber = 17; + private bool field17_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field17 { + get { return field17_; } + set { + field17_ = value; + } + } + + /// Field number for the "field13" field. + public const int Field13FieldNumber = 13; + private bool field13_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field13 { + get { return field13_; } + set { + field13_ = value; + } + } + + /// Field number for the "field14" field. + public const int Field14FieldNumber = 14; + private bool field14_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field14 { + get { return field14_; } + set { + field14_ = value; + } + } + + /// Field number for the "field104" field. + public const int Field104FieldNumber = 104; + private int field104_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field104 { + get { return field104_; } + set { + field104_ = value; + } + } + + /// Field number for the "field100" field. + public const int Field100FieldNumber = 100; + private int field100_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field100 { + get { return field100_; } + set { + field100_ = value; + } + } + + /// Field number for the "field101" field. + public const int Field101FieldNumber = 101; + private int field101_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field101 { + get { return field101_; } + set { + field101_ = value; + } + } + + /// Field number for the "field102" field. + public const int Field102FieldNumber = 102; + private string field102_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field102 { + get { return field102_; } + set { + field102_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field103" field. + public const int Field103FieldNumber = 103; + private string field103_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field103 { + get { return field103_; } + set { + field103_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field29" field. + public const int Field29FieldNumber = 29; + private int field29_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field29 { + get { return field29_; } + set { + field29_ = value; + } + } + + /// Field number for the "field30" field. + public const int Field30FieldNumber = 30; + private bool field30_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field30 { + get { return field30_; } + set { + field30_ = value; + } + } + + /// Field number for the "field60" field. + public const int Field60FieldNumber = 60; + private int field60_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field60 { + get { return field60_; } + set { + field60_ = value; + } + } + + /// Field number for the "field271" field. + public const int Field271FieldNumber = 271; + private int field271_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field271 { + get { return field271_; } + set { + field271_ = value; + } + } + + /// Field number for the "field272" field. + public const int Field272FieldNumber = 272; + private int field272_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field272 { + get { return field272_; } + set { + field272_ = value; + } + } + + /// Field number for the "field150" field. + public const int Field150FieldNumber = 150; + private int field150_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field150 { + get { return field150_; } + set { + field150_ = value; + } + } + + /// Field number for the "field23" field. + public const int Field23FieldNumber = 23; + private int field23_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field23 { + get { return field23_; } + set { + field23_ = value; + } + } + + /// Field number for the "field24" field. + public const int Field24FieldNumber = 24; + private bool field24_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field24 { + get { return field24_; } + set { + field24_ = value; + } + } + + /// Field number for the "field25" field. + public const int Field25FieldNumber = 25; + private int field25_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field25 { + get { return field25_; } + set { + field25_ = value; + } + } + + /// Field number for the "field15" field. + public const int Field15FieldNumber = 15; + private global::Benchmarks.Proto3.GoogleMessage1SubMessage field15_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Benchmarks.Proto3.GoogleMessage1SubMessage Field15 { + get { return field15_; } + set { + field15_ = value; + } + } + + /// Field number for the "field78" field. + public const int Field78FieldNumber = 78; + private bool field78_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field78 { + get { return field78_; } + set { + field78_ = value; + } + } + + /// Field number for the "field67" field. + public const int Field67FieldNumber = 67; + private int field67_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field67 { + get { return field67_; } + set { + field67_ = value; + } + } + + /// Field number for the "field68" field. + public const int Field68FieldNumber = 68; + private int field68_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field68 { + get { return field68_; } + set { + field68_ = value; + } + } + + /// Field number for the "field128" field. + public const int Field128FieldNumber = 128; + private int field128_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field128 { + get { return field128_; } + set { + field128_ = value; + } + } + + /// Field number for the "field129" field. + public const int Field129FieldNumber = 129; + private string field129_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field129 { + get { return field129_; } + set { + field129_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field131" field. + public const int Field131FieldNumber = 131; + private int field131_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field131 { + get { return field131_; } + set { + field131_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GoogleMessage1); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GoogleMessage1 other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Field1 != other.Field1) return false; + if (Field9 != other.Field9) return false; + if (Field18 != other.Field18) return false; + if (Field80 != other.Field80) return false; + if (Field81 != other.Field81) return false; + if (Field2 != other.Field2) return false; + if (Field3 != other.Field3) return false; + if (Field280 != other.Field280) return false; + if (Field6 != other.Field6) return false; + if (Field22 != other.Field22) return false; + if (Field4 != other.Field4) return false; + if(!field5_.Equals(other.field5_)) return false; + if (Field59 != other.Field59) return false; + if (Field7 != other.Field7) return false; + if (Field16 != other.Field16) return false; + if (Field130 != other.Field130) return false; + if (Field12 != other.Field12) return false; + if (Field17 != other.Field17) return false; + if (Field13 != other.Field13) return false; + if (Field14 != other.Field14) return false; + if (Field104 != other.Field104) return false; + if (Field100 != other.Field100) return false; + if (Field101 != other.Field101) return false; + if (Field102 != other.Field102) return false; + if (Field103 != other.Field103) return false; + if (Field29 != other.Field29) return false; + if (Field30 != other.Field30) return false; + if (Field60 != other.Field60) return false; + if (Field271 != other.Field271) return false; + if (Field272 != other.Field272) return false; + if (Field150 != other.Field150) return false; + if (Field23 != other.Field23) return false; + if (Field24 != other.Field24) return false; + if (Field25 != other.Field25) return false; + if (!object.Equals(Field15, other.Field15)) return false; + if (Field78 != other.Field78) return false; + if (Field67 != other.Field67) return false; + if (Field68 != other.Field68) return false; + if (Field128 != other.Field128) return false; + if (Field129 != other.Field129) return false; + if (Field131 != other.Field131) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Field1.Length != 0) hash ^= Field1.GetHashCode(); + if (Field9.Length != 0) hash ^= Field9.GetHashCode(); + if (Field18.Length != 0) hash ^= Field18.GetHashCode(); + if (Field80 != false) hash ^= Field80.GetHashCode(); + if (Field81 != false) hash ^= Field81.GetHashCode(); + if (Field2 != 0) hash ^= Field2.GetHashCode(); + if (Field3 != 0) hash ^= Field3.GetHashCode(); + if (Field280 != 0) hash ^= Field280.GetHashCode(); + if (Field6 != 0) hash ^= Field6.GetHashCode(); + if (Field22 != 0L) hash ^= Field22.GetHashCode(); + if (Field4.Length != 0) hash ^= Field4.GetHashCode(); + hash ^= field5_.GetHashCode(); + if (Field59 != false) hash ^= Field59.GetHashCode(); + if (Field7.Length != 0) hash ^= Field7.GetHashCode(); + if (Field16 != 0) hash ^= Field16.GetHashCode(); + if (Field130 != 0) hash ^= Field130.GetHashCode(); + if (Field12 != false) hash ^= Field12.GetHashCode(); + if (Field17 != false) hash ^= Field17.GetHashCode(); + if (Field13 != false) hash ^= Field13.GetHashCode(); + if (Field14 != false) hash ^= Field14.GetHashCode(); + if (Field104 != 0) hash ^= Field104.GetHashCode(); + if (Field100 != 0) hash ^= Field100.GetHashCode(); + if (Field101 != 0) hash ^= Field101.GetHashCode(); + if (Field102.Length != 0) hash ^= Field102.GetHashCode(); + if (Field103.Length != 0) hash ^= Field103.GetHashCode(); + if (Field29 != 0) hash ^= Field29.GetHashCode(); + if (Field30 != false) hash ^= Field30.GetHashCode(); + if (Field60 != 0) hash ^= Field60.GetHashCode(); + if (Field271 != 0) hash ^= Field271.GetHashCode(); + if (Field272 != 0) hash ^= Field272.GetHashCode(); + if (Field150 != 0) hash ^= Field150.GetHashCode(); + if (Field23 != 0) hash ^= Field23.GetHashCode(); + if (Field24 != false) hash ^= Field24.GetHashCode(); + if (Field25 != 0) hash ^= Field25.GetHashCode(); + if (field15_ != null) hash ^= Field15.GetHashCode(); + if (Field78 != false) hash ^= Field78.GetHashCode(); + if (Field67 != 0) hash ^= Field67.GetHashCode(); + if (Field68 != 0) hash ^= Field68.GetHashCode(); + if (Field128 != 0) hash ^= Field128.GetHashCode(); + if (Field129.Length != 0) hash ^= Field129.GetHashCode(); + if (Field131 != 0) hash ^= Field131.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Field1.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Field1); + } + if (Field2 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Field2); + } + if (Field3 != 0) { + output.WriteRawTag(24); + output.WriteInt32(Field3); + } + if (Field4.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Field4); + } + field5_.WriteTo(output, _repeated_field5_codec); + if (Field6 != 0) { + output.WriteRawTag(48); + output.WriteInt32(Field6); + } + if (Field7.Length != 0) { + output.WriteRawTag(58); + output.WriteString(Field7); + } + if (Field9.Length != 0) { + output.WriteRawTag(74); + output.WriteString(Field9); + } + if (Field12 != false) { + output.WriteRawTag(96); + output.WriteBool(Field12); + } + if (Field13 != false) { + output.WriteRawTag(104); + output.WriteBool(Field13); + } + if (Field14 != false) { + output.WriteRawTag(112); + output.WriteBool(Field14); + } + if (field15_ != null) { + output.WriteRawTag(122); + output.WriteMessage(Field15); + } + if (Field16 != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(Field16); + } + if (Field17 != false) { + output.WriteRawTag(136, 1); + output.WriteBool(Field17); + } + if (Field18.Length != 0) { + output.WriteRawTag(146, 1); + output.WriteString(Field18); + } + if (Field22 != 0L) { + output.WriteRawTag(176, 1); + output.WriteInt64(Field22); + } + if (Field23 != 0) { + output.WriteRawTag(184, 1); + output.WriteInt32(Field23); + } + if (Field24 != false) { + output.WriteRawTag(192, 1); + output.WriteBool(Field24); + } + if (Field25 != 0) { + output.WriteRawTag(200, 1); + output.WriteInt32(Field25); + } + if (Field29 != 0) { + output.WriteRawTag(232, 1); + output.WriteInt32(Field29); + } + if (Field30 != false) { + output.WriteRawTag(240, 1); + output.WriteBool(Field30); + } + if (Field59 != false) { + output.WriteRawTag(216, 3); + output.WriteBool(Field59); + } + if (Field60 != 0) { + output.WriteRawTag(224, 3); + output.WriteInt32(Field60); + } + if (Field67 != 0) { + output.WriteRawTag(152, 4); + output.WriteInt32(Field67); + } + if (Field68 != 0) { + output.WriteRawTag(160, 4); + output.WriteInt32(Field68); + } + if (Field78 != false) { + output.WriteRawTag(240, 4); + output.WriteBool(Field78); + } + if (Field80 != false) { + output.WriteRawTag(128, 5); + output.WriteBool(Field80); + } + if (Field81 != false) { + output.WriteRawTag(136, 5); + output.WriteBool(Field81); + } + if (Field100 != 0) { + output.WriteRawTag(160, 6); + output.WriteInt32(Field100); + } + if (Field101 != 0) { + output.WriteRawTag(168, 6); + output.WriteInt32(Field101); + } + if (Field102.Length != 0) { + output.WriteRawTag(178, 6); + output.WriteString(Field102); + } + if (Field103.Length != 0) { + output.WriteRawTag(186, 6); + output.WriteString(Field103); + } + if (Field104 != 0) { + output.WriteRawTag(192, 6); + output.WriteInt32(Field104); + } + if (Field128 != 0) { + output.WriteRawTag(128, 8); + output.WriteInt32(Field128); + } + if (Field129.Length != 0) { + output.WriteRawTag(138, 8); + output.WriteString(Field129); + } + if (Field130 != 0) { + output.WriteRawTag(144, 8); + output.WriteInt32(Field130); + } + if (Field131 != 0) { + output.WriteRawTag(152, 8); + output.WriteInt32(Field131); + } + if (Field150 != 0) { + output.WriteRawTag(176, 9); + output.WriteInt32(Field150); + } + if (Field271 != 0) { + output.WriteRawTag(248, 16); + output.WriteInt32(Field271); + } + if (Field272 != 0) { + output.WriteRawTag(128, 17); + output.WriteInt32(Field272); + } + if (Field280 != 0) { + output.WriteRawTag(192, 17); + output.WriteInt32(Field280); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Field1.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Field1); + } + if (Field2 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Field2); + } + if (Field3 != 0) { + output.WriteRawTag(24); + output.WriteInt32(Field3); + } + if (Field4.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Field4); + } + field5_.WriteTo(ref output, _repeated_field5_codec); + if (Field6 != 0) { + output.WriteRawTag(48); + output.WriteInt32(Field6); + } + if (Field7.Length != 0) { + output.WriteRawTag(58); + output.WriteString(Field7); + } + if (Field9.Length != 0) { + output.WriteRawTag(74); + output.WriteString(Field9); + } + if (Field12 != false) { + output.WriteRawTag(96); + output.WriteBool(Field12); + } + if (Field13 != false) { + output.WriteRawTag(104); + output.WriteBool(Field13); + } + if (Field14 != false) { + output.WriteRawTag(112); + output.WriteBool(Field14); + } + if (field15_ != null) { + output.WriteRawTag(122); + output.WriteMessage(Field15); + } + if (Field16 != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(Field16); + } + if (Field17 != false) { + output.WriteRawTag(136, 1); + output.WriteBool(Field17); + } + if (Field18.Length != 0) { + output.WriteRawTag(146, 1); + output.WriteString(Field18); + } + if (Field22 != 0L) { + output.WriteRawTag(176, 1); + output.WriteInt64(Field22); + } + if (Field23 != 0) { + output.WriteRawTag(184, 1); + output.WriteInt32(Field23); + } + if (Field24 != false) { + output.WriteRawTag(192, 1); + output.WriteBool(Field24); + } + if (Field25 != 0) { + output.WriteRawTag(200, 1); + output.WriteInt32(Field25); + } + if (Field29 != 0) { + output.WriteRawTag(232, 1); + output.WriteInt32(Field29); + } + if (Field30 != false) { + output.WriteRawTag(240, 1); + output.WriteBool(Field30); + } + if (Field59 != false) { + output.WriteRawTag(216, 3); + output.WriteBool(Field59); + } + if (Field60 != 0) { + output.WriteRawTag(224, 3); + output.WriteInt32(Field60); + } + if (Field67 != 0) { + output.WriteRawTag(152, 4); + output.WriteInt32(Field67); + } + if (Field68 != 0) { + output.WriteRawTag(160, 4); + output.WriteInt32(Field68); + } + if (Field78 != false) { + output.WriteRawTag(240, 4); + output.WriteBool(Field78); + } + if (Field80 != false) { + output.WriteRawTag(128, 5); + output.WriteBool(Field80); + } + if (Field81 != false) { + output.WriteRawTag(136, 5); + output.WriteBool(Field81); + } + if (Field100 != 0) { + output.WriteRawTag(160, 6); + output.WriteInt32(Field100); + } + if (Field101 != 0) { + output.WriteRawTag(168, 6); + output.WriteInt32(Field101); + } + if (Field102.Length != 0) { + output.WriteRawTag(178, 6); + output.WriteString(Field102); + } + if (Field103.Length != 0) { + output.WriteRawTag(186, 6); + output.WriteString(Field103); + } + if (Field104 != 0) { + output.WriteRawTag(192, 6); + output.WriteInt32(Field104); + } + if (Field128 != 0) { + output.WriteRawTag(128, 8); + output.WriteInt32(Field128); + } + if (Field129.Length != 0) { + output.WriteRawTag(138, 8); + output.WriteString(Field129); + } + if (Field130 != 0) { + output.WriteRawTag(144, 8); + output.WriteInt32(Field130); + } + if (Field131 != 0) { + output.WriteRawTag(152, 8); + output.WriteInt32(Field131); + } + if (Field150 != 0) { + output.WriteRawTag(176, 9); + output.WriteInt32(Field150); + } + if (Field271 != 0) { + output.WriteRawTag(248, 16); + output.WriteInt32(Field271); + } + if (Field272 != 0) { + output.WriteRawTag(128, 17); + output.WriteInt32(Field272); + } + if (Field280 != 0) { + output.WriteRawTag(192, 17); + output.WriteInt32(Field280); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Field1.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Field1); + } + if (Field9.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Field9); + } + if (Field18.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(Field18); + } + if (Field80 != false) { + size += 2 + 1; + } + if (Field81 != false) { + size += 2 + 1; + } + if (Field2 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Field2); + } + if (Field3 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Field3); + } + if (Field280 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field280); + } + if (Field6 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Field6); + } + if (Field22 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Field22); + } + if (Field4.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Field4); + } + size += field5_.CalculateSize(_repeated_field5_codec); + if (Field59 != false) { + size += 2 + 1; + } + if (Field7.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Field7); + } + if (Field16 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field16); + } + if (Field130 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field130); + } + if (Field12 != false) { + size += 1 + 1; + } + if (Field17 != false) { + size += 2 + 1; + } + if (Field13 != false) { + size += 1 + 1; + } + if (Field14 != false) { + size += 1 + 1; + } + if (Field104 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field104); + } + if (Field100 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field100); + } + if (Field101 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field101); + } + if (Field102.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(Field102); + } + if (Field103.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(Field103); + } + if (Field29 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field29); + } + if (Field30 != false) { + size += 2 + 1; + } + if (Field60 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field60); + } + if (Field271 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field271); + } + if (Field272 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field272); + } + if (Field150 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field150); + } + if (Field23 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field23); + } + if (Field24 != false) { + size += 2 + 1; + } + if (Field25 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field25); + } + if (field15_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Field15); + } + if (Field78 != false) { + size += 2 + 1; + } + if (Field67 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field67); + } + if (Field68 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field68); + } + if (Field128 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field128); + } + if (Field129.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(Field129); + } + if (Field131 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field131); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GoogleMessage1 other) { + if (other == null) { + return; + } + if (other.Field1.Length != 0) { + Field1 = other.Field1; + } + if (other.Field9.Length != 0) { + Field9 = other.Field9; + } + if (other.Field18.Length != 0) { + Field18 = other.Field18; + } + if (other.Field80 != false) { + Field80 = other.Field80; + } + if (other.Field81 != false) { + Field81 = other.Field81; + } + if (other.Field2 != 0) { + Field2 = other.Field2; + } + if (other.Field3 != 0) { + Field3 = other.Field3; + } + if (other.Field280 != 0) { + Field280 = other.Field280; + } + if (other.Field6 != 0) { + Field6 = other.Field6; + } + if (other.Field22 != 0L) { + Field22 = other.Field22; + } + if (other.Field4.Length != 0) { + Field4 = other.Field4; + } + field5_.Add(other.field5_); + if (other.Field59 != false) { + Field59 = other.Field59; + } + if (other.Field7.Length != 0) { + Field7 = other.Field7; + } + if (other.Field16 != 0) { + Field16 = other.Field16; + } + if (other.Field130 != 0) { + Field130 = other.Field130; + } + if (other.Field12 != false) { + Field12 = other.Field12; + } + if (other.Field17 != false) { + Field17 = other.Field17; + } + if (other.Field13 != false) { + Field13 = other.Field13; + } + if (other.Field14 != false) { + Field14 = other.Field14; + } + if (other.Field104 != 0) { + Field104 = other.Field104; + } + if (other.Field100 != 0) { + Field100 = other.Field100; + } + if (other.Field101 != 0) { + Field101 = other.Field101; + } + if (other.Field102.Length != 0) { + Field102 = other.Field102; + } + if (other.Field103.Length != 0) { + Field103 = other.Field103; + } + if (other.Field29 != 0) { + Field29 = other.Field29; + } + if (other.Field30 != false) { + Field30 = other.Field30; + } + if (other.Field60 != 0) { + Field60 = other.Field60; + } + if (other.Field271 != 0) { + Field271 = other.Field271; + } + if (other.Field272 != 0) { + Field272 = other.Field272; + } + if (other.Field150 != 0) { + Field150 = other.Field150; + } + if (other.Field23 != 0) { + Field23 = other.Field23; + } + if (other.Field24 != false) { + Field24 = other.Field24; + } + if (other.Field25 != 0) { + Field25 = other.Field25; + } + if (other.field15_ != null) { + if (field15_ == null) { + Field15 = new global::Benchmarks.Proto3.GoogleMessage1SubMessage(); + } + Field15.MergeFrom(other.Field15); + } + if (other.Field78 != false) { + Field78 = other.Field78; + } + if (other.Field67 != 0) { + Field67 = other.Field67; + } + if (other.Field68 != 0) { + Field68 = other.Field68; + } + if (other.Field128 != 0) { + Field128 = other.Field128; + } + if (other.Field129.Length != 0) { + Field129 = other.Field129; + } + if (other.Field131 != 0) { + Field131 = other.Field131; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Field1 = input.ReadString(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 34: { + Field4 = input.ReadString(); + break; + } + case 42: + case 41: { + field5_.AddEntriesFrom(input, _repeated_field5_codec); + break; + } + case 48: { + Field6 = input.ReadInt32(); + break; + } + case 58: { + Field7 = input.ReadString(); + break; + } + case 74: { + Field9 = input.ReadString(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadBool(); + break; + } + case 112: { + Field14 = input.ReadBool(); + break; + } + case 122: { + if (field15_ == null) { + Field15 = new global::Benchmarks.Proto3.GoogleMessage1SubMessage(); + } + input.ReadMessage(Field15); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 136: { + Field17 = input.ReadBool(); + break; + } + case 146: { + Field18 = input.ReadString(); + break; + } + case 176: { + Field22 = input.ReadInt64(); + break; + } + case 184: { + Field23 = input.ReadInt32(); + break; + } + case 192: { + Field24 = input.ReadBool(); + break; + } + case 200: { + Field25 = input.ReadInt32(); + break; + } + case 232: { + Field29 = input.ReadInt32(); + break; + } + case 240: { + Field30 = input.ReadBool(); + break; + } + case 472: { + Field59 = input.ReadBool(); + break; + } + case 480: { + Field60 = input.ReadInt32(); + break; + } + case 536: { + Field67 = input.ReadInt32(); + break; + } + case 544: { + Field68 = input.ReadInt32(); + break; + } + case 624: { + Field78 = input.ReadBool(); + break; + } + case 640: { + Field80 = input.ReadBool(); + break; + } + case 648: { + Field81 = input.ReadBool(); + break; + } + case 800: { + Field100 = input.ReadInt32(); + break; + } + case 808: { + Field101 = input.ReadInt32(); + break; + } + case 818: { + Field102 = input.ReadString(); + break; + } + case 826: { + Field103 = input.ReadString(); + break; + } + case 832: { + Field104 = input.ReadInt32(); + break; + } + case 1024: { + Field128 = input.ReadInt32(); + break; + } + case 1034: { + Field129 = input.ReadString(); + break; + } + case 1040: { + Field130 = input.ReadInt32(); + break; + } + case 1048: { + Field131 = input.ReadInt32(); + break; + } + case 1200: { + Field150 = input.ReadInt32(); + break; + } + case 2168: { + Field271 = input.ReadInt32(); + break; + } + case 2176: { + Field272 = input.ReadInt32(); + break; + } + case 2240: { + Field280 = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Field1 = input.ReadString(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 34: { + Field4 = input.ReadString(); + break; + } + case 42: + case 41: { + field5_.AddEntriesFrom(ref input, _repeated_field5_codec); + break; + } + case 48: { + Field6 = input.ReadInt32(); + break; + } + case 58: { + Field7 = input.ReadString(); + break; + } + case 74: { + Field9 = input.ReadString(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadBool(); + break; + } + case 112: { + Field14 = input.ReadBool(); + break; + } + case 122: { + if (field15_ == null) { + Field15 = new global::Benchmarks.Proto3.GoogleMessage1SubMessage(); + } + input.ReadMessage(Field15); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 136: { + Field17 = input.ReadBool(); + break; + } + case 146: { + Field18 = input.ReadString(); + break; + } + case 176: { + Field22 = input.ReadInt64(); + break; + } + case 184: { + Field23 = input.ReadInt32(); + break; + } + case 192: { + Field24 = input.ReadBool(); + break; + } + case 200: { + Field25 = input.ReadInt32(); + break; + } + case 232: { + Field29 = input.ReadInt32(); + break; + } + case 240: { + Field30 = input.ReadBool(); + break; + } + case 472: { + Field59 = input.ReadBool(); + break; + } + case 480: { + Field60 = input.ReadInt32(); + break; + } + case 536: { + Field67 = input.ReadInt32(); + break; + } + case 544: { + Field68 = input.ReadInt32(); + break; + } + case 624: { + Field78 = input.ReadBool(); + break; + } + case 640: { + Field80 = input.ReadBool(); + break; + } + case 648: { + Field81 = input.ReadBool(); + break; + } + case 800: { + Field100 = input.ReadInt32(); + break; + } + case 808: { + Field101 = input.ReadInt32(); + break; + } + case 818: { + Field102 = input.ReadString(); + break; + } + case 826: { + Field103 = input.ReadString(); + break; + } + case 832: { + Field104 = input.ReadInt32(); + break; + } + case 1024: { + Field128 = input.ReadInt32(); + break; + } + case 1034: { + Field129 = input.ReadString(); + break; + } + case 1040: { + Field130 = input.ReadInt32(); + break; + } + case 1048: { + Field131 = input.ReadInt32(); + break; + } + case 1200: { + Field150 = input.ReadInt32(); + break; + } + case 2168: { + Field271 = input.ReadInt32(); + break; + } + case 2176: { + Field272 = input.ReadInt32(); + break; + } + case 2240: { + Field280 = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class GoogleMessage1SubMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1SubMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Benchmarks.Proto3.BenchmarkMessage1Proto3Reflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GoogleMessage1SubMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GoogleMessage1SubMessage(GoogleMessage1SubMessage other) : this() { + field1_ = other.field1_; + field2_ = other.field2_; + field3_ = other.field3_; + field15_ = other.field15_; + field12_ = other.field12_; + field13_ = other.field13_; + field14_ = other.field14_; + field16_ = other.field16_; + field19_ = other.field19_; + field20_ = other.field20_; + field28_ = other.field28_; + field21_ = other.field21_; + field22_ = other.field22_; + field23_ = other.field23_; + field206_ = other.field206_; + field203_ = other.field203_; + field204_ = other.field204_; + field205_ = other.field205_; + field207_ = other.field207_; + field300_ = other.field300_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GoogleMessage1SubMessage Clone() { + return new GoogleMessage1SubMessage(this); + } + + /// Field number for the "field1" field. + public const int Field1FieldNumber = 1; + private int field1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field1 { + get { return field1_; } + set { + field1_ = value; + } + } + + /// Field number for the "field2" field. + public const int Field2FieldNumber = 2; + private int field2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field2 { + get { return field2_; } + set { + field2_ = value; + } + } + + /// Field number for the "field3" field. + public const int Field3FieldNumber = 3; + private int field3_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field3 { + get { return field3_; } + set { + field3_ = value; + } + } + + /// Field number for the "field15" field. + public const int Field15FieldNumber = 15; + private string field15_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field15 { + get { return field15_; } + set { + field15_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field12" field. + public const int Field12FieldNumber = 12; + private bool field12_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field12 { + get { return field12_; } + set { + field12_ = value; + } + } + + /// Field number for the "field13" field. + public const int Field13FieldNumber = 13; + private long field13_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Field13 { + get { return field13_; } + set { + field13_ = value; + } + } + + /// Field number for the "field14" field. + public const int Field14FieldNumber = 14; + private long field14_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Field14 { + get { return field14_; } + set { + field14_ = value; + } + } + + /// Field number for the "field16" field. + public const int Field16FieldNumber = 16; + private int field16_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field16 { + get { return field16_; } + set { + field16_ = value; + } + } + + /// Field number for the "field19" field. + public const int Field19FieldNumber = 19; + private int field19_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field19 { + get { return field19_; } + set { + field19_ = value; + } + } + + /// Field number for the "field20" field. + public const int Field20FieldNumber = 20; + private bool field20_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field20 { + get { return field20_; } + set { + field20_ = value; + } + } + + /// Field number for the "field28" field. + public const int Field28FieldNumber = 28; + private bool field28_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field28 { + get { return field28_; } + set { + field28_ = value; + } + } + + /// Field number for the "field21" field. + public const int Field21FieldNumber = 21; + private ulong field21_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ulong Field21 { + get { return field21_; } + set { + field21_ = value; + } + } + + /// Field number for the "field22" field. + public const int Field22FieldNumber = 22; + private int field22_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field22 { + get { return field22_; } + set { + field22_ = value; + } + } + + /// Field number for the "field23" field. + public const int Field23FieldNumber = 23; + private bool field23_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field23 { + get { return field23_; } + set { + field23_ = value; + } + } + + /// Field number for the "field206" field. + public const int Field206FieldNumber = 206; + private bool field206_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Field206 { + get { return field206_; } + set { + field206_ = value; + } + } + + /// Field number for the "field203" field. + public const int Field203FieldNumber = 203; + private uint field203_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Field203 { + get { return field203_; } + set { + field203_ = value; + } + } + + /// Field number for the "field204" field. + public const int Field204FieldNumber = 204; + private int field204_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Field204 { + get { return field204_; } + set { + field204_ = value; + } + } + + /// Field number for the "field205" field. + public const int Field205FieldNumber = 205; + private string field205_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Field205 { + get { return field205_; } + set { + field205_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "field207" field. + public const int Field207FieldNumber = 207; + private ulong field207_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ulong Field207 { + get { return field207_; } + set { + field207_ = value; + } + } + + /// Field number for the "field300" field. + public const int Field300FieldNumber = 300; + private ulong field300_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ulong Field300 { + get { return field300_; } + set { + field300_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GoogleMessage1SubMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GoogleMessage1SubMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Field1 != other.Field1) return false; + if (Field2 != other.Field2) return false; + if (Field3 != other.Field3) return false; + if (Field15 != other.Field15) return false; + if (Field12 != other.Field12) return false; + if (Field13 != other.Field13) return false; + if (Field14 != other.Field14) return false; + if (Field16 != other.Field16) return false; + if (Field19 != other.Field19) return false; + if (Field20 != other.Field20) return false; + if (Field28 != other.Field28) return false; + if (Field21 != other.Field21) return false; + if (Field22 != other.Field22) return false; + if (Field23 != other.Field23) return false; + if (Field206 != other.Field206) return false; + if (Field203 != other.Field203) return false; + if (Field204 != other.Field204) return false; + if (Field205 != other.Field205) return false; + if (Field207 != other.Field207) return false; + if (Field300 != other.Field300) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Field1 != 0) hash ^= Field1.GetHashCode(); + if (Field2 != 0) hash ^= Field2.GetHashCode(); + if (Field3 != 0) hash ^= Field3.GetHashCode(); + if (Field15.Length != 0) hash ^= Field15.GetHashCode(); + if (Field12 != false) hash ^= Field12.GetHashCode(); + if (Field13 != 0L) hash ^= Field13.GetHashCode(); + if (Field14 != 0L) hash ^= Field14.GetHashCode(); + if (Field16 != 0) hash ^= Field16.GetHashCode(); + if (Field19 != 0) hash ^= Field19.GetHashCode(); + if (Field20 != false) hash ^= Field20.GetHashCode(); + if (Field28 != false) hash ^= Field28.GetHashCode(); + if (Field21 != 0UL) hash ^= Field21.GetHashCode(); + if (Field22 != 0) hash ^= Field22.GetHashCode(); + if (Field23 != false) hash ^= Field23.GetHashCode(); + if (Field206 != false) hash ^= Field206.GetHashCode(); + if (Field203 != 0) hash ^= Field203.GetHashCode(); + if (Field204 != 0) hash ^= Field204.GetHashCode(); + if (Field205.Length != 0) hash ^= Field205.GetHashCode(); + if (Field207 != 0UL) hash ^= Field207.GetHashCode(); + if (Field300 != 0UL) hash ^= Field300.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Field1 != 0) { + output.WriteRawTag(8); + output.WriteInt32(Field1); + } + if (Field2 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Field2); + } + if (Field3 != 0) { + output.WriteRawTag(24); + output.WriteInt32(Field3); + } + if (Field12 != false) { + output.WriteRawTag(96); + output.WriteBool(Field12); + } + if (Field13 != 0L) { + output.WriteRawTag(104); + output.WriteInt64(Field13); + } + if (Field14 != 0L) { + output.WriteRawTag(112); + output.WriteInt64(Field14); + } + if (Field15.Length != 0) { + output.WriteRawTag(122); + output.WriteString(Field15); + } + if (Field16 != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(Field16); + } + if (Field19 != 0) { + output.WriteRawTag(152, 1); + output.WriteInt32(Field19); + } + if (Field20 != false) { + output.WriteRawTag(160, 1); + output.WriteBool(Field20); + } + if (Field21 != 0UL) { + output.WriteRawTag(169, 1); + output.WriteFixed64(Field21); + } + if (Field22 != 0) { + output.WriteRawTag(176, 1); + output.WriteInt32(Field22); + } + if (Field23 != false) { + output.WriteRawTag(184, 1); + output.WriteBool(Field23); + } + if (Field28 != false) { + output.WriteRawTag(224, 1); + output.WriteBool(Field28); + } + if (Field203 != 0) { + output.WriteRawTag(221, 12); + output.WriteFixed32(Field203); + } + if (Field204 != 0) { + output.WriteRawTag(224, 12); + output.WriteInt32(Field204); + } + if (Field205.Length != 0) { + output.WriteRawTag(234, 12); + output.WriteString(Field205); + } + if (Field206 != false) { + output.WriteRawTag(240, 12); + output.WriteBool(Field206); + } + if (Field207 != 0UL) { + output.WriteRawTag(248, 12); + output.WriteUInt64(Field207); + } + if (Field300 != 0UL) { + output.WriteRawTag(224, 18); + output.WriteUInt64(Field300); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Field1 != 0) { + output.WriteRawTag(8); + output.WriteInt32(Field1); + } + if (Field2 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Field2); + } + if (Field3 != 0) { + output.WriteRawTag(24); + output.WriteInt32(Field3); + } + if (Field12 != false) { + output.WriteRawTag(96); + output.WriteBool(Field12); + } + if (Field13 != 0L) { + output.WriteRawTag(104); + output.WriteInt64(Field13); + } + if (Field14 != 0L) { + output.WriteRawTag(112); + output.WriteInt64(Field14); + } + if (Field15.Length != 0) { + output.WriteRawTag(122); + output.WriteString(Field15); + } + if (Field16 != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(Field16); + } + if (Field19 != 0) { + output.WriteRawTag(152, 1); + output.WriteInt32(Field19); + } + if (Field20 != false) { + output.WriteRawTag(160, 1); + output.WriteBool(Field20); + } + if (Field21 != 0UL) { + output.WriteRawTag(169, 1); + output.WriteFixed64(Field21); + } + if (Field22 != 0) { + output.WriteRawTag(176, 1); + output.WriteInt32(Field22); + } + if (Field23 != false) { + output.WriteRawTag(184, 1); + output.WriteBool(Field23); + } + if (Field28 != false) { + output.WriteRawTag(224, 1); + output.WriteBool(Field28); + } + if (Field203 != 0) { + output.WriteRawTag(221, 12); + output.WriteFixed32(Field203); + } + if (Field204 != 0) { + output.WriteRawTag(224, 12); + output.WriteInt32(Field204); + } + if (Field205.Length != 0) { + output.WriteRawTag(234, 12); + output.WriteString(Field205); + } + if (Field206 != false) { + output.WriteRawTag(240, 12); + output.WriteBool(Field206); + } + if (Field207 != 0UL) { + output.WriteRawTag(248, 12); + output.WriteUInt64(Field207); + } + if (Field300 != 0UL) { + output.WriteRawTag(224, 18); + output.WriteUInt64(Field300); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Field1 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Field1); + } + if (Field2 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Field2); + } + if (Field3 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Field3); + } + if (Field15.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Field15); + } + if (Field12 != false) { + size += 1 + 1; + } + if (Field13 != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Field13); + } + if (Field14 != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Field14); + } + if (Field16 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field16); + } + if (Field19 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field19); + } + if (Field20 != false) { + size += 2 + 1; + } + if (Field28 != false) { + size += 2 + 1; + } + if (Field21 != 0UL) { + size += 2 + 8; + } + if (Field22 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field22); + } + if (Field23 != false) { + size += 2 + 1; + } + if (Field206 != false) { + size += 2 + 1; + } + if (Field203 != 0) { + size += 2 + 4; + } + if (Field204 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field204); + } + if (Field205.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(Field205); + } + if (Field207 != 0UL) { + size += 2 + pb::CodedOutputStream.ComputeUInt64Size(Field207); + } + if (Field300 != 0UL) { + size += 2 + pb::CodedOutputStream.ComputeUInt64Size(Field300); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GoogleMessage1SubMessage other) { + if (other == null) { + return; + } + if (other.Field1 != 0) { + Field1 = other.Field1; + } + if (other.Field2 != 0) { + Field2 = other.Field2; + } + if (other.Field3 != 0) { + Field3 = other.Field3; + } + if (other.Field15.Length != 0) { + Field15 = other.Field15; + } + if (other.Field12 != false) { + Field12 = other.Field12; + } + if (other.Field13 != 0L) { + Field13 = other.Field13; + } + if (other.Field14 != 0L) { + Field14 = other.Field14; + } + if (other.Field16 != 0) { + Field16 = other.Field16; + } + if (other.Field19 != 0) { + Field19 = other.Field19; + } + if (other.Field20 != false) { + Field20 = other.Field20; + } + if (other.Field28 != false) { + Field28 = other.Field28; + } + if (other.Field21 != 0UL) { + Field21 = other.Field21; + } + if (other.Field22 != 0) { + Field22 = other.Field22; + } + if (other.Field23 != false) { + Field23 = other.Field23; + } + if (other.Field206 != false) { + Field206 = other.Field206; + } + if (other.Field203 != 0) { + Field203 = other.Field203; + } + if (other.Field204 != 0) { + Field204 = other.Field204; + } + if (other.Field205.Length != 0) { + Field205 = other.Field205; + } + if (other.Field207 != 0UL) { + Field207 = other.Field207; + } + if (other.Field300 != 0UL) { + Field300 = other.Field300; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Field1 = input.ReadInt32(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadInt64(); + break; + } + case 112: { + Field14 = input.ReadInt64(); + break; + } + case 122: { + Field15 = input.ReadString(); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 152: { + Field19 = input.ReadInt32(); + break; + } + case 160: { + Field20 = input.ReadBool(); + break; + } + case 169: { + Field21 = input.ReadFixed64(); + break; + } + case 176: { + Field22 = input.ReadInt32(); + break; + } + case 184: { + Field23 = input.ReadBool(); + break; + } + case 224: { + Field28 = input.ReadBool(); + break; + } + case 1629: { + Field203 = input.ReadFixed32(); + break; + } + case 1632: { + Field204 = input.ReadInt32(); + break; + } + case 1642: { + Field205 = input.ReadString(); + break; + } + case 1648: { + Field206 = input.ReadBool(); + break; + } + case 1656: { + Field207 = input.ReadUInt64(); + break; + } + case 2400: { + Field300 = input.ReadUInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Field1 = input.ReadInt32(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadInt64(); + break; + } + case 112: { + Field14 = input.ReadInt64(); + break; + } + case 122: { + Field15 = input.ReadString(); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 152: { + Field19 = input.ReadInt32(); + break; + } + case 160: { + Field20 = input.ReadBool(); + break; + } + case 169: { + Field21 = input.ReadFixed64(); + break; + } + case 176: { + Field22 = input.ReadInt32(); + break; + } + case 184: { + Field23 = input.ReadBool(); + break; + } + case 224: { + Field28 = input.ReadBool(); + break; + } + case 1629: { + Field203 = input.ReadFixed32(); + break; + } + case 1632: { + Field204 = input.ReadInt32(); + break; + } + case 1642: { + Field205 = input.ReadString(); + break; + } + case 1648: { + Field206 = input.ReadBool(); + break; + } + case 1656: { + Field207 = input.ReadUInt64(); + break; + } + case 2400: { + Field300 = input.ReadUInt64(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.pb.cs b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs similarity index 45% rename from csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.pb.cs rename to csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs index a71fe3a61358377408c7842cb75a5b6c66dc00f4..e2578f367fd26370eb54c0446ec6763b51d4054f 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.pb.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs @@ -1,134 +1,168 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/source_context.proto +// source: benchmarks.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { +namespace Benchmarks { - /// Holder for reflection information generated from google/protobuf/source_context.proto - public static partial class SourceContextReflection { + /// Holder for reflection information generated from benchmarks.proto + public static partial class BenchmarksReflection { #region Descriptor - /// File descriptor for google/protobuf/source_context.proto + /// File descriptor for benchmarks.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; - static SourceContextReflection() { + static BenchmarksReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2ds", - "ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo", - "CUKKAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3Rv", - "UAFaNmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3Nv", - "dXJjZWNvbnRleHRwYqICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25v", - "d25UeXBlc2IGcHJvdG8z")); + "ChBiZW5jaG1hcmtzLnByb3RvEgpiZW5jaG1hcmtzIkcKEEJlbmNobWFya0Rh", + "dGFzZXQSDAoEbmFtZRgBIAEoCRIUCgxtZXNzYWdlX25hbWUYAiABKAkSDwoH", + "cGF5bG9hZBgDIAMoDEIgCh5jb20uZ29vZ2xlLnByb3RvYnVmLmJlbmNobWFy", + "a3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.SourceContext), global::Google.Protobuf.WellKnownTypes.SourceContext.Parser, new[]{ "FileName" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Benchmarks.BenchmarkDataset), global::Benchmarks.BenchmarkDataset.Parser, new[]{ "Name", "MessageName", "Payload" }, null, null, null, null) })); } #endregion } #region Messages - /// - /// `SourceContext` represents information about the source of a - /// protobuf element, like the file in which it is defined. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class SourceContext : pb::IMessage + public sealed partial class BenchmarkDataset : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceContext()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BenchmarkDataset()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor.MessageTypes[0]; } + get { return global::Benchmarks.BenchmarksReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SourceContext() { + public BenchmarkDataset() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SourceContext(SourceContext other) : this() { - fileName_ = other.fileName_; + public BenchmarkDataset(BenchmarkDataset other) : this() { + name_ = other.name_; + messageName_ = other.messageName_; + payload_ = other.payload_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SourceContext Clone() { - return new SourceContext(this); + public BenchmarkDataset Clone() { + return new BenchmarkDataset(this); } - /// Field number for the "file_name" field. - public const int FileNameFieldNumber = 1; - private string fileName_ = ""; + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; /// - /// The path-qualified name of the .proto file that contained the associated - /// protobuf element. For example: `"google/protobuf/source_context.proto"`. + /// Name of the benchmark dataset. This should be unique across all datasets. + /// Should only contain word characters: [a-zA-Z0-9_] /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string FileName { - get { return fileName_; } + public string Name { + get { return name_; } set { - fileName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } + /// Field number for the "message_name" field. + public const int MessageNameFieldNumber = 2; + private string messageName_ = ""; + /// + /// Fully-qualified name of the protobuf message for this dataset. + /// It will be one of the messages defined benchmark_messages_proto2.proto + /// or benchmark_messages_proto3.proto. + /// + /// Implementations that do not support reflection can implement this with + /// an explicit "if/else" chain that lists every known message defined + /// in those files. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string MessageName { + get { return messageName_; } + set { + messageName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "payload" field. + public const int PayloadFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_payload_codec + = pb::FieldCodec.ForBytes(26); + private readonly pbc::RepeatedField payload_ = new pbc::RepeatedField(); + /// + /// The payload(s) for this dataset. They should be parsed or serialized + /// in sequence, in a loop, ie. + /// + /// while (!benchmarkDone) { // Benchmark runner decides when to exit. + /// for (i = 0; i < benchmark.payload.length; i++) { + /// parse(benchmark.payload[i]) + /// } + /// } + /// + /// This is intended to let datasets include a variety of data to provide + /// potentially more realistic results than just parsing the same message + /// over and over. A single message parsed repeatedly could yield unusually + /// good branch prediction performance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Payload { + get { return payload_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { - return Equals(other as SourceContext); + return Equals(other as BenchmarkDataset); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(SourceContext other) { + public bool Equals(BenchmarkDataset other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (FileName != other.FileName) return false; + if (Name != other.Name) return false; + if (MessageName != other.MessageName) return false; + if(!payload_.Equals(other.payload_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (FileName.Length != 0) hash ^= FileName.GetHashCode(); + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (MessageName.Length != 0) hash ^= MessageName.GetHashCode(); + hash ^= payload_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -136,21 +170,24 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (FileName.Length != 0) { + if (Name.Length != 0) { output.WriteRawTag(10); - output.WriteString(FileName); + output.WriteString(Name); } + if (MessageName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(MessageName); + } + payload_.WriteTo(output, _repeated_payload_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -159,12 +196,16 @@ namespace Google.Protobuf.WellKnownTypes { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (FileName.Length != 0) { + if (Name.Length != 0) { output.WriteRawTag(10); - output.WriteString(FileName); + output.WriteString(Name); + } + if (MessageName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(MessageName); } + payload_.WriteTo(ref output, _repeated_payload_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -172,12 +213,15 @@ namespace Google.Protobuf.WellKnownTypes { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (FileName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(FileName); + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (MessageName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageName); } + size += payload_.CalculateSize(_repeated_payload_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -185,19 +229,21 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(SourceContext other) { + public void MergeFrom(BenchmarkDataset other) { if (other == null) { return; } - if (other.FileName.Length != 0) { - FileName = other.FileName; + if (other.Name.Length != 0) { + Name = other.Name; } + if (other.MessageName.Length != 0) { + MessageName = other.MessageName; + } + payload_.Add(other.payload_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -209,7 +255,15 @@ namespace Google.Protobuf.WellKnownTypes { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - FileName = input.ReadString(); + Name = input.ReadString(); + break; + } + case 18: { + MessageName = input.ReadString(); + break; + } + case 26: { + payload_.AddEntriesFrom(input, _repeated_payload_codec); break; } } @@ -219,7 +273,6 @@ namespace Google.Protobuf.WellKnownTypes { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -228,7 +281,15 @@ namespace Google.Protobuf.WellKnownTypes { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - FileName = input.ReadString(); + Name = input.ReadString(); + break; + } + case 18: { + MessageName = input.ReadString(); + break; + } + case 26: { + payload_.AddEntriesFrom(ref input, _repeated_payload_codec); break; } } diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj similarity index 47% rename from csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj rename to csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj index 59edf2c24c07fedfc8bba0bd8175480859e82946..37bbc3ef2f0e4c3024b27ed84cfccefe2175318c 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj @@ -2,25 +2,26 @@ Exe - net462;net6.0 + netcoreapp3.1 ../../keys/Google.Protobuf.snk true + true False - 8.0 + pdbonly + true - + - - + + - - +
diff --git a/python/compatibility_tests/v2.5.0/protos/python/google/protobuf/internal/factory_test2.proto b/csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs similarity index 31% rename from python/compatibility_tests/v2.5.0/protos/python/google/protobuf/internal/factory_test2.proto rename to csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs index d3ce4d7f95c0894534d51d7e63422bb8986d8249..132967e00a29dec52230076fd2d83b7a62f74e7e 100644 --- a/python/compatibility_tests/v2.5.0/protos/python/google/protobuf/internal/factory_test2.proto +++ b/csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs @@ -1,6 +1,7 @@ +#region Copyright notice and license // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -27,51 +28,97 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion -// Author: matthewtoia@google.com (Matt Toia) +using BenchmarkDotNet.Attributes; +using System.Collections.Generic; +using System.IO; +using System.Linq; +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmark for serializing and deserializing of standard datasets that are also + /// measured by benchmarks in other languages. + /// Over time we may wish to test the various different approaches to serialization and deserialization separately. + /// See https://github.com/protocolbuffers/protobuf/blob/master/benchmarks/README.md + /// See https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md + /// + [MemoryDiagnoser] + public class GoogleMessageBenchmark + { + /// + /// All the datasets to be tested. Add more datasets to the array as they're available. + /// (When C# supports proto2, this will increase significantly.) + /// + public static BenchmarkDatasetConfig[] DatasetConfigurations => new[] + { + // short name is specified to make results table more readable + new BenchmarkDatasetConfig("dataset.google_message1_proto3.pb", "goog_msg1_proto3") + }; -package google.protobuf.python.internal; + [ParamsSource(nameof(DatasetConfigurations))] + public BenchmarkDatasetConfig Dataset { get; set; } -import "google/protobuf/internal/factory_test1.proto"; + private MessageParser parser; + /// + /// Each data set can contain multiple messages in a single file. + /// Each "write" operation should write each message in turn, and each "parse" + /// operation should parse each message in turn. + /// + private List subTests; + [GlobalSetup] + public void GlobalSetup() + { + parser = Dataset.Parser; + subTests = Dataset.Payloads.Select(p => new SubTest(p, parser.ParseFrom(p))).ToList(); + } -enum Factory2Enum { - FACTORY_2_VALUE_0 = 0; - FACTORY_2_VALUE_1 = 1; -} + [Benchmark] + public void WriteToStream() => subTests.ForEach(item => item.WriteToStream()); -message Factory2Message { - required int32 mandatory = 1; - optional Factory2Enum factory_2_enum = 2; - enum NestedFactory2Enum { - NESTED_FACTORY_2_VALUE_0 = 0; - NESTED_FACTORY_2_VALUE_1 = 1; - } - optional NestedFactory2Enum nested_factory_2_enum = 3; - message NestedFactory2Message { - optional string value = 1; - } - optional NestedFactory2Message nested_factory_2_message = 4; - optional Factory1Message factory_1_message = 5; - optional Factory1Enum factory_1_enum = 6; - optional Factory1Message.NestedFactory1Enum nested_factory_1_enum = 7; - optional Factory1Message.NestedFactory1Message nested_factory_1_message = 8; - optional Factory2Message circular_message = 9; - optional string scalar_value = 10; - repeated string list_value = 11; - repeated group Grouped = 12 { - optional string part_1 = 13; - optional string part_2 = 14; - } - optional LoopMessage loop = 15; - optional int32 int_with_default = 16 [default = 1776]; - optional double double_with_default = 17 [default = 9.99]; - optional string string_with_default = 18 [default = "hello world"]; - optional bool bool_with_default = 19 [default = false]; - optional Factory2Enum enum_with_default = 20 [default = FACTORY_2_VALUE_1]; -} + [Benchmark] + public void ToByteArray() => subTests.ForEach(item => item.ToByteArray()); + + [Benchmark] + public void ParseFromByteArray() => subTests.ForEach(item => item.ParseFromByteArray(parser)); + + [Benchmark] + public void ParseFromStream() => subTests.ForEach(item => item.ParseFromStream(parser)); + + private class SubTest + { + private readonly Stream destinationStream; + private readonly Stream sourceStream; + private readonly byte[] data; + private readonly IMessage message; + + public SubTest(byte[] data, IMessage message) + { + destinationStream = new MemoryStream(data.Length); + sourceStream = new MemoryStream(data); + this.data = data; + this.message = message; + } + + public void Reset() => destinationStream.Position = 0; + + public void WriteToStream() + { + destinationStream.Position = 0; + message.WriteTo(destinationStream); + } + + public void ToByteArray() => message.ToByteArray(); + + public void ParseFromByteArray(MessageParser parser) => parser.ParseFrom(data); -message LoopMessage { - optional Factory2Message loop = 1; + public void ParseFromStream(MessageParser parser) + { + sourceStream.Position = 0; + parser.ParseFrom(sourceStream); + } + } + } } diff --git a/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs new file mode 100644 index 0000000000000000000000000000000000000000..8e6710b7089c3d8985d1839cd6e790e15403f97d --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs @@ -0,0 +1,258 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using BenchmarkDotNet.Attributes; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Buffers; +using Google.Protobuf.WellKnownTypes; +using Benchmarks.Proto3; + +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmark that tests parsing performance for various messages. + /// + [MemoryDiagnoser] + public class ParseMessagesBenchmark + { + const int MaxMessages = 100; + + SubTest manyWrapperFieldsTest = new SubTest(CreateManyWrapperFieldsMessage(), ManyWrapperFieldsMessage.Parser, () => new ManyWrapperFieldsMessage(), MaxMessages); + SubTest manyPrimitiveFieldsTest = new SubTest(CreateManyPrimitiveFieldsMessage(), ManyPrimitiveFieldsMessage.Parser, () => new ManyPrimitiveFieldsMessage(), MaxMessages); + SubTest repeatedFieldTest = new SubTest(CreateRepeatedFieldMessage(), GoogleMessage1.Parser, () => new GoogleMessage1(), MaxMessages); + SubTest emptyMessageTest = new SubTest(new Empty(), Empty.Parser, () => new Empty(), MaxMessages); + + public IEnumerable MessageCountValues => new[] { 10, 100 }; + + [GlobalSetup] + public void GlobalSetup() + { + } + + [Benchmark] + public IMessage ManyWrapperFieldsMessage_ParseFromByteArray() + { + return manyWrapperFieldsTest.ParseFromByteArray(); + } + + [Benchmark] + public IMessage ManyWrapperFieldsMessage_ParseFromReadOnlySequence() + { + return manyWrapperFieldsTest.ParseFromReadOnlySequence(); + } + + [Benchmark] + public IMessage ManyPrimitiveFieldsMessage_ParseFromByteArray() + { + return manyPrimitiveFieldsTest.ParseFromByteArray(); + } + + [Benchmark] + public IMessage ManyPrimitiveFieldsMessage_ParseFromReadOnlySequence() + { + return manyPrimitiveFieldsTest.ParseFromReadOnlySequence(); + } + + [Benchmark] + public IMessage RepeatedFieldMessage_ParseFromByteArray() + { + return repeatedFieldTest.ParseFromByteArray(); + } + + [Benchmark] + public IMessage RepeatedFieldMessage_ParseFromReadOnlySequence() + { + return repeatedFieldTest.ParseFromReadOnlySequence(); + } + + [Benchmark] + public IMessage EmptyMessage_ParseFromByteArray() + { + return emptyMessageTest.ParseFromByteArray(); + } + + [Benchmark] + public IMessage EmptyMessage_ParseFromReadOnlySequence() + { + return emptyMessageTest.ParseFromReadOnlySequence(); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount) + { + manyWrapperFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + manyWrapperFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount) + { + manyPrimitiveFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + manyPrimitiveFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void RepeatedFieldMessage_ParseDelimitedMessagesFromByteArray(int messageCount) + { + repeatedFieldTest.ParseDelimitedMessagesFromByteArray(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void RepeatedFieldMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + repeatedFieldTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); + } + + public static ManyWrapperFieldsMessage CreateManyWrapperFieldsMessage() + { + // Example data match data of an internal benchmarks + return new ManyWrapperFieldsMessage() + { + Int64Field19 = 123, + Int64Field37 = 1000032, + Int64Field26 = 3453524500, + DoubleField79 = 1.2, + DoubleField25 = 234, + DoubleField9 = 123.3, + DoubleField28 = 23, + DoubleField7 = 234, + DoubleField50 = 2.45 + }; + } + + public static ManyPrimitiveFieldsMessage CreateManyPrimitiveFieldsMessage() + { + // Example data match data of an internal benchmarks + return new ManyPrimitiveFieldsMessage() + { + Int64Field19 = 123, + Int64Field37 = 1000032, + Int64Field26 = 3453524500, + DoubleField79 = 1.2, + DoubleField25 = 234, + DoubleField9 = 123.3, + DoubleField28 = 23, + DoubleField7 = 234, + DoubleField50 = 2.45 + }; + } + + public static GoogleMessage1 CreateRepeatedFieldMessage() + { + // Message with a repeated fixed length item collection + var message = new GoogleMessage1(); + for (ulong i = 0; i < 1000; i++) + { + message.Field5.Add(i); + } + return message; + } + + private class SubTest + { + private readonly IMessage message; + private readonly MessageParser parser; + private readonly Func factory; + private readonly byte[] data; + private readonly byte[] multipleMessagesData; + + private ReadOnlySequence dataSequence; + private ReadOnlySequence multipleMessagesDataSequence; + + public SubTest(IMessage message, MessageParser parser, Func factory, int maxMessageCount) + { + this.message = message; + this.parser = parser; + this.factory = factory; + this.data = message.ToByteArray(); + this.multipleMessagesData = CreateBufferWithMultipleMessages(message, maxMessageCount); + this.dataSequence = new ReadOnlySequence(this.data); + this.multipleMessagesDataSequence = new ReadOnlySequence(this.multipleMessagesData); + } + + public IMessage ParseFromByteArray() => parser.ParseFrom(data); + + public IMessage ParseFromReadOnlySequence() => parser.ParseFrom(dataSequence); + + public void ParseDelimitedMessagesFromByteArray(int messageCount) + { + var input = new CodedInputStream(multipleMessagesData); + for (int i = 0; i < messageCount; i++) + { + var msg = factory(); + input.ReadMessage(msg); + } + } + + public void ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + ParseContext.Initialize(multipleMessagesDataSequence, out ParseContext ctx); + for (int i = 0; i < messageCount; i++) + { + var msg = factory(); + ctx.ReadMessage(msg); + } + } + + private static byte[] CreateBufferWithMultipleMessages(IMessage msg, int msgCount) + { + var ms = new MemoryStream(); + var cos = new CodedOutputStream(ms); + for (int i = 0; i < msgCount; i++) + { + cos.WriteMessage(msg); + } + cos.Flush(); + return ms.ToArray(); + } + } + } +} diff --git a/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs new file mode 100644 index 0000000000000000000000000000000000000000..6df1c872c3ca1babf9b3e3d41eac1ed7311aebaa --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs @@ -0,0 +1,536 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using BenchmarkDotNet.Attributes; +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Buffers; + +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmarks throughput when parsing raw primitives. + /// + [MemoryDiagnoser] + public class ParseRawPrimitivesBenchmark + { + // key is the encodedSize of varint values + Dictionary varintInputBuffers; + + byte[] doubleInputBuffer; + byte[] floatInputBuffer; + byte[] fixedIntInputBuffer; + + // key is the encodedSize of string values + Dictionary stringInputBuffers; + Dictionary> stringInputBuffersSegmented; + + Random random = new Random(417384220); // random but deterministic seed + + public IEnumerable StringEncodedSizes => new[] { 1, 4, 10, 105, 10080 }; + public IEnumerable StringSegmentedEncodedSizes => new[] { 105, 10080 }; + + [GlobalSetup] + public void GlobalSetup() + { + // add some extra values that we won't read just to make sure we are far enough from the end of the buffer + // which allows the parser fastpath to always kick in. + const int paddingValueCount = 100; + + varintInputBuffers = new Dictionary(); + for (int encodedSize = 1; encodedSize <= 10; encodedSize++) + { + byte[] buffer = CreateBufferWithRandomVarints(random, BytesToParse / encodedSize, encodedSize, paddingValueCount); + varintInputBuffers.Add(encodedSize, buffer); + } + + doubleInputBuffer = CreateBufferWithRandomDoubles(random, BytesToParse / sizeof(double), paddingValueCount); + floatInputBuffer = CreateBufferWithRandomFloats(random, BytesToParse / sizeof(float), paddingValueCount); + fixedIntInputBuffer = CreateBufferWithRandomData(random, BytesToParse / sizeof(long), sizeof(long), paddingValueCount); + + stringInputBuffers = new Dictionary(); + foreach (var encodedSize in StringEncodedSizes) + { + byte[] buffer = CreateBufferWithStrings(BytesToParse / encodedSize, encodedSize, encodedSize < 10 ? 10 : 1 ); + stringInputBuffers.Add(encodedSize, buffer); + } + + stringInputBuffersSegmented = new Dictionary>(); + foreach (var encodedSize in StringSegmentedEncodedSizes) + { + byte[] buffer = CreateBufferWithStrings(BytesToParse / encodedSize, encodedSize, encodedSize < 10 ? 10 : 1); + stringInputBuffersSegmented.Add(encodedSize, ReadOnlySequenceFactory.CreateWithContent(buffer, segmentSize: 128, addEmptySegmentDelimiters: false)); + } + } + + // Total number of bytes that each benchmark will parse. + // Measuring the time taken to parse buffer of given size makes it easier to compare parsing speed for different + // types and makes it easy to calculate the througput (in MB/s) + // 10800 bytes is chosen because it is divisible by all possible encoded sizes for all primitive types {1..10} + [Params(10080)] + public int BytesToParse { get; set; } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + public int ParseRawVarint32_CodedInputStream(int encodedSize) + { + CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadInt32(); + } + return sum; + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + public int ParseRawVarint32_ParseContext(int encodedSize) + { + InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadInt32(); + } + return sum; + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + [Arguments(6)] + [Arguments(7)] + [Arguments(8)] + [Arguments(9)] + [Arguments(10)] + public long ParseRawVarint64_CodedInputStream(int encodedSize) + { + CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]); + long sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadInt64(); + } + return sum; + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + [Arguments(6)] + [Arguments(7)] + [Arguments(8)] + [Arguments(9)] + [Arguments(10)] + public long ParseRawVarint64_ParseContext(int encodedSize) + { + InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx); + long sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadInt64(); + } + return sum; + } + + [Benchmark] + public uint ParseFixed32_CodedInputStream() + { + const int encodedSize = sizeof(uint); + CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer); + uint sum = 0; + for (uint i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadFixed32(); + } + return sum; + } + + [Benchmark] + public uint ParseFixed32_ParseContext() + { + const int encodedSize = sizeof(uint); + InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx); + uint sum = 0; + for (uint i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadFixed32(); + } + return sum; + } + + [Benchmark] + public ulong ParseFixed64_CodedInputStream() + { + const int encodedSize = sizeof(ulong); + CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer); + ulong sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadFixed64(); + } + return sum; + } + + [Benchmark] + public ulong ParseFixed64_ParseContext() + { + const int encodedSize = sizeof(ulong); + InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx); + ulong sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadFixed64(); + } + return sum; + } + + [Benchmark] + public float ParseRawFloat_CodedInputStream() + { + const int encodedSize = sizeof(float); + CodedInputStream cis = new CodedInputStream(floatInputBuffer); + float sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadFloat(); + } + return sum; + } + + [Benchmark] + public float ParseRawFloat_ParseContext() + { + const int encodedSize = sizeof(float); + InitializeParseContext(floatInputBuffer, out ParseContext ctx); + float sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadFloat(); + } + return sum; + } + + [Benchmark] + public double ParseRawDouble_CodedInputStream() + { + const int encodedSize = sizeof(double); + CodedInputStream cis = new CodedInputStream(doubleInputBuffer); + double sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadDouble(); + } + return sum; + } + + [Benchmark] + public double ParseRawDouble_ParseContext() + { + const int encodedSize = sizeof(double); + InitializeParseContext(doubleInputBuffer, out ParseContext ctx); + double sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadDouble(); + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseString_CodedInputStream(int encodedSize) + { + CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadString().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseString_ParseContext(int encodedSize) + { + InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadString().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringSegmentedEncodedSizes))] + public int ParseString_ParseContext_MultipleSegments(int encodedSize) + { + InitializeParseContext(stringInputBuffersSegmented[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadString().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseBytes_CodedInputStream(int encodedSize) + { + CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadBytes().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseBytes_ParseContext(int encodedSize) + { + InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadBytes().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringSegmentedEncodedSizes))] + public int ParseBytes_ParseContext_MultipleSegments(int encodedSize) + { + InitializeParseContext(stringInputBuffersSegmented[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadBytes().Length; + } + return sum; + } + + private static void InitializeParseContext(byte[] buffer, out ParseContext ctx) + { + ParseContext.Initialize(new ReadOnlySequence(buffer), out ctx); + } + + private static void InitializeParseContext(ReadOnlySequence buffer, out ParseContext ctx) + { + ParseContext.Initialize(buffer, out ctx); + } + + private static byte[] CreateBufferWithRandomVarints(Random random, int valueCount, int encodedSize, int paddingValueCount) + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream cos = new CodedOutputStream(ms); + for (int i = 0; i < valueCount + paddingValueCount; i++) + { + cos.WriteUInt64(RandomUnsignedVarint(random, encodedSize, false)); + } + cos.Flush(); + var buffer = ms.ToArray(); + + if (buffer.Length != encodedSize * (valueCount + paddingValueCount)) + { + throw new InvalidOperationException($"Unexpected output buffer length {buffer.Length}"); + } + return buffer; + } + + private static byte[] CreateBufferWithRandomFloats(Random random, int valueCount, int paddingValueCount) + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream cos = new CodedOutputStream(ms); + for (int i = 0; i < valueCount + paddingValueCount; i++) + { + cos.WriteFloat((float)random.NextDouble()); + } + cos.Flush(); + var buffer = ms.ToArray(); + return buffer; + } + + private static byte[] CreateBufferWithRandomDoubles(Random random, int valueCount, int paddingValueCount) + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream cos = new CodedOutputStream(ms); + for (int i = 0; i < valueCount + paddingValueCount; i++) + { + cos.WriteDouble(random.NextDouble()); + } + cos.Flush(); + var buffer = ms.ToArray(); + return buffer; + } + + private static byte[] CreateBufferWithRandomData(Random random, int valueCount, int encodedSize, int paddingValueCount) + { + int bufferSize = (valueCount + paddingValueCount) * encodedSize; + byte[] buffer = new byte[bufferSize]; + random.NextBytes(buffer); + return buffer; + } + + /// + /// Generate a random value that will take exactly "encodedSize" bytes when varint-encoded. + /// + public static ulong RandomUnsignedVarint(Random random, int encodedSize, bool fitsIn32Bits) + { + Span randomBytesBuffer = stackalloc byte[8]; + + if (encodedSize < 1 || encodedSize > 10 || (fitsIn32Bits && encodedSize > 5)) + { + throw new ArgumentException("Illegal encodedSize value requested", nameof(encodedSize)); + } + const int bitsPerByte = 7; + + ulong result = 0; + while (true) + { + random.NextBytes(randomBytesBuffer); + ulong randomValue = BinaryPrimitives.ReadUInt64LittleEndian(randomBytesBuffer); + + // only use the number of random bits we need + ulong bitmask = encodedSize < 10 ? ((1UL << (encodedSize * bitsPerByte)) - 1) : ulong.MaxValue; + result = randomValue & bitmask; + + if (fitsIn32Bits) + { + // make sure the resulting value is representable by a uint. + result &= uint.MaxValue; + } + + if (encodedSize == 10) + { + // for 10-byte values the highest bit always needs to be set (7*9=63) + result |= ulong.MaxValue; + break; + } + + // some random values won't require the full "encodedSize" bytes, check that at least + // one of the top 7 bits is set. Retrying is fine since it only happens rarely + if (encodedSize == 1 || (result & (0x7FUL << ((encodedSize - 1) * bitsPerByte))) != 0) + { + break; + } + } + return result; + } + + private static byte[] CreateBufferWithStrings(int valueCount, int encodedSize, int paddingValueCount) + { + var str = CreateStringWithEncodedSize(encodedSize); + + MemoryStream ms = new MemoryStream(); + CodedOutputStream cos = new CodedOutputStream(ms); + for (int i = 0; i < valueCount + paddingValueCount; i++) + { + cos.WriteString(str); + } + cos.Flush(); + var buffer = ms.ToArray(); + + if (buffer.Length != encodedSize * (valueCount + paddingValueCount)) + { + throw new InvalidOperationException($"Unexpected output buffer length {buffer.Length}"); + } + return buffer; + } + + public static string CreateStringWithEncodedSize(int encodedSize) + { + var str = new string('a', encodedSize); + while (CodedOutputStream.ComputeStringSize(str) > encodedSize) + { + str = str.Substring(1); + } + + if (CodedOutputStream.ComputeStringSize(str) != encodedSize) + { + throw new InvalidOperationException($"Generated string with wrong encodedSize"); + } + return str; + } + + public static string CreateNonAsciiStringWithEncodedSize(int encodedSize) + { + if (encodedSize < 3) + { + throw new ArgumentException("Illegal encoded size for a string with non-ascii chars."); + } + var twoByteChar = '\u00DC'; // U-umlaut, UTF8 encoding has 2 bytes + var str = new string(twoByteChar, encodedSize / 2); + while (CodedOutputStream.ComputeStringSize(str) > encodedSize) + { + str = str.Substring(1); + } + + // add padding of ascii characters to reach the desired encoded size. + while (CodedOutputStream.ComputeStringSize(str) < encodedSize) + { + str += 'a'; + } + + // Note that for a few specific encodedSize values, it might be impossible to generate + // the string with the desired encodedSize using the algorithm above. For testing purposes, checking that + // the encoded size we got is actually correct is good enough. + if (CodedOutputStream.ComputeStringSize(str) != encodedSize) + { + throw new InvalidOperationException($"Generated string with wrong encodedSize"); + } + return str; + } + } +} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/com/google/protobuf/nested_extension_lite.proto b/csharp/src/Google.Protobuf.Benchmarks/Program.cs similarity index 71% rename from java/compatibility_tests/v2.5.0/more_protos/src/proto/com/google/protobuf/nested_extension_lite.proto rename to csharp/src/Google.Protobuf.Benchmarks/Program.cs index 16ee46e57dc27602a4990668f6d5b64ec4145a6a..1f77a26135eba72f44a4c4bc2c2d875c5cb06755 100644 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/com/google/protobuf/nested_extension_lite.proto +++ b/csharp/src/Google.Protobuf.Benchmarks/Program.cs @@ -1,6 +1,7 @@ +#region Copyright notice and license // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -27,22 +28,22 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion -// Author: Darick Tong (darick@google.com) -// -// A proto file with nested extensions for a MessageLite messages. Note that -// this must be defined in a separate file to properly test the initialization -// of the outer class. - - -package protobuf_unittest; - -option optimize_for = LITE_RUNTIME; +using BenchmarkDotNet.Running; -import "com/google/protobuf/non_nested_extension_lite.proto"; +namespace Google.Protobuf.Benchmarks +{ + class Program + { + // typical usage: dotnet run -c Release -f netcoreapp2.1 + // (this can profile both .net core and .net framework; for some reason + // if you start from "-f net461", it goes horribly wrong) + public static void Main(string[] args) + { + BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); + } + } -message MyNestedExtensionLite { - extend MessageLiteToBeExtended { - optional MessageLiteToBeExtended recursiveExtensionLite = 3; - } + } diff --git a/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs new file mode 100644 index 0000000000000000000000000000000000000000..9db92447ee942cf43cb26f492a335e0dc31d6f35 --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs @@ -0,0 +1,9350 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wrapper_benchmark_messages.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Google.Protobuf.Benchmarks { + + /// Holder for reflection information generated from wrapper_benchmark_messages.proto + public static partial class WrapperBenchmarkMessagesReflection { + + #region Descriptor + /// File descriptor for wrapper_benchmark_messages.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static WrapperBenchmarkMessagesReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiB3cmFwcGVyX2JlbmNobWFya19tZXNzYWdlcy5wcm90bxIaZ29vZ2xlLnBy", + "b3RvYnVmLmJlbmNobWFya3MaHmdvb2dsZS9wcm90b2J1Zi93cmFwcGVycy5w", + "cm90byLeLgoYTWFueVdyYXBwZXJGaWVsZHNNZXNzYWdlEjUKD2RvdWJsZV9m", + "aWVsZF85NRhfIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI0", + "Cg5kb3VibGVfZmllbGRfMRgBIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3Vi", + "bGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRfNzkYTyABKAsyHC5nb29nbGUucHJv", + "dG9idWYuRG91YmxlVmFsdWUSMgoNaW50NjRfZmllbGRfMhgCIAEoCzIbLmdv", + "b2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEjUKD2RvdWJsZV9maWVsZF85Nhhg", + "IAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRIyCg1pbnQ2NF9m", + "aWVsZF8zGAMgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSMgoN", + "aW50NjRfZmllbGRfNBgEIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZh", + "bHVlEjUKD2RvdWJsZV9maWVsZF85NxhhIAEoCzIcLmdvb2dsZS5wcm90b2J1", + "Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRfNjUYQSABKAsyHC5nb29n", + "bGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzY2GEIg", + "ASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjQKDmRvdWJsZV9m", + "aWVsZF83GAcgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjUK", + "D2RvdWJsZV9maWVsZF82Mhg+IAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3Vi", + "bGVWYWx1ZRI2ChBkb3VibGVfZmllbGRfMTE4GHYgASgLMhwuZ29vZ2xlLnBy", + "b3RvYnVmLkRvdWJsZVZhbHVlEjYKEGRvdWJsZV9maWVsZF8xMTkYdyABKAsy", + "HC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxk", + "XzY3GEMgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjYKEGRv", + "dWJsZV9maWVsZF8xMjAYeCABKAsyHC5nb29nbGUucHJvdG9idWYuRG91Ymxl", + "VmFsdWUSNgoQZG91YmxlX2ZpZWxkXzEyMRh5IAEoCzIcLmdvb2dsZS5wcm90", + "b2J1Zi5Eb3VibGVWYWx1ZRI2ChBkb3VibGVfZmllbGRfMTIyGHogASgLMhwu", + "Z29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjYKEGRvdWJsZV9maWVsZF8x", + "MjMYeyABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNgoQZG91", + "YmxlX2ZpZWxkXzEyNBh8IAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVW", + "YWx1ZRI0Cg5kb3VibGVfZmllbGRfOBgIIAEoCzIcLmdvb2dsZS5wcm90b2J1", + "Zi5Eb3VibGVWYWx1ZRI0Cg5kb3VibGVfZmllbGRfORgJIAEoCzIcLmdvb2ds", + "ZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRfOTgYYiAB", + "KAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2Zp", + "ZWxkXzEwGAogASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjUK", + "D2RvdWJsZV9maWVsZF8xMRgLIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3Vi", + "bGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRfOTkYYyABKAsyHC5nb29nbGUucHJv", + "dG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzg0GFQgASgLMhwu", + "Z29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjUKD2RvdWJsZV9maWVsZF8x", + "NBgOIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI1Cg9kb3Vi", + "bGVfZmllbGRfNzcYTSABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFs", + "dWUSNQoPZG91YmxlX2ZpZWxkXzE1GA8gASgLMhwuZ29vZ2xlLnByb3RvYnVm", + "LkRvdWJsZVZhbHVlEjMKDmludDY0X2ZpZWxkXzE5GBMgASgLMhsuZ29vZ2xl", + "LnByb3RvYnVmLkludDY0VmFsdWUSNAoPaW50NjRfZmllbGRfMTE1GHMgASgL", + "MhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSNgoQZG91YmxlX2ZpZWxk", + "XzExNhh0IAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI0Cg9p", + "bnQ2NF9maWVsZF8xMTcYdSABKAsyGy5nb29nbGUucHJvdG9idWYuSW50NjRW", + "YWx1ZRI1Cg9kb3VibGVfZmllbGRfMjAYFCABKAsyHC5nb29nbGUucHJvdG9i", + "dWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzIxGBUgASgLMhwuZ29v", + "Z2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjUKD3N0cmluZ19maWVsZF83MxhJ", + "IAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5TdHJpbmdWYWx1ZRI1Cg9zdHJpbmdf", + "ZmllbGRfNzQYSiABKAsyHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUS", + "NQoPZG91YmxlX2ZpZWxkXzIyGBYgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRv", + "dWJsZVZhbHVlEjUKD2RvdWJsZV9maWVsZF82ORhFIAEoCzIcLmdvb2dsZS5w", + "cm90b2J1Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRfNzAYRiABKAsy", + "HC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxk", + "XzcxGEcgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjUKD2Rv", + "dWJsZV9maWVsZF83MhhIIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVW", + "YWx1ZRI1Cg9kb3VibGVfZmllbGRfMjUYGSABKAsyHC5nb29nbGUucHJvdG9i", + "dWYuRG91YmxlVmFsdWUSMwoOaW50NjRfZmllbGRfMjYYGiABKAsyGy5nb29n", + "bGUucHJvdG9idWYuSW50NjRWYWx1ZRI1Cg9kb3VibGVfZmllbGRfNjgYRCAB", + "KAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2Zp", + "ZWxkXzI4GBwgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjYK", + "EGRvdWJsZV9maWVsZF8xMDYYaiABKAsyHC5nb29nbGUucHJvdG9idWYuRG91", + "YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzI5GB0gASgLMhwuZ29vZ2xlLnBy", + "b3RvYnVmLkRvdWJsZVZhbHVlEjUKD2RvdWJsZV9maWVsZF8zMBgeIAEoCzIc", + "Lmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI2ChBkb3VibGVfZmllbGRf", + "MTAxGGUgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjYKEGRv", + "dWJsZV9maWVsZF8xMDIYZiABKAsyHC5nb29nbGUucHJvdG9idWYuRG91Ymxl", + "VmFsdWUSNgoQZG91YmxlX2ZpZWxkXzEwMxhnIAEoCzIcLmdvb2dsZS5wcm90", + "b2J1Zi5Eb3VibGVWYWx1ZRI2ChBkb3VibGVfZmllbGRfMTA0GGggASgLMhwu", + "Z29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjYKEGRvdWJsZV9maWVsZF8x", + "MDUYaSABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91", + "YmxlX2ZpZWxkXzMxGB8gASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZh", + "bHVlEjMKDmludDY0X2ZpZWxkXzMyGCAgASgLMhsuZ29vZ2xlLnByb3RvYnVm", + "LkludDY0VmFsdWUSNQoPZG91YmxlX2ZpZWxkXzc1GEsgASgLMhwuZ29vZ2xl", + "LnByb3RvYnVmLkRvdWJsZVZhbHVlEjcKEGRvdWJsZV9maWVsZF8xMjkYgQEg", + "ASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEhUKDWVudW1fZmll", + "bGRfODAYUCABKAUSFQoNZW51bV9maWVsZF84MRhRIAEoBRIzCg5pbnQ2NF9m", + "aWVsZF84MhhSIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEhUK", + "DWVudW1fZmllbGRfODMYUyABKAUSMwoOaW50NjRfZmllbGRfODUYVSABKAsy", + "Gy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1ZRIzCg5pbnQ2NF9maWVsZF84", + "NhhWIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEjMKDmludDY0", + "X2ZpZWxkXzg3GFcgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUS", + "NAoPaW50NjRfZmllbGRfMTI1GH0gASgLMhsuZ29vZ2xlLnByb3RvYnVmLklu", + "dDY0VmFsdWUSMwoOaW50NjRfZmllbGRfMzcYJSABKAsyGy5nb29nbGUucHJv", + "dG9idWYuSW50NjRWYWx1ZRI1Cg9kb3VibGVfZmllbGRfMzgYJiABKAsyHC5n", + "b29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSMQoMaW50ZXJhY3Rpb25zGCcg", + "ASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSHgoWcmVwZWF0ZWRf", + "aW50X2ZpZWxkXzEwMBhkIAMoBRI1Cg9kb3VibGVfZmllbGRfNDAYKCABKAsy", + "HC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSMwoOaW50NjRfZmllbGRf", + "NDEYKSABKAsyGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1ZRI0Cg9pbnQ2", + "NF9maWVsZF8xMjYYfiABKAsyGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1", + "ZRI0Cg9pbnQ2NF9maWVsZF8xMjcYfyABKAsyGy5nb29nbGUucHJvdG9idWYu", + "SW50NjRWYWx1ZRI3ChBkb3VibGVfZmllbGRfMTI4GIABIAEoCzIcLmdvb2ds", + "ZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI2ChBkb3VibGVfZmllbGRfMTA5GG0g", + "ASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjQKD2ludDY0X2Zp", + "ZWxkXzExMBhuIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEjYK", + "EGRvdWJsZV9maWVsZF8xMTEYbyABKAsyHC5nb29nbGUucHJvdG9idWYuRG91", + "YmxlVmFsdWUSNAoPaW50NjRfZmllbGRfMTEyGHAgASgLMhsuZ29vZ2xlLnBy", + "b3RvYnVmLkludDY0VmFsdWUSNgoQZG91YmxlX2ZpZWxkXzExMxhxIAEoCzIc", + "Lmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI0Cg9pbnQ2NF9maWVsZF8x", + "MTQYciABKAsyGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1ZRI1Cg9kb3Vi", + "bGVfZmllbGRfNDIYKiABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFs", + "dWUSMwoOaW50NjRfZmllbGRfNDMYKyABKAsyGy5nb29nbGUucHJvdG9idWYu", + "SW50NjRWYWx1ZRIzCg5pbnQ2NF9maWVsZF80NBgsIAEoCzIbLmdvb2dsZS5w", + "cm90b2J1Zi5JbnQ2NFZhbHVlEjUKD2RvdWJsZV9maWVsZF80NRgtIAEoCzIc", + "Lmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRf", + "NDYYLiABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91", + "YmxlX2ZpZWxkXzc4GE4gASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZh", + "bHVlEjUKD2RvdWJsZV9maWVsZF84OBhYIAEoCzIcLmdvb2dsZS5wcm90b2J1", + "Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRfNDcYLyABKAsyHC5nb29n", + "bGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzg5GFkg", + "ASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjUKD2RvdWJsZV9m", + "aWVsZF80OBgwIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI1", + "Cg9kb3VibGVfZmllbGRfNDkYMSABKAsyHC5nb29nbGUucHJvdG9idWYuRG91", + "YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzUwGDIgASgLMhwuZ29vZ2xlLnBy", + "b3RvYnVmLkRvdWJsZVZhbHVlEjUKD2RvdWJsZV9maWVsZF85MBhaIAEoCzIc", + "Lmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRf", + "NTEYMyABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91", + "YmxlX2ZpZWxkXzkxGFsgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZh", + "bHVlEjUKD2RvdWJsZV9maWVsZF85MhhcIAEoCzIcLmdvb2dsZS5wcm90b2J1", + "Zi5Eb3VibGVWYWx1ZRI0Cg9pbnQ2NF9maWVsZF8xMDcYayABKAsyGy5nb29n", + "bGUucHJvdG9idWYuSW50NjRWYWx1ZRI1Cg9kb3VibGVfZmllbGRfOTMYXSAB", + "KAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNgoQZG91YmxlX2Zp", + "ZWxkXzEwOBhsIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI1", + "Cg9kb3VibGVfZmllbGRfNTIYNCABKAsyHC5nb29nbGUucHJvdG9idWYuRG91", + "YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzUzGDUgASgLMhwuZ29vZ2xlLnBy", + "b3RvYnVmLkRvdWJsZVZhbHVlEjUKD2RvdWJsZV9maWVsZF85NBheIAEoCzIc", + "Lmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRf", + "NTQYNiABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91", + "YmxlX2ZpZWxkXzU1GDcgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZh", + "bHVlEjUKD2RvdWJsZV9maWVsZF81Nhg4IAEoCzIcLmdvb2dsZS5wcm90b2J1", + "Zi5Eb3VibGVWYWx1ZRI1Cg9kb3VibGVfZmllbGRfNTcYOSABKAsyHC5nb29n", + "bGUucHJvdG9idWYuRG91YmxlVmFsdWUSNQoPZG91YmxlX2ZpZWxkXzU4GDog", + "ASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjMKDmludDY0X2Zp", + "ZWxkXzU5GDsgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSMwoO", + "aW50NjRfZmllbGRfNjAYPCABKAsyGy5nb29nbGUucHJvdG9idWYuSW50NjRW", + "YWx1ZSLwFQoaTWFueVByaW1pdGl2ZUZpZWxkc01lc3NhZ2USFwoPZG91Ymxl", + "X2ZpZWxkXzk1GF8gASgBEhYKDmRvdWJsZV9maWVsZF8xGAEgASgBEhcKD2Rv", + "dWJsZV9maWVsZF83ORhPIAEoARIVCg1pbnQ2NF9maWVsZF8yGAIgASgDEhcK", + "D2RvdWJsZV9maWVsZF85NhhgIAEoARIVCg1pbnQ2NF9maWVsZF8zGAMgASgD", + "EhUKDWludDY0X2ZpZWxkXzQYBCABKAMSFwoPZG91YmxlX2ZpZWxkXzk3GGEg", + "ASgBEhcKD2RvdWJsZV9maWVsZF82NRhBIAEoARIXCg9kb3VibGVfZmllbGRf", + "NjYYQiABKAESFgoOZG91YmxlX2ZpZWxkXzcYByABKAESFwoPZG91YmxlX2Zp", + "ZWxkXzYyGD4gASgBEhgKEGRvdWJsZV9maWVsZF8xMTgYdiABKAESGAoQZG91", + "YmxlX2ZpZWxkXzExORh3IAEoARIXCg9kb3VibGVfZmllbGRfNjcYQyABKAES", + "GAoQZG91YmxlX2ZpZWxkXzEyMBh4IAEoARIYChBkb3VibGVfZmllbGRfMTIx", + "GHkgASgBEhgKEGRvdWJsZV9maWVsZF8xMjIYeiABKAESGAoQZG91YmxlX2Zp", + "ZWxkXzEyMxh7IAEoARIYChBkb3VibGVfZmllbGRfMTI0GHwgASgBEhYKDmRv", + "dWJsZV9maWVsZF84GAggASgBEhYKDmRvdWJsZV9maWVsZF85GAkgASgBEhcK", + "D2RvdWJsZV9maWVsZF85OBhiIAEoARIXCg9kb3VibGVfZmllbGRfMTAYCiAB", + "KAESFwoPZG91YmxlX2ZpZWxkXzExGAsgASgBEhcKD2RvdWJsZV9maWVsZF85", + "ORhjIAEoARIXCg9kb3VibGVfZmllbGRfODQYVCABKAESFwoPZG91YmxlX2Zp", + "ZWxkXzE0GA4gASgBEhcKD2RvdWJsZV9maWVsZF83NxhNIAEoARIXCg9kb3Vi", + "bGVfZmllbGRfMTUYDyABKAESFgoOaW50NjRfZmllbGRfMTkYEyABKAMSFwoP", + "aW50NjRfZmllbGRfMTE1GHMgASgDEhgKEGRvdWJsZV9maWVsZF8xMTYYdCAB", + "KAESFwoPaW50NjRfZmllbGRfMTE3GHUgASgDEhcKD2RvdWJsZV9maWVsZF8y", + "MBgUIAEoARIXCg9kb3VibGVfZmllbGRfMjEYFSABKAESFwoPc3RyaW5nX2Zp", + "ZWxkXzczGEkgASgJEhcKD3N0cmluZ19maWVsZF83NBhKIAEoCRIXCg9kb3Vi", + "bGVfZmllbGRfMjIYFiABKAESFwoPZG91YmxlX2ZpZWxkXzY5GEUgASgBEhcK", + "D2RvdWJsZV9maWVsZF83MBhGIAEoARIXCg9kb3VibGVfZmllbGRfNzEYRyAB", + "KAESFwoPZG91YmxlX2ZpZWxkXzcyGEggASgBEhcKD2RvdWJsZV9maWVsZF8y", + "NRgZIAEoARIWCg5pbnQ2NF9maWVsZF8yNhgaIAEoAxIXCg9kb3VibGVfZmll", + "bGRfNjgYRCABKAESFwoPZG91YmxlX2ZpZWxkXzI4GBwgASgBEhgKEGRvdWJs", + "ZV9maWVsZF8xMDYYaiABKAESFwoPZG91YmxlX2ZpZWxkXzI5GB0gASgBEhcK", + "D2RvdWJsZV9maWVsZF8zMBgeIAEoARIYChBkb3VibGVfZmllbGRfMTAxGGUg", + "ASgBEhgKEGRvdWJsZV9maWVsZF8xMDIYZiABKAESGAoQZG91YmxlX2ZpZWxk", + "XzEwMxhnIAEoARIYChBkb3VibGVfZmllbGRfMTA0GGggASgBEhgKEGRvdWJs", + "ZV9maWVsZF8xMDUYaSABKAESFwoPZG91YmxlX2ZpZWxkXzMxGB8gASgBEhYK", + "DmludDY0X2ZpZWxkXzMyGCAgASgDEhcKD2RvdWJsZV9maWVsZF83NRhLIAEo", + "ARIZChBkb3VibGVfZmllbGRfMTI5GIEBIAEoARIVCg1lbnVtX2ZpZWxkXzgw", + "GFAgASgFEhUKDWVudW1fZmllbGRfODEYUSABKAUSFgoOaW50NjRfZmllbGRf", + "ODIYUiABKAMSFQoNZW51bV9maWVsZF84MxhTIAEoBRIWCg5pbnQ2NF9maWVs", + "ZF84NRhVIAEoAxIWCg5pbnQ2NF9maWVsZF84NhhWIAEoAxIWCg5pbnQ2NF9m", + "aWVsZF84NxhXIAEoAxIXCg9pbnQ2NF9maWVsZF8xMjUYfSABKAMSFgoOaW50", + "NjRfZmllbGRfMzcYJSABKAMSFwoPZG91YmxlX2ZpZWxkXzM4GCYgASgBEhQK", + "DGludGVyYWN0aW9ucxgnIAEoAxIeChZyZXBlYXRlZF9pbnRfZmllbGRfMTAw", + "GGQgAygFEhcKD2RvdWJsZV9maWVsZF80MBgoIAEoARIWCg5pbnQ2NF9maWVs", + "ZF80MRgpIAEoAxIXCg9pbnQ2NF9maWVsZF8xMjYYfiABKAMSFwoPaW50NjRf", + "ZmllbGRfMTI3GH8gASgDEhkKEGRvdWJsZV9maWVsZF8xMjgYgAEgASgBEhgK", + "EGRvdWJsZV9maWVsZF8xMDkYbSABKAESFwoPaW50NjRfZmllbGRfMTEwGG4g", + "ASgDEhgKEGRvdWJsZV9maWVsZF8xMTEYbyABKAESFwoPaW50NjRfZmllbGRf", + "MTEyGHAgASgDEhgKEGRvdWJsZV9maWVsZF8xMTMYcSABKAESFwoPaW50NjRf", + "ZmllbGRfMTE0GHIgASgDEhcKD2RvdWJsZV9maWVsZF80MhgqIAEoARIWCg5p", + "bnQ2NF9maWVsZF80MxgrIAEoAxIWCg5pbnQ2NF9maWVsZF80NBgsIAEoAxIX", + "Cg9kb3VibGVfZmllbGRfNDUYLSABKAESFwoPZG91YmxlX2ZpZWxkXzQ2GC4g", + "ASgBEhcKD2RvdWJsZV9maWVsZF83OBhOIAEoARIXCg9kb3VibGVfZmllbGRf", + "ODgYWCABKAESFwoPZG91YmxlX2ZpZWxkXzQ3GC8gASgBEhcKD2RvdWJsZV9m", + "aWVsZF84ORhZIAEoARIXCg9kb3VibGVfZmllbGRfNDgYMCABKAESFwoPZG91", + "YmxlX2ZpZWxkXzQ5GDEgASgBEhcKD2RvdWJsZV9maWVsZF81MBgyIAEoARIX", + "Cg9kb3VibGVfZmllbGRfOTAYWiABKAESFwoPZG91YmxlX2ZpZWxkXzUxGDMg", + "ASgBEhcKD2RvdWJsZV9maWVsZF85MRhbIAEoARIXCg9kb3VibGVfZmllbGRf", + "OTIYXCABKAESFwoPaW50NjRfZmllbGRfMTA3GGsgASgDEhcKD2RvdWJsZV9m", + "aWVsZF85MxhdIAEoARIYChBkb3VibGVfZmllbGRfMTA4GGwgASgBEhcKD2Rv", + "dWJsZV9maWVsZF81Mhg0IAEoARIXCg9kb3VibGVfZmllbGRfNTMYNSABKAES", + "FwoPZG91YmxlX2ZpZWxkXzk0GF4gASgBEhcKD2RvdWJsZV9maWVsZF81NBg2", + "IAEoARIXCg9kb3VibGVfZmllbGRfNTUYNyABKAESFwoPZG91YmxlX2ZpZWxk", + "XzU2GDggASgBEhcKD2RvdWJsZV9maWVsZF81Nxg5IAEoARIXCg9kb3VibGVf", + "ZmllbGRfNTgYOiABKAESFgoOaW50NjRfZmllbGRfNTkYOyABKAMSFgoOaW50", + "NjRfZmllbGRfNjAYPCABKANiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Benchmarks.ManyWrapperFieldsMessage), global::Google.Protobuf.Benchmarks.ManyWrapperFieldsMessage.Parser, new[]{ "DoubleField95", "DoubleField1", "DoubleField79", "Int64Field2", "DoubleField96", "Int64Field3", "Int64Field4", "DoubleField97", "DoubleField65", "DoubleField66", "DoubleField7", "DoubleField62", "DoubleField118", "DoubleField119", "DoubleField67", "DoubleField120", "DoubleField121", "DoubleField122", "DoubleField123", "DoubleField124", "DoubleField8", "DoubleField9", "DoubleField98", "DoubleField10", "DoubleField11", "DoubleField99", "DoubleField84", "DoubleField14", "DoubleField77", "DoubleField15", "Int64Field19", "Int64Field115", "DoubleField116", "Int64Field117", "DoubleField20", "DoubleField21", "StringField73", "StringField74", "DoubleField22", "DoubleField69", "DoubleField70", "DoubleField71", "DoubleField72", "DoubleField25", "Int64Field26", "DoubleField68", "DoubleField28", "DoubleField106", "DoubleField29", "DoubleField30", "DoubleField101", "DoubleField102", "DoubleField103", "DoubleField104", "DoubleField105", "DoubleField31", "Int64Field32", "DoubleField75", "DoubleField129", "EnumField80", "EnumField81", "Int64Field82", "EnumField83", "Int64Field85", "Int64Field86", "Int64Field87", "Int64Field125", "Int64Field37", "DoubleField38", "Interactions", "RepeatedIntField100", "DoubleField40", "Int64Field41", "Int64Field126", "Int64Field127", "DoubleField128", "DoubleField109", "Int64Field110", "DoubleField111", "Int64Field112", "DoubleField113", "Int64Field114", "DoubleField42", "Int64Field43", "Int64Field44", "DoubleField45", "DoubleField46", "DoubleField78", "DoubleField88", "DoubleField47", "DoubleField89", "DoubleField48", "DoubleField49", "DoubleField50", "DoubleField90", "DoubleField51", "DoubleField91", "DoubleField92", "Int64Field107", "DoubleField93", "DoubleField108", "DoubleField52", "DoubleField53", "DoubleField94", "DoubleField54", "DoubleField55", "DoubleField56", "DoubleField57", "DoubleField58", "Int64Field59", "Int64Field60" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Benchmarks.ManyPrimitiveFieldsMessage), global::Google.Protobuf.Benchmarks.ManyPrimitiveFieldsMessage.Parser, new[]{ "DoubleField95", "DoubleField1", "DoubleField79", "Int64Field2", "DoubleField96", "Int64Field3", "Int64Field4", "DoubleField97", "DoubleField65", "DoubleField66", "DoubleField7", "DoubleField62", "DoubleField118", "DoubleField119", "DoubleField67", "DoubleField120", "DoubleField121", "DoubleField122", "DoubleField123", "DoubleField124", "DoubleField8", "DoubleField9", "DoubleField98", "DoubleField10", "DoubleField11", "DoubleField99", "DoubleField84", "DoubleField14", "DoubleField77", "DoubleField15", "Int64Field19", "Int64Field115", "DoubleField116", "Int64Field117", "DoubleField20", "DoubleField21", "StringField73", "StringField74", "DoubleField22", "DoubleField69", "DoubleField70", "DoubleField71", "DoubleField72", "DoubleField25", "Int64Field26", "DoubleField68", "DoubleField28", "DoubleField106", "DoubleField29", "DoubleField30", "DoubleField101", "DoubleField102", "DoubleField103", "DoubleField104", "DoubleField105", "DoubleField31", "Int64Field32", "DoubleField75", "DoubleField129", "EnumField80", "EnumField81", "Int64Field82", "EnumField83", "Int64Field85", "Int64Field86", "Int64Field87", "Int64Field125", "Int64Field37", "DoubleField38", "Interactions", "RepeatedIntField100", "DoubleField40", "Int64Field41", "Int64Field126", "Int64Field127", "DoubleField128", "DoubleField109", "Int64Field110", "DoubleField111", "Int64Field112", "DoubleField113", "Int64Field114", "DoubleField42", "Int64Field43", "Int64Field44", "DoubleField45", "DoubleField46", "DoubleField78", "DoubleField88", "DoubleField47", "DoubleField89", "DoubleField48", "DoubleField49", "DoubleField50", "DoubleField90", "DoubleField51", "DoubleField91", "DoubleField92", "Int64Field107", "DoubleField93", "DoubleField108", "DoubleField52", "DoubleField53", "DoubleField94", "DoubleField54", "DoubleField55", "DoubleField56", "DoubleField57", "DoubleField58", "Int64Field59", "Int64Field60" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// a message that has a large number of wrapper fields + /// obfuscated version of an internal message + /// + public sealed partial class ManyWrapperFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyWrapperFieldsMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.Benchmarks.WrapperBenchmarkMessagesReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyWrapperFieldsMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyWrapperFieldsMessage(ManyWrapperFieldsMessage other) : this() { + DoubleField95 = other.DoubleField95; + DoubleField1 = other.DoubleField1; + DoubleField79 = other.DoubleField79; + Int64Field2 = other.Int64Field2; + DoubleField96 = other.DoubleField96; + Int64Field3 = other.Int64Field3; + Int64Field4 = other.Int64Field4; + DoubleField97 = other.DoubleField97; + DoubleField65 = other.DoubleField65; + DoubleField66 = other.DoubleField66; + DoubleField7 = other.DoubleField7; + DoubleField62 = other.DoubleField62; + DoubleField118 = other.DoubleField118; + DoubleField119 = other.DoubleField119; + DoubleField67 = other.DoubleField67; + DoubleField120 = other.DoubleField120; + DoubleField121 = other.DoubleField121; + DoubleField122 = other.DoubleField122; + DoubleField123 = other.DoubleField123; + DoubleField124 = other.DoubleField124; + DoubleField8 = other.DoubleField8; + DoubleField9 = other.DoubleField9; + DoubleField98 = other.DoubleField98; + DoubleField10 = other.DoubleField10; + DoubleField11 = other.DoubleField11; + DoubleField99 = other.DoubleField99; + DoubleField84 = other.DoubleField84; + DoubleField14 = other.DoubleField14; + DoubleField77 = other.DoubleField77; + DoubleField15 = other.DoubleField15; + Int64Field19 = other.Int64Field19; + Int64Field115 = other.Int64Field115; + DoubleField116 = other.DoubleField116; + Int64Field117 = other.Int64Field117; + DoubleField20 = other.DoubleField20; + DoubleField21 = other.DoubleField21; + StringField73 = other.StringField73; + StringField74 = other.StringField74; + DoubleField22 = other.DoubleField22; + DoubleField69 = other.DoubleField69; + DoubleField70 = other.DoubleField70; + DoubleField71 = other.DoubleField71; + DoubleField72 = other.DoubleField72; + DoubleField25 = other.DoubleField25; + Int64Field26 = other.Int64Field26; + DoubleField68 = other.DoubleField68; + DoubleField28 = other.DoubleField28; + DoubleField106 = other.DoubleField106; + DoubleField29 = other.DoubleField29; + DoubleField30 = other.DoubleField30; + DoubleField101 = other.DoubleField101; + DoubleField102 = other.DoubleField102; + DoubleField103 = other.DoubleField103; + DoubleField104 = other.DoubleField104; + DoubleField105 = other.DoubleField105; + DoubleField31 = other.DoubleField31; + Int64Field32 = other.Int64Field32; + DoubleField75 = other.DoubleField75; + DoubleField129 = other.DoubleField129; + enumField80_ = other.enumField80_; + enumField81_ = other.enumField81_; + Int64Field82 = other.Int64Field82; + enumField83_ = other.enumField83_; + Int64Field85 = other.Int64Field85; + Int64Field86 = other.Int64Field86; + Int64Field87 = other.Int64Field87; + Int64Field125 = other.Int64Field125; + Int64Field37 = other.Int64Field37; + DoubleField38 = other.DoubleField38; + Interactions = other.Interactions; + repeatedIntField100_ = other.repeatedIntField100_.Clone(); + DoubleField40 = other.DoubleField40; + Int64Field41 = other.Int64Field41; + Int64Field126 = other.Int64Field126; + Int64Field127 = other.Int64Field127; + DoubleField128 = other.DoubleField128; + DoubleField109 = other.DoubleField109; + Int64Field110 = other.Int64Field110; + DoubleField111 = other.DoubleField111; + Int64Field112 = other.Int64Field112; + DoubleField113 = other.DoubleField113; + Int64Field114 = other.Int64Field114; + DoubleField42 = other.DoubleField42; + Int64Field43 = other.Int64Field43; + Int64Field44 = other.Int64Field44; + DoubleField45 = other.DoubleField45; + DoubleField46 = other.DoubleField46; + DoubleField78 = other.DoubleField78; + DoubleField88 = other.DoubleField88; + DoubleField47 = other.DoubleField47; + DoubleField89 = other.DoubleField89; + DoubleField48 = other.DoubleField48; + DoubleField49 = other.DoubleField49; + DoubleField50 = other.DoubleField50; + DoubleField90 = other.DoubleField90; + DoubleField51 = other.DoubleField51; + DoubleField91 = other.DoubleField91; + DoubleField92 = other.DoubleField92; + Int64Field107 = other.Int64Field107; + DoubleField93 = other.DoubleField93; + DoubleField108 = other.DoubleField108; + DoubleField52 = other.DoubleField52; + DoubleField53 = other.DoubleField53; + DoubleField94 = other.DoubleField94; + DoubleField54 = other.DoubleField54; + DoubleField55 = other.DoubleField55; + DoubleField56 = other.DoubleField56; + DoubleField57 = other.DoubleField57; + DoubleField58 = other.DoubleField58; + Int64Field59 = other.Int64Field59; + Int64Field60 = other.Int64Field60; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyWrapperFieldsMessage Clone() { + return new ManyWrapperFieldsMessage(this); + } + + /// Field number for the "double_field_95" field. + public const int DoubleField95FieldNumber = 95; + private static readonly pb::FieldCodec _single_doubleField95_codec = pb::FieldCodec.ForStructWrapper(762); + private double? doubleField95_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField95 { + get { return doubleField95_; } + set { + doubleField95_ = value; + } + } + + + /// Field number for the "double_field_1" field. + public const int DoubleField1FieldNumber = 1; + private static readonly pb::FieldCodec _single_doubleField1_codec = pb::FieldCodec.ForStructWrapper(10); + private double? doubleField1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField1 { + get { return doubleField1_; } + set { + doubleField1_ = value; + } + } + + + /// Field number for the "double_field_79" field. + public const int DoubleField79FieldNumber = 79; + private static readonly pb::FieldCodec _single_doubleField79_codec = pb::FieldCodec.ForStructWrapper(634); + private double? doubleField79_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField79 { + get { return doubleField79_; } + set { + doubleField79_ = value; + } + } + + + /// Field number for the "int64_field_2" field. + public const int Int64Field2FieldNumber = 2; + private static readonly pb::FieldCodec _single_int64Field2_codec = pb::FieldCodec.ForStructWrapper(18); + private long? int64Field2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field2 { + get { return int64Field2_; } + set { + int64Field2_ = value; + } + } + + + /// Field number for the "double_field_96" field. + public const int DoubleField96FieldNumber = 96; + private static readonly pb::FieldCodec _single_doubleField96_codec = pb::FieldCodec.ForStructWrapper(770); + private double? doubleField96_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField96 { + get { return doubleField96_; } + set { + doubleField96_ = value; + } + } + + + /// Field number for the "int64_field_3" field. + public const int Int64Field3FieldNumber = 3; + private static readonly pb::FieldCodec _single_int64Field3_codec = pb::FieldCodec.ForStructWrapper(26); + private long? int64Field3_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field3 { + get { return int64Field3_; } + set { + int64Field3_ = value; + } + } + + + /// Field number for the "int64_field_4" field. + public const int Int64Field4FieldNumber = 4; + private static readonly pb::FieldCodec _single_int64Field4_codec = pb::FieldCodec.ForStructWrapper(34); + private long? int64Field4_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field4 { + get { return int64Field4_; } + set { + int64Field4_ = value; + } + } + + + /// Field number for the "double_field_97" field. + public const int DoubleField97FieldNumber = 97; + private static readonly pb::FieldCodec _single_doubleField97_codec = pb::FieldCodec.ForStructWrapper(778); + private double? doubleField97_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField97 { + get { return doubleField97_; } + set { + doubleField97_ = value; + } + } + + + /// Field number for the "double_field_65" field. + public const int DoubleField65FieldNumber = 65; + private static readonly pb::FieldCodec _single_doubleField65_codec = pb::FieldCodec.ForStructWrapper(522); + private double? doubleField65_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField65 { + get { return doubleField65_; } + set { + doubleField65_ = value; + } + } + + + /// Field number for the "double_field_66" field. + public const int DoubleField66FieldNumber = 66; + private static readonly pb::FieldCodec _single_doubleField66_codec = pb::FieldCodec.ForStructWrapper(530); + private double? doubleField66_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField66 { + get { return doubleField66_; } + set { + doubleField66_ = value; + } + } + + + /// Field number for the "double_field_7" field. + public const int DoubleField7FieldNumber = 7; + private static readonly pb::FieldCodec _single_doubleField7_codec = pb::FieldCodec.ForStructWrapper(58); + private double? doubleField7_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField7 { + get { return doubleField7_; } + set { + doubleField7_ = value; + } + } + + + /// Field number for the "double_field_62" field. + public const int DoubleField62FieldNumber = 62; + private static readonly pb::FieldCodec _single_doubleField62_codec = pb::FieldCodec.ForStructWrapper(498); + private double? doubleField62_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField62 { + get { return doubleField62_; } + set { + doubleField62_ = value; + } + } + + + /// Field number for the "double_field_118" field. + public const int DoubleField118FieldNumber = 118; + private static readonly pb::FieldCodec _single_doubleField118_codec = pb::FieldCodec.ForStructWrapper(946); + private double? doubleField118_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField118 { + get { return doubleField118_; } + set { + doubleField118_ = value; + } + } + + + /// Field number for the "double_field_119" field. + public const int DoubleField119FieldNumber = 119; + private static readonly pb::FieldCodec _single_doubleField119_codec = pb::FieldCodec.ForStructWrapper(954); + private double? doubleField119_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField119 { + get { return doubleField119_; } + set { + doubleField119_ = value; + } + } + + + /// Field number for the "double_field_67" field. + public const int DoubleField67FieldNumber = 67; + private static readonly pb::FieldCodec _single_doubleField67_codec = pb::FieldCodec.ForStructWrapper(538); + private double? doubleField67_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField67 { + get { return doubleField67_; } + set { + doubleField67_ = value; + } + } + + + /// Field number for the "double_field_120" field. + public const int DoubleField120FieldNumber = 120; + private static readonly pb::FieldCodec _single_doubleField120_codec = pb::FieldCodec.ForStructWrapper(962); + private double? doubleField120_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField120 { + get { return doubleField120_; } + set { + doubleField120_ = value; + } + } + + + /// Field number for the "double_field_121" field. + public const int DoubleField121FieldNumber = 121; + private static readonly pb::FieldCodec _single_doubleField121_codec = pb::FieldCodec.ForStructWrapper(970); + private double? doubleField121_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField121 { + get { return doubleField121_; } + set { + doubleField121_ = value; + } + } + + + /// Field number for the "double_field_122" field. + public const int DoubleField122FieldNumber = 122; + private static readonly pb::FieldCodec _single_doubleField122_codec = pb::FieldCodec.ForStructWrapper(978); + private double? doubleField122_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField122 { + get { return doubleField122_; } + set { + doubleField122_ = value; + } + } + + + /// Field number for the "double_field_123" field. + public const int DoubleField123FieldNumber = 123; + private static readonly pb::FieldCodec _single_doubleField123_codec = pb::FieldCodec.ForStructWrapper(986); + private double? doubleField123_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField123 { + get { return doubleField123_; } + set { + doubleField123_ = value; + } + } + + + /// Field number for the "double_field_124" field. + public const int DoubleField124FieldNumber = 124; + private static readonly pb::FieldCodec _single_doubleField124_codec = pb::FieldCodec.ForStructWrapper(994); + private double? doubleField124_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField124 { + get { return doubleField124_; } + set { + doubleField124_ = value; + } + } + + + /// Field number for the "double_field_8" field. + public const int DoubleField8FieldNumber = 8; + private static readonly pb::FieldCodec _single_doubleField8_codec = pb::FieldCodec.ForStructWrapper(66); + private double? doubleField8_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField8 { + get { return doubleField8_; } + set { + doubleField8_ = value; + } + } + + + /// Field number for the "double_field_9" field. + public const int DoubleField9FieldNumber = 9; + private static readonly pb::FieldCodec _single_doubleField9_codec = pb::FieldCodec.ForStructWrapper(74); + private double? doubleField9_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField9 { + get { return doubleField9_; } + set { + doubleField9_ = value; + } + } + + + /// Field number for the "double_field_98" field. + public const int DoubleField98FieldNumber = 98; + private static readonly pb::FieldCodec _single_doubleField98_codec = pb::FieldCodec.ForStructWrapper(786); + private double? doubleField98_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField98 { + get { return doubleField98_; } + set { + doubleField98_ = value; + } + } + + + /// Field number for the "double_field_10" field. + public const int DoubleField10FieldNumber = 10; + private static readonly pb::FieldCodec _single_doubleField10_codec = pb::FieldCodec.ForStructWrapper(82); + private double? doubleField10_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField10 { + get { return doubleField10_; } + set { + doubleField10_ = value; + } + } + + + /// Field number for the "double_field_11" field. + public const int DoubleField11FieldNumber = 11; + private static readonly pb::FieldCodec _single_doubleField11_codec = pb::FieldCodec.ForStructWrapper(90); + private double? doubleField11_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField11 { + get { return doubleField11_; } + set { + doubleField11_ = value; + } + } + + + /// Field number for the "double_field_99" field. + public const int DoubleField99FieldNumber = 99; + private static readonly pb::FieldCodec _single_doubleField99_codec = pb::FieldCodec.ForStructWrapper(794); + private double? doubleField99_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField99 { + get { return doubleField99_; } + set { + doubleField99_ = value; + } + } + + + /// Field number for the "double_field_84" field. + public const int DoubleField84FieldNumber = 84; + private static readonly pb::FieldCodec _single_doubleField84_codec = pb::FieldCodec.ForStructWrapper(674); + private double? doubleField84_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField84 { + get { return doubleField84_; } + set { + doubleField84_ = value; + } + } + + + /// Field number for the "double_field_14" field. + public const int DoubleField14FieldNumber = 14; + private static readonly pb::FieldCodec _single_doubleField14_codec = pb::FieldCodec.ForStructWrapper(114); + private double? doubleField14_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField14 { + get { return doubleField14_; } + set { + doubleField14_ = value; + } + } + + + /// Field number for the "double_field_77" field. + public const int DoubleField77FieldNumber = 77; + private static readonly pb::FieldCodec _single_doubleField77_codec = pb::FieldCodec.ForStructWrapper(618); + private double? doubleField77_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField77 { + get { return doubleField77_; } + set { + doubleField77_ = value; + } + } + + + /// Field number for the "double_field_15" field. + public const int DoubleField15FieldNumber = 15; + private static readonly pb::FieldCodec _single_doubleField15_codec = pb::FieldCodec.ForStructWrapper(122); + private double? doubleField15_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField15 { + get { return doubleField15_; } + set { + doubleField15_ = value; + } + } + + + /// Field number for the "int64_field_19" field. + public const int Int64Field19FieldNumber = 19; + private static readonly pb::FieldCodec _single_int64Field19_codec = pb::FieldCodec.ForStructWrapper(154); + private long? int64Field19_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field19 { + get { return int64Field19_; } + set { + int64Field19_ = value; + } + } + + + /// Field number for the "int64_field_115" field. + public const int Int64Field115FieldNumber = 115; + private static readonly pb::FieldCodec _single_int64Field115_codec = pb::FieldCodec.ForStructWrapper(922); + private long? int64Field115_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field115 { + get { return int64Field115_; } + set { + int64Field115_ = value; + } + } + + + /// Field number for the "double_field_116" field. + public const int DoubleField116FieldNumber = 116; + private static readonly pb::FieldCodec _single_doubleField116_codec = pb::FieldCodec.ForStructWrapper(930); + private double? doubleField116_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField116 { + get { return doubleField116_; } + set { + doubleField116_ = value; + } + } + + + /// Field number for the "int64_field_117" field. + public const int Int64Field117FieldNumber = 117; + private static readonly pb::FieldCodec _single_int64Field117_codec = pb::FieldCodec.ForStructWrapper(938); + private long? int64Field117_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field117 { + get { return int64Field117_; } + set { + int64Field117_ = value; + } + } + + + /// Field number for the "double_field_20" field. + public const int DoubleField20FieldNumber = 20; + private static readonly pb::FieldCodec _single_doubleField20_codec = pb::FieldCodec.ForStructWrapper(162); + private double? doubleField20_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField20 { + get { return doubleField20_; } + set { + doubleField20_ = value; + } + } + + + /// Field number for the "double_field_21" field. + public const int DoubleField21FieldNumber = 21; + private static readonly pb::FieldCodec _single_doubleField21_codec = pb::FieldCodec.ForStructWrapper(170); + private double? doubleField21_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField21 { + get { return doubleField21_; } + set { + doubleField21_ = value; + } + } + + + /// Field number for the "string_field_73" field. + public const int StringField73FieldNumber = 73; + private static readonly pb::FieldCodec _single_stringField73_codec = pb::FieldCodec.ForClassWrapper(586); + private string stringField73_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StringField73 { + get { return stringField73_; } + set { + stringField73_ = value; + } + } + + + /// Field number for the "string_field_74" field. + public const int StringField74FieldNumber = 74; + private static readonly pb::FieldCodec _single_stringField74_codec = pb::FieldCodec.ForClassWrapper(594); + private string stringField74_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StringField74 { + get { return stringField74_; } + set { + stringField74_ = value; + } + } + + + /// Field number for the "double_field_22" field. + public const int DoubleField22FieldNumber = 22; + private static readonly pb::FieldCodec _single_doubleField22_codec = pb::FieldCodec.ForStructWrapper(178); + private double? doubleField22_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField22 { + get { return doubleField22_; } + set { + doubleField22_ = value; + } + } + + + /// Field number for the "double_field_69" field. + public const int DoubleField69FieldNumber = 69; + private static readonly pb::FieldCodec _single_doubleField69_codec = pb::FieldCodec.ForStructWrapper(554); + private double? doubleField69_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField69 { + get { return doubleField69_; } + set { + doubleField69_ = value; + } + } + + + /// Field number for the "double_field_70" field. + public const int DoubleField70FieldNumber = 70; + private static readonly pb::FieldCodec _single_doubleField70_codec = pb::FieldCodec.ForStructWrapper(562); + private double? doubleField70_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField70 { + get { return doubleField70_; } + set { + doubleField70_ = value; + } + } + + + /// Field number for the "double_field_71" field. + public const int DoubleField71FieldNumber = 71; + private static readonly pb::FieldCodec _single_doubleField71_codec = pb::FieldCodec.ForStructWrapper(570); + private double? doubleField71_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField71 { + get { return doubleField71_; } + set { + doubleField71_ = value; + } + } + + + /// Field number for the "double_field_72" field. + public const int DoubleField72FieldNumber = 72; + private static readonly pb::FieldCodec _single_doubleField72_codec = pb::FieldCodec.ForStructWrapper(578); + private double? doubleField72_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField72 { + get { return doubleField72_; } + set { + doubleField72_ = value; + } + } + + + /// Field number for the "double_field_25" field. + public const int DoubleField25FieldNumber = 25; + private static readonly pb::FieldCodec _single_doubleField25_codec = pb::FieldCodec.ForStructWrapper(202); + private double? doubleField25_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField25 { + get { return doubleField25_; } + set { + doubleField25_ = value; + } + } + + + /// Field number for the "int64_field_26" field. + public const int Int64Field26FieldNumber = 26; + private static readonly pb::FieldCodec _single_int64Field26_codec = pb::FieldCodec.ForStructWrapper(210); + private long? int64Field26_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field26 { + get { return int64Field26_; } + set { + int64Field26_ = value; + } + } + + + /// Field number for the "double_field_68" field. + public const int DoubleField68FieldNumber = 68; + private static readonly pb::FieldCodec _single_doubleField68_codec = pb::FieldCodec.ForStructWrapper(546); + private double? doubleField68_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField68 { + get { return doubleField68_; } + set { + doubleField68_ = value; + } + } + + + /// Field number for the "double_field_28" field. + public const int DoubleField28FieldNumber = 28; + private static readonly pb::FieldCodec _single_doubleField28_codec = pb::FieldCodec.ForStructWrapper(226); + private double? doubleField28_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField28 { + get { return doubleField28_; } + set { + doubleField28_ = value; + } + } + + + /// Field number for the "double_field_106" field. + public const int DoubleField106FieldNumber = 106; + private static readonly pb::FieldCodec _single_doubleField106_codec = pb::FieldCodec.ForStructWrapper(850); + private double? doubleField106_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField106 { + get { return doubleField106_; } + set { + doubleField106_ = value; + } + } + + + /// Field number for the "double_field_29" field. + public const int DoubleField29FieldNumber = 29; + private static readonly pb::FieldCodec _single_doubleField29_codec = pb::FieldCodec.ForStructWrapper(234); + private double? doubleField29_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField29 { + get { return doubleField29_; } + set { + doubleField29_ = value; + } + } + + + /// Field number for the "double_field_30" field. + public const int DoubleField30FieldNumber = 30; + private static readonly pb::FieldCodec _single_doubleField30_codec = pb::FieldCodec.ForStructWrapper(242); + private double? doubleField30_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField30 { + get { return doubleField30_; } + set { + doubleField30_ = value; + } + } + + + /// Field number for the "double_field_101" field. + public const int DoubleField101FieldNumber = 101; + private static readonly pb::FieldCodec _single_doubleField101_codec = pb::FieldCodec.ForStructWrapper(810); + private double? doubleField101_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField101 { + get { return doubleField101_; } + set { + doubleField101_ = value; + } + } + + + /// Field number for the "double_field_102" field. + public const int DoubleField102FieldNumber = 102; + private static readonly pb::FieldCodec _single_doubleField102_codec = pb::FieldCodec.ForStructWrapper(818); + private double? doubleField102_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField102 { + get { return doubleField102_; } + set { + doubleField102_ = value; + } + } + + + /// Field number for the "double_field_103" field. + public const int DoubleField103FieldNumber = 103; + private static readonly pb::FieldCodec _single_doubleField103_codec = pb::FieldCodec.ForStructWrapper(826); + private double? doubleField103_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField103 { + get { return doubleField103_; } + set { + doubleField103_ = value; + } + } + + + /// Field number for the "double_field_104" field. + public const int DoubleField104FieldNumber = 104; + private static readonly pb::FieldCodec _single_doubleField104_codec = pb::FieldCodec.ForStructWrapper(834); + private double? doubleField104_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField104 { + get { return doubleField104_; } + set { + doubleField104_ = value; + } + } + + + /// Field number for the "double_field_105" field. + public const int DoubleField105FieldNumber = 105; + private static readonly pb::FieldCodec _single_doubleField105_codec = pb::FieldCodec.ForStructWrapper(842); + private double? doubleField105_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField105 { + get { return doubleField105_; } + set { + doubleField105_ = value; + } + } + + + /// Field number for the "double_field_31" field. + public const int DoubleField31FieldNumber = 31; + private static readonly pb::FieldCodec _single_doubleField31_codec = pb::FieldCodec.ForStructWrapper(250); + private double? doubleField31_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField31 { + get { return doubleField31_; } + set { + doubleField31_ = value; + } + } + + + /// Field number for the "int64_field_32" field. + public const int Int64Field32FieldNumber = 32; + private static readonly pb::FieldCodec _single_int64Field32_codec = pb::FieldCodec.ForStructWrapper(258); + private long? int64Field32_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field32 { + get { return int64Field32_; } + set { + int64Field32_ = value; + } + } + + + /// Field number for the "double_field_75" field. + public const int DoubleField75FieldNumber = 75; + private static readonly pb::FieldCodec _single_doubleField75_codec = pb::FieldCodec.ForStructWrapper(602); + private double? doubleField75_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField75 { + get { return doubleField75_; } + set { + doubleField75_ = value; + } + } + + + /// Field number for the "double_field_129" field. + public const int DoubleField129FieldNumber = 129; + private static readonly pb::FieldCodec _single_doubleField129_codec = pb::FieldCodec.ForStructWrapper(1034); + private double? doubleField129_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField129 { + get { return doubleField129_; } + set { + doubleField129_ = value; + } + } + + + /// Field number for the "enum_field_80" field. + public const int EnumField80FieldNumber = 80; + private int enumField80_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int EnumField80 { + get { return enumField80_; } + set { + enumField80_ = value; + } + } + + /// Field number for the "enum_field_81" field. + public const int EnumField81FieldNumber = 81; + private int enumField81_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int EnumField81 { + get { return enumField81_; } + set { + enumField81_ = value; + } + } + + /// Field number for the "int64_field_82" field. + public const int Int64Field82FieldNumber = 82; + private static readonly pb::FieldCodec _single_int64Field82_codec = pb::FieldCodec.ForStructWrapper(658); + private long? int64Field82_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field82 { + get { return int64Field82_; } + set { + int64Field82_ = value; + } + } + + + /// Field number for the "enum_field_83" field. + public const int EnumField83FieldNumber = 83; + private int enumField83_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int EnumField83 { + get { return enumField83_; } + set { + enumField83_ = value; + } + } + + /// Field number for the "int64_field_85" field. + public const int Int64Field85FieldNumber = 85; + private static readonly pb::FieldCodec _single_int64Field85_codec = pb::FieldCodec.ForStructWrapper(682); + private long? int64Field85_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field85 { + get { return int64Field85_; } + set { + int64Field85_ = value; + } + } + + + /// Field number for the "int64_field_86" field. + public const int Int64Field86FieldNumber = 86; + private static readonly pb::FieldCodec _single_int64Field86_codec = pb::FieldCodec.ForStructWrapper(690); + private long? int64Field86_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field86 { + get { return int64Field86_; } + set { + int64Field86_ = value; + } + } + + + /// Field number for the "int64_field_87" field. + public const int Int64Field87FieldNumber = 87; + private static readonly pb::FieldCodec _single_int64Field87_codec = pb::FieldCodec.ForStructWrapper(698); + private long? int64Field87_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field87 { + get { return int64Field87_; } + set { + int64Field87_ = value; + } + } + + + /// Field number for the "int64_field_125" field. + public const int Int64Field125FieldNumber = 125; + private static readonly pb::FieldCodec _single_int64Field125_codec = pb::FieldCodec.ForStructWrapper(1002); + private long? int64Field125_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field125 { + get { return int64Field125_; } + set { + int64Field125_ = value; + } + } + + + /// Field number for the "int64_field_37" field. + public const int Int64Field37FieldNumber = 37; + private static readonly pb::FieldCodec _single_int64Field37_codec = pb::FieldCodec.ForStructWrapper(298); + private long? int64Field37_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field37 { + get { return int64Field37_; } + set { + int64Field37_ = value; + } + } + + + /// Field number for the "double_field_38" field. + public const int DoubleField38FieldNumber = 38; + private static readonly pb::FieldCodec _single_doubleField38_codec = pb::FieldCodec.ForStructWrapper(306); + private double? doubleField38_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField38 { + get { return doubleField38_; } + set { + doubleField38_ = value; + } + } + + + /// Field number for the "interactions" field. + public const int InteractionsFieldNumber = 39; + private static readonly pb::FieldCodec _single_interactions_codec = pb::FieldCodec.ForStructWrapper(314); + private long? interactions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Interactions { + get { return interactions_; } + set { + interactions_ = value; + } + } + + + /// Field number for the "repeated_int_field_100" field. + public const int RepeatedIntField100FieldNumber = 100; + private static readonly pb::FieldCodec _repeated_repeatedIntField100_codec + = pb::FieldCodec.ForInt32(802); + private readonly pbc::RepeatedField repeatedIntField100_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField RepeatedIntField100 { + get { return repeatedIntField100_; } + } + + /// Field number for the "double_field_40" field. + public const int DoubleField40FieldNumber = 40; + private static readonly pb::FieldCodec _single_doubleField40_codec = pb::FieldCodec.ForStructWrapper(322); + private double? doubleField40_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField40 { + get { return doubleField40_; } + set { + doubleField40_ = value; + } + } + + + /// Field number for the "int64_field_41" field. + public const int Int64Field41FieldNumber = 41; + private static readonly pb::FieldCodec _single_int64Field41_codec = pb::FieldCodec.ForStructWrapper(330); + private long? int64Field41_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field41 { + get { return int64Field41_; } + set { + int64Field41_ = value; + } + } + + + /// Field number for the "int64_field_126" field. + public const int Int64Field126FieldNumber = 126; + private static readonly pb::FieldCodec _single_int64Field126_codec = pb::FieldCodec.ForStructWrapper(1010); + private long? int64Field126_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field126 { + get { return int64Field126_; } + set { + int64Field126_ = value; + } + } + + + /// Field number for the "int64_field_127" field. + public const int Int64Field127FieldNumber = 127; + private static readonly pb::FieldCodec _single_int64Field127_codec = pb::FieldCodec.ForStructWrapper(1018); + private long? int64Field127_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field127 { + get { return int64Field127_; } + set { + int64Field127_ = value; + } + } + + + /// Field number for the "double_field_128" field. + public const int DoubleField128FieldNumber = 128; + private static readonly pb::FieldCodec _single_doubleField128_codec = pb::FieldCodec.ForStructWrapper(1026); + private double? doubleField128_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField128 { + get { return doubleField128_; } + set { + doubleField128_ = value; + } + } + + + /// Field number for the "double_field_109" field. + public const int DoubleField109FieldNumber = 109; + private static readonly pb::FieldCodec _single_doubleField109_codec = pb::FieldCodec.ForStructWrapper(874); + private double? doubleField109_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField109 { + get { return doubleField109_; } + set { + doubleField109_ = value; + } + } + + + /// Field number for the "int64_field_110" field. + public const int Int64Field110FieldNumber = 110; + private static readonly pb::FieldCodec _single_int64Field110_codec = pb::FieldCodec.ForStructWrapper(882); + private long? int64Field110_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field110 { + get { return int64Field110_; } + set { + int64Field110_ = value; + } + } + + + /// Field number for the "double_field_111" field. + public const int DoubleField111FieldNumber = 111; + private static readonly pb::FieldCodec _single_doubleField111_codec = pb::FieldCodec.ForStructWrapper(890); + private double? doubleField111_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField111 { + get { return doubleField111_; } + set { + doubleField111_ = value; + } + } + + + /// Field number for the "int64_field_112" field. + public const int Int64Field112FieldNumber = 112; + private static readonly pb::FieldCodec _single_int64Field112_codec = pb::FieldCodec.ForStructWrapper(898); + private long? int64Field112_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field112 { + get { return int64Field112_; } + set { + int64Field112_ = value; + } + } + + + /// Field number for the "double_field_113" field. + public const int DoubleField113FieldNumber = 113; + private static readonly pb::FieldCodec _single_doubleField113_codec = pb::FieldCodec.ForStructWrapper(906); + private double? doubleField113_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField113 { + get { return doubleField113_; } + set { + doubleField113_ = value; + } + } + + + /// Field number for the "int64_field_114" field. + public const int Int64Field114FieldNumber = 114; + private static readonly pb::FieldCodec _single_int64Field114_codec = pb::FieldCodec.ForStructWrapper(914); + private long? int64Field114_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field114 { + get { return int64Field114_; } + set { + int64Field114_ = value; + } + } + + + /// Field number for the "double_field_42" field. + public const int DoubleField42FieldNumber = 42; + private static readonly pb::FieldCodec _single_doubleField42_codec = pb::FieldCodec.ForStructWrapper(338); + private double? doubleField42_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField42 { + get { return doubleField42_; } + set { + doubleField42_ = value; + } + } + + + /// Field number for the "int64_field_43" field. + public const int Int64Field43FieldNumber = 43; + private static readonly pb::FieldCodec _single_int64Field43_codec = pb::FieldCodec.ForStructWrapper(346); + private long? int64Field43_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field43 { + get { return int64Field43_; } + set { + int64Field43_ = value; + } + } + + + /// Field number for the "int64_field_44" field. + public const int Int64Field44FieldNumber = 44; + private static readonly pb::FieldCodec _single_int64Field44_codec = pb::FieldCodec.ForStructWrapper(354); + private long? int64Field44_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field44 { + get { return int64Field44_; } + set { + int64Field44_ = value; + } + } + + + /// Field number for the "double_field_45" field. + public const int DoubleField45FieldNumber = 45; + private static readonly pb::FieldCodec _single_doubleField45_codec = pb::FieldCodec.ForStructWrapper(362); + private double? doubleField45_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField45 { + get { return doubleField45_; } + set { + doubleField45_ = value; + } + } + + + /// Field number for the "double_field_46" field. + public const int DoubleField46FieldNumber = 46; + private static readonly pb::FieldCodec _single_doubleField46_codec = pb::FieldCodec.ForStructWrapper(370); + private double? doubleField46_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField46 { + get { return doubleField46_; } + set { + doubleField46_ = value; + } + } + + + /// Field number for the "double_field_78" field. + public const int DoubleField78FieldNumber = 78; + private static readonly pb::FieldCodec _single_doubleField78_codec = pb::FieldCodec.ForStructWrapper(626); + private double? doubleField78_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField78 { + get { return doubleField78_; } + set { + doubleField78_ = value; + } + } + + + /// Field number for the "double_field_88" field. + public const int DoubleField88FieldNumber = 88; + private static readonly pb::FieldCodec _single_doubleField88_codec = pb::FieldCodec.ForStructWrapper(706); + private double? doubleField88_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField88 { + get { return doubleField88_; } + set { + doubleField88_ = value; + } + } + + + /// Field number for the "double_field_47" field. + public const int DoubleField47FieldNumber = 47; + private static readonly pb::FieldCodec _single_doubleField47_codec = pb::FieldCodec.ForStructWrapper(378); + private double? doubleField47_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField47 { + get { return doubleField47_; } + set { + doubleField47_ = value; + } + } + + + /// Field number for the "double_field_89" field. + public const int DoubleField89FieldNumber = 89; + private static readonly pb::FieldCodec _single_doubleField89_codec = pb::FieldCodec.ForStructWrapper(714); + private double? doubleField89_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField89 { + get { return doubleField89_; } + set { + doubleField89_ = value; + } + } + + + /// Field number for the "double_field_48" field. + public const int DoubleField48FieldNumber = 48; + private static readonly pb::FieldCodec _single_doubleField48_codec = pb::FieldCodec.ForStructWrapper(386); + private double? doubleField48_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField48 { + get { return doubleField48_; } + set { + doubleField48_ = value; + } + } + + + /// Field number for the "double_field_49" field. + public const int DoubleField49FieldNumber = 49; + private static readonly pb::FieldCodec _single_doubleField49_codec = pb::FieldCodec.ForStructWrapper(394); + private double? doubleField49_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField49 { + get { return doubleField49_; } + set { + doubleField49_ = value; + } + } + + + /// Field number for the "double_field_50" field. + public const int DoubleField50FieldNumber = 50; + private static readonly pb::FieldCodec _single_doubleField50_codec = pb::FieldCodec.ForStructWrapper(402); + private double? doubleField50_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField50 { + get { return doubleField50_; } + set { + doubleField50_ = value; + } + } + + + /// Field number for the "double_field_90" field. + public const int DoubleField90FieldNumber = 90; + private static readonly pb::FieldCodec _single_doubleField90_codec = pb::FieldCodec.ForStructWrapper(722); + private double? doubleField90_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField90 { + get { return doubleField90_; } + set { + doubleField90_ = value; + } + } + + + /// Field number for the "double_field_51" field. + public const int DoubleField51FieldNumber = 51; + private static readonly pb::FieldCodec _single_doubleField51_codec = pb::FieldCodec.ForStructWrapper(410); + private double? doubleField51_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField51 { + get { return doubleField51_; } + set { + doubleField51_ = value; + } + } + + + /// Field number for the "double_field_91" field. + public const int DoubleField91FieldNumber = 91; + private static readonly pb::FieldCodec _single_doubleField91_codec = pb::FieldCodec.ForStructWrapper(730); + private double? doubleField91_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField91 { + get { return doubleField91_; } + set { + doubleField91_ = value; + } + } + + + /// Field number for the "double_field_92" field. + public const int DoubleField92FieldNumber = 92; + private static readonly pb::FieldCodec _single_doubleField92_codec = pb::FieldCodec.ForStructWrapper(738); + private double? doubleField92_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField92 { + get { return doubleField92_; } + set { + doubleField92_ = value; + } + } + + + /// Field number for the "int64_field_107" field. + public const int Int64Field107FieldNumber = 107; + private static readonly pb::FieldCodec _single_int64Field107_codec = pb::FieldCodec.ForStructWrapper(858); + private long? int64Field107_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field107 { + get { return int64Field107_; } + set { + int64Field107_ = value; + } + } + + + /// Field number for the "double_field_93" field. + public const int DoubleField93FieldNumber = 93; + private static readonly pb::FieldCodec _single_doubleField93_codec = pb::FieldCodec.ForStructWrapper(746); + private double? doubleField93_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField93 { + get { return doubleField93_; } + set { + doubleField93_ = value; + } + } + + + /// Field number for the "double_field_108" field. + public const int DoubleField108FieldNumber = 108; + private static readonly pb::FieldCodec _single_doubleField108_codec = pb::FieldCodec.ForStructWrapper(866); + private double? doubleField108_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField108 { + get { return doubleField108_; } + set { + doubleField108_ = value; + } + } + + + /// Field number for the "double_field_52" field. + public const int DoubleField52FieldNumber = 52; + private static readonly pb::FieldCodec _single_doubleField52_codec = pb::FieldCodec.ForStructWrapper(418); + private double? doubleField52_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField52 { + get { return doubleField52_; } + set { + doubleField52_ = value; + } + } + + + /// Field number for the "double_field_53" field. + public const int DoubleField53FieldNumber = 53; + private static readonly pb::FieldCodec _single_doubleField53_codec = pb::FieldCodec.ForStructWrapper(426); + private double? doubleField53_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField53 { + get { return doubleField53_; } + set { + doubleField53_ = value; + } + } + + + /// Field number for the "double_field_94" field. + public const int DoubleField94FieldNumber = 94; + private static readonly pb::FieldCodec _single_doubleField94_codec = pb::FieldCodec.ForStructWrapper(754); + private double? doubleField94_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField94 { + get { return doubleField94_; } + set { + doubleField94_ = value; + } + } + + + /// Field number for the "double_field_54" field. + public const int DoubleField54FieldNumber = 54; + private static readonly pb::FieldCodec _single_doubleField54_codec = pb::FieldCodec.ForStructWrapper(434); + private double? doubleField54_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField54 { + get { return doubleField54_; } + set { + doubleField54_ = value; + } + } + + + /// Field number for the "double_field_55" field. + public const int DoubleField55FieldNumber = 55; + private static readonly pb::FieldCodec _single_doubleField55_codec = pb::FieldCodec.ForStructWrapper(442); + private double? doubleField55_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField55 { + get { return doubleField55_; } + set { + doubleField55_ = value; + } + } + + + /// Field number for the "double_field_56" field. + public const int DoubleField56FieldNumber = 56; + private static readonly pb::FieldCodec _single_doubleField56_codec = pb::FieldCodec.ForStructWrapper(450); + private double? doubleField56_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField56 { + get { return doubleField56_; } + set { + doubleField56_ = value; + } + } + + + /// Field number for the "double_field_57" field. + public const int DoubleField57FieldNumber = 57; + private static readonly pb::FieldCodec _single_doubleField57_codec = pb::FieldCodec.ForStructWrapper(458); + private double? doubleField57_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField57 { + get { return doubleField57_; } + set { + doubleField57_ = value; + } + } + + + /// Field number for the "double_field_58" field. + public const int DoubleField58FieldNumber = 58; + private static readonly pb::FieldCodec _single_doubleField58_codec = pb::FieldCodec.ForStructWrapper(466); + private double? doubleField58_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double? DoubleField58 { + get { return doubleField58_; } + set { + doubleField58_ = value; + } + } + + + /// Field number for the "int64_field_59" field. + public const int Int64Field59FieldNumber = 59; + private static readonly pb::FieldCodec _single_int64Field59_codec = pb::FieldCodec.ForStructWrapper(474); + private long? int64Field59_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field59 { + get { return int64Field59_; } + set { + int64Field59_ = value; + } + } + + + /// Field number for the "int64_field_60" field. + public const int Int64Field60FieldNumber = 60; + private static readonly pb::FieldCodec _single_int64Field60_codec = pb::FieldCodec.ForStructWrapper(482); + private long? int64Field60_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long? Int64Field60 { + get { return int64Field60_; } + set { + int64Field60_ = value; + } + } + + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ManyWrapperFieldsMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ManyWrapperFieldsMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField95, other.DoubleField95)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField1, other.DoubleField1)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField79, other.DoubleField79)) return false; + if (Int64Field2 != other.Int64Field2) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField96, other.DoubleField96)) return false; + if (Int64Field3 != other.Int64Field3) return false; + if (Int64Field4 != other.Int64Field4) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField97, other.DoubleField97)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField65, other.DoubleField65)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField66, other.DoubleField66)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField7, other.DoubleField7)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField62, other.DoubleField62)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField118, other.DoubleField118)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField119, other.DoubleField119)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField67, other.DoubleField67)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField120, other.DoubleField120)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField121, other.DoubleField121)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField122, other.DoubleField122)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField123, other.DoubleField123)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField124, other.DoubleField124)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField8, other.DoubleField8)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField9, other.DoubleField9)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField98, other.DoubleField98)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField10, other.DoubleField10)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField11, other.DoubleField11)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField99, other.DoubleField99)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField84, other.DoubleField84)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField14, other.DoubleField14)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField77, other.DoubleField77)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField15, other.DoubleField15)) return false; + if (Int64Field19 != other.Int64Field19) return false; + if (Int64Field115 != other.Int64Field115) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField116, other.DoubleField116)) return false; + if (Int64Field117 != other.Int64Field117) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField20, other.DoubleField20)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField21, other.DoubleField21)) return false; + if (StringField73 != other.StringField73) return false; + if (StringField74 != other.StringField74) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField22, other.DoubleField22)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField69, other.DoubleField69)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField70, other.DoubleField70)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField71, other.DoubleField71)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField72, other.DoubleField72)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField25, other.DoubleField25)) return false; + if (Int64Field26 != other.Int64Field26) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField68, other.DoubleField68)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField28, other.DoubleField28)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField106, other.DoubleField106)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField29, other.DoubleField29)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField30, other.DoubleField30)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField101, other.DoubleField101)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField102, other.DoubleField102)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField103, other.DoubleField103)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField104, other.DoubleField104)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField105, other.DoubleField105)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField31, other.DoubleField31)) return false; + if (Int64Field32 != other.Int64Field32) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField75, other.DoubleField75)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField129, other.DoubleField129)) return false; + if (EnumField80 != other.EnumField80) return false; + if (EnumField81 != other.EnumField81) return false; + if (Int64Field82 != other.Int64Field82) return false; + if (EnumField83 != other.EnumField83) return false; + if (Int64Field85 != other.Int64Field85) return false; + if (Int64Field86 != other.Int64Field86) return false; + if (Int64Field87 != other.Int64Field87) return false; + if (Int64Field125 != other.Int64Field125) return false; + if (Int64Field37 != other.Int64Field37) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField38, other.DoubleField38)) return false; + if (Interactions != other.Interactions) return false; + if(!repeatedIntField100_.Equals(other.repeatedIntField100_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField40, other.DoubleField40)) return false; + if (Int64Field41 != other.Int64Field41) return false; + if (Int64Field126 != other.Int64Field126) return false; + if (Int64Field127 != other.Int64Field127) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField128, other.DoubleField128)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField109, other.DoubleField109)) return false; + if (Int64Field110 != other.Int64Field110) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField111, other.DoubleField111)) return false; + if (Int64Field112 != other.Int64Field112) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField113, other.DoubleField113)) return false; + if (Int64Field114 != other.Int64Field114) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField42, other.DoubleField42)) return false; + if (Int64Field43 != other.Int64Field43) return false; + if (Int64Field44 != other.Int64Field44) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField45, other.DoubleField45)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField46, other.DoubleField46)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField78, other.DoubleField78)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField88, other.DoubleField88)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField47, other.DoubleField47)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField89, other.DoubleField89)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField48, other.DoubleField48)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField49, other.DoubleField49)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField50, other.DoubleField50)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField90, other.DoubleField90)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField51, other.DoubleField51)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField91, other.DoubleField91)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField92, other.DoubleField92)) return false; + if (Int64Field107 != other.Int64Field107) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField93, other.DoubleField93)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField108, other.DoubleField108)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField52, other.DoubleField52)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField53, other.DoubleField53)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField94, other.DoubleField94)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField54, other.DoubleField54)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField55, other.DoubleField55)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField56, other.DoubleField56)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField57, other.DoubleField57)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals(DoubleField58, other.DoubleField58)) return false; + if (Int64Field59 != other.Int64Field59) return false; + if (Int64Field60 != other.Int64Field60) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (doubleField95_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField95); + if (doubleField1_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField1); + if (doubleField79_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField79); + if (int64Field2_ != null) hash ^= Int64Field2.GetHashCode(); + if (doubleField96_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField96); + if (int64Field3_ != null) hash ^= Int64Field3.GetHashCode(); + if (int64Field4_ != null) hash ^= Int64Field4.GetHashCode(); + if (doubleField97_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField97); + if (doubleField65_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField65); + if (doubleField66_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField66); + if (doubleField7_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField7); + if (doubleField62_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField62); + if (doubleField118_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField118); + if (doubleField119_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField119); + if (doubleField67_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField67); + if (doubleField120_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField120); + if (doubleField121_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField121); + if (doubleField122_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField122); + if (doubleField123_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField123); + if (doubleField124_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField124); + if (doubleField8_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField8); + if (doubleField9_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField9); + if (doubleField98_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField98); + if (doubleField10_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField10); + if (doubleField11_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField11); + if (doubleField99_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField99); + if (doubleField84_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField84); + if (doubleField14_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField14); + if (doubleField77_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField77); + if (doubleField15_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField15); + if (int64Field19_ != null) hash ^= Int64Field19.GetHashCode(); + if (int64Field115_ != null) hash ^= Int64Field115.GetHashCode(); + if (doubleField116_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField116); + if (int64Field117_ != null) hash ^= Int64Field117.GetHashCode(); + if (doubleField20_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField20); + if (doubleField21_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField21); + if (stringField73_ != null) hash ^= StringField73.GetHashCode(); + if (stringField74_ != null) hash ^= StringField74.GetHashCode(); + if (doubleField22_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField22); + if (doubleField69_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField69); + if (doubleField70_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField70); + if (doubleField71_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField71); + if (doubleField72_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField72); + if (doubleField25_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField25); + if (int64Field26_ != null) hash ^= Int64Field26.GetHashCode(); + if (doubleField68_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField68); + if (doubleField28_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField28); + if (doubleField106_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField106); + if (doubleField29_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField29); + if (doubleField30_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField30); + if (doubleField101_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField101); + if (doubleField102_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField102); + if (doubleField103_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField103); + if (doubleField104_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField104); + if (doubleField105_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField105); + if (doubleField31_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField31); + if (int64Field32_ != null) hash ^= Int64Field32.GetHashCode(); + if (doubleField75_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField75); + if (doubleField129_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField129); + if (EnumField80 != 0) hash ^= EnumField80.GetHashCode(); + if (EnumField81 != 0) hash ^= EnumField81.GetHashCode(); + if (int64Field82_ != null) hash ^= Int64Field82.GetHashCode(); + if (EnumField83 != 0) hash ^= EnumField83.GetHashCode(); + if (int64Field85_ != null) hash ^= Int64Field85.GetHashCode(); + if (int64Field86_ != null) hash ^= Int64Field86.GetHashCode(); + if (int64Field87_ != null) hash ^= Int64Field87.GetHashCode(); + if (int64Field125_ != null) hash ^= Int64Field125.GetHashCode(); + if (int64Field37_ != null) hash ^= Int64Field37.GetHashCode(); + if (doubleField38_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField38); + if (interactions_ != null) hash ^= Interactions.GetHashCode(); + hash ^= repeatedIntField100_.GetHashCode(); + if (doubleField40_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField40); + if (int64Field41_ != null) hash ^= Int64Field41.GetHashCode(); + if (int64Field126_ != null) hash ^= Int64Field126.GetHashCode(); + if (int64Field127_ != null) hash ^= Int64Field127.GetHashCode(); + if (doubleField128_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField128); + if (doubleField109_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField109); + if (int64Field110_ != null) hash ^= Int64Field110.GetHashCode(); + if (doubleField111_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField111); + if (int64Field112_ != null) hash ^= Int64Field112.GetHashCode(); + if (doubleField113_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField113); + if (int64Field114_ != null) hash ^= Int64Field114.GetHashCode(); + if (doubleField42_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField42); + if (int64Field43_ != null) hash ^= Int64Field43.GetHashCode(); + if (int64Field44_ != null) hash ^= Int64Field44.GetHashCode(); + if (doubleField45_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField45); + if (doubleField46_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField46); + if (doubleField78_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField78); + if (doubleField88_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField88); + if (doubleField47_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField47); + if (doubleField89_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField89); + if (doubleField48_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField48); + if (doubleField49_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField49); + if (doubleField50_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField50); + if (doubleField90_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField90); + if (doubleField51_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField51); + if (doubleField91_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField91); + if (doubleField92_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField92); + if (int64Field107_ != null) hash ^= Int64Field107.GetHashCode(); + if (doubleField93_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField93); + if (doubleField108_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField108); + if (doubleField52_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField52); + if (doubleField53_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField53); + if (doubleField94_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField94); + if (doubleField54_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField54); + if (doubleField55_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField55); + if (doubleField56_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField56); + if (doubleField57_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField57); + if (doubleField58_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField58); + if (int64Field59_ != null) hash ^= Int64Field59.GetHashCode(); + if (int64Field60_ != null) hash ^= Int64Field60.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (doubleField1_ != null) { + _single_doubleField1_codec.WriteTagAndValue(output, DoubleField1); + } + if (int64Field2_ != null) { + _single_int64Field2_codec.WriteTagAndValue(output, Int64Field2); + } + if (int64Field3_ != null) { + _single_int64Field3_codec.WriteTagAndValue(output, Int64Field3); + } + if (int64Field4_ != null) { + _single_int64Field4_codec.WriteTagAndValue(output, Int64Field4); + } + if (doubleField7_ != null) { + _single_doubleField7_codec.WriteTagAndValue(output, DoubleField7); + } + if (doubleField8_ != null) { + _single_doubleField8_codec.WriteTagAndValue(output, DoubleField8); + } + if (doubleField9_ != null) { + _single_doubleField9_codec.WriteTagAndValue(output, DoubleField9); + } + if (doubleField10_ != null) { + _single_doubleField10_codec.WriteTagAndValue(output, DoubleField10); + } + if (doubleField11_ != null) { + _single_doubleField11_codec.WriteTagAndValue(output, DoubleField11); + } + if (doubleField14_ != null) { + _single_doubleField14_codec.WriteTagAndValue(output, DoubleField14); + } + if (doubleField15_ != null) { + _single_doubleField15_codec.WriteTagAndValue(output, DoubleField15); + } + if (int64Field19_ != null) { + _single_int64Field19_codec.WriteTagAndValue(output, Int64Field19); + } + if (doubleField20_ != null) { + _single_doubleField20_codec.WriteTagAndValue(output, DoubleField20); + } + if (doubleField21_ != null) { + _single_doubleField21_codec.WriteTagAndValue(output, DoubleField21); + } + if (doubleField22_ != null) { + _single_doubleField22_codec.WriteTagAndValue(output, DoubleField22); + } + if (doubleField25_ != null) { + _single_doubleField25_codec.WriteTagAndValue(output, DoubleField25); + } + if (int64Field26_ != null) { + _single_int64Field26_codec.WriteTagAndValue(output, Int64Field26); + } + if (doubleField28_ != null) { + _single_doubleField28_codec.WriteTagAndValue(output, DoubleField28); + } + if (doubleField29_ != null) { + _single_doubleField29_codec.WriteTagAndValue(output, DoubleField29); + } + if (doubleField30_ != null) { + _single_doubleField30_codec.WriteTagAndValue(output, DoubleField30); + } + if (doubleField31_ != null) { + _single_doubleField31_codec.WriteTagAndValue(output, DoubleField31); + } + if (int64Field32_ != null) { + _single_int64Field32_codec.WriteTagAndValue(output, Int64Field32); + } + if (int64Field37_ != null) { + _single_int64Field37_codec.WriteTagAndValue(output, Int64Field37); + } + if (doubleField38_ != null) { + _single_doubleField38_codec.WriteTagAndValue(output, DoubleField38); + } + if (interactions_ != null) { + _single_interactions_codec.WriteTagAndValue(output, Interactions); + } + if (doubleField40_ != null) { + _single_doubleField40_codec.WriteTagAndValue(output, DoubleField40); + } + if (int64Field41_ != null) { + _single_int64Field41_codec.WriteTagAndValue(output, Int64Field41); + } + if (doubleField42_ != null) { + _single_doubleField42_codec.WriteTagAndValue(output, DoubleField42); + } + if (int64Field43_ != null) { + _single_int64Field43_codec.WriteTagAndValue(output, Int64Field43); + } + if (int64Field44_ != null) { + _single_int64Field44_codec.WriteTagAndValue(output, Int64Field44); + } + if (doubleField45_ != null) { + _single_doubleField45_codec.WriteTagAndValue(output, DoubleField45); + } + if (doubleField46_ != null) { + _single_doubleField46_codec.WriteTagAndValue(output, DoubleField46); + } + if (doubleField47_ != null) { + _single_doubleField47_codec.WriteTagAndValue(output, DoubleField47); + } + if (doubleField48_ != null) { + _single_doubleField48_codec.WriteTagAndValue(output, DoubleField48); + } + if (doubleField49_ != null) { + _single_doubleField49_codec.WriteTagAndValue(output, DoubleField49); + } + if (doubleField50_ != null) { + _single_doubleField50_codec.WriteTagAndValue(output, DoubleField50); + } + if (doubleField51_ != null) { + _single_doubleField51_codec.WriteTagAndValue(output, DoubleField51); + } + if (doubleField52_ != null) { + _single_doubleField52_codec.WriteTagAndValue(output, DoubleField52); + } + if (doubleField53_ != null) { + _single_doubleField53_codec.WriteTagAndValue(output, DoubleField53); + } + if (doubleField54_ != null) { + _single_doubleField54_codec.WriteTagAndValue(output, DoubleField54); + } + if (doubleField55_ != null) { + _single_doubleField55_codec.WriteTagAndValue(output, DoubleField55); + } + if (doubleField56_ != null) { + _single_doubleField56_codec.WriteTagAndValue(output, DoubleField56); + } + if (doubleField57_ != null) { + _single_doubleField57_codec.WriteTagAndValue(output, DoubleField57); + } + if (doubleField58_ != null) { + _single_doubleField58_codec.WriteTagAndValue(output, DoubleField58); + } + if (int64Field59_ != null) { + _single_int64Field59_codec.WriteTagAndValue(output, Int64Field59); + } + if (int64Field60_ != null) { + _single_int64Field60_codec.WriteTagAndValue(output, Int64Field60); + } + if (doubleField62_ != null) { + _single_doubleField62_codec.WriteTagAndValue(output, DoubleField62); + } + if (doubleField65_ != null) { + _single_doubleField65_codec.WriteTagAndValue(output, DoubleField65); + } + if (doubleField66_ != null) { + _single_doubleField66_codec.WriteTagAndValue(output, DoubleField66); + } + if (doubleField67_ != null) { + _single_doubleField67_codec.WriteTagAndValue(output, DoubleField67); + } + if (doubleField68_ != null) { + _single_doubleField68_codec.WriteTagAndValue(output, DoubleField68); + } + if (doubleField69_ != null) { + _single_doubleField69_codec.WriteTagAndValue(output, DoubleField69); + } + if (doubleField70_ != null) { + _single_doubleField70_codec.WriteTagAndValue(output, DoubleField70); + } + if (doubleField71_ != null) { + _single_doubleField71_codec.WriteTagAndValue(output, DoubleField71); + } + if (doubleField72_ != null) { + _single_doubleField72_codec.WriteTagAndValue(output, DoubleField72); + } + if (stringField73_ != null) { + _single_stringField73_codec.WriteTagAndValue(output, StringField73); + } + if (stringField74_ != null) { + _single_stringField74_codec.WriteTagAndValue(output, StringField74); + } + if (doubleField75_ != null) { + _single_doubleField75_codec.WriteTagAndValue(output, DoubleField75); + } + if (doubleField77_ != null) { + _single_doubleField77_codec.WriteTagAndValue(output, DoubleField77); + } + if (doubleField78_ != null) { + _single_doubleField78_codec.WriteTagAndValue(output, DoubleField78); + } + if (doubleField79_ != null) { + _single_doubleField79_codec.WriteTagAndValue(output, DoubleField79); + } + if (EnumField80 != 0) { + output.WriteRawTag(128, 5); + output.WriteInt32(EnumField80); + } + if (EnumField81 != 0) { + output.WriteRawTag(136, 5); + output.WriteInt32(EnumField81); + } + if (int64Field82_ != null) { + _single_int64Field82_codec.WriteTagAndValue(output, Int64Field82); + } + if (EnumField83 != 0) { + output.WriteRawTag(152, 5); + output.WriteInt32(EnumField83); + } + if (doubleField84_ != null) { + _single_doubleField84_codec.WriteTagAndValue(output, DoubleField84); + } + if (int64Field85_ != null) { + _single_int64Field85_codec.WriteTagAndValue(output, Int64Field85); + } + if (int64Field86_ != null) { + _single_int64Field86_codec.WriteTagAndValue(output, Int64Field86); + } + if (int64Field87_ != null) { + _single_int64Field87_codec.WriteTagAndValue(output, Int64Field87); + } + if (doubleField88_ != null) { + _single_doubleField88_codec.WriteTagAndValue(output, DoubleField88); + } + if (doubleField89_ != null) { + _single_doubleField89_codec.WriteTagAndValue(output, DoubleField89); + } + if (doubleField90_ != null) { + _single_doubleField90_codec.WriteTagAndValue(output, DoubleField90); + } + if (doubleField91_ != null) { + _single_doubleField91_codec.WriteTagAndValue(output, DoubleField91); + } + if (doubleField92_ != null) { + _single_doubleField92_codec.WriteTagAndValue(output, DoubleField92); + } + if (doubleField93_ != null) { + _single_doubleField93_codec.WriteTagAndValue(output, DoubleField93); + } + if (doubleField94_ != null) { + _single_doubleField94_codec.WriteTagAndValue(output, DoubleField94); + } + if (doubleField95_ != null) { + _single_doubleField95_codec.WriteTagAndValue(output, DoubleField95); + } + if (doubleField96_ != null) { + _single_doubleField96_codec.WriteTagAndValue(output, DoubleField96); + } + if (doubleField97_ != null) { + _single_doubleField97_codec.WriteTagAndValue(output, DoubleField97); + } + if (doubleField98_ != null) { + _single_doubleField98_codec.WriteTagAndValue(output, DoubleField98); + } + if (doubleField99_ != null) { + _single_doubleField99_codec.WriteTagAndValue(output, DoubleField99); + } + repeatedIntField100_.WriteTo(output, _repeated_repeatedIntField100_codec); + if (doubleField101_ != null) { + _single_doubleField101_codec.WriteTagAndValue(output, DoubleField101); + } + if (doubleField102_ != null) { + _single_doubleField102_codec.WriteTagAndValue(output, DoubleField102); + } + if (doubleField103_ != null) { + _single_doubleField103_codec.WriteTagAndValue(output, DoubleField103); + } + if (doubleField104_ != null) { + _single_doubleField104_codec.WriteTagAndValue(output, DoubleField104); + } + if (doubleField105_ != null) { + _single_doubleField105_codec.WriteTagAndValue(output, DoubleField105); + } + if (doubleField106_ != null) { + _single_doubleField106_codec.WriteTagAndValue(output, DoubleField106); + } + if (int64Field107_ != null) { + _single_int64Field107_codec.WriteTagAndValue(output, Int64Field107); + } + if (doubleField108_ != null) { + _single_doubleField108_codec.WriteTagAndValue(output, DoubleField108); + } + if (doubleField109_ != null) { + _single_doubleField109_codec.WriteTagAndValue(output, DoubleField109); + } + if (int64Field110_ != null) { + _single_int64Field110_codec.WriteTagAndValue(output, Int64Field110); + } + if (doubleField111_ != null) { + _single_doubleField111_codec.WriteTagAndValue(output, DoubleField111); + } + if (int64Field112_ != null) { + _single_int64Field112_codec.WriteTagAndValue(output, Int64Field112); + } + if (doubleField113_ != null) { + _single_doubleField113_codec.WriteTagAndValue(output, DoubleField113); + } + if (int64Field114_ != null) { + _single_int64Field114_codec.WriteTagAndValue(output, Int64Field114); + } + if (int64Field115_ != null) { + _single_int64Field115_codec.WriteTagAndValue(output, Int64Field115); + } + if (doubleField116_ != null) { + _single_doubleField116_codec.WriteTagAndValue(output, DoubleField116); + } + if (int64Field117_ != null) { + _single_int64Field117_codec.WriteTagAndValue(output, Int64Field117); + } + if (doubleField118_ != null) { + _single_doubleField118_codec.WriteTagAndValue(output, DoubleField118); + } + if (doubleField119_ != null) { + _single_doubleField119_codec.WriteTagAndValue(output, DoubleField119); + } + if (doubleField120_ != null) { + _single_doubleField120_codec.WriteTagAndValue(output, DoubleField120); + } + if (doubleField121_ != null) { + _single_doubleField121_codec.WriteTagAndValue(output, DoubleField121); + } + if (doubleField122_ != null) { + _single_doubleField122_codec.WriteTagAndValue(output, DoubleField122); + } + if (doubleField123_ != null) { + _single_doubleField123_codec.WriteTagAndValue(output, DoubleField123); + } + if (doubleField124_ != null) { + _single_doubleField124_codec.WriteTagAndValue(output, DoubleField124); + } + if (int64Field125_ != null) { + _single_int64Field125_codec.WriteTagAndValue(output, Int64Field125); + } + if (int64Field126_ != null) { + _single_int64Field126_codec.WriteTagAndValue(output, Int64Field126); + } + if (int64Field127_ != null) { + _single_int64Field127_codec.WriteTagAndValue(output, Int64Field127); + } + if (doubleField128_ != null) { + _single_doubleField128_codec.WriteTagAndValue(output, DoubleField128); + } + if (doubleField129_ != null) { + _single_doubleField129_codec.WriteTagAndValue(output, DoubleField129); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (doubleField1_ != null) { + _single_doubleField1_codec.WriteTagAndValue(ref output, DoubleField1); + } + if (int64Field2_ != null) { + _single_int64Field2_codec.WriteTagAndValue(ref output, Int64Field2); + } + if (int64Field3_ != null) { + _single_int64Field3_codec.WriteTagAndValue(ref output, Int64Field3); + } + if (int64Field4_ != null) { + _single_int64Field4_codec.WriteTagAndValue(ref output, Int64Field4); + } + if (doubleField7_ != null) { + _single_doubleField7_codec.WriteTagAndValue(ref output, DoubleField7); + } + if (doubleField8_ != null) { + _single_doubleField8_codec.WriteTagAndValue(ref output, DoubleField8); + } + if (doubleField9_ != null) { + _single_doubleField9_codec.WriteTagAndValue(ref output, DoubleField9); + } + if (doubleField10_ != null) { + _single_doubleField10_codec.WriteTagAndValue(ref output, DoubleField10); + } + if (doubleField11_ != null) { + _single_doubleField11_codec.WriteTagAndValue(ref output, DoubleField11); + } + if (doubleField14_ != null) { + _single_doubleField14_codec.WriteTagAndValue(ref output, DoubleField14); + } + if (doubleField15_ != null) { + _single_doubleField15_codec.WriteTagAndValue(ref output, DoubleField15); + } + if (int64Field19_ != null) { + _single_int64Field19_codec.WriteTagAndValue(ref output, Int64Field19); + } + if (doubleField20_ != null) { + _single_doubleField20_codec.WriteTagAndValue(ref output, DoubleField20); + } + if (doubleField21_ != null) { + _single_doubleField21_codec.WriteTagAndValue(ref output, DoubleField21); + } + if (doubleField22_ != null) { + _single_doubleField22_codec.WriteTagAndValue(ref output, DoubleField22); + } + if (doubleField25_ != null) { + _single_doubleField25_codec.WriteTagAndValue(ref output, DoubleField25); + } + if (int64Field26_ != null) { + _single_int64Field26_codec.WriteTagAndValue(ref output, Int64Field26); + } + if (doubleField28_ != null) { + _single_doubleField28_codec.WriteTagAndValue(ref output, DoubleField28); + } + if (doubleField29_ != null) { + _single_doubleField29_codec.WriteTagAndValue(ref output, DoubleField29); + } + if (doubleField30_ != null) { + _single_doubleField30_codec.WriteTagAndValue(ref output, DoubleField30); + } + if (doubleField31_ != null) { + _single_doubleField31_codec.WriteTagAndValue(ref output, DoubleField31); + } + if (int64Field32_ != null) { + _single_int64Field32_codec.WriteTagAndValue(ref output, Int64Field32); + } + if (int64Field37_ != null) { + _single_int64Field37_codec.WriteTagAndValue(ref output, Int64Field37); + } + if (doubleField38_ != null) { + _single_doubleField38_codec.WriteTagAndValue(ref output, DoubleField38); + } + if (interactions_ != null) { + _single_interactions_codec.WriteTagAndValue(ref output, Interactions); + } + if (doubleField40_ != null) { + _single_doubleField40_codec.WriteTagAndValue(ref output, DoubleField40); + } + if (int64Field41_ != null) { + _single_int64Field41_codec.WriteTagAndValue(ref output, Int64Field41); + } + if (doubleField42_ != null) { + _single_doubleField42_codec.WriteTagAndValue(ref output, DoubleField42); + } + if (int64Field43_ != null) { + _single_int64Field43_codec.WriteTagAndValue(ref output, Int64Field43); + } + if (int64Field44_ != null) { + _single_int64Field44_codec.WriteTagAndValue(ref output, Int64Field44); + } + if (doubleField45_ != null) { + _single_doubleField45_codec.WriteTagAndValue(ref output, DoubleField45); + } + if (doubleField46_ != null) { + _single_doubleField46_codec.WriteTagAndValue(ref output, DoubleField46); + } + if (doubleField47_ != null) { + _single_doubleField47_codec.WriteTagAndValue(ref output, DoubleField47); + } + if (doubleField48_ != null) { + _single_doubleField48_codec.WriteTagAndValue(ref output, DoubleField48); + } + if (doubleField49_ != null) { + _single_doubleField49_codec.WriteTagAndValue(ref output, DoubleField49); + } + if (doubleField50_ != null) { + _single_doubleField50_codec.WriteTagAndValue(ref output, DoubleField50); + } + if (doubleField51_ != null) { + _single_doubleField51_codec.WriteTagAndValue(ref output, DoubleField51); + } + if (doubleField52_ != null) { + _single_doubleField52_codec.WriteTagAndValue(ref output, DoubleField52); + } + if (doubleField53_ != null) { + _single_doubleField53_codec.WriteTagAndValue(ref output, DoubleField53); + } + if (doubleField54_ != null) { + _single_doubleField54_codec.WriteTagAndValue(ref output, DoubleField54); + } + if (doubleField55_ != null) { + _single_doubleField55_codec.WriteTagAndValue(ref output, DoubleField55); + } + if (doubleField56_ != null) { + _single_doubleField56_codec.WriteTagAndValue(ref output, DoubleField56); + } + if (doubleField57_ != null) { + _single_doubleField57_codec.WriteTagAndValue(ref output, DoubleField57); + } + if (doubleField58_ != null) { + _single_doubleField58_codec.WriteTagAndValue(ref output, DoubleField58); + } + if (int64Field59_ != null) { + _single_int64Field59_codec.WriteTagAndValue(ref output, Int64Field59); + } + if (int64Field60_ != null) { + _single_int64Field60_codec.WriteTagAndValue(ref output, Int64Field60); + } + if (doubleField62_ != null) { + _single_doubleField62_codec.WriteTagAndValue(ref output, DoubleField62); + } + if (doubleField65_ != null) { + _single_doubleField65_codec.WriteTagAndValue(ref output, DoubleField65); + } + if (doubleField66_ != null) { + _single_doubleField66_codec.WriteTagAndValue(ref output, DoubleField66); + } + if (doubleField67_ != null) { + _single_doubleField67_codec.WriteTagAndValue(ref output, DoubleField67); + } + if (doubleField68_ != null) { + _single_doubleField68_codec.WriteTagAndValue(ref output, DoubleField68); + } + if (doubleField69_ != null) { + _single_doubleField69_codec.WriteTagAndValue(ref output, DoubleField69); + } + if (doubleField70_ != null) { + _single_doubleField70_codec.WriteTagAndValue(ref output, DoubleField70); + } + if (doubleField71_ != null) { + _single_doubleField71_codec.WriteTagAndValue(ref output, DoubleField71); + } + if (doubleField72_ != null) { + _single_doubleField72_codec.WriteTagAndValue(ref output, DoubleField72); + } + if (stringField73_ != null) { + _single_stringField73_codec.WriteTagAndValue(ref output, StringField73); + } + if (stringField74_ != null) { + _single_stringField74_codec.WriteTagAndValue(ref output, StringField74); + } + if (doubleField75_ != null) { + _single_doubleField75_codec.WriteTagAndValue(ref output, DoubleField75); + } + if (doubleField77_ != null) { + _single_doubleField77_codec.WriteTagAndValue(ref output, DoubleField77); + } + if (doubleField78_ != null) { + _single_doubleField78_codec.WriteTagAndValue(ref output, DoubleField78); + } + if (doubleField79_ != null) { + _single_doubleField79_codec.WriteTagAndValue(ref output, DoubleField79); + } + if (EnumField80 != 0) { + output.WriteRawTag(128, 5); + output.WriteInt32(EnumField80); + } + if (EnumField81 != 0) { + output.WriteRawTag(136, 5); + output.WriteInt32(EnumField81); + } + if (int64Field82_ != null) { + _single_int64Field82_codec.WriteTagAndValue(ref output, Int64Field82); + } + if (EnumField83 != 0) { + output.WriteRawTag(152, 5); + output.WriteInt32(EnumField83); + } + if (doubleField84_ != null) { + _single_doubleField84_codec.WriteTagAndValue(ref output, DoubleField84); + } + if (int64Field85_ != null) { + _single_int64Field85_codec.WriteTagAndValue(ref output, Int64Field85); + } + if (int64Field86_ != null) { + _single_int64Field86_codec.WriteTagAndValue(ref output, Int64Field86); + } + if (int64Field87_ != null) { + _single_int64Field87_codec.WriteTagAndValue(ref output, Int64Field87); + } + if (doubleField88_ != null) { + _single_doubleField88_codec.WriteTagAndValue(ref output, DoubleField88); + } + if (doubleField89_ != null) { + _single_doubleField89_codec.WriteTagAndValue(ref output, DoubleField89); + } + if (doubleField90_ != null) { + _single_doubleField90_codec.WriteTagAndValue(ref output, DoubleField90); + } + if (doubleField91_ != null) { + _single_doubleField91_codec.WriteTagAndValue(ref output, DoubleField91); + } + if (doubleField92_ != null) { + _single_doubleField92_codec.WriteTagAndValue(ref output, DoubleField92); + } + if (doubleField93_ != null) { + _single_doubleField93_codec.WriteTagAndValue(ref output, DoubleField93); + } + if (doubleField94_ != null) { + _single_doubleField94_codec.WriteTagAndValue(ref output, DoubleField94); + } + if (doubleField95_ != null) { + _single_doubleField95_codec.WriteTagAndValue(ref output, DoubleField95); + } + if (doubleField96_ != null) { + _single_doubleField96_codec.WriteTagAndValue(ref output, DoubleField96); + } + if (doubleField97_ != null) { + _single_doubleField97_codec.WriteTagAndValue(ref output, DoubleField97); + } + if (doubleField98_ != null) { + _single_doubleField98_codec.WriteTagAndValue(ref output, DoubleField98); + } + if (doubleField99_ != null) { + _single_doubleField99_codec.WriteTagAndValue(ref output, DoubleField99); + } + repeatedIntField100_.WriteTo(ref output, _repeated_repeatedIntField100_codec); + if (doubleField101_ != null) { + _single_doubleField101_codec.WriteTagAndValue(ref output, DoubleField101); + } + if (doubleField102_ != null) { + _single_doubleField102_codec.WriteTagAndValue(ref output, DoubleField102); + } + if (doubleField103_ != null) { + _single_doubleField103_codec.WriteTagAndValue(ref output, DoubleField103); + } + if (doubleField104_ != null) { + _single_doubleField104_codec.WriteTagAndValue(ref output, DoubleField104); + } + if (doubleField105_ != null) { + _single_doubleField105_codec.WriteTagAndValue(ref output, DoubleField105); + } + if (doubleField106_ != null) { + _single_doubleField106_codec.WriteTagAndValue(ref output, DoubleField106); + } + if (int64Field107_ != null) { + _single_int64Field107_codec.WriteTagAndValue(ref output, Int64Field107); + } + if (doubleField108_ != null) { + _single_doubleField108_codec.WriteTagAndValue(ref output, DoubleField108); + } + if (doubleField109_ != null) { + _single_doubleField109_codec.WriteTagAndValue(ref output, DoubleField109); + } + if (int64Field110_ != null) { + _single_int64Field110_codec.WriteTagAndValue(ref output, Int64Field110); + } + if (doubleField111_ != null) { + _single_doubleField111_codec.WriteTagAndValue(ref output, DoubleField111); + } + if (int64Field112_ != null) { + _single_int64Field112_codec.WriteTagAndValue(ref output, Int64Field112); + } + if (doubleField113_ != null) { + _single_doubleField113_codec.WriteTagAndValue(ref output, DoubleField113); + } + if (int64Field114_ != null) { + _single_int64Field114_codec.WriteTagAndValue(ref output, Int64Field114); + } + if (int64Field115_ != null) { + _single_int64Field115_codec.WriteTagAndValue(ref output, Int64Field115); + } + if (doubleField116_ != null) { + _single_doubleField116_codec.WriteTagAndValue(ref output, DoubleField116); + } + if (int64Field117_ != null) { + _single_int64Field117_codec.WriteTagAndValue(ref output, Int64Field117); + } + if (doubleField118_ != null) { + _single_doubleField118_codec.WriteTagAndValue(ref output, DoubleField118); + } + if (doubleField119_ != null) { + _single_doubleField119_codec.WriteTagAndValue(ref output, DoubleField119); + } + if (doubleField120_ != null) { + _single_doubleField120_codec.WriteTagAndValue(ref output, DoubleField120); + } + if (doubleField121_ != null) { + _single_doubleField121_codec.WriteTagAndValue(ref output, DoubleField121); + } + if (doubleField122_ != null) { + _single_doubleField122_codec.WriteTagAndValue(ref output, DoubleField122); + } + if (doubleField123_ != null) { + _single_doubleField123_codec.WriteTagAndValue(ref output, DoubleField123); + } + if (doubleField124_ != null) { + _single_doubleField124_codec.WriteTagAndValue(ref output, DoubleField124); + } + if (int64Field125_ != null) { + _single_int64Field125_codec.WriteTagAndValue(ref output, Int64Field125); + } + if (int64Field126_ != null) { + _single_int64Field126_codec.WriteTagAndValue(ref output, Int64Field126); + } + if (int64Field127_ != null) { + _single_int64Field127_codec.WriteTagAndValue(ref output, Int64Field127); + } + if (doubleField128_ != null) { + _single_doubleField128_codec.WriteTagAndValue(ref output, DoubleField128); + } + if (doubleField129_ != null) { + _single_doubleField129_codec.WriteTagAndValue(ref output, DoubleField129); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (doubleField95_ != null) { + size += _single_doubleField95_codec.CalculateSizeWithTag(DoubleField95); + } + if (doubleField1_ != null) { + size += _single_doubleField1_codec.CalculateSizeWithTag(DoubleField1); + } + if (doubleField79_ != null) { + size += _single_doubleField79_codec.CalculateSizeWithTag(DoubleField79); + } + if (int64Field2_ != null) { + size += _single_int64Field2_codec.CalculateSizeWithTag(Int64Field2); + } + if (doubleField96_ != null) { + size += _single_doubleField96_codec.CalculateSizeWithTag(DoubleField96); + } + if (int64Field3_ != null) { + size += _single_int64Field3_codec.CalculateSizeWithTag(Int64Field3); + } + if (int64Field4_ != null) { + size += _single_int64Field4_codec.CalculateSizeWithTag(Int64Field4); + } + if (doubleField97_ != null) { + size += _single_doubleField97_codec.CalculateSizeWithTag(DoubleField97); + } + if (doubleField65_ != null) { + size += _single_doubleField65_codec.CalculateSizeWithTag(DoubleField65); + } + if (doubleField66_ != null) { + size += _single_doubleField66_codec.CalculateSizeWithTag(DoubleField66); + } + if (doubleField7_ != null) { + size += _single_doubleField7_codec.CalculateSizeWithTag(DoubleField7); + } + if (doubleField62_ != null) { + size += _single_doubleField62_codec.CalculateSizeWithTag(DoubleField62); + } + if (doubleField118_ != null) { + size += _single_doubleField118_codec.CalculateSizeWithTag(DoubleField118); + } + if (doubleField119_ != null) { + size += _single_doubleField119_codec.CalculateSizeWithTag(DoubleField119); + } + if (doubleField67_ != null) { + size += _single_doubleField67_codec.CalculateSizeWithTag(DoubleField67); + } + if (doubleField120_ != null) { + size += _single_doubleField120_codec.CalculateSizeWithTag(DoubleField120); + } + if (doubleField121_ != null) { + size += _single_doubleField121_codec.CalculateSizeWithTag(DoubleField121); + } + if (doubleField122_ != null) { + size += _single_doubleField122_codec.CalculateSizeWithTag(DoubleField122); + } + if (doubleField123_ != null) { + size += _single_doubleField123_codec.CalculateSizeWithTag(DoubleField123); + } + if (doubleField124_ != null) { + size += _single_doubleField124_codec.CalculateSizeWithTag(DoubleField124); + } + if (doubleField8_ != null) { + size += _single_doubleField8_codec.CalculateSizeWithTag(DoubleField8); + } + if (doubleField9_ != null) { + size += _single_doubleField9_codec.CalculateSizeWithTag(DoubleField9); + } + if (doubleField98_ != null) { + size += _single_doubleField98_codec.CalculateSizeWithTag(DoubleField98); + } + if (doubleField10_ != null) { + size += _single_doubleField10_codec.CalculateSizeWithTag(DoubleField10); + } + if (doubleField11_ != null) { + size += _single_doubleField11_codec.CalculateSizeWithTag(DoubleField11); + } + if (doubleField99_ != null) { + size += _single_doubleField99_codec.CalculateSizeWithTag(DoubleField99); + } + if (doubleField84_ != null) { + size += _single_doubleField84_codec.CalculateSizeWithTag(DoubleField84); + } + if (doubleField14_ != null) { + size += _single_doubleField14_codec.CalculateSizeWithTag(DoubleField14); + } + if (doubleField77_ != null) { + size += _single_doubleField77_codec.CalculateSizeWithTag(DoubleField77); + } + if (doubleField15_ != null) { + size += _single_doubleField15_codec.CalculateSizeWithTag(DoubleField15); + } + if (int64Field19_ != null) { + size += _single_int64Field19_codec.CalculateSizeWithTag(Int64Field19); + } + if (int64Field115_ != null) { + size += _single_int64Field115_codec.CalculateSizeWithTag(Int64Field115); + } + if (doubleField116_ != null) { + size += _single_doubleField116_codec.CalculateSizeWithTag(DoubleField116); + } + if (int64Field117_ != null) { + size += _single_int64Field117_codec.CalculateSizeWithTag(Int64Field117); + } + if (doubleField20_ != null) { + size += _single_doubleField20_codec.CalculateSizeWithTag(DoubleField20); + } + if (doubleField21_ != null) { + size += _single_doubleField21_codec.CalculateSizeWithTag(DoubleField21); + } + if (stringField73_ != null) { + size += _single_stringField73_codec.CalculateSizeWithTag(StringField73); + } + if (stringField74_ != null) { + size += _single_stringField74_codec.CalculateSizeWithTag(StringField74); + } + if (doubleField22_ != null) { + size += _single_doubleField22_codec.CalculateSizeWithTag(DoubleField22); + } + if (doubleField69_ != null) { + size += _single_doubleField69_codec.CalculateSizeWithTag(DoubleField69); + } + if (doubleField70_ != null) { + size += _single_doubleField70_codec.CalculateSizeWithTag(DoubleField70); + } + if (doubleField71_ != null) { + size += _single_doubleField71_codec.CalculateSizeWithTag(DoubleField71); + } + if (doubleField72_ != null) { + size += _single_doubleField72_codec.CalculateSizeWithTag(DoubleField72); + } + if (doubleField25_ != null) { + size += _single_doubleField25_codec.CalculateSizeWithTag(DoubleField25); + } + if (int64Field26_ != null) { + size += _single_int64Field26_codec.CalculateSizeWithTag(Int64Field26); + } + if (doubleField68_ != null) { + size += _single_doubleField68_codec.CalculateSizeWithTag(DoubleField68); + } + if (doubleField28_ != null) { + size += _single_doubleField28_codec.CalculateSizeWithTag(DoubleField28); + } + if (doubleField106_ != null) { + size += _single_doubleField106_codec.CalculateSizeWithTag(DoubleField106); + } + if (doubleField29_ != null) { + size += _single_doubleField29_codec.CalculateSizeWithTag(DoubleField29); + } + if (doubleField30_ != null) { + size += _single_doubleField30_codec.CalculateSizeWithTag(DoubleField30); + } + if (doubleField101_ != null) { + size += _single_doubleField101_codec.CalculateSizeWithTag(DoubleField101); + } + if (doubleField102_ != null) { + size += _single_doubleField102_codec.CalculateSizeWithTag(DoubleField102); + } + if (doubleField103_ != null) { + size += _single_doubleField103_codec.CalculateSizeWithTag(DoubleField103); + } + if (doubleField104_ != null) { + size += _single_doubleField104_codec.CalculateSizeWithTag(DoubleField104); + } + if (doubleField105_ != null) { + size += _single_doubleField105_codec.CalculateSizeWithTag(DoubleField105); + } + if (doubleField31_ != null) { + size += _single_doubleField31_codec.CalculateSizeWithTag(DoubleField31); + } + if (int64Field32_ != null) { + size += _single_int64Field32_codec.CalculateSizeWithTag(Int64Field32); + } + if (doubleField75_ != null) { + size += _single_doubleField75_codec.CalculateSizeWithTag(DoubleField75); + } + if (doubleField129_ != null) { + size += _single_doubleField129_codec.CalculateSizeWithTag(DoubleField129); + } + if (EnumField80 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(EnumField80); + } + if (EnumField81 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(EnumField81); + } + if (int64Field82_ != null) { + size += _single_int64Field82_codec.CalculateSizeWithTag(Int64Field82); + } + if (EnumField83 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(EnumField83); + } + if (int64Field85_ != null) { + size += _single_int64Field85_codec.CalculateSizeWithTag(Int64Field85); + } + if (int64Field86_ != null) { + size += _single_int64Field86_codec.CalculateSizeWithTag(Int64Field86); + } + if (int64Field87_ != null) { + size += _single_int64Field87_codec.CalculateSizeWithTag(Int64Field87); + } + if (int64Field125_ != null) { + size += _single_int64Field125_codec.CalculateSizeWithTag(Int64Field125); + } + if (int64Field37_ != null) { + size += _single_int64Field37_codec.CalculateSizeWithTag(Int64Field37); + } + if (doubleField38_ != null) { + size += _single_doubleField38_codec.CalculateSizeWithTag(DoubleField38); + } + if (interactions_ != null) { + size += _single_interactions_codec.CalculateSizeWithTag(Interactions); + } + size += repeatedIntField100_.CalculateSize(_repeated_repeatedIntField100_codec); + if (doubleField40_ != null) { + size += _single_doubleField40_codec.CalculateSizeWithTag(DoubleField40); + } + if (int64Field41_ != null) { + size += _single_int64Field41_codec.CalculateSizeWithTag(Int64Field41); + } + if (int64Field126_ != null) { + size += _single_int64Field126_codec.CalculateSizeWithTag(Int64Field126); + } + if (int64Field127_ != null) { + size += _single_int64Field127_codec.CalculateSizeWithTag(Int64Field127); + } + if (doubleField128_ != null) { + size += _single_doubleField128_codec.CalculateSizeWithTag(DoubleField128); + } + if (doubleField109_ != null) { + size += _single_doubleField109_codec.CalculateSizeWithTag(DoubleField109); + } + if (int64Field110_ != null) { + size += _single_int64Field110_codec.CalculateSizeWithTag(Int64Field110); + } + if (doubleField111_ != null) { + size += _single_doubleField111_codec.CalculateSizeWithTag(DoubleField111); + } + if (int64Field112_ != null) { + size += _single_int64Field112_codec.CalculateSizeWithTag(Int64Field112); + } + if (doubleField113_ != null) { + size += _single_doubleField113_codec.CalculateSizeWithTag(DoubleField113); + } + if (int64Field114_ != null) { + size += _single_int64Field114_codec.CalculateSizeWithTag(Int64Field114); + } + if (doubleField42_ != null) { + size += _single_doubleField42_codec.CalculateSizeWithTag(DoubleField42); + } + if (int64Field43_ != null) { + size += _single_int64Field43_codec.CalculateSizeWithTag(Int64Field43); + } + if (int64Field44_ != null) { + size += _single_int64Field44_codec.CalculateSizeWithTag(Int64Field44); + } + if (doubleField45_ != null) { + size += _single_doubleField45_codec.CalculateSizeWithTag(DoubleField45); + } + if (doubleField46_ != null) { + size += _single_doubleField46_codec.CalculateSizeWithTag(DoubleField46); + } + if (doubleField78_ != null) { + size += _single_doubleField78_codec.CalculateSizeWithTag(DoubleField78); + } + if (doubleField88_ != null) { + size += _single_doubleField88_codec.CalculateSizeWithTag(DoubleField88); + } + if (doubleField47_ != null) { + size += _single_doubleField47_codec.CalculateSizeWithTag(DoubleField47); + } + if (doubleField89_ != null) { + size += _single_doubleField89_codec.CalculateSizeWithTag(DoubleField89); + } + if (doubleField48_ != null) { + size += _single_doubleField48_codec.CalculateSizeWithTag(DoubleField48); + } + if (doubleField49_ != null) { + size += _single_doubleField49_codec.CalculateSizeWithTag(DoubleField49); + } + if (doubleField50_ != null) { + size += _single_doubleField50_codec.CalculateSizeWithTag(DoubleField50); + } + if (doubleField90_ != null) { + size += _single_doubleField90_codec.CalculateSizeWithTag(DoubleField90); + } + if (doubleField51_ != null) { + size += _single_doubleField51_codec.CalculateSizeWithTag(DoubleField51); + } + if (doubleField91_ != null) { + size += _single_doubleField91_codec.CalculateSizeWithTag(DoubleField91); + } + if (doubleField92_ != null) { + size += _single_doubleField92_codec.CalculateSizeWithTag(DoubleField92); + } + if (int64Field107_ != null) { + size += _single_int64Field107_codec.CalculateSizeWithTag(Int64Field107); + } + if (doubleField93_ != null) { + size += _single_doubleField93_codec.CalculateSizeWithTag(DoubleField93); + } + if (doubleField108_ != null) { + size += _single_doubleField108_codec.CalculateSizeWithTag(DoubleField108); + } + if (doubleField52_ != null) { + size += _single_doubleField52_codec.CalculateSizeWithTag(DoubleField52); + } + if (doubleField53_ != null) { + size += _single_doubleField53_codec.CalculateSizeWithTag(DoubleField53); + } + if (doubleField94_ != null) { + size += _single_doubleField94_codec.CalculateSizeWithTag(DoubleField94); + } + if (doubleField54_ != null) { + size += _single_doubleField54_codec.CalculateSizeWithTag(DoubleField54); + } + if (doubleField55_ != null) { + size += _single_doubleField55_codec.CalculateSizeWithTag(DoubleField55); + } + if (doubleField56_ != null) { + size += _single_doubleField56_codec.CalculateSizeWithTag(DoubleField56); + } + if (doubleField57_ != null) { + size += _single_doubleField57_codec.CalculateSizeWithTag(DoubleField57); + } + if (doubleField58_ != null) { + size += _single_doubleField58_codec.CalculateSizeWithTag(DoubleField58); + } + if (int64Field59_ != null) { + size += _single_int64Field59_codec.CalculateSizeWithTag(Int64Field59); + } + if (int64Field60_ != null) { + size += _single_int64Field60_codec.CalculateSizeWithTag(Int64Field60); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ManyWrapperFieldsMessage other) { + if (other == null) { + return; + } + if (other.doubleField95_ != null) { + if (doubleField95_ == null || other.DoubleField95 != 0D) { + DoubleField95 = other.DoubleField95; + } + } + if (other.doubleField1_ != null) { + if (doubleField1_ == null || other.DoubleField1 != 0D) { + DoubleField1 = other.DoubleField1; + } + } + if (other.doubleField79_ != null) { + if (doubleField79_ == null || other.DoubleField79 != 0D) { + DoubleField79 = other.DoubleField79; + } + } + if (other.int64Field2_ != null) { + if (int64Field2_ == null || other.Int64Field2 != 0L) { + Int64Field2 = other.Int64Field2; + } + } + if (other.doubleField96_ != null) { + if (doubleField96_ == null || other.DoubleField96 != 0D) { + DoubleField96 = other.DoubleField96; + } + } + if (other.int64Field3_ != null) { + if (int64Field3_ == null || other.Int64Field3 != 0L) { + Int64Field3 = other.Int64Field3; + } + } + if (other.int64Field4_ != null) { + if (int64Field4_ == null || other.Int64Field4 != 0L) { + Int64Field4 = other.Int64Field4; + } + } + if (other.doubleField97_ != null) { + if (doubleField97_ == null || other.DoubleField97 != 0D) { + DoubleField97 = other.DoubleField97; + } + } + if (other.doubleField65_ != null) { + if (doubleField65_ == null || other.DoubleField65 != 0D) { + DoubleField65 = other.DoubleField65; + } + } + if (other.doubleField66_ != null) { + if (doubleField66_ == null || other.DoubleField66 != 0D) { + DoubleField66 = other.DoubleField66; + } + } + if (other.doubleField7_ != null) { + if (doubleField7_ == null || other.DoubleField7 != 0D) { + DoubleField7 = other.DoubleField7; + } + } + if (other.doubleField62_ != null) { + if (doubleField62_ == null || other.DoubleField62 != 0D) { + DoubleField62 = other.DoubleField62; + } + } + if (other.doubleField118_ != null) { + if (doubleField118_ == null || other.DoubleField118 != 0D) { + DoubleField118 = other.DoubleField118; + } + } + if (other.doubleField119_ != null) { + if (doubleField119_ == null || other.DoubleField119 != 0D) { + DoubleField119 = other.DoubleField119; + } + } + if (other.doubleField67_ != null) { + if (doubleField67_ == null || other.DoubleField67 != 0D) { + DoubleField67 = other.DoubleField67; + } + } + if (other.doubleField120_ != null) { + if (doubleField120_ == null || other.DoubleField120 != 0D) { + DoubleField120 = other.DoubleField120; + } + } + if (other.doubleField121_ != null) { + if (doubleField121_ == null || other.DoubleField121 != 0D) { + DoubleField121 = other.DoubleField121; + } + } + if (other.doubleField122_ != null) { + if (doubleField122_ == null || other.DoubleField122 != 0D) { + DoubleField122 = other.DoubleField122; + } + } + if (other.doubleField123_ != null) { + if (doubleField123_ == null || other.DoubleField123 != 0D) { + DoubleField123 = other.DoubleField123; + } + } + if (other.doubleField124_ != null) { + if (doubleField124_ == null || other.DoubleField124 != 0D) { + DoubleField124 = other.DoubleField124; + } + } + if (other.doubleField8_ != null) { + if (doubleField8_ == null || other.DoubleField8 != 0D) { + DoubleField8 = other.DoubleField8; + } + } + if (other.doubleField9_ != null) { + if (doubleField9_ == null || other.DoubleField9 != 0D) { + DoubleField9 = other.DoubleField9; + } + } + if (other.doubleField98_ != null) { + if (doubleField98_ == null || other.DoubleField98 != 0D) { + DoubleField98 = other.DoubleField98; + } + } + if (other.doubleField10_ != null) { + if (doubleField10_ == null || other.DoubleField10 != 0D) { + DoubleField10 = other.DoubleField10; + } + } + if (other.doubleField11_ != null) { + if (doubleField11_ == null || other.DoubleField11 != 0D) { + DoubleField11 = other.DoubleField11; + } + } + if (other.doubleField99_ != null) { + if (doubleField99_ == null || other.DoubleField99 != 0D) { + DoubleField99 = other.DoubleField99; + } + } + if (other.doubleField84_ != null) { + if (doubleField84_ == null || other.DoubleField84 != 0D) { + DoubleField84 = other.DoubleField84; + } + } + if (other.doubleField14_ != null) { + if (doubleField14_ == null || other.DoubleField14 != 0D) { + DoubleField14 = other.DoubleField14; + } + } + if (other.doubleField77_ != null) { + if (doubleField77_ == null || other.DoubleField77 != 0D) { + DoubleField77 = other.DoubleField77; + } + } + if (other.doubleField15_ != null) { + if (doubleField15_ == null || other.DoubleField15 != 0D) { + DoubleField15 = other.DoubleField15; + } + } + if (other.int64Field19_ != null) { + if (int64Field19_ == null || other.Int64Field19 != 0L) { + Int64Field19 = other.Int64Field19; + } + } + if (other.int64Field115_ != null) { + if (int64Field115_ == null || other.Int64Field115 != 0L) { + Int64Field115 = other.Int64Field115; + } + } + if (other.doubleField116_ != null) { + if (doubleField116_ == null || other.DoubleField116 != 0D) { + DoubleField116 = other.DoubleField116; + } + } + if (other.int64Field117_ != null) { + if (int64Field117_ == null || other.Int64Field117 != 0L) { + Int64Field117 = other.Int64Field117; + } + } + if (other.doubleField20_ != null) { + if (doubleField20_ == null || other.DoubleField20 != 0D) { + DoubleField20 = other.DoubleField20; + } + } + if (other.doubleField21_ != null) { + if (doubleField21_ == null || other.DoubleField21 != 0D) { + DoubleField21 = other.DoubleField21; + } + } + if (other.stringField73_ != null) { + if (stringField73_ == null || other.StringField73 != "") { + StringField73 = other.StringField73; + } + } + if (other.stringField74_ != null) { + if (stringField74_ == null || other.StringField74 != "") { + StringField74 = other.StringField74; + } + } + if (other.doubleField22_ != null) { + if (doubleField22_ == null || other.DoubleField22 != 0D) { + DoubleField22 = other.DoubleField22; + } + } + if (other.doubleField69_ != null) { + if (doubleField69_ == null || other.DoubleField69 != 0D) { + DoubleField69 = other.DoubleField69; + } + } + if (other.doubleField70_ != null) { + if (doubleField70_ == null || other.DoubleField70 != 0D) { + DoubleField70 = other.DoubleField70; + } + } + if (other.doubleField71_ != null) { + if (doubleField71_ == null || other.DoubleField71 != 0D) { + DoubleField71 = other.DoubleField71; + } + } + if (other.doubleField72_ != null) { + if (doubleField72_ == null || other.DoubleField72 != 0D) { + DoubleField72 = other.DoubleField72; + } + } + if (other.doubleField25_ != null) { + if (doubleField25_ == null || other.DoubleField25 != 0D) { + DoubleField25 = other.DoubleField25; + } + } + if (other.int64Field26_ != null) { + if (int64Field26_ == null || other.Int64Field26 != 0L) { + Int64Field26 = other.Int64Field26; + } + } + if (other.doubleField68_ != null) { + if (doubleField68_ == null || other.DoubleField68 != 0D) { + DoubleField68 = other.DoubleField68; + } + } + if (other.doubleField28_ != null) { + if (doubleField28_ == null || other.DoubleField28 != 0D) { + DoubleField28 = other.DoubleField28; + } + } + if (other.doubleField106_ != null) { + if (doubleField106_ == null || other.DoubleField106 != 0D) { + DoubleField106 = other.DoubleField106; + } + } + if (other.doubleField29_ != null) { + if (doubleField29_ == null || other.DoubleField29 != 0D) { + DoubleField29 = other.DoubleField29; + } + } + if (other.doubleField30_ != null) { + if (doubleField30_ == null || other.DoubleField30 != 0D) { + DoubleField30 = other.DoubleField30; + } + } + if (other.doubleField101_ != null) { + if (doubleField101_ == null || other.DoubleField101 != 0D) { + DoubleField101 = other.DoubleField101; + } + } + if (other.doubleField102_ != null) { + if (doubleField102_ == null || other.DoubleField102 != 0D) { + DoubleField102 = other.DoubleField102; + } + } + if (other.doubleField103_ != null) { + if (doubleField103_ == null || other.DoubleField103 != 0D) { + DoubleField103 = other.DoubleField103; + } + } + if (other.doubleField104_ != null) { + if (doubleField104_ == null || other.DoubleField104 != 0D) { + DoubleField104 = other.DoubleField104; + } + } + if (other.doubleField105_ != null) { + if (doubleField105_ == null || other.DoubleField105 != 0D) { + DoubleField105 = other.DoubleField105; + } + } + if (other.doubleField31_ != null) { + if (doubleField31_ == null || other.DoubleField31 != 0D) { + DoubleField31 = other.DoubleField31; + } + } + if (other.int64Field32_ != null) { + if (int64Field32_ == null || other.Int64Field32 != 0L) { + Int64Field32 = other.Int64Field32; + } + } + if (other.doubleField75_ != null) { + if (doubleField75_ == null || other.DoubleField75 != 0D) { + DoubleField75 = other.DoubleField75; + } + } + if (other.doubleField129_ != null) { + if (doubleField129_ == null || other.DoubleField129 != 0D) { + DoubleField129 = other.DoubleField129; + } + } + if (other.EnumField80 != 0) { + EnumField80 = other.EnumField80; + } + if (other.EnumField81 != 0) { + EnumField81 = other.EnumField81; + } + if (other.int64Field82_ != null) { + if (int64Field82_ == null || other.Int64Field82 != 0L) { + Int64Field82 = other.Int64Field82; + } + } + if (other.EnumField83 != 0) { + EnumField83 = other.EnumField83; + } + if (other.int64Field85_ != null) { + if (int64Field85_ == null || other.Int64Field85 != 0L) { + Int64Field85 = other.Int64Field85; + } + } + if (other.int64Field86_ != null) { + if (int64Field86_ == null || other.Int64Field86 != 0L) { + Int64Field86 = other.Int64Field86; + } + } + if (other.int64Field87_ != null) { + if (int64Field87_ == null || other.Int64Field87 != 0L) { + Int64Field87 = other.Int64Field87; + } + } + if (other.int64Field125_ != null) { + if (int64Field125_ == null || other.Int64Field125 != 0L) { + Int64Field125 = other.Int64Field125; + } + } + if (other.int64Field37_ != null) { + if (int64Field37_ == null || other.Int64Field37 != 0L) { + Int64Field37 = other.Int64Field37; + } + } + if (other.doubleField38_ != null) { + if (doubleField38_ == null || other.DoubleField38 != 0D) { + DoubleField38 = other.DoubleField38; + } + } + if (other.interactions_ != null) { + if (interactions_ == null || other.Interactions != 0L) { + Interactions = other.Interactions; + } + } + repeatedIntField100_.Add(other.repeatedIntField100_); + if (other.doubleField40_ != null) { + if (doubleField40_ == null || other.DoubleField40 != 0D) { + DoubleField40 = other.DoubleField40; + } + } + if (other.int64Field41_ != null) { + if (int64Field41_ == null || other.Int64Field41 != 0L) { + Int64Field41 = other.Int64Field41; + } + } + if (other.int64Field126_ != null) { + if (int64Field126_ == null || other.Int64Field126 != 0L) { + Int64Field126 = other.Int64Field126; + } + } + if (other.int64Field127_ != null) { + if (int64Field127_ == null || other.Int64Field127 != 0L) { + Int64Field127 = other.Int64Field127; + } + } + if (other.doubleField128_ != null) { + if (doubleField128_ == null || other.DoubleField128 != 0D) { + DoubleField128 = other.DoubleField128; + } + } + if (other.doubleField109_ != null) { + if (doubleField109_ == null || other.DoubleField109 != 0D) { + DoubleField109 = other.DoubleField109; + } + } + if (other.int64Field110_ != null) { + if (int64Field110_ == null || other.Int64Field110 != 0L) { + Int64Field110 = other.Int64Field110; + } + } + if (other.doubleField111_ != null) { + if (doubleField111_ == null || other.DoubleField111 != 0D) { + DoubleField111 = other.DoubleField111; + } + } + if (other.int64Field112_ != null) { + if (int64Field112_ == null || other.Int64Field112 != 0L) { + Int64Field112 = other.Int64Field112; + } + } + if (other.doubleField113_ != null) { + if (doubleField113_ == null || other.DoubleField113 != 0D) { + DoubleField113 = other.DoubleField113; + } + } + if (other.int64Field114_ != null) { + if (int64Field114_ == null || other.Int64Field114 != 0L) { + Int64Field114 = other.Int64Field114; + } + } + if (other.doubleField42_ != null) { + if (doubleField42_ == null || other.DoubleField42 != 0D) { + DoubleField42 = other.DoubleField42; + } + } + if (other.int64Field43_ != null) { + if (int64Field43_ == null || other.Int64Field43 != 0L) { + Int64Field43 = other.Int64Field43; + } + } + if (other.int64Field44_ != null) { + if (int64Field44_ == null || other.Int64Field44 != 0L) { + Int64Field44 = other.Int64Field44; + } + } + if (other.doubleField45_ != null) { + if (doubleField45_ == null || other.DoubleField45 != 0D) { + DoubleField45 = other.DoubleField45; + } + } + if (other.doubleField46_ != null) { + if (doubleField46_ == null || other.DoubleField46 != 0D) { + DoubleField46 = other.DoubleField46; + } + } + if (other.doubleField78_ != null) { + if (doubleField78_ == null || other.DoubleField78 != 0D) { + DoubleField78 = other.DoubleField78; + } + } + if (other.doubleField88_ != null) { + if (doubleField88_ == null || other.DoubleField88 != 0D) { + DoubleField88 = other.DoubleField88; + } + } + if (other.doubleField47_ != null) { + if (doubleField47_ == null || other.DoubleField47 != 0D) { + DoubleField47 = other.DoubleField47; + } + } + if (other.doubleField89_ != null) { + if (doubleField89_ == null || other.DoubleField89 != 0D) { + DoubleField89 = other.DoubleField89; + } + } + if (other.doubleField48_ != null) { + if (doubleField48_ == null || other.DoubleField48 != 0D) { + DoubleField48 = other.DoubleField48; + } + } + if (other.doubleField49_ != null) { + if (doubleField49_ == null || other.DoubleField49 != 0D) { + DoubleField49 = other.DoubleField49; + } + } + if (other.doubleField50_ != null) { + if (doubleField50_ == null || other.DoubleField50 != 0D) { + DoubleField50 = other.DoubleField50; + } + } + if (other.doubleField90_ != null) { + if (doubleField90_ == null || other.DoubleField90 != 0D) { + DoubleField90 = other.DoubleField90; + } + } + if (other.doubleField51_ != null) { + if (doubleField51_ == null || other.DoubleField51 != 0D) { + DoubleField51 = other.DoubleField51; + } + } + if (other.doubleField91_ != null) { + if (doubleField91_ == null || other.DoubleField91 != 0D) { + DoubleField91 = other.DoubleField91; + } + } + if (other.doubleField92_ != null) { + if (doubleField92_ == null || other.DoubleField92 != 0D) { + DoubleField92 = other.DoubleField92; + } + } + if (other.int64Field107_ != null) { + if (int64Field107_ == null || other.Int64Field107 != 0L) { + Int64Field107 = other.Int64Field107; + } + } + if (other.doubleField93_ != null) { + if (doubleField93_ == null || other.DoubleField93 != 0D) { + DoubleField93 = other.DoubleField93; + } + } + if (other.doubleField108_ != null) { + if (doubleField108_ == null || other.DoubleField108 != 0D) { + DoubleField108 = other.DoubleField108; + } + } + if (other.doubleField52_ != null) { + if (doubleField52_ == null || other.DoubleField52 != 0D) { + DoubleField52 = other.DoubleField52; + } + } + if (other.doubleField53_ != null) { + if (doubleField53_ == null || other.DoubleField53 != 0D) { + DoubleField53 = other.DoubleField53; + } + } + if (other.doubleField94_ != null) { + if (doubleField94_ == null || other.DoubleField94 != 0D) { + DoubleField94 = other.DoubleField94; + } + } + if (other.doubleField54_ != null) { + if (doubleField54_ == null || other.DoubleField54 != 0D) { + DoubleField54 = other.DoubleField54; + } + } + if (other.doubleField55_ != null) { + if (doubleField55_ == null || other.DoubleField55 != 0D) { + DoubleField55 = other.DoubleField55; + } + } + if (other.doubleField56_ != null) { + if (doubleField56_ == null || other.DoubleField56 != 0D) { + DoubleField56 = other.DoubleField56; + } + } + if (other.doubleField57_ != null) { + if (doubleField57_ == null || other.DoubleField57 != 0D) { + DoubleField57 = other.DoubleField57; + } + } + if (other.doubleField58_ != null) { + if (doubleField58_ == null || other.DoubleField58 != 0D) { + DoubleField58 = other.DoubleField58; + } + } + if (other.int64Field59_ != null) { + if (int64Field59_ == null || other.Int64Field59 != 0L) { + Int64Field59 = other.Int64Field59; + } + } + if (other.int64Field60_ != null) { + if (int64Field60_ == null || other.Int64Field60 != 0L) { + Int64Field60 = other.Int64Field60; + } + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + double? value = _single_doubleField1_codec.Read(input); + if (doubleField1_ == null || value != 0D) { + DoubleField1 = value; + } + break; + } + case 18: { + long? value = _single_int64Field2_codec.Read(input); + if (int64Field2_ == null || value != 0L) { + Int64Field2 = value; + } + break; + } + case 26: { + long? value = _single_int64Field3_codec.Read(input); + if (int64Field3_ == null || value != 0L) { + Int64Field3 = value; + } + break; + } + case 34: { + long? value = _single_int64Field4_codec.Read(input); + if (int64Field4_ == null || value != 0L) { + Int64Field4 = value; + } + break; + } + case 58: { + double? value = _single_doubleField7_codec.Read(input); + if (doubleField7_ == null || value != 0D) { + DoubleField7 = value; + } + break; + } + case 66: { + double? value = _single_doubleField8_codec.Read(input); + if (doubleField8_ == null || value != 0D) { + DoubleField8 = value; + } + break; + } + case 74: { + double? value = _single_doubleField9_codec.Read(input); + if (doubleField9_ == null || value != 0D) { + DoubleField9 = value; + } + break; + } + case 82: { + double? value = _single_doubleField10_codec.Read(input); + if (doubleField10_ == null || value != 0D) { + DoubleField10 = value; + } + break; + } + case 90: { + double? value = _single_doubleField11_codec.Read(input); + if (doubleField11_ == null || value != 0D) { + DoubleField11 = value; + } + break; + } + case 114: { + double? value = _single_doubleField14_codec.Read(input); + if (doubleField14_ == null || value != 0D) { + DoubleField14 = value; + } + break; + } + case 122: { + double? value = _single_doubleField15_codec.Read(input); + if (doubleField15_ == null || value != 0D) { + DoubleField15 = value; + } + break; + } + case 154: { + long? value = _single_int64Field19_codec.Read(input); + if (int64Field19_ == null || value != 0L) { + Int64Field19 = value; + } + break; + } + case 162: { + double? value = _single_doubleField20_codec.Read(input); + if (doubleField20_ == null || value != 0D) { + DoubleField20 = value; + } + break; + } + case 170: { + double? value = _single_doubleField21_codec.Read(input); + if (doubleField21_ == null || value != 0D) { + DoubleField21 = value; + } + break; + } + case 178: { + double? value = _single_doubleField22_codec.Read(input); + if (doubleField22_ == null || value != 0D) { + DoubleField22 = value; + } + break; + } + case 202: { + double? value = _single_doubleField25_codec.Read(input); + if (doubleField25_ == null || value != 0D) { + DoubleField25 = value; + } + break; + } + case 210: { + long? value = _single_int64Field26_codec.Read(input); + if (int64Field26_ == null || value != 0L) { + Int64Field26 = value; + } + break; + } + case 226: { + double? value = _single_doubleField28_codec.Read(input); + if (doubleField28_ == null || value != 0D) { + DoubleField28 = value; + } + break; + } + case 234: { + double? value = _single_doubleField29_codec.Read(input); + if (doubleField29_ == null || value != 0D) { + DoubleField29 = value; + } + break; + } + case 242: { + double? value = _single_doubleField30_codec.Read(input); + if (doubleField30_ == null || value != 0D) { + DoubleField30 = value; + } + break; + } + case 250: { + double? value = _single_doubleField31_codec.Read(input); + if (doubleField31_ == null || value != 0D) { + DoubleField31 = value; + } + break; + } + case 258: { + long? value = _single_int64Field32_codec.Read(input); + if (int64Field32_ == null || value != 0L) { + Int64Field32 = value; + } + break; + } + case 298: { + long? value = _single_int64Field37_codec.Read(input); + if (int64Field37_ == null || value != 0L) { + Int64Field37 = value; + } + break; + } + case 306: { + double? value = _single_doubleField38_codec.Read(input); + if (doubleField38_ == null || value != 0D) { + DoubleField38 = value; + } + break; + } + case 314: { + long? value = _single_interactions_codec.Read(input); + if (interactions_ == null || value != 0L) { + Interactions = value; + } + break; + } + case 322: { + double? value = _single_doubleField40_codec.Read(input); + if (doubleField40_ == null || value != 0D) { + DoubleField40 = value; + } + break; + } + case 330: { + long? value = _single_int64Field41_codec.Read(input); + if (int64Field41_ == null || value != 0L) { + Int64Field41 = value; + } + break; + } + case 338: { + double? value = _single_doubleField42_codec.Read(input); + if (doubleField42_ == null || value != 0D) { + DoubleField42 = value; + } + break; + } + case 346: { + long? value = _single_int64Field43_codec.Read(input); + if (int64Field43_ == null || value != 0L) { + Int64Field43 = value; + } + break; + } + case 354: { + long? value = _single_int64Field44_codec.Read(input); + if (int64Field44_ == null || value != 0L) { + Int64Field44 = value; + } + break; + } + case 362: { + double? value = _single_doubleField45_codec.Read(input); + if (doubleField45_ == null || value != 0D) { + DoubleField45 = value; + } + break; + } + case 370: { + double? value = _single_doubleField46_codec.Read(input); + if (doubleField46_ == null || value != 0D) { + DoubleField46 = value; + } + break; + } + case 378: { + double? value = _single_doubleField47_codec.Read(input); + if (doubleField47_ == null || value != 0D) { + DoubleField47 = value; + } + break; + } + case 386: { + double? value = _single_doubleField48_codec.Read(input); + if (doubleField48_ == null || value != 0D) { + DoubleField48 = value; + } + break; + } + case 394: { + double? value = _single_doubleField49_codec.Read(input); + if (doubleField49_ == null || value != 0D) { + DoubleField49 = value; + } + break; + } + case 402: { + double? value = _single_doubleField50_codec.Read(input); + if (doubleField50_ == null || value != 0D) { + DoubleField50 = value; + } + break; + } + case 410: { + double? value = _single_doubleField51_codec.Read(input); + if (doubleField51_ == null || value != 0D) { + DoubleField51 = value; + } + break; + } + case 418: { + double? value = _single_doubleField52_codec.Read(input); + if (doubleField52_ == null || value != 0D) { + DoubleField52 = value; + } + break; + } + case 426: { + double? value = _single_doubleField53_codec.Read(input); + if (doubleField53_ == null || value != 0D) { + DoubleField53 = value; + } + break; + } + case 434: { + double? value = _single_doubleField54_codec.Read(input); + if (doubleField54_ == null || value != 0D) { + DoubleField54 = value; + } + break; + } + case 442: { + double? value = _single_doubleField55_codec.Read(input); + if (doubleField55_ == null || value != 0D) { + DoubleField55 = value; + } + break; + } + case 450: { + double? value = _single_doubleField56_codec.Read(input); + if (doubleField56_ == null || value != 0D) { + DoubleField56 = value; + } + break; + } + case 458: { + double? value = _single_doubleField57_codec.Read(input); + if (doubleField57_ == null || value != 0D) { + DoubleField57 = value; + } + break; + } + case 466: { + double? value = _single_doubleField58_codec.Read(input); + if (doubleField58_ == null || value != 0D) { + DoubleField58 = value; + } + break; + } + case 474: { + long? value = _single_int64Field59_codec.Read(input); + if (int64Field59_ == null || value != 0L) { + Int64Field59 = value; + } + break; + } + case 482: { + long? value = _single_int64Field60_codec.Read(input); + if (int64Field60_ == null || value != 0L) { + Int64Field60 = value; + } + break; + } + case 498: { + double? value = _single_doubleField62_codec.Read(input); + if (doubleField62_ == null || value != 0D) { + DoubleField62 = value; + } + break; + } + case 522: { + double? value = _single_doubleField65_codec.Read(input); + if (doubleField65_ == null || value != 0D) { + DoubleField65 = value; + } + break; + } + case 530: { + double? value = _single_doubleField66_codec.Read(input); + if (doubleField66_ == null || value != 0D) { + DoubleField66 = value; + } + break; + } + case 538: { + double? value = _single_doubleField67_codec.Read(input); + if (doubleField67_ == null || value != 0D) { + DoubleField67 = value; + } + break; + } + case 546: { + double? value = _single_doubleField68_codec.Read(input); + if (doubleField68_ == null || value != 0D) { + DoubleField68 = value; + } + break; + } + case 554: { + double? value = _single_doubleField69_codec.Read(input); + if (doubleField69_ == null || value != 0D) { + DoubleField69 = value; + } + break; + } + case 562: { + double? value = _single_doubleField70_codec.Read(input); + if (doubleField70_ == null || value != 0D) { + DoubleField70 = value; + } + break; + } + case 570: { + double? value = _single_doubleField71_codec.Read(input); + if (doubleField71_ == null || value != 0D) { + DoubleField71 = value; + } + break; + } + case 578: { + double? value = _single_doubleField72_codec.Read(input); + if (doubleField72_ == null || value != 0D) { + DoubleField72 = value; + } + break; + } + case 586: { + string value = _single_stringField73_codec.Read(input); + if (stringField73_ == null || value != "") { + StringField73 = value; + } + break; + } + case 594: { + string value = _single_stringField74_codec.Read(input); + if (stringField74_ == null || value != "") { + StringField74 = value; + } + break; + } + case 602: { + double? value = _single_doubleField75_codec.Read(input); + if (doubleField75_ == null || value != 0D) { + DoubleField75 = value; + } + break; + } + case 618: { + double? value = _single_doubleField77_codec.Read(input); + if (doubleField77_ == null || value != 0D) { + DoubleField77 = value; + } + break; + } + case 626: { + double? value = _single_doubleField78_codec.Read(input); + if (doubleField78_ == null || value != 0D) { + DoubleField78 = value; + } + break; + } + case 634: { + double? value = _single_doubleField79_codec.Read(input); + if (doubleField79_ == null || value != 0D) { + DoubleField79 = value; + } + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 658: { + long? value = _single_int64Field82_codec.Read(input); + if (int64Field82_ == null || value != 0L) { + Int64Field82 = value; + } + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 674: { + double? value = _single_doubleField84_codec.Read(input); + if (doubleField84_ == null || value != 0D) { + DoubleField84 = value; + } + break; + } + case 682: { + long? value = _single_int64Field85_codec.Read(input); + if (int64Field85_ == null || value != 0L) { + Int64Field85 = value; + } + break; + } + case 690: { + long? value = _single_int64Field86_codec.Read(input); + if (int64Field86_ == null || value != 0L) { + Int64Field86 = value; + } + break; + } + case 698: { + long? value = _single_int64Field87_codec.Read(input); + if (int64Field87_ == null || value != 0L) { + Int64Field87 = value; + } + break; + } + case 706: { + double? value = _single_doubleField88_codec.Read(input); + if (doubleField88_ == null || value != 0D) { + DoubleField88 = value; + } + break; + } + case 714: { + double? value = _single_doubleField89_codec.Read(input); + if (doubleField89_ == null || value != 0D) { + DoubleField89 = value; + } + break; + } + case 722: { + double? value = _single_doubleField90_codec.Read(input); + if (doubleField90_ == null || value != 0D) { + DoubleField90 = value; + } + break; + } + case 730: { + double? value = _single_doubleField91_codec.Read(input); + if (doubleField91_ == null || value != 0D) { + DoubleField91 = value; + } + break; + } + case 738: { + double? value = _single_doubleField92_codec.Read(input); + if (doubleField92_ == null || value != 0D) { + DoubleField92 = value; + } + break; + } + case 746: { + double? value = _single_doubleField93_codec.Read(input); + if (doubleField93_ == null || value != 0D) { + DoubleField93 = value; + } + break; + } + case 754: { + double? value = _single_doubleField94_codec.Read(input); + if (doubleField94_ == null || value != 0D) { + DoubleField94 = value; + } + break; + } + case 762: { + double? value = _single_doubleField95_codec.Read(input); + if (doubleField95_ == null || value != 0D) { + DoubleField95 = value; + } + break; + } + case 770: { + double? value = _single_doubleField96_codec.Read(input); + if (doubleField96_ == null || value != 0D) { + DoubleField96 = value; + } + break; + } + case 778: { + double? value = _single_doubleField97_codec.Read(input); + if (doubleField97_ == null || value != 0D) { + DoubleField97 = value; + } + break; + } + case 786: { + double? value = _single_doubleField98_codec.Read(input); + if (doubleField98_ == null || value != 0D) { + DoubleField98 = value; + } + break; + } + case 794: { + double? value = _single_doubleField99_codec.Read(input); + if (doubleField99_ == null || value != 0D) { + DoubleField99 = value; + } + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec); + break; + } + case 810: { + double? value = _single_doubleField101_codec.Read(input); + if (doubleField101_ == null || value != 0D) { + DoubleField101 = value; + } + break; + } + case 818: { + double? value = _single_doubleField102_codec.Read(input); + if (doubleField102_ == null || value != 0D) { + DoubleField102 = value; + } + break; + } + case 826: { + double? value = _single_doubleField103_codec.Read(input); + if (doubleField103_ == null || value != 0D) { + DoubleField103 = value; + } + break; + } + case 834: { + double? value = _single_doubleField104_codec.Read(input); + if (doubleField104_ == null || value != 0D) { + DoubleField104 = value; + } + break; + } + case 842: { + double? value = _single_doubleField105_codec.Read(input); + if (doubleField105_ == null || value != 0D) { + DoubleField105 = value; + } + break; + } + case 850: { + double? value = _single_doubleField106_codec.Read(input); + if (doubleField106_ == null || value != 0D) { + DoubleField106 = value; + } + break; + } + case 858: { + long? value = _single_int64Field107_codec.Read(input); + if (int64Field107_ == null || value != 0L) { + Int64Field107 = value; + } + break; + } + case 866: { + double? value = _single_doubleField108_codec.Read(input); + if (doubleField108_ == null || value != 0D) { + DoubleField108 = value; + } + break; + } + case 874: { + double? value = _single_doubleField109_codec.Read(input); + if (doubleField109_ == null || value != 0D) { + DoubleField109 = value; + } + break; + } + case 882: { + long? value = _single_int64Field110_codec.Read(input); + if (int64Field110_ == null || value != 0L) { + Int64Field110 = value; + } + break; + } + case 890: { + double? value = _single_doubleField111_codec.Read(input); + if (doubleField111_ == null || value != 0D) { + DoubleField111 = value; + } + break; + } + case 898: { + long? value = _single_int64Field112_codec.Read(input); + if (int64Field112_ == null || value != 0L) { + Int64Field112 = value; + } + break; + } + case 906: { + double? value = _single_doubleField113_codec.Read(input); + if (doubleField113_ == null || value != 0D) { + DoubleField113 = value; + } + break; + } + case 914: { + long? value = _single_int64Field114_codec.Read(input); + if (int64Field114_ == null || value != 0L) { + Int64Field114 = value; + } + break; + } + case 922: { + long? value = _single_int64Field115_codec.Read(input); + if (int64Field115_ == null || value != 0L) { + Int64Field115 = value; + } + break; + } + case 930: { + double? value = _single_doubleField116_codec.Read(input); + if (doubleField116_ == null || value != 0D) { + DoubleField116 = value; + } + break; + } + case 938: { + long? value = _single_int64Field117_codec.Read(input); + if (int64Field117_ == null || value != 0L) { + Int64Field117 = value; + } + break; + } + case 946: { + double? value = _single_doubleField118_codec.Read(input); + if (doubleField118_ == null || value != 0D) { + DoubleField118 = value; + } + break; + } + case 954: { + double? value = _single_doubleField119_codec.Read(input); + if (doubleField119_ == null || value != 0D) { + DoubleField119 = value; + } + break; + } + case 962: { + double? value = _single_doubleField120_codec.Read(input); + if (doubleField120_ == null || value != 0D) { + DoubleField120 = value; + } + break; + } + case 970: { + double? value = _single_doubleField121_codec.Read(input); + if (doubleField121_ == null || value != 0D) { + DoubleField121 = value; + } + break; + } + case 978: { + double? value = _single_doubleField122_codec.Read(input); + if (doubleField122_ == null || value != 0D) { + DoubleField122 = value; + } + break; + } + case 986: { + double? value = _single_doubleField123_codec.Read(input); + if (doubleField123_ == null || value != 0D) { + DoubleField123 = value; + } + break; + } + case 994: { + double? value = _single_doubleField124_codec.Read(input); + if (doubleField124_ == null || value != 0D) { + DoubleField124 = value; + } + break; + } + case 1002: { + long? value = _single_int64Field125_codec.Read(input); + if (int64Field125_ == null || value != 0L) { + Int64Field125 = value; + } + break; + } + case 1010: { + long? value = _single_int64Field126_codec.Read(input); + if (int64Field126_ == null || value != 0L) { + Int64Field126 = value; + } + break; + } + case 1018: { + long? value = _single_int64Field127_codec.Read(input); + if (int64Field127_ == null || value != 0L) { + Int64Field127 = value; + } + break; + } + case 1026: { + double? value = _single_doubleField128_codec.Read(input); + if (doubleField128_ == null || value != 0D) { + DoubleField128 = value; + } + break; + } + case 1034: { + double? value = _single_doubleField129_codec.Read(input); + if (doubleField129_ == null || value != 0D) { + DoubleField129 = value; + } + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + double? value = _single_doubleField1_codec.Read(ref input); + if (doubleField1_ == null || value != 0D) { + DoubleField1 = value; + } + break; + } + case 18: { + long? value = _single_int64Field2_codec.Read(ref input); + if (int64Field2_ == null || value != 0L) { + Int64Field2 = value; + } + break; + } + case 26: { + long? value = _single_int64Field3_codec.Read(ref input); + if (int64Field3_ == null || value != 0L) { + Int64Field3 = value; + } + break; + } + case 34: { + long? value = _single_int64Field4_codec.Read(ref input); + if (int64Field4_ == null || value != 0L) { + Int64Field4 = value; + } + break; + } + case 58: { + double? value = _single_doubleField7_codec.Read(ref input); + if (doubleField7_ == null || value != 0D) { + DoubleField7 = value; + } + break; + } + case 66: { + double? value = _single_doubleField8_codec.Read(ref input); + if (doubleField8_ == null || value != 0D) { + DoubleField8 = value; + } + break; + } + case 74: { + double? value = _single_doubleField9_codec.Read(ref input); + if (doubleField9_ == null || value != 0D) { + DoubleField9 = value; + } + break; + } + case 82: { + double? value = _single_doubleField10_codec.Read(ref input); + if (doubleField10_ == null || value != 0D) { + DoubleField10 = value; + } + break; + } + case 90: { + double? value = _single_doubleField11_codec.Read(ref input); + if (doubleField11_ == null || value != 0D) { + DoubleField11 = value; + } + break; + } + case 114: { + double? value = _single_doubleField14_codec.Read(ref input); + if (doubleField14_ == null || value != 0D) { + DoubleField14 = value; + } + break; + } + case 122: { + double? value = _single_doubleField15_codec.Read(ref input); + if (doubleField15_ == null || value != 0D) { + DoubleField15 = value; + } + break; + } + case 154: { + long? value = _single_int64Field19_codec.Read(ref input); + if (int64Field19_ == null || value != 0L) { + Int64Field19 = value; + } + break; + } + case 162: { + double? value = _single_doubleField20_codec.Read(ref input); + if (doubleField20_ == null || value != 0D) { + DoubleField20 = value; + } + break; + } + case 170: { + double? value = _single_doubleField21_codec.Read(ref input); + if (doubleField21_ == null || value != 0D) { + DoubleField21 = value; + } + break; + } + case 178: { + double? value = _single_doubleField22_codec.Read(ref input); + if (doubleField22_ == null || value != 0D) { + DoubleField22 = value; + } + break; + } + case 202: { + double? value = _single_doubleField25_codec.Read(ref input); + if (doubleField25_ == null || value != 0D) { + DoubleField25 = value; + } + break; + } + case 210: { + long? value = _single_int64Field26_codec.Read(ref input); + if (int64Field26_ == null || value != 0L) { + Int64Field26 = value; + } + break; + } + case 226: { + double? value = _single_doubleField28_codec.Read(ref input); + if (doubleField28_ == null || value != 0D) { + DoubleField28 = value; + } + break; + } + case 234: { + double? value = _single_doubleField29_codec.Read(ref input); + if (doubleField29_ == null || value != 0D) { + DoubleField29 = value; + } + break; + } + case 242: { + double? value = _single_doubleField30_codec.Read(ref input); + if (doubleField30_ == null || value != 0D) { + DoubleField30 = value; + } + break; + } + case 250: { + double? value = _single_doubleField31_codec.Read(ref input); + if (doubleField31_ == null || value != 0D) { + DoubleField31 = value; + } + break; + } + case 258: { + long? value = _single_int64Field32_codec.Read(ref input); + if (int64Field32_ == null || value != 0L) { + Int64Field32 = value; + } + break; + } + case 298: { + long? value = _single_int64Field37_codec.Read(ref input); + if (int64Field37_ == null || value != 0L) { + Int64Field37 = value; + } + break; + } + case 306: { + double? value = _single_doubleField38_codec.Read(ref input); + if (doubleField38_ == null || value != 0D) { + DoubleField38 = value; + } + break; + } + case 314: { + long? value = _single_interactions_codec.Read(ref input); + if (interactions_ == null || value != 0L) { + Interactions = value; + } + break; + } + case 322: { + double? value = _single_doubleField40_codec.Read(ref input); + if (doubleField40_ == null || value != 0D) { + DoubleField40 = value; + } + break; + } + case 330: { + long? value = _single_int64Field41_codec.Read(ref input); + if (int64Field41_ == null || value != 0L) { + Int64Field41 = value; + } + break; + } + case 338: { + double? value = _single_doubleField42_codec.Read(ref input); + if (doubleField42_ == null || value != 0D) { + DoubleField42 = value; + } + break; + } + case 346: { + long? value = _single_int64Field43_codec.Read(ref input); + if (int64Field43_ == null || value != 0L) { + Int64Field43 = value; + } + break; + } + case 354: { + long? value = _single_int64Field44_codec.Read(ref input); + if (int64Field44_ == null || value != 0L) { + Int64Field44 = value; + } + break; + } + case 362: { + double? value = _single_doubleField45_codec.Read(ref input); + if (doubleField45_ == null || value != 0D) { + DoubleField45 = value; + } + break; + } + case 370: { + double? value = _single_doubleField46_codec.Read(ref input); + if (doubleField46_ == null || value != 0D) { + DoubleField46 = value; + } + break; + } + case 378: { + double? value = _single_doubleField47_codec.Read(ref input); + if (doubleField47_ == null || value != 0D) { + DoubleField47 = value; + } + break; + } + case 386: { + double? value = _single_doubleField48_codec.Read(ref input); + if (doubleField48_ == null || value != 0D) { + DoubleField48 = value; + } + break; + } + case 394: { + double? value = _single_doubleField49_codec.Read(ref input); + if (doubleField49_ == null || value != 0D) { + DoubleField49 = value; + } + break; + } + case 402: { + double? value = _single_doubleField50_codec.Read(ref input); + if (doubleField50_ == null || value != 0D) { + DoubleField50 = value; + } + break; + } + case 410: { + double? value = _single_doubleField51_codec.Read(ref input); + if (doubleField51_ == null || value != 0D) { + DoubleField51 = value; + } + break; + } + case 418: { + double? value = _single_doubleField52_codec.Read(ref input); + if (doubleField52_ == null || value != 0D) { + DoubleField52 = value; + } + break; + } + case 426: { + double? value = _single_doubleField53_codec.Read(ref input); + if (doubleField53_ == null || value != 0D) { + DoubleField53 = value; + } + break; + } + case 434: { + double? value = _single_doubleField54_codec.Read(ref input); + if (doubleField54_ == null || value != 0D) { + DoubleField54 = value; + } + break; + } + case 442: { + double? value = _single_doubleField55_codec.Read(ref input); + if (doubleField55_ == null || value != 0D) { + DoubleField55 = value; + } + break; + } + case 450: { + double? value = _single_doubleField56_codec.Read(ref input); + if (doubleField56_ == null || value != 0D) { + DoubleField56 = value; + } + break; + } + case 458: { + double? value = _single_doubleField57_codec.Read(ref input); + if (doubleField57_ == null || value != 0D) { + DoubleField57 = value; + } + break; + } + case 466: { + double? value = _single_doubleField58_codec.Read(ref input); + if (doubleField58_ == null || value != 0D) { + DoubleField58 = value; + } + break; + } + case 474: { + long? value = _single_int64Field59_codec.Read(ref input); + if (int64Field59_ == null || value != 0L) { + Int64Field59 = value; + } + break; + } + case 482: { + long? value = _single_int64Field60_codec.Read(ref input); + if (int64Field60_ == null || value != 0L) { + Int64Field60 = value; + } + break; + } + case 498: { + double? value = _single_doubleField62_codec.Read(ref input); + if (doubleField62_ == null || value != 0D) { + DoubleField62 = value; + } + break; + } + case 522: { + double? value = _single_doubleField65_codec.Read(ref input); + if (doubleField65_ == null || value != 0D) { + DoubleField65 = value; + } + break; + } + case 530: { + double? value = _single_doubleField66_codec.Read(ref input); + if (doubleField66_ == null || value != 0D) { + DoubleField66 = value; + } + break; + } + case 538: { + double? value = _single_doubleField67_codec.Read(ref input); + if (doubleField67_ == null || value != 0D) { + DoubleField67 = value; + } + break; + } + case 546: { + double? value = _single_doubleField68_codec.Read(ref input); + if (doubleField68_ == null || value != 0D) { + DoubleField68 = value; + } + break; + } + case 554: { + double? value = _single_doubleField69_codec.Read(ref input); + if (doubleField69_ == null || value != 0D) { + DoubleField69 = value; + } + break; + } + case 562: { + double? value = _single_doubleField70_codec.Read(ref input); + if (doubleField70_ == null || value != 0D) { + DoubleField70 = value; + } + break; + } + case 570: { + double? value = _single_doubleField71_codec.Read(ref input); + if (doubleField71_ == null || value != 0D) { + DoubleField71 = value; + } + break; + } + case 578: { + double? value = _single_doubleField72_codec.Read(ref input); + if (doubleField72_ == null || value != 0D) { + DoubleField72 = value; + } + break; + } + case 586: { + string value = _single_stringField73_codec.Read(ref input); + if (stringField73_ == null || value != "") { + StringField73 = value; + } + break; + } + case 594: { + string value = _single_stringField74_codec.Read(ref input); + if (stringField74_ == null || value != "") { + StringField74 = value; + } + break; + } + case 602: { + double? value = _single_doubleField75_codec.Read(ref input); + if (doubleField75_ == null || value != 0D) { + DoubleField75 = value; + } + break; + } + case 618: { + double? value = _single_doubleField77_codec.Read(ref input); + if (doubleField77_ == null || value != 0D) { + DoubleField77 = value; + } + break; + } + case 626: { + double? value = _single_doubleField78_codec.Read(ref input); + if (doubleField78_ == null || value != 0D) { + DoubleField78 = value; + } + break; + } + case 634: { + double? value = _single_doubleField79_codec.Read(ref input); + if (doubleField79_ == null || value != 0D) { + DoubleField79 = value; + } + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 658: { + long? value = _single_int64Field82_codec.Read(ref input); + if (int64Field82_ == null || value != 0L) { + Int64Field82 = value; + } + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 674: { + double? value = _single_doubleField84_codec.Read(ref input); + if (doubleField84_ == null || value != 0D) { + DoubleField84 = value; + } + break; + } + case 682: { + long? value = _single_int64Field85_codec.Read(ref input); + if (int64Field85_ == null || value != 0L) { + Int64Field85 = value; + } + break; + } + case 690: { + long? value = _single_int64Field86_codec.Read(ref input); + if (int64Field86_ == null || value != 0L) { + Int64Field86 = value; + } + break; + } + case 698: { + long? value = _single_int64Field87_codec.Read(ref input); + if (int64Field87_ == null || value != 0L) { + Int64Field87 = value; + } + break; + } + case 706: { + double? value = _single_doubleField88_codec.Read(ref input); + if (doubleField88_ == null || value != 0D) { + DoubleField88 = value; + } + break; + } + case 714: { + double? value = _single_doubleField89_codec.Read(ref input); + if (doubleField89_ == null || value != 0D) { + DoubleField89 = value; + } + break; + } + case 722: { + double? value = _single_doubleField90_codec.Read(ref input); + if (doubleField90_ == null || value != 0D) { + DoubleField90 = value; + } + break; + } + case 730: { + double? value = _single_doubleField91_codec.Read(ref input); + if (doubleField91_ == null || value != 0D) { + DoubleField91 = value; + } + break; + } + case 738: { + double? value = _single_doubleField92_codec.Read(ref input); + if (doubleField92_ == null || value != 0D) { + DoubleField92 = value; + } + break; + } + case 746: { + double? value = _single_doubleField93_codec.Read(ref input); + if (doubleField93_ == null || value != 0D) { + DoubleField93 = value; + } + break; + } + case 754: { + double? value = _single_doubleField94_codec.Read(ref input); + if (doubleField94_ == null || value != 0D) { + DoubleField94 = value; + } + break; + } + case 762: { + double? value = _single_doubleField95_codec.Read(ref input); + if (doubleField95_ == null || value != 0D) { + DoubleField95 = value; + } + break; + } + case 770: { + double? value = _single_doubleField96_codec.Read(ref input); + if (doubleField96_ == null || value != 0D) { + DoubleField96 = value; + } + break; + } + case 778: { + double? value = _single_doubleField97_codec.Read(ref input); + if (doubleField97_ == null || value != 0D) { + DoubleField97 = value; + } + break; + } + case 786: { + double? value = _single_doubleField98_codec.Read(ref input); + if (doubleField98_ == null || value != 0D) { + DoubleField98 = value; + } + break; + } + case 794: { + double? value = _single_doubleField99_codec.Read(ref input); + if (doubleField99_ == null || value != 0D) { + DoubleField99 = value; + } + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec); + break; + } + case 810: { + double? value = _single_doubleField101_codec.Read(ref input); + if (doubleField101_ == null || value != 0D) { + DoubleField101 = value; + } + break; + } + case 818: { + double? value = _single_doubleField102_codec.Read(ref input); + if (doubleField102_ == null || value != 0D) { + DoubleField102 = value; + } + break; + } + case 826: { + double? value = _single_doubleField103_codec.Read(ref input); + if (doubleField103_ == null || value != 0D) { + DoubleField103 = value; + } + break; + } + case 834: { + double? value = _single_doubleField104_codec.Read(ref input); + if (doubleField104_ == null || value != 0D) { + DoubleField104 = value; + } + break; + } + case 842: { + double? value = _single_doubleField105_codec.Read(ref input); + if (doubleField105_ == null || value != 0D) { + DoubleField105 = value; + } + break; + } + case 850: { + double? value = _single_doubleField106_codec.Read(ref input); + if (doubleField106_ == null || value != 0D) { + DoubleField106 = value; + } + break; + } + case 858: { + long? value = _single_int64Field107_codec.Read(ref input); + if (int64Field107_ == null || value != 0L) { + Int64Field107 = value; + } + break; + } + case 866: { + double? value = _single_doubleField108_codec.Read(ref input); + if (doubleField108_ == null || value != 0D) { + DoubleField108 = value; + } + break; + } + case 874: { + double? value = _single_doubleField109_codec.Read(ref input); + if (doubleField109_ == null || value != 0D) { + DoubleField109 = value; + } + break; + } + case 882: { + long? value = _single_int64Field110_codec.Read(ref input); + if (int64Field110_ == null || value != 0L) { + Int64Field110 = value; + } + break; + } + case 890: { + double? value = _single_doubleField111_codec.Read(ref input); + if (doubleField111_ == null || value != 0D) { + DoubleField111 = value; + } + break; + } + case 898: { + long? value = _single_int64Field112_codec.Read(ref input); + if (int64Field112_ == null || value != 0L) { + Int64Field112 = value; + } + break; + } + case 906: { + double? value = _single_doubleField113_codec.Read(ref input); + if (doubleField113_ == null || value != 0D) { + DoubleField113 = value; + } + break; + } + case 914: { + long? value = _single_int64Field114_codec.Read(ref input); + if (int64Field114_ == null || value != 0L) { + Int64Field114 = value; + } + break; + } + case 922: { + long? value = _single_int64Field115_codec.Read(ref input); + if (int64Field115_ == null || value != 0L) { + Int64Field115 = value; + } + break; + } + case 930: { + double? value = _single_doubleField116_codec.Read(ref input); + if (doubleField116_ == null || value != 0D) { + DoubleField116 = value; + } + break; + } + case 938: { + long? value = _single_int64Field117_codec.Read(ref input); + if (int64Field117_ == null || value != 0L) { + Int64Field117 = value; + } + break; + } + case 946: { + double? value = _single_doubleField118_codec.Read(ref input); + if (doubleField118_ == null || value != 0D) { + DoubleField118 = value; + } + break; + } + case 954: { + double? value = _single_doubleField119_codec.Read(ref input); + if (doubleField119_ == null || value != 0D) { + DoubleField119 = value; + } + break; + } + case 962: { + double? value = _single_doubleField120_codec.Read(ref input); + if (doubleField120_ == null || value != 0D) { + DoubleField120 = value; + } + break; + } + case 970: { + double? value = _single_doubleField121_codec.Read(ref input); + if (doubleField121_ == null || value != 0D) { + DoubleField121 = value; + } + break; + } + case 978: { + double? value = _single_doubleField122_codec.Read(ref input); + if (doubleField122_ == null || value != 0D) { + DoubleField122 = value; + } + break; + } + case 986: { + double? value = _single_doubleField123_codec.Read(ref input); + if (doubleField123_ == null || value != 0D) { + DoubleField123 = value; + } + break; + } + case 994: { + double? value = _single_doubleField124_codec.Read(ref input); + if (doubleField124_ == null || value != 0D) { + DoubleField124 = value; + } + break; + } + case 1002: { + long? value = _single_int64Field125_codec.Read(ref input); + if (int64Field125_ == null || value != 0L) { + Int64Field125 = value; + } + break; + } + case 1010: { + long? value = _single_int64Field126_codec.Read(ref input); + if (int64Field126_ == null || value != 0L) { + Int64Field126 = value; + } + break; + } + case 1018: { + long? value = _single_int64Field127_codec.Read(ref input); + if (int64Field127_ == null || value != 0L) { + Int64Field127 = value; + } + break; + } + case 1026: { + double? value = _single_doubleField128_codec.Read(ref input); + if (doubleField128_ == null || value != 0D) { + DoubleField128 = value; + } + break; + } + case 1034: { + double? value = _single_doubleField129_codec.Read(ref input); + if (doubleField129_ == null || value != 0D) { + DoubleField129 = value; + } + break; + } + } + } + } + #endif + + } + + /// + /// same as ManyWrapperFieldsMessages, but with primitive fields + /// for comparison. + /// + public sealed partial class ManyPrimitiveFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyPrimitiveFieldsMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.Benchmarks.WrapperBenchmarkMessagesReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyPrimitiveFieldsMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyPrimitiveFieldsMessage(ManyPrimitiveFieldsMessage other) : this() { + doubleField95_ = other.doubleField95_; + doubleField1_ = other.doubleField1_; + doubleField79_ = other.doubleField79_; + int64Field2_ = other.int64Field2_; + doubleField96_ = other.doubleField96_; + int64Field3_ = other.int64Field3_; + int64Field4_ = other.int64Field4_; + doubleField97_ = other.doubleField97_; + doubleField65_ = other.doubleField65_; + doubleField66_ = other.doubleField66_; + doubleField7_ = other.doubleField7_; + doubleField62_ = other.doubleField62_; + doubleField118_ = other.doubleField118_; + doubleField119_ = other.doubleField119_; + doubleField67_ = other.doubleField67_; + doubleField120_ = other.doubleField120_; + doubleField121_ = other.doubleField121_; + doubleField122_ = other.doubleField122_; + doubleField123_ = other.doubleField123_; + doubleField124_ = other.doubleField124_; + doubleField8_ = other.doubleField8_; + doubleField9_ = other.doubleField9_; + doubleField98_ = other.doubleField98_; + doubleField10_ = other.doubleField10_; + doubleField11_ = other.doubleField11_; + doubleField99_ = other.doubleField99_; + doubleField84_ = other.doubleField84_; + doubleField14_ = other.doubleField14_; + doubleField77_ = other.doubleField77_; + doubleField15_ = other.doubleField15_; + int64Field19_ = other.int64Field19_; + int64Field115_ = other.int64Field115_; + doubleField116_ = other.doubleField116_; + int64Field117_ = other.int64Field117_; + doubleField20_ = other.doubleField20_; + doubleField21_ = other.doubleField21_; + stringField73_ = other.stringField73_; + stringField74_ = other.stringField74_; + doubleField22_ = other.doubleField22_; + doubleField69_ = other.doubleField69_; + doubleField70_ = other.doubleField70_; + doubleField71_ = other.doubleField71_; + doubleField72_ = other.doubleField72_; + doubleField25_ = other.doubleField25_; + int64Field26_ = other.int64Field26_; + doubleField68_ = other.doubleField68_; + doubleField28_ = other.doubleField28_; + doubleField106_ = other.doubleField106_; + doubleField29_ = other.doubleField29_; + doubleField30_ = other.doubleField30_; + doubleField101_ = other.doubleField101_; + doubleField102_ = other.doubleField102_; + doubleField103_ = other.doubleField103_; + doubleField104_ = other.doubleField104_; + doubleField105_ = other.doubleField105_; + doubleField31_ = other.doubleField31_; + int64Field32_ = other.int64Field32_; + doubleField75_ = other.doubleField75_; + doubleField129_ = other.doubleField129_; + enumField80_ = other.enumField80_; + enumField81_ = other.enumField81_; + int64Field82_ = other.int64Field82_; + enumField83_ = other.enumField83_; + int64Field85_ = other.int64Field85_; + int64Field86_ = other.int64Field86_; + int64Field87_ = other.int64Field87_; + int64Field125_ = other.int64Field125_; + int64Field37_ = other.int64Field37_; + doubleField38_ = other.doubleField38_; + interactions_ = other.interactions_; + repeatedIntField100_ = other.repeatedIntField100_.Clone(); + doubleField40_ = other.doubleField40_; + int64Field41_ = other.int64Field41_; + int64Field126_ = other.int64Field126_; + int64Field127_ = other.int64Field127_; + doubleField128_ = other.doubleField128_; + doubleField109_ = other.doubleField109_; + int64Field110_ = other.int64Field110_; + doubleField111_ = other.doubleField111_; + int64Field112_ = other.int64Field112_; + doubleField113_ = other.doubleField113_; + int64Field114_ = other.int64Field114_; + doubleField42_ = other.doubleField42_; + int64Field43_ = other.int64Field43_; + int64Field44_ = other.int64Field44_; + doubleField45_ = other.doubleField45_; + doubleField46_ = other.doubleField46_; + doubleField78_ = other.doubleField78_; + doubleField88_ = other.doubleField88_; + doubleField47_ = other.doubleField47_; + doubleField89_ = other.doubleField89_; + doubleField48_ = other.doubleField48_; + doubleField49_ = other.doubleField49_; + doubleField50_ = other.doubleField50_; + doubleField90_ = other.doubleField90_; + doubleField51_ = other.doubleField51_; + doubleField91_ = other.doubleField91_; + doubleField92_ = other.doubleField92_; + int64Field107_ = other.int64Field107_; + doubleField93_ = other.doubleField93_; + doubleField108_ = other.doubleField108_; + doubleField52_ = other.doubleField52_; + doubleField53_ = other.doubleField53_; + doubleField94_ = other.doubleField94_; + doubleField54_ = other.doubleField54_; + doubleField55_ = other.doubleField55_; + doubleField56_ = other.doubleField56_; + doubleField57_ = other.doubleField57_; + doubleField58_ = other.doubleField58_; + int64Field59_ = other.int64Field59_; + int64Field60_ = other.int64Field60_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyPrimitiveFieldsMessage Clone() { + return new ManyPrimitiveFieldsMessage(this); + } + + /// Field number for the "double_field_95" field. + public const int DoubleField95FieldNumber = 95; + private double doubleField95_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField95 { + get { return doubleField95_; } + set { + doubleField95_ = value; + } + } + + /// Field number for the "double_field_1" field. + public const int DoubleField1FieldNumber = 1; + private double doubleField1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField1 { + get { return doubleField1_; } + set { + doubleField1_ = value; + } + } + + /// Field number for the "double_field_79" field. + public const int DoubleField79FieldNumber = 79; + private double doubleField79_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField79 { + get { return doubleField79_; } + set { + doubleField79_ = value; + } + } + + /// Field number for the "int64_field_2" field. + public const int Int64Field2FieldNumber = 2; + private long int64Field2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field2 { + get { return int64Field2_; } + set { + int64Field2_ = value; + } + } + + /// Field number for the "double_field_96" field. + public const int DoubleField96FieldNumber = 96; + private double doubleField96_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField96 { + get { return doubleField96_; } + set { + doubleField96_ = value; + } + } + + /// Field number for the "int64_field_3" field. + public const int Int64Field3FieldNumber = 3; + private long int64Field3_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field3 { + get { return int64Field3_; } + set { + int64Field3_ = value; + } + } + + /// Field number for the "int64_field_4" field. + public const int Int64Field4FieldNumber = 4; + private long int64Field4_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field4 { + get { return int64Field4_; } + set { + int64Field4_ = value; + } + } + + /// Field number for the "double_field_97" field. + public const int DoubleField97FieldNumber = 97; + private double doubleField97_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField97 { + get { return doubleField97_; } + set { + doubleField97_ = value; + } + } + + /// Field number for the "double_field_65" field. + public const int DoubleField65FieldNumber = 65; + private double doubleField65_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField65 { + get { return doubleField65_; } + set { + doubleField65_ = value; + } + } + + /// Field number for the "double_field_66" field. + public const int DoubleField66FieldNumber = 66; + private double doubleField66_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField66 { + get { return doubleField66_; } + set { + doubleField66_ = value; + } + } + + /// Field number for the "double_field_7" field. + public const int DoubleField7FieldNumber = 7; + private double doubleField7_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField7 { + get { return doubleField7_; } + set { + doubleField7_ = value; + } + } + + /// Field number for the "double_field_62" field. + public const int DoubleField62FieldNumber = 62; + private double doubleField62_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField62 { + get { return doubleField62_; } + set { + doubleField62_ = value; + } + } + + /// Field number for the "double_field_118" field. + public const int DoubleField118FieldNumber = 118; + private double doubleField118_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField118 { + get { return doubleField118_; } + set { + doubleField118_ = value; + } + } + + /// Field number for the "double_field_119" field. + public const int DoubleField119FieldNumber = 119; + private double doubleField119_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField119 { + get { return doubleField119_; } + set { + doubleField119_ = value; + } + } + + /// Field number for the "double_field_67" field. + public const int DoubleField67FieldNumber = 67; + private double doubleField67_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField67 { + get { return doubleField67_; } + set { + doubleField67_ = value; + } + } + + /// Field number for the "double_field_120" field. + public const int DoubleField120FieldNumber = 120; + private double doubleField120_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField120 { + get { return doubleField120_; } + set { + doubleField120_ = value; + } + } + + /// Field number for the "double_field_121" field. + public const int DoubleField121FieldNumber = 121; + private double doubleField121_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField121 { + get { return doubleField121_; } + set { + doubleField121_ = value; + } + } + + /// Field number for the "double_field_122" field. + public const int DoubleField122FieldNumber = 122; + private double doubleField122_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField122 { + get { return doubleField122_; } + set { + doubleField122_ = value; + } + } + + /// Field number for the "double_field_123" field. + public const int DoubleField123FieldNumber = 123; + private double doubleField123_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField123 { + get { return doubleField123_; } + set { + doubleField123_ = value; + } + } + + /// Field number for the "double_field_124" field. + public const int DoubleField124FieldNumber = 124; + private double doubleField124_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField124 { + get { return doubleField124_; } + set { + doubleField124_ = value; + } + } + + /// Field number for the "double_field_8" field. + public const int DoubleField8FieldNumber = 8; + private double doubleField8_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField8 { + get { return doubleField8_; } + set { + doubleField8_ = value; + } + } + + /// Field number for the "double_field_9" field. + public const int DoubleField9FieldNumber = 9; + private double doubleField9_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField9 { + get { return doubleField9_; } + set { + doubleField9_ = value; + } + } + + /// Field number for the "double_field_98" field. + public const int DoubleField98FieldNumber = 98; + private double doubleField98_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField98 { + get { return doubleField98_; } + set { + doubleField98_ = value; + } + } + + /// Field number for the "double_field_10" field. + public const int DoubleField10FieldNumber = 10; + private double doubleField10_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField10 { + get { return doubleField10_; } + set { + doubleField10_ = value; + } + } + + /// Field number for the "double_field_11" field. + public const int DoubleField11FieldNumber = 11; + private double doubleField11_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField11 { + get { return doubleField11_; } + set { + doubleField11_ = value; + } + } + + /// Field number for the "double_field_99" field. + public const int DoubleField99FieldNumber = 99; + private double doubleField99_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField99 { + get { return doubleField99_; } + set { + doubleField99_ = value; + } + } + + /// Field number for the "double_field_84" field. + public const int DoubleField84FieldNumber = 84; + private double doubleField84_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField84 { + get { return doubleField84_; } + set { + doubleField84_ = value; + } + } + + /// Field number for the "double_field_14" field. + public const int DoubleField14FieldNumber = 14; + private double doubleField14_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField14 { + get { return doubleField14_; } + set { + doubleField14_ = value; + } + } + + /// Field number for the "double_field_77" field. + public const int DoubleField77FieldNumber = 77; + private double doubleField77_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField77 { + get { return doubleField77_; } + set { + doubleField77_ = value; + } + } + + /// Field number for the "double_field_15" field. + public const int DoubleField15FieldNumber = 15; + private double doubleField15_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField15 { + get { return doubleField15_; } + set { + doubleField15_ = value; + } + } + + /// Field number for the "int64_field_19" field. + public const int Int64Field19FieldNumber = 19; + private long int64Field19_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field19 { + get { return int64Field19_; } + set { + int64Field19_ = value; + } + } + + /// Field number for the "int64_field_115" field. + public const int Int64Field115FieldNumber = 115; + private long int64Field115_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field115 { + get { return int64Field115_; } + set { + int64Field115_ = value; + } + } + + /// Field number for the "double_field_116" field. + public const int DoubleField116FieldNumber = 116; + private double doubleField116_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField116 { + get { return doubleField116_; } + set { + doubleField116_ = value; + } + } + + /// Field number for the "int64_field_117" field. + public const int Int64Field117FieldNumber = 117; + private long int64Field117_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field117 { + get { return int64Field117_; } + set { + int64Field117_ = value; + } + } + + /// Field number for the "double_field_20" field. + public const int DoubleField20FieldNumber = 20; + private double doubleField20_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField20 { + get { return doubleField20_; } + set { + doubleField20_ = value; + } + } + + /// Field number for the "double_field_21" field. + public const int DoubleField21FieldNumber = 21; + private double doubleField21_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField21 { + get { return doubleField21_; } + set { + doubleField21_ = value; + } + } + + /// Field number for the "string_field_73" field. + public const int StringField73FieldNumber = 73; + private string stringField73_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StringField73 { + get { return stringField73_; } + set { + stringField73_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "string_field_74" field. + public const int StringField74FieldNumber = 74; + private string stringField74_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StringField74 { + get { return stringField74_; } + set { + stringField74_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "double_field_22" field. + public const int DoubleField22FieldNumber = 22; + private double doubleField22_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField22 { + get { return doubleField22_; } + set { + doubleField22_ = value; + } + } + + /// Field number for the "double_field_69" field. + public const int DoubleField69FieldNumber = 69; + private double doubleField69_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField69 { + get { return doubleField69_; } + set { + doubleField69_ = value; + } + } + + /// Field number for the "double_field_70" field. + public const int DoubleField70FieldNumber = 70; + private double doubleField70_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField70 { + get { return doubleField70_; } + set { + doubleField70_ = value; + } + } + + /// Field number for the "double_field_71" field. + public const int DoubleField71FieldNumber = 71; + private double doubleField71_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField71 { + get { return doubleField71_; } + set { + doubleField71_ = value; + } + } + + /// Field number for the "double_field_72" field. + public const int DoubleField72FieldNumber = 72; + private double doubleField72_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField72 { + get { return doubleField72_; } + set { + doubleField72_ = value; + } + } + + /// Field number for the "double_field_25" field. + public const int DoubleField25FieldNumber = 25; + private double doubleField25_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField25 { + get { return doubleField25_; } + set { + doubleField25_ = value; + } + } + + /// Field number for the "int64_field_26" field. + public const int Int64Field26FieldNumber = 26; + private long int64Field26_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field26 { + get { return int64Field26_; } + set { + int64Field26_ = value; + } + } + + /// Field number for the "double_field_68" field. + public const int DoubleField68FieldNumber = 68; + private double doubleField68_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField68 { + get { return doubleField68_; } + set { + doubleField68_ = value; + } + } + + /// Field number for the "double_field_28" field. + public const int DoubleField28FieldNumber = 28; + private double doubleField28_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField28 { + get { return doubleField28_; } + set { + doubleField28_ = value; + } + } + + /// Field number for the "double_field_106" field. + public const int DoubleField106FieldNumber = 106; + private double doubleField106_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField106 { + get { return doubleField106_; } + set { + doubleField106_ = value; + } + } + + /// Field number for the "double_field_29" field. + public const int DoubleField29FieldNumber = 29; + private double doubleField29_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField29 { + get { return doubleField29_; } + set { + doubleField29_ = value; + } + } + + /// Field number for the "double_field_30" field. + public const int DoubleField30FieldNumber = 30; + private double doubleField30_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField30 { + get { return doubleField30_; } + set { + doubleField30_ = value; + } + } + + /// Field number for the "double_field_101" field. + public const int DoubleField101FieldNumber = 101; + private double doubleField101_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField101 { + get { return doubleField101_; } + set { + doubleField101_ = value; + } + } + + /// Field number for the "double_field_102" field. + public const int DoubleField102FieldNumber = 102; + private double doubleField102_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField102 { + get { return doubleField102_; } + set { + doubleField102_ = value; + } + } + + /// Field number for the "double_field_103" field. + public const int DoubleField103FieldNumber = 103; + private double doubleField103_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField103 { + get { return doubleField103_; } + set { + doubleField103_ = value; + } + } + + /// Field number for the "double_field_104" field. + public const int DoubleField104FieldNumber = 104; + private double doubleField104_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField104 { + get { return doubleField104_; } + set { + doubleField104_ = value; + } + } + + /// Field number for the "double_field_105" field. + public const int DoubleField105FieldNumber = 105; + private double doubleField105_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField105 { + get { return doubleField105_; } + set { + doubleField105_ = value; + } + } + + /// Field number for the "double_field_31" field. + public const int DoubleField31FieldNumber = 31; + private double doubleField31_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField31 { + get { return doubleField31_; } + set { + doubleField31_ = value; + } + } + + /// Field number for the "int64_field_32" field. + public const int Int64Field32FieldNumber = 32; + private long int64Field32_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field32 { + get { return int64Field32_; } + set { + int64Field32_ = value; + } + } + + /// Field number for the "double_field_75" field. + public const int DoubleField75FieldNumber = 75; + private double doubleField75_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField75 { + get { return doubleField75_; } + set { + doubleField75_ = value; + } + } + + /// Field number for the "double_field_129" field. + public const int DoubleField129FieldNumber = 129; + private double doubleField129_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField129 { + get { return doubleField129_; } + set { + doubleField129_ = value; + } + } + + /// Field number for the "enum_field_80" field. + public const int EnumField80FieldNumber = 80; + private int enumField80_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int EnumField80 { + get { return enumField80_; } + set { + enumField80_ = value; + } + } + + /// Field number for the "enum_field_81" field. + public const int EnumField81FieldNumber = 81; + private int enumField81_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int EnumField81 { + get { return enumField81_; } + set { + enumField81_ = value; + } + } + + /// Field number for the "int64_field_82" field. + public const int Int64Field82FieldNumber = 82; + private long int64Field82_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field82 { + get { return int64Field82_; } + set { + int64Field82_ = value; + } + } + + /// Field number for the "enum_field_83" field. + public const int EnumField83FieldNumber = 83; + private int enumField83_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int EnumField83 { + get { return enumField83_; } + set { + enumField83_ = value; + } + } + + /// Field number for the "int64_field_85" field. + public const int Int64Field85FieldNumber = 85; + private long int64Field85_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field85 { + get { return int64Field85_; } + set { + int64Field85_ = value; + } + } + + /// Field number for the "int64_field_86" field. + public const int Int64Field86FieldNumber = 86; + private long int64Field86_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field86 { + get { return int64Field86_; } + set { + int64Field86_ = value; + } + } + + /// Field number for the "int64_field_87" field. + public const int Int64Field87FieldNumber = 87; + private long int64Field87_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field87 { + get { return int64Field87_; } + set { + int64Field87_ = value; + } + } + + /// Field number for the "int64_field_125" field. + public const int Int64Field125FieldNumber = 125; + private long int64Field125_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field125 { + get { return int64Field125_; } + set { + int64Field125_ = value; + } + } + + /// Field number for the "int64_field_37" field. + public const int Int64Field37FieldNumber = 37; + private long int64Field37_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field37 { + get { return int64Field37_; } + set { + int64Field37_ = value; + } + } + + /// Field number for the "double_field_38" field. + public const int DoubleField38FieldNumber = 38; + private double doubleField38_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField38 { + get { return doubleField38_; } + set { + doubleField38_ = value; + } + } + + /// Field number for the "interactions" field. + public const int InteractionsFieldNumber = 39; + private long interactions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Interactions { + get { return interactions_; } + set { + interactions_ = value; + } + } + + /// Field number for the "repeated_int_field_100" field. + public const int RepeatedIntField100FieldNumber = 100; + private static readonly pb::FieldCodec _repeated_repeatedIntField100_codec + = pb::FieldCodec.ForInt32(802); + private readonly pbc::RepeatedField repeatedIntField100_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField RepeatedIntField100 { + get { return repeatedIntField100_; } + } + + /// Field number for the "double_field_40" field. + public const int DoubleField40FieldNumber = 40; + private double doubleField40_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField40 { + get { return doubleField40_; } + set { + doubleField40_ = value; + } + } + + /// Field number for the "int64_field_41" field. + public const int Int64Field41FieldNumber = 41; + private long int64Field41_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field41 { + get { return int64Field41_; } + set { + int64Field41_ = value; + } + } + + /// Field number for the "int64_field_126" field. + public const int Int64Field126FieldNumber = 126; + private long int64Field126_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field126 { + get { return int64Field126_; } + set { + int64Field126_ = value; + } + } + + /// Field number for the "int64_field_127" field. + public const int Int64Field127FieldNumber = 127; + private long int64Field127_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field127 { + get { return int64Field127_; } + set { + int64Field127_ = value; + } + } + + /// Field number for the "double_field_128" field. + public const int DoubleField128FieldNumber = 128; + private double doubleField128_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField128 { + get { return doubleField128_; } + set { + doubleField128_ = value; + } + } + + /// Field number for the "double_field_109" field. + public const int DoubleField109FieldNumber = 109; + private double doubleField109_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField109 { + get { return doubleField109_; } + set { + doubleField109_ = value; + } + } + + /// Field number for the "int64_field_110" field. + public const int Int64Field110FieldNumber = 110; + private long int64Field110_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field110 { + get { return int64Field110_; } + set { + int64Field110_ = value; + } + } + + /// Field number for the "double_field_111" field. + public const int DoubleField111FieldNumber = 111; + private double doubleField111_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField111 { + get { return doubleField111_; } + set { + doubleField111_ = value; + } + } + + /// Field number for the "int64_field_112" field. + public const int Int64Field112FieldNumber = 112; + private long int64Field112_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field112 { + get { return int64Field112_; } + set { + int64Field112_ = value; + } + } + + /// Field number for the "double_field_113" field. + public const int DoubleField113FieldNumber = 113; + private double doubleField113_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField113 { + get { return doubleField113_; } + set { + doubleField113_ = value; + } + } + + /// Field number for the "int64_field_114" field. + public const int Int64Field114FieldNumber = 114; + private long int64Field114_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field114 { + get { return int64Field114_; } + set { + int64Field114_ = value; + } + } + + /// Field number for the "double_field_42" field. + public const int DoubleField42FieldNumber = 42; + private double doubleField42_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField42 { + get { return doubleField42_; } + set { + doubleField42_ = value; + } + } + + /// Field number for the "int64_field_43" field. + public const int Int64Field43FieldNumber = 43; + private long int64Field43_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field43 { + get { return int64Field43_; } + set { + int64Field43_ = value; + } + } + + /// Field number for the "int64_field_44" field. + public const int Int64Field44FieldNumber = 44; + private long int64Field44_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field44 { + get { return int64Field44_; } + set { + int64Field44_ = value; + } + } + + /// Field number for the "double_field_45" field. + public const int DoubleField45FieldNumber = 45; + private double doubleField45_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField45 { + get { return doubleField45_; } + set { + doubleField45_ = value; + } + } + + /// Field number for the "double_field_46" field. + public const int DoubleField46FieldNumber = 46; + private double doubleField46_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField46 { + get { return doubleField46_; } + set { + doubleField46_ = value; + } + } + + /// Field number for the "double_field_78" field. + public const int DoubleField78FieldNumber = 78; + private double doubleField78_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField78 { + get { return doubleField78_; } + set { + doubleField78_ = value; + } + } + + /// Field number for the "double_field_88" field. + public const int DoubleField88FieldNumber = 88; + private double doubleField88_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField88 { + get { return doubleField88_; } + set { + doubleField88_ = value; + } + } + + /// Field number for the "double_field_47" field. + public const int DoubleField47FieldNumber = 47; + private double doubleField47_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField47 { + get { return doubleField47_; } + set { + doubleField47_ = value; + } + } + + /// Field number for the "double_field_89" field. + public const int DoubleField89FieldNumber = 89; + private double doubleField89_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField89 { + get { return doubleField89_; } + set { + doubleField89_ = value; + } + } + + /// Field number for the "double_field_48" field. + public const int DoubleField48FieldNumber = 48; + private double doubleField48_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField48 { + get { return doubleField48_; } + set { + doubleField48_ = value; + } + } + + /// Field number for the "double_field_49" field. + public const int DoubleField49FieldNumber = 49; + private double doubleField49_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField49 { + get { return doubleField49_; } + set { + doubleField49_ = value; + } + } + + /// Field number for the "double_field_50" field. + public const int DoubleField50FieldNumber = 50; + private double doubleField50_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField50 { + get { return doubleField50_; } + set { + doubleField50_ = value; + } + } + + /// Field number for the "double_field_90" field. + public const int DoubleField90FieldNumber = 90; + private double doubleField90_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField90 { + get { return doubleField90_; } + set { + doubleField90_ = value; + } + } + + /// Field number for the "double_field_51" field. + public const int DoubleField51FieldNumber = 51; + private double doubleField51_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField51 { + get { return doubleField51_; } + set { + doubleField51_ = value; + } + } + + /// Field number for the "double_field_91" field. + public const int DoubleField91FieldNumber = 91; + private double doubleField91_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField91 { + get { return doubleField91_; } + set { + doubleField91_ = value; + } + } + + /// Field number for the "double_field_92" field. + public const int DoubleField92FieldNumber = 92; + private double doubleField92_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField92 { + get { return doubleField92_; } + set { + doubleField92_ = value; + } + } + + /// Field number for the "int64_field_107" field. + public const int Int64Field107FieldNumber = 107; + private long int64Field107_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field107 { + get { return int64Field107_; } + set { + int64Field107_ = value; + } + } + + /// Field number for the "double_field_93" field. + public const int DoubleField93FieldNumber = 93; + private double doubleField93_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField93 { + get { return doubleField93_; } + set { + doubleField93_ = value; + } + } + + /// Field number for the "double_field_108" field. + public const int DoubleField108FieldNumber = 108; + private double doubleField108_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField108 { + get { return doubleField108_; } + set { + doubleField108_ = value; + } + } + + /// Field number for the "double_field_52" field. + public const int DoubleField52FieldNumber = 52; + private double doubleField52_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField52 { + get { return doubleField52_; } + set { + doubleField52_ = value; + } + } + + /// Field number for the "double_field_53" field. + public const int DoubleField53FieldNumber = 53; + private double doubleField53_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField53 { + get { return doubleField53_; } + set { + doubleField53_ = value; + } + } + + /// Field number for the "double_field_94" field. + public const int DoubleField94FieldNumber = 94; + private double doubleField94_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField94 { + get { return doubleField94_; } + set { + doubleField94_ = value; + } + } + + /// Field number for the "double_field_54" field. + public const int DoubleField54FieldNumber = 54; + private double doubleField54_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField54 { + get { return doubleField54_; } + set { + doubleField54_ = value; + } + } + + /// Field number for the "double_field_55" field. + public const int DoubleField55FieldNumber = 55; + private double doubleField55_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField55 { + get { return doubleField55_; } + set { + doubleField55_ = value; + } + } + + /// Field number for the "double_field_56" field. + public const int DoubleField56FieldNumber = 56; + private double doubleField56_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField56 { + get { return doubleField56_; } + set { + doubleField56_ = value; + } + } + + /// Field number for the "double_field_57" field. + public const int DoubleField57FieldNumber = 57; + private double doubleField57_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField57 { + get { return doubleField57_; } + set { + doubleField57_ = value; + } + } + + /// Field number for the "double_field_58" field. + public const int DoubleField58FieldNumber = 58; + private double doubleField58_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DoubleField58 { + get { return doubleField58_; } + set { + doubleField58_ = value; + } + } + + /// Field number for the "int64_field_59" field. + public const int Int64Field59FieldNumber = 59; + private long int64Field59_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field59 { + get { return int64Field59_; } + set { + int64Field59_ = value; + } + } + + /// Field number for the "int64_field_60" field. + public const int Int64Field60FieldNumber = 60; + private long int64Field60_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Int64Field60 { + get { return int64Field60_; } + set { + int64Field60_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ManyPrimitiveFieldsMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ManyPrimitiveFieldsMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField95, other.DoubleField95)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField1, other.DoubleField1)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField79, other.DoubleField79)) return false; + if (Int64Field2 != other.Int64Field2) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField96, other.DoubleField96)) return false; + if (Int64Field3 != other.Int64Field3) return false; + if (Int64Field4 != other.Int64Field4) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField97, other.DoubleField97)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField65, other.DoubleField65)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField66, other.DoubleField66)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField7, other.DoubleField7)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField62, other.DoubleField62)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField118, other.DoubleField118)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField119, other.DoubleField119)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField67, other.DoubleField67)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField120, other.DoubleField120)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField121, other.DoubleField121)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField122, other.DoubleField122)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField123, other.DoubleField123)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField124, other.DoubleField124)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField8, other.DoubleField8)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField9, other.DoubleField9)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField98, other.DoubleField98)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField10, other.DoubleField10)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField11, other.DoubleField11)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField99, other.DoubleField99)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField84, other.DoubleField84)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField14, other.DoubleField14)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField77, other.DoubleField77)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField15, other.DoubleField15)) return false; + if (Int64Field19 != other.Int64Field19) return false; + if (Int64Field115 != other.Int64Field115) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField116, other.DoubleField116)) return false; + if (Int64Field117 != other.Int64Field117) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField20, other.DoubleField20)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField21, other.DoubleField21)) return false; + if (StringField73 != other.StringField73) return false; + if (StringField74 != other.StringField74) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField22, other.DoubleField22)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField69, other.DoubleField69)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField70, other.DoubleField70)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField71, other.DoubleField71)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField72, other.DoubleField72)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField25, other.DoubleField25)) return false; + if (Int64Field26 != other.Int64Field26) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField68, other.DoubleField68)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField28, other.DoubleField28)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField106, other.DoubleField106)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField29, other.DoubleField29)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField30, other.DoubleField30)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField101, other.DoubleField101)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField102, other.DoubleField102)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField103, other.DoubleField103)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField104, other.DoubleField104)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField105, other.DoubleField105)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField31, other.DoubleField31)) return false; + if (Int64Field32 != other.Int64Field32) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField75, other.DoubleField75)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField129, other.DoubleField129)) return false; + if (EnumField80 != other.EnumField80) return false; + if (EnumField81 != other.EnumField81) return false; + if (Int64Field82 != other.Int64Field82) return false; + if (EnumField83 != other.EnumField83) return false; + if (Int64Field85 != other.Int64Field85) return false; + if (Int64Field86 != other.Int64Field86) return false; + if (Int64Field87 != other.Int64Field87) return false; + if (Int64Field125 != other.Int64Field125) return false; + if (Int64Field37 != other.Int64Field37) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField38, other.DoubleField38)) return false; + if (Interactions != other.Interactions) return false; + if(!repeatedIntField100_.Equals(other.repeatedIntField100_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField40, other.DoubleField40)) return false; + if (Int64Field41 != other.Int64Field41) return false; + if (Int64Field126 != other.Int64Field126) return false; + if (Int64Field127 != other.Int64Field127) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField128, other.DoubleField128)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField109, other.DoubleField109)) return false; + if (Int64Field110 != other.Int64Field110) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField111, other.DoubleField111)) return false; + if (Int64Field112 != other.Int64Field112) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField113, other.DoubleField113)) return false; + if (Int64Field114 != other.Int64Field114) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField42, other.DoubleField42)) return false; + if (Int64Field43 != other.Int64Field43) return false; + if (Int64Field44 != other.Int64Field44) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField45, other.DoubleField45)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField46, other.DoubleField46)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField78, other.DoubleField78)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField88, other.DoubleField88)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField47, other.DoubleField47)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField89, other.DoubleField89)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField48, other.DoubleField48)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField49, other.DoubleField49)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField50, other.DoubleField50)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField90, other.DoubleField90)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField51, other.DoubleField51)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField91, other.DoubleField91)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField92, other.DoubleField92)) return false; + if (Int64Field107 != other.Int64Field107) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField93, other.DoubleField93)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField108, other.DoubleField108)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField52, other.DoubleField52)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField53, other.DoubleField53)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField94, other.DoubleField94)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField54, other.DoubleField54)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField55, other.DoubleField55)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField56, other.DoubleField56)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField57, other.DoubleField57)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField58, other.DoubleField58)) return false; + if (Int64Field59 != other.Int64Field59) return false; + if (Int64Field60 != other.Int64Field60) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (DoubleField95 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField95); + if (DoubleField1 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField1); + if (DoubleField79 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField79); + if (Int64Field2 != 0L) hash ^= Int64Field2.GetHashCode(); + if (DoubleField96 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField96); + if (Int64Field3 != 0L) hash ^= Int64Field3.GetHashCode(); + if (Int64Field4 != 0L) hash ^= Int64Field4.GetHashCode(); + if (DoubleField97 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField97); + if (DoubleField65 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField65); + if (DoubleField66 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField66); + if (DoubleField7 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField7); + if (DoubleField62 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField62); + if (DoubleField118 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField118); + if (DoubleField119 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField119); + if (DoubleField67 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField67); + if (DoubleField120 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField120); + if (DoubleField121 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField121); + if (DoubleField122 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField122); + if (DoubleField123 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField123); + if (DoubleField124 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField124); + if (DoubleField8 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField8); + if (DoubleField9 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField9); + if (DoubleField98 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField98); + if (DoubleField10 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField10); + if (DoubleField11 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField11); + if (DoubleField99 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField99); + if (DoubleField84 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField84); + if (DoubleField14 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField14); + if (DoubleField77 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField77); + if (DoubleField15 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField15); + if (Int64Field19 != 0L) hash ^= Int64Field19.GetHashCode(); + if (Int64Field115 != 0L) hash ^= Int64Field115.GetHashCode(); + if (DoubleField116 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField116); + if (Int64Field117 != 0L) hash ^= Int64Field117.GetHashCode(); + if (DoubleField20 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField20); + if (DoubleField21 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField21); + if (StringField73.Length != 0) hash ^= StringField73.GetHashCode(); + if (StringField74.Length != 0) hash ^= StringField74.GetHashCode(); + if (DoubleField22 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField22); + if (DoubleField69 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField69); + if (DoubleField70 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField70); + if (DoubleField71 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField71); + if (DoubleField72 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField72); + if (DoubleField25 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField25); + if (Int64Field26 != 0L) hash ^= Int64Field26.GetHashCode(); + if (DoubleField68 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField68); + if (DoubleField28 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField28); + if (DoubleField106 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField106); + if (DoubleField29 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField29); + if (DoubleField30 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField30); + if (DoubleField101 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField101); + if (DoubleField102 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField102); + if (DoubleField103 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField103); + if (DoubleField104 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField104); + if (DoubleField105 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField105); + if (DoubleField31 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField31); + if (Int64Field32 != 0L) hash ^= Int64Field32.GetHashCode(); + if (DoubleField75 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField75); + if (DoubleField129 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField129); + if (EnumField80 != 0) hash ^= EnumField80.GetHashCode(); + if (EnumField81 != 0) hash ^= EnumField81.GetHashCode(); + if (Int64Field82 != 0L) hash ^= Int64Field82.GetHashCode(); + if (EnumField83 != 0) hash ^= EnumField83.GetHashCode(); + if (Int64Field85 != 0L) hash ^= Int64Field85.GetHashCode(); + if (Int64Field86 != 0L) hash ^= Int64Field86.GetHashCode(); + if (Int64Field87 != 0L) hash ^= Int64Field87.GetHashCode(); + if (Int64Field125 != 0L) hash ^= Int64Field125.GetHashCode(); + if (Int64Field37 != 0L) hash ^= Int64Field37.GetHashCode(); + if (DoubleField38 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField38); + if (Interactions != 0L) hash ^= Interactions.GetHashCode(); + hash ^= repeatedIntField100_.GetHashCode(); + if (DoubleField40 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField40); + if (Int64Field41 != 0L) hash ^= Int64Field41.GetHashCode(); + if (Int64Field126 != 0L) hash ^= Int64Field126.GetHashCode(); + if (Int64Field127 != 0L) hash ^= Int64Field127.GetHashCode(); + if (DoubleField128 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField128); + if (DoubleField109 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField109); + if (Int64Field110 != 0L) hash ^= Int64Field110.GetHashCode(); + if (DoubleField111 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField111); + if (Int64Field112 != 0L) hash ^= Int64Field112.GetHashCode(); + if (DoubleField113 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField113); + if (Int64Field114 != 0L) hash ^= Int64Field114.GetHashCode(); + if (DoubleField42 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField42); + if (Int64Field43 != 0L) hash ^= Int64Field43.GetHashCode(); + if (Int64Field44 != 0L) hash ^= Int64Field44.GetHashCode(); + if (DoubleField45 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField45); + if (DoubleField46 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField46); + if (DoubleField78 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField78); + if (DoubleField88 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField88); + if (DoubleField47 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField47); + if (DoubleField89 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField89); + if (DoubleField48 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField48); + if (DoubleField49 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField49); + if (DoubleField50 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField50); + if (DoubleField90 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField90); + if (DoubleField51 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField51); + if (DoubleField91 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField91); + if (DoubleField92 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField92); + if (Int64Field107 != 0L) hash ^= Int64Field107.GetHashCode(); + if (DoubleField93 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField93); + if (DoubleField108 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField108); + if (DoubleField52 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField52); + if (DoubleField53 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField53); + if (DoubleField94 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField94); + if (DoubleField54 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField54); + if (DoubleField55 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField55); + if (DoubleField56 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField56); + if (DoubleField57 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField57); + if (DoubleField58 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField58); + if (Int64Field59 != 0L) hash ^= Int64Field59.GetHashCode(); + if (Int64Field60 != 0L) hash ^= Int64Field60.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (DoubleField1 != 0D) { + output.WriteRawTag(9); + output.WriteDouble(DoubleField1); + } + if (Int64Field2 != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Int64Field2); + } + if (Int64Field3 != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Int64Field3); + } + if (Int64Field4 != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Int64Field4); + } + if (DoubleField7 != 0D) { + output.WriteRawTag(57); + output.WriteDouble(DoubleField7); + } + if (DoubleField8 != 0D) { + output.WriteRawTag(65); + output.WriteDouble(DoubleField8); + } + if (DoubleField9 != 0D) { + output.WriteRawTag(73); + output.WriteDouble(DoubleField9); + } + if (DoubleField10 != 0D) { + output.WriteRawTag(81); + output.WriteDouble(DoubleField10); + } + if (DoubleField11 != 0D) { + output.WriteRawTag(89); + output.WriteDouble(DoubleField11); + } + if (DoubleField14 != 0D) { + output.WriteRawTag(113); + output.WriteDouble(DoubleField14); + } + if (DoubleField15 != 0D) { + output.WriteRawTag(121); + output.WriteDouble(DoubleField15); + } + if (Int64Field19 != 0L) { + output.WriteRawTag(152, 1); + output.WriteInt64(Int64Field19); + } + if (DoubleField20 != 0D) { + output.WriteRawTag(161, 1); + output.WriteDouble(DoubleField20); + } + if (DoubleField21 != 0D) { + output.WriteRawTag(169, 1); + output.WriteDouble(DoubleField21); + } + if (DoubleField22 != 0D) { + output.WriteRawTag(177, 1); + output.WriteDouble(DoubleField22); + } + if (DoubleField25 != 0D) { + output.WriteRawTag(201, 1); + output.WriteDouble(DoubleField25); + } + if (Int64Field26 != 0L) { + output.WriteRawTag(208, 1); + output.WriteInt64(Int64Field26); + } + if (DoubleField28 != 0D) { + output.WriteRawTag(225, 1); + output.WriteDouble(DoubleField28); + } + if (DoubleField29 != 0D) { + output.WriteRawTag(233, 1); + output.WriteDouble(DoubleField29); + } + if (DoubleField30 != 0D) { + output.WriteRawTag(241, 1); + output.WriteDouble(DoubleField30); + } + if (DoubleField31 != 0D) { + output.WriteRawTag(249, 1); + output.WriteDouble(DoubleField31); + } + if (Int64Field32 != 0L) { + output.WriteRawTag(128, 2); + output.WriteInt64(Int64Field32); + } + if (Int64Field37 != 0L) { + output.WriteRawTag(168, 2); + output.WriteInt64(Int64Field37); + } + if (DoubleField38 != 0D) { + output.WriteRawTag(177, 2); + output.WriteDouble(DoubleField38); + } + if (Interactions != 0L) { + output.WriteRawTag(184, 2); + output.WriteInt64(Interactions); + } + if (DoubleField40 != 0D) { + output.WriteRawTag(193, 2); + output.WriteDouble(DoubleField40); + } + if (Int64Field41 != 0L) { + output.WriteRawTag(200, 2); + output.WriteInt64(Int64Field41); + } + if (DoubleField42 != 0D) { + output.WriteRawTag(209, 2); + output.WriteDouble(DoubleField42); + } + if (Int64Field43 != 0L) { + output.WriteRawTag(216, 2); + output.WriteInt64(Int64Field43); + } + if (Int64Field44 != 0L) { + output.WriteRawTag(224, 2); + output.WriteInt64(Int64Field44); + } + if (DoubleField45 != 0D) { + output.WriteRawTag(233, 2); + output.WriteDouble(DoubleField45); + } + if (DoubleField46 != 0D) { + output.WriteRawTag(241, 2); + output.WriteDouble(DoubleField46); + } + if (DoubleField47 != 0D) { + output.WriteRawTag(249, 2); + output.WriteDouble(DoubleField47); + } + if (DoubleField48 != 0D) { + output.WriteRawTag(129, 3); + output.WriteDouble(DoubleField48); + } + if (DoubleField49 != 0D) { + output.WriteRawTag(137, 3); + output.WriteDouble(DoubleField49); + } + if (DoubleField50 != 0D) { + output.WriteRawTag(145, 3); + output.WriteDouble(DoubleField50); + } + if (DoubleField51 != 0D) { + output.WriteRawTag(153, 3); + output.WriteDouble(DoubleField51); + } + if (DoubleField52 != 0D) { + output.WriteRawTag(161, 3); + output.WriteDouble(DoubleField52); + } + if (DoubleField53 != 0D) { + output.WriteRawTag(169, 3); + output.WriteDouble(DoubleField53); + } + if (DoubleField54 != 0D) { + output.WriteRawTag(177, 3); + output.WriteDouble(DoubleField54); + } + if (DoubleField55 != 0D) { + output.WriteRawTag(185, 3); + output.WriteDouble(DoubleField55); + } + if (DoubleField56 != 0D) { + output.WriteRawTag(193, 3); + output.WriteDouble(DoubleField56); + } + if (DoubleField57 != 0D) { + output.WriteRawTag(201, 3); + output.WriteDouble(DoubleField57); + } + if (DoubleField58 != 0D) { + output.WriteRawTag(209, 3); + output.WriteDouble(DoubleField58); + } + if (Int64Field59 != 0L) { + output.WriteRawTag(216, 3); + output.WriteInt64(Int64Field59); + } + if (Int64Field60 != 0L) { + output.WriteRawTag(224, 3); + output.WriteInt64(Int64Field60); + } + if (DoubleField62 != 0D) { + output.WriteRawTag(241, 3); + output.WriteDouble(DoubleField62); + } + if (DoubleField65 != 0D) { + output.WriteRawTag(137, 4); + output.WriteDouble(DoubleField65); + } + if (DoubleField66 != 0D) { + output.WriteRawTag(145, 4); + output.WriteDouble(DoubleField66); + } + if (DoubleField67 != 0D) { + output.WriteRawTag(153, 4); + output.WriteDouble(DoubleField67); + } + if (DoubleField68 != 0D) { + output.WriteRawTag(161, 4); + output.WriteDouble(DoubleField68); + } + if (DoubleField69 != 0D) { + output.WriteRawTag(169, 4); + output.WriteDouble(DoubleField69); + } + if (DoubleField70 != 0D) { + output.WriteRawTag(177, 4); + output.WriteDouble(DoubleField70); + } + if (DoubleField71 != 0D) { + output.WriteRawTag(185, 4); + output.WriteDouble(DoubleField71); + } + if (DoubleField72 != 0D) { + output.WriteRawTag(193, 4); + output.WriteDouble(DoubleField72); + } + if (StringField73.Length != 0) { + output.WriteRawTag(202, 4); + output.WriteString(StringField73); + } + if (StringField74.Length != 0) { + output.WriteRawTag(210, 4); + output.WriteString(StringField74); + } + if (DoubleField75 != 0D) { + output.WriteRawTag(217, 4); + output.WriteDouble(DoubleField75); + } + if (DoubleField77 != 0D) { + output.WriteRawTag(233, 4); + output.WriteDouble(DoubleField77); + } + if (DoubleField78 != 0D) { + output.WriteRawTag(241, 4); + output.WriteDouble(DoubleField78); + } + if (DoubleField79 != 0D) { + output.WriteRawTag(249, 4); + output.WriteDouble(DoubleField79); + } + if (EnumField80 != 0) { + output.WriteRawTag(128, 5); + output.WriteInt32(EnumField80); + } + if (EnumField81 != 0) { + output.WriteRawTag(136, 5); + output.WriteInt32(EnumField81); + } + if (Int64Field82 != 0L) { + output.WriteRawTag(144, 5); + output.WriteInt64(Int64Field82); + } + if (EnumField83 != 0) { + output.WriteRawTag(152, 5); + output.WriteInt32(EnumField83); + } + if (DoubleField84 != 0D) { + output.WriteRawTag(161, 5); + output.WriteDouble(DoubleField84); + } + if (Int64Field85 != 0L) { + output.WriteRawTag(168, 5); + output.WriteInt64(Int64Field85); + } + if (Int64Field86 != 0L) { + output.WriteRawTag(176, 5); + output.WriteInt64(Int64Field86); + } + if (Int64Field87 != 0L) { + output.WriteRawTag(184, 5); + output.WriteInt64(Int64Field87); + } + if (DoubleField88 != 0D) { + output.WriteRawTag(193, 5); + output.WriteDouble(DoubleField88); + } + if (DoubleField89 != 0D) { + output.WriteRawTag(201, 5); + output.WriteDouble(DoubleField89); + } + if (DoubleField90 != 0D) { + output.WriteRawTag(209, 5); + output.WriteDouble(DoubleField90); + } + if (DoubleField91 != 0D) { + output.WriteRawTag(217, 5); + output.WriteDouble(DoubleField91); + } + if (DoubleField92 != 0D) { + output.WriteRawTag(225, 5); + output.WriteDouble(DoubleField92); + } + if (DoubleField93 != 0D) { + output.WriteRawTag(233, 5); + output.WriteDouble(DoubleField93); + } + if (DoubleField94 != 0D) { + output.WriteRawTag(241, 5); + output.WriteDouble(DoubleField94); + } + if (DoubleField95 != 0D) { + output.WriteRawTag(249, 5); + output.WriteDouble(DoubleField95); + } + if (DoubleField96 != 0D) { + output.WriteRawTag(129, 6); + output.WriteDouble(DoubleField96); + } + if (DoubleField97 != 0D) { + output.WriteRawTag(137, 6); + output.WriteDouble(DoubleField97); + } + if (DoubleField98 != 0D) { + output.WriteRawTag(145, 6); + output.WriteDouble(DoubleField98); + } + if (DoubleField99 != 0D) { + output.WriteRawTag(153, 6); + output.WriteDouble(DoubleField99); + } + repeatedIntField100_.WriteTo(output, _repeated_repeatedIntField100_codec); + if (DoubleField101 != 0D) { + output.WriteRawTag(169, 6); + output.WriteDouble(DoubleField101); + } + if (DoubleField102 != 0D) { + output.WriteRawTag(177, 6); + output.WriteDouble(DoubleField102); + } + if (DoubleField103 != 0D) { + output.WriteRawTag(185, 6); + output.WriteDouble(DoubleField103); + } + if (DoubleField104 != 0D) { + output.WriteRawTag(193, 6); + output.WriteDouble(DoubleField104); + } + if (DoubleField105 != 0D) { + output.WriteRawTag(201, 6); + output.WriteDouble(DoubleField105); + } + if (DoubleField106 != 0D) { + output.WriteRawTag(209, 6); + output.WriteDouble(DoubleField106); + } + if (Int64Field107 != 0L) { + output.WriteRawTag(216, 6); + output.WriteInt64(Int64Field107); + } + if (DoubleField108 != 0D) { + output.WriteRawTag(225, 6); + output.WriteDouble(DoubleField108); + } + if (DoubleField109 != 0D) { + output.WriteRawTag(233, 6); + output.WriteDouble(DoubleField109); + } + if (Int64Field110 != 0L) { + output.WriteRawTag(240, 6); + output.WriteInt64(Int64Field110); + } + if (DoubleField111 != 0D) { + output.WriteRawTag(249, 6); + output.WriteDouble(DoubleField111); + } + if (Int64Field112 != 0L) { + output.WriteRawTag(128, 7); + output.WriteInt64(Int64Field112); + } + if (DoubleField113 != 0D) { + output.WriteRawTag(137, 7); + output.WriteDouble(DoubleField113); + } + if (Int64Field114 != 0L) { + output.WriteRawTag(144, 7); + output.WriteInt64(Int64Field114); + } + if (Int64Field115 != 0L) { + output.WriteRawTag(152, 7); + output.WriteInt64(Int64Field115); + } + if (DoubleField116 != 0D) { + output.WriteRawTag(161, 7); + output.WriteDouble(DoubleField116); + } + if (Int64Field117 != 0L) { + output.WriteRawTag(168, 7); + output.WriteInt64(Int64Field117); + } + if (DoubleField118 != 0D) { + output.WriteRawTag(177, 7); + output.WriteDouble(DoubleField118); + } + if (DoubleField119 != 0D) { + output.WriteRawTag(185, 7); + output.WriteDouble(DoubleField119); + } + if (DoubleField120 != 0D) { + output.WriteRawTag(193, 7); + output.WriteDouble(DoubleField120); + } + if (DoubleField121 != 0D) { + output.WriteRawTag(201, 7); + output.WriteDouble(DoubleField121); + } + if (DoubleField122 != 0D) { + output.WriteRawTag(209, 7); + output.WriteDouble(DoubleField122); + } + if (DoubleField123 != 0D) { + output.WriteRawTag(217, 7); + output.WriteDouble(DoubleField123); + } + if (DoubleField124 != 0D) { + output.WriteRawTag(225, 7); + output.WriteDouble(DoubleField124); + } + if (Int64Field125 != 0L) { + output.WriteRawTag(232, 7); + output.WriteInt64(Int64Field125); + } + if (Int64Field126 != 0L) { + output.WriteRawTag(240, 7); + output.WriteInt64(Int64Field126); + } + if (Int64Field127 != 0L) { + output.WriteRawTag(248, 7); + output.WriteInt64(Int64Field127); + } + if (DoubleField128 != 0D) { + output.WriteRawTag(129, 8); + output.WriteDouble(DoubleField128); + } + if (DoubleField129 != 0D) { + output.WriteRawTag(137, 8); + output.WriteDouble(DoubleField129); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (DoubleField1 != 0D) { + output.WriteRawTag(9); + output.WriteDouble(DoubleField1); + } + if (Int64Field2 != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Int64Field2); + } + if (Int64Field3 != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Int64Field3); + } + if (Int64Field4 != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Int64Field4); + } + if (DoubleField7 != 0D) { + output.WriteRawTag(57); + output.WriteDouble(DoubleField7); + } + if (DoubleField8 != 0D) { + output.WriteRawTag(65); + output.WriteDouble(DoubleField8); + } + if (DoubleField9 != 0D) { + output.WriteRawTag(73); + output.WriteDouble(DoubleField9); + } + if (DoubleField10 != 0D) { + output.WriteRawTag(81); + output.WriteDouble(DoubleField10); + } + if (DoubleField11 != 0D) { + output.WriteRawTag(89); + output.WriteDouble(DoubleField11); + } + if (DoubleField14 != 0D) { + output.WriteRawTag(113); + output.WriteDouble(DoubleField14); + } + if (DoubleField15 != 0D) { + output.WriteRawTag(121); + output.WriteDouble(DoubleField15); + } + if (Int64Field19 != 0L) { + output.WriteRawTag(152, 1); + output.WriteInt64(Int64Field19); + } + if (DoubleField20 != 0D) { + output.WriteRawTag(161, 1); + output.WriteDouble(DoubleField20); + } + if (DoubleField21 != 0D) { + output.WriteRawTag(169, 1); + output.WriteDouble(DoubleField21); + } + if (DoubleField22 != 0D) { + output.WriteRawTag(177, 1); + output.WriteDouble(DoubleField22); + } + if (DoubleField25 != 0D) { + output.WriteRawTag(201, 1); + output.WriteDouble(DoubleField25); + } + if (Int64Field26 != 0L) { + output.WriteRawTag(208, 1); + output.WriteInt64(Int64Field26); + } + if (DoubleField28 != 0D) { + output.WriteRawTag(225, 1); + output.WriteDouble(DoubleField28); + } + if (DoubleField29 != 0D) { + output.WriteRawTag(233, 1); + output.WriteDouble(DoubleField29); + } + if (DoubleField30 != 0D) { + output.WriteRawTag(241, 1); + output.WriteDouble(DoubleField30); + } + if (DoubleField31 != 0D) { + output.WriteRawTag(249, 1); + output.WriteDouble(DoubleField31); + } + if (Int64Field32 != 0L) { + output.WriteRawTag(128, 2); + output.WriteInt64(Int64Field32); + } + if (Int64Field37 != 0L) { + output.WriteRawTag(168, 2); + output.WriteInt64(Int64Field37); + } + if (DoubleField38 != 0D) { + output.WriteRawTag(177, 2); + output.WriteDouble(DoubleField38); + } + if (Interactions != 0L) { + output.WriteRawTag(184, 2); + output.WriteInt64(Interactions); + } + if (DoubleField40 != 0D) { + output.WriteRawTag(193, 2); + output.WriteDouble(DoubleField40); + } + if (Int64Field41 != 0L) { + output.WriteRawTag(200, 2); + output.WriteInt64(Int64Field41); + } + if (DoubleField42 != 0D) { + output.WriteRawTag(209, 2); + output.WriteDouble(DoubleField42); + } + if (Int64Field43 != 0L) { + output.WriteRawTag(216, 2); + output.WriteInt64(Int64Field43); + } + if (Int64Field44 != 0L) { + output.WriteRawTag(224, 2); + output.WriteInt64(Int64Field44); + } + if (DoubleField45 != 0D) { + output.WriteRawTag(233, 2); + output.WriteDouble(DoubleField45); + } + if (DoubleField46 != 0D) { + output.WriteRawTag(241, 2); + output.WriteDouble(DoubleField46); + } + if (DoubleField47 != 0D) { + output.WriteRawTag(249, 2); + output.WriteDouble(DoubleField47); + } + if (DoubleField48 != 0D) { + output.WriteRawTag(129, 3); + output.WriteDouble(DoubleField48); + } + if (DoubleField49 != 0D) { + output.WriteRawTag(137, 3); + output.WriteDouble(DoubleField49); + } + if (DoubleField50 != 0D) { + output.WriteRawTag(145, 3); + output.WriteDouble(DoubleField50); + } + if (DoubleField51 != 0D) { + output.WriteRawTag(153, 3); + output.WriteDouble(DoubleField51); + } + if (DoubleField52 != 0D) { + output.WriteRawTag(161, 3); + output.WriteDouble(DoubleField52); + } + if (DoubleField53 != 0D) { + output.WriteRawTag(169, 3); + output.WriteDouble(DoubleField53); + } + if (DoubleField54 != 0D) { + output.WriteRawTag(177, 3); + output.WriteDouble(DoubleField54); + } + if (DoubleField55 != 0D) { + output.WriteRawTag(185, 3); + output.WriteDouble(DoubleField55); + } + if (DoubleField56 != 0D) { + output.WriteRawTag(193, 3); + output.WriteDouble(DoubleField56); + } + if (DoubleField57 != 0D) { + output.WriteRawTag(201, 3); + output.WriteDouble(DoubleField57); + } + if (DoubleField58 != 0D) { + output.WriteRawTag(209, 3); + output.WriteDouble(DoubleField58); + } + if (Int64Field59 != 0L) { + output.WriteRawTag(216, 3); + output.WriteInt64(Int64Field59); + } + if (Int64Field60 != 0L) { + output.WriteRawTag(224, 3); + output.WriteInt64(Int64Field60); + } + if (DoubleField62 != 0D) { + output.WriteRawTag(241, 3); + output.WriteDouble(DoubleField62); + } + if (DoubleField65 != 0D) { + output.WriteRawTag(137, 4); + output.WriteDouble(DoubleField65); + } + if (DoubleField66 != 0D) { + output.WriteRawTag(145, 4); + output.WriteDouble(DoubleField66); + } + if (DoubleField67 != 0D) { + output.WriteRawTag(153, 4); + output.WriteDouble(DoubleField67); + } + if (DoubleField68 != 0D) { + output.WriteRawTag(161, 4); + output.WriteDouble(DoubleField68); + } + if (DoubleField69 != 0D) { + output.WriteRawTag(169, 4); + output.WriteDouble(DoubleField69); + } + if (DoubleField70 != 0D) { + output.WriteRawTag(177, 4); + output.WriteDouble(DoubleField70); + } + if (DoubleField71 != 0D) { + output.WriteRawTag(185, 4); + output.WriteDouble(DoubleField71); + } + if (DoubleField72 != 0D) { + output.WriteRawTag(193, 4); + output.WriteDouble(DoubleField72); + } + if (StringField73.Length != 0) { + output.WriteRawTag(202, 4); + output.WriteString(StringField73); + } + if (StringField74.Length != 0) { + output.WriteRawTag(210, 4); + output.WriteString(StringField74); + } + if (DoubleField75 != 0D) { + output.WriteRawTag(217, 4); + output.WriteDouble(DoubleField75); + } + if (DoubleField77 != 0D) { + output.WriteRawTag(233, 4); + output.WriteDouble(DoubleField77); + } + if (DoubleField78 != 0D) { + output.WriteRawTag(241, 4); + output.WriteDouble(DoubleField78); + } + if (DoubleField79 != 0D) { + output.WriteRawTag(249, 4); + output.WriteDouble(DoubleField79); + } + if (EnumField80 != 0) { + output.WriteRawTag(128, 5); + output.WriteInt32(EnumField80); + } + if (EnumField81 != 0) { + output.WriteRawTag(136, 5); + output.WriteInt32(EnumField81); + } + if (Int64Field82 != 0L) { + output.WriteRawTag(144, 5); + output.WriteInt64(Int64Field82); + } + if (EnumField83 != 0) { + output.WriteRawTag(152, 5); + output.WriteInt32(EnumField83); + } + if (DoubleField84 != 0D) { + output.WriteRawTag(161, 5); + output.WriteDouble(DoubleField84); + } + if (Int64Field85 != 0L) { + output.WriteRawTag(168, 5); + output.WriteInt64(Int64Field85); + } + if (Int64Field86 != 0L) { + output.WriteRawTag(176, 5); + output.WriteInt64(Int64Field86); + } + if (Int64Field87 != 0L) { + output.WriteRawTag(184, 5); + output.WriteInt64(Int64Field87); + } + if (DoubleField88 != 0D) { + output.WriteRawTag(193, 5); + output.WriteDouble(DoubleField88); + } + if (DoubleField89 != 0D) { + output.WriteRawTag(201, 5); + output.WriteDouble(DoubleField89); + } + if (DoubleField90 != 0D) { + output.WriteRawTag(209, 5); + output.WriteDouble(DoubleField90); + } + if (DoubleField91 != 0D) { + output.WriteRawTag(217, 5); + output.WriteDouble(DoubleField91); + } + if (DoubleField92 != 0D) { + output.WriteRawTag(225, 5); + output.WriteDouble(DoubleField92); + } + if (DoubleField93 != 0D) { + output.WriteRawTag(233, 5); + output.WriteDouble(DoubleField93); + } + if (DoubleField94 != 0D) { + output.WriteRawTag(241, 5); + output.WriteDouble(DoubleField94); + } + if (DoubleField95 != 0D) { + output.WriteRawTag(249, 5); + output.WriteDouble(DoubleField95); + } + if (DoubleField96 != 0D) { + output.WriteRawTag(129, 6); + output.WriteDouble(DoubleField96); + } + if (DoubleField97 != 0D) { + output.WriteRawTag(137, 6); + output.WriteDouble(DoubleField97); + } + if (DoubleField98 != 0D) { + output.WriteRawTag(145, 6); + output.WriteDouble(DoubleField98); + } + if (DoubleField99 != 0D) { + output.WriteRawTag(153, 6); + output.WriteDouble(DoubleField99); + } + repeatedIntField100_.WriteTo(ref output, _repeated_repeatedIntField100_codec); + if (DoubleField101 != 0D) { + output.WriteRawTag(169, 6); + output.WriteDouble(DoubleField101); + } + if (DoubleField102 != 0D) { + output.WriteRawTag(177, 6); + output.WriteDouble(DoubleField102); + } + if (DoubleField103 != 0D) { + output.WriteRawTag(185, 6); + output.WriteDouble(DoubleField103); + } + if (DoubleField104 != 0D) { + output.WriteRawTag(193, 6); + output.WriteDouble(DoubleField104); + } + if (DoubleField105 != 0D) { + output.WriteRawTag(201, 6); + output.WriteDouble(DoubleField105); + } + if (DoubleField106 != 0D) { + output.WriteRawTag(209, 6); + output.WriteDouble(DoubleField106); + } + if (Int64Field107 != 0L) { + output.WriteRawTag(216, 6); + output.WriteInt64(Int64Field107); + } + if (DoubleField108 != 0D) { + output.WriteRawTag(225, 6); + output.WriteDouble(DoubleField108); + } + if (DoubleField109 != 0D) { + output.WriteRawTag(233, 6); + output.WriteDouble(DoubleField109); + } + if (Int64Field110 != 0L) { + output.WriteRawTag(240, 6); + output.WriteInt64(Int64Field110); + } + if (DoubleField111 != 0D) { + output.WriteRawTag(249, 6); + output.WriteDouble(DoubleField111); + } + if (Int64Field112 != 0L) { + output.WriteRawTag(128, 7); + output.WriteInt64(Int64Field112); + } + if (DoubleField113 != 0D) { + output.WriteRawTag(137, 7); + output.WriteDouble(DoubleField113); + } + if (Int64Field114 != 0L) { + output.WriteRawTag(144, 7); + output.WriteInt64(Int64Field114); + } + if (Int64Field115 != 0L) { + output.WriteRawTag(152, 7); + output.WriteInt64(Int64Field115); + } + if (DoubleField116 != 0D) { + output.WriteRawTag(161, 7); + output.WriteDouble(DoubleField116); + } + if (Int64Field117 != 0L) { + output.WriteRawTag(168, 7); + output.WriteInt64(Int64Field117); + } + if (DoubleField118 != 0D) { + output.WriteRawTag(177, 7); + output.WriteDouble(DoubleField118); + } + if (DoubleField119 != 0D) { + output.WriteRawTag(185, 7); + output.WriteDouble(DoubleField119); + } + if (DoubleField120 != 0D) { + output.WriteRawTag(193, 7); + output.WriteDouble(DoubleField120); + } + if (DoubleField121 != 0D) { + output.WriteRawTag(201, 7); + output.WriteDouble(DoubleField121); + } + if (DoubleField122 != 0D) { + output.WriteRawTag(209, 7); + output.WriteDouble(DoubleField122); + } + if (DoubleField123 != 0D) { + output.WriteRawTag(217, 7); + output.WriteDouble(DoubleField123); + } + if (DoubleField124 != 0D) { + output.WriteRawTag(225, 7); + output.WriteDouble(DoubleField124); + } + if (Int64Field125 != 0L) { + output.WriteRawTag(232, 7); + output.WriteInt64(Int64Field125); + } + if (Int64Field126 != 0L) { + output.WriteRawTag(240, 7); + output.WriteInt64(Int64Field126); + } + if (Int64Field127 != 0L) { + output.WriteRawTag(248, 7); + output.WriteInt64(Int64Field127); + } + if (DoubleField128 != 0D) { + output.WriteRawTag(129, 8); + output.WriteDouble(DoubleField128); + } + if (DoubleField129 != 0D) { + output.WriteRawTag(137, 8); + output.WriteDouble(DoubleField129); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (DoubleField95 != 0D) { + size += 2 + 8; + } + if (DoubleField1 != 0D) { + size += 1 + 8; + } + if (DoubleField79 != 0D) { + size += 2 + 8; + } + if (Int64Field2 != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Int64Field2); + } + if (DoubleField96 != 0D) { + size += 2 + 8; + } + if (Int64Field3 != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Int64Field3); + } + if (Int64Field4 != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Int64Field4); + } + if (DoubleField97 != 0D) { + size += 2 + 8; + } + if (DoubleField65 != 0D) { + size += 2 + 8; + } + if (DoubleField66 != 0D) { + size += 2 + 8; + } + if (DoubleField7 != 0D) { + size += 1 + 8; + } + if (DoubleField62 != 0D) { + size += 2 + 8; + } + if (DoubleField118 != 0D) { + size += 2 + 8; + } + if (DoubleField119 != 0D) { + size += 2 + 8; + } + if (DoubleField67 != 0D) { + size += 2 + 8; + } + if (DoubleField120 != 0D) { + size += 2 + 8; + } + if (DoubleField121 != 0D) { + size += 2 + 8; + } + if (DoubleField122 != 0D) { + size += 2 + 8; + } + if (DoubleField123 != 0D) { + size += 2 + 8; + } + if (DoubleField124 != 0D) { + size += 2 + 8; + } + if (DoubleField8 != 0D) { + size += 1 + 8; + } + if (DoubleField9 != 0D) { + size += 1 + 8; + } + if (DoubleField98 != 0D) { + size += 2 + 8; + } + if (DoubleField10 != 0D) { + size += 1 + 8; + } + if (DoubleField11 != 0D) { + size += 1 + 8; + } + if (DoubleField99 != 0D) { + size += 2 + 8; + } + if (DoubleField84 != 0D) { + size += 2 + 8; + } + if (DoubleField14 != 0D) { + size += 1 + 8; + } + if (DoubleField77 != 0D) { + size += 2 + 8; + } + if (DoubleField15 != 0D) { + size += 1 + 8; + } + if (Int64Field19 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field19); + } + if (Int64Field115 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field115); + } + if (DoubleField116 != 0D) { + size += 2 + 8; + } + if (Int64Field117 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field117); + } + if (DoubleField20 != 0D) { + size += 2 + 8; + } + if (DoubleField21 != 0D) { + size += 2 + 8; + } + if (StringField73.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(StringField73); + } + if (StringField74.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(StringField74); + } + if (DoubleField22 != 0D) { + size += 2 + 8; + } + if (DoubleField69 != 0D) { + size += 2 + 8; + } + if (DoubleField70 != 0D) { + size += 2 + 8; + } + if (DoubleField71 != 0D) { + size += 2 + 8; + } + if (DoubleField72 != 0D) { + size += 2 + 8; + } + if (DoubleField25 != 0D) { + size += 2 + 8; + } + if (Int64Field26 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field26); + } + if (DoubleField68 != 0D) { + size += 2 + 8; + } + if (DoubleField28 != 0D) { + size += 2 + 8; + } + if (DoubleField106 != 0D) { + size += 2 + 8; + } + if (DoubleField29 != 0D) { + size += 2 + 8; + } + if (DoubleField30 != 0D) { + size += 2 + 8; + } + if (DoubleField101 != 0D) { + size += 2 + 8; + } + if (DoubleField102 != 0D) { + size += 2 + 8; + } + if (DoubleField103 != 0D) { + size += 2 + 8; + } + if (DoubleField104 != 0D) { + size += 2 + 8; + } + if (DoubleField105 != 0D) { + size += 2 + 8; + } + if (DoubleField31 != 0D) { + size += 2 + 8; + } + if (Int64Field32 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field32); + } + if (DoubleField75 != 0D) { + size += 2 + 8; + } + if (DoubleField129 != 0D) { + size += 2 + 8; + } + if (EnumField80 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(EnumField80); + } + if (EnumField81 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(EnumField81); + } + if (Int64Field82 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field82); + } + if (EnumField83 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(EnumField83); + } + if (Int64Field85 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field85); + } + if (Int64Field86 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field86); + } + if (Int64Field87 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field87); + } + if (Int64Field125 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field125); + } + if (Int64Field37 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field37); + } + if (DoubleField38 != 0D) { + size += 2 + 8; + } + if (Interactions != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Interactions); + } + size += repeatedIntField100_.CalculateSize(_repeated_repeatedIntField100_codec); + if (DoubleField40 != 0D) { + size += 2 + 8; + } + if (Int64Field41 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field41); + } + if (Int64Field126 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field126); + } + if (Int64Field127 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field127); + } + if (DoubleField128 != 0D) { + size += 2 + 8; + } + if (DoubleField109 != 0D) { + size += 2 + 8; + } + if (Int64Field110 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field110); + } + if (DoubleField111 != 0D) { + size += 2 + 8; + } + if (Int64Field112 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field112); + } + if (DoubleField113 != 0D) { + size += 2 + 8; + } + if (Int64Field114 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field114); + } + if (DoubleField42 != 0D) { + size += 2 + 8; + } + if (Int64Field43 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field43); + } + if (Int64Field44 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field44); + } + if (DoubleField45 != 0D) { + size += 2 + 8; + } + if (DoubleField46 != 0D) { + size += 2 + 8; + } + if (DoubleField78 != 0D) { + size += 2 + 8; + } + if (DoubleField88 != 0D) { + size += 2 + 8; + } + if (DoubleField47 != 0D) { + size += 2 + 8; + } + if (DoubleField89 != 0D) { + size += 2 + 8; + } + if (DoubleField48 != 0D) { + size += 2 + 8; + } + if (DoubleField49 != 0D) { + size += 2 + 8; + } + if (DoubleField50 != 0D) { + size += 2 + 8; + } + if (DoubleField90 != 0D) { + size += 2 + 8; + } + if (DoubleField51 != 0D) { + size += 2 + 8; + } + if (DoubleField91 != 0D) { + size += 2 + 8; + } + if (DoubleField92 != 0D) { + size += 2 + 8; + } + if (Int64Field107 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field107); + } + if (DoubleField93 != 0D) { + size += 2 + 8; + } + if (DoubleField108 != 0D) { + size += 2 + 8; + } + if (DoubleField52 != 0D) { + size += 2 + 8; + } + if (DoubleField53 != 0D) { + size += 2 + 8; + } + if (DoubleField94 != 0D) { + size += 2 + 8; + } + if (DoubleField54 != 0D) { + size += 2 + 8; + } + if (DoubleField55 != 0D) { + size += 2 + 8; + } + if (DoubleField56 != 0D) { + size += 2 + 8; + } + if (DoubleField57 != 0D) { + size += 2 + 8; + } + if (DoubleField58 != 0D) { + size += 2 + 8; + } + if (Int64Field59 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field59); + } + if (Int64Field60 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(Int64Field60); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ManyPrimitiveFieldsMessage other) { + if (other == null) { + return; + } + if (other.DoubleField95 != 0D) { + DoubleField95 = other.DoubleField95; + } + if (other.DoubleField1 != 0D) { + DoubleField1 = other.DoubleField1; + } + if (other.DoubleField79 != 0D) { + DoubleField79 = other.DoubleField79; + } + if (other.Int64Field2 != 0L) { + Int64Field2 = other.Int64Field2; + } + if (other.DoubleField96 != 0D) { + DoubleField96 = other.DoubleField96; + } + if (other.Int64Field3 != 0L) { + Int64Field3 = other.Int64Field3; + } + if (other.Int64Field4 != 0L) { + Int64Field4 = other.Int64Field4; + } + if (other.DoubleField97 != 0D) { + DoubleField97 = other.DoubleField97; + } + if (other.DoubleField65 != 0D) { + DoubleField65 = other.DoubleField65; + } + if (other.DoubleField66 != 0D) { + DoubleField66 = other.DoubleField66; + } + if (other.DoubleField7 != 0D) { + DoubleField7 = other.DoubleField7; + } + if (other.DoubleField62 != 0D) { + DoubleField62 = other.DoubleField62; + } + if (other.DoubleField118 != 0D) { + DoubleField118 = other.DoubleField118; + } + if (other.DoubleField119 != 0D) { + DoubleField119 = other.DoubleField119; + } + if (other.DoubleField67 != 0D) { + DoubleField67 = other.DoubleField67; + } + if (other.DoubleField120 != 0D) { + DoubleField120 = other.DoubleField120; + } + if (other.DoubleField121 != 0D) { + DoubleField121 = other.DoubleField121; + } + if (other.DoubleField122 != 0D) { + DoubleField122 = other.DoubleField122; + } + if (other.DoubleField123 != 0D) { + DoubleField123 = other.DoubleField123; + } + if (other.DoubleField124 != 0D) { + DoubleField124 = other.DoubleField124; + } + if (other.DoubleField8 != 0D) { + DoubleField8 = other.DoubleField8; + } + if (other.DoubleField9 != 0D) { + DoubleField9 = other.DoubleField9; + } + if (other.DoubleField98 != 0D) { + DoubleField98 = other.DoubleField98; + } + if (other.DoubleField10 != 0D) { + DoubleField10 = other.DoubleField10; + } + if (other.DoubleField11 != 0D) { + DoubleField11 = other.DoubleField11; + } + if (other.DoubleField99 != 0D) { + DoubleField99 = other.DoubleField99; + } + if (other.DoubleField84 != 0D) { + DoubleField84 = other.DoubleField84; + } + if (other.DoubleField14 != 0D) { + DoubleField14 = other.DoubleField14; + } + if (other.DoubleField77 != 0D) { + DoubleField77 = other.DoubleField77; + } + if (other.DoubleField15 != 0D) { + DoubleField15 = other.DoubleField15; + } + if (other.Int64Field19 != 0L) { + Int64Field19 = other.Int64Field19; + } + if (other.Int64Field115 != 0L) { + Int64Field115 = other.Int64Field115; + } + if (other.DoubleField116 != 0D) { + DoubleField116 = other.DoubleField116; + } + if (other.Int64Field117 != 0L) { + Int64Field117 = other.Int64Field117; + } + if (other.DoubleField20 != 0D) { + DoubleField20 = other.DoubleField20; + } + if (other.DoubleField21 != 0D) { + DoubleField21 = other.DoubleField21; + } + if (other.StringField73.Length != 0) { + StringField73 = other.StringField73; + } + if (other.StringField74.Length != 0) { + StringField74 = other.StringField74; + } + if (other.DoubleField22 != 0D) { + DoubleField22 = other.DoubleField22; + } + if (other.DoubleField69 != 0D) { + DoubleField69 = other.DoubleField69; + } + if (other.DoubleField70 != 0D) { + DoubleField70 = other.DoubleField70; + } + if (other.DoubleField71 != 0D) { + DoubleField71 = other.DoubleField71; + } + if (other.DoubleField72 != 0D) { + DoubleField72 = other.DoubleField72; + } + if (other.DoubleField25 != 0D) { + DoubleField25 = other.DoubleField25; + } + if (other.Int64Field26 != 0L) { + Int64Field26 = other.Int64Field26; + } + if (other.DoubleField68 != 0D) { + DoubleField68 = other.DoubleField68; + } + if (other.DoubleField28 != 0D) { + DoubleField28 = other.DoubleField28; + } + if (other.DoubleField106 != 0D) { + DoubleField106 = other.DoubleField106; + } + if (other.DoubleField29 != 0D) { + DoubleField29 = other.DoubleField29; + } + if (other.DoubleField30 != 0D) { + DoubleField30 = other.DoubleField30; + } + if (other.DoubleField101 != 0D) { + DoubleField101 = other.DoubleField101; + } + if (other.DoubleField102 != 0D) { + DoubleField102 = other.DoubleField102; + } + if (other.DoubleField103 != 0D) { + DoubleField103 = other.DoubleField103; + } + if (other.DoubleField104 != 0D) { + DoubleField104 = other.DoubleField104; + } + if (other.DoubleField105 != 0D) { + DoubleField105 = other.DoubleField105; + } + if (other.DoubleField31 != 0D) { + DoubleField31 = other.DoubleField31; + } + if (other.Int64Field32 != 0L) { + Int64Field32 = other.Int64Field32; + } + if (other.DoubleField75 != 0D) { + DoubleField75 = other.DoubleField75; + } + if (other.DoubleField129 != 0D) { + DoubleField129 = other.DoubleField129; + } + if (other.EnumField80 != 0) { + EnumField80 = other.EnumField80; + } + if (other.EnumField81 != 0) { + EnumField81 = other.EnumField81; + } + if (other.Int64Field82 != 0L) { + Int64Field82 = other.Int64Field82; + } + if (other.EnumField83 != 0) { + EnumField83 = other.EnumField83; + } + if (other.Int64Field85 != 0L) { + Int64Field85 = other.Int64Field85; + } + if (other.Int64Field86 != 0L) { + Int64Field86 = other.Int64Field86; + } + if (other.Int64Field87 != 0L) { + Int64Field87 = other.Int64Field87; + } + if (other.Int64Field125 != 0L) { + Int64Field125 = other.Int64Field125; + } + if (other.Int64Field37 != 0L) { + Int64Field37 = other.Int64Field37; + } + if (other.DoubleField38 != 0D) { + DoubleField38 = other.DoubleField38; + } + if (other.Interactions != 0L) { + Interactions = other.Interactions; + } + repeatedIntField100_.Add(other.repeatedIntField100_); + if (other.DoubleField40 != 0D) { + DoubleField40 = other.DoubleField40; + } + if (other.Int64Field41 != 0L) { + Int64Field41 = other.Int64Field41; + } + if (other.Int64Field126 != 0L) { + Int64Field126 = other.Int64Field126; + } + if (other.Int64Field127 != 0L) { + Int64Field127 = other.Int64Field127; + } + if (other.DoubleField128 != 0D) { + DoubleField128 = other.DoubleField128; + } + if (other.DoubleField109 != 0D) { + DoubleField109 = other.DoubleField109; + } + if (other.Int64Field110 != 0L) { + Int64Field110 = other.Int64Field110; + } + if (other.DoubleField111 != 0D) { + DoubleField111 = other.DoubleField111; + } + if (other.Int64Field112 != 0L) { + Int64Field112 = other.Int64Field112; + } + if (other.DoubleField113 != 0D) { + DoubleField113 = other.DoubleField113; + } + if (other.Int64Field114 != 0L) { + Int64Field114 = other.Int64Field114; + } + if (other.DoubleField42 != 0D) { + DoubleField42 = other.DoubleField42; + } + if (other.Int64Field43 != 0L) { + Int64Field43 = other.Int64Field43; + } + if (other.Int64Field44 != 0L) { + Int64Field44 = other.Int64Field44; + } + if (other.DoubleField45 != 0D) { + DoubleField45 = other.DoubleField45; + } + if (other.DoubleField46 != 0D) { + DoubleField46 = other.DoubleField46; + } + if (other.DoubleField78 != 0D) { + DoubleField78 = other.DoubleField78; + } + if (other.DoubleField88 != 0D) { + DoubleField88 = other.DoubleField88; + } + if (other.DoubleField47 != 0D) { + DoubleField47 = other.DoubleField47; + } + if (other.DoubleField89 != 0D) { + DoubleField89 = other.DoubleField89; + } + if (other.DoubleField48 != 0D) { + DoubleField48 = other.DoubleField48; + } + if (other.DoubleField49 != 0D) { + DoubleField49 = other.DoubleField49; + } + if (other.DoubleField50 != 0D) { + DoubleField50 = other.DoubleField50; + } + if (other.DoubleField90 != 0D) { + DoubleField90 = other.DoubleField90; + } + if (other.DoubleField51 != 0D) { + DoubleField51 = other.DoubleField51; + } + if (other.DoubleField91 != 0D) { + DoubleField91 = other.DoubleField91; + } + if (other.DoubleField92 != 0D) { + DoubleField92 = other.DoubleField92; + } + if (other.Int64Field107 != 0L) { + Int64Field107 = other.Int64Field107; + } + if (other.DoubleField93 != 0D) { + DoubleField93 = other.DoubleField93; + } + if (other.DoubleField108 != 0D) { + DoubleField108 = other.DoubleField108; + } + if (other.DoubleField52 != 0D) { + DoubleField52 = other.DoubleField52; + } + if (other.DoubleField53 != 0D) { + DoubleField53 = other.DoubleField53; + } + if (other.DoubleField94 != 0D) { + DoubleField94 = other.DoubleField94; + } + if (other.DoubleField54 != 0D) { + DoubleField54 = other.DoubleField54; + } + if (other.DoubleField55 != 0D) { + DoubleField55 = other.DoubleField55; + } + if (other.DoubleField56 != 0D) { + DoubleField56 = other.DoubleField56; + } + if (other.DoubleField57 != 0D) { + DoubleField57 = other.DoubleField57; + } + if (other.DoubleField58 != 0D) { + DoubleField58 = other.DoubleField58; + } + if (other.Int64Field59 != 0L) { + Int64Field59 = other.Int64Field59; + } + if (other.Int64Field60 != 0L) { + Int64Field60 = other.Int64Field60; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + DoubleField1 = input.ReadDouble(); + break; + } + case 16: { + Int64Field2 = input.ReadInt64(); + break; + } + case 24: { + Int64Field3 = input.ReadInt64(); + break; + } + case 32: { + Int64Field4 = input.ReadInt64(); + break; + } + case 57: { + DoubleField7 = input.ReadDouble(); + break; + } + case 65: { + DoubleField8 = input.ReadDouble(); + break; + } + case 73: { + DoubleField9 = input.ReadDouble(); + break; + } + case 81: { + DoubleField10 = input.ReadDouble(); + break; + } + case 89: { + DoubleField11 = input.ReadDouble(); + break; + } + case 113: { + DoubleField14 = input.ReadDouble(); + break; + } + case 121: { + DoubleField15 = input.ReadDouble(); + break; + } + case 152: { + Int64Field19 = input.ReadInt64(); + break; + } + case 161: { + DoubleField20 = input.ReadDouble(); + break; + } + case 169: { + DoubleField21 = input.ReadDouble(); + break; + } + case 177: { + DoubleField22 = input.ReadDouble(); + break; + } + case 201: { + DoubleField25 = input.ReadDouble(); + break; + } + case 208: { + Int64Field26 = input.ReadInt64(); + break; + } + case 225: { + DoubleField28 = input.ReadDouble(); + break; + } + case 233: { + DoubleField29 = input.ReadDouble(); + break; + } + case 241: { + DoubleField30 = input.ReadDouble(); + break; + } + case 249: { + DoubleField31 = input.ReadDouble(); + break; + } + case 256: { + Int64Field32 = input.ReadInt64(); + break; + } + case 296: { + Int64Field37 = input.ReadInt64(); + break; + } + case 305: { + DoubleField38 = input.ReadDouble(); + break; + } + case 312: { + Interactions = input.ReadInt64(); + break; + } + case 321: { + DoubleField40 = input.ReadDouble(); + break; + } + case 328: { + Int64Field41 = input.ReadInt64(); + break; + } + case 337: { + DoubleField42 = input.ReadDouble(); + break; + } + case 344: { + Int64Field43 = input.ReadInt64(); + break; + } + case 352: { + Int64Field44 = input.ReadInt64(); + break; + } + case 361: { + DoubleField45 = input.ReadDouble(); + break; + } + case 369: { + DoubleField46 = input.ReadDouble(); + break; + } + case 377: { + DoubleField47 = input.ReadDouble(); + break; + } + case 385: { + DoubleField48 = input.ReadDouble(); + break; + } + case 393: { + DoubleField49 = input.ReadDouble(); + break; + } + case 401: { + DoubleField50 = input.ReadDouble(); + break; + } + case 409: { + DoubleField51 = input.ReadDouble(); + break; + } + case 417: { + DoubleField52 = input.ReadDouble(); + break; + } + case 425: { + DoubleField53 = input.ReadDouble(); + break; + } + case 433: { + DoubleField54 = input.ReadDouble(); + break; + } + case 441: { + DoubleField55 = input.ReadDouble(); + break; + } + case 449: { + DoubleField56 = input.ReadDouble(); + break; + } + case 457: { + DoubleField57 = input.ReadDouble(); + break; + } + case 465: { + DoubleField58 = input.ReadDouble(); + break; + } + case 472: { + Int64Field59 = input.ReadInt64(); + break; + } + case 480: { + Int64Field60 = input.ReadInt64(); + break; + } + case 497: { + DoubleField62 = input.ReadDouble(); + break; + } + case 521: { + DoubleField65 = input.ReadDouble(); + break; + } + case 529: { + DoubleField66 = input.ReadDouble(); + break; + } + case 537: { + DoubleField67 = input.ReadDouble(); + break; + } + case 545: { + DoubleField68 = input.ReadDouble(); + break; + } + case 553: { + DoubleField69 = input.ReadDouble(); + break; + } + case 561: { + DoubleField70 = input.ReadDouble(); + break; + } + case 569: { + DoubleField71 = input.ReadDouble(); + break; + } + case 577: { + DoubleField72 = input.ReadDouble(); + break; + } + case 586: { + StringField73 = input.ReadString(); + break; + } + case 594: { + StringField74 = input.ReadString(); + break; + } + case 601: { + DoubleField75 = input.ReadDouble(); + break; + } + case 617: { + DoubleField77 = input.ReadDouble(); + break; + } + case 625: { + DoubleField78 = input.ReadDouble(); + break; + } + case 633: { + DoubleField79 = input.ReadDouble(); + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 656: { + Int64Field82 = input.ReadInt64(); + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 673: { + DoubleField84 = input.ReadDouble(); + break; + } + case 680: { + Int64Field85 = input.ReadInt64(); + break; + } + case 688: { + Int64Field86 = input.ReadInt64(); + break; + } + case 696: { + Int64Field87 = input.ReadInt64(); + break; + } + case 705: { + DoubleField88 = input.ReadDouble(); + break; + } + case 713: { + DoubleField89 = input.ReadDouble(); + break; + } + case 721: { + DoubleField90 = input.ReadDouble(); + break; + } + case 729: { + DoubleField91 = input.ReadDouble(); + break; + } + case 737: { + DoubleField92 = input.ReadDouble(); + break; + } + case 745: { + DoubleField93 = input.ReadDouble(); + break; + } + case 753: { + DoubleField94 = input.ReadDouble(); + break; + } + case 761: { + DoubleField95 = input.ReadDouble(); + break; + } + case 769: { + DoubleField96 = input.ReadDouble(); + break; + } + case 777: { + DoubleField97 = input.ReadDouble(); + break; + } + case 785: { + DoubleField98 = input.ReadDouble(); + break; + } + case 793: { + DoubleField99 = input.ReadDouble(); + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec); + break; + } + case 809: { + DoubleField101 = input.ReadDouble(); + break; + } + case 817: { + DoubleField102 = input.ReadDouble(); + break; + } + case 825: { + DoubleField103 = input.ReadDouble(); + break; + } + case 833: { + DoubleField104 = input.ReadDouble(); + break; + } + case 841: { + DoubleField105 = input.ReadDouble(); + break; + } + case 849: { + DoubleField106 = input.ReadDouble(); + break; + } + case 856: { + Int64Field107 = input.ReadInt64(); + break; + } + case 865: { + DoubleField108 = input.ReadDouble(); + break; + } + case 873: { + DoubleField109 = input.ReadDouble(); + break; + } + case 880: { + Int64Field110 = input.ReadInt64(); + break; + } + case 889: { + DoubleField111 = input.ReadDouble(); + break; + } + case 896: { + Int64Field112 = input.ReadInt64(); + break; + } + case 905: { + DoubleField113 = input.ReadDouble(); + break; + } + case 912: { + Int64Field114 = input.ReadInt64(); + break; + } + case 920: { + Int64Field115 = input.ReadInt64(); + break; + } + case 929: { + DoubleField116 = input.ReadDouble(); + break; + } + case 936: { + Int64Field117 = input.ReadInt64(); + break; + } + case 945: { + DoubleField118 = input.ReadDouble(); + break; + } + case 953: { + DoubleField119 = input.ReadDouble(); + break; + } + case 961: { + DoubleField120 = input.ReadDouble(); + break; + } + case 969: { + DoubleField121 = input.ReadDouble(); + break; + } + case 977: { + DoubleField122 = input.ReadDouble(); + break; + } + case 985: { + DoubleField123 = input.ReadDouble(); + break; + } + case 993: { + DoubleField124 = input.ReadDouble(); + break; + } + case 1000: { + Int64Field125 = input.ReadInt64(); + break; + } + case 1008: { + Int64Field126 = input.ReadInt64(); + break; + } + case 1016: { + Int64Field127 = input.ReadInt64(); + break; + } + case 1025: { + DoubleField128 = input.ReadDouble(); + break; + } + case 1033: { + DoubleField129 = input.ReadDouble(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + DoubleField1 = input.ReadDouble(); + break; + } + case 16: { + Int64Field2 = input.ReadInt64(); + break; + } + case 24: { + Int64Field3 = input.ReadInt64(); + break; + } + case 32: { + Int64Field4 = input.ReadInt64(); + break; + } + case 57: { + DoubleField7 = input.ReadDouble(); + break; + } + case 65: { + DoubleField8 = input.ReadDouble(); + break; + } + case 73: { + DoubleField9 = input.ReadDouble(); + break; + } + case 81: { + DoubleField10 = input.ReadDouble(); + break; + } + case 89: { + DoubleField11 = input.ReadDouble(); + break; + } + case 113: { + DoubleField14 = input.ReadDouble(); + break; + } + case 121: { + DoubleField15 = input.ReadDouble(); + break; + } + case 152: { + Int64Field19 = input.ReadInt64(); + break; + } + case 161: { + DoubleField20 = input.ReadDouble(); + break; + } + case 169: { + DoubleField21 = input.ReadDouble(); + break; + } + case 177: { + DoubleField22 = input.ReadDouble(); + break; + } + case 201: { + DoubleField25 = input.ReadDouble(); + break; + } + case 208: { + Int64Field26 = input.ReadInt64(); + break; + } + case 225: { + DoubleField28 = input.ReadDouble(); + break; + } + case 233: { + DoubleField29 = input.ReadDouble(); + break; + } + case 241: { + DoubleField30 = input.ReadDouble(); + break; + } + case 249: { + DoubleField31 = input.ReadDouble(); + break; + } + case 256: { + Int64Field32 = input.ReadInt64(); + break; + } + case 296: { + Int64Field37 = input.ReadInt64(); + break; + } + case 305: { + DoubleField38 = input.ReadDouble(); + break; + } + case 312: { + Interactions = input.ReadInt64(); + break; + } + case 321: { + DoubleField40 = input.ReadDouble(); + break; + } + case 328: { + Int64Field41 = input.ReadInt64(); + break; + } + case 337: { + DoubleField42 = input.ReadDouble(); + break; + } + case 344: { + Int64Field43 = input.ReadInt64(); + break; + } + case 352: { + Int64Field44 = input.ReadInt64(); + break; + } + case 361: { + DoubleField45 = input.ReadDouble(); + break; + } + case 369: { + DoubleField46 = input.ReadDouble(); + break; + } + case 377: { + DoubleField47 = input.ReadDouble(); + break; + } + case 385: { + DoubleField48 = input.ReadDouble(); + break; + } + case 393: { + DoubleField49 = input.ReadDouble(); + break; + } + case 401: { + DoubleField50 = input.ReadDouble(); + break; + } + case 409: { + DoubleField51 = input.ReadDouble(); + break; + } + case 417: { + DoubleField52 = input.ReadDouble(); + break; + } + case 425: { + DoubleField53 = input.ReadDouble(); + break; + } + case 433: { + DoubleField54 = input.ReadDouble(); + break; + } + case 441: { + DoubleField55 = input.ReadDouble(); + break; + } + case 449: { + DoubleField56 = input.ReadDouble(); + break; + } + case 457: { + DoubleField57 = input.ReadDouble(); + break; + } + case 465: { + DoubleField58 = input.ReadDouble(); + break; + } + case 472: { + Int64Field59 = input.ReadInt64(); + break; + } + case 480: { + Int64Field60 = input.ReadInt64(); + break; + } + case 497: { + DoubleField62 = input.ReadDouble(); + break; + } + case 521: { + DoubleField65 = input.ReadDouble(); + break; + } + case 529: { + DoubleField66 = input.ReadDouble(); + break; + } + case 537: { + DoubleField67 = input.ReadDouble(); + break; + } + case 545: { + DoubleField68 = input.ReadDouble(); + break; + } + case 553: { + DoubleField69 = input.ReadDouble(); + break; + } + case 561: { + DoubleField70 = input.ReadDouble(); + break; + } + case 569: { + DoubleField71 = input.ReadDouble(); + break; + } + case 577: { + DoubleField72 = input.ReadDouble(); + break; + } + case 586: { + StringField73 = input.ReadString(); + break; + } + case 594: { + StringField74 = input.ReadString(); + break; + } + case 601: { + DoubleField75 = input.ReadDouble(); + break; + } + case 617: { + DoubleField77 = input.ReadDouble(); + break; + } + case 625: { + DoubleField78 = input.ReadDouble(); + break; + } + case 633: { + DoubleField79 = input.ReadDouble(); + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 656: { + Int64Field82 = input.ReadInt64(); + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 673: { + DoubleField84 = input.ReadDouble(); + break; + } + case 680: { + Int64Field85 = input.ReadInt64(); + break; + } + case 688: { + Int64Field86 = input.ReadInt64(); + break; + } + case 696: { + Int64Field87 = input.ReadInt64(); + break; + } + case 705: { + DoubleField88 = input.ReadDouble(); + break; + } + case 713: { + DoubleField89 = input.ReadDouble(); + break; + } + case 721: { + DoubleField90 = input.ReadDouble(); + break; + } + case 729: { + DoubleField91 = input.ReadDouble(); + break; + } + case 737: { + DoubleField92 = input.ReadDouble(); + break; + } + case 745: { + DoubleField93 = input.ReadDouble(); + break; + } + case 753: { + DoubleField94 = input.ReadDouble(); + break; + } + case 761: { + DoubleField95 = input.ReadDouble(); + break; + } + case 769: { + DoubleField96 = input.ReadDouble(); + break; + } + case 777: { + DoubleField97 = input.ReadDouble(); + break; + } + case 785: { + DoubleField98 = input.ReadDouble(); + break; + } + case 793: { + DoubleField99 = input.ReadDouble(); + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec); + break; + } + case 809: { + DoubleField101 = input.ReadDouble(); + break; + } + case 817: { + DoubleField102 = input.ReadDouble(); + break; + } + case 825: { + DoubleField103 = input.ReadDouble(); + break; + } + case 833: { + DoubleField104 = input.ReadDouble(); + break; + } + case 841: { + DoubleField105 = input.ReadDouble(); + break; + } + case 849: { + DoubleField106 = input.ReadDouble(); + break; + } + case 856: { + Int64Field107 = input.ReadInt64(); + break; + } + case 865: { + DoubleField108 = input.ReadDouble(); + break; + } + case 873: { + DoubleField109 = input.ReadDouble(); + break; + } + case 880: { + Int64Field110 = input.ReadInt64(); + break; + } + case 889: { + DoubleField111 = input.ReadDouble(); + break; + } + case 896: { + Int64Field112 = input.ReadInt64(); + break; + } + case 905: { + DoubleField113 = input.ReadDouble(); + break; + } + case 912: { + Int64Field114 = input.ReadInt64(); + break; + } + case 920: { + Int64Field115 = input.ReadInt64(); + break; + } + case 929: { + DoubleField116 = input.ReadDouble(); + break; + } + case 936: { + Int64Field117 = input.ReadInt64(); + break; + } + case 945: { + DoubleField118 = input.ReadDouble(); + break; + } + case 953: { + DoubleField119 = input.ReadDouble(); + break; + } + case 961: { + DoubleField120 = input.ReadDouble(); + break; + } + case 969: { + DoubleField121 = input.ReadDouble(); + break; + } + case 977: { + DoubleField122 = input.ReadDouble(); + break; + } + case 985: { + DoubleField123 = input.ReadDouble(); + break; + } + case 993: { + DoubleField124 = input.ReadDouble(); + break; + } + case 1000: { + Int64Field125 = input.ReadInt64(); + break; + } + case 1008: { + Int64Field126 = input.ReadInt64(); + break; + } + case 1016: { + Int64Field127 = input.ReadInt64(); + break; + } + case 1025: { + DoubleField128 = input.ReadDouble(); + break; + } + case 1033: { + DoubleField129 = input.ReadDouble(); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs new file mode 100644 index 0000000000000000000000000000000000000000..5a3bba74d260e33900ab580cdeacc6f8eac139a2 --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs @@ -0,0 +1,198 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using BenchmarkDotNet.Attributes; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Buffers; +using Google.Protobuf.WellKnownTypes; + +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmark that tests writing performance for various messages. + /// + [MemoryDiagnoser] + public class WriteMessagesBenchmark + { + const int MaxMessages = 100; + + SubTest manyWrapperFieldsTest = new SubTest(ParseMessagesBenchmark.CreateManyWrapperFieldsMessage(), MaxMessages); + SubTest manyPrimitiveFieldsTest = new SubTest(ParseMessagesBenchmark.CreateManyPrimitiveFieldsMessage(), MaxMessages); + SubTest emptyMessageTest = new SubTest(new Empty(), MaxMessages); + + public IEnumerable MessageCountValues => new[] { 10, 100 }; + + [GlobalSetup] + public void GlobalSetup() + { + } + + [Benchmark] + public byte[] ManyWrapperFieldsMessage_ToByteArray() + { + return manyWrapperFieldsTest.ToByteArray(); + } + + [Benchmark] + public byte[] ManyWrapperFieldsMessage_WriteToCodedOutputStream() + { + return manyWrapperFieldsTest.WriteToCodedOutputStream_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] ManyWrapperFieldsMessage_WriteToSpan() + { + return manyWrapperFieldsTest.WriteToSpan_PreAllocatedBuffer(); + } + + + [Benchmark] + public byte[] ManyPrimitiveFieldsMessage_ToByteArray() + { + return manyPrimitiveFieldsTest.ToByteArray(); + } + + [Benchmark] + public byte[] ManyPrimitiveFieldsMessage_WriteToCodedOutputStream() + { + return manyPrimitiveFieldsTest.WriteToCodedOutputStream_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] ManyPrimitiveFieldsMessage_WriteToSpan() + { + return manyPrimitiveFieldsTest.WriteToSpan_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] EmptyMessage_ToByteArray() + { + return emptyMessageTest.ToByteArray(); + } + + [Benchmark] + public byte[] EmptyMessage_WriteToCodedOutputStream() + { + return emptyMessageTest.WriteToCodedOutputStream_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] EmptyMessage_WriteToSpan() + { + return emptyMessageTest.WriteToSpan_PreAllocatedBuffer(); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyWrapperFieldsMessage_WriteDelimitedMessagesToCodedOutputStream(int messageCount) + { + manyWrapperFieldsTest.WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyWrapperFieldsMessage_WriteDelimitedMessagesToSpan(int messageCount) + { + manyWrapperFieldsTest.WriteDelimitedMessagesToSpan_PreAllocatedBuffer(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyPrimitiveFieldsMessage_WriteDelimitedMessagesToCodedOutputStream(int messageCount) + { + manyPrimitiveFieldsTest.WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyPrimitiveFieldsMessage_WriteDelimitedMessagesToSpan(int messageCount) + { + manyPrimitiveFieldsTest.WriteDelimitedMessagesToSpan_PreAllocatedBuffer(messageCount); + } + + private class SubTest + { + private readonly IMessage message; + private readonly byte[] outputBuffer; + private readonly byte[] multipleMessagesOutputBuffer; + + public SubTest(IMessage message, int maxMessageCount) + { + this.message = message; + + int messageSize = message.CalculateSize(); + this.outputBuffer = new byte[messageSize]; + this.multipleMessagesOutputBuffer = new byte[maxMessageCount * (messageSize + CodedOutputStream.ComputeLengthSize(messageSize))]; + } + + public byte[] ToByteArray() => message.ToByteArray(); + + public byte[] WriteToCodedOutputStream_PreAllocatedBuffer() + { + var cos = new CodedOutputStream(outputBuffer); // use pre-existing output buffer + message.WriteTo(cos); + return outputBuffer; + } + + public byte[] WriteToSpan_PreAllocatedBuffer() + { + var span = new Span(outputBuffer); // use pre-existing output buffer + message.WriteTo(span); + return outputBuffer; + } + + public byte[] WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(int messageCount) + { + var cos = new CodedOutputStream(multipleMessagesOutputBuffer); // use pre-existing output buffer + for (int i = 0; i < messageCount; i++) + { + cos.WriteMessage(message); + } + return multipleMessagesOutputBuffer; + } + + public byte[] WriteDelimitedMessagesToSpan_PreAllocatedBuffer(int messageCount) + { + var span = new Span(multipleMessagesOutputBuffer); // use pre-existing output buffer + WriteContext.Initialize(ref span, out WriteContext ctx); + for (int i = 0; i < messageCount; i++) + { + ctx.WriteMessage(message); + } + return multipleMessagesOutputBuffer; + } + } + } +} diff --git a/csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs new file mode 100644 index 0000000000000000000000000000000000000000..66b6b4a02828ffcf844a9cd322af4fcd220eca48 --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs @@ -0,0 +1,519 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using BenchmarkDotNet.Attributes; +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Buffers; +using System.Text; + +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmarks throughput when writing raw primitives. + /// + [MemoryDiagnoser] + public class WriteRawPrimitivesBenchmark + { + // key is the encodedSize of varint values + Dictionary varint32Values; + Dictionary varint64Values; + + double[] doubleValues; + float[] floatValues; + + // key is the encodedSize of string values + Dictionary stringValues; + + // key is the encodedSize of string values + Dictionary nonAsciiStringValues; + + // key is the encodedSize of string values + Dictionary byteStringValues; + + // the buffer to which all the data will be written + byte[] outputBuffer; + + Random random = new Random(417384220); // random but deterministic seed + + public IEnumerable StringEncodedSizes => new[] { 1, 4, 10, 105, 10080 }; + + public IEnumerable NonAsciiStringEncodedSizes => new[] { 4, 10, 105, 10080 }; + + [GlobalSetup] + public void GlobalSetup() + { + outputBuffer = new byte[BytesToWrite]; + + varint32Values = new Dictionary(); + varint64Values = new Dictionary(); + for (int encodedSize = 1; encodedSize <= 10; encodedSize++) + { + if (encodedSize <= 5) + { + varint32Values.Add(encodedSize, CreateRandomVarints32(random, BytesToWrite / encodedSize, encodedSize)); + } + varint64Values.Add(encodedSize, CreateRandomVarints64(random, BytesToWrite / encodedSize, encodedSize)); + } + + doubleValues = CreateRandomDoubles(random, BytesToWrite / sizeof(double)); + floatValues = CreateRandomFloats(random, BytesToWrite / sizeof(float)); + + stringValues = new Dictionary(); + + byteStringValues = new Dictionary(); + foreach(var encodedSize in StringEncodedSizes) + { + stringValues.Add(encodedSize, CreateStrings(BytesToWrite / encodedSize, encodedSize)); + byteStringValues.Add(encodedSize, CreateByteStrings(BytesToWrite / encodedSize, encodedSize)); + } + + nonAsciiStringValues = new Dictionary(); + foreach(var encodedSize in NonAsciiStringEncodedSizes) + { + nonAsciiStringValues.Add(encodedSize, CreateNonAsciiStrings(BytesToWrite / encodedSize, encodedSize)); + } + } + + // Total number of bytes that each benchmark will write. + // Measuring the time taken to write buffer of given size makes it easier to compare parsing speed for different + // types and makes it easy to calculate the througput (in MB/s) + // 10800 bytes is chosen because it is divisible by all possible encoded sizes for all primitive types {1..10} + [Params(10080)] + public int BytesToWrite { get; set; } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + public void WriteRawVarint32_CodedOutputStream(int encodedSize) + { + var values = varint32Values[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + for (int i = 0; i < values.Length; i++) + { + cos.WriteRawVarint32(values[i]); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + public void WriteRawVarint32_WriteContext(int encodedSize) + { + var values = varint32Values[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (int i = 0; i < values.Length; i++) + { + ctx.WriteUInt32(values[i]); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + [Arguments(6)] + [Arguments(7)] + [Arguments(8)] + [Arguments(9)] + [Arguments(10)] + public void WriteRawVarint64_CodedOutputStream(int encodedSize) + { + var values = varint64Values[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + for (int i = 0; i < values.Length; i++) + { + cos.WriteRawVarint64(values[i]); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + [Arguments(6)] + [Arguments(7)] + [Arguments(8)] + [Arguments(9)] + [Arguments(10)] + public void WriteRawVarint64_WriteContext(int encodedSize) + { + var values = varint64Values[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (int i = 0; i < values.Length; i++) + { + ctx.WriteUInt64(values[i]); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed32_CodedOutputStream() + { + const int encodedSize = sizeof(uint); + var cos = new CodedOutputStream(outputBuffer); + for (int i = 0; i < BytesToWrite / encodedSize; i++) + { + cos.WriteFixed32(12345); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed32_WriteContext() + { + const int encodedSize = sizeof(uint); + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteFixed32(12345); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed64_CodedOutputStream() + { + const int encodedSize = sizeof(ulong); + var cos = new CodedOutputStream(outputBuffer); + for(int i = 0; i < BytesToWrite / encodedSize; i++) + { + cos.WriteFixed64(123456789); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed64_WriteContext() + { + const int encodedSize = sizeof(ulong); + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteFixed64(123456789); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawTag_OneByte_WriteContext() + { + const int encodedSize = 1; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteRawTag(16); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawTag_TwoBytes_WriteContext() + { + const int encodedSize = 2; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteRawTag(137, 6); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawTag_ThreeBytes_WriteContext() + { + const int encodedSize = 3; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteRawTag(160, 131, 1); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void Baseline_WriteContext() + { + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + ctx.state.position = outputBuffer.Length; + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawFloat_CodedOutputStream() + { + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in floatValues) + { + cos.WriteFloat(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawFloat_WriteContext() + { + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in floatValues) + { + ctx.WriteFloat(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawDouble_CodedOutputStream() + { + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in doubleValues) + { + cos.WriteDouble(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawDouble_WriteContext() + { + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in doubleValues) + { + ctx.WriteDouble(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteString_CodedOutputStream(int encodedSize) + { + var values = stringValues[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in values) + { + cos.WriteString(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteString_WriteContext(int encodedSize) + { + var values = stringValues[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in values) + { + ctx.WriteString(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(NonAsciiStringEncodedSizes))] + public void WriteNonAsciiString_CodedOutputStream(int encodedSize) + { + var values = nonAsciiStringValues[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in values) + { + cos.WriteString(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(NonAsciiStringEncodedSizes))] + public void WriteNonAsciiString_WriteContext(int encodedSize) + { + var values = nonAsciiStringValues[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in values) + { + ctx.WriteString(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteBytes_CodedOutputStream(int encodedSize) + { + var values = byteStringValues[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in values) + { + cos.WriteBytes(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteBytes_WriteContext(int encodedSize) + { + var values = byteStringValues[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in values) + { + ctx.WriteBytes(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + private static uint[] CreateRandomVarints32(Random random, int valueCount, int encodedSize) + { + var result = new uint[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = (uint) ParseRawPrimitivesBenchmark.RandomUnsignedVarint(random, encodedSize, true); + } + return result; + } + + private static ulong[] CreateRandomVarints64(Random random, int valueCount, int encodedSize) + { + var result = new ulong[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = ParseRawPrimitivesBenchmark.RandomUnsignedVarint(random, encodedSize, false); + } + return result; + } + + private static float[] CreateRandomFloats(Random random, int valueCount) + { + var result = new float[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = (float)random.NextDouble(); + } + return result; + } + + private static double[] CreateRandomDoubles(Random random, int valueCount) + { + var result = new double[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = random.NextDouble(); + } + return result; + } + + private static string[] CreateStrings(int valueCount, int encodedSize) + { + var str = ParseRawPrimitivesBenchmark.CreateStringWithEncodedSize(encodedSize); + + var result = new string[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = str; + } + return result; + } + + private static string[] CreateNonAsciiStrings(int valueCount, int encodedSize) + { + var str = ParseRawPrimitivesBenchmark.CreateNonAsciiStringWithEncodedSize(encodedSize); + + var result = new string[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = str; + } + return result; + } + + private static ByteString[] CreateByteStrings(int valueCount, int encodedSize) + { + var str = ParseRawPrimitivesBenchmark.CreateStringWithEncodedSize(encodedSize); + + var result = new ByteString[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = ByteString.CopyFrom(Encoding.UTF8.GetBytes(str)); + } + return result; + } + } +} diff --git a/csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto b/csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto new file mode 100644 index 0000000000000000000000000000000000000000..6802c252ba0c81cc00c965838f3ad5847c892bf5 --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto @@ -0,0 +1,237 @@ +syntax = "proto3"; + +package google.protobuf.benchmarks; + +import "google/protobuf/wrappers.proto"; + +// a message that has a large number of wrapper fields +// obfuscated version of an internal message +message ManyWrapperFieldsMessage { + google.protobuf.DoubleValue double_field_95 = 95; + google.protobuf.DoubleValue double_field_1 = 1; + google.protobuf.DoubleValue double_field_79 = 79; + google.protobuf.Int64Value int64_field_2 = 2; + google.protobuf.DoubleValue double_field_96 = 96; + google.protobuf.Int64Value int64_field_3 = 3; + google.protobuf.Int64Value int64_field_4 = 4; + google.protobuf.DoubleValue double_field_97 = 97; + google.protobuf.DoubleValue double_field_65 = 65; + google.protobuf.DoubleValue double_field_66 = 66; + google.protobuf.DoubleValue double_field_7 = 7; + google.protobuf.DoubleValue double_field_62 = 62; + google.protobuf.DoubleValue double_field_118 = 118; + google.protobuf.DoubleValue double_field_119 = 119; + google.protobuf.DoubleValue double_field_67 = 67; + google.protobuf.DoubleValue double_field_120 = 120; + google.protobuf.DoubleValue double_field_121 = 121; + google.protobuf.DoubleValue double_field_122 = 122; + google.protobuf.DoubleValue double_field_123 = 123; + google.protobuf.DoubleValue double_field_124 = 124; + google.protobuf.DoubleValue double_field_8 = 8; + google.protobuf.DoubleValue double_field_9 = 9; + google.protobuf.DoubleValue double_field_98 = 98; + google.protobuf.DoubleValue double_field_10 = 10; + google.protobuf.DoubleValue double_field_11 = 11; + google.protobuf.DoubleValue double_field_99 = 99; + google.protobuf.DoubleValue double_field_84 = 84; + google.protobuf.DoubleValue double_field_14 = 14; + google.protobuf.DoubleValue double_field_77 = 77; + google.protobuf.DoubleValue double_field_15 = 15; + google.protobuf.Int64Value int64_field_19 = 19; + google.protobuf.Int64Value int64_field_115 = 115; + google.protobuf.DoubleValue double_field_116 = 116; + google.protobuf.Int64Value int64_field_117 = 117; + google.protobuf.DoubleValue double_field_20 = 20; + google.protobuf.DoubleValue double_field_21 = 21; + google.protobuf.StringValue string_field_73 = 73; + google.protobuf.StringValue string_field_74 = 74; + google.protobuf.DoubleValue double_field_22 = 22; + google.protobuf.DoubleValue double_field_69 = 69; + google.protobuf.DoubleValue double_field_70 = 70; + google.protobuf.DoubleValue double_field_71 = 71; + google.protobuf.DoubleValue double_field_72 = 72; + google.protobuf.DoubleValue double_field_25 = 25; + google.protobuf.Int64Value int64_field_26 = 26; + google.protobuf.DoubleValue double_field_68 = 68; + google.protobuf.DoubleValue double_field_28 = 28; + google.protobuf.DoubleValue double_field_106 = 106; + google.protobuf.DoubleValue double_field_29 = 29; + google.protobuf.DoubleValue double_field_30 = 30; + google.protobuf.DoubleValue double_field_101 = 101; + google.protobuf.DoubleValue double_field_102 = 102; + google.protobuf.DoubleValue double_field_103 = 103; + google.protobuf.DoubleValue double_field_104 = 104; + google.protobuf.DoubleValue double_field_105 = 105; + google.protobuf.DoubleValue double_field_31 = 31; + google.protobuf.Int64Value int64_field_32 = 32; + google.protobuf.DoubleValue double_field_75 = 75; + google.protobuf.DoubleValue double_field_129 = 129; + int32 enum_field_80 = 80; + int32 enum_field_81 = 81; + google.protobuf.Int64Value int64_field_82 = 82; + int32 enum_field_83 = 83; + google.protobuf.Int64Value int64_field_85 = 85; + google.protobuf.Int64Value int64_field_86 = 86; + google.protobuf.Int64Value int64_field_87 = 87; + google.protobuf.Int64Value int64_field_125 = 125; + google.protobuf.Int64Value int64_field_37 = 37; + google.protobuf.DoubleValue double_field_38 = 38; + google.protobuf.Int64Value interactions = 39; + repeated int32 repeated_int_field_100 = 100; + google.protobuf.DoubleValue double_field_40 = 40; + google.protobuf.Int64Value int64_field_41 = 41; + google.protobuf.Int64Value int64_field_126 = 126; + google.protobuf.Int64Value int64_field_127 = 127; + google.protobuf.DoubleValue double_field_128 = 128; + google.protobuf.DoubleValue double_field_109 = 109; + google.protobuf.Int64Value int64_field_110 = 110; + google.protobuf.DoubleValue double_field_111 = 111; + google.protobuf.Int64Value int64_field_112 = 112; + google.protobuf.DoubleValue double_field_113 = 113; + google.protobuf.Int64Value int64_field_114 = 114; + google.protobuf.DoubleValue double_field_42 = 42; + google.protobuf.Int64Value int64_field_43 = 43; + google.protobuf.Int64Value int64_field_44 = 44; + google.protobuf.DoubleValue double_field_45 = 45; + google.protobuf.DoubleValue double_field_46 = 46; + google.protobuf.DoubleValue double_field_78 = 78; + google.protobuf.DoubleValue double_field_88 = 88; + google.protobuf.DoubleValue double_field_47 = 47; + google.protobuf.DoubleValue double_field_89 = 89; + google.protobuf.DoubleValue double_field_48 = 48; + google.protobuf.DoubleValue double_field_49 = 49; + google.protobuf.DoubleValue double_field_50 = 50; + google.protobuf.DoubleValue double_field_90 = 90; + google.protobuf.DoubleValue double_field_51 = 51; + google.protobuf.DoubleValue double_field_91 = 91; + google.protobuf.DoubleValue double_field_92 = 92; + google.protobuf.Int64Value int64_field_107 = 107; + google.protobuf.DoubleValue double_field_93 = 93; + google.protobuf.DoubleValue double_field_108 = 108; + google.protobuf.DoubleValue double_field_52 = 52; + google.protobuf.DoubleValue double_field_53 = 53; + google.protobuf.DoubleValue double_field_94 = 94; + google.protobuf.DoubleValue double_field_54 = 54; + google.protobuf.DoubleValue double_field_55 = 55; + google.protobuf.DoubleValue double_field_56 = 56; + google.protobuf.DoubleValue double_field_57 = 57; + google.protobuf.DoubleValue double_field_58 = 58; + google.protobuf.Int64Value int64_field_59 = 59; + google.protobuf.Int64Value int64_field_60 = 60; +} + +// same as ManyWrapperFieldsMessages, but with primitive fields +// for comparison. +message ManyPrimitiveFieldsMessage { + double double_field_95 = 95; + double double_field_1 = 1; + double double_field_79 = 79; + int64 int64_field_2 = 2; + double double_field_96 = 96; + int64 int64_field_3 = 3; + int64 int64_field_4 = 4; + double double_field_97 = 97; + double double_field_65 = 65; + double double_field_66 = 66; + double double_field_7 = 7; + double double_field_62 = 62; + double double_field_118 = 118; + double double_field_119 = 119; + double double_field_67 = 67; + double double_field_120 = 120; + double double_field_121 = 121; + double double_field_122 = 122; + double double_field_123 = 123; + double double_field_124 = 124; + double double_field_8 = 8; + double double_field_9 = 9; + double double_field_98 = 98; + double double_field_10 = 10; + double double_field_11 = 11; + double double_field_99 = 99; + double double_field_84 = 84; + double double_field_14 = 14; + double double_field_77 = 77; + double double_field_15 = 15; + int64 int64_field_19 = 19; + int64 int64_field_115 = 115; + double double_field_116 = 116; + int64 int64_field_117 = 117; + double double_field_20 = 20; + double double_field_21 = 21; + string string_field_73 = 73; + string string_field_74 = 74; + double double_field_22 = 22; + double double_field_69 = 69; + double double_field_70 = 70; + double double_field_71 = 71; + double double_field_72 = 72; + double double_field_25 = 25; + int64 int64_field_26 = 26; + double double_field_68 = 68; + double double_field_28 = 28; + double double_field_106 = 106; + double double_field_29 = 29; + double double_field_30 = 30; + double double_field_101 = 101; + double double_field_102 = 102; + double double_field_103 = 103; + double double_field_104 = 104; + double double_field_105 = 105; + double double_field_31 = 31; + int64 int64_field_32 = 32; + double double_field_75 = 75; + double double_field_129 = 129; + int32 enum_field_80 = 80; + int32 enum_field_81 = 81; + int64 int64_field_82 = 82; + int32 enum_field_83 = 83; + int64 int64_field_85 = 85; + int64 int64_field_86 = 86; + int64 int64_field_87 = 87; + int64 int64_field_125 = 125; + int64 int64_field_37 = 37; + double double_field_38 = 38; + int64 interactions = 39; + repeated int32 repeated_int_field_100 = 100; + double double_field_40 = 40; + int64 int64_field_41 = 41; + int64 int64_field_126 = 126; + int64 int64_field_127 = 127; + double double_field_128 = 128; + double double_field_109 = 109; + int64 int64_field_110 = 110; + double double_field_111 = 111; + int64 int64_field_112 = 112; + double double_field_113 = 113; + int64 int64_field_114 = 114; + double double_field_42 = 42; + int64 int64_field_43 = 43; + int64 int64_field_44 = 44; + double double_field_45 = 45; + double double_field_46 = 46; + double double_field_78 = 78; + double double_field_88 = 88; + double double_field_47 = 47; + double double_field_89 = 89; + double double_field_48 = 48; + double double_field_49 = 49; + double double_field_50 = 50; + double double_field_90 = 90; + double double_field_51 = 51; + double double_field_91 = 91; + double double_field_92 = 92; + int64 int64_field_107 = 107; + double double_field_93 = 93; + double double_field_108 = 108; + double double_field_52 = 52; + double double_field_53 = 53; + double double_field_94 = 94; + double double_field_54 = 54; + double double_field_55 = 55; + double double_field_56 = 56; + double double_field_57 = 57; + double double_field_58 = 58; + int64 int64_field_59 = 59; + int64 int64_field_60 = 60; +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Conformance/BUILD.bazel b/csharp/src/Google.Protobuf.Conformance/BUILD.bazel deleted file mode 100644 index df7371f6621d821f6265bdbd517d4b2a66beb42c..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf.Conformance/BUILD.bazel +++ /dev/null @@ -1,94 +0,0 @@ -load("//build_defs:internal_shell.bzl", "inline_sh_binary") -load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") - -inline_sh_binary( - name = "build_conformance_test", - srcs = ["Google.Protobuf.Conformance.csproj"], - cmd = "dotnet build -c Release $(SRCS)", - visibility = ["//visibility:private"], -) - -CONFORMANCE_DEPS = [ - "Google.Protobuf.dll", - "Google.Protobuf.Conformance.deps.json", - "Google.Protobuf.Conformance.pdb", - "Google.Protobuf.Conformance.runtimeconfig.json", - "Google.Protobuf.Test.dll", - "Google.Protobuf.Test.TestProtos.dll", - "Microsoft.TestPlatform.CommunicationUtilities.dll", - "Microsoft.TestPlatform.CoreUtilities.dll", - "Microsoft.TestPlatform.CrossPlatEngine.dll", - "Microsoft.TestPlatform.PlatformAbstractions.dll", - "Microsoft.TestPlatform.Utilities.dll", - "Microsoft.VisualStudio.CodeCoverage.Shim.dll", - "Microsoft.VisualStudio.TestPlatform.Common.dll", - "Microsoft.VisualStudio.TestPlatform.ObjectModel.dll", - "NUnit3.TestAdapter.dll", - "Newtonsoft.Json.dll", - "NuGet.Frameworks.dll", - "nunit.engine.api.dll", - "nunit.engine.core.dll", - "nunit.engine.dll", - "nunit.framework.dll", - "testcentric.engine.metadata.dll", - "testhost.dll", -] - -filegroup( - name = "srcs", - srcs = [ - "Google.Protobuf.Conformance.csproj", - "Program.cs", - ], - visibility = [ - "//csharp:__subpackages__", - ], -) - -genrule( - name = "package_conformance_test", - srcs = [ - "Program.cs", - "Google.Protobuf.Conformance.csproj", - "//conformance:conformance_csharp_proto", - "//csharp:srcs", - ], - outs = CONFORMANCE_DEPS + ["Google.Protobuf.Conformance.dll"], - cmd = """ - SRCDIR=$$(dirname $(location :Program.cs)) - cp $(location //conformance:conformance_csharp_proto) $$SRCDIR - DOTNET_CLI_HOME=/tmp ./$(location :build_conformance_test) - cp -r $$SRCDIR/bin/Release/net6.0/* $(RULEDIR) - """, - tools = [":build_conformance_test"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "conformance_dll", - srcs = ["Google.Protobuf.Conformance.dll"], - data = [":package_conformance_test"], - visibility = ["//conformance:__subpackages__"], -) - -filegroup( - name = "conformance_runfiles", - srcs = CONFORMANCE_DEPS, - data = [":package_conformance_test"], - visibility = ["//conformance:__subpackages__"], -) - -################################################################################ -# Distribution files -################################################################################ - -pkg_files( - name = "dist_files", - srcs = [ - "BUILD.bazel", - "Google.Protobuf.Conformance.csproj", - "Program.cs", - ], - strip_prefix = strip_prefix.from_root(""), - visibility = ["//csharp:__pkg__"], -) diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.cs index f26d181a98dedd161f2ff3165b4ece18227d28ad..06b61ea8bd6e45e86b7463a6eba9e68810d44e56 100644 --- a/csharp/src/Google.Protobuf.Conformance/Conformance.cs +++ b/csharp/src/Google.Protobuf.Conformance/Conformance.cs @@ -82,7 +82,7 @@ namespace Conformance { [pbr::OriginalName("JSON_TEST")] JsonTest = 2, /// /// Similar to JSON_TEST. However, during parsing json, testee should ignore - /// unknown fields. This feature is optional. Each implementation can descide + /// unknown fields. This feature is optional. Each implementation can decide /// whether to support it. See /// https://developers.google.com/protocol-buffers/docs/proto3#json_options /// for more detail. @@ -414,7 +414,7 @@ namespace Conformance { private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest; /// /// Each test is given a specific test category. Some category may need - /// spedific support in testee programs. Refer to the definition of TestCategory + /// specific support in testee programs. Refer to the definition of TestCategory /// for more information. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs deleted file mode 100644 index 26b32fb1762b3e34579ebea9d118e7d22d17a8b8..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs +++ /dev/null @@ -1,1823 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: conformance/conformance.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Conformance { - - /// Holder for reflection information generated from conformance/conformance.proto - public static partial class ConformanceReflection { - - #region Descriptor - /// File descriptor for conformance/conformance.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static ConformanceReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch1jb25mb3JtYW5jZS9jb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2Ui", - "HQoKRmFpbHVyZVNldBIPCgdmYWlsdXJlGAEgAygJIuMCChJDb25mb3JtYW5j", - "ZVJlcXVlc3QSGgoQcHJvdG9idWZfcGF5bG9hZBgBIAEoDEgAEhYKDGpzb25f", - "cGF5bG9hZBgCIAEoCUgAEhYKDGpzcGJfcGF5bG9hZBgHIAEoCUgAEhYKDHRl", - "eHRfcGF5bG9hZBgIIAEoCUgAEjgKF3JlcXVlc3RlZF9vdXRwdXRfZm9ybWF0", - "GAMgASgOMhcuY29uZm9ybWFuY2UuV2lyZUZvcm1hdBIUCgxtZXNzYWdlX3R5", - "cGUYBCABKAkSMAoNdGVzdF9jYXRlZ29yeRgFIAEoDjIZLmNvbmZvcm1hbmNl", - "LlRlc3RDYXRlZ29yeRI+ChVqc3BiX2VuY29kaW5nX29wdGlvbnMYBiABKAsy", - "Hy5jb25mb3JtYW5jZS5Kc3BiRW5jb2RpbmdDb25maWcSHAoUcHJpbnRfdW5r", - "bm93bl9maWVsZHMYCSABKAhCCQoHcGF5bG9hZCL6AQoTQ29uZm9ybWFuY2VS", - "ZXNwb25zZRIVCgtwYXJzZV9lcnJvchgBIAEoCUgAEhkKD3NlcmlhbGl6ZV9l", - "cnJvchgGIAEoCUgAEhcKDXRpbWVvdXRfZXJyb3IYCSABKAlIABIXCg1ydW50", - "aW1lX2Vycm9yGAIgASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgDIAEoDEgA", - "EhYKDGpzb25fcGF5bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSABKAlIABIW", - "Cgxqc3BiX3BheWxvYWQYByABKAlIABIWCgx0ZXh0X3BheWxvYWQYCCABKAlI", - "AEIICgZyZXN1bHQiNwoSSnNwYkVuY29kaW5nQ29uZmlnEiEKGXVzZV9qc3Bi", - "X2FycmF5X2FueV9mb3JtYXQYASABKAgqUAoKV2lyZUZvcm1hdBIPCgtVTlNQ", - "RUNJRklFRBAAEgwKCFBST1RPQlVGEAESCAoESlNPThACEggKBEpTUEIQAxIP", - "CgtURVhUX0ZPUk1BVBAEKo8BCgxUZXN0Q2F0ZWdvcnkSFAoQVU5TUEVDSUZJ", - "RURfVEVTVBAAEg8KC0JJTkFSWV9URVNUEAESDQoJSlNPTl9URVNUEAISJAog", - "SlNPTl9JR05PUkVfVU5LTk9XTl9QQVJTSU5HX1RFU1QQAxINCglKU1BCX1RF", - "U1QQBBIUChBURVhUX0ZPUk1BVF9URVNUEAVCLwofY29tLmdvb2dsZS5wcm90", - "b2J1Zi5jb25mb3JtYW5jZaICC0NvbmZvcm1hbmNlYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), typeof(global::Conformance.TestCategory), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.FailureSet), global::Conformance.FailureSet.Parser, new[]{ "Failure" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "JspbPayload", "TextPayload", "RequestedOutputFormat", "MessageType", "TestCategory", "JspbEncodingOptions", "PrintUnknownFields" }, new[]{ "Payload" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "TimeoutError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped", "JspbPayload", "TextPayload" }, new[]{ "Result" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.JspbEncodingConfig), global::Conformance.JspbEncodingConfig.Parser, new[]{ "UseJspbArrayAnyFormat" }, null, null, null, null) - })); - } - #endregion - - } - #region Enums - public enum WireFormat { - [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, - [pbr::OriginalName("PROTOBUF")] Protobuf = 1, - [pbr::OriginalName("JSON")] Json = 2, - /// - /// Only used inside Google. Opensource testees just skip it. - /// - [pbr::OriginalName("JSPB")] Jspb = 3, - [pbr::OriginalName("TEXT_FORMAT")] TextFormat = 4, - } - - public enum TestCategory { - [pbr::OriginalName("UNSPECIFIED_TEST")] UnspecifiedTest = 0, - /// - /// Test binary wire format. - /// - [pbr::OriginalName("BINARY_TEST")] BinaryTest = 1, - /// - /// Test json wire format. - /// - [pbr::OriginalName("JSON_TEST")] JsonTest = 2, - /// - /// Similar to JSON_TEST. However, during parsing json, testee should ignore - /// unknown fields. This feature is optional. Each implementation can decide - /// whether to support it. See - /// https://developers.google.com/protocol-buffers/docs/proto3#json_options - /// for more detail. - /// - [pbr::OriginalName("JSON_IGNORE_UNKNOWN_PARSING_TEST")] JsonIgnoreUnknownParsingTest = 3, - /// - /// Test jspb wire format. Only used inside Google. Opensource testees just - /// skip it. - /// - [pbr::OriginalName("JSPB_TEST")] JspbTest = 4, - /// - /// Test text format. For cpp, java and python, testees can already deal with - /// this type. Testees of other languages can simply skip it. - /// - [pbr::OriginalName("TEXT_FORMAT_TEST")] TextFormatTest = 5, - } - - #endregion - - #region Messages - /// - /// The conformance runner will request a list of failures as the first request. - /// This will be known by message_type == "conformance.FailureSet", a conformance - /// test should return a serialized FailureSet in protobuf_payload. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FailureSet : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FailureSet()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FailureSet() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FailureSet(FailureSet other) : this() { - failure_ = other.failure_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FailureSet Clone() { - return new FailureSet(this); - } - - /// Field number for the "failure" field. - public const int FailureFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_failure_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField failure_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Failure { - get { return failure_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FailureSet); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FailureSet other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!failure_.Equals(other.failure_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= failure_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - failure_.WriteTo(output, _repeated_failure_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - failure_.WriteTo(ref output, _repeated_failure_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += failure_.CalculateSize(_repeated_failure_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FailureSet other) { - if (other == null) { - return; - } - failure_.Add(other.failure_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - failure_.AddEntriesFrom(input, _repeated_failure_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - failure_.AddEntriesFrom(ref input, _repeated_failure_codec); - break; - } - } - } - } - #endif - - } - - /// - /// Represents a single test case's input. The testee should: - /// - /// 1. parse this proto (which should always succeed) - /// 2. parse the protobuf or JSON payload in "payload" (which may fail) - /// 3. if the parse succeeded, serialize the message in the requested format. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ConformanceRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConformanceRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConformanceRequest(ConformanceRequest other) : this() { - requestedOutputFormat_ = other.requestedOutputFormat_; - messageType_ = other.messageType_; - testCategory_ = other.testCategory_; - jspbEncodingOptions_ = other.jspbEncodingOptions_ != null ? other.jspbEncodingOptions_.Clone() : null; - printUnknownFields_ = other.printUnknownFields_; - switch (other.PayloadCase) { - case PayloadOneofCase.ProtobufPayload: - ProtobufPayload = other.ProtobufPayload; - break; - case PayloadOneofCase.JsonPayload: - JsonPayload = other.JsonPayload; - break; - case PayloadOneofCase.JspbPayload: - JspbPayload = other.JspbPayload; - break; - case PayloadOneofCase.TextPayload: - TextPayload = other.TextPayload; - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConformanceRequest Clone() { - return new ConformanceRequest(this); - } - - /// Field number for the "protobuf_payload" field. - public const int ProtobufPayloadFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString ProtobufPayload { - get { return HasProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; } - set { - payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - payloadCase_ = PayloadOneofCase.ProtobufPayload; - } - } - /// Gets whether the "protobuf_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasProtobufPayload { - get { return payloadCase_ == PayloadOneofCase.ProtobufPayload; } - } - /// Clears the value of the oneof if it's currently set to "protobuf_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearProtobufPayload() { - if (HasProtobufPayload) { - ClearPayload(); - } - } - - /// Field number for the "json_payload" field. - public const int JsonPayloadFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JsonPayload { - get { return HasJsonPayload ? (string) payload_ : ""; } - set { - payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - payloadCase_ = PayloadOneofCase.JsonPayload; - } - } - /// Gets whether the "json_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJsonPayload { - get { return payloadCase_ == PayloadOneofCase.JsonPayload; } - } - /// Clears the value of the oneof if it's currently set to "json_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJsonPayload() { - if (HasJsonPayload) { - ClearPayload(); - } - } - - /// Field number for the "jspb_payload" field. - public const int JspbPayloadFieldNumber = 7; - /// - /// Only used inside Google. Opensource testees just skip it. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JspbPayload { - get { return HasJspbPayload ? (string) payload_ : ""; } - set { - payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - payloadCase_ = PayloadOneofCase.JspbPayload; - } - } - /// Gets whether the "jspb_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJspbPayload { - get { return payloadCase_ == PayloadOneofCase.JspbPayload; } - } - /// Clears the value of the oneof if it's currently set to "jspb_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJspbPayload() { - if (HasJspbPayload) { - ClearPayload(); - } - } - - /// Field number for the "text_payload" field. - public const int TextPayloadFieldNumber = 8; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string TextPayload { - get { return HasTextPayload ? (string) payload_ : ""; } - set { - payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - payloadCase_ = PayloadOneofCase.TextPayload; - } - } - /// Gets whether the "text_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasTextPayload { - get { return payloadCase_ == PayloadOneofCase.TextPayload; } - } - /// Clears the value of the oneof if it's currently set to "text_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearTextPayload() { - if (HasTextPayload) { - ClearPayload(); - } - } - - /// Field number for the "requested_output_format" field. - public const int RequestedOutputFormatFieldNumber = 3; - private global::Conformance.WireFormat requestedOutputFormat_ = global::Conformance.WireFormat.Unspecified; - /// - /// Which format should the testee serialize its message to? - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Conformance.WireFormat RequestedOutputFormat { - get { return requestedOutputFormat_; } - set { - requestedOutputFormat_ = value; - } - } - - /// Field number for the "message_type" field. - public const int MessageTypeFieldNumber = 4; - private string messageType_ = ""; - /// - /// The full name for the test message to use; for the moment, either: - /// protobuf_test_messages.proto3.TestAllTypesProto3 or - /// protobuf_test_messages.google.protobuf.TestAllTypesProto2. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string MessageType { - get { return messageType_; } - set { - messageType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "test_category" field. - public const int TestCategoryFieldNumber = 5; - private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest; - /// - /// Each test is given a specific test category. Some category may need - /// specific support in testee programs. Refer to the definition of - /// TestCategory for more information. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Conformance.TestCategory TestCategory { - get { return testCategory_; } - set { - testCategory_ = value; - } - } - - /// Field number for the "jspb_encoding_options" field. - public const int JspbEncodingOptionsFieldNumber = 6; - private global::Conformance.JspbEncodingConfig jspbEncodingOptions_; - /// - /// Specify details for how to encode jspb. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Conformance.JspbEncodingConfig JspbEncodingOptions { - get { return jspbEncodingOptions_; } - set { - jspbEncodingOptions_ = value; - } - } - - /// Field number for the "print_unknown_fields" field. - public const int PrintUnknownFieldsFieldNumber = 9; - private bool printUnknownFields_; - /// - /// This can be used in json and text format. If true, testee should print - /// unknown fields instead of ignore. This feature is optional. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool PrintUnknownFields { - get { return printUnknownFields_; } - set { - printUnknownFields_ = value; - } - } - - private object payload_; - /// Enum of possible cases for the "payload" oneof. - public enum PayloadOneofCase { - None = 0, - ProtobufPayload = 1, - JsonPayload = 2, - JspbPayload = 7, - TextPayload = 8, - } - private PayloadOneofCase payloadCase_ = PayloadOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PayloadOneofCase PayloadCase { - get { return payloadCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPayload() { - payloadCase_ = PayloadOneofCase.None; - payload_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ConformanceRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ConformanceRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (ProtobufPayload != other.ProtobufPayload) return false; - if (JsonPayload != other.JsonPayload) return false; - if (JspbPayload != other.JspbPayload) return false; - if (TextPayload != other.TextPayload) return false; - if (RequestedOutputFormat != other.RequestedOutputFormat) return false; - if (MessageType != other.MessageType) return false; - if (TestCategory != other.TestCategory) return false; - if (!object.Equals(JspbEncodingOptions, other.JspbEncodingOptions)) return false; - if (PrintUnknownFields != other.PrintUnknownFields) return false; - if (PayloadCase != other.PayloadCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasProtobufPayload) hash ^= ProtobufPayload.GetHashCode(); - if (HasJsonPayload) hash ^= JsonPayload.GetHashCode(); - if (HasJspbPayload) hash ^= JspbPayload.GetHashCode(); - if (HasTextPayload) hash ^= TextPayload.GetHashCode(); - if (RequestedOutputFormat != global::Conformance.WireFormat.Unspecified) hash ^= RequestedOutputFormat.GetHashCode(); - if (MessageType.Length != 0) hash ^= MessageType.GetHashCode(); - if (TestCategory != global::Conformance.TestCategory.UnspecifiedTest) hash ^= TestCategory.GetHashCode(); - if (jspbEncodingOptions_ != null) hash ^= JspbEncodingOptions.GetHashCode(); - if (PrintUnknownFields != false) hash ^= PrintUnknownFields.GetHashCode(); - hash ^= (int) payloadCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasProtobufPayload) { - output.WriteRawTag(10); - output.WriteBytes(ProtobufPayload); - } - if (HasJsonPayload) { - output.WriteRawTag(18); - output.WriteString(JsonPayload); - } - if (RequestedOutputFormat != global::Conformance.WireFormat.Unspecified) { - output.WriteRawTag(24); - output.WriteEnum((int) RequestedOutputFormat); - } - if (MessageType.Length != 0) { - output.WriteRawTag(34); - output.WriteString(MessageType); - } - if (TestCategory != global::Conformance.TestCategory.UnspecifiedTest) { - output.WriteRawTag(40); - output.WriteEnum((int) TestCategory); - } - if (jspbEncodingOptions_ != null) { - output.WriteRawTag(50); - output.WriteMessage(JspbEncodingOptions); - } - if (HasJspbPayload) { - output.WriteRawTag(58); - output.WriteString(JspbPayload); - } - if (HasTextPayload) { - output.WriteRawTag(66); - output.WriteString(TextPayload); - } - if (PrintUnknownFields != false) { - output.WriteRawTag(72); - output.WriteBool(PrintUnknownFields); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasProtobufPayload) { - output.WriteRawTag(10); - output.WriteBytes(ProtobufPayload); - } - if (HasJsonPayload) { - output.WriteRawTag(18); - output.WriteString(JsonPayload); - } - if (RequestedOutputFormat != global::Conformance.WireFormat.Unspecified) { - output.WriteRawTag(24); - output.WriteEnum((int) RequestedOutputFormat); - } - if (MessageType.Length != 0) { - output.WriteRawTag(34); - output.WriteString(MessageType); - } - if (TestCategory != global::Conformance.TestCategory.UnspecifiedTest) { - output.WriteRawTag(40); - output.WriteEnum((int) TestCategory); - } - if (jspbEncodingOptions_ != null) { - output.WriteRawTag(50); - output.WriteMessage(JspbEncodingOptions); - } - if (HasJspbPayload) { - output.WriteRawTag(58); - output.WriteString(JspbPayload); - } - if (HasTextPayload) { - output.WriteRawTag(66); - output.WriteString(TextPayload); - } - if (PrintUnknownFields != false) { - output.WriteRawTag(72); - output.WriteBool(PrintUnknownFields); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasProtobufPayload) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload); - } - if (HasJsonPayload) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload); - } - if (HasJspbPayload) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JspbPayload); - } - if (HasTextPayload) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TextPayload); - } - if (RequestedOutputFormat != global::Conformance.WireFormat.Unspecified) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RequestedOutputFormat); - } - if (MessageType.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageType); - } - if (TestCategory != global::Conformance.TestCategory.UnspecifiedTest) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TestCategory); - } - if (jspbEncodingOptions_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(JspbEncodingOptions); - } - if (PrintUnknownFields != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ConformanceRequest other) { - if (other == null) { - return; - } - if (other.RequestedOutputFormat != global::Conformance.WireFormat.Unspecified) { - RequestedOutputFormat = other.RequestedOutputFormat; - } - if (other.MessageType.Length != 0) { - MessageType = other.MessageType; - } - if (other.TestCategory != global::Conformance.TestCategory.UnspecifiedTest) { - TestCategory = other.TestCategory; - } - if (other.jspbEncodingOptions_ != null) { - if (jspbEncodingOptions_ == null) { - JspbEncodingOptions = new global::Conformance.JspbEncodingConfig(); - } - JspbEncodingOptions.MergeFrom(other.JspbEncodingOptions); - } - if (other.PrintUnknownFields != false) { - PrintUnknownFields = other.PrintUnknownFields; - } - switch (other.PayloadCase) { - case PayloadOneofCase.ProtobufPayload: - ProtobufPayload = other.ProtobufPayload; - break; - case PayloadOneofCase.JsonPayload: - JsonPayload = other.JsonPayload; - break; - case PayloadOneofCase.JspbPayload: - JspbPayload = other.JspbPayload; - break; - case PayloadOneofCase.TextPayload: - TextPayload = other.TextPayload; - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - ProtobufPayload = input.ReadBytes(); - break; - } - case 18: { - JsonPayload = input.ReadString(); - break; - } - case 24: { - RequestedOutputFormat = (global::Conformance.WireFormat) input.ReadEnum(); - break; - } - case 34: { - MessageType = input.ReadString(); - break; - } - case 40: { - TestCategory = (global::Conformance.TestCategory) input.ReadEnum(); - break; - } - case 50: { - if (jspbEncodingOptions_ == null) { - JspbEncodingOptions = new global::Conformance.JspbEncodingConfig(); - } - input.ReadMessage(JspbEncodingOptions); - break; - } - case 58: { - JspbPayload = input.ReadString(); - break; - } - case 66: { - TextPayload = input.ReadString(); - break; - } - case 72: { - PrintUnknownFields = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - ProtobufPayload = input.ReadBytes(); - break; - } - case 18: { - JsonPayload = input.ReadString(); - break; - } - case 24: { - RequestedOutputFormat = (global::Conformance.WireFormat) input.ReadEnum(); - break; - } - case 34: { - MessageType = input.ReadString(); - break; - } - case 40: { - TestCategory = (global::Conformance.TestCategory) input.ReadEnum(); - break; - } - case 50: { - if (jspbEncodingOptions_ == null) { - JspbEncodingOptions = new global::Conformance.JspbEncodingConfig(); - } - input.ReadMessage(JspbEncodingOptions); - break; - } - case 58: { - JspbPayload = input.ReadString(); - break; - } - case 66: { - TextPayload = input.ReadString(); - break; - } - case 72: { - PrintUnknownFields = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// Represents a single test case's output. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ConformanceResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceResponse()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConformanceResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConformanceResponse(ConformanceResponse other) : this() { - switch (other.ResultCase) { - case ResultOneofCase.ParseError: - ParseError = other.ParseError; - break; - case ResultOneofCase.SerializeError: - SerializeError = other.SerializeError; - break; - case ResultOneofCase.TimeoutError: - TimeoutError = other.TimeoutError; - break; - case ResultOneofCase.RuntimeError: - RuntimeError = other.RuntimeError; - break; - case ResultOneofCase.ProtobufPayload: - ProtobufPayload = other.ProtobufPayload; - break; - case ResultOneofCase.JsonPayload: - JsonPayload = other.JsonPayload; - break; - case ResultOneofCase.Skipped: - Skipped = other.Skipped; - break; - case ResultOneofCase.JspbPayload: - JspbPayload = other.JspbPayload; - break; - case ResultOneofCase.TextPayload: - TextPayload = other.TextPayload; - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ConformanceResponse Clone() { - return new ConformanceResponse(this); - } - - /// Field number for the "parse_error" field. - public const int ParseErrorFieldNumber = 1; - /// - /// This string should be set to indicate parsing failed. The string can - /// provide more information about the parse error if it is available. - /// - /// Setting this string does not necessarily mean the testee failed the - /// test. Some of the test cases are intentionally invalid input. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ParseError { - get { return HasParseError ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.ParseError; - } - } - /// Gets whether the "parse_error" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasParseError { - get { return resultCase_ == ResultOneofCase.ParseError; } - } - /// Clears the value of the oneof if it's currently set to "parse_error" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearParseError() { - if (HasParseError) { - ClearResult(); - } - } - - /// Field number for the "serialize_error" field. - public const int SerializeErrorFieldNumber = 6; - /// - /// If the input was successfully parsed but errors occurred when - /// serializing it to the requested output format, set the error message in - /// this field. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string SerializeError { - get { return HasSerializeError ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.SerializeError; - } - } - /// Gets whether the "serialize_error" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSerializeError { - get { return resultCase_ == ResultOneofCase.SerializeError; } - } - /// Clears the value of the oneof if it's currently set to "serialize_error" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSerializeError() { - if (HasSerializeError) { - ClearResult(); - } - } - - /// Field number for the "timeout_error" field. - public const int TimeoutErrorFieldNumber = 9; - /// - /// This should be set if the test program timed out. The string should - /// provide more information about what the child process was doing when it - /// was killed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string TimeoutError { - get { return HasTimeoutError ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.TimeoutError; - } - } - /// Gets whether the "timeout_error" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasTimeoutError { - get { return resultCase_ == ResultOneofCase.TimeoutError; } - } - /// Clears the value of the oneof if it's currently set to "timeout_error" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearTimeoutError() { - if (HasTimeoutError) { - ClearResult(); - } - } - - /// Field number for the "runtime_error" field. - public const int RuntimeErrorFieldNumber = 2; - /// - /// This should be set if some other error occurred. This will always - /// indicate that the test failed. The string can provide more information - /// about the failure. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string RuntimeError { - get { return HasRuntimeError ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.RuntimeError; - } - } - /// Gets whether the "runtime_error" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRuntimeError { - get { return resultCase_ == ResultOneofCase.RuntimeError; } - } - /// Clears the value of the oneof if it's currently set to "runtime_error" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRuntimeError() { - if (HasRuntimeError) { - ClearResult(); - } - } - - /// Field number for the "protobuf_payload" field. - public const int ProtobufPayloadFieldNumber = 3; - /// - /// If the input was successfully parsed and the requested output was - /// protobuf, serialize it to protobuf and set it in this field. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString ProtobufPayload { - get { return HasProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.ProtobufPayload; - } - } - /// Gets whether the "protobuf_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasProtobufPayload { - get { return resultCase_ == ResultOneofCase.ProtobufPayload; } - } - /// Clears the value of the oneof if it's currently set to "protobuf_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearProtobufPayload() { - if (HasProtobufPayload) { - ClearResult(); - } - } - - /// Field number for the "json_payload" field. - public const int JsonPayloadFieldNumber = 4; - /// - /// If the input was successfully parsed and the requested output was JSON, - /// serialize to JSON and set it in this field. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JsonPayload { - get { return HasJsonPayload ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.JsonPayload; - } - } - /// Gets whether the "json_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJsonPayload { - get { return resultCase_ == ResultOneofCase.JsonPayload; } - } - /// Clears the value of the oneof if it's currently set to "json_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJsonPayload() { - if (HasJsonPayload) { - ClearResult(); - } - } - - /// Field number for the "skipped" field. - public const int SkippedFieldNumber = 5; - /// - /// For when the testee skipped the test, likely because a certain feature - /// wasn't supported, like JSON input/output. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Skipped { - get { return HasSkipped ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.Skipped; - } - } - /// Gets whether the "skipped" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSkipped { - get { return resultCase_ == ResultOneofCase.Skipped; } - } - /// Clears the value of the oneof if it's currently set to "skipped" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSkipped() { - if (HasSkipped) { - ClearResult(); - } - } - - /// Field number for the "jspb_payload" field. - public const int JspbPayloadFieldNumber = 7; - /// - /// If the input was successfully parsed and the requested output was JSPB, - /// serialize to JSPB and set it in this field. JSPB is only used inside - /// Google. Opensource testees can just skip it. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JspbPayload { - get { return HasJspbPayload ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.JspbPayload; - } - } - /// Gets whether the "jspb_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJspbPayload { - get { return resultCase_ == ResultOneofCase.JspbPayload; } - } - /// Clears the value of the oneof if it's currently set to "jspb_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJspbPayload() { - if (HasJspbPayload) { - ClearResult(); - } - } - - /// Field number for the "text_payload" field. - public const int TextPayloadFieldNumber = 8; - /// - /// If the input was successfully parsed and the requested output was - /// TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string TextPayload { - get { return HasTextPayload ? (string) result_ : ""; } - set { - result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - resultCase_ = ResultOneofCase.TextPayload; - } - } - /// Gets whether the "text_payload" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasTextPayload { - get { return resultCase_ == ResultOneofCase.TextPayload; } - } - /// Clears the value of the oneof if it's currently set to "text_payload" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearTextPayload() { - if (HasTextPayload) { - ClearResult(); - } - } - - private object result_; - /// Enum of possible cases for the "result" oneof. - public enum ResultOneofCase { - None = 0, - ParseError = 1, - SerializeError = 6, - TimeoutError = 9, - RuntimeError = 2, - ProtobufPayload = 3, - JsonPayload = 4, - Skipped = 5, - JspbPayload = 7, - TextPayload = 8, - } - private ResultOneofCase resultCase_ = ResultOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ResultOneofCase ResultCase { - get { return resultCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearResult() { - resultCase_ = ResultOneofCase.None; - result_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ConformanceResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ConformanceResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (ParseError != other.ParseError) return false; - if (SerializeError != other.SerializeError) return false; - if (TimeoutError != other.TimeoutError) return false; - if (RuntimeError != other.RuntimeError) return false; - if (ProtobufPayload != other.ProtobufPayload) return false; - if (JsonPayload != other.JsonPayload) return false; - if (Skipped != other.Skipped) return false; - if (JspbPayload != other.JspbPayload) return false; - if (TextPayload != other.TextPayload) return false; - if (ResultCase != other.ResultCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasParseError) hash ^= ParseError.GetHashCode(); - if (HasSerializeError) hash ^= SerializeError.GetHashCode(); - if (HasTimeoutError) hash ^= TimeoutError.GetHashCode(); - if (HasRuntimeError) hash ^= RuntimeError.GetHashCode(); - if (HasProtobufPayload) hash ^= ProtobufPayload.GetHashCode(); - if (HasJsonPayload) hash ^= JsonPayload.GetHashCode(); - if (HasSkipped) hash ^= Skipped.GetHashCode(); - if (HasJspbPayload) hash ^= JspbPayload.GetHashCode(); - if (HasTextPayload) hash ^= TextPayload.GetHashCode(); - hash ^= (int) resultCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasParseError) { - output.WriteRawTag(10); - output.WriteString(ParseError); - } - if (HasRuntimeError) { - output.WriteRawTag(18); - output.WriteString(RuntimeError); - } - if (HasProtobufPayload) { - output.WriteRawTag(26); - output.WriteBytes(ProtobufPayload); - } - if (HasJsonPayload) { - output.WriteRawTag(34); - output.WriteString(JsonPayload); - } - if (HasSkipped) { - output.WriteRawTag(42); - output.WriteString(Skipped); - } - if (HasSerializeError) { - output.WriteRawTag(50); - output.WriteString(SerializeError); - } - if (HasJspbPayload) { - output.WriteRawTag(58); - output.WriteString(JspbPayload); - } - if (HasTextPayload) { - output.WriteRawTag(66); - output.WriteString(TextPayload); - } - if (HasTimeoutError) { - output.WriteRawTag(74); - output.WriteString(TimeoutError); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasParseError) { - output.WriteRawTag(10); - output.WriteString(ParseError); - } - if (HasRuntimeError) { - output.WriteRawTag(18); - output.WriteString(RuntimeError); - } - if (HasProtobufPayload) { - output.WriteRawTag(26); - output.WriteBytes(ProtobufPayload); - } - if (HasJsonPayload) { - output.WriteRawTag(34); - output.WriteString(JsonPayload); - } - if (HasSkipped) { - output.WriteRawTag(42); - output.WriteString(Skipped); - } - if (HasSerializeError) { - output.WriteRawTag(50); - output.WriteString(SerializeError); - } - if (HasJspbPayload) { - output.WriteRawTag(58); - output.WriteString(JspbPayload); - } - if (HasTextPayload) { - output.WriteRawTag(66); - output.WriteString(TextPayload); - } - if (HasTimeoutError) { - output.WriteRawTag(74); - output.WriteString(TimeoutError); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasParseError) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ParseError); - } - if (HasSerializeError) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(SerializeError); - } - if (HasTimeoutError) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TimeoutError); - } - if (HasRuntimeError) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(RuntimeError); - } - if (HasProtobufPayload) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload); - } - if (HasJsonPayload) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload); - } - if (HasSkipped) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Skipped); - } - if (HasJspbPayload) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JspbPayload); - } - if (HasTextPayload) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TextPayload); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ConformanceResponse other) { - if (other == null) { - return; - } - switch (other.ResultCase) { - case ResultOneofCase.ParseError: - ParseError = other.ParseError; - break; - case ResultOneofCase.SerializeError: - SerializeError = other.SerializeError; - break; - case ResultOneofCase.TimeoutError: - TimeoutError = other.TimeoutError; - break; - case ResultOneofCase.RuntimeError: - RuntimeError = other.RuntimeError; - break; - case ResultOneofCase.ProtobufPayload: - ProtobufPayload = other.ProtobufPayload; - break; - case ResultOneofCase.JsonPayload: - JsonPayload = other.JsonPayload; - break; - case ResultOneofCase.Skipped: - Skipped = other.Skipped; - break; - case ResultOneofCase.JspbPayload: - JspbPayload = other.JspbPayload; - break; - case ResultOneofCase.TextPayload: - TextPayload = other.TextPayload; - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - ParseError = input.ReadString(); - break; - } - case 18: { - RuntimeError = input.ReadString(); - break; - } - case 26: { - ProtobufPayload = input.ReadBytes(); - break; - } - case 34: { - JsonPayload = input.ReadString(); - break; - } - case 42: { - Skipped = input.ReadString(); - break; - } - case 50: { - SerializeError = input.ReadString(); - break; - } - case 58: { - JspbPayload = input.ReadString(); - break; - } - case 66: { - TextPayload = input.ReadString(); - break; - } - case 74: { - TimeoutError = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - ParseError = input.ReadString(); - break; - } - case 18: { - RuntimeError = input.ReadString(); - break; - } - case 26: { - ProtobufPayload = input.ReadBytes(); - break; - } - case 34: { - JsonPayload = input.ReadString(); - break; - } - case 42: { - Skipped = input.ReadString(); - break; - } - case 50: { - SerializeError = input.ReadString(); - break; - } - case 58: { - JspbPayload = input.ReadString(); - break; - } - case 66: { - TextPayload = input.ReadString(); - break; - } - case 74: { - TimeoutError = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// Encoding options for jspb format. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class JspbEncodingConfig : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JspbEncodingConfig()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public JspbEncodingConfig() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public JspbEncodingConfig(JspbEncodingConfig other) : this() { - useJspbArrayAnyFormat_ = other.useJspbArrayAnyFormat_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public JspbEncodingConfig Clone() { - return new JspbEncodingConfig(this); - } - - /// Field number for the "use_jspb_array_any_format" field. - public const int UseJspbArrayAnyFormatFieldNumber = 1; - private bool useJspbArrayAnyFormat_; - /// - /// Encode the value field of Any as jspb array if true, otherwise binary. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool UseJspbArrayAnyFormat { - get { return useJspbArrayAnyFormat_; } - set { - useJspbArrayAnyFormat_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as JspbEncodingConfig); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(JspbEncodingConfig other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (UseJspbArrayAnyFormat != other.UseJspbArrayAnyFormat) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (UseJspbArrayAnyFormat != false) hash ^= UseJspbArrayAnyFormat.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (UseJspbArrayAnyFormat != false) { - output.WriteRawTag(8); - output.WriteBool(UseJspbArrayAnyFormat); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (UseJspbArrayAnyFormat != false) { - output.WriteRawTag(8); - output.WriteBool(UseJspbArrayAnyFormat); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (UseJspbArrayAnyFormat != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(JspbEncodingConfig other) { - if (other == null) { - return; - } - if (other.UseJspbArrayAnyFormat != false) { - UseJspbArrayAnyFormat = other.UseJspbArrayAnyFormat; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - UseJspbArrayAnyFormat = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - UseJspbArrayAnyFormat = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj b/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj index 3bcfb354266c889195288e772dc2395ce1091f45..ec8fb9138947cbe76a1b93764839e84b5057ee4f 100644 --- a/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj +++ b/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj @@ -1,7 +1,7 @@  - net6.0 + netcoreapp2.1 Exe False diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index 470cfb612cde91755d4609d536baab29f7fb66fa..d721ecfcb7afadcb502bcb4de5118a7a3ff94415 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Conformance; @@ -20,7 +43,7 @@ namespace Google.Protobuf.Conformance /// class Program { - private static void Main() + private static void Main(string[] args) { // This way we get the binary streams instead of readers/writers. var input = new BinaryReader(Console.OpenStandardInput()); @@ -77,22 +100,32 @@ namespace Google.Protobuf.Conformance return new ConformanceResponse { Skipped = "CSharp doesn't support skipping unknown fields in json parsing." }; } var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); - message = request.MessageType switch + switch (request.MessageType) { - "protobuf_test_messages.proto3.TestAllTypesProto3" => parser.Parse(request.JsonPayload), - "protobuf_test_messages.proto2.TestAllTypesProto2" => parser.Parse(request.JsonPayload), - _ => throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"), - }; + case "protobuf_test_messages.proto3.TestAllTypesProto3": + message = parser.Parse(request.JsonPayload); + break; + case "protobuf_test_messages.proto2.TestAllTypesProto2": + message = parser.Parse(request.JsonPayload); + break; + default: + throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"); + } break; case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - message = request.MessageType switch + switch (request.MessageType) { - "protobuf_test_messages.proto3.TestAllTypesProto3" => ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload), - "protobuf_test_messages.proto2.TestAllTypesProto2" => ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser - .WithExtensionRegistry(proto2ExtensionRegistry) - .ParseFrom(request.ProtobufPayload), - _ => throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"), - }; + case "protobuf_test_messages.proto3.TestAllTypesProto3": + message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); + break; + case "protobuf_test_messages.proto2.TestAllTypesProto2": + message = ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser + .WithExtensionRegistry(proto2ExtensionRegistry) + .ParseFrom(request.ProtobufPayload); + break; + default: + throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"); + } break; case ConformanceRequest.PayloadOneofCase.TextPayload: return new ConformanceResponse { Skipped = "CSharp doesn't support text format" }; diff --git a/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj b/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj index 475402b98fd787677705290be758c850d6c1bce5..fee35be9910d3dca60fd1a4dd62368471bd69290 100644 --- a/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj +++ b/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj @@ -1,7 +1,7 @@  - net6.0 + netcoreapp2.1 Exe False diff --git a/csharp/src/Google.Protobuf.JsonDump/Program.cs b/csharp/src/Google.Protobuf.JsonDump/Program.cs index 101eb72b818ec5855e6ec2f4592e76ba4696d42d..296b2f3f1ed5c6b5631d24671e3e24818ad59464 100644 --- a/csharp/src/Google.Protobuf.JsonDump/Program.cs +++ b/csharp/src/Google.Protobuf.JsonDump/Program.cs @@ -1,50 +1,73 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using System.Reflection; - -namespace Google.Protobuf.ProtoDump -{ - /// - /// Small utility to load a binary message and dump it in JSON format. - /// - internal class Program - { - private static int Main(string[] args) - { - if (args.Length != 2) - { - Console.Error.WriteLine("Usage: Google.Protobuf.JsonDump "); - Console.Error.WriteLine("The descriptor type name is the fully-qualified message name,"); - Console.Error.WriteLine("including assembly e.g. ProjectNamespace.Message,Company.Project"); - return 1; - } - Type type = Type.GetType(args[0]); - if (type == null) - { - Console.Error.WriteLine("Unable to load type {0}.", args[0]); - return 1; - } - if (!typeof(IMessage).GetTypeInfo().IsAssignableFrom(type)) - { - Console.Error.WriteLine("Type {0} doesn't implement IMessage.", args[0]); - return 1; - } - IMessage message = (IMessage) Activator.CreateInstance(type); - using (var input = File.OpenRead(args[1])) - { - message.MergeFrom(input); - } - Console.WriteLine(message); - return 0; - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; +using System.Reflection; + +namespace Google.Protobuf.ProtoDump +{ + /// + /// Small utility to load a binary message and dump it in JSON format. + /// + internal class Program + { + private static int Main(string[] args) + { + if (args.Length != 2) + { + Console.Error.WriteLine("Usage: Google.Protobuf.JsonDump "); + Console.Error.WriteLine("The descriptor type name is the fully-qualified message name,"); + Console.Error.WriteLine("including assembly e.g. ProjectNamespace.Message,Company.Project"); + return 1; + } + Type type = Type.GetType(args[0]); + if (type == null) + { + Console.Error.WriteLine("Unable to load type {0}.", args[0]); + return 1; + } + if (!typeof(IMessage).GetTypeInfo().IsAssignableFrom(type)) + { + Console.Error.WriteLine("Type {0} doesn't implement IMessage.", args[0]); + return 1; + } + IMessage message = (IMessage) Activator.CreateInstance(type); + using (var input = File.OpenRead(args[1])) + { + message.MergeFrom(input); + } + Console.WriteLine(message); + return 0; + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs b/csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs index 4832666abe1538ab0b94c8a276d6a76df542eb30..909bcea96e59a278dc4d421126c8cd47bfa2765d 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2016 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf.TestProtos diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj b/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj index 1d21193dd491732403009701d1ef869ea19aceef..1af85e0a54793586d8fe0bf3ec3c9bd42ba34c8d 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj +++ b/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj @@ -1,25 +1,26 @@ - - - - - net462;netstandard2.0 - 10.0 - ../../keys/Google.Protobuf.snk - true - False - - - - - - - - - - - - + + + + + net45;netstandard1.1;netstandard2.0 + 3.0 + ../../keys/Google.Protobuf.snk + true + true + False + + + + + + + + + + + + diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs similarity index 79% rename from csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs index 0e547d7ba712e8deb591ea7cfc9385acd01bdfe2..bbf0061f880b1ae9061b9b615f5eb3e12d6f9ad6 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/map_unittest_proto3.proto +// source: map_unittest_proto3.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { - /// Holder for reflection information generated from csharp/protos/map_unittest_proto3.proto + /// Holder for reflection information generated from map_unittest_proto3.proto public static partial class MapUnittestProto3Reflection { #region Descriptor - /// File descriptor for csharp/protos/map_unittest_proto3.proto + /// File descriptor for map_unittest_proto3.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,131 +24,130 @@ namespace Google.Protobuf.TestProtos { static MapUnittestProto3Reflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cidjc2hhcnAvcHJvdG9zL21hcF91bml0dGVzdF9wcm90bzMucHJvdG8SEnBy", - "b3RvYnVmX3VuaXR0ZXN0MxojY3NoYXJwL3Byb3Rvcy91bml0dGVzdF9wcm90", - "bzMucHJvdG8iqRIKB1Rlc3RNYXASRwoPbWFwX2ludDMyX2ludDMyGAEgAygL", - "Mi4ucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNYXAuTWFwSW50MzJJbnQzMkVu", - "dHJ5EkcKD21hcF9pbnQ2NF9pbnQ2NBgCIAMoCzIuLnByb3RvYnVmX3VuaXR0", - "ZXN0My5UZXN0TWFwLk1hcEludDY0SW50NjRFbnRyeRJLChFtYXBfdWludDMy", - "X3VpbnQzMhgDIAMoCzIwLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0TWFwLk1h", - "cFVpbnQzMlVpbnQzMkVudHJ5EksKEW1hcF91aW50NjRfdWludDY0GAQgAygL", - "MjAucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNYXAuTWFwVWludDY0VWludDY0", - "RW50cnkSSwoRbWFwX3NpbnQzMl9zaW50MzIYBSADKAsyMC5wcm90b2J1Zl91", - "bml0dGVzdDMuVGVzdE1hcC5NYXBTaW50MzJTaW50MzJFbnRyeRJLChFtYXBf", - "c2ludDY0X3NpbnQ2NBgGIAMoCzIwLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0", - "TWFwLk1hcFNpbnQ2NFNpbnQ2NEVudHJ5Ek8KE21hcF9maXhlZDMyX2ZpeGVk", - "MzIYByADKAsyMi5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE1hcC5NYXBGaXhl", - "ZDMyRml4ZWQzMkVudHJ5Ek8KE21hcF9maXhlZDY0X2ZpeGVkNjQYCCADKAsy", - "Mi5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE1hcC5NYXBGaXhlZDY0Rml4ZWQ2", - "NEVudHJ5ElMKFW1hcF9zZml4ZWQzMl9zZml4ZWQzMhgJIAMoCzI0LnByb3Rv", - "YnVmX3VuaXR0ZXN0My5UZXN0TWFwLk1hcFNmaXhlZDMyU2ZpeGVkMzJFbnRy", - "eRJTChVtYXBfc2ZpeGVkNjRfc2ZpeGVkNjQYCiADKAsyNC5wcm90b2J1Zl91", - "bml0dGVzdDMuVGVzdE1hcC5NYXBTZml4ZWQ2NFNmaXhlZDY0RW50cnkSRwoP", - "bWFwX2ludDMyX2Zsb2F0GAsgAygLMi4ucHJvdG9idWZfdW5pdHRlc3QzLlRl", - "c3RNYXAuTWFwSW50MzJGbG9hdEVudHJ5EkkKEG1hcF9pbnQzMl9kb3VibGUY", - "DCADKAsyLy5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE1hcC5NYXBJbnQzMkRv", - "dWJsZUVudHJ5EkMKDW1hcF9ib29sX2Jvb2wYDSADKAsyLC5wcm90b2J1Zl91", - "bml0dGVzdDMuVGVzdE1hcC5NYXBCb29sQm9vbEVudHJ5EksKEW1hcF9zdHJp", - "bmdfc3RyaW5nGA4gAygLMjAucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNYXAu", - "TWFwU3RyaW5nU3RyaW5nRW50cnkSRwoPbWFwX2ludDMyX2J5dGVzGA8gAygL", - "Mi4ucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNYXAuTWFwSW50MzJCeXRlc0Vu", - "dHJ5EkUKDm1hcF9pbnQzMl9lbnVtGBAgAygLMi0ucHJvdG9idWZfdW5pdHRl", - "c3QzLlRlc3RNYXAuTWFwSW50MzJFbnVtRW50cnkSWgoZbWFwX2ludDMyX2Zv", - "cmVpZ25fbWVzc2FnZRgRIAMoCzI3LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0", - "TWFwLk1hcEludDMyRm9yZWlnbk1lc3NhZ2VFbnRyeRo0ChJNYXBJbnQzMklu", - "dDMyRW50cnkSCwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgFOgI4ARo0ChJN", - "YXBJbnQ2NEludDY0RW50cnkSCwoDa2V5GAEgASgDEg0KBXZhbHVlGAIgASgD", - "OgI4ARo2ChRNYXBVaW50MzJVaW50MzJFbnRyeRILCgNrZXkYASABKA0SDQoF", - "dmFsdWUYAiABKA06AjgBGjYKFE1hcFVpbnQ2NFVpbnQ2NEVudHJ5EgsKA2tl", - "eRgBIAEoBBINCgV2YWx1ZRgCIAEoBDoCOAEaNgoUTWFwU2ludDMyU2ludDMy", - "RW50cnkSCwoDa2V5GAEgASgREg0KBXZhbHVlGAIgASgROgI4ARo2ChRNYXBT", - "aW50NjRTaW50NjRFbnRyeRILCgNrZXkYASABKBISDQoFdmFsdWUYAiABKBI6", - "AjgBGjgKFk1hcEZpeGVkMzJGaXhlZDMyRW50cnkSCwoDa2V5GAEgASgHEg0K", - "BXZhbHVlGAIgASgHOgI4ARo4ChZNYXBGaXhlZDY0Rml4ZWQ2NEVudHJ5EgsK", - "A2tleRgBIAEoBhINCgV2YWx1ZRgCIAEoBjoCOAEaOgoYTWFwU2ZpeGVkMzJT", - "Zml4ZWQzMkVudHJ5EgsKA2tleRgBIAEoDxINCgV2YWx1ZRgCIAEoDzoCOAEa", - "OgoYTWFwU2ZpeGVkNjRTZml4ZWQ2NEVudHJ5EgsKA2tleRgBIAEoEBINCgV2", - "YWx1ZRgCIAEoEDoCOAEaNAoSTWFwSW50MzJGbG9hdEVudHJ5EgsKA2tleRgB", - "IAEoBRINCgV2YWx1ZRgCIAEoAjoCOAEaNQoTTWFwSW50MzJEb3VibGVFbnRy", - "eRILCgNrZXkYASABKAUSDQoFdmFsdWUYAiABKAE6AjgBGjIKEE1hcEJvb2xC", - "b29sRW50cnkSCwoDa2V5GAEgASgIEg0KBXZhbHVlGAIgASgIOgI4ARo2ChRN", - "YXBTdHJpbmdTdHJpbmdFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiAB", - "KAk6AjgBGjQKEk1hcEludDMyQnl0ZXNFbnRyeRILCgNrZXkYASABKAUSDQoF", - "dmFsdWUYAiABKAw6AjgBGlAKEU1hcEludDMyRW51bUVudHJ5EgsKA2tleRgB", - "IAEoBRIqCgV2YWx1ZRgCIAEoDjIbLnByb3RvYnVmX3VuaXR0ZXN0My5NYXBF", - "bnVtOgI4ARphChtNYXBJbnQzMkZvcmVpZ25NZXNzYWdlRW50cnkSCwoDa2V5", - "GAEgASgFEjEKBXZhbHVlGAIgASgLMiIucHJvdG9idWZfdW5pdHRlc3QzLkZv", - "cmVpZ25NZXNzYWdlOgI4ASJCChFUZXN0TWFwU3VibWVzc2FnZRItCgh0ZXN0", - "X21hcBgBIAEoCzIbLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0TWFwIr4BCg5U", - "ZXN0TWVzc2FnZU1hcBJSChFtYXBfaW50MzJfbWVzc2FnZRgBIAMoCzI3LnBy", - "b3RvYnVmX3VuaXR0ZXN0My5UZXN0TWVzc2FnZU1hcC5NYXBJbnQzMk1lc3Nh", - "Z2VFbnRyeRpYChRNYXBJbnQzMk1lc3NhZ2VFbnRyeRILCgNrZXkYASABKAUS", - "LwoFdmFsdWUYAiABKAsyIC5wcm90b2J1Zl91bml0dGVzdDMuVGVzdEFsbFR5", - "cGVzOgI4ASLlAQoPVGVzdFNhbWVUeXBlTWFwEjsKBG1hcDEYASADKAsyLS5w", - "cm90b2J1Zl91bml0dGVzdDMuVGVzdFNhbWVUeXBlTWFwLk1hcDFFbnRyeRI7", - "CgRtYXAyGAIgAygLMi0ucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RTYW1lVHlw", - "ZU1hcC5NYXAyRW50cnkaKwoJTWFwMUVudHJ5EgsKA2tleRgBIAEoBRINCgV2", - "YWx1ZRgCIAEoBToCOAEaKwoJTWFwMkVudHJ5EgsKA2tleRgBIAEoBRINCgV2", - "YWx1ZRgCIAEoBToCOAEi9RAKDFRlc3RBcmVuYU1hcBJMCg9tYXBfaW50MzJf", - "aW50MzIYASADKAsyMy5wcm90b2J1Zl91bml0dGVzdDMuVGVzdEFyZW5hTWFw", - "Lk1hcEludDMySW50MzJFbnRyeRJMCg9tYXBfaW50NjRfaW50NjQYAiADKAsy", - "My5wcm90b2J1Zl91bml0dGVzdDMuVGVzdEFyZW5hTWFwLk1hcEludDY0SW50", - "NjRFbnRyeRJQChFtYXBfdWludDMyX3VpbnQzMhgDIAMoCzI1LnByb3RvYnVm", - "X3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwVWludDMyVWludDMyRW50cnkS", - "UAoRbWFwX3VpbnQ2NF91aW50NjQYBCADKAsyNS5wcm90b2J1Zl91bml0dGVz", - "dDMuVGVzdEFyZW5hTWFwLk1hcFVpbnQ2NFVpbnQ2NEVudHJ5ElAKEW1hcF9z", - "aW50MzJfc2ludDMyGAUgAygLMjUucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RB", - "cmVuYU1hcC5NYXBTaW50MzJTaW50MzJFbnRyeRJQChFtYXBfc2ludDY0X3Np", - "bnQ2NBgGIAMoCzI1LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAu", - "TWFwU2ludDY0U2ludDY0RW50cnkSVAoTbWFwX2ZpeGVkMzJfZml4ZWQzMhgH", - "IAMoCzI3LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwRml4", - "ZWQzMkZpeGVkMzJFbnRyeRJUChNtYXBfZml4ZWQ2NF9maXhlZDY0GAggAygL", - "MjcucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBcmVuYU1hcC5NYXBGaXhlZDY0", - "Rml4ZWQ2NEVudHJ5ElgKFW1hcF9zZml4ZWQzMl9zZml4ZWQzMhgJIAMoCzI5", - "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwU2ZpeGVkMzJT", - "Zml4ZWQzMkVudHJ5ElgKFW1hcF9zZml4ZWQ2NF9zZml4ZWQ2NBgKIAMoCzI5", - "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwU2ZpeGVkNjRT", - "Zml4ZWQ2NEVudHJ5EkwKD21hcF9pbnQzMl9mbG9hdBgLIAMoCzIzLnByb3Rv", - "YnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwSW50MzJGbG9hdEVudHJ5", - "Ek4KEG1hcF9pbnQzMl9kb3VibGUYDCADKAsyNC5wcm90b2J1Zl91bml0dGVz", - "dDMuVGVzdEFyZW5hTWFwLk1hcEludDMyRG91YmxlRW50cnkSSAoNbWFwX2Jv", - "b2xfYm9vbBgNIAMoCzIxLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFN", - "YXAuTWFwQm9vbEJvb2xFbnRyeRJKCg5tYXBfaW50MzJfZW51bRgOIAMoCzIy", - "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwSW50MzJFbnVt", - "RW50cnkSXwoZbWFwX2ludDMyX2ZvcmVpZ25fbWVzc2FnZRgPIAMoCzI8LnBy", - "b3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwSW50MzJGb3JlaWdu", - "TWVzc2FnZUVudHJ5GjQKEk1hcEludDMySW50MzJFbnRyeRILCgNrZXkYASAB", - "KAUSDQoFdmFsdWUYAiABKAU6AjgBGjQKEk1hcEludDY0SW50NjRFbnRyeRIL", - "CgNrZXkYASABKAMSDQoFdmFsdWUYAiABKAM6AjgBGjYKFE1hcFVpbnQzMlVp", - "bnQzMkVudHJ5EgsKA2tleRgBIAEoDRINCgV2YWx1ZRgCIAEoDToCOAEaNgoU", - "TWFwVWludDY0VWludDY0RW50cnkSCwoDa2V5GAEgASgEEg0KBXZhbHVlGAIg", - "ASgEOgI4ARo2ChRNYXBTaW50MzJTaW50MzJFbnRyeRILCgNrZXkYASABKBES", - "DQoFdmFsdWUYAiABKBE6AjgBGjYKFE1hcFNpbnQ2NFNpbnQ2NEVudHJ5EgsK", - "A2tleRgBIAEoEhINCgV2YWx1ZRgCIAEoEjoCOAEaOAoWTWFwRml4ZWQzMkZp", - "eGVkMzJFbnRyeRILCgNrZXkYASABKAcSDQoFdmFsdWUYAiABKAc6AjgBGjgK", - "Fk1hcEZpeGVkNjRGaXhlZDY0RW50cnkSCwoDa2V5GAEgASgGEg0KBXZhbHVl", - "GAIgASgGOgI4ARo6ChhNYXBTZml4ZWQzMlNmaXhlZDMyRW50cnkSCwoDa2V5", - "GAEgASgPEg0KBXZhbHVlGAIgASgPOgI4ARo6ChhNYXBTZml4ZWQ2NFNmaXhl", - "ZDY0RW50cnkSCwoDa2V5GAEgASgQEg0KBXZhbHVlGAIgASgQOgI4ARo0ChJN", - "YXBJbnQzMkZsb2F0RW50cnkSCwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgC", - "OgI4ARo1ChNNYXBJbnQzMkRvdWJsZUVudHJ5EgsKA2tleRgBIAEoBRINCgV2", - "YWx1ZRgCIAEoAToCOAEaMgoQTWFwQm9vbEJvb2xFbnRyeRILCgNrZXkYASAB", - "KAgSDQoFdmFsdWUYAiABKAg6AjgBGlAKEU1hcEludDMyRW51bUVudHJ5EgsK", - "A2tleRgBIAEoBRIqCgV2YWx1ZRgCIAEoDjIbLnByb3RvYnVmX3VuaXR0ZXN0", - "My5NYXBFbnVtOgI4ARphChtNYXBJbnQzMkZvcmVpZ25NZXNzYWdlRW50cnkS", - "CwoDa2V5GAEgASgFEjEKBXZhbHVlGAIgASgLMiIucHJvdG9idWZfdW5pdHRl", - "c3QzLkZvcmVpZ25NZXNzYWdlOgI4ASLmAQofTWVzc2FnZUNvbnRhaW5pbmdF", - "bnVtQ2FsbGVkVHlwZRJLCgR0eXBlGAEgAygLMj0ucHJvdG9idWZfdW5pdHRl", - "c3QzLk1lc3NhZ2VDb250YWluaW5nRW51bUNhbGxlZFR5cGUuVHlwZUVudHJ5", - "GmAKCVR5cGVFbnRyeRILCgNrZXkYASABKAUSQgoFdmFsdWUYAiABKAsyMy5w", - "cm90b2J1Zl91bml0dGVzdDMuTWVzc2FnZUNvbnRhaW5pbmdFbnVtQ2FsbGVk", - "VHlwZToCOAEiFAoEVHlwZRIMCghUWVBFX0ZPTxAAIp4BCh9NZXNzYWdlQ29u", - "dGFpbmluZ01hcENhbGxlZEVudHJ5Ek0KBWVudHJ5GAEgAygLMj4ucHJvdG9i", - "dWZfdW5pdHRlc3QzLk1lc3NhZ2VDb250YWluaW5nTWFwQ2FsbGVkRW50cnku", - "RW50cnlFbnRyeRosCgpFbnRyeUVudHJ5EgsKA2tleRgBIAEoBRINCgV2YWx1", - "ZRgCIAEoBToCOAEqPwoHTWFwRW51bRIQCgxNQVBfRU5VTV9GT08QABIQCgxN", - "QVBfRU5VTV9CQVIQARIQCgxNQVBfRU5VTV9CQVoQAkIdqgIaR29vZ2xlLlBy", - "b3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); + "ChltYXBfdW5pdHRlc3RfcHJvdG8zLnByb3RvEhJwcm90b2J1Zl91bml0dGVz", + "dDMaFXVuaXR0ZXN0X3Byb3RvMy5wcm90byKpEgoHVGVzdE1hcBJHCg9tYXBf", + "aW50MzJfaW50MzIYASADKAsyLi5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE1h", + "cC5NYXBJbnQzMkludDMyRW50cnkSRwoPbWFwX2ludDY0X2ludDY0GAIgAygL", + "Mi4ucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNYXAuTWFwSW50NjRJbnQ2NEVu", + "dHJ5EksKEW1hcF91aW50MzJfdWludDMyGAMgAygLMjAucHJvdG9idWZfdW5p", + "dHRlc3QzLlRlc3RNYXAuTWFwVWludDMyVWludDMyRW50cnkSSwoRbWFwX3Vp", + "bnQ2NF91aW50NjQYBCADKAsyMC5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE1h", + "cC5NYXBVaW50NjRVaW50NjRFbnRyeRJLChFtYXBfc2ludDMyX3NpbnQzMhgF", + "IAMoCzIwLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0TWFwLk1hcFNpbnQzMlNp", + "bnQzMkVudHJ5EksKEW1hcF9zaW50NjRfc2ludDY0GAYgAygLMjAucHJvdG9i", + "dWZfdW5pdHRlc3QzLlRlc3RNYXAuTWFwU2ludDY0U2ludDY0RW50cnkSTwoT", + "bWFwX2ZpeGVkMzJfZml4ZWQzMhgHIAMoCzIyLnByb3RvYnVmX3VuaXR0ZXN0", + "My5UZXN0TWFwLk1hcEZpeGVkMzJGaXhlZDMyRW50cnkSTwoTbWFwX2ZpeGVk", + "NjRfZml4ZWQ2NBgIIAMoCzIyLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0TWFw", + "Lk1hcEZpeGVkNjRGaXhlZDY0RW50cnkSUwoVbWFwX3NmaXhlZDMyX3NmaXhl", + "ZDMyGAkgAygLMjQucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNYXAuTWFwU2Zp", + "eGVkMzJTZml4ZWQzMkVudHJ5ElMKFW1hcF9zZml4ZWQ2NF9zZml4ZWQ2NBgK", + "IAMoCzI0LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0TWFwLk1hcFNmaXhlZDY0", + "U2ZpeGVkNjRFbnRyeRJHCg9tYXBfaW50MzJfZmxvYXQYCyADKAsyLi5wcm90", + "b2J1Zl91bml0dGVzdDMuVGVzdE1hcC5NYXBJbnQzMkZsb2F0RW50cnkSSQoQ", + "bWFwX2ludDMyX2RvdWJsZRgMIAMoCzIvLnByb3RvYnVmX3VuaXR0ZXN0My5U", + "ZXN0TWFwLk1hcEludDMyRG91YmxlRW50cnkSQwoNbWFwX2Jvb2xfYm9vbBgN", + "IAMoCzIsLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0TWFwLk1hcEJvb2xCb29s", + "RW50cnkSSwoRbWFwX3N0cmluZ19zdHJpbmcYDiADKAsyMC5wcm90b2J1Zl91", + "bml0dGVzdDMuVGVzdE1hcC5NYXBTdHJpbmdTdHJpbmdFbnRyeRJHCg9tYXBf", + "aW50MzJfYnl0ZXMYDyADKAsyLi5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE1h", + "cC5NYXBJbnQzMkJ5dGVzRW50cnkSRQoObWFwX2ludDMyX2VudW0YECADKAsy", + "LS5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE1hcC5NYXBJbnQzMkVudW1FbnRy", + "eRJaChltYXBfaW50MzJfZm9yZWlnbl9tZXNzYWdlGBEgAygLMjcucHJvdG9i", + "dWZfdW5pdHRlc3QzLlRlc3RNYXAuTWFwSW50MzJGb3JlaWduTWVzc2FnZUVu", + "dHJ5GjQKEk1hcEludDMySW50MzJFbnRyeRILCgNrZXkYASABKAUSDQoFdmFs", + "dWUYAiABKAU6AjgBGjQKEk1hcEludDY0SW50NjRFbnRyeRILCgNrZXkYASAB", + "KAMSDQoFdmFsdWUYAiABKAM6AjgBGjYKFE1hcFVpbnQzMlVpbnQzMkVudHJ5", + "EgsKA2tleRgBIAEoDRINCgV2YWx1ZRgCIAEoDToCOAEaNgoUTWFwVWludDY0", + "VWludDY0RW50cnkSCwoDa2V5GAEgASgEEg0KBXZhbHVlGAIgASgEOgI4ARo2", + "ChRNYXBTaW50MzJTaW50MzJFbnRyeRILCgNrZXkYASABKBESDQoFdmFsdWUY", + "AiABKBE6AjgBGjYKFE1hcFNpbnQ2NFNpbnQ2NEVudHJ5EgsKA2tleRgBIAEo", + "EhINCgV2YWx1ZRgCIAEoEjoCOAEaOAoWTWFwRml4ZWQzMkZpeGVkMzJFbnRy", + "eRILCgNrZXkYASABKAcSDQoFdmFsdWUYAiABKAc6AjgBGjgKFk1hcEZpeGVk", + "NjRGaXhlZDY0RW50cnkSCwoDa2V5GAEgASgGEg0KBXZhbHVlGAIgASgGOgI4", + "ARo6ChhNYXBTZml4ZWQzMlNmaXhlZDMyRW50cnkSCwoDa2V5GAEgASgPEg0K", + "BXZhbHVlGAIgASgPOgI4ARo6ChhNYXBTZml4ZWQ2NFNmaXhlZDY0RW50cnkS", + "CwoDa2V5GAEgASgQEg0KBXZhbHVlGAIgASgQOgI4ARo0ChJNYXBJbnQzMkZs", + "b2F0RW50cnkSCwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgCOgI4ARo1ChNN", + "YXBJbnQzMkRvdWJsZUVudHJ5EgsKA2tleRgBIAEoBRINCgV2YWx1ZRgCIAEo", + "AToCOAEaMgoQTWFwQm9vbEJvb2xFbnRyeRILCgNrZXkYASABKAgSDQoFdmFs", + "dWUYAiABKAg6AjgBGjYKFE1hcFN0cmluZ1N0cmluZ0VudHJ5EgsKA2tleRgB", + "IAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaNAoSTWFwSW50MzJCeXRlc0VudHJ5", + "EgsKA2tleRgBIAEoBRINCgV2YWx1ZRgCIAEoDDoCOAEaUAoRTWFwSW50MzJF", + "bnVtRW50cnkSCwoDa2V5GAEgASgFEioKBXZhbHVlGAIgASgOMhsucHJvdG9i", + "dWZfdW5pdHRlc3QzLk1hcEVudW06AjgBGmEKG01hcEludDMyRm9yZWlnbk1l", + "c3NhZ2VFbnRyeRILCgNrZXkYASABKAUSMQoFdmFsdWUYAiABKAsyIi5wcm90", + "b2J1Zl91bml0dGVzdDMuRm9yZWlnbk1lc3NhZ2U6AjgBIkIKEVRlc3RNYXBT", + "dWJtZXNzYWdlEi0KCHRlc3RfbWFwGAEgASgLMhsucHJvdG9idWZfdW5pdHRl", + "c3QzLlRlc3RNYXAivgEKDlRlc3RNZXNzYWdlTWFwElIKEW1hcF9pbnQzMl9t", + "ZXNzYWdlGAEgAygLMjcucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNZXNzYWdl", + "TWFwLk1hcEludDMyTWVzc2FnZUVudHJ5GlgKFE1hcEludDMyTWVzc2FnZUVu", + "dHJ5EgsKA2tleRgBIAEoBRIvCgV2YWx1ZRgCIAEoCzIgLnByb3RvYnVmX3Vu", + "aXR0ZXN0My5UZXN0QWxsVHlwZXM6AjgBIuUBCg9UZXN0U2FtZVR5cGVNYXAS", + "OwoEbWFwMRgBIAMoCzItLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0U2FtZVR5", + "cGVNYXAuTWFwMUVudHJ5EjsKBG1hcDIYAiADKAsyLS5wcm90b2J1Zl91bml0", + "dGVzdDMuVGVzdFNhbWVUeXBlTWFwLk1hcDJFbnRyeRorCglNYXAxRW50cnkS", + "CwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgFOgI4ARorCglNYXAyRW50cnkS", + "CwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgFOgI4ASL1EAoMVGVzdEFyZW5h", + "TWFwEkwKD21hcF9pbnQzMl9pbnQzMhgBIAMoCzIzLnByb3RvYnVmX3VuaXR0", + "ZXN0My5UZXN0QXJlbmFNYXAuTWFwSW50MzJJbnQzMkVudHJ5EkwKD21hcF9p", + "bnQ2NF9pbnQ2NBgCIAMoCzIzLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJl", + "bmFNYXAuTWFwSW50NjRJbnQ2NEVudHJ5ElAKEW1hcF91aW50MzJfdWludDMy", + "GAMgAygLMjUucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBcmVuYU1hcC5NYXBV", + "aW50MzJVaW50MzJFbnRyeRJQChFtYXBfdWludDY0X3VpbnQ2NBgEIAMoCzI1", + "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwVWludDY0VWlu", + "dDY0RW50cnkSUAoRbWFwX3NpbnQzMl9zaW50MzIYBSADKAsyNS5wcm90b2J1", + "Zl91bml0dGVzdDMuVGVzdEFyZW5hTWFwLk1hcFNpbnQzMlNpbnQzMkVudHJ5", + "ElAKEW1hcF9zaW50NjRfc2ludDY0GAYgAygLMjUucHJvdG9idWZfdW5pdHRl", + "c3QzLlRlc3RBcmVuYU1hcC5NYXBTaW50NjRTaW50NjRFbnRyeRJUChNtYXBf", + "Zml4ZWQzMl9maXhlZDMyGAcgAygLMjcucHJvdG9idWZfdW5pdHRlc3QzLlRl", + "c3RBcmVuYU1hcC5NYXBGaXhlZDMyRml4ZWQzMkVudHJ5ElQKE21hcF9maXhl", + "ZDY0X2ZpeGVkNjQYCCADKAsyNy5wcm90b2J1Zl91bml0dGVzdDMuVGVzdEFy", + "ZW5hTWFwLk1hcEZpeGVkNjRGaXhlZDY0RW50cnkSWAoVbWFwX3NmaXhlZDMy", + "X3NmaXhlZDMyGAkgAygLMjkucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBcmVu", + "YU1hcC5NYXBTZml4ZWQzMlNmaXhlZDMyRW50cnkSWAoVbWFwX3NmaXhlZDY0", + "X3NmaXhlZDY0GAogAygLMjkucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBcmVu", + "YU1hcC5NYXBTZml4ZWQ2NFNmaXhlZDY0RW50cnkSTAoPbWFwX2ludDMyX2Zs", + "b2F0GAsgAygLMjMucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBcmVuYU1hcC5N", + "YXBJbnQzMkZsb2F0RW50cnkSTgoQbWFwX2ludDMyX2RvdWJsZRgMIAMoCzI0", + "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QXJlbmFNYXAuTWFwSW50MzJEb3Vi", + "bGVFbnRyeRJICg1tYXBfYm9vbF9ib29sGA0gAygLMjEucHJvdG9idWZfdW5p", + "dHRlc3QzLlRlc3RBcmVuYU1hcC5NYXBCb29sQm9vbEVudHJ5EkoKDm1hcF9p", + "bnQzMl9lbnVtGA4gAygLMjIucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBcmVu", + "YU1hcC5NYXBJbnQzMkVudW1FbnRyeRJfChltYXBfaW50MzJfZm9yZWlnbl9t", + "ZXNzYWdlGA8gAygLMjwucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBcmVuYU1h", + "cC5NYXBJbnQzMkZvcmVpZ25NZXNzYWdlRW50cnkaNAoSTWFwSW50MzJJbnQz", + "MkVudHJ5EgsKA2tleRgBIAEoBRINCgV2YWx1ZRgCIAEoBToCOAEaNAoSTWFw", + "SW50NjRJbnQ2NEVudHJ5EgsKA2tleRgBIAEoAxINCgV2YWx1ZRgCIAEoAzoC", + "OAEaNgoUTWFwVWludDMyVWludDMyRW50cnkSCwoDa2V5GAEgASgNEg0KBXZh", + "bHVlGAIgASgNOgI4ARo2ChRNYXBVaW50NjRVaW50NjRFbnRyeRILCgNrZXkY", + "ASABKAQSDQoFdmFsdWUYAiABKAQ6AjgBGjYKFE1hcFNpbnQzMlNpbnQzMkVu", + "dHJ5EgsKA2tleRgBIAEoERINCgV2YWx1ZRgCIAEoEToCOAEaNgoUTWFwU2lu", + "dDY0U2ludDY0RW50cnkSCwoDa2V5GAEgASgSEg0KBXZhbHVlGAIgASgSOgI4", + "ARo4ChZNYXBGaXhlZDMyRml4ZWQzMkVudHJ5EgsKA2tleRgBIAEoBxINCgV2", + "YWx1ZRgCIAEoBzoCOAEaOAoWTWFwRml4ZWQ2NEZpeGVkNjRFbnRyeRILCgNr", + "ZXkYASABKAYSDQoFdmFsdWUYAiABKAY6AjgBGjoKGE1hcFNmaXhlZDMyU2Zp", + "eGVkMzJFbnRyeRILCgNrZXkYASABKA8SDQoFdmFsdWUYAiABKA86AjgBGjoK", + "GE1hcFNmaXhlZDY0U2ZpeGVkNjRFbnRyeRILCgNrZXkYASABKBASDQoFdmFs", + "dWUYAiABKBA6AjgBGjQKEk1hcEludDMyRmxvYXRFbnRyeRILCgNrZXkYASAB", + "KAUSDQoFdmFsdWUYAiABKAI6AjgBGjUKE01hcEludDMyRG91YmxlRW50cnkS", + "CwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgBOgI4ARoyChBNYXBCb29sQm9v", + "bEVudHJ5EgsKA2tleRgBIAEoCBINCgV2YWx1ZRgCIAEoCDoCOAEaUAoRTWFw", + "SW50MzJFbnVtRW50cnkSCwoDa2V5GAEgASgFEioKBXZhbHVlGAIgASgOMhsu", + "cHJvdG9idWZfdW5pdHRlc3QzLk1hcEVudW06AjgBGmEKG01hcEludDMyRm9y", + "ZWlnbk1lc3NhZ2VFbnRyeRILCgNrZXkYASABKAUSMQoFdmFsdWUYAiABKAsy", + "Ii5wcm90b2J1Zl91bml0dGVzdDMuRm9yZWlnbk1lc3NhZ2U6AjgBIuYBCh9N", + "ZXNzYWdlQ29udGFpbmluZ0VudW1DYWxsZWRUeXBlEksKBHR5cGUYASADKAsy", + "PS5wcm90b2J1Zl91bml0dGVzdDMuTWVzc2FnZUNvbnRhaW5pbmdFbnVtQ2Fs", + "bGVkVHlwZS5UeXBlRW50cnkaYAoJVHlwZUVudHJ5EgsKA2tleRgBIAEoBRJC", + "CgV2YWx1ZRgCIAEoCzIzLnByb3RvYnVmX3VuaXR0ZXN0My5NZXNzYWdlQ29u", + "dGFpbmluZ0VudW1DYWxsZWRUeXBlOgI4ASIUCgRUeXBlEgwKCFRZUEVfRk9P", + "EAAingEKH01lc3NhZ2VDb250YWluaW5nTWFwQ2FsbGVkRW50cnkSTQoFZW50", + "cnkYASADKAsyPi5wcm90b2J1Zl91bml0dGVzdDMuTWVzc2FnZUNvbnRhaW5p", + "bmdNYXBDYWxsZWRFbnRyeS5FbnRyeUVudHJ5GiwKCkVudHJ5RW50cnkSCwoD", + "a2V5GAEgASgFEg0KBXZhbHVlGAIgASgFOgI4ASo/CgdNYXBFbnVtEhAKDE1B", + "UF9FTlVNX0ZPTxAAEhAKDE1BUF9FTlVNX0JBUhABEhAKDE1BUF9FTlVNX0JB", + "WhACQh2qAhpHb29nbGUuUHJvdG9idWYuVGVzdFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.MapEnum), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -177,7 +176,6 @@ namespace Google.Protobuf.TestProtos { /// /// Tests maps. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMap : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -186,23 +184,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMap() { OnConstruction(); } @@ -210,7 +204,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMap(TestMap other) : this() { mapInt32Int32_ = other.mapInt32Int32_.Clone(); mapInt64Int64_ = other.mapInt64Int64_.Clone(); @@ -233,7 +226,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMap Clone() { return new TestMap(this); } @@ -244,7 +236,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField mapInt32Int32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -255,7 +246,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 18); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -266,7 +256,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 26); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -277,7 +266,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 34); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -288,7 +276,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 42); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -299,7 +286,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 50); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -310,7 +296,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 58); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -321,7 +306,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 66); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -332,7 +316,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 74); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -343,7 +326,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 82); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -354,7 +336,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 90); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -365,7 +346,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 98); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -376,7 +356,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 106); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -387,7 +366,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 114); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -398,7 +376,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForBytes(18, pb::ByteString.Empty), 122); private readonly pbc::MapField mapInt32Bytes_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Bytes { get { return mapInt32Bytes_; } } @@ -409,7 +386,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x, global::Google.Protobuf.TestProtos.MapEnum.Foo), 130); private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -420,19 +396,16 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 138); private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMap other) { if (ReferenceEquals(other, null)) { return false; @@ -461,7 +434,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= MapInt32Int32.GetHashCode(); @@ -488,13 +460,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -524,7 +494,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { mapInt32Int32_.WriteTo(ref output, _map_mapInt32Int32_codec); mapInt64Int64_.WriteTo(ref output, _map_mapInt64Int64_codec); @@ -550,7 +519,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); @@ -577,33 +545,31 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMap other) { if (other == null) { return; } - mapInt32Int32_.MergeFrom(other.mapInt32Int32_); - mapInt64Int64_.MergeFrom(other.mapInt64Int64_); - mapUint32Uint32_.MergeFrom(other.mapUint32Uint32_); - mapUint64Uint64_.MergeFrom(other.mapUint64Uint64_); - mapSint32Sint32_.MergeFrom(other.mapSint32Sint32_); - mapSint64Sint64_.MergeFrom(other.mapSint64Sint64_); - mapFixed32Fixed32_.MergeFrom(other.mapFixed32Fixed32_); - mapFixed64Fixed64_.MergeFrom(other.mapFixed64Fixed64_); - mapSfixed32Sfixed32_.MergeFrom(other.mapSfixed32Sfixed32_); - mapSfixed64Sfixed64_.MergeFrom(other.mapSfixed64Sfixed64_); - mapInt32Float_.MergeFrom(other.mapInt32Float_); - mapInt32Double_.MergeFrom(other.mapInt32Double_); - mapBoolBool_.MergeFrom(other.mapBoolBool_); - mapStringString_.MergeFrom(other.mapStringString_); - mapInt32Bytes_.MergeFrom(other.mapInt32Bytes_); - mapInt32Enum_.MergeFrom(other.mapInt32Enum_); - mapInt32ForeignMessage_.MergeFrom(other.mapInt32ForeignMessage_); + mapInt32Int32_.Add(other.mapInt32Int32_); + mapInt64Int64_.Add(other.mapInt64Int64_); + mapUint32Uint32_.Add(other.mapUint32Uint32_); + mapUint64Uint64_.Add(other.mapUint64Uint64_); + mapSint32Sint32_.Add(other.mapSint32Sint32_); + mapSint64Sint64_.Add(other.mapSint64Sint64_); + mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); + mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); + mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); + mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); + mapInt32Float_.Add(other.mapInt32Float_); + mapInt32Double_.Add(other.mapInt32Double_); + mapBoolBool_.Add(other.mapBoolBool_); + mapStringString_.Add(other.mapStringString_); + mapInt32Bytes_.Add(other.mapInt32Bytes_); + mapInt32Enum_.Add(other.mapInt32Enum_); + mapInt32ForeignMessage_.Add(other.mapInt32ForeignMessage_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -689,7 +655,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -772,7 +737,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMapSubmessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -781,23 +745,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMapSubmessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMapSubmessage() { OnConstruction(); } @@ -805,14 +765,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMapSubmessage(TestMapSubmessage other) : this() { testMap_ = other.testMap_ != null ? other.testMap_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMapSubmessage Clone() { return new TestMapSubmessage(this); } @@ -821,7 +779,6 @@ namespace Google.Protobuf.TestProtos { public const int TestMapFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMap testMap_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestMap TestMap { get { return testMap_; } set { @@ -830,13 +787,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMapSubmessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMapSubmessage other) { if (ReferenceEquals(other, null)) { return false; @@ -849,7 +804,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (testMap_ != null) hash ^= TestMap.GetHashCode(); @@ -860,13 +814,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -883,7 +835,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (testMap_ != null) { output.WriteRawTag(10); @@ -896,7 +847,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (testMap_ != null) { @@ -909,7 +859,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMapSubmessage other) { if (other == null) { return; @@ -924,7 +873,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -949,7 +897,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -971,7 +918,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMessageMap : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -980,23 +926,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageMap() { OnConstruction(); } @@ -1004,14 +946,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageMap(TestMessageMap other) : this() { mapInt32Message_ = other.mapInt32Message_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageMap Clone() { return new TestMessageMap(this); } @@ -1022,19 +962,16 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.TestAllTypes.Parser), 10); private readonly pbc::MapField mapInt32Message_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Message { get { return mapInt32Message_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMessageMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMessageMap other) { if (ReferenceEquals(other, null)) { return false; @@ -1047,7 +984,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= MapInt32Message.GetHashCode(); @@ -1058,13 +994,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1078,7 +1012,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { mapInt32Message_.WriteTo(ref output, _map_mapInt32Message_codec); if (_unknownFields != null) { @@ -1088,7 +1021,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += mapInt32Message_.CalculateSize(_map_mapInt32Message_codec); @@ -1099,17 +1031,15 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMessageMap other) { if (other == null) { return; } - mapInt32Message_.MergeFrom(other.mapInt32Message_); + mapInt32Message_.Add(other.mapInt32Message_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1131,7 +1061,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1153,7 +1082,6 @@ namespace Google.Protobuf.TestProtos { /// /// Two map fields share the same entry default instance. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestSameTypeMap : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1162,23 +1090,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestSameTypeMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestSameTypeMap() { OnConstruction(); } @@ -1186,7 +1110,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestSameTypeMap(TestSameTypeMap other) : this() { map1_ = other.map1_.Clone(); map2_ = other.map2_.Clone(); @@ -1194,7 +1117,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestSameTypeMap Clone() { return new TestSameTypeMap(this); } @@ -1205,7 +1127,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField map1_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Map1 { get { return map1_; } } @@ -1216,19 +1137,16 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 18); private readonly pbc::MapField map2_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Map2 { get { return map2_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestSameTypeMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestSameTypeMap other) { if (ReferenceEquals(other, null)) { return false; @@ -1242,7 +1160,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Map1.GetHashCode(); @@ -1254,13 +1171,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1275,7 +1190,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { map1_.WriteTo(ref output, _map_map1_codec); map2_.WriteTo(ref output, _map_map2_codec); @@ -1286,7 +1200,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += map1_.CalculateSize(_map_map1_codec); @@ -1298,18 +1211,16 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestSameTypeMap other) { if (other == null) { return; } - map1_.MergeFrom(other.map1_); - map2_.MergeFrom(other.map2_); + map1_.Add(other.map1_); + map2_.Add(other.map2_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1335,7 +1246,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1358,7 +1268,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestArenaMap : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1367,23 +1276,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestArenaMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestArenaMap() { OnConstruction(); } @@ -1391,7 +1296,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestArenaMap(TestArenaMap other) : this() { mapInt32Int32_ = other.mapInt32Int32_.Clone(); mapInt64Int64_ = other.mapInt64Int64_.Clone(); @@ -1412,7 +1316,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestArenaMap Clone() { return new TestArenaMap(this); } @@ -1423,7 +1326,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField mapInt32Int32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1434,7 +1336,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 18); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1445,7 +1346,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 26); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1456,7 +1356,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 34); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1467,7 +1366,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 42); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1478,7 +1376,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 50); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1489,7 +1386,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 58); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1500,7 +1396,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 66); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1511,7 +1406,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 74); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1522,7 +1416,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 82); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1533,7 +1426,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 90); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1544,7 +1436,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 98); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1555,7 +1446,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 106); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1566,7 +1456,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x, global::Google.Protobuf.TestProtos.MapEnum.Foo), 114); private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -1577,19 +1466,16 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 122); private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestArenaMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestArenaMap other) { if (ReferenceEquals(other, null)) { return false; @@ -1616,7 +1502,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= MapInt32Int32.GetHashCode(); @@ -1641,13 +1526,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1675,7 +1558,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { mapInt32Int32_.WriteTo(ref output, _map_mapInt32Int32_codec); mapInt64Int64_.WriteTo(ref output, _map_mapInt64Int64_codec); @@ -1699,7 +1581,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); @@ -1724,31 +1605,29 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestArenaMap other) { if (other == null) { return; } - mapInt32Int32_.MergeFrom(other.mapInt32Int32_); - mapInt64Int64_.MergeFrom(other.mapInt64Int64_); - mapUint32Uint32_.MergeFrom(other.mapUint32Uint32_); - mapUint64Uint64_.MergeFrom(other.mapUint64Uint64_); - mapSint32Sint32_.MergeFrom(other.mapSint32Sint32_); - mapSint64Sint64_.MergeFrom(other.mapSint64Sint64_); - mapFixed32Fixed32_.MergeFrom(other.mapFixed32Fixed32_); - mapFixed64Fixed64_.MergeFrom(other.mapFixed64Fixed64_); - mapSfixed32Sfixed32_.MergeFrom(other.mapSfixed32Sfixed32_); - mapSfixed64Sfixed64_.MergeFrom(other.mapSfixed64Sfixed64_); - mapInt32Float_.MergeFrom(other.mapInt32Float_); - mapInt32Double_.MergeFrom(other.mapInt32Double_); - mapBoolBool_.MergeFrom(other.mapBoolBool_); - mapInt32Enum_.MergeFrom(other.mapInt32Enum_); - mapInt32ForeignMessage_.MergeFrom(other.mapInt32ForeignMessage_); + mapInt32Int32_.Add(other.mapInt32Int32_); + mapInt64Int64_.Add(other.mapInt64Int64_); + mapUint32Uint32_.Add(other.mapUint32Uint32_); + mapUint64Uint64_.Add(other.mapUint64Uint64_); + mapSint32Sint32_.Add(other.mapSint32Sint32_); + mapSint64Sint64_.Add(other.mapSint64Sint64_); + mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); + mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); + mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); + mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); + mapInt32Float_.Add(other.mapInt32Float_); + mapInt32Double_.Add(other.mapInt32Double_); + mapBoolBool_.Add(other.mapBoolBool_); + mapInt32Enum_.Add(other.mapInt32Enum_); + mapInt32ForeignMessage_.Add(other.mapInt32ForeignMessage_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1826,7 +1705,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1905,7 +1783,6 @@ namespace Google.Protobuf.TestProtos { /// Previously, message containing enum called Type cannot be used as value of /// map field. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MessageContainingEnumCalledType : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1914,23 +1791,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingEnumCalledType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingEnumCalledType() { OnConstruction(); } @@ -1938,14 +1811,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingEnumCalledType(MessageContainingEnumCalledType other) : this() { type_ = other.type_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingEnumCalledType Clone() { return new MessageContainingEnumCalledType(this); } @@ -1956,19 +1827,16 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Parser), 10); private readonly pbc::MapField type_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Type { get { return type_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageContainingEnumCalledType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageContainingEnumCalledType other) { if (ReferenceEquals(other, null)) { return false; @@ -1981,7 +1849,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Type.GetHashCode(); @@ -1992,13 +1859,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2012,7 +1877,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { type_.WriteTo(ref output, _map_type_codec); if (_unknownFields != null) { @@ -2022,7 +1886,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += type_.CalculateSize(_map_type_codec); @@ -2033,17 +1896,15 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageContainingEnumCalledType other) { if (other == null) { return; } - type_.MergeFrom(other.type_); + type_.Add(other.type_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2065,7 +1926,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2085,7 +1945,6 @@ namespace Google.Protobuf.TestProtos { #region Nested types /// Container for nested types declared in the MessageContainingEnumCalledType message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum Type { [pbr::OriginalName("TYPE_FOO")] Foo = 0, @@ -2099,7 +1958,6 @@ namespace Google.Protobuf.TestProtos { /// /// Previously, message cannot contain map field called "entry". /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MessageContainingMapCalledEntry : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2108,23 +1966,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingMapCalledEntry()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingMapCalledEntry() { OnConstruction(); } @@ -2132,14 +1986,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingMapCalledEntry(MessageContainingMapCalledEntry other) : this() { entry_ = other.entry_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingMapCalledEntry Clone() { return new MessageContainingMapCalledEntry(this); } @@ -2150,19 +2002,16 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField entry_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Entry { get { return entry_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageContainingMapCalledEntry); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageContainingMapCalledEntry other) { if (ReferenceEquals(other, null)) { return false; @@ -2175,7 +2024,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Entry.GetHashCode(); @@ -2186,13 +2034,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2206,7 +2052,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { entry_.WriteTo(ref output, _map_entry_codec); if (_unknownFields != null) { @@ -2216,7 +2061,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += entry_.CalculateSize(_map_entry_codec); @@ -2227,17 +2071,15 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageContainingMapCalledEntry other) { if (other == null) { return; } - entry_.MergeFrom(other.entry_); + entry_.Add(other.entry_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2259,7 +2101,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs similarity index 52% rename from csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs index 7fa5475cde20f09bf1d70133ed165d321837227c..de1ece351afcaa1ad3f5c1e64d734180867f5b6f 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs @@ -2,7 +2,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/test_messages_proto2.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -25,7 +25,7 @@ namespace ProtobufTestMessages.Proto2 { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Cipnb29nbGUvcHJvdG9idWYvdGVzdF9tZXNzYWdlc19wcm90bzIucHJvdG8S", - "HXByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yIsQ+ChJUZXN0QWxsVHlw", + "HXByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yIv45ChJUZXN0QWxsVHlw", "ZXNQcm90bzISFgoOb3B0aW9uYWxfaW50MzIYASABKAUSFgoOb3B0aW9uYWxf", "aW50NjQYAiABKAMSFwoPb3B0aW9uYWxfdWludDMyGAMgASgNEhcKD29wdGlv", "bmFsX3VpbnQ2NBgEIAEoBBIXCg9vcHRpb25hbF9zaW50MzIYBSABKBESFwoP", @@ -135,167 +135,85 @@ namespace ProtobufTestMessages.Proto2 { "b25lb2ZfZG91YmxlGHYgASgBSAASUgoKb25lb2ZfZW51bRh3IAEoDjI8LnBy", "b3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yLlRlc3RBbGxUeXBlc1Byb3Rv", "Mi5OZXN0ZWRFbnVtSAASRQoEZGF0YRjJASABKAoyNi5wcm90b2J1Zl90ZXN0", - "X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsVHlwZXNQcm90bzIuRGF0YRIiCg1k", - "ZWZhdWx0X2ludDMyGPEBIAEoBToKLTEyMzQ1Njc4ORIsCg1kZWZhdWx0X2lu", - "dDY0GPIBIAEoAzoULTkxMjM0NTY3ODkxMjM0NTY3ODkSIwoOZGVmYXVsdF91", - "aW50MzIY8wEgASgNOgoyMTIzNDU2Nzg5Ei0KDmRlZmF1bHRfdWludDY0GPQB", - "IAEoBDoUMTAxMjM0NTY3ODkxMjM0NTY3ODkSIwoOZGVmYXVsdF9zaW50MzIY", - "9QEgASgROgotMTIzNDU2Nzg5Ei0KDmRlZmF1bHRfc2ludDY0GPYBIAEoEjoU", - "LTkxMjM0NTY3ODkxMjM0NTY3ODkSJAoPZGVmYXVsdF9maXhlZDMyGPcBIAEo", - "BzoKMjEyMzQ1Njc4ORIuCg9kZWZhdWx0X2ZpeGVkNjQY+AEgASgGOhQxMDEy", - "MzQ1Njc4OTEyMzQ1Njc4ORIlChBkZWZhdWx0X3NmaXhlZDMyGPkBIAEoDzoK", - "LTEyMzQ1Njc4ORIvChBkZWZhdWx0X3NmaXhlZDY0GPoBIAEoEDoULTkxMjM0", - "NTY3ODkxMjM0NTY3ODkSHQoNZGVmYXVsdF9mbG9hdBj7ASABKAI6BTllKzA5", - "Eh4KDmRlZmF1bHRfZG91YmxlGPwBIAEoAToFN2UrMjISGwoMZGVmYXVsdF9i", - "b29sGP0BIAEoCDoEdHJ1ZRIgCg5kZWZhdWx0X3N0cmluZxj+ASABKAk6B1Jv", - "c2VidWQSHgoNZGVmYXVsdF9ieXRlcxj/ASABKAw6Bmpvc2h1YRITCgpmaWVs", - "ZG5hbWUxGJEDIAEoBRIUCgtmaWVsZF9uYW1lMhiSAyABKAUSFQoMX2ZpZWxk", - "X25hbWUzGJMDIAEoBRIWCg1maWVsZF9fbmFtZTRfGJQDIAEoBRIUCgtmaWVs", - "ZDBuYW1lNRiVAyABKAUSFgoNZmllbGRfMF9uYW1lNhiWAyABKAUSEwoKZmll", - "bGROYW1lNxiXAyABKAUSEwoKRmllbGROYW1lOBiYAyABKAUSFAoLZmllbGRf", - "TmFtZTkYmQMgASgFEhUKDEZpZWxkX05hbWUxMBiaAyABKAUSFQoMRklFTERf", - "TkFNRTExGJsDIAEoBRIVCgxGSUVMRF9uYW1lMTIYnAMgASgFEhcKDl9fZmll", - "bGRfbmFtZTEzGJ0DIAEoBRIXCg5fX0ZpZWxkX25hbWUxNBieAyABKAUSFgoN", - "ZmllbGRfX25hbWUxNRifAyABKAUSFgoNZmllbGRfX05hbWUxNhigAyABKAUS", - "FwoOZmllbGRfbmFtZTE3X18YoQMgASgFEhcKDkZpZWxkX25hbWUxOF9fGKID", - "IAEoBRpiCg1OZXN0ZWRNZXNzYWdlEgkKAWEYASABKAUSRgoLY29yZWN1cnNp", - "dmUYAiABKAsyMS5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5UZXN0", - "QWxsVHlwZXNQcm90bzIaNAoSTWFwSW50MzJJbnQzMkVudHJ5EgsKA2tleRgB", - "IAEoBRINCgV2YWx1ZRgCIAEoBToCOAEaNAoSTWFwSW50NjRJbnQ2NEVudHJ5", - "EgsKA2tleRgBIAEoAxINCgV2YWx1ZRgCIAEoAzoCOAEaNgoUTWFwVWludDMy", - "VWludDMyRW50cnkSCwoDa2V5GAEgASgNEg0KBXZhbHVlGAIgASgNOgI4ARo2", - "ChRNYXBVaW50NjRVaW50NjRFbnRyeRILCgNrZXkYASABKAQSDQoFdmFsdWUY", - "AiABKAQ6AjgBGjYKFE1hcFNpbnQzMlNpbnQzMkVudHJ5EgsKA2tleRgBIAEo", - "ERINCgV2YWx1ZRgCIAEoEToCOAEaNgoUTWFwU2ludDY0U2ludDY0RW50cnkS", - "CwoDa2V5GAEgASgSEg0KBXZhbHVlGAIgASgSOgI4ARo4ChZNYXBGaXhlZDMy", - "Rml4ZWQzMkVudHJ5EgsKA2tleRgBIAEoBxINCgV2YWx1ZRgCIAEoBzoCOAEa", - "OAoWTWFwRml4ZWQ2NEZpeGVkNjRFbnRyeRILCgNrZXkYASABKAYSDQoFdmFs", - "dWUYAiABKAY6AjgBGjoKGE1hcFNmaXhlZDMyU2ZpeGVkMzJFbnRyeRILCgNr", - "ZXkYASABKA8SDQoFdmFsdWUYAiABKA86AjgBGjoKGE1hcFNmaXhlZDY0U2Zp", - "eGVkNjRFbnRyeRILCgNrZXkYASABKBASDQoFdmFsdWUYAiABKBA6AjgBGjQK", - "Ek1hcEludDMyRmxvYXRFbnRyeRILCgNrZXkYASABKAUSDQoFdmFsdWUYAiAB", - "KAI6AjgBGjUKE01hcEludDMyRG91YmxlRW50cnkSCwoDa2V5GAEgASgFEg0K", - "BXZhbHVlGAIgASgBOgI4ARoyChBNYXBCb29sQm9vbEVudHJ5EgsKA2tleRgB", - "IAEoCBINCgV2YWx1ZRgCIAEoCDoCOAEaNgoUTWFwU3RyaW5nU3RyaW5nRW50", - "cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ARo1ChNNYXBTdHJp", - "bmdCeXRlc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoDDoCOAEa", - "fgobTWFwU3RyaW5nTmVzdGVkTWVzc2FnZUVudHJ5EgsKA2tleRgBIAEoCRJO", - "CgV2YWx1ZRgCIAEoCzI/LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8y", - "LlRlc3RBbGxUeXBlc1Byb3RvMi5OZXN0ZWRNZXNzYWdlOgI4ARpzChxNYXBT", - "dHJpbmdGb3JlaWduTWVzc2FnZUVudHJ5EgsKA2tleRgBIAEoCRJCCgV2YWx1", - "ZRgCIAEoCzIzLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yLkZvcmVp", - "Z25NZXNzYWdlUHJvdG8yOgI4ARp4ChhNYXBTdHJpbmdOZXN0ZWRFbnVtRW50", - "cnkSCwoDa2V5GAEgASgJEksKBXZhbHVlGAIgASgOMjwucHJvdG9idWZfdGVz", - "dF9tZXNzYWdlcy5wcm90bzIuVGVzdEFsbFR5cGVzUHJvdG8yLk5lc3RlZEVu", - "dW06AjgBGm0KGU1hcFN0cmluZ0ZvcmVpZ25FbnVtRW50cnkSCwoDa2V5GAEg", - "ASgJEj8KBXZhbHVlGAIgASgOMjAucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5w", - "cm90bzIuRm9yZWlnbkVudW1Qcm90bzI6AjgBGjMKBERhdGESFAoLZ3JvdXBf", - "aW50MzIYygEgASgFEhUKDGdyb3VwX3VpbnQzMhjLASABKA0aIQoRTWVzc2Fn", - "ZVNldENvcnJlY3QqCAgEEP////8HOgIIARrgAQobTWVzc2FnZVNldENvcnJl", - "Y3RFeHRlbnNpb24xEgsKA3N0chgZIAEoCTKzAQoVbWVzc2FnZV9zZXRfZXh0", - "ZW5zaW9uEkMucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIuVGVzdEFs", - "bFR5cGVzUHJvdG8yLk1lc3NhZ2VTZXRDb3JyZWN0GPm7XiABKAsyTS5wcm90", - "b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsVHlwZXNQcm90bzIu", - "TWVzc2FnZVNldENvcnJlY3RFeHRlbnNpb24xGt8BChtNZXNzYWdlU2V0Q29y", - "cmVjdEV4dGVuc2lvbjISCQoBaRgJIAEoBTK0AQoVbWVzc2FnZV9zZXRfZXh0", - "ZW5zaW9uEkMucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIuVGVzdEFs", - "bFR5cGVzUHJvdG8yLk1lc3NhZ2VTZXRDb3JyZWN0GJCz/AEgASgLMk0ucHJv", - "dG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIuVGVzdEFsbFR5cGVzUHJvdG8y", - "Lk1lc3NhZ2VTZXRDb3JyZWN0RXh0ZW5zaW9uMiI5CgpOZXN0ZWRFbnVtEgcK", - "A0ZPTxAAEgcKA0JBUhABEgcKA0JBWhACEhAKA05FRxD///////////8BKgUI", - "eBDJAUINCgtvbmVvZl9maWVsZEoGCOgHEJBOIiEKFEZvcmVpZ25NZXNzYWdl", - "UHJvdG8yEgkKAWMYASABKAUiwQIKFVVua25vd25Ub1Rlc3RBbGxUeXBlcxIX", - "Cg5vcHRpb25hbF9pbnQzMhjpByABKAUSGAoPb3B0aW9uYWxfc3RyaW5nGOoH", - "IAEoCRJMCg5uZXN0ZWRfbWVzc2FnZRjrByABKAsyMy5wcm90b2J1Zl90ZXN0", - "X21lc3NhZ2VzLnByb3RvMi5Gb3JlaWduTWVzc2FnZVByb3RvMhJaCg1vcHRp", - "b25hbGdyb3VwGOwHIAEoCjJCLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJv", - "dG8yLlVua25vd25Ub1Rlc3RBbGxUeXBlcy5PcHRpb25hbEdyb3VwEhYKDW9w", - "dGlvbmFsX2Jvb2wY7gcgASgIEhcKDnJlcGVhdGVkX2ludDMyGPMHIAMoBRoa", - "Cg1PcHRpb25hbEdyb3VwEgkKAWEYASABKAUiFgoUTnVsbEh5cG90aGVzaXNQ", - "cm90bzIiLwoORW51bU9ubHlQcm90bzIiHQoEQm9vbBIKCgZrRmFsc2UQABIJ", - "CgVrVHJ1ZRABIh8KD09uZVN0cmluZ1Byb3RvMhIMCgRkYXRhGAEgASgJIkYK", - "EVByb3RvV2l0aEtleXdvcmRzEg4KBmlubGluZRgBIAEoBRIPCgdjb25jZXB0", - "GAIgASgJEhAKCHJlcXVpcmVzGAMgAygJIt4TChpUZXN0QWxsUmVxdWlyZWRU", - "eXBlc1Byb3RvMhIWCg5yZXF1aXJlZF9pbnQzMhgBIAIoBRIWCg5yZXF1aXJl", - "ZF9pbnQ2NBgCIAIoAxIXCg9yZXF1aXJlZF91aW50MzIYAyACKA0SFwoPcmVx", - "dWlyZWRfdWludDY0GAQgAigEEhcKD3JlcXVpcmVkX3NpbnQzMhgFIAIoERIX", - "Cg9yZXF1aXJlZF9zaW50NjQYBiACKBISGAoQcmVxdWlyZWRfZml4ZWQzMhgH", - "IAIoBxIYChByZXF1aXJlZF9maXhlZDY0GAggAigGEhkKEXJlcXVpcmVkX3Nm", - "aXhlZDMyGAkgAigPEhkKEXJlcXVpcmVkX3NmaXhlZDY0GAogAigQEhYKDnJl", - "cXVpcmVkX2Zsb2F0GAsgAigCEhcKD3JlcXVpcmVkX2RvdWJsZRgMIAIoARIV", - "Cg1yZXF1aXJlZF9ib29sGA0gAigIEhcKD3JlcXVpcmVkX3N0cmluZxgOIAIo", - "CRIWCg5yZXF1aXJlZF9ieXRlcxgPIAIoDBJoChdyZXF1aXJlZF9uZXN0ZWRf", - "bWVzc2FnZRgSIAIoCzJHLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8y", - "LlRlc3RBbGxSZXF1aXJlZFR5cGVzUHJvdG8yLk5lc3RlZE1lc3NhZ2USVQoY", - "cmVxdWlyZWRfZm9yZWlnbl9tZXNzYWdlGBMgAigLMjMucHJvdG9idWZfdGVz", - "dF9tZXNzYWdlcy5wcm90bzIuRm9yZWlnbk1lc3NhZ2VQcm90bzISYgoUcmVx", - "dWlyZWRfbmVzdGVkX2VudW0YFSACKA4yRC5wcm90b2J1Zl90ZXN0X21lc3Nh", - "Z2VzLnByb3RvMi5UZXN0QWxsUmVxdWlyZWRUeXBlc1Byb3RvMi5OZXN0ZWRF", - "bnVtEk8KFXJlcXVpcmVkX2ZvcmVpZ25fZW51bRgWIAIoDjIwLnByb3RvYnVm", - "X3Rlc3RfbWVzc2FnZXMucHJvdG8yLkZvcmVpZ25FbnVtUHJvdG8yEiEKFXJl", - "cXVpcmVkX3N0cmluZ19waWVjZRgYIAIoCUICCAISGQoNcmVxdWlyZWRfY29y", - "ZBgZIAIoCUICCAESVAoRcmVjdXJzaXZlX21lc3NhZ2UYGyACKAsyOS5wcm90", - "b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsUmVxdWlyZWRUeXBl", - "c1Byb3RvMhJdChpvcHRpb25hbF9yZWN1cnNpdmVfbWVzc2FnZRgcIAEoCzI5", - "LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yLlRlc3RBbGxSZXF1aXJl", - "ZFR5cGVzUHJvdG8yEk0KBGRhdGEYyQEgAigKMj4ucHJvdG9idWZfdGVzdF9t", - "ZXNzYWdlcy5wcm90bzIuVGVzdEFsbFJlcXVpcmVkVHlwZXNQcm90bzIuRGF0", - "YRIiCg1kZWZhdWx0X2ludDMyGPEBIAIoBToKLTEyMzQ1Njc4ORIsCg1kZWZh", - "dWx0X2ludDY0GPIBIAIoAzoULTkxMjM0NTY3ODkxMjM0NTY3ODkSIwoOZGVm", - "YXVsdF91aW50MzIY8wEgAigNOgoyMTIzNDU2Nzg5Ei0KDmRlZmF1bHRfdWlu", - "dDY0GPQBIAIoBDoUMTAxMjM0NTY3ODkxMjM0NTY3ODkSIwoOZGVmYXVsdF9z", - "aW50MzIY9QEgAigROgotMTIzNDU2Nzg5Ei0KDmRlZmF1bHRfc2ludDY0GPYB", - "IAIoEjoULTkxMjM0NTY3ODkxMjM0NTY3ODkSJAoPZGVmYXVsdF9maXhlZDMy", - "GPcBIAIoBzoKMjEyMzQ1Njc4ORIuCg9kZWZhdWx0X2ZpeGVkNjQY+AEgAigG", - "OhQxMDEyMzQ1Njc4OTEyMzQ1Njc4ORIlChBkZWZhdWx0X3NmaXhlZDMyGPkB", - "IAIoDzoKLTEyMzQ1Njc4ORIvChBkZWZhdWx0X3NmaXhlZDY0GPoBIAIoEDoU", - "LTkxMjM0NTY3ODkxMjM0NTY3ODkSHQoNZGVmYXVsdF9mbG9hdBj7ASACKAI6", - "BTllKzA5Eh4KDmRlZmF1bHRfZG91YmxlGPwBIAIoAToFN2UrMjISGwoMZGVm", - "YXVsdF9ib29sGP0BIAIoCDoEdHJ1ZRIgCg5kZWZhdWx0X3N0cmluZxj+ASAC", - "KAk6B1Jvc2VidWQSHgoNZGVmYXVsdF9ieXRlcxj/ASACKAw6Bmpvc2h1YRrD", - "AQoNTmVzdGVkTWVzc2FnZRIJCgFhGAEgAigFEk4KC2NvcmVjdXJzaXZlGAIg", - "AigLMjkucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIuVGVzdEFsbFJl", - "cXVpcmVkVHlwZXNQcm90bzISVwoUb3B0aW9uYWxfY29yZWN1cnNpdmUYAyAB", - "KAsyOS5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsUmVx", - "dWlyZWRUeXBlc1Byb3RvMhozCgREYXRhEhQKC2dyb3VwX2ludDMyGMoBIAIo", - "BRIVCgxncm91cF91aW50MzIYywEgAigNGiEKEU1lc3NhZ2VTZXRDb3JyZWN0", - "KggIBBD/////BzoCCAEa8AEKG01lc3NhZ2VTZXRDb3JyZWN0RXh0ZW5zaW9u", - "MRILCgNzdHIYGSACKAkywwEKFW1lc3NhZ2Vfc2V0X2V4dGVuc2lvbhJLLnBy", - "b3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yLlRlc3RBbGxSZXF1aXJlZFR5", - "cGVzUHJvdG8yLk1lc3NhZ2VTZXRDb3JyZWN0GPm7XiABKAsyVS5wcm90b2J1", - "Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsUmVxdWlyZWRUeXBlc1By", - "b3RvMi5NZXNzYWdlU2V0Q29ycmVjdEV4dGVuc2lvbjEa7wEKG01lc3NhZ2VT", - "ZXRDb3JyZWN0RXh0ZW5zaW9uMhIJCgFpGAkgAigFMsQBChVtZXNzYWdlX3Nl", - "dF9leHRlbnNpb24SSy5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5U", - "ZXN0QWxsUmVxdWlyZWRUeXBlc1Byb3RvMi5NZXNzYWdlU2V0Q29ycmVjdBiQ", - "s/wBIAEoCzJVLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yLlRlc3RB", - "bGxSZXF1aXJlZFR5cGVzUHJvdG8yLk1lc3NhZ2VTZXRDb3JyZWN0RXh0ZW5z", - "aW9uMiI5CgpOZXN0ZWRFbnVtEgcKA0ZPTxAAEgcKA0JBUhABEgcKA0JBWhAC", - "EhAKA05FRxD///////////8BKgUIeBDJAUoGCOgHEJBOKkYKEUZvcmVpZ25F", - "bnVtUHJvdG8yEg8KC0ZPUkVJR05fRk9PEAASDwoLRk9SRUlHTl9CQVIQARIP", - "CgtGT1JFSUdOX0JBWhACOkoKD2V4dGVuc2lvbl9pbnQzMhIxLnByb3RvYnVm", - "X3Rlc3RfbWVzc2FnZXMucHJvdG8yLlRlc3RBbGxUeXBlc1Byb3RvMhh4IAEo", - "BUI4Cihjb20uZ29vZ2xlLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8y", - "SAH4AQGiAgZQcm90bzI=")); + "X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsVHlwZXNQcm90bzIuRGF0YRITCgpm", + "aWVsZG5hbWUxGJEDIAEoBRIUCgtmaWVsZF9uYW1lMhiSAyABKAUSFQoMX2Zp", + "ZWxkX25hbWUzGJMDIAEoBRIWCg1maWVsZF9fbmFtZTRfGJQDIAEoBRIUCgtm", + "aWVsZDBuYW1lNRiVAyABKAUSFgoNZmllbGRfMF9uYW1lNhiWAyABKAUSEwoK", + "ZmllbGROYW1lNxiXAyABKAUSEwoKRmllbGROYW1lOBiYAyABKAUSFAoLZmll", + "bGRfTmFtZTkYmQMgASgFEhUKDEZpZWxkX05hbWUxMBiaAyABKAUSFQoMRklF", + "TERfTkFNRTExGJsDIAEoBRIVCgxGSUVMRF9uYW1lMTIYnAMgASgFEhcKDl9f", + "ZmllbGRfbmFtZTEzGJ0DIAEoBRIXCg5fX0ZpZWxkX25hbWUxNBieAyABKAUS", + "FgoNZmllbGRfX25hbWUxNRifAyABKAUSFgoNZmllbGRfX05hbWUxNhigAyAB", + "KAUSFwoOZmllbGRfbmFtZTE3X18YoQMgASgFEhcKDkZpZWxkX25hbWUxOF9f", + "GKIDIAEoBRpiCg1OZXN0ZWRNZXNzYWdlEgkKAWEYASABKAUSRgoLY29yZWN1", + "cnNpdmUYAiABKAsyMS5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5U", + "ZXN0QWxsVHlwZXNQcm90bzIaNAoSTWFwSW50MzJJbnQzMkVudHJ5EgsKA2tl", + "eRgBIAEoBRINCgV2YWx1ZRgCIAEoBToCOAEaNAoSTWFwSW50NjRJbnQ2NEVu", + "dHJ5EgsKA2tleRgBIAEoAxINCgV2YWx1ZRgCIAEoAzoCOAEaNgoUTWFwVWlu", + "dDMyVWludDMyRW50cnkSCwoDa2V5GAEgASgNEg0KBXZhbHVlGAIgASgNOgI4", + "ARo2ChRNYXBVaW50NjRVaW50NjRFbnRyeRILCgNrZXkYASABKAQSDQoFdmFs", + "dWUYAiABKAQ6AjgBGjYKFE1hcFNpbnQzMlNpbnQzMkVudHJ5EgsKA2tleRgB", + "IAEoERINCgV2YWx1ZRgCIAEoEToCOAEaNgoUTWFwU2ludDY0U2ludDY0RW50", + "cnkSCwoDa2V5GAEgASgSEg0KBXZhbHVlGAIgASgSOgI4ARo4ChZNYXBGaXhl", + "ZDMyRml4ZWQzMkVudHJ5EgsKA2tleRgBIAEoBxINCgV2YWx1ZRgCIAEoBzoC", + "OAEaOAoWTWFwRml4ZWQ2NEZpeGVkNjRFbnRyeRILCgNrZXkYASABKAYSDQoF", + "dmFsdWUYAiABKAY6AjgBGjoKGE1hcFNmaXhlZDMyU2ZpeGVkMzJFbnRyeRIL", + "CgNrZXkYASABKA8SDQoFdmFsdWUYAiABKA86AjgBGjoKGE1hcFNmaXhlZDY0", + "U2ZpeGVkNjRFbnRyeRILCgNrZXkYASABKBASDQoFdmFsdWUYAiABKBA6AjgB", + "GjQKEk1hcEludDMyRmxvYXRFbnRyeRILCgNrZXkYASABKAUSDQoFdmFsdWUY", + "AiABKAI6AjgBGjUKE01hcEludDMyRG91YmxlRW50cnkSCwoDa2V5GAEgASgF", + "Eg0KBXZhbHVlGAIgASgBOgI4ARoyChBNYXBCb29sQm9vbEVudHJ5EgsKA2tl", + "eRgBIAEoCBINCgV2YWx1ZRgCIAEoCDoCOAEaNgoUTWFwU3RyaW5nU3RyaW5n", + "RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ARo1ChNNYXBT", + "dHJpbmdCeXRlc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoDDoC", + "OAEafgobTWFwU3RyaW5nTmVzdGVkTWVzc2FnZUVudHJ5EgsKA2tleRgBIAEo", + "CRJOCgV2YWx1ZRgCIAEoCzI/LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJv", + "dG8yLlRlc3RBbGxUeXBlc1Byb3RvMi5OZXN0ZWRNZXNzYWdlOgI4ARpzChxN", + "YXBTdHJpbmdGb3JlaWduTWVzc2FnZUVudHJ5EgsKA2tleRgBIAEoCRJCCgV2", + "YWx1ZRgCIAEoCzIzLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yLkZv", + "cmVpZ25NZXNzYWdlUHJvdG8yOgI4ARp4ChhNYXBTdHJpbmdOZXN0ZWRFbnVt", + "RW50cnkSCwoDa2V5GAEgASgJEksKBXZhbHVlGAIgASgOMjwucHJvdG9idWZf", + "dGVzdF9tZXNzYWdlcy5wcm90bzIuVGVzdEFsbFR5cGVzUHJvdG8yLk5lc3Rl", + "ZEVudW06AjgBGm0KGU1hcFN0cmluZ0ZvcmVpZ25FbnVtRW50cnkSCwoDa2V5", + "GAEgASgJEj8KBXZhbHVlGAIgASgOMjAucHJvdG9idWZfdGVzdF9tZXNzYWdl", + "cy5wcm90bzIuRm9yZWlnbkVudW1Qcm90bzI6AjgBGjMKBERhdGESFAoLZ3Jv", + "dXBfaW50MzIYygEgASgFEhUKDGdyb3VwX3VpbnQzMhjLASABKA0aIQoRTWVz", + "c2FnZVNldENvcnJlY3QqCAgEEP////8HOgIIARrgAQobTWVzc2FnZVNldENv", + "cnJlY3RFeHRlbnNpb24xEgsKA3N0chgZIAEoCTKzAQoVbWVzc2FnZV9zZXRf", + "ZXh0ZW5zaW9uEkMucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIuVGVz", + "dEFsbFR5cGVzUHJvdG8yLk1lc3NhZ2VTZXRDb3JyZWN0GPm7XiABKAsyTS5w", + "cm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsVHlwZXNQcm90", + "bzIuTWVzc2FnZVNldENvcnJlY3RFeHRlbnNpb24xGt8BChtNZXNzYWdlU2V0", + "Q29ycmVjdEV4dGVuc2lvbjISCQoBaRgJIAEoBTK0AQoVbWVzc2FnZV9zZXRf", + "ZXh0ZW5zaW9uEkMucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIuVGVz", + "dEFsbFR5cGVzUHJvdG8yLk1lc3NhZ2VTZXRDb3JyZWN0GJCz/AEgASgLMk0u", + "cHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIuVGVzdEFsbFR5cGVzUHJv", + "dG8yLk1lc3NhZ2VTZXRDb3JyZWN0RXh0ZW5zaW9uMiI5CgpOZXN0ZWRFbnVt", + "EgcKA0ZPTxAAEgcKA0JBUhABEgcKA0JBWhACEhAKA05FRxD///////////8B", + "KgUIeBDJAUINCgtvbmVvZl9maWVsZEoGCOgHEJBOIiEKFEZvcmVpZ25NZXNz", + "YWdlUHJvdG8yEgkKAWMYASABKAUiwQIKFVVua25vd25Ub1Rlc3RBbGxUeXBl", + "cxIXCg5vcHRpb25hbF9pbnQzMhjpByABKAUSGAoPb3B0aW9uYWxfc3RyaW5n", + "GOoHIAEoCRJMCg5uZXN0ZWRfbWVzc2FnZRjrByABKAsyMy5wcm90b2J1Zl90", + "ZXN0X21lc3NhZ2VzLnByb3RvMi5Gb3JlaWduTWVzc2FnZVByb3RvMhJaCg1v", + "cHRpb25hbGdyb3VwGOwHIAEoCjJCLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMu", + "cHJvdG8yLlVua25vd25Ub1Rlc3RBbGxUeXBlcy5PcHRpb25hbEdyb3VwEhYK", + "DW9wdGlvbmFsX2Jvb2wY7gcgASgIEhcKDnJlcGVhdGVkX2ludDMyGPMHIAMo", + "BRoaCg1PcHRpb25hbEdyb3VwEgkKAWEYASABKAUqRgoRRm9yZWlnbkVudW1Q", + "cm90bzISDwoLRk9SRUlHTl9GT08QABIPCgtGT1JFSUdOX0JBUhABEg8KC0ZP", + "UkVJR05fQkFaEAI6SgoPZXh0ZW5zaW9uX2ludDMyEjEucHJvdG9idWZfdGVz", + "dF9tZXNzYWdlcy5wcm90bzIuVGVzdEFsbFR5cGVzUHJvdG8yGHggASgFQi8K", + "KGNvbS5nb29nbGUucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzJIAfgB", + "AQ==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ProtobufTestMessages.Proto2.ForeignEnumProto2), }, new pb::Extension[] { TestMessagesProto2Extensions.ExtensionInt32 }, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedNestedEnum", "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedNestedEnum", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "Data", "DefaultInt32", "DefaultInt64", "DefaultUint32", "DefaultUint64", "DefaultSint32", "DefaultSint64", "DefaultFixed32", "DefaultFixed64", "DefaultSfixed32", "DefaultSfixed64", "DefaultFloat", "DefaultDouble", "DefaultBool", "DefaultString", "DefaultBytes", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedNestedEnum", "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedNestedEnum", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "Data", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null, null), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data.Parser, new[]{ "GroupInt32", "GroupUint32" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrect), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrect.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Parser, new[]{ "Str" }, null, null, new pb::Extension[] { global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension }, null), new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Parser, new[]{ "I" }, null, null, new pb::Extension[] { global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension }, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.ForeignMessageProto2), global::ProtobufTestMessages.Proto2.ForeignMessageProto2.Parser, new[]{ "C" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes), global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Parser, new[]{ "OptionalInt32", "OptionalString", "NestedMessage", "OptionalGroup", "OptionalBool", "RepeatedInt32" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup), global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup.Parser, new[]{ "A" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.NullHypothesisProto2), global::ProtobufTestMessages.Proto2.NullHypothesisProto2.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.EnumOnlyProto2), global::ProtobufTestMessages.Proto2.EnumOnlyProto2.Parser, null, null, new[]{ typeof(global::ProtobufTestMessages.Proto2.EnumOnlyProto2.Types.Bool) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.OneStringProto2), global::ProtobufTestMessages.Proto2.OneStringProto2.Parser, new[]{ "Data" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.ProtoWithKeywords), global::ProtobufTestMessages.Proto2.ProtoWithKeywords.Parser, new[]{ "Inline", "Concept", "Requires" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2), global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Parser, new[]{ "RequiredInt32", "RequiredInt64", "RequiredUint32", "RequiredUint64", "RequiredSint32", "RequiredSint64", "RequiredFixed32", "RequiredFixed64", "RequiredSfixed32", "RequiredSfixed64", "RequiredFloat", "RequiredDouble", "RequiredBool", "RequiredString", "RequiredBytes", "RequiredNestedMessage", "RequiredForeignMessage", "RequiredNestedEnum", "RequiredForeignEnum", "RequiredStringPiece", "RequiredCord", "RecursiveMessage", "OptionalRecursiveMessage", "Data", "DefaultInt32", "DefaultInt64", "DefaultUint32", "DefaultUint64", "DefaultSint32", "DefaultSint64", "DefaultFixed32", "DefaultFixed64", "DefaultSfixed32", "DefaultSfixed64", "DefaultFloat", "DefaultDouble", "DefaultBool", "DefaultString", "DefaultBytes" }, null, new[]{ typeof(global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedMessage), global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedMessage.Parser, new[]{ "A", "Corecursive", "OptionalCorecursive" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.Data), global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.Data.Parser, new[]{ "GroupInt32", "GroupUint32" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrect), global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrect.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension1), global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension1.Parser, new[]{ "Str" }, null, null, new pb::Extension[] { global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension }, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension2), global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension2.Parser, new[]{ "I" }, null, null, new pb::Extension[] { global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension }, null)}) + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes), global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Parser, new[]{ "OptionalInt32", "OptionalString", "NestedMessage", "OptionalGroup", "OptionalBool", "RepeatedInt32" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup), global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup.Parser, new[]{ "A" }, null, null, null, null)}) })); } #endregion @@ -326,7 +244,6 @@ namespace ProtobufTestMessages.Proto2 { /// could trigger bugs that occur in any message type in this file. We verify /// this stays true in a unit test. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -339,23 +256,19 @@ namespace ProtobufTestMessages.Proto2 { private int _hasBits0; private int _hasBits1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto2() { OnConstruction(); } @@ -363,7 +276,6 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto2(TestAllTypesProto2 other) : this() { _hasBits0 = other._hasBits0; _hasBits1 = other._hasBits1; @@ -458,21 +370,6 @@ namespace ProtobufTestMessages.Proto2 { mapStringNestedEnum_ = other.mapStringNestedEnum_.Clone(); mapStringForeignEnum_ = other.mapStringForeignEnum_.Clone(); data_ = other.HasData ? other.data_.Clone() : null; - defaultInt32_ = other.defaultInt32_; - defaultInt64_ = other.defaultInt64_; - defaultUint32_ = other.defaultUint32_; - defaultUint64_ = other.defaultUint64_; - defaultSint32_ = other.defaultSint32_; - defaultSint64_ = other.defaultSint64_; - defaultFixed32_ = other.defaultFixed32_; - defaultFixed64_ = other.defaultFixed64_; - defaultSfixed32_ = other.defaultSfixed32_; - defaultSfixed64_ = other.defaultSfixed64_; - defaultFloat_ = other.defaultFloat_; - defaultDouble_ = other.defaultDouble_; - defaultBool_ = other.defaultBool_; - defaultString_ = other.defaultString_; - defaultBytes_ = other.defaultBytes_; fieldname1_ = other.fieldname1_; fieldName2_ = other.fieldName2_; FieldName3_ = other.FieldName3_; @@ -526,7 +423,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto2 Clone() { return new TestAllTypesProto2(this); } @@ -540,7 +436,6 @@ namespace ProtobufTestMessages.Proto2 { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -550,13 +445,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -567,7 +460,6 @@ namespace ProtobufTestMessages.Proto2 { private long optionalInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalInt64 { get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return OptionalInt64DefaultValue; } } set { @@ -577,13 +469,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt64 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "optional_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt64() { _hasBits0 &= ~2; } @@ -594,7 +484,6 @@ namespace ProtobufTestMessages.Proto2 { private uint optionalUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalUint32 { get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return OptionalUint32DefaultValue; } } set { @@ -604,13 +493,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint32 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "optional_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint32() { _hasBits0 &= ~4; } @@ -621,7 +508,6 @@ namespace ProtobufTestMessages.Proto2 { private ulong optionalUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalUint64 { get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return OptionalUint64DefaultValue; } } set { @@ -631,13 +517,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint64 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "optional_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint64() { _hasBits0 &= ~8; } @@ -648,7 +532,6 @@ namespace ProtobufTestMessages.Proto2 { private int optionalSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSint32 { get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return OptionalSint32DefaultValue; } } set { @@ -658,13 +541,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint32 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "optional_sint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint32() { _hasBits0 &= ~16; } @@ -675,7 +556,6 @@ namespace ProtobufTestMessages.Proto2 { private long optionalSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSint64 { get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return OptionalSint64DefaultValue; } } set { @@ -685,13 +565,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint64 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "optional_sint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint64() { _hasBits0 &= ~32; } @@ -702,7 +580,6 @@ namespace ProtobufTestMessages.Proto2 { private uint optionalFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalFixed32 { get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return OptionalFixed32DefaultValue; } } set { @@ -712,13 +589,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_fixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed32 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "optional_fixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed32() { _hasBits0 &= ~64; } @@ -729,7 +604,6 @@ namespace ProtobufTestMessages.Proto2 { private ulong optionalFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalFixed64 { get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return OptionalFixed64DefaultValue; } } set { @@ -739,13 +613,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_fixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed64 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "optional_fixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed64() { _hasBits0 &= ~128; } @@ -756,7 +628,6 @@ namespace ProtobufTestMessages.Proto2 { private int optionalSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSfixed32 { get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return OptionalSfixed32DefaultValue; } } set { @@ -766,13 +637,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sfixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed32 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "optional_sfixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed32() { _hasBits0 &= ~256; } @@ -783,7 +652,6 @@ namespace ProtobufTestMessages.Proto2 { private long optionalSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSfixed64 { get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return OptionalSfixed64DefaultValue; } } set { @@ -793,13 +661,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sfixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed64 { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "optional_sfixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed64() { _hasBits0 &= ~512; } @@ -810,7 +676,6 @@ namespace ProtobufTestMessages.Proto2 { private float optionalFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OptionalFloat { get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return OptionalFloatDefaultValue; } } set { @@ -820,13 +685,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFloat { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "optional_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFloat() { _hasBits0 &= ~1024; } @@ -837,7 +700,6 @@ namespace ProtobufTestMessages.Proto2 { private double optionalDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OptionalDouble { get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return OptionalDoubleDefaultValue; } } set { @@ -847,13 +709,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalDouble { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "optional_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalDouble() { _hasBits0 &= ~2048; } @@ -864,7 +724,6 @@ namespace ProtobufTestMessages.Proto2 { private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } } set { @@ -874,13 +733,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBool { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "optional_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBool() { _hasBits0 &= ~4096; } @@ -891,7 +748,6 @@ namespace ProtobufTestMessages.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -900,13 +756,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -917,7 +771,6 @@ namespace ProtobufTestMessages.Proto2 { private pb::ByteString optionalBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_ ?? OptionalBytesDefaultValue; } set { @@ -926,13 +779,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBytes { get { return optionalBytes_ != null; } } /// Clears the value of the "optional_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBytes() { optionalBytes_ = null; } @@ -941,7 +792,6 @@ namespace ProtobufTestMessages.Proto2 { public const int OptionalNestedMessageFieldNumber = 18; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -953,7 +803,6 @@ namespace ProtobufTestMessages.Proto2 { public const int OptionalForeignMessageFieldNumber = 19; private global::ProtobufTestMessages.Proto2.ForeignMessageProto2 optionalForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.ForeignMessageProto2 OptionalForeignMessage { get { return optionalForeignMessage_; } set { @@ -967,7 +816,6 @@ namespace ProtobufTestMessages.Proto2 { private global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum optionalNestedEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum OptionalNestedEnum { get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return OptionalNestedEnumDefaultValue; } } set { @@ -977,13 +825,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_nested_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalNestedEnum { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "optional_nested_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalNestedEnum() { _hasBits0 &= ~8192; } @@ -994,7 +840,6 @@ namespace ProtobufTestMessages.Proto2 { private global::ProtobufTestMessages.Proto2.ForeignEnumProto2 optionalForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.ForeignEnumProto2 OptionalForeignEnum { get { if ((_hasBits0 & 16384) != 0) { return optionalForeignEnum_; } else { return OptionalForeignEnumDefaultValue; } } set { @@ -1004,13 +849,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalForeignEnum { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "optional_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalForeignEnum() { _hasBits0 &= ~16384; } @@ -1021,7 +864,6 @@ namespace ProtobufTestMessages.Proto2 { private string optionalStringPiece_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringPiece { get { return optionalStringPiece_ ?? OptionalStringPieceDefaultValue; } set { @@ -1030,13 +872,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalStringPiece { get { return optionalStringPiece_ != null; } } /// Clears the value of the "optional_string_piece" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalStringPiece() { optionalStringPiece_ = null; } @@ -1047,7 +887,6 @@ namespace ProtobufTestMessages.Proto2 { private string optionalCord_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalCord { get { return optionalCord_ ?? OptionalCordDefaultValue; } set { @@ -1056,13 +895,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalCord { get { return optionalCord_ != null; } } /// Clears the value of the "optional_cord" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalCord() { optionalCord_ = null; } @@ -1071,7 +908,6 @@ namespace ProtobufTestMessages.Proto2 { public const int RecursiveMessageFieldNumber = 27; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2 recursiveMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2 RecursiveMessage { get { return recursiveMessage_; } set { @@ -1088,7 +924,6 @@ namespace ProtobufTestMessages.Proto2 { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -1099,7 +934,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt64(256); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -1110,7 +944,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt32(264); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -1121,7 +954,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt64(272); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -1132,7 +964,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt32(280); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -1143,7 +974,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt64(288); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -1154,7 +984,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed32(301); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -1165,7 +994,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed64(305); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -1176,7 +1004,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed32(317); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -1187,7 +1014,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed64(321); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -1198,7 +1024,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFloat(333); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -1209,7 +1034,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForDouble(337); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -1220,7 +1044,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBool(344); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -1231,7 +1054,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -1242,7 +1064,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -1253,7 +1074,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForMessage(386, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -1264,7 +1084,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForMessage(394, global::ProtobufTestMessages.Proto2.ForeignMessageProto2.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -1275,7 +1094,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(408, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -1286,7 +1104,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(416, x => (int) x, x => (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -1297,7 +1114,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForString(434); private readonly pbc::RepeatedField repeatedStringPiece_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPiece { get { return repeatedStringPiece_; } } @@ -1308,7 +1124,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForString(442); private readonly pbc::RepeatedField repeatedCord_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCord { get { return repeatedCord_; } } @@ -1322,7 +1137,6 @@ namespace ProtobufTestMessages.Proto2 { /// Packed /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -1333,7 +1147,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt64(610); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -1344,7 +1157,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt32(618); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -1355,7 +1167,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt64(626); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -1366,7 +1177,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt32(634); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -1377,7 +1187,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt64(642); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -1388,7 +1197,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed32(650); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -1399,7 +1207,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed64(658); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -1410,7 +1217,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed32(666); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -1421,7 +1227,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed64(674); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -1432,7 +1237,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFloat(682); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -1443,7 +1247,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForDouble(690); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -1454,7 +1257,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBool(698); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -1465,7 +1267,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(706, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x); private readonly pbc::RepeatedField packedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedNestedEnum { get { return packedNestedEnum_; } } @@ -1479,7 +1280,6 @@ namespace ProtobufTestMessages.Proto2 { /// Unpacked /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -1490,7 +1290,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt64(720); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -1501,7 +1300,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt32(728); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -1512,7 +1310,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt64(736); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -1523,7 +1320,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt32(744); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -1534,7 +1330,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt64(752); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -1545,7 +1340,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed32(765); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -1556,7 +1350,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed64(769); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -1567,7 +1360,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed32(781); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -1578,7 +1370,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed64(785); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -1589,7 +1380,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFloat(797); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -1600,7 +1390,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForDouble(801); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -1611,7 +1400,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBool(808); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -1622,7 +1410,6 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(816, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x); private readonly pbc::RepeatedField unpackedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedNestedEnum { get { return unpackedNestedEnum_; } } @@ -1636,7 +1423,6 @@ namespace ProtobufTestMessages.Proto2 { /// Map /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1647,7 +1433,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 458); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1658,7 +1443,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 466); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1669,7 +1453,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 474); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1680,7 +1463,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 482); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1691,7 +1473,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 490); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1702,7 +1483,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 498); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1713,7 +1493,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 506); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1724,7 +1503,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 514); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1735,7 +1513,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 522); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1746,7 +1523,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 530); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1757,7 +1533,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 538); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1768,7 +1543,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 546); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1779,7 +1553,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 554); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -1790,7 +1563,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForBytes(18, pb::ByteString.Empty), 562); private readonly pbc::MapField mapStringBytes_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringBytes { get { return mapStringBytes_; } } @@ -1801,7 +1573,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage.Parser), 570); private readonly pbc::MapField mapStringNestedMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedMessage { get { return mapStringNestedMessage_; } } @@ -1812,7 +1583,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto2.ForeignMessageProto2.Parser), 578); private readonly pbc::MapField mapStringForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignMessage { get { return mapStringForeignMessage_; } } @@ -1823,7 +1593,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum.Foo), 586); private readonly pbc::MapField mapStringNestedEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedEnum { get { return mapStringNestedEnum_; } } @@ -1834,7 +1603,6 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) x, global::ProtobufTestMessages.Proto2.ForeignEnumProto2.ForeignFoo), 594); private readonly pbc::MapField mapStringForeignEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignEnum { get { return mapStringForeignEnum_; } } @@ -1842,7 +1610,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return HasOneofUint32 ? (uint) oneofField_ : 0; } set { @@ -1852,13 +1619,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } } /// Clears the value of the oneof if it's currently set to "oneof_uint32" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint32() { if (HasOneofUint32) { ClearOneofField(); @@ -1868,7 +1633,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage) oneofField_ : null; } set { @@ -1880,7 +1644,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return HasOneofString ? (string) oneofField_ : ""; } set { @@ -1890,13 +1653,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } } /// Clears the value of the oneof if it's currently set to "oneof_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofString() { if (HasOneofString) { ClearOneofField(); @@ -1906,7 +1667,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -1916,13 +1676,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } } /// Clears the value of the oneof if it's currently set to "oneof_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBytes() { if (HasOneofBytes) { ClearOneofField(); @@ -1932,7 +1690,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_bool" field. public const int OneofBoolFieldNumber = 115; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OneofBool { get { return HasOneofBool ? (bool) oneofField_ : false; } set { @@ -1942,13 +1699,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBool { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBool; } } /// Clears the value of the oneof if it's currently set to "oneof_bool" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBool() { if (HasOneofBool) { ClearOneofField(); @@ -1958,7 +1713,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_uint64" field. public const int OneofUint64FieldNumber = 116; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OneofUint64 { get { return HasOneofUint64 ? (ulong) oneofField_ : 0UL; } set { @@ -1968,13 +1722,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint64 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint64; } } /// Clears the value of the oneof if it's currently set to "oneof_uint64" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint64() { if (HasOneofUint64) { ClearOneofField(); @@ -1984,7 +1736,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_float" field. public const int OneofFloatFieldNumber = 117; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OneofFloat { get { return HasOneofFloat ? (float) oneofField_ : 0F; } set { @@ -1994,13 +1745,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofFloat { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofFloat; } } /// Clears the value of the oneof if it's currently set to "oneof_float" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofFloat() { if (HasOneofFloat) { ClearOneofField(); @@ -2010,7 +1759,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_double" field. public const int OneofDoubleFieldNumber = 118; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OneofDouble { get { return HasOneofDouble ? (double) oneofField_ : 0D; } set { @@ -2020,13 +1768,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofDouble { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofDouble; } } /// Clears the value of the oneof if it's currently set to "oneof_double" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofDouble() { if (HasOneofDouble) { ClearOneofField(); @@ -2036,7 +1782,6 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_enum" field. public const int OneofEnumFieldNumber = 119; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum OneofEnum { get { return HasOneofEnum ? (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) oneofField_ : global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum.Foo; } set { @@ -2046,13 +1791,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofEnum { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum; } } /// Clears the value of the oneof if it's currently set to "oneof_enum" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofEnum() { if (HasOneofEnum) { ClearOneofField(); @@ -2063,7 +1806,6 @@ namespace ProtobufTestMessages.Proto2 { public const int DataFieldNumber = 201; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data Data { get { return data_; } set { @@ -2072,423 +1814,15 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the data field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return data_ != null; } } /// Clears the value of the data field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { data_ = null; } - /// Field number for the "default_int32" field. - public const int DefaultInt32FieldNumber = 241; - private readonly static int DefaultInt32DefaultValue = -123456789; - - private int defaultInt32_; - /// - /// default values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int DefaultInt32 { - get { if ((_hasBits0 & 32768) != 0) { return defaultInt32_; } else { return DefaultInt32DefaultValue; } } - set { - _hasBits0 |= 32768; - defaultInt32_ = value; - } - } - /// Gets whether the "default_int32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultInt32 { - get { return (_hasBits0 & 32768) != 0; } - } - /// Clears the value of the "default_int32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultInt32() { - _hasBits0 &= ~32768; - } - - /// Field number for the "default_int64" field. - public const int DefaultInt64FieldNumber = 242; - private readonly static long DefaultInt64DefaultValue = -9123456789123456789L; - - private long defaultInt64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long DefaultInt64 { - get { if ((_hasBits0 & 65536) != 0) { return defaultInt64_; } else { return DefaultInt64DefaultValue; } } - set { - _hasBits0 |= 65536; - defaultInt64_ = value; - } - } - /// Gets whether the "default_int64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultInt64 { - get { return (_hasBits0 & 65536) != 0; } - } - /// Clears the value of the "default_int64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultInt64() { - _hasBits0 &= ~65536; - } - - /// Field number for the "default_uint32" field. - public const int DefaultUint32FieldNumber = 243; - private readonly static uint DefaultUint32DefaultValue = 2123456789; - - private uint defaultUint32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint DefaultUint32 { - get { if ((_hasBits0 & 131072) != 0) { return defaultUint32_; } else { return DefaultUint32DefaultValue; } } - set { - _hasBits0 |= 131072; - defaultUint32_ = value; - } - } - /// Gets whether the "default_uint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultUint32 { - get { return (_hasBits0 & 131072) != 0; } - } - /// Clears the value of the "default_uint32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultUint32() { - _hasBits0 &= ~131072; - } - - /// Field number for the "default_uint64" field. - public const int DefaultUint64FieldNumber = 244; - private readonly static ulong DefaultUint64DefaultValue = 10123456789123456789UL; - - private ulong defaultUint64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong DefaultUint64 { - get { if ((_hasBits0 & 262144) != 0) { return defaultUint64_; } else { return DefaultUint64DefaultValue; } } - set { - _hasBits0 |= 262144; - defaultUint64_ = value; - } - } - /// Gets whether the "default_uint64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultUint64 { - get { return (_hasBits0 & 262144) != 0; } - } - /// Clears the value of the "default_uint64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultUint64() { - _hasBits0 &= ~262144; - } - - /// Field number for the "default_sint32" field. - public const int DefaultSint32FieldNumber = 245; - private readonly static int DefaultSint32DefaultValue = -123456789; - - private int defaultSint32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int DefaultSint32 { - get { if ((_hasBits0 & 524288) != 0) { return defaultSint32_; } else { return DefaultSint32DefaultValue; } } - set { - _hasBits0 |= 524288; - defaultSint32_ = value; - } - } - /// Gets whether the "default_sint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSint32 { - get { return (_hasBits0 & 524288) != 0; } - } - /// Clears the value of the "default_sint32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSint32() { - _hasBits0 &= ~524288; - } - - /// Field number for the "default_sint64" field. - public const int DefaultSint64FieldNumber = 246; - private readonly static long DefaultSint64DefaultValue = -9123456789123456789L; - - private long defaultSint64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long DefaultSint64 { - get { if ((_hasBits0 & 1048576) != 0) { return defaultSint64_; } else { return DefaultSint64DefaultValue; } } - set { - _hasBits0 |= 1048576; - defaultSint64_ = value; - } - } - /// Gets whether the "default_sint64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSint64 { - get { return (_hasBits0 & 1048576) != 0; } - } - /// Clears the value of the "default_sint64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSint64() { - _hasBits0 &= ~1048576; - } - - /// Field number for the "default_fixed32" field. - public const int DefaultFixed32FieldNumber = 247; - private readonly static uint DefaultFixed32DefaultValue = 2123456789; - - private uint defaultFixed32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint DefaultFixed32 { - get { if ((_hasBits0 & 2097152) != 0) { return defaultFixed32_; } else { return DefaultFixed32DefaultValue; } } - set { - _hasBits0 |= 2097152; - defaultFixed32_ = value; - } - } - /// Gets whether the "default_fixed32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultFixed32 { - get { return (_hasBits0 & 2097152) != 0; } - } - /// Clears the value of the "default_fixed32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultFixed32() { - _hasBits0 &= ~2097152; - } - - /// Field number for the "default_fixed64" field. - public const int DefaultFixed64FieldNumber = 248; - private readonly static ulong DefaultFixed64DefaultValue = 10123456789123456789UL; - - private ulong defaultFixed64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong DefaultFixed64 { - get { if ((_hasBits0 & 4194304) != 0) { return defaultFixed64_; } else { return DefaultFixed64DefaultValue; } } - set { - _hasBits0 |= 4194304; - defaultFixed64_ = value; - } - } - /// Gets whether the "default_fixed64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultFixed64 { - get { return (_hasBits0 & 4194304) != 0; } - } - /// Clears the value of the "default_fixed64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultFixed64() { - _hasBits0 &= ~4194304; - } - - /// Field number for the "default_sfixed32" field. - public const int DefaultSfixed32FieldNumber = 249; - private readonly static int DefaultSfixed32DefaultValue = -123456789; - - private int defaultSfixed32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int DefaultSfixed32 { - get { if ((_hasBits0 & 8388608) != 0) { return defaultSfixed32_; } else { return DefaultSfixed32DefaultValue; } } - set { - _hasBits0 |= 8388608; - defaultSfixed32_ = value; - } - } - /// Gets whether the "default_sfixed32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSfixed32 { - get { return (_hasBits0 & 8388608) != 0; } - } - /// Clears the value of the "default_sfixed32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSfixed32() { - _hasBits0 &= ~8388608; - } - - /// Field number for the "default_sfixed64" field. - public const int DefaultSfixed64FieldNumber = 250; - private readonly static long DefaultSfixed64DefaultValue = -9123456789123456789L; - - private long defaultSfixed64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long DefaultSfixed64 { - get { if ((_hasBits0 & 16777216) != 0) { return defaultSfixed64_; } else { return DefaultSfixed64DefaultValue; } } - set { - _hasBits0 |= 16777216; - defaultSfixed64_ = value; - } - } - /// Gets whether the "default_sfixed64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSfixed64 { - get { return (_hasBits0 & 16777216) != 0; } - } - /// Clears the value of the "default_sfixed64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSfixed64() { - _hasBits0 &= ~16777216; - } - - /// Field number for the "default_float" field. - public const int DefaultFloatFieldNumber = 251; - private readonly static float DefaultFloatDefaultValue = 9e+09F; - - private float defaultFloat_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float DefaultFloat { - get { if ((_hasBits0 & 33554432) != 0) { return defaultFloat_; } else { return DefaultFloatDefaultValue; } } - set { - _hasBits0 |= 33554432; - defaultFloat_ = value; - } - } - /// Gets whether the "default_float" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultFloat { - get { return (_hasBits0 & 33554432) != 0; } - } - /// Clears the value of the "default_float" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultFloat() { - _hasBits0 &= ~33554432; - } - - /// Field number for the "default_double" field. - public const int DefaultDoubleFieldNumber = 252; - private readonly static double DefaultDoubleDefaultValue = 7e+22D; - - private double defaultDouble_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double DefaultDouble { - get { if ((_hasBits0 & 67108864) != 0) { return defaultDouble_; } else { return DefaultDoubleDefaultValue; } } - set { - _hasBits0 |= 67108864; - defaultDouble_ = value; - } - } - /// Gets whether the "default_double" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultDouble { - get { return (_hasBits0 & 67108864) != 0; } - } - /// Clears the value of the "default_double" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultDouble() { - _hasBits0 &= ~67108864; - } - - /// Field number for the "default_bool" field. - public const int DefaultBoolFieldNumber = 253; - private readonly static bool DefaultBoolDefaultValue = true; - - private bool defaultBool_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool DefaultBool { - get { if ((_hasBits0 & 134217728) != 0) { return defaultBool_; } else { return DefaultBoolDefaultValue; } } - set { - _hasBits0 |= 134217728; - defaultBool_ = value; - } - } - /// Gets whether the "default_bool" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultBool { - get { return (_hasBits0 & 134217728) != 0; } - } - /// Clears the value of the "default_bool" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultBool() { - _hasBits0 &= ~134217728; - } - - /// Field number for the "default_string" field. - public const int DefaultStringFieldNumber = 254; - private readonly static string DefaultStringDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("Um9zZWJ1ZA=="), 0, 7); - - private string defaultString_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string DefaultString { - get { return defaultString_ ?? DefaultStringDefaultValue; } - set { - defaultString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "default_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultString { - get { return defaultString_ != null; } - } - /// Clears the value of the "default_string" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultString() { - defaultString_ = null; - } - - /// Field number for the "default_bytes" field. - public const int DefaultBytesFieldNumber = 255; - private readonly static pb::ByteString DefaultBytesDefaultValue = pb::ByteString.FromBase64("am9zaHVh"); - - private pb::ByteString defaultBytes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString DefaultBytes { - get { return defaultBytes_ ?? DefaultBytesDefaultValue; } - set { - defaultBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "default_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultBytes { - get { return defaultBytes_ != null; } - } - /// Clears the value of the "default_bytes" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultBytes() { - defaultBytes_ = null; - } - /// Field number for the "fieldname1" field. public const int Fieldname1FieldNumber = 401; private readonly static int Fieldname1DefaultValue = 0; @@ -2499,25 +1833,22 @@ namespace ProtobufTestMessages.Proto2 { /// (protobuf says names can be any valid C/C++ identifier.) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fieldname1 { - get { if ((_hasBits0 & 268435456) != 0) { return fieldname1_; } else { return Fieldname1DefaultValue; } } + get { if ((_hasBits0 & 32768) != 0) { return fieldname1_; } else { return Fieldname1DefaultValue; } } set { - _hasBits0 |= 268435456; + _hasBits0 |= 32768; fieldname1_ = value; } } /// Gets whether the "fieldname1" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldname1 { - get { return (_hasBits0 & 268435456) != 0; } + get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "fieldname1" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldname1() { - _hasBits0 &= ~268435456; + _hasBits0 &= ~32768; } /// Field number for the "field_name2" field. @@ -2526,25 +1857,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName2 { - get { if ((_hasBits0 & 536870912) != 0) { return fieldName2_; } else { return FieldName2DefaultValue; } } + get { if ((_hasBits0 & 65536) != 0) { return fieldName2_; } else { return FieldName2DefaultValue; } } set { - _hasBits0 |= 536870912; + _hasBits0 |= 65536; fieldName2_ = value; } } /// Gets whether the "field_name2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName2 { - get { return (_hasBits0 & 536870912) != 0; } + get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "field_name2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName2() { - _hasBits0 &= ~536870912; + _hasBits0 &= ~65536; } /// Field number for the "_field_name3" field. @@ -2553,25 +1881,22 @@ namespace ProtobufTestMessages.Proto2 { private int FieldName3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName3 { - get { if ((_hasBits0 & 1073741824) != 0) { return FieldName3_; } else { return FieldName3DefaultValue; } } + get { if ((_hasBits0 & 131072) != 0) { return FieldName3_; } else { return FieldName3DefaultValue; } } set { - _hasBits0 |= 1073741824; + _hasBits0 |= 131072; FieldName3_ = value; } } /// Gets whether the "_field_name3" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName3 { - get { return (_hasBits0 & 1073741824) != 0; } + get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "_field_name3" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName3() { - _hasBits0 &= ~1073741824; + _hasBits0 &= ~131072; } /// Field number for the "field__name4_" field. @@ -2580,25 +1905,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName4 { - get { if ((_hasBits0 & -2147483648) != 0) { return fieldName4_; } else { return FieldName4DefaultValue; } } + get { if ((_hasBits0 & 262144) != 0) { return fieldName4_; } else { return FieldName4DefaultValue; } } set { - _hasBits0 |= -2147483648; + _hasBits0 |= 262144; fieldName4_ = value; } } /// Gets whether the "field__name4_" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName4 { - get { return (_hasBits0 & -2147483648) != 0; } + get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "field__name4_" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName4() { - _hasBits0 &= ~-2147483648; + _hasBits0 &= ~262144; } /// Field number for the "field0name5" field. @@ -2607,25 +1929,22 @@ namespace ProtobufTestMessages.Proto2 { private int field0Name5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name5 { - get { if ((_hasBits1 & 1) != 0) { return field0Name5_; } else { return Field0Name5DefaultValue; } } + get { if ((_hasBits0 & 524288) != 0) { return field0Name5_; } else { return Field0Name5DefaultValue; } } set { - _hasBits1 |= 1; + _hasBits0 |= 524288; field0Name5_ = value; } } /// Gets whether the "field0name5" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField0Name5 { - get { return (_hasBits1 & 1) != 0; } + get { return (_hasBits0 & 524288) != 0; } } /// Clears the value of the "field0name5" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField0Name5() { - _hasBits1 &= ~1; + _hasBits0 &= ~524288; } /// Field number for the "field_0_name6" field. @@ -2634,25 +1953,22 @@ namespace ProtobufTestMessages.Proto2 { private int field0Name6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name6 { - get { if ((_hasBits1 & 2) != 0) { return field0Name6_; } else { return Field0Name6DefaultValue; } } + get { if ((_hasBits0 & 1048576) != 0) { return field0Name6_; } else { return Field0Name6DefaultValue; } } set { - _hasBits1 |= 2; + _hasBits0 |= 1048576; field0Name6_ = value; } } /// Gets whether the "field_0_name6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField0Name6 { - get { return (_hasBits1 & 2) != 0; } + get { return (_hasBits0 & 1048576) != 0; } } /// Clears the value of the "field_0_name6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField0Name6() { - _hasBits1 &= ~2; + _hasBits0 &= ~1048576; } /// Field number for the "fieldName7" field. @@ -2661,25 +1977,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName7 { - get { if ((_hasBits1 & 4) != 0) { return fieldName7_; } else { return FieldName7DefaultValue; } } + get { if ((_hasBits0 & 2097152) != 0) { return fieldName7_; } else { return FieldName7DefaultValue; } } set { - _hasBits1 |= 4; + _hasBits0 |= 2097152; fieldName7_ = value; } } /// Gets whether the "fieldName7" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName7 { - get { return (_hasBits1 & 4) != 0; } + get { return (_hasBits0 & 2097152) != 0; } } /// Clears the value of the "fieldName7" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName7() { - _hasBits1 &= ~4; + _hasBits0 &= ~2097152; } /// Field number for the "FieldName8" field. @@ -2688,25 +2001,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName8 { - get { if ((_hasBits1 & 8) != 0) { return fieldName8_; } else { return FieldName8DefaultValue; } } + get { if ((_hasBits0 & 4194304) != 0) { return fieldName8_; } else { return FieldName8DefaultValue; } } set { - _hasBits1 |= 8; + _hasBits0 |= 4194304; fieldName8_ = value; } } /// Gets whether the "FieldName8" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName8 { - get { return (_hasBits1 & 8) != 0; } + get { return (_hasBits0 & 4194304) != 0; } } /// Clears the value of the "FieldName8" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName8() { - _hasBits1 &= ~8; + _hasBits0 &= ~4194304; } /// Field number for the "field_Name9" field. @@ -2715,25 +2025,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName9 { - get { if ((_hasBits1 & 16) != 0) { return fieldName9_; } else { return FieldName9DefaultValue; } } + get { if ((_hasBits0 & 8388608) != 0) { return fieldName9_; } else { return FieldName9DefaultValue; } } set { - _hasBits1 |= 16; + _hasBits0 |= 8388608; fieldName9_ = value; } } /// Gets whether the "field_Name9" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName9 { - get { return (_hasBits1 & 16) != 0; } + get { return (_hasBits0 & 8388608) != 0; } } /// Clears the value of the "field_Name9" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName9() { - _hasBits1 &= ~16; + _hasBits0 &= ~8388608; } /// Field number for the "Field_Name10" field. @@ -2742,25 +2049,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName10 { - get { if ((_hasBits1 & 32) != 0) { return fieldName10_; } else { return FieldName10DefaultValue; } } + get { if ((_hasBits0 & 16777216) != 0) { return fieldName10_; } else { return FieldName10DefaultValue; } } set { - _hasBits1 |= 32; + _hasBits0 |= 16777216; fieldName10_ = value; } } /// Gets whether the "Field_Name10" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName10 { - get { return (_hasBits1 & 32) != 0; } + get { return (_hasBits0 & 16777216) != 0; } } /// Clears the value of the "Field_Name10" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName10() { - _hasBits1 &= ~32; + _hasBits0 &= ~16777216; } /// Field number for the "FIELD_NAME11" field. @@ -2769,25 +2073,22 @@ namespace ProtobufTestMessages.Proto2 { private int fIELDNAME11_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDNAME11 { - get { if ((_hasBits1 & 64) != 0) { return fIELDNAME11_; } else { return FIELDNAME11DefaultValue; } } + get { if ((_hasBits0 & 33554432) != 0) { return fIELDNAME11_; } else { return FIELDNAME11DefaultValue; } } set { - _hasBits1 |= 64; + _hasBits0 |= 33554432; fIELDNAME11_ = value; } } /// Gets whether the "FIELD_NAME11" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFIELDNAME11 { - get { return (_hasBits1 & 64) != 0; } + get { return (_hasBits0 & 33554432) != 0; } } /// Clears the value of the "FIELD_NAME11" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFIELDNAME11() { - _hasBits1 &= ~64; + _hasBits0 &= ~33554432; } /// Field number for the "FIELD_name12" field. @@ -2796,25 +2097,22 @@ namespace ProtobufTestMessages.Proto2 { private int fIELDName12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDName12 { - get { if ((_hasBits1 & 128) != 0) { return fIELDName12_; } else { return FIELDName12DefaultValue; } } + get { if ((_hasBits0 & 67108864) != 0) { return fIELDName12_; } else { return FIELDName12DefaultValue; } } set { - _hasBits1 |= 128; + _hasBits0 |= 67108864; fIELDName12_ = value; } } /// Gets whether the "FIELD_name12" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFIELDName12 { - get { return (_hasBits1 & 128) != 0; } + get { return (_hasBits0 & 67108864) != 0; } } /// Clears the value of the "FIELD_name12" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFIELDName12() { - _hasBits1 &= ~128; + _hasBits0 &= ~67108864; } /// Field number for the "__field_name13" field. @@ -2823,25 +2121,22 @@ namespace ProtobufTestMessages.Proto2 { private int FieldName13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName13 { - get { if ((_hasBits1 & 256) != 0) { return FieldName13_; } else { return FieldName13DefaultValue; } } + get { if ((_hasBits0 & 134217728) != 0) { return FieldName13_; } else { return FieldName13DefaultValue; } } set { - _hasBits1 |= 256; + _hasBits0 |= 134217728; FieldName13_ = value; } } /// Gets whether the "__field_name13" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName13 { - get { return (_hasBits1 & 256) != 0; } + get { return (_hasBits0 & 134217728) != 0; } } /// Clears the value of the "__field_name13" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName13() { - _hasBits1 &= ~256; + _hasBits0 &= ~134217728; } /// Field number for the "__Field_name14" field. @@ -2850,25 +2145,22 @@ namespace ProtobufTestMessages.Proto2 { private int FieldName14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName14 { - get { if ((_hasBits1 & 512) != 0) { return FieldName14_; } else { return FieldName14DefaultValue; } } + get { if ((_hasBits0 & 268435456) != 0) { return FieldName14_; } else { return FieldName14DefaultValue; } } set { - _hasBits1 |= 512; + _hasBits0 |= 268435456; FieldName14_ = value; } } /// Gets whether the "__Field_name14" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName14 { - get { return (_hasBits1 & 512) != 0; } + get { return (_hasBits0 & 268435456) != 0; } } /// Clears the value of the "__Field_name14" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName14() { - _hasBits1 &= ~512; + _hasBits0 &= ~268435456; } /// Field number for the "field__name15" field. @@ -2877,25 +2169,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName15 { - get { if ((_hasBits1 & 1024) != 0) { return fieldName15_; } else { return FieldName15DefaultValue; } } + get { if ((_hasBits0 & 536870912) != 0) { return fieldName15_; } else { return FieldName15DefaultValue; } } set { - _hasBits1 |= 1024; + _hasBits0 |= 536870912; fieldName15_ = value; } } /// Gets whether the "field__name15" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName15 { - get { return (_hasBits1 & 1024) != 0; } + get { return (_hasBits0 & 536870912) != 0; } } /// Clears the value of the "field__name15" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName15() { - _hasBits1 &= ~1024; + _hasBits0 &= ~536870912; } /// Field number for the "field__Name16" field. @@ -2904,25 +2193,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName16 { - get { if ((_hasBits1 & 2048) != 0) { return fieldName16_; } else { return FieldName16DefaultValue; } } + get { if ((_hasBits0 & 1073741824) != 0) { return fieldName16_; } else { return FieldName16DefaultValue; } } set { - _hasBits1 |= 2048; + _hasBits0 |= 1073741824; fieldName16_ = value; } } /// Gets whether the "field__Name16" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName16 { - get { return (_hasBits1 & 2048) != 0; } + get { return (_hasBits0 & 1073741824) != 0; } } /// Clears the value of the "field__Name16" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName16() { - _hasBits1 &= ~2048; + _hasBits0 &= ~1073741824; } /// Field number for the "field_name17__" field. @@ -2931,25 +2217,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName17_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName17 { - get { if ((_hasBits1 & 4096) != 0) { return fieldName17_; } else { return FieldName17DefaultValue; } } + get { if ((_hasBits0 & -2147483648) != 0) { return fieldName17_; } else { return FieldName17DefaultValue; } } set { - _hasBits1 |= 4096; + _hasBits0 |= -2147483648; fieldName17_ = value; } } /// Gets whether the "field_name17__" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName17 { - get { return (_hasBits1 & 4096) != 0; } + get { return (_hasBits0 & -2147483648) != 0; } } /// Clears the value of the "field_name17__" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName17() { - _hasBits1 &= ~4096; + _hasBits0 &= ~-2147483648; } /// Field number for the "Field_name18__" field. @@ -2958,25 +2241,22 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName18_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName18 { - get { if ((_hasBits1 & 8192) != 0) { return fieldName18_; } else { return FieldName18DefaultValue; } } + get { if ((_hasBits1 & 1) != 0) { return fieldName18_; } else { return FieldName18DefaultValue; } } set { - _hasBits1 |= 8192; + _hasBits1 |= 1; fieldName18_ = value; } } /// Gets whether the "Field_name18__" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName18 { - get { return (_hasBits1 & 8192) != 0; } + get { return (_hasBits1 & 1) != 0; } } /// Clears the value of the "Field_name18__" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName18() { - _hasBits1 &= ~8192; + _hasBits1 &= ~1; } private object oneofField_; @@ -2995,26 +2275,22 @@ namespace ProtobufTestMessages.Proto2 { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypesProto2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypesProto2 other) { if (ReferenceEquals(other, null)) { return false; @@ -3122,21 +2398,6 @@ namespace ProtobufTestMessages.Proto2 { if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OneofDouble, other.OneofDouble)) return false; if (OneofEnum != other.OneofEnum) return false; if (!object.Equals(Data, other.Data)) return false; - if (DefaultInt32 != other.DefaultInt32) return false; - if (DefaultInt64 != other.DefaultInt64) return false; - if (DefaultUint32 != other.DefaultUint32) return false; - if (DefaultUint64 != other.DefaultUint64) return false; - if (DefaultSint32 != other.DefaultSint32) return false; - if (DefaultSint64 != other.DefaultSint64) return false; - if (DefaultFixed32 != other.DefaultFixed32) return false; - if (DefaultFixed64 != other.DefaultFixed64) return false; - if (DefaultSfixed32 != other.DefaultSfixed32) return false; - if (DefaultSfixed64 != other.DefaultSfixed64) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DefaultFloat, other.DefaultFloat)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DefaultDouble, other.DefaultDouble)) return false; - if (DefaultBool != other.DefaultBool) return false; - if (DefaultString != other.DefaultString) return false; - if (DefaultBytes != other.DefaultBytes) return false; if (Fieldname1 != other.Fieldname1) return false; if (FieldName2 != other.FieldName2) return false; if (FieldName3 != other.FieldName3) return false; @@ -3163,7 +2424,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -3266,21 +2526,6 @@ namespace ProtobufTestMessages.Proto2 { if (HasOneofDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OneofDouble); if (HasOneofEnum) hash ^= OneofEnum.GetHashCode(); if (HasData) hash ^= Data.GetHashCode(); - if (HasDefaultInt32) hash ^= DefaultInt32.GetHashCode(); - if (HasDefaultInt64) hash ^= DefaultInt64.GetHashCode(); - if (HasDefaultUint32) hash ^= DefaultUint32.GetHashCode(); - if (HasDefaultUint64) hash ^= DefaultUint64.GetHashCode(); - if (HasDefaultSint32) hash ^= DefaultSint32.GetHashCode(); - if (HasDefaultSint64) hash ^= DefaultSint64.GetHashCode(); - if (HasDefaultFixed32) hash ^= DefaultFixed32.GetHashCode(); - if (HasDefaultFixed64) hash ^= DefaultFixed64.GetHashCode(); - if (HasDefaultSfixed32) hash ^= DefaultSfixed32.GetHashCode(); - if (HasDefaultSfixed64) hash ^= DefaultSfixed64.GetHashCode(); - if (HasDefaultFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DefaultFloat); - if (HasDefaultDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DefaultDouble); - if (HasDefaultBool) hash ^= DefaultBool.GetHashCode(); - if (HasDefaultString) hash ^= DefaultString.GetHashCode(); - if (HasDefaultBytes) hash ^= DefaultBytes.GetHashCode(); if (HasFieldname1) hash ^= Fieldname1.GetHashCode(); if (HasFieldName2) hash ^= FieldName2.GetHashCode(); if (HasFieldName3) hash ^= FieldName3.GetHashCode(); @@ -3310,13 +2555,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3518,66 +2761,6 @@ namespace ProtobufTestMessages.Proto2 { output.WriteGroup(Data); output.WriteRawTag(204, 12); } - if (HasDefaultInt32) { - output.WriteRawTag(136, 15); - output.WriteInt32(DefaultInt32); - } - if (HasDefaultInt64) { - output.WriteRawTag(144, 15); - output.WriteInt64(DefaultInt64); - } - if (HasDefaultUint32) { - output.WriteRawTag(152, 15); - output.WriteUInt32(DefaultUint32); - } - if (HasDefaultUint64) { - output.WriteRawTag(160, 15); - output.WriteUInt64(DefaultUint64); - } - if (HasDefaultSint32) { - output.WriteRawTag(168, 15); - output.WriteSInt32(DefaultSint32); - } - if (HasDefaultSint64) { - output.WriteRawTag(176, 15); - output.WriteSInt64(DefaultSint64); - } - if (HasDefaultFixed32) { - output.WriteRawTag(189, 15); - output.WriteFixed32(DefaultFixed32); - } - if (HasDefaultFixed64) { - output.WriteRawTag(193, 15); - output.WriteFixed64(DefaultFixed64); - } - if (HasDefaultSfixed32) { - output.WriteRawTag(205, 15); - output.WriteSFixed32(DefaultSfixed32); - } - if (HasDefaultSfixed64) { - output.WriteRawTag(209, 15); - output.WriteSFixed64(DefaultSfixed64); - } - if (HasDefaultFloat) { - output.WriteRawTag(221, 15); - output.WriteFloat(DefaultFloat); - } - if (HasDefaultDouble) { - output.WriteRawTag(225, 15); - output.WriteDouble(DefaultDouble); - } - if (HasDefaultBool) { - output.WriteRawTag(232, 15); - output.WriteBool(DefaultBool); - } - if (HasDefaultString) { - output.WriteRawTag(242, 15); - output.WriteString(DefaultString); - } - if (HasDefaultBytes) { - output.WriteRawTag(250, 15); - output.WriteBytes(DefaultBytes); - } if (HasFieldname1) { output.WriteRawTag(136, 25); output.WriteInt32(Fieldname1); @@ -3661,7 +2844,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasOptionalInt32) { output.WriteRawTag(8); @@ -3860,66 +3042,6 @@ namespace ProtobufTestMessages.Proto2 { output.WriteGroup(Data); output.WriteRawTag(204, 12); } - if (HasDefaultInt32) { - output.WriteRawTag(136, 15); - output.WriteInt32(DefaultInt32); - } - if (HasDefaultInt64) { - output.WriteRawTag(144, 15); - output.WriteInt64(DefaultInt64); - } - if (HasDefaultUint32) { - output.WriteRawTag(152, 15); - output.WriteUInt32(DefaultUint32); - } - if (HasDefaultUint64) { - output.WriteRawTag(160, 15); - output.WriteUInt64(DefaultUint64); - } - if (HasDefaultSint32) { - output.WriteRawTag(168, 15); - output.WriteSInt32(DefaultSint32); - } - if (HasDefaultSint64) { - output.WriteRawTag(176, 15); - output.WriteSInt64(DefaultSint64); - } - if (HasDefaultFixed32) { - output.WriteRawTag(189, 15); - output.WriteFixed32(DefaultFixed32); - } - if (HasDefaultFixed64) { - output.WriteRawTag(193, 15); - output.WriteFixed64(DefaultFixed64); - } - if (HasDefaultSfixed32) { - output.WriteRawTag(205, 15); - output.WriteSFixed32(DefaultSfixed32); - } - if (HasDefaultSfixed64) { - output.WriteRawTag(209, 15); - output.WriteSFixed64(DefaultSfixed64); - } - if (HasDefaultFloat) { - output.WriteRawTag(221, 15); - output.WriteFloat(DefaultFloat); - } - if (HasDefaultDouble) { - output.WriteRawTag(225, 15); - output.WriteDouble(DefaultDouble); - } - if (HasDefaultBool) { - output.WriteRawTag(232, 15); - output.WriteBool(DefaultBool); - } - if (HasDefaultString) { - output.WriteRawTag(242, 15); - output.WriteString(DefaultString); - } - if (HasDefaultBytes) { - output.WriteRawTag(250, 15); - output.WriteBytes(DefaultBytes); - } if (HasFieldname1) { output.WriteRawTag(136, 25); output.WriteInt32(Fieldname1); @@ -4002,7 +3124,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -4169,51 +3290,6 @@ namespace ProtobufTestMessages.Proto2 { if (HasData) { size += 4 + pb::CodedOutputStream.ComputeGroupSize(Data); } - if (HasDefaultInt32) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(DefaultInt32); - } - if (HasDefaultInt64) { - size += 2 + pb::CodedOutputStream.ComputeInt64Size(DefaultInt64); - } - if (HasDefaultUint32) { - size += 2 + pb::CodedOutputStream.ComputeUInt32Size(DefaultUint32); - } - if (HasDefaultUint64) { - size += 2 + pb::CodedOutputStream.ComputeUInt64Size(DefaultUint64); - } - if (HasDefaultSint32) { - size += 2 + pb::CodedOutputStream.ComputeSInt32Size(DefaultSint32); - } - if (HasDefaultSint64) { - size += 2 + pb::CodedOutputStream.ComputeSInt64Size(DefaultSint64); - } - if (HasDefaultFixed32) { - size += 2 + 4; - } - if (HasDefaultFixed64) { - size += 2 + 8; - } - if (HasDefaultSfixed32) { - size += 2 + 4; - } - if (HasDefaultSfixed64) { - size += 2 + 8; - } - if (HasDefaultFloat) { - size += 2 + 4; - } - if (HasDefaultDouble) { - size += 2 + 8; - } - if (HasDefaultBool) { - size += 2 + 1; - } - if (HasDefaultString) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(DefaultString); - } - if (HasDefaultBytes) { - size += 2 + pb::CodedOutputStream.ComputeBytesSize(DefaultBytes); - } if (HasFieldname1) { size += 2 + pb::CodedOutputStream.ComputeInt32Size(Fieldname1); } @@ -4278,7 +3354,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllTypesProto2 other) { if (other == null) { return; @@ -4407,76 +3482,31 @@ namespace ProtobufTestMessages.Proto2 { unpackedDouble_.Add(other.unpackedDouble_); unpackedBool_.Add(other.unpackedBool_); unpackedNestedEnum_.Add(other.unpackedNestedEnum_); - mapInt32Int32_.MergeFrom(other.mapInt32Int32_); - mapInt64Int64_.MergeFrom(other.mapInt64Int64_); - mapUint32Uint32_.MergeFrom(other.mapUint32Uint32_); - mapUint64Uint64_.MergeFrom(other.mapUint64Uint64_); - mapSint32Sint32_.MergeFrom(other.mapSint32Sint32_); - mapSint64Sint64_.MergeFrom(other.mapSint64Sint64_); - mapFixed32Fixed32_.MergeFrom(other.mapFixed32Fixed32_); - mapFixed64Fixed64_.MergeFrom(other.mapFixed64Fixed64_); - mapSfixed32Sfixed32_.MergeFrom(other.mapSfixed32Sfixed32_); - mapSfixed64Sfixed64_.MergeFrom(other.mapSfixed64Sfixed64_); - mapInt32Float_.MergeFrom(other.mapInt32Float_); - mapInt32Double_.MergeFrom(other.mapInt32Double_); - mapBoolBool_.MergeFrom(other.mapBoolBool_); - mapStringString_.MergeFrom(other.mapStringString_); - mapStringBytes_.MergeFrom(other.mapStringBytes_); - mapStringNestedMessage_.MergeFrom(other.mapStringNestedMessage_); - mapStringForeignMessage_.MergeFrom(other.mapStringForeignMessage_); - mapStringNestedEnum_.MergeFrom(other.mapStringNestedEnum_); - mapStringForeignEnum_.MergeFrom(other.mapStringForeignEnum_); + mapInt32Int32_.Add(other.mapInt32Int32_); + mapInt64Int64_.Add(other.mapInt64Int64_); + mapUint32Uint32_.Add(other.mapUint32Uint32_); + mapUint64Uint64_.Add(other.mapUint64Uint64_); + mapSint32Sint32_.Add(other.mapSint32Sint32_); + mapSint64Sint64_.Add(other.mapSint64Sint64_); + mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); + mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); + mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); + mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); + mapInt32Float_.Add(other.mapInt32Float_); + mapInt32Double_.Add(other.mapInt32Double_); + mapBoolBool_.Add(other.mapBoolBool_); + mapStringString_.Add(other.mapStringString_); + mapStringBytes_.Add(other.mapStringBytes_); + mapStringNestedMessage_.Add(other.mapStringNestedMessage_); + mapStringForeignMessage_.Add(other.mapStringForeignMessage_); + mapStringNestedEnum_.Add(other.mapStringNestedEnum_); + mapStringForeignEnum_.Add(other.mapStringForeignEnum_); if (other.HasData) { if (!HasData) { Data = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data(); } Data.MergeFrom(other.Data); } - if (other.HasDefaultInt32) { - DefaultInt32 = other.DefaultInt32; - } - if (other.HasDefaultInt64) { - DefaultInt64 = other.DefaultInt64; - } - if (other.HasDefaultUint32) { - DefaultUint32 = other.DefaultUint32; - } - if (other.HasDefaultUint64) { - DefaultUint64 = other.DefaultUint64; - } - if (other.HasDefaultSint32) { - DefaultSint32 = other.DefaultSint32; - } - if (other.HasDefaultSint64) { - DefaultSint64 = other.DefaultSint64; - } - if (other.HasDefaultFixed32) { - DefaultFixed32 = other.DefaultFixed32; - } - if (other.HasDefaultFixed64) { - DefaultFixed64 = other.DefaultFixed64; - } - if (other.HasDefaultSfixed32) { - DefaultSfixed32 = other.DefaultSfixed32; - } - if (other.HasDefaultSfixed64) { - DefaultSfixed64 = other.DefaultSfixed64; - } - if (other.HasDefaultFloat) { - DefaultFloat = other.DefaultFloat; - } - if (other.HasDefaultDouble) { - DefaultDouble = other.DefaultDouble; - } - if (other.HasDefaultBool) { - DefaultBool = other.DefaultBool; - } - if (other.HasDefaultString) { - DefaultString = other.DefaultString; - } - if (other.HasDefaultBytes) { - DefaultBytes = other.DefaultBytes; - } if (other.HasFieldname1) { Fieldname1 = other.Fieldname1; } @@ -4569,7 +3599,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5043,66 +4072,6 @@ namespace ProtobufTestMessages.Proto2 { input.ReadGroup(Data); break; } - case 1928: { - DefaultInt32 = input.ReadInt32(); - break; - } - case 1936: { - DefaultInt64 = input.ReadInt64(); - break; - } - case 1944: { - DefaultUint32 = input.ReadUInt32(); - break; - } - case 1952: { - DefaultUint64 = input.ReadUInt64(); - break; - } - case 1960: { - DefaultSint32 = input.ReadSInt32(); - break; - } - case 1968: { - DefaultSint64 = input.ReadSInt64(); - break; - } - case 1981: { - DefaultFixed32 = input.ReadFixed32(); - break; - } - case 1985: { - DefaultFixed64 = input.ReadFixed64(); - break; - } - case 1997: { - DefaultSfixed32 = input.ReadSFixed32(); - break; - } - case 2001: { - DefaultSfixed64 = input.ReadSFixed64(); - break; - } - case 2013: { - DefaultFloat = input.ReadFloat(); - break; - } - case 2017: { - DefaultDouble = input.ReadDouble(); - break; - } - case 2024: { - DefaultBool = input.ReadBool(); - break; - } - case 2034: { - DefaultString = input.ReadString(); - break; - } - case 2042: { - DefaultBytes = input.ReadBytes(); - break; - } case 3208: { Fieldname1 = input.ReadInt32(); break; @@ -5182,7 +4151,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5653,66 +4621,6 @@ namespace ProtobufTestMessages.Proto2 { input.ReadGroup(Data); break; } - case 1928: { - DefaultInt32 = input.ReadInt32(); - break; - } - case 1936: { - DefaultInt64 = input.ReadInt64(); - break; - } - case 1944: { - DefaultUint32 = input.ReadUInt32(); - break; - } - case 1952: { - DefaultUint64 = input.ReadUInt64(); - break; - } - case 1960: { - DefaultSint32 = input.ReadSInt32(); - break; - } - case 1968: { - DefaultSint64 = input.ReadSInt64(); - break; - } - case 1981: { - DefaultFixed32 = input.ReadFixed32(); - break; - } - case 1985: { - DefaultFixed64 = input.ReadFixed64(); - break; - } - case 1997: { - DefaultSfixed32 = input.ReadSFixed32(); - break; - } - case 2001: { - DefaultSfixed64 = input.ReadSFixed64(); - break; - } - case 2013: { - DefaultFloat = input.ReadFloat(); - break; - } - case 2017: { - DefaultDouble = input.ReadDouble(); - break; - } - case 2024: { - DefaultBool = input.ReadBool(); - break; - } - case 2034: { - DefaultString = input.ReadString(); - break; - } - case 2042: { - DefaultBytes = input.ReadBytes(); - break; - } case 3208: { Fieldname1 = input.ReadInt32(); break; @@ -5815,7 +4723,6 @@ namespace ProtobufTestMessages.Proto2 { #region Nested types /// Container for nested types declared in the TestAllTypesProto2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("FOO")] Foo = 0, @@ -5827,7 +4734,6 @@ namespace ProtobufTestMessages.Proto2 { [pbr::OriginalName("NEG")] Neg = -1, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5837,23 +4743,19 @@ namespace ProtobufTestMessages.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -5861,7 +4763,6 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -5870,7 +4771,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -5881,7 +4781,6 @@ namespace ProtobufTestMessages.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -5891,13 +4790,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -5906,7 +4803,6 @@ namespace ProtobufTestMessages.Proto2 { public const int CorecursiveFieldNumber = 2; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2 corecursive_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2 Corecursive { get { return corecursive_; } set { @@ -5915,13 +4811,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -5935,7 +4829,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -5947,13 +4840,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5974,7 +4865,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(8); @@ -5991,7 +4881,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -6007,7 +4896,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -6025,7 +4913,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6054,7 +4941,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6083,7 +4969,6 @@ namespace ProtobufTestMessages.Proto2 { /// /// groups /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Data : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6093,23 +4978,19 @@ namespace ProtobufTestMessages.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Data() { OnConstruction(); } @@ -6117,7 +4998,6 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Data(Data other) : this() { _hasBits0 = other._hasBits0; groupInt32_ = other.groupInt32_; @@ -6126,7 +5006,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Data Clone() { return new Data(this); } @@ -6137,7 +5016,6 @@ namespace ProtobufTestMessages.Proto2 { private int groupInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int GroupInt32 { get { if ((_hasBits0 & 1) != 0) { return groupInt32_; } else { return GroupInt32DefaultValue; } } set { @@ -6147,13 +5025,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "group_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasGroupInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "group_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearGroupInt32() { _hasBits0 &= ~1; } @@ -6164,7 +5040,6 @@ namespace ProtobufTestMessages.Proto2 { private uint groupUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint GroupUint32 { get { if ((_hasBits0 & 2) != 0) { return groupUint32_; } else { return GroupUint32DefaultValue; } } set { @@ -6174,25 +5049,21 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "group_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasGroupUint32 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "group_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearGroupUint32() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Data); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Data other) { if (ReferenceEquals(other, null)) { return false; @@ -6206,7 +5077,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasGroupInt32) hash ^= GroupInt32.GetHashCode(); @@ -6218,13 +5088,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6245,7 +5113,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasGroupInt32) { output.WriteRawTag(208, 12); @@ -6262,7 +5129,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasGroupInt32) { @@ -6278,7 +5144,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Data other) { if (other == null) { return; @@ -6293,7 +5158,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6321,7 +5185,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6349,7 +5212,6 @@ namespace ProtobufTestMessages.Proto2 { /// /// message_set test case. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MessageSetCorrect : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6360,23 +5222,19 @@ namespace ProtobufTestMessages.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[21]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrect() { OnConstruction(); } @@ -6384,26 +5242,22 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrect(MessageSetCorrect other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrect Clone() { return new MessageSetCorrect(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageSetCorrect); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageSetCorrect other) { if (ReferenceEquals(other, null)) { return false; @@ -6418,7 +5272,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -6431,13 +5284,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6453,7 +5304,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_extensions != null) { _extensions.WriteTo(ref output); @@ -6465,7 +5315,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -6478,7 +5327,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageSetCorrect other) { if (other == null) { return; @@ -6488,7 +5336,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6508,7 +5355,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6547,7 +5393,6 @@ namespace ProtobufTestMessages.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MessageSetCorrectExtension1 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6556,23 +5401,19 @@ namespace ProtobufTestMessages.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[22]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension1() { OnConstruction(); } @@ -6580,14 +5421,12 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension1(MessageSetCorrectExtension1 other) : this() { str_ = other.str_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension1 Clone() { return new MessageSetCorrectExtension1(this); } @@ -6598,7 +5437,6 @@ namespace ProtobufTestMessages.Proto2 { private string str_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Str { get { return str_ ?? StrDefaultValue; } set { @@ -6607,25 +5445,21 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "str" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStr { get { return str_ != null; } } /// Clears the value of the "str" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStr() { str_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageSetCorrectExtension1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageSetCorrectExtension1 other) { if (ReferenceEquals(other, null)) { return false; @@ -6638,7 +5472,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasStr) hash ^= Str.GetHashCode(); @@ -6649,13 +5482,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6672,7 +5503,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasStr) { output.WriteRawTag(202, 1); @@ -6685,7 +5515,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasStr) { @@ -6698,7 +5527,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageSetCorrectExtension1 other) { if (other == null) { return; @@ -6710,7 +5538,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6732,7 +5559,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6752,7 +5578,6 @@ namespace ProtobufTestMessages.Proto2 { #region Extensions /// Container for extensions for other messages declared in the MessageSetCorrectExtension1 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension MessageSetExtension = new pb::Extension(1547769, pb::FieldCodec.ForMessage(12382154, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Parser)); @@ -6761,7 +5586,6 @@ namespace ProtobufTestMessages.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MessageSetCorrectExtension2 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6771,23 +5595,19 @@ namespace ProtobufTestMessages.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension2() { OnConstruction(); } @@ -6795,7 +5615,6 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension2(MessageSetCorrectExtension2 other) : this() { _hasBits0 = other._hasBits0; i_ = other.i_; @@ -6803,7 +5622,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension2 Clone() { return new MessageSetCorrectExtension2(this); } @@ -6814,7 +5632,6 @@ namespace ProtobufTestMessages.Proto2 { private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { if ((_hasBits0 & 1) != 0) { return i_; } else { return IDefaultValue; } } set { @@ -6824,25 +5641,21 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "i" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasI { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "i" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearI() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageSetCorrectExtension2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageSetCorrectExtension2 other) { if (ReferenceEquals(other, null)) { return false; @@ -6855,7 +5668,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasI) hash ^= I.GetHashCode(); @@ -6866,13 +5678,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6889,7 +5699,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasI) { output.WriteRawTag(72); @@ -6902,7 +5711,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasI) { @@ -6915,7 +5723,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageSetCorrectExtension2 other) { if (other == null) { return; @@ -6927,7 +5734,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6949,7 +5755,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6969,7 +5774,6 @@ namespace ProtobufTestMessages.Proto2 { #region Extensions /// Container for extensions for other messages declared in the MessageSetCorrectExtension2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension MessageSetExtension = new pb::Extension(4135312, pb::FieldCodec.ForMessage(33082498, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Parser)); @@ -6983,7 +5787,6 @@ namespace ProtobufTestMessages.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ForeignMessageProto2 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6993,23 +5796,19 @@ namespace ProtobufTestMessages.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessageProto2() { OnConstruction(); } @@ -7017,7 +5816,6 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessageProto2(ForeignMessageProto2 other) : this() { _hasBits0 = other._hasBits0; c_ = other.c_; @@ -7025,7 +5823,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessageProto2 Clone() { return new ForeignMessageProto2(this); } @@ -7036,7 +5833,6 @@ namespace ProtobufTestMessages.Proto2 { private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { if ((_hasBits0 & 1) != 0) { return c_; } else { return CDefaultValue; } } set { @@ -7046,25 +5842,21 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "c" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasC { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "c" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearC() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessageProto2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessageProto2 other) { if (ReferenceEquals(other, null)) { return false; @@ -7077,7 +5869,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasC) hash ^= C.GetHashCode(); @@ -7088,13 +5879,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7111,7 +5900,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasC) { output.WriteRawTag(8); @@ -7124,7 +5912,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasC) { @@ -7137,7 +5924,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessageProto2 other) { if (other == null) { return; @@ -7149,7 +5935,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7171,7 +5956,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7190,7 +5974,6 @@ namespace ProtobufTestMessages.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class UnknownToTestAllTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7200,23 +5983,19 @@ namespace ProtobufTestMessages.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UnknownToTestAllTypes() { OnConstruction(); } @@ -7224,7 +6003,6 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UnknownToTestAllTypes(UnknownToTestAllTypes other) : this() { _hasBits0 = other._hasBits0; optionalInt32_ = other.optionalInt32_; @@ -7237,7 +6015,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UnknownToTestAllTypes Clone() { return new UnknownToTestAllTypes(this); } @@ -7248,7 +6025,6 @@ namespace ProtobufTestMessages.Proto2 { private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -7258,13 +6034,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -7275,7 +6049,6 @@ namespace ProtobufTestMessages.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -7284,13 +6057,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -7299,7 +6070,6 @@ namespace ProtobufTestMessages.Proto2 { public const int NestedMessageFieldNumber = 1003; private global::ProtobufTestMessages.Proto2.ForeignMessageProto2 nestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.ForeignMessageProto2 NestedMessage { get { return nestedMessage_; } set { @@ -7311,7 +6081,6 @@ namespace ProtobufTestMessages.Proto2 { public const int OptionalGroupFieldNumber = 1004; private global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -7320,13 +6089,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -7337,7 +6104,6 @@ namespace ProtobufTestMessages.Proto2 { private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { if ((_hasBits0 & 2) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } } set { @@ -7347,13 +6113,11 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBool { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "optional_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBool() { _hasBits0 &= ~2; } @@ -7364,19 +6128,16 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt32(8088); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as UnknownToTestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(UnknownToTestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -7394,7 +6155,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -7410,13 +6170,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7451,7 +6209,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasOptionalInt32) { output.WriteRawTag(200, 62); @@ -7482,7 +6239,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -7508,7 +6264,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(UnknownToTestAllTypes other) { if (other == null) { return; @@ -7539,7 +6294,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7588,7 +6342,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7635,9 +6388,7 @@ namespace ProtobufTestMessages.Proto2 { #region Nested types /// Container for nested types declared in the UnknownToTestAllTypes message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OptionalGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7647,23 +6398,19 @@ namespace ProtobufTestMessages.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -7671,7 +6418,6 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -7679,7 +6425,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -7690,7 +6435,6 @@ namespace ProtobufTestMessages.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -7700,25 +6444,21 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -7731,7 +6471,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -7742,13 +6481,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7765,7 +6502,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(8); @@ -7778,7 +6514,6 @@ namespace ProtobufTestMessages.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -7791,7 +6526,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -7803,7 +6537,6 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7827,7 +6560,6 @@ namespace ProtobufTestMessages.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7853,4240 +6585,6 @@ namespace ProtobufTestMessages.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class NullHypothesisProto2 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NullHypothesisProto2()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NullHypothesisProto2() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NullHypothesisProto2(NullHypothesisProto2 other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NullHypothesisProto2 Clone() { - return new NullHypothesisProto2(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as NullHypothesisProto2); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(NullHypothesisProto2 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(NullHypothesisProto2 other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumOnlyProto2 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumOnlyProto2()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOnlyProto2() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOnlyProto2(EnumOnlyProto2 other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOnlyProto2 Clone() { - return new EnumOnlyProto2(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumOnlyProto2); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumOnlyProto2 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumOnlyProto2 other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the EnumOnlyProto2 message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum Bool { - [pbr::OriginalName("kFalse")] KFalse = 0, - [pbr::OriginalName("kTrue")] KTrue = 1, - } - - } - #endregion - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class OneStringProto2 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneStringProto2()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneStringProto2() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneStringProto2(OneStringProto2 other) : this() { - data_ = other.data_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneStringProto2 Clone() { - return new OneStringProto2(this); - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 1; - private readonly static string DataDefaultValue = ""; - - private string data_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Data { - get { return data_ ?? DataDefaultValue; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "data" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasData { - get { return data_ != null; } - } - /// Clears the value of the "data" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearData() { - data_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OneStringProto2); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OneStringProto2 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Data != other.Data) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasData) hash ^= Data.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasData) { - output.WriteRawTag(10); - output.WriteString(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasData) { - output.WriteRawTag(10); - output.WriteString(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasData) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Data); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OneStringProto2 other) { - if (other == null) { - return; - } - if (other.HasData) { - Data = other.Data; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Data = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Data = input.ReadString(); - break; - } - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ProtoWithKeywords : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ProtoWithKeywords()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ProtoWithKeywords() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ProtoWithKeywords(ProtoWithKeywords other) : this() { - _hasBits0 = other._hasBits0; - inline_ = other.inline_; - concept_ = other.concept_; - requires_ = other.requires_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ProtoWithKeywords Clone() { - return new ProtoWithKeywords(this); - } - - /// Field number for the "inline" field. - public const int InlineFieldNumber = 1; - private readonly static int InlineDefaultValue = 0; - - private int inline_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Inline { - get { if ((_hasBits0 & 1) != 0) { return inline_; } else { return InlineDefaultValue; } } - set { - _hasBits0 |= 1; - inline_ = value; - } - } - /// Gets whether the "inline" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasInline { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "inline" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearInline() { - _hasBits0 &= ~1; - } - - /// Field number for the "concept" field. - public const int ConceptFieldNumber = 2; - private readonly static string ConceptDefaultValue = ""; - - private string concept_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Concept { - get { return concept_ ?? ConceptDefaultValue; } - set { - concept_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "concept" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasConcept { - get { return concept_ != null; } - } - /// Clears the value of the "concept" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearConcept() { - concept_ = null; - } - - /// Field number for the "requires" field. - public const int RequiresFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_requires_codec - = pb::FieldCodec.ForString(26); - private readonly pbc::RepeatedField requires_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Requires { - get { return requires_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ProtoWithKeywords); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ProtoWithKeywords other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Inline != other.Inline) return false; - if (Concept != other.Concept) return false; - if(!requires_.Equals(other.requires_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasInline) hash ^= Inline.GetHashCode(); - if (HasConcept) hash ^= Concept.GetHashCode(); - hash ^= requires_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasInline) { - output.WriteRawTag(8); - output.WriteInt32(Inline); - } - if (HasConcept) { - output.WriteRawTag(18); - output.WriteString(Concept); - } - requires_.WriteTo(output, _repeated_requires_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasInline) { - output.WriteRawTag(8); - output.WriteInt32(Inline); - } - if (HasConcept) { - output.WriteRawTag(18); - output.WriteString(Concept); - } - requires_.WriteTo(ref output, _repeated_requires_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasInline) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Inline); - } - if (HasConcept) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Concept); - } - size += requires_.CalculateSize(_repeated_requires_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ProtoWithKeywords other) { - if (other == null) { - return; - } - if (other.HasInline) { - Inline = other.Inline; - } - if (other.HasConcept) { - Concept = other.Concept; - } - requires_.Add(other.requires_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Inline = input.ReadInt32(); - break; - } - case 18: { - Concept = input.ReadString(); - break; - } - case 26: { - requires_.AddEntriesFrom(input, _repeated_requires_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Inline = input.ReadInt32(); - break; - } - case 18: { - Concept = input.ReadString(); - break; - } - case 26: { - requires_.AddEntriesFrom(ref input, _repeated_requires_codec); - break; - } - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class TestAllRequiredTypesProto2 : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllRequiredTypesProto2()); - private pb::UnknownFieldSet _unknownFields; - private pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TestAllRequiredTypesProto2() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TestAllRequiredTypesProto2(TestAllRequiredTypesProto2 other) : this() { - _hasBits0 = other._hasBits0; - requiredInt32_ = other.requiredInt32_; - requiredInt64_ = other.requiredInt64_; - requiredUint32_ = other.requiredUint32_; - requiredUint64_ = other.requiredUint64_; - requiredSint32_ = other.requiredSint32_; - requiredSint64_ = other.requiredSint64_; - requiredFixed32_ = other.requiredFixed32_; - requiredFixed64_ = other.requiredFixed64_; - requiredSfixed32_ = other.requiredSfixed32_; - requiredSfixed64_ = other.requiredSfixed64_; - requiredFloat_ = other.requiredFloat_; - requiredDouble_ = other.requiredDouble_; - requiredBool_ = other.requiredBool_; - requiredString_ = other.requiredString_; - requiredBytes_ = other.requiredBytes_; - requiredNestedMessage_ = other.requiredNestedMessage_ != null ? other.requiredNestedMessage_.Clone() : null; - requiredForeignMessage_ = other.requiredForeignMessage_ != null ? other.requiredForeignMessage_.Clone() : null; - requiredNestedEnum_ = other.requiredNestedEnum_; - requiredForeignEnum_ = other.requiredForeignEnum_; - requiredStringPiece_ = other.requiredStringPiece_; - requiredCord_ = other.requiredCord_; - recursiveMessage_ = other.recursiveMessage_ != null ? other.recursiveMessage_.Clone() : null; - optionalRecursiveMessage_ = other.optionalRecursiveMessage_ != null ? other.optionalRecursiveMessage_.Clone() : null; - data_ = other.HasData ? other.data_.Clone() : null; - defaultInt32_ = other.defaultInt32_; - defaultInt64_ = other.defaultInt64_; - defaultUint32_ = other.defaultUint32_; - defaultUint64_ = other.defaultUint64_; - defaultSint32_ = other.defaultSint32_; - defaultSint64_ = other.defaultSint64_; - defaultFixed32_ = other.defaultFixed32_; - defaultFixed64_ = other.defaultFixed64_; - defaultSfixed32_ = other.defaultSfixed32_; - defaultSfixed64_ = other.defaultSfixed64_; - defaultFloat_ = other.defaultFloat_; - defaultDouble_ = other.defaultDouble_; - defaultBool_ = other.defaultBool_; - defaultString_ = other.defaultString_; - defaultBytes_ = other.defaultBytes_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TestAllRequiredTypesProto2 Clone() { - return new TestAllRequiredTypesProto2(this); - } - - /// Field number for the "required_int32" field. - public const int RequiredInt32FieldNumber = 1; - private readonly static int RequiredInt32DefaultValue = 0; - - private int requiredInt32_; - /// - /// Singular - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int RequiredInt32 { - get { if ((_hasBits0 & 1) != 0) { return requiredInt32_; } else { return RequiredInt32DefaultValue; } } - set { - _hasBits0 |= 1; - requiredInt32_ = value; - } - } - /// Gets whether the "required_int32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredInt32 { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "required_int32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredInt32() { - _hasBits0 &= ~1; - } - - /// Field number for the "required_int64" field. - public const int RequiredInt64FieldNumber = 2; - private readonly static long RequiredInt64DefaultValue = 0L; - - private long requiredInt64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RequiredInt64 { - get { if ((_hasBits0 & 2) != 0) { return requiredInt64_; } else { return RequiredInt64DefaultValue; } } - set { - _hasBits0 |= 2; - requiredInt64_ = value; - } - } - /// Gets whether the "required_int64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredInt64 { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "required_int64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredInt64() { - _hasBits0 &= ~2; - } - - /// Field number for the "required_uint32" field. - public const int RequiredUint32FieldNumber = 3; - private readonly static uint RequiredUint32DefaultValue = 0; - - private uint requiredUint32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint RequiredUint32 { - get { if ((_hasBits0 & 4) != 0) { return requiredUint32_; } else { return RequiredUint32DefaultValue; } } - set { - _hasBits0 |= 4; - requiredUint32_ = value; - } - } - /// Gets whether the "required_uint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredUint32 { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "required_uint32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredUint32() { - _hasBits0 &= ~4; - } - - /// Field number for the "required_uint64" field. - public const int RequiredUint64FieldNumber = 4; - private readonly static ulong RequiredUint64DefaultValue = 0UL; - - private ulong requiredUint64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong RequiredUint64 { - get { if ((_hasBits0 & 8) != 0) { return requiredUint64_; } else { return RequiredUint64DefaultValue; } } - set { - _hasBits0 |= 8; - requiredUint64_ = value; - } - } - /// Gets whether the "required_uint64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredUint64 { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "required_uint64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredUint64() { - _hasBits0 &= ~8; - } - - /// Field number for the "required_sint32" field. - public const int RequiredSint32FieldNumber = 5; - private readonly static int RequiredSint32DefaultValue = 0; - - private int requiredSint32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int RequiredSint32 { - get { if ((_hasBits0 & 16) != 0) { return requiredSint32_; } else { return RequiredSint32DefaultValue; } } - set { - _hasBits0 |= 16; - requiredSint32_ = value; - } - } - /// Gets whether the "required_sint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredSint32 { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "required_sint32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredSint32() { - _hasBits0 &= ~16; - } - - /// Field number for the "required_sint64" field. - public const int RequiredSint64FieldNumber = 6; - private readonly static long RequiredSint64DefaultValue = 0L; - - private long requiredSint64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RequiredSint64 { - get { if ((_hasBits0 & 32) != 0) { return requiredSint64_; } else { return RequiredSint64DefaultValue; } } - set { - _hasBits0 |= 32; - requiredSint64_ = value; - } - } - /// Gets whether the "required_sint64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredSint64 { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "required_sint64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredSint64() { - _hasBits0 &= ~32; - } - - /// Field number for the "required_fixed32" field. - public const int RequiredFixed32FieldNumber = 7; - private readonly static uint RequiredFixed32DefaultValue = 0; - - private uint requiredFixed32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint RequiredFixed32 { - get { if ((_hasBits0 & 64) != 0) { return requiredFixed32_; } else { return RequiredFixed32DefaultValue; } } - set { - _hasBits0 |= 64; - requiredFixed32_ = value; - } - } - /// Gets whether the "required_fixed32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredFixed32 { - get { return (_hasBits0 & 64) != 0; } - } - /// Clears the value of the "required_fixed32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredFixed32() { - _hasBits0 &= ~64; - } - - /// Field number for the "required_fixed64" field. - public const int RequiredFixed64FieldNumber = 8; - private readonly static ulong RequiredFixed64DefaultValue = 0UL; - - private ulong requiredFixed64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong RequiredFixed64 { - get { if ((_hasBits0 & 128) != 0) { return requiredFixed64_; } else { return RequiredFixed64DefaultValue; } } - set { - _hasBits0 |= 128; - requiredFixed64_ = value; - } - } - /// Gets whether the "required_fixed64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredFixed64 { - get { return (_hasBits0 & 128) != 0; } - } - /// Clears the value of the "required_fixed64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredFixed64() { - _hasBits0 &= ~128; - } - - /// Field number for the "required_sfixed32" field. - public const int RequiredSfixed32FieldNumber = 9; - private readonly static int RequiredSfixed32DefaultValue = 0; - - private int requiredSfixed32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int RequiredSfixed32 { - get { if ((_hasBits0 & 256) != 0) { return requiredSfixed32_; } else { return RequiredSfixed32DefaultValue; } } - set { - _hasBits0 |= 256; - requiredSfixed32_ = value; - } - } - /// Gets whether the "required_sfixed32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredSfixed32 { - get { return (_hasBits0 & 256) != 0; } - } - /// Clears the value of the "required_sfixed32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredSfixed32() { - _hasBits0 &= ~256; - } - - /// Field number for the "required_sfixed64" field. - public const int RequiredSfixed64FieldNumber = 10; - private readonly static long RequiredSfixed64DefaultValue = 0L; - - private long requiredSfixed64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long RequiredSfixed64 { - get { if ((_hasBits0 & 512) != 0) { return requiredSfixed64_; } else { return RequiredSfixed64DefaultValue; } } - set { - _hasBits0 |= 512; - requiredSfixed64_ = value; - } - } - /// Gets whether the "required_sfixed64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredSfixed64 { - get { return (_hasBits0 & 512) != 0; } - } - /// Clears the value of the "required_sfixed64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredSfixed64() { - _hasBits0 &= ~512; - } - - /// Field number for the "required_float" field. - public const int RequiredFloatFieldNumber = 11; - private readonly static float RequiredFloatDefaultValue = 0F; - - private float requiredFloat_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float RequiredFloat { - get { if ((_hasBits0 & 1024) != 0) { return requiredFloat_; } else { return RequiredFloatDefaultValue; } } - set { - _hasBits0 |= 1024; - requiredFloat_ = value; - } - } - /// Gets whether the "required_float" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredFloat { - get { return (_hasBits0 & 1024) != 0; } - } - /// Clears the value of the "required_float" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredFloat() { - _hasBits0 &= ~1024; - } - - /// Field number for the "required_double" field. - public const int RequiredDoubleFieldNumber = 12; - private readonly static double RequiredDoubleDefaultValue = 0D; - - private double requiredDouble_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double RequiredDouble { - get { if ((_hasBits0 & 2048) != 0) { return requiredDouble_; } else { return RequiredDoubleDefaultValue; } } - set { - _hasBits0 |= 2048; - requiredDouble_ = value; - } - } - /// Gets whether the "required_double" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredDouble { - get { return (_hasBits0 & 2048) != 0; } - } - /// Clears the value of the "required_double" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredDouble() { - _hasBits0 &= ~2048; - } - - /// Field number for the "required_bool" field. - public const int RequiredBoolFieldNumber = 13; - private readonly static bool RequiredBoolDefaultValue = false; - - private bool requiredBool_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool RequiredBool { - get { if ((_hasBits0 & 4096) != 0) { return requiredBool_; } else { return RequiredBoolDefaultValue; } } - set { - _hasBits0 |= 4096; - requiredBool_ = value; - } - } - /// Gets whether the "required_bool" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredBool { - get { return (_hasBits0 & 4096) != 0; } - } - /// Clears the value of the "required_bool" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredBool() { - _hasBits0 &= ~4096; - } - - /// Field number for the "required_string" field. - public const int RequiredStringFieldNumber = 14; - private readonly static string RequiredStringDefaultValue = ""; - - private string requiredString_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string RequiredString { - get { return requiredString_ ?? RequiredStringDefaultValue; } - set { - requiredString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "required_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredString { - get { return requiredString_ != null; } - } - /// Clears the value of the "required_string" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredString() { - requiredString_ = null; - } - - /// Field number for the "required_bytes" field. - public const int RequiredBytesFieldNumber = 15; - private readonly static pb::ByteString RequiredBytesDefaultValue = pb::ByteString.Empty; - - private pb::ByteString requiredBytes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString RequiredBytes { - get { return requiredBytes_ ?? RequiredBytesDefaultValue; } - set { - requiredBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "required_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredBytes { - get { return requiredBytes_ != null; } - } - /// Clears the value of the "required_bytes" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredBytes() { - requiredBytes_ = null; - } - - /// Field number for the "required_nested_message" field. - public const int RequiredNestedMessageFieldNumber = 18; - private global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedMessage requiredNestedMessage_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedMessage RequiredNestedMessage { - get { return requiredNestedMessage_; } - set { - requiredNestedMessage_ = value; - } - } - - /// Field number for the "required_foreign_message" field. - public const int RequiredForeignMessageFieldNumber = 19; - private global::ProtobufTestMessages.Proto2.ForeignMessageProto2 requiredForeignMessage_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.ForeignMessageProto2 RequiredForeignMessage { - get { return requiredForeignMessage_; } - set { - requiredForeignMessage_ = value; - } - } - - /// Field number for the "required_nested_enum" field. - public const int RequiredNestedEnumFieldNumber = 21; - private readonly static global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedEnum RequiredNestedEnumDefaultValue = global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedEnum.Foo; - - private global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedEnum requiredNestedEnum_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedEnum RequiredNestedEnum { - get { if ((_hasBits0 & 8192) != 0) { return requiredNestedEnum_; } else { return RequiredNestedEnumDefaultValue; } } - set { - _hasBits0 |= 8192; - requiredNestedEnum_ = value; - } - } - /// Gets whether the "required_nested_enum" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredNestedEnum { - get { return (_hasBits0 & 8192) != 0; } - } - /// Clears the value of the "required_nested_enum" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredNestedEnum() { - _hasBits0 &= ~8192; - } - - /// Field number for the "required_foreign_enum" field. - public const int RequiredForeignEnumFieldNumber = 22; - private readonly static global::ProtobufTestMessages.Proto2.ForeignEnumProto2 RequiredForeignEnumDefaultValue = global::ProtobufTestMessages.Proto2.ForeignEnumProto2.ForeignFoo; - - private global::ProtobufTestMessages.Proto2.ForeignEnumProto2 requiredForeignEnum_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.ForeignEnumProto2 RequiredForeignEnum { - get { if ((_hasBits0 & 16384) != 0) { return requiredForeignEnum_; } else { return RequiredForeignEnumDefaultValue; } } - set { - _hasBits0 |= 16384; - requiredForeignEnum_ = value; - } - } - /// Gets whether the "required_foreign_enum" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredForeignEnum { - get { return (_hasBits0 & 16384) != 0; } - } - /// Clears the value of the "required_foreign_enum" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredForeignEnum() { - _hasBits0 &= ~16384; - } - - /// Field number for the "required_string_piece" field. - public const int RequiredStringPieceFieldNumber = 24; - private readonly static string RequiredStringPieceDefaultValue = ""; - - private string requiredStringPiece_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string RequiredStringPiece { - get { return requiredStringPiece_ ?? RequiredStringPieceDefaultValue; } - set { - requiredStringPiece_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "required_string_piece" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredStringPiece { - get { return requiredStringPiece_ != null; } - } - /// Clears the value of the "required_string_piece" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredStringPiece() { - requiredStringPiece_ = null; - } - - /// Field number for the "required_cord" field. - public const int RequiredCordFieldNumber = 25; - private readonly static string RequiredCordDefaultValue = ""; - - private string requiredCord_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string RequiredCord { - get { return requiredCord_ ?? RequiredCordDefaultValue; } - set { - requiredCord_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "required_cord" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRequiredCord { - get { return requiredCord_ != null; } - } - /// Clears the value of the "required_cord" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRequiredCord() { - requiredCord_ = null; - } - - /// Field number for the "recursive_message" field. - public const int RecursiveMessageFieldNumber = 27; - private global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 recursiveMessage_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 RecursiveMessage { - get { return recursiveMessage_; } - set { - recursiveMessage_ = value; - } - } - - /// Field number for the "optional_recursive_message" field. - public const int OptionalRecursiveMessageFieldNumber = 28; - private global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 optionalRecursiveMessage_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 OptionalRecursiveMessage { - get { return optionalRecursiveMessage_; } - set { - optionalRecursiveMessage_ = value; - } - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 201; - private global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.Data data_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.Data Data { - get { return data_; } - set { - data_ = value; - } - } - /// Gets whether the data field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasData { - get { return data_ != null; } - } - /// Clears the value of the data field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearData() { - data_ = null; - } - - /// Field number for the "default_int32" field. - public const int DefaultInt32FieldNumber = 241; - private readonly static int DefaultInt32DefaultValue = -123456789; - - private int defaultInt32_; - /// - /// default values - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int DefaultInt32 { - get { if ((_hasBits0 & 32768) != 0) { return defaultInt32_; } else { return DefaultInt32DefaultValue; } } - set { - _hasBits0 |= 32768; - defaultInt32_ = value; - } - } - /// Gets whether the "default_int32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultInt32 { - get { return (_hasBits0 & 32768) != 0; } - } - /// Clears the value of the "default_int32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultInt32() { - _hasBits0 &= ~32768; - } - - /// Field number for the "default_int64" field. - public const int DefaultInt64FieldNumber = 242; - private readonly static long DefaultInt64DefaultValue = -9123456789123456789L; - - private long defaultInt64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long DefaultInt64 { - get { if ((_hasBits0 & 65536) != 0) { return defaultInt64_; } else { return DefaultInt64DefaultValue; } } - set { - _hasBits0 |= 65536; - defaultInt64_ = value; - } - } - /// Gets whether the "default_int64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultInt64 { - get { return (_hasBits0 & 65536) != 0; } - } - /// Clears the value of the "default_int64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultInt64() { - _hasBits0 &= ~65536; - } - - /// Field number for the "default_uint32" field. - public const int DefaultUint32FieldNumber = 243; - private readonly static uint DefaultUint32DefaultValue = 2123456789; - - private uint defaultUint32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint DefaultUint32 { - get { if ((_hasBits0 & 131072) != 0) { return defaultUint32_; } else { return DefaultUint32DefaultValue; } } - set { - _hasBits0 |= 131072; - defaultUint32_ = value; - } - } - /// Gets whether the "default_uint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultUint32 { - get { return (_hasBits0 & 131072) != 0; } - } - /// Clears the value of the "default_uint32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultUint32() { - _hasBits0 &= ~131072; - } - - /// Field number for the "default_uint64" field. - public const int DefaultUint64FieldNumber = 244; - private readonly static ulong DefaultUint64DefaultValue = 10123456789123456789UL; - - private ulong defaultUint64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong DefaultUint64 { - get { if ((_hasBits0 & 262144) != 0) { return defaultUint64_; } else { return DefaultUint64DefaultValue; } } - set { - _hasBits0 |= 262144; - defaultUint64_ = value; - } - } - /// Gets whether the "default_uint64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultUint64 { - get { return (_hasBits0 & 262144) != 0; } - } - /// Clears the value of the "default_uint64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultUint64() { - _hasBits0 &= ~262144; - } - - /// Field number for the "default_sint32" field. - public const int DefaultSint32FieldNumber = 245; - private readonly static int DefaultSint32DefaultValue = -123456789; - - private int defaultSint32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int DefaultSint32 { - get { if ((_hasBits0 & 524288) != 0) { return defaultSint32_; } else { return DefaultSint32DefaultValue; } } - set { - _hasBits0 |= 524288; - defaultSint32_ = value; - } - } - /// Gets whether the "default_sint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSint32 { - get { return (_hasBits0 & 524288) != 0; } - } - /// Clears the value of the "default_sint32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSint32() { - _hasBits0 &= ~524288; - } - - /// Field number for the "default_sint64" field. - public const int DefaultSint64FieldNumber = 246; - private readonly static long DefaultSint64DefaultValue = -9123456789123456789L; - - private long defaultSint64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long DefaultSint64 { - get { if ((_hasBits0 & 1048576) != 0) { return defaultSint64_; } else { return DefaultSint64DefaultValue; } } - set { - _hasBits0 |= 1048576; - defaultSint64_ = value; - } - } - /// Gets whether the "default_sint64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSint64 { - get { return (_hasBits0 & 1048576) != 0; } - } - /// Clears the value of the "default_sint64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSint64() { - _hasBits0 &= ~1048576; - } - - /// Field number for the "default_fixed32" field. - public const int DefaultFixed32FieldNumber = 247; - private readonly static uint DefaultFixed32DefaultValue = 2123456789; - - private uint defaultFixed32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint DefaultFixed32 { - get { if ((_hasBits0 & 2097152) != 0) { return defaultFixed32_; } else { return DefaultFixed32DefaultValue; } } - set { - _hasBits0 |= 2097152; - defaultFixed32_ = value; - } - } - /// Gets whether the "default_fixed32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultFixed32 { - get { return (_hasBits0 & 2097152) != 0; } - } - /// Clears the value of the "default_fixed32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultFixed32() { - _hasBits0 &= ~2097152; - } - - /// Field number for the "default_fixed64" field. - public const int DefaultFixed64FieldNumber = 248; - private readonly static ulong DefaultFixed64DefaultValue = 10123456789123456789UL; - - private ulong defaultFixed64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong DefaultFixed64 { - get { if ((_hasBits0 & 4194304) != 0) { return defaultFixed64_; } else { return DefaultFixed64DefaultValue; } } - set { - _hasBits0 |= 4194304; - defaultFixed64_ = value; - } - } - /// Gets whether the "default_fixed64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultFixed64 { - get { return (_hasBits0 & 4194304) != 0; } - } - /// Clears the value of the "default_fixed64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultFixed64() { - _hasBits0 &= ~4194304; - } - - /// Field number for the "default_sfixed32" field. - public const int DefaultSfixed32FieldNumber = 249; - private readonly static int DefaultSfixed32DefaultValue = -123456789; - - private int defaultSfixed32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int DefaultSfixed32 { - get { if ((_hasBits0 & 8388608) != 0) { return defaultSfixed32_; } else { return DefaultSfixed32DefaultValue; } } - set { - _hasBits0 |= 8388608; - defaultSfixed32_ = value; - } - } - /// Gets whether the "default_sfixed32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSfixed32 { - get { return (_hasBits0 & 8388608) != 0; } - } - /// Clears the value of the "default_sfixed32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSfixed32() { - _hasBits0 &= ~8388608; - } - - /// Field number for the "default_sfixed64" field. - public const int DefaultSfixed64FieldNumber = 250; - private readonly static long DefaultSfixed64DefaultValue = -9123456789123456789L; - - private long defaultSfixed64_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long DefaultSfixed64 { - get { if ((_hasBits0 & 16777216) != 0) { return defaultSfixed64_; } else { return DefaultSfixed64DefaultValue; } } - set { - _hasBits0 |= 16777216; - defaultSfixed64_ = value; - } - } - /// Gets whether the "default_sfixed64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultSfixed64 { - get { return (_hasBits0 & 16777216) != 0; } - } - /// Clears the value of the "default_sfixed64" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultSfixed64() { - _hasBits0 &= ~16777216; - } - - /// Field number for the "default_float" field. - public const int DefaultFloatFieldNumber = 251; - private readonly static float DefaultFloatDefaultValue = 9e+09F; - - private float defaultFloat_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float DefaultFloat { - get { if ((_hasBits0 & 33554432) != 0) { return defaultFloat_; } else { return DefaultFloatDefaultValue; } } - set { - _hasBits0 |= 33554432; - defaultFloat_ = value; - } - } - /// Gets whether the "default_float" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultFloat { - get { return (_hasBits0 & 33554432) != 0; } - } - /// Clears the value of the "default_float" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultFloat() { - _hasBits0 &= ~33554432; - } - - /// Field number for the "default_double" field. - public const int DefaultDoubleFieldNumber = 252; - private readonly static double DefaultDoubleDefaultValue = 7e+22D; - - private double defaultDouble_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double DefaultDouble { - get { if ((_hasBits0 & 67108864) != 0) { return defaultDouble_; } else { return DefaultDoubleDefaultValue; } } - set { - _hasBits0 |= 67108864; - defaultDouble_ = value; - } - } - /// Gets whether the "default_double" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultDouble { - get { return (_hasBits0 & 67108864) != 0; } - } - /// Clears the value of the "default_double" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultDouble() { - _hasBits0 &= ~67108864; - } - - /// Field number for the "default_bool" field. - public const int DefaultBoolFieldNumber = 253; - private readonly static bool DefaultBoolDefaultValue = true; - - private bool defaultBool_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool DefaultBool { - get { if ((_hasBits0 & 134217728) != 0) { return defaultBool_; } else { return DefaultBoolDefaultValue; } } - set { - _hasBits0 |= 134217728; - defaultBool_ = value; - } - } - /// Gets whether the "default_bool" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultBool { - get { return (_hasBits0 & 134217728) != 0; } - } - /// Clears the value of the "default_bool" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultBool() { - _hasBits0 &= ~134217728; - } - - /// Field number for the "default_string" field. - public const int DefaultStringFieldNumber = 254; - private readonly static string DefaultStringDefaultValue = global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("Um9zZWJ1ZA=="), 0, 7); - - private string defaultString_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string DefaultString { - get { return defaultString_ ?? DefaultStringDefaultValue; } - set { - defaultString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "default_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultString { - get { return defaultString_ != null; } - } - /// Clears the value of the "default_string" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultString() { - defaultString_ = null; - } - - /// Field number for the "default_bytes" field. - public const int DefaultBytesFieldNumber = 255; - private readonly static pb::ByteString DefaultBytesDefaultValue = pb::ByteString.FromBase64("am9zaHVh"); - - private pb::ByteString defaultBytes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString DefaultBytes { - get { return defaultBytes_ ?? DefaultBytesDefaultValue; } - set { - defaultBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "default_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultBytes { - get { return defaultBytes_ != null; } - } - /// Clears the value of the "default_bytes" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultBytes() { - defaultBytes_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as TestAllRequiredTypesProto2); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(TestAllRequiredTypesProto2 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (RequiredInt32 != other.RequiredInt32) return false; - if (RequiredInt64 != other.RequiredInt64) return false; - if (RequiredUint32 != other.RequiredUint32) return false; - if (RequiredUint64 != other.RequiredUint64) return false; - if (RequiredSint32 != other.RequiredSint32) return false; - if (RequiredSint64 != other.RequiredSint64) return false; - if (RequiredFixed32 != other.RequiredFixed32) return false; - if (RequiredFixed64 != other.RequiredFixed64) return false; - if (RequiredSfixed32 != other.RequiredSfixed32) return false; - if (RequiredSfixed64 != other.RequiredSfixed64) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RequiredFloat, other.RequiredFloat)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(RequiredDouble, other.RequiredDouble)) return false; - if (RequiredBool != other.RequiredBool) return false; - if (RequiredString != other.RequiredString) return false; - if (RequiredBytes != other.RequiredBytes) return false; - if (!object.Equals(RequiredNestedMessage, other.RequiredNestedMessage)) return false; - if (!object.Equals(RequiredForeignMessage, other.RequiredForeignMessage)) return false; - if (RequiredNestedEnum != other.RequiredNestedEnum) return false; - if (RequiredForeignEnum != other.RequiredForeignEnum) return false; - if (RequiredStringPiece != other.RequiredStringPiece) return false; - if (RequiredCord != other.RequiredCord) return false; - if (!object.Equals(RecursiveMessage, other.RecursiveMessage)) return false; - if (!object.Equals(OptionalRecursiveMessage, other.OptionalRecursiveMessage)) return false; - if (!object.Equals(Data, other.Data)) return false; - if (DefaultInt32 != other.DefaultInt32) return false; - if (DefaultInt64 != other.DefaultInt64) return false; - if (DefaultUint32 != other.DefaultUint32) return false; - if (DefaultUint64 != other.DefaultUint64) return false; - if (DefaultSint32 != other.DefaultSint32) return false; - if (DefaultSint64 != other.DefaultSint64) return false; - if (DefaultFixed32 != other.DefaultFixed32) return false; - if (DefaultFixed64 != other.DefaultFixed64) return false; - if (DefaultSfixed32 != other.DefaultSfixed32) return false; - if (DefaultSfixed64 != other.DefaultSfixed64) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DefaultFloat, other.DefaultFloat)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DefaultDouble, other.DefaultDouble)) return false; - if (DefaultBool != other.DefaultBool) return false; - if (DefaultString != other.DefaultString) return false; - if (DefaultBytes != other.DefaultBytes) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasRequiredInt32) hash ^= RequiredInt32.GetHashCode(); - if (HasRequiredInt64) hash ^= RequiredInt64.GetHashCode(); - if (HasRequiredUint32) hash ^= RequiredUint32.GetHashCode(); - if (HasRequiredUint64) hash ^= RequiredUint64.GetHashCode(); - if (HasRequiredSint32) hash ^= RequiredSint32.GetHashCode(); - if (HasRequiredSint64) hash ^= RequiredSint64.GetHashCode(); - if (HasRequiredFixed32) hash ^= RequiredFixed32.GetHashCode(); - if (HasRequiredFixed64) hash ^= RequiredFixed64.GetHashCode(); - if (HasRequiredSfixed32) hash ^= RequiredSfixed32.GetHashCode(); - if (HasRequiredSfixed64) hash ^= RequiredSfixed64.GetHashCode(); - if (HasRequiredFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RequiredFloat); - if (HasRequiredDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(RequiredDouble); - if (HasRequiredBool) hash ^= RequiredBool.GetHashCode(); - if (HasRequiredString) hash ^= RequiredString.GetHashCode(); - if (HasRequiredBytes) hash ^= RequiredBytes.GetHashCode(); - if (requiredNestedMessage_ != null) hash ^= RequiredNestedMessage.GetHashCode(); - if (requiredForeignMessage_ != null) hash ^= RequiredForeignMessage.GetHashCode(); - if (HasRequiredNestedEnum) hash ^= RequiredNestedEnum.GetHashCode(); - if (HasRequiredForeignEnum) hash ^= RequiredForeignEnum.GetHashCode(); - if (HasRequiredStringPiece) hash ^= RequiredStringPiece.GetHashCode(); - if (HasRequiredCord) hash ^= RequiredCord.GetHashCode(); - if (recursiveMessage_ != null) hash ^= RecursiveMessage.GetHashCode(); - if (optionalRecursiveMessage_ != null) hash ^= OptionalRecursiveMessage.GetHashCode(); - if (HasData) hash ^= Data.GetHashCode(); - if (HasDefaultInt32) hash ^= DefaultInt32.GetHashCode(); - if (HasDefaultInt64) hash ^= DefaultInt64.GetHashCode(); - if (HasDefaultUint32) hash ^= DefaultUint32.GetHashCode(); - if (HasDefaultUint64) hash ^= DefaultUint64.GetHashCode(); - if (HasDefaultSint32) hash ^= DefaultSint32.GetHashCode(); - if (HasDefaultSint64) hash ^= DefaultSint64.GetHashCode(); - if (HasDefaultFixed32) hash ^= DefaultFixed32.GetHashCode(); - if (HasDefaultFixed64) hash ^= DefaultFixed64.GetHashCode(); - if (HasDefaultSfixed32) hash ^= DefaultSfixed32.GetHashCode(); - if (HasDefaultSfixed64) hash ^= DefaultSfixed64.GetHashCode(); - if (HasDefaultFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DefaultFloat); - if (HasDefaultDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DefaultDouble); - if (HasDefaultBool) hash ^= DefaultBool.GetHashCode(); - if (HasDefaultString) hash ^= DefaultString.GetHashCode(); - if (HasDefaultBytes) hash ^= DefaultBytes.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasRequiredInt32) { - output.WriteRawTag(8); - output.WriteInt32(RequiredInt32); - } - if (HasRequiredInt64) { - output.WriteRawTag(16); - output.WriteInt64(RequiredInt64); - } - if (HasRequiredUint32) { - output.WriteRawTag(24); - output.WriteUInt32(RequiredUint32); - } - if (HasRequiredUint64) { - output.WriteRawTag(32); - output.WriteUInt64(RequiredUint64); - } - if (HasRequiredSint32) { - output.WriteRawTag(40); - output.WriteSInt32(RequiredSint32); - } - if (HasRequiredSint64) { - output.WriteRawTag(48); - output.WriteSInt64(RequiredSint64); - } - if (HasRequiredFixed32) { - output.WriteRawTag(61); - output.WriteFixed32(RequiredFixed32); - } - if (HasRequiredFixed64) { - output.WriteRawTag(65); - output.WriteFixed64(RequiredFixed64); - } - if (HasRequiredSfixed32) { - output.WriteRawTag(77); - output.WriteSFixed32(RequiredSfixed32); - } - if (HasRequiredSfixed64) { - output.WriteRawTag(81); - output.WriteSFixed64(RequiredSfixed64); - } - if (HasRequiredFloat) { - output.WriteRawTag(93); - output.WriteFloat(RequiredFloat); - } - if (HasRequiredDouble) { - output.WriteRawTag(97); - output.WriteDouble(RequiredDouble); - } - if (HasRequiredBool) { - output.WriteRawTag(104); - output.WriteBool(RequiredBool); - } - if (HasRequiredString) { - output.WriteRawTag(114); - output.WriteString(RequiredString); - } - if (HasRequiredBytes) { - output.WriteRawTag(122); - output.WriteBytes(RequiredBytes); - } - if (requiredNestedMessage_ != null) { - output.WriteRawTag(146, 1); - output.WriteMessage(RequiredNestedMessage); - } - if (requiredForeignMessage_ != null) { - output.WriteRawTag(154, 1); - output.WriteMessage(RequiredForeignMessage); - } - if (HasRequiredNestedEnum) { - output.WriteRawTag(168, 1); - output.WriteEnum((int) RequiredNestedEnum); - } - if (HasRequiredForeignEnum) { - output.WriteRawTag(176, 1); - output.WriteEnum((int) RequiredForeignEnum); - } - if (HasRequiredStringPiece) { - output.WriteRawTag(194, 1); - output.WriteString(RequiredStringPiece); - } - if (HasRequiredCord) { - output.WriteRawTag(202, 1); - output.WriteString(RequiredCord); - } - if (recursiveMessage_ != null) { - output.WriteRawTag(218, 1); - output.WriteMessage(RecursiveMessage); - } - if (optionalRecursiveMessage_ != null) { - output.WriteRawTag(226, 1); - output.WriteMessage(OptionalRecursiveMessage); - } - if (HasData) { - output.WriteRawTag(203, 12); - output.WriteGroup(Data); - output.WriteRawTag(204, 12); - } - if (HasDefaultInt32) { - output.WriteRawTag(136, 15); - output.WriteInt32(DefaultInt32); - } - if (HasDefaultInt64) { - output.WriteRawTag(144, 15); - output.WriteInt64(DefaultInt64); - } - if (HasDefaultUint32) { - output.WriteRawTag(152, 15); - output.WriteUInt32(DefaultUint32); - } - if (HasDefaultUint64) { - output.WriteRawTag(160, 15); - output.WriteUInt64(DefaultUint64); - } - if (HasDefaultSint32) { - output.WriteRawTag(168, 15); - output.WriteSInt32(DefaultSint32); - } - if (HasDefaultSint64) { - output.WriteRawTag(176, 15); - output.WriteSInt64(DefaultSint64); - } - if (HasDefaultFixed32) { - output.WriteRawTag(189, 15); - output.WriteFixed32(DefaultFixed32); - } - if (HasDefaultFixed64) { - output.WriteRawTag(193, 15); - output.WriteFixed64(DefaultFixed64); - } - if (HasDefaultSfixed32) { - output.WriteRawTag(205, 15); - output.WriteSFixed32(DefaultSfixed32); - } - if (HasDefaultSfixed64) { - output.WriteRawTag(209, 15); - output.WriteSFixed64(DefaultSfixed64); - } - if (HasDefaultFloat) { - output.WriteRawTag(221, 15); - output.WriteFloat(DefaultFloat); - } - if (HasDefaultDouble) { - output.WriteRawTag(225, 15); - output.WriteDouble(DefaultDouble); - } - if (HasDefaultBool) { - output.WriteRawTag(232, 15); - output.WriteBool(DefaultBool); - } - if (HasDefaultString) { - output.WriteRawTag(242, 15); - output.WriteString(DefaultString); - } - if (HasDefaultBytes) { - output.WriteRawTag(250, 15); - output.WriteBytes(DefaultBytes); - } - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasRequiredInt32) { - output.WriteRawTag(8); - output.WriteInt32(RequiredInt32); - } - if (HasRequiredInt64) { - output.WriteRawTag(16); - output.WriteInt64(RequiredInt64); - } - if (HasRequiredUint32) { - output.WriteRawTag(24); - output.WriteUInt32(RequiredUint32); - } - if (HasRequiredUint64) { - output.WriteRawTag(32); - output.WriteUInt64(RequiredUint64); - } - if (HasRequiredSint32) { - output.WriteRawTag(40); - output.WriteSInt32(RequiredSint32); - } - if (HasRequiredSint64) { - output.WriteRawTag(48); - output.WriteSInt64(RequiredSint64); - } - if (HasRequiredFixed32) { - output.WriteRawTag(61); - output.WriteFixed32(RequiredFixed32); - } - if (HasRequiredFixed64) { - output.WriteRawTag(65); - output.WriteFixed64(RequiredFixed64); - } - if (HasRequiredSfixed32) { - output.WriteRawTag(77); - output.WriteSFixed32(RequiredSfixed32); - } - if (HasRequiredSfixed64) { - output.WriteRawTag(81); - output.WriteSFixed64(RequiredSfixed64); - } - if (HasRequiredFloat) { - output.WriteRawTag(93); - output.WriteFloat(RequiredFloat); - } - if (HasRequiredDouble) { - output.WriteRawTag(97); - output.WriteDouble(RequiredDouble); - } - if (HasRequiredBool) { - output.WriteRawTag(104); - output.WriteBool(RequiredBool); - } - if (HasRequiredString) { - output.WriteRawTag(114); - output.WriteString(RequiredString); - } - if (HasRequiredBytes) { - output.WriteRawTag(122); - output.WriteBytes(RequiredBytes); - } - if (requiredNestedMessage_ != null) { - output.WriteRawTag(146, 1); - output.WriteMessage(RequiredNestedMessage); - } - if (requiredForeignMessage_ != null) { - output.WriteRawTag(154, 1); - output.WriteMessage(RequiredForeignMessage); - } - if (HasRequiredNestedEnum) { - output.WriteRawTag(168, 1); - output.WriteEnum((int) RequiredNestedEnum); - } - if (HasRequiredForeignEnum) { - output.WriteRawTag(176, 1); - output.WriteEnum((int) RequiredForeignEnum); - } - if (HasRequiredStringPiece) { - output.WriteRawTag(194, 1); - output.WriteString(RequiredStringPiece); - } - if (HasRequiredCord) { - output.WriteRawTag(202, 1); - output.WriteString(RequiredCord); - } - if (recursiveMessage_ != null) { - output.WriteRawTag(218, 1); - output.WriteMessage(RecursiveMessage); - } - if (optionalRecursiveMessage_ != null) { - output.WriteRawTag(226, 1); - output.WriteMessage(OptionalRecursiveMessage); - } - if (HasData) { - output.WriteRawTag(203, 12); - output.WriteGroup(Data); - output.WriteRawTag(204, 12); - } - if (HasDefaultInt32) { - output.WriteRawTag(136, 15); - output.WriteInt32(DefaultInt32); - } - if (HasDefaultInt64) { - output.WriteRawTag(144, 15); - output.WriteInt64(DefaultInt64); - } - if (HasDefaultUint32) { - output.WriteRawTag(152, 15); - output.WriteUInt32(DefaultUint32); - } - if (HasDefaultUint64) { - output.WriteRawTag(160, 15); - output.WriteUInt64(DefaultUint64); - } - if (HasDefaultSint32) { - output.WriteRawTag(168, 15); - output.WriteSInt32(DefaultSint32); - } - if (HasDefaultSint64) { - output.WriteRawTag(176, 15); - output.WriteSInt64(DefaultSint64); - } - if (HasDefaultFixed32) { - output.WriteRawTag(189, 15); - output.WriteFixed32(DefaultFixed32); - } - if (HasDefaultFixed64) { - output.WriteRawTag(193, 15); - output.WriteFixed64(DefaultFixed64); - } - if (HasDefaultSfixed32) { - output.WriteRawTag(205, 15); - output.WriteSFixed32(DefaultSfixed32); - } - if (HasDefaultSfixed64) { - output.WriteRawTag(209, 15); - output.WriteSFixed64(DefaultSfixed64); - } - if (HasDefaultFloat) { - output.WriteRawTag(221, 15); - output.WriteFloat(DefaultFloat); - } - if (HasDefaultDouble) { - output.WriteRawTag(225, 15); - output.WriteDouble(DefaultDouble); - } - if (HasDefaultBool) { - output.WriteRawTag(232, 15); - output.WriteBool(DefaultBool); - } - if (HasDefaultString) { - output.WriteRawTag(242, 15); - output.WriteString(DefaultString); - } - if (HasDefaultBytes) { - output.WriteRawTag(250, 15); - output.WriteBytes(DefaultBytes); - } - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasRequiredInt32) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(RequiredInt32); - } - if (HasRequiredInt64) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(RequiredInt64); - } - if (HasRequiredUint32) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(RequiredUint32); - } - if (HasRequiredUint64) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(RequiredUint64); - } - if (HasRequiredSint32) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(RequiredSint32); - } - if (HasRequiredSint64) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(RequiredSint64); - } - if (HasRequiredFixed32) { - size += 1 + 4; - } - if (HasRequiredFixed64) { - size += 1 + 8; - } - if (HasRequiredSfixed32) { - size += 1 + 4; - } - if (HasRequiredSfixed64) { - size += 1 + 8; - } - if (HasRequiredFloat) { - size += 1 + 4; - } - if (HasRequiredDouble) { - size += 1 + 8; - } - if (HasRequiredBool) { - size += 1 + 1; - } - if (HasRequiredString) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(RequiredString); - } - if (HasRequiredBytes) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(RequiredBytes); - } - if (requiredNestedMessage_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RequiredNestedMessage); - } - if (requiredForeignMessage_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RequiredForeignMessage); - } - if (HasRequiredNestedEnum) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) RequiredNestedEnum); - } - if (HasRequiredForeignEnum) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) RequiredForeignEnum); - } - if (HasRequiredStringPiece) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(RequiredStringPiece); - } - if (HasRequiredCord) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(RequiredCord); - } - if (recursiveMessage_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RecursiveMessage); - } - if (optionalRecursiveMessage_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalRecursiveMessage); - } - if (HasData) { - size += 4 + pb::CodedOutputStream.ComputeGroupSize(Data); - } - if (HasDefaultInt32) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(DefaultInt32); - } - if (HasDefaultInt64) { - size += 2 + pb::CodedOutputStream.ComputeInt64Size(DefaultInt64); - } - if (HasDefaultUint32) { - size += 2 + pb::CodedOutputStream.ComputeUInt32Size(DefaultUint32); - } - if (HasDefaultUint64) { - size += 2 + pb::CodedOutputStream.ComputeUInt64Size(DefaultUint64); - } - if (HasDefaultSint32) { - size += 2 + pb::CodedOutputStream.ComputeSInt32Size(DefaultSint32); - } - if (HasDefaultSint64) { - size += 2 + pb::CodedOutputStream.ComputeSInt64Size(DefaultSint64); - } - if (HasDefaultFixed32) { - size += 2 + 4; - } - if (HasDefaultFixed64) { - size += 2 + 8; - } - if (HasDefaultSfixed32) { - size += 2 + 4; - } - if (HasDefaultSfixed64) { - size += 2 + 8; - } - if (HasDefaultFloat) { - size += 2 + 4; - } - if (HasDefaultDouble) { - size += 2 + 8; - } - if (HasDefaultBool) { - size += 2 + 1; - } - if (HasDefaultString) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(DefaultString); - } - if (HasDefaultBytes) { - size += 2 + pb::CodedOutputStream.ComputeBytesSize(DefaultBytes); - } - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(TestAllRequiredTypesProto2 other) { - if (other == null) { - return; - } - if (other.HasRequiredInt32) { - RequiredInt32 = other.RequiredInt32; - } - if (other.HasRequiredInt64) { - RequiredInt64 = other.RequiredInt64; - } - if (other.HasRequiredUint32) { - RequiredUint32 = other.RequiredUint32; - } - if (other.HasRequiredUint64) { - RequiredUint64 = other.RequiredUint64; - } - if (other.HasRequiredSint32) { - RequiredSint32 = other.RequiredSint32; - } - if (other.HasRequiredSint64) { - RequiredSint64 = other.RequiredSint64; - } - if (other.HasRequiredFixed32) { - RequiredFixed32 = other.RequiredFixed32; - } - if (other.HasRequiredFixed64) { - RequiredFixed64 = other.RequiredFixed64; - } - if (other.HasRequiredSfixed32) { - RequiredSfixed32 = other.RequiredSfixed32; - } - if (other.HasRequiredSfixed64) { - RequiredSfixed64 = other.RequiredSfixed64; - } - if (other.HasRequiredFloat) { - RequiredFloat = other.RequiredFloat; - } - if (other.HasRequiredDouble) { - RequiredDouble = other.RequiredDouble; - } - if (other.HasRequiredBool) { - RequiredBool = other.RequiredBool; - } - if (other.HasRequiredString) { - RequiredString = other.RequiredString; - } - if (other.HasRequiredBytes) { - RequiredBytes = other.RequiredBytes; - } - if (other.requiredNestedMessage_ != null) { - if (requiredNestedMessage_ == null) { - RequiredNestedMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedMessage(); - } - RequiredNestedMessage.MergeFrom(other.RequiredNestedMessage); - } - if (other.requiredForeignMessage_ != null) { - if (requiredForeignMessage_ == null) { - RequiredForeignMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); - } - RequiredForeignMessage.MergeFrom(other.RequiredForeignMessage); - } - if (other.HasRequiredNestedEnum) { - RequiredNestedEnum = other.RequiredNestedEnum; - } - if (other.HasRequiredForeignEnum) { - RequiredForeignEnum = other.RequiredForeignEnum; - } - if (other.HasRequiredStringPiece) { - RequiredStringPiece = other.RequiredStringPiece; - } - if (other.HasRequiredCord) { - RequiredCord = other.RequiredCord; - } - if (other.recursiveMessage_ != null) { - if (recursiveMessage_ == null) { - RecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - RecursiveMessage.MergeFrom(other.RecursiveMessage); - } - if (other.optionalRecursiveMessage_ != null) { - if (optionalRecursiveMessage_ == null) { - OptionalRecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - OptionalRecursiveMessage.MergeFrom(other.OptionalRecursiveMessage); - } - if (other.HasData) { - if (!HasData) { - Data = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.Data(); - } - Data.MergeFrom(other.Data); - } - if (other.HasDefaultInt32) { - DefaultInt32 = other.DefaultInt32; - } - if (other.HasDefaultInt64) { - DefaultInt64 = other.DefaultInt64; - } - if (other.HasDefaultUint32) { - DefaultUint32 = other.DefaultUint32; - } - if (other.HasDefaultUint64) { - DefaultUint64 = other.DefaultUint64; - } - if (other.HasDefaultSint32) { - DefaultSint32 = other.DefaultSint32; - } - if (other.HasDefaultSint64) { - DefaultSint64 = other.DefaultSint64; - } - if (other.HasDefaultFixed32) { - DefaultFixed32 = other.DefaultFixed32; - } - if (other.HasDefaultFixed64) { - DefaultFixed64 = other.DefaultFixed64; - } - if (other.HasDefaultSfixed32) { - DefaultSfixed32 = other.DefaultSfixed32; - } - if (other.HasDefaultSfixed64) { - DefaultSfixed64 = other.DefaultSfixed64; - } - if (other.HasDefaultFloat) { - DefaultFloat = other.DefaultFloat; - } - if (other.HasDefaultDouble) { - DefaultDouble = other.DefaultDouble; - } - if (other.HasDefaultBool) { - DefaultBool = other.DefaultBool; - } - if (other.HasDefaultString) { - DefaultString = other.DefaultString; - } - if (other.HasDefaultBytes) { - DefaultBytes = other.DefaultBytes; - } - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 8: { - RequiredInt32 = input.ReadInt32(); - break; - } - case 16: { - RequiredInt64 = input.ReadInt64(); - break; - } - case 24: { - RequiredUint32 = input.ReadUInt32(); - break; - } - case 32: { - RequiredUint64 = input.ReadUInt64(); - break; - } - case 40: { - RequiredSint32 = input.ReadSInt32(); - break; - } - case 48: { - RequiredSint64 = input.ReadSInt64(); - break; - } - case 61: { - RequiredFixed32 = input.ReadFixed32(); - break; - } - case 65: { - RequiredFixed64 = input.ReadFixed64(); - break; - } - case 77: { - RequiredSfixed32 = input.ReadSFixed32(); - break; - } - case 81: { - RequiredSfixed64 = input.ReadSFixed64(); - break; - } - case 93: { - RequiredFloat = input.ReadFloat(); - break; - } - case 97: { - RequiredDouble = input.ReadDouble(); - break; - } - case 104: { - RequiredBool = input.ReadBool(); - break; - } - case 114: { - RequiredString = input.ReadString(); - break; - } - case 122: { - RequiredBytes = input.ReadBytes(); - break; - } - case 146: { - if (requiredNestedMessage_ == null) { - RequiredNestedMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedMessage(); - } - input.ReadMessage(RequiredNestedMessage); - break; - } - case 154: { - if (requiredForeignMessage_ == null) { - RequiredForeignMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); - } - input.ReadMessage(RequiredForeignMessage); - break; - } - case 168: { - RequiredNestedEnum = (global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedEnum) input.ReadEnum(); - break; - } - case 176: { - RequiredForeignEnum = (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) input.ReadEnum(); - break; - } - case 194: { - RequiredStringPiece = input.ReadString(); - break; - } - case 202: { - RequiredCord = input.ReadString(); - break; - } - case 218: { - if (recursiveMessage_ == null) { - RecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(RecursiveMessage); - break; - } - case 226: { - if (optionalRecursiveMessage_ == null) { - OptionalRecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(OptionalRecursiveMessage); - break; - } - case 1611: { - if (!HasData) { - Data = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.Data(); - } - input.ReadGroup(Data); - break; - } - case 1928: { - DefaultInt32 = input.ReadInt32(); - break; - } - case 1936: { - DefaultInt64 = input.ReadInt64(); - break; - } - case 1944: { - DefaultUint32 = input.ReadUInt32(); - break; - } - case 1952: { - DefaultUint64 = input.ReadUInt64(); - break; - } - case 1960: { - DefaultSint32 = input.ReadSInt32(); - break; - } - case 1968: { - DefaultSint64 = input.ReadSInt64(); - break; - } - case 1981: { - DefaultFixed32 = input.ReadFixed32(); - break; - } - case 1985: { - DefaultFixed64 = input.ReadFixed64(); - break; - } - case 1997: { - DefaultSfixed32 = input.ReadSFixed32(); - break; - } - case 2001: { - DefaultSfixed64 = input.ReadSFixed64(); - break; - } - case 2013: { - DefaultFloat = input.ReadFloat(); - break; - } - case 2017: { - DefaultDouble = input.ReadDouble(); - break; - } - case 2024: { - DefaultBool = input.ReadBool(); - break; - } - case 2034: { - DefaultString = input.ReadString(); - break; - } - case 2042: { - DefaultBytes = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 8: { - RequiredInt32 = input.ReadInt32(); - break; - } - case 16: { - RequiredInt64 = input.ReadInt64(); - break; - } - case 24: { - RequiredUint32 = input.ReadUInt32(); - break; - } - case 32: { - RequiredUint64 = input.ReadUInt64(); - break; - } - case 40: { - RequiredSint32 = input.ReadSInt32(); - break; - } - case 48: { - RequiredSint64 = input.ReadSInt64(); - break; - } - case 61: { - RequiredFixed32 = input.ReadFixed32(); - break; - } - case 65: { - RequiredFixed64 = input.ReadFixed64(); - break; - } - case 77: { - RequiredSfixed32 = input.ReadSFixed32(); - break; - } - case 81: { - RequiredSfixed64 = input.ReadSFixed64(); - break; - } - case 93: { - RequiredFloat = input.ReadFloat(); - break; - } - case 97: { - RequiredDouble = input.ReadDouble(); - break; - } - case 104: { - RequiredBool = input.ReadBool(); - break; - } - case 114: { - RequiredString = input.ReadString(); - break; - } - case 122: { - RequiredBytes = input.ReadBytes(); - break; - } - case 146: { - if (requiredNestedMessage_ == null) { - RequiredNestedMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedMessage(); - } - input.ReadMessage(RequiredNestedMessage); - break; - } - case 154: { - if (requiredForeignMessage_ == null) { - RequiredForeignMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); - } - input.ReadMessage(RequiredForeignMessage); - break; - } - case 168: { - RequiredNestedEnum = (global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.NestedEnum) input.ReadEnum(); - break; - } - case 176: { - RequiredForeignEnum = (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) input.ReadEnum(); - break; - } - case 194: { - RequiredStringPiece = input.ReadString(); - break; - } - case 202: { - RequiredCord = input.ReadString(); - break; - } - case 218: { - if (recursiveMessage_ == null) { - RecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(RecursiveMessage); - break; - } - case 226: { - if (optionalRecursiveMessage_ == null) { - OptionalRecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(OptionalRecursiveMessage); - break; - } - case 1611: { - if (!HasData) { - Data = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.Data(); - } - input.ReadGroup(Data); - break; - } - case 1928: { - DefaultInt32 = input.ReadInt32(); - break; - } - case 1936: { - DefaultInt64 = input.ReadInt64(); - break; - } - case 1944: { - DefaultUint32 = input.ReadUInt32(); - break; - } - case 1952: { - DefaultUint64 = input.ReadUInt64(); - break; - } - case 1960: { - DefaultSint32 = input.ReadSInt32(); - break; - } - case 1968: { - DefaultSint64 = input.ReadSInt64(); - break; - } - case 1981: { - DefaultFixed32 = input.ReadFixed32(); - break; - } - case 1985: { - DefaultFixed64 = input.ReadFixed64(); - break; - } - case 1997: { - DefaultSfixed32 = input.ReadSFixed32(); - break; - } - case 2001: { - DefaultSfixed64 = input.ReadSFixed64(); - break; - } - case 2013: { - DefaultFloat = input.ReadFloat(); - break; - } - case 2017: { - DefaultDouble = input.ReadDouble(); - break; - } - case 2024: { - DefaultBool = input.ReadBool(); - break; - } - case 2034: { - DefaultString = input.ReadString(); - break; - } - case 2042: { - DefaultBytes = input.ReadBytes(); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - #region Nested types - /// Container for nested types declared in the TestAllRequiredTypesProto2 message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum NestedEnum { - [pbr::OriginalName("FOO")] Foo = 0, - [pbr::OriginalName("BAR")] Bar = 1, - [pbr::OriginalName("BAZ")] Baz = 2, - /// - /// Intentionally negative. - /// - [pbr::OriginalName("NEG")] Neg = -1, - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class NestedMessage : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NestedMessage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NestedMessage(NestedMessage other) : this() { - _hasBits0 = other._hasBits0; - a_ = other.a_; - corecursive_ = other.corecursive_ != null ? other.corecursive_.Clone() : null; - optionalCorecursive_ = other.optionalCorecursive_ != null ? other.optionalCorecursive_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NestedMessage Clone() { - return new NestedMessage(this); - } - - /// Field number for the "a" field. - public const int AFieldNumber = 1; - private readonly static int ADefaultValue = 0; - - private int a_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int A { - get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } - set { - _hasBits0 |= 1; - a_ = value; - } - } - /// Gets whether the "a" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasA { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "a" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearA() { - _hasBits0 &= ~1; - } - - /// Field number for the "corecursive" field. - public const int CorecursiveFieldNumber = 2; - private global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 corecursive_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 Corecursive { - get { return corecursive_; } - set { - corecursive_ = value; - } - } - - /// Field number for the "optional_corecursive" field. - public const int OptionalCorecursiveFieldNumber = 3; - private global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 optionalCorecursive_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2 OptionalCorecursive { - get { return optionalCorecursive_; } - set { - optionalCorecursive_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as NestedMessage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(NestedMessage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (A != other.A) return false; - if (!object.Equals(Corecursive, other.Corecursive)) return false; - if (!object.Equals(OptionalCorecursive, other.OptionalCorecursive)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasA) hash ^= A.GetHashCode(); - if (corecursive_ != null) hash ^= Corecursive.GetHashCode(); - if (optionalCorecursive_ != null) hash ^= OptionalCorecursive.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasA) { - output.WriteRawTag(8); - output.WriteInt32(A); - } - if (corecursive_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Corecursive); - } - if (optionalCorecursive_ != null) { - output.WriteRawTag(26); - output.WriteMessage(OptionalCorecursive); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasA) { - output.WriteRawTag(8); - output.WriteInt32(A); - } - if (corecursive_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Corecursive); - } - if (optionalCorecursive_ != null) { - output.WriteRawTag(26); - output.WriteMessage(OptionalCorecursive); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasA) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(A); - } - if (corecursive_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Corecursive); - } - if (optionalCorecursive_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalCorecursive); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(NestedMessage other) { - if (other == null) { - return; - } - if (other.HasA) { - A = other.A; - } - if (other.corecursive_ != null) { - if (corecursive_ == null) { - Corecursive = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - Corecursive.MergeFrom(other.Corecursive); - } - if (other.optionalCorecursive_ != null) { - if (optionalCorecursive_ == null) { - OptionalCorecursive = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - OptionalCorecursive.MergeFrom(other.OptionalCorecursive); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - A = input.ReadInt32(); - break; - } - case 18: { - if (corecursive_ == null) { - Corecursive = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(Corecursive); - break; - } - case 26: { - if (optionalCorecursive_ == null) { - OptionalCorecursive = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(OptionalCorecursive); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - A = input.ReadInt32(); - break; - } - case 18: { - if (corecursive_ == null) { - Corecursive = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(Corecursive); - break; - } - case 26: { - if (optionalCorecursive_ == null) { - OptionalCorecursive = new global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2(); - } - input.ReadMessage(OptionalCorecursive); - break; - } - } - } - } - #endif - - } - - /// - /// groups - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Data : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Data()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Descriptor.NestedTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Data() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Data(Data other) : this() { - _hasBits0 = other._hasBits0; - groupInt32_ = other.groupInt32_; - groupUint32_ = other.groupUint32_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Data Clone() { - return new Data(this); - } - - /// Field number for the "group_int32" field. - public const int GroupInt32FieldNumber = 202; - private readonly static int GroupInt32DefaultValue = 0; - - private int groupInt32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int GroupInt32 { - get { if ((_hasBits0 & 1) != 0) { return groupInt32_; } else { return GroupInt32DefaultValue; } } - set { - _hasBits0 |= 1; - groupInt32_ = value; - } - } - /// Gets whether the "group_int32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasGroupInt32 { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "group_int32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearGroupInt32() { - _hasBits0 &= ~1; - } - - /// Field number for the "group_uint32" field. - public const int GroupUint32FieldNumber = 203; - private readonly static uint GroupUint32DefaultValue = 0; - - private uint groupUint32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint GroupUint32 { - get { if ((_hasBits0 & 2) != 0) { return groupUint32_; } else { return GroupUint32DefaultValue; } } - set { - _hasBits0 |= 2; - groupUint32_ = value; - } - } - /// Gets whether the "group_uint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasGroupUint32 { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "group_uint32" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearGroupUint32() { - _hasBits0 &= ~2; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Data); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Data other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (GroupInt32 != other.GroupInt32) return false; - if (GroupUint32 != other.GroupUint32) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasGroupInt32) hash ^= GroupInt32.GetHashCode(); - if (HasGroupUint32) hash ^= GroupUint32.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasGroupInt32) { - output.WriteRawTag(208, 12); - output.WriteInt32(GroupInt32); - } - if (HasGroupUint32) { - output.WriteRawTag(216, 12); - output.WriteUInt32(GroupUint32); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasGroupInt32) { - output.WriteRawTag(208, 12); - output.WriteInt32(GroupInt32); - } - if (HasGroupUint32) { - output.WriteRawTag(216, 12); - output.WriteUInt32(GroupUint32); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasGroupInt32) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(GroupInt32); - } - if (HasGroupUint32) { - size += 2 + pb::CodedOutputStream.ComputeUInt32Size(GroupUint32); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Data other) { - if (other == null) { - return; - } - if (other.HasGroupInt32) { - GroupInt32 = other.GroupInt32; - } - if (other.HasGroupUint32) { - GroupUint32 = other.GroupUint32; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - case 1612: - return; - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 1616: { - GroupInt32 = input.ReadInt32(); - break; - } - case 1624: { - GroupUint32 = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - case 1612: - return; - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 1616: { - GroupInt32 = input.ReadInt32(); - break; - } - case 1624: { - GroupUint32 = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - /// - /// message_set test case. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MessageSetCorrect : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrect()); - private pb::UnknownFieldSet _unknownFields; - private pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Descriptor.NestedTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrect() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrect(MessageSetCorrect other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrect Clone() { - return new MessageSetCorrect(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MessageSetCorrect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MessageSetCorrect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MessageSetCorrect other) { - if (other == null) { - return; - } - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MessageSetCorrectExtension1 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension1()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Descriptor.NestedTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrectExtension1() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrectExtension1(MessageSetCorrectExtension1 other) : this() { - str_ = other.str_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrectExtension1 Clone() { - return new MessageSetCorrectExtension1(this); - } - - /// Field number for the "str" field. - public const int StrFieldNumber = 25; - private readonly static string StrDefaultValue = ""; - - private string str_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Str { - get { return str_ ?? StrDefaultValue; } - set { - str_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "str" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasStr { - get { return str_ != null; } - } - /// Clears the value of the "str" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearStr() { - str_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MessageSetCorrectExtension1); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MessageSetCorrectExtension1 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Str != other.Str) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasStr) hash ^= Str.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasStr) { - output.WriteRawTag(202, 1); - output.WriteString(Str); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasStr) { - output.WriteRawTag(202, 1); - output.WriteString(Str); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasStr) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(Str); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MessageSetCorrectExtension1 other) { - if (other == null) { - return; - } - if (other.HasStr) { - Str = other.Str; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 202: { - Str = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 202: { - Str = input.ReadString(); - break; - } - } - } - } - #endif - - #region Extensions - /// Container for extensions for other messages declared in the MessageSetCorrectExtension1 message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Extensions { - public static readonly pb::Extension MessageSetExtension = - new pb::Extension(1547769, pb::FieldCodec.ForMessage(12382154, global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension1.Parser)); - } - #endregion - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MessageSetCorrectExtension2 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension2()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Descriptor.NestedTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrectExtension2() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrectExtension2(MessageSetCorrectExtension2 other) : this() { - _hasBits0 = other._hasBits0; - i_ = other.i_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageSetCorrectExtension2 Clone() { - return new MessageSetCorrectExtension2(this); - } - - /// Field number for the "i" field. - public const int IFieldNumber = 9; - private readonly static int IDefaultValue = 0; - - private int i_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int I { - get { if ((_hasBits0 & 1) != 0) { return i_; } else { return IDefaultValue; } } - set { - _hasBits0 |= 1; - i_ = value; - } - } - /// Gets whether the "i" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasI { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "i" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearI() { - _hasBits0 &= ~1; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MessageSetCorrectExtension2); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MessageSetCorrectExtension2 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (I != other.I) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasI) hash ^= I.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasI) { - output.WriteRawTag(72); - output.WriteInt32(I); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasI) { - output.WriteRawTag(72); - output.WriteInt32(I); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasI) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(I); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MessageSetCorrectExtension2 other) { - if (other == null) { - return; - } - if (other.HasI) { - I = other.I; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 72: { - I = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 72: { - I = input.ReadInt32(); - break; - } - } - } - } - #endif - - #region Extensions - /// Container for extensions for other messages declared in the MessageSetCorrectExtension2 message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Extensions { - public static readonly pb::Extension MessageSetExtension = - new pb::Extension(4135312, pb::FieldCodec.ForMessage(33082498, global::ProtobufTestMessages.Proto2.TestAllRequiredTypesProto2.Types.MessageSetCorrectExtension2.Parser)); - } - #endregion - - } - - } - #endregion - - } - #endregion } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs similarity index 87% rename from csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs index d037e74ea53039dba009912c1d981d2a3e3762aa..6f915cb79bf9eac407e432be546bb9fb2fa70ad2 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs @@ -2,7 +2,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/test_messages_proto3.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -226,21 +226,17 @@ namespace ProtobufTestMessages.Proto3 { "dG8zLkZvcmVpZ25FbnVtOgI4ASI5CgpOZXN0ZWRFbnVtEgcKA0ZPTxAAEgcK", "A0JBUhABEgcKA0JBWhACEhAKA05FRxD///////////8BIlkKC0FsaWFzZWRF", "bnVtEg0KCUFMSUFTX0ZPTxAAEg0KCUFMSUFTX0JBUhABEg0KCUFMSUFTX0JB", - "WhACEgcKA01PTxACEgcKA21vbxACEgcKA2JBehACGgIQAUINCgtvbmVvZl9m", - "aWVsZEoGCPUDEP8DIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUiFgoU", - "TnVsbEh5cG90aGVzaXNQcm90bzMiLwoORW51bU9ubHlQcm90bzMiHQoEQm9v", - "bBIKCgZrRmFsc2UQABIJCgVrVHJ1ZRABKkAKC0ZvcmVpZ25FbnVtEg8KC0ZP", - "UkVJR05fRk9PEAASDwoLRk9SRUlHTl9CQVIQARIPCgtGT1JFSUdOX0JBWhAC", - "QjgKKGNvbS5nb29nbGUucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzNI", - "AfgBAaICBlByb3RvM2IGcHJvdG8z")); + "WhACEgcKA1FVWBACEgcKA3F1eBACEgcKA2JBehACGgIQAUINCgtvbmVvZl9m", + "aWVsZEoGCPUDEP8DIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUqQAoL", + "Rm9yZWlnbkVudW0SDwoLRk9SRUlHTl9GT08QABIPCgtGT1JFSUdOX0JBUhAB", + "Eg8KC0ZPUkVJR05fQkFaEAJCOAooY29tLmdvb2dsZS5wcm90b2J1Zl90ZXN0", + "X21lc3NhZ2VzLnByb3RvM0gB+AEBogIGUHJvdG8zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ProtobufTestMessages.Proto3.ForeignEnum), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalAliasedEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedNestedEnum", "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedNestedEnum", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "OneofNullValue", "OptionalBoolWrapper", "OptionalInt32Wrapper", "OptionalInt64Wrapper", "OptionalUint32Wrapper", "OptionalUint64Wrapper", "OptionalFloatWrapper", "OptionalDoubleWrapper", "OptionalStringWrapper", "OptionalBytesWrapper", "RepeatedBoolWrapper", "RepeatedInt32Wrapper", "RepeatedInt64Wrapper", "RepeatedUint32Wrapper", "RepeatedUint64Wrapper", "RepeatedFloatWrapper", "RepeatedDoubleWrapper", "RepeatedStringWrapper", "RepeatedBytesWrapper", "OptionalDuration", "OptionalTimestamp", "OptionalFieldMask", "OptionalStruct", "OptionalAny", "OptionalValue", "OptionalNullValue", "RepeatedDuration", "RepeatedTimestamp", "RepeatedFieldmask", "RepeatedStruct", "RepeatedAny", "RepeatedValue", "RepeatedListValue", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum), typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null, null), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.ForeignMessage), global::ProtobufTestMessages.Proto3.ForeignMessage.Parser, new[]{ "C" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.NullHypothesisProto3), global::ProtobufTestMessages.Proto3.NullHypothesisProto3.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.EnumOnlyProto3), global::ProtobufTestMessages.Proto3.EnumOnlyProto3.Parser, null, null, new[]{ typeof(global::ProtobufTestMessages.Proto3.EnumOnlyProto3.Types.Bool) }, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.ForeignMessage), global::ProtobufTestMessages.Proto3.ForeignMessage.Parser, new[]{ "C" }, null, null, null, null) })); } #endregion @@ -265,7 +261,6 @@ namespace ProtobufTestMessages.Proto3 { /// could trigger bugs that occur in any message type in this file. We verify /// this stays true in a unit test. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestAllTypesProto3 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -274,23 +269,19 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto3() { OnConstruction(); } @@ -298,7 +289,6 @@ namespace ProtobufTestMessages.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto3(TestAllTypesProto3 other) : this() { optionalInt32_ = other.optionalInt32_; optionalInt64_ = other.optionalInt64_; @@ -478,7 +468,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto3 Clone() { return new TestAllTypesProto3(this); } @@ -490,7 +479,6 @@ namespace ProtobufTestMessages.Proto3 { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { return optionalInt32_; } set { @@ -502,7 +490,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalInt64FieldNumber = 2; private long optionalInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalInt64 { get { return optionalInt64_; } set { @@ -514,7 +501,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalUint32FieldNumber = 3; private uint optionalUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalUint32 { get { return optionalUint32_; } set { @@ -526,7 +512,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalUint64FieldNumber = 4; private ulong optionalUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalUint64 { get { return optionalUint64_; } set { @@ -538,7 +523,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSint32FieldNumber = 5; private int optionalSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSint32 { get { return optionalSint32_; } set { @@ -550,7 +534,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSint64FieldNumber = 6; private long optionalSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSint64 { get { return optionalSint64_; } set { @@ -562,7 +545,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFixed32FieldNumber = 7; private uint optionalFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalFixed32 { get { return optionalFixed32_; } set { @@ -574,7 +556,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFixed64FieldNumber = 8; private ulong optionalFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalFixed64 { get { return optionalFixed64_; } set { @@ -586,7 +567,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSfixed32FieldNumber = 9; private int optionalSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSfixed32 { get { return optionalSfixed32_; } set { @@ -598,7 +578,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSfixed64FieldNumber = 10; private long optionalSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSfixed64 { get { return optionalSfixed64_; } set { @@ -610,7 +589,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFloatFieldNumber = 11; private float optionalFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OptionalFloat { get { return optionalFloat_; } set { @@ -622,7 +600,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalDoubleFieldNumber = 12; private double optionalDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OptionalDouble { get { return optionalDouble_; } set { @@ -634,7 +611,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalBoolFieldNumber = 13; private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { return optionalBool_; } set { @@ -646,7 +622,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalStringFieldNumber = 14; private string optionalString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_; } set { @@ -658,7 +633,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalBytesFieldNumber = 15; private pb::ByteString optionalBytes_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_; } set { @@ -670,7 +644,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalNestedMessageFieldNumber = 18; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -682,7 +655,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalForeignMessageFieldNumber = 19; private global::ProtobufTestMessages.Proto3.ForeignMessage optionalForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.ForeignMessage OptionalForeignMessage { get { return optionalForeignMessage_; } set { @@ -694,7 +666,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalNestedEnumFieldNumber = 21; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum optionalNestedEnum_ = global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum OptionalNestedEnum { get { return optionalNestedEnum_; } set { @@ -706,7 +677,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalForeignEnumFieldNumber = 22; private global::ProtobufTestMessages.Proto3.ForeignEnum optionalForeignEnum_ = global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.ForeignEnum OptionalForeignEnum { get { return optionalForeignEnum_; } set { @@ -718,7 +688,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalAliasedEnumFieldNumber = 23; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum optionalAliasedEnum_ = global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum.AliasFoo; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum OptionalAliasedEnum { get { return optionalAliasedEnum_; } set { @@ -730,7 +699,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalStringPieceFieldNumber = 24; private string optionalStringPiece_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringPiece { get { return optionalStringPiece_; } set { @@ -742,7 +710,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalCordFieldNumber = 25; private string optionalCord_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalCord { get { return optionalCord_; } set { @@ -754,7 +721,6 @@ namespace ProtobufTestMessages.Proto3 { public const int RecursiveMessageFieldNumber = 27; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3 recursiveMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3 RecursiveMessage { get { return recursiveMessage_; } set { @@ -771,7 +737,6 @@ namespace ProtobufTestMessages.Proto3 { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -782,7 +747,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForInt64(258); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -793,7 +757,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt32(266); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -804,7 +767,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt64(274); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -815,7 +777,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt32(282); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -826,7 +787,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt64(290); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -837,7 +797,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed32(298); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -848,7 +807,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed64(306); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -859,7 +817,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed32(314); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -870,7 +827,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed64(322); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -881,7 +837,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFloat(330); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -892,7 +847,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForDouble(338); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -903,7 +857,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBool(346); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -914,7 +867,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -925,7 +877,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -936,7 +887,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(386, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -947,7 +897,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(394, global::ProtobufTestMessages.Proto3.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -958,7 +907,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -969,7 +917,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::ProtobufTestMessages.Proto3.ForeignEnum) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -980,7 +927,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForString(434); private readonly pbc::RepeatedField repeatedStringPiece_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPiece { get { return repeatedStringPiece_; } } @@ -991,7 +937,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForString(442); private readonly pbc::RepeatedField repeatedCord_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCord { get { return repeatedCord_; } } @@ -1005,7 +950,6 @@ namespace ProtobufTestMessages.Proto3 { /// Packed /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -1016,7 +960,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForInt64(610); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -1027,7 +970,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt32(618); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -1038,7 +980,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt64(626); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -1049,7 +990,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt32(634); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -1060,7 +1000,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt64(642); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -1071,7 +1010,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed32(650); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -1082,7 +1020,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed64(658); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -1093,7 +1030,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed32(666); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -1104,7 +1040,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed64(674); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -1115,7 +1050,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFloat(682); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -1126,7 +1060,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForDouble(690); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -1137,7 +1070,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBool(698); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -1148,7 +1080,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(706, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x); private readonly pbc::RepeatedField packedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedNestedEnum { get { return packedNestedEnum_; } } @@ -1162,7 +1093,6 @@ namespace ProtobufTestMessages.Proto3 { /// Unpacked /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -1173,7 +1103,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForInt64(720); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -1184,7 +1113,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt32(728); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -1195,7 +1123,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt64(736); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -1206,7 +1133,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt32(744); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -1217,7 +1143,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt64(752); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -1228,7 +1153,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed32(765); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -1239,7 +1163,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed64(769); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -1250,7 +1173,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed32(781); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -1261,7 +1183,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed64(785); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -1272,7 +1193,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFloat(797); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -1283,7 +1203,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForDouble(801); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -1294,7 +1213,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBool(808); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -1305,7 +1223,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(816, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x); private readonly pbc::RepeatedField unpackedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedNestedEnum { get { return unpackedNestedEnum_; } } @@ -1319,7 +1236,6 @@ namespace ProtobufTestMessages.Proto3 { /// Map /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1330,7 +1246,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 458); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1341,7 +1256,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 466); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1352,7 +1266,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 474); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1363,7 +1276,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 482); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1374,7 +1286,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 490); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1385,7 +1296,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 498); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1396,7 +1306,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 506); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1407,7 +1316,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 514); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1418,7 +1326,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 522); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1429,7 +1336,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 530); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1440,7 +1346,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 538); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1451,7 +1356,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 546); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1462,7 +1366,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 554); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -1473,7 +1376,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForBytes(18, pb::ByteString.Empty), 562); private readonly pbc::MapField mapStringBytes_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringBytes { get { return mapStringBytes_; } } @@ -1484,7 +1386,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser), 570); private readonly pbc::MapField mapStringNestedMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedMessage { get { return mapStringNestedMessage_; } } @@ -1495,7 +1396,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto3.ForeignMessage.Parser), 578); private readonly pbc::MapField mapStringForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignMessage { get { return mapStringForeignMessage_; } } @@ -1506,7 +1406,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo), 586); private readonly pbc::MapField mapStringNestedEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedEnum { get { return mapStringNestedEnum_; } } @@ -1517,7 +1416,6 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto3.ForeignEnum) x, global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo), 594); private readonly pbc::MapField mapStringForeignEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignEnum { get { return mapStringForeignEnum_; } } @@ -1525,33 +1423,17 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { - get { return HasOneofUint32 ? (uint) oneofField_ : 0; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofUint32; } } - /// Gets whether the "oneof_uint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofUint32 { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } - } - /// Clears the value of the oneof if it's currently set to "oneof_uint32" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofUint32() { - if (HasOneofUint32) { - ClearOneofField(); - } - } /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage) oneofField_ : null; } set { @@ -1563,210 +1445,90 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { - get { return HasOneofString ? (string) oneofField_ : ""; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } set { oneofField_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); oneofFieldCase_ = OneofFieldOneofCase.OneofString; } } - /// Gets whether the "oneof_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofString { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } - } - /// Clears the value of the oneof if it's currently set to "oneof_string" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofString() { - if (HasOneofString) { - ClearOneofField(); - } - } /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { - get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { oneofField_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); oneofFieldCase_ = OneofFieldOneofCase.OneofBytes; } } - /// Gets whether the "oneof_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofBytes { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } - } - /// Clears the value of the oneof if it's currently set to "oneof_bytes" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofBytes() { - if (HasOneofBytes) { - ClearOneofField(); - } - } /// Field number for the "oneof_bool" field. public const int OneofBoolFieldNumber = 115; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OneofBool { - get { return HasOneofBool ? (bool) oneofField_ : false; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBool ? (bool) oneofField_ : false; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofBool; } } - /// Gets whether the "oneof_bool" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofBool { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBool; } - } - /// Clears the value of the oneof if it's currently set to "oneof_bool" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofBool() { - if (HasOneofBool) { - ClearOneofField(); - } - } /// Field number for the "oneof_uint64" field. public const int OneofUint64FieldNumber = 116; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OneofUint64 { - get { return HasOneofUint64 ? (ulong) oneofField_ : 0UL; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint64 ? (ulong) oneofField_ : 0UL; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofUint64; } } - /// Gets whether the "oneof_uint64" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofUint64 { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint64; } - } - /// Clears the value of the oneof if it's currently set to "oneof_uint64" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofUint64() { - if (HasOneofUint64) { - ClearOneofField(); - } - } /// Field number for the "oneof_float" field. public const int OneofFloatFieldNumber = 117; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OneofFloat { - get { return HasOneofFloat ? (float) oneofField_ : 0F; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofFloat ? (float) oneofField_ : 0F; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofFloat; } } - /// Gets whether the "oneof_float" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofFloat { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofFloat; } - } - /// Clears the value of the oneof if it's currently set to "oneof_float" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofFloat() { - if (HasOneofFloat) { - ClearOneofField(); - } - } /// Field number for the "oneof_double" field. public const int OneofDoubleFieldNumber = 118; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OneofDouble { - get { return HasOneofDouble ? (double) oneofField_ : 0D; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofDouble ? (double) oneofField_ : 0D; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofDouble; } } - /// Gets whether the "oneof_double" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofDouble { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofDouble; } - } - /// Clears the value of the oneof if it's currently set to "oneof_double" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofDouble() { - if (HasOneofDouble) { - ClearOneofField(); - } - } /// Field number for the "oneof_enum" field. public const int OneofEnumFieldNumber = 119; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum OneofEnum { - get { return HasOneofEnum ? (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) oneofField_ : global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum ? (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) oneofField_ : global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofEnum; } } - /// Gets whether the "oneof_enum" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofEnum { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum; } - } - /// Clears the value of the oneof if it's currently set to "oneof_enum" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofEnum() { - if (HasOneofEnum) { - ClearOneofField(); - } - } /// Field number for the "oneof_null_value" field. public const int OneofNullValueFieldNumber = 120; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.NullValue OneofNullValue { - get { return HasOneofNullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) oneofField_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) oneofField_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofNullValue; } } - /// Gets whether the "oneof_null_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofNullValue { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue; } - } - /// Clears the value of the oneof if it's currently set to "oneof_null_value" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofNullValue() { - if (HasOneofNullValue) { - ClearOneofField(); - } - } /// Field number for the "optional_bool_wrapper" field. public const int OptionalBoolWrapperFieldNumber = 201; @@ -1776,7 +1538,6 @@ namespace ProtobufTestMessages.Proto3 { /// Well-known types /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool? OptionalBoolWrapper { get { return optionalBoolWrapper_; } set { @@ -1790,7 +1551,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalInt32Wrapper_codec = pb::FieldCodec.ForStructWrapper(1618); private int? optionalInt32Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int? OptionalInt32Wrapper { get { return optionalInt32Wrapper_; } set { @@ -1804,7 +1564,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalInt64Wrapper_codec = pb::FieldCodec.ForStructWrapper(1626); private long? optionalInt64Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? OptionalInt64Wrapper { get { return optionalInt64Wrapper_; } set { @@ -1818,7 +1577,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalUint32Wrapper_codec = pb::FieldCodec.ForStructWrapper(1634); private uint? optionalUint32Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint? OptionalUint32Wrapper { get { return optionalUint32Wrapper_; } set { @@ -1832,7 +1590,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalUint64Wrapper_codec = pb::FieldCodec.ForStructWrapper(1642); private ulong? optionalUint64Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong? OptionalUint64Wrapper { get { return optionalUint64Wrapper_; } set { @@ -1846,7 +1603,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalFloatWrapper_codec = pb::FieldCodec.ForStructWrapper(1650); private float? optionalFloatWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float? OptionalFloatWrapper { get { return optionalFloatWrapper_; } set { @@ -1860,7 +1616,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalDoubleWrapper_codec = pb::FieldCodec.ForStructWrapper(1658); private double? optionalDoubleWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? OptionalDoubleWrapper { get { return optionalDoubleWrapper_; } set { @@ -1874,7 +1629,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalStringWrapper_codec = pb::FieldCodec.ForClassWrapper(1666); private string optionalStringWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringWrapper { get { return optionalStringWrapper_; } set { @@ -1888,7 +1642,6 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalBytesWrapper_codec = pb::FieldCodec.ForClassWrapper(1674); private pb::ByteString optionalBytesWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytesWrapper { get { return optionalBytesWrapper_; } set { @@ -1903,7 +1656,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1690); private readonly pbc::RepeatedField repeatedBoolWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBoolWrapper { get { return repeatedBoolWrapper_; } } @@ -1914,7 +1666,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1698); private readonly pbc::RepeatedField repeatedInt32Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32Wrapper { get { return repeatedInt32Wrapper_; } } @@ -1925,7 +1676,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1706); private readonly pbc::RepeatedField repeatedInt64Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64Wrapper { get { return repeatedInt64Wrapper_; } } @@ -1936,7 +1686,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1714); private readonly pbc::RepeatedField repeatedUint32Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32Wrapper { get { return repeatedUint32Wrapper_; } } @@ -1947,7 +1696,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1722); private readonly pbc::RepeatedField repeatedUint64Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64Wrapper { get { return repeatedUint64Wrapper_; } } @@ -1958,7 +1706,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1730); private readonly pbc::RepeatedField repeatedFloatWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloatWrapper { get { return repeatedFloatWrapper_; } } @@ -1969,7 +1716,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1738); private readonly pbc::RepeatedField repeatedDoubleWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDoubleWrapper { get { return repeatedDoubleWrapper_; } } @@ -1980,7 +1726,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForClassWrapper(1746); private readonly pbc::RepeatedField repeatedStringWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringWrapper { get { return repeatedStringWrapper_; } } @@ -1991,7 +1736,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForClassWrapper(1754); private readonly pbc::RepeatedField repeatedBytesWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytesWrapper { get { return repeatedBytesWrapper_; } } @@ -2000,7 +1744,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalDurationFieldNumber = 301; private global::Google.Protobuf.WellKnownTypes.Duration optionalDuration_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Duration OptionalDuration { get { return optionalDuration_; } set { @@ -2012,7 +1755,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalTimestampFieldNumber = 302; private global::Google.Protobuf.WellKnownTypes.Timestamp optionalTimestamp_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp OptionalTimestamp { get { return optionalTimestamp_; } set { @@ -2024,7 +1766,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFieldMaskFieldNumber = 303; private global::Google.Protobuf.WellKnownTypes.FieldMask optionalFieldMask_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.FieldMask OptionalFieldMask { get { return optionalFieldMask_; } set { @@ -2036,7 +1777,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalStructFieldNumber = 304; private global::Google.Protobuf.WellKnownTypes.Struct optionalStruct_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Struct OptionalStruct { get { return optionalStruct_; } set { @@ -2048,7 +1788,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalAnyFieldNumber = 305; private global::Google.Protobuf.WellKnownTypes.Any optionalAny_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Any OptionalAny { get { return optionalAny_; } set { @@ -2060,7 +1799,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalValueFieldNumber = 306; private global::Google.Protobuf.WellKnownTypes.Value optionalValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Value OptionalValue { get { return optionalValue_; } set { @@ -2072,7 +1810,6 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalNullValueFieldNumber = 307; private global::Google.Protobuf.WellKnownTypes.NullValue optionalNullValue_ = global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.NullValue OptionalNullValue { get { return optionalNullValue_; } set { @@ -2086,7 +1823,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2490, global::Google.Protobuf.WellKnownTypes.Duration.Parser); private readonly pbc::RepeatedField repeatedDuration_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDuration { get { return repeatedDuration_; } } @@ -2097,7 +1833,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2498, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); private readonly pbc::RepeatedField repeatedTimestamp_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedTimestamp { get { return repeatedTimestamp_; } } @@ -2108,7 +1843,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2506, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); private readonly pbc::RepeatedField repeatedFieldmask_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFieldmask { get { return repeatedFieldmask_; } } @@ -2119,7 +1853,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2594, global::Google.Protobuf.WellKnownTypes.Struct.Parser); private readonly pbc::RepeatedField repeatedStruct_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStruct { get { return repeatedStruct_; } } @@ -2130,7 +1863,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2522, global::Google.Protobuf.WellKnownTypes.Any.Parser); private readonly pbc::RepeatedField repeatedAny_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedAny { get { return repeatedAny_; } } @@ -2141,7 +1873,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2530, global::Google.Protobuf.WellKnownTypes.Value.Parser); private readonly pbc::RepeatedField repeatedValue_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedValue { get { return repeatedValue_; } } @@ -2152,7 +1883,6 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2538, global::Google.Protobuf.WellKnownTypes.ListValue.Parser); private readonly pbc::RepeatedField repeatedListValue_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedListValue { get { return repeatedListValue_; } } @@ -2165,7 +1895,6 @@ namespace ProtobufTestMessages.Proto3 { /// (protobuf says names can be any valid C/C++ identifier.) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fieldname1 { get { return fieldname1_; } set { @@ -2177,7 +1906,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName2FieldNumber = 402; private int fieldName2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName2 { get { return fieldName2_; } set { @@ -2189,7 +1917,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName3FieldNumber = 403; private int FieldName3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName3 { get { return FieldName3_; } set { @@ -2201,7 +1928,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName4FieldNumber = 404; private int fieldName4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName4 { get { return fieldName4_; } set { @@ -2213,7 +1939,6 @@ namespace ProtobufTestMessages.Proto3 { public const int Field0Name5FieldNumber = 405; private int field0Name5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name5 { get { return field0Name5_; } set { @@ -2225,7 +1950,6 @@ namespace ProtobufTestMessages.Proto3 { public const int Field0Name6FieldNumber = 406; private int field0Name6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name6 { get { return field0Name6_; } set { @@ -2237,7 +1961,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName7FieldNumber = 407; private int fieldName7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName7 { get { return fieldName7_; } set { @@ -2249,7 +1972,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName8FieldNumber = 408; private int fieldName8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName8 { get { return fieldName8_; } set { @@ -2261,7 +1983,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName9FieldNumber = 409; private int fieldName9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName9 { get { return fieldName9_; } set { @@ -2273,7 +1994,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName10FieldNumber = 410; private int fieldName10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName10 { get { return fieldName10_; } set { @@ -2285,7 +2005,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FIELDNAME11FieldNumber = 411; private int fIELDNAME11_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDNAME11 { get { return fIELDNAME11_; } set { @@ -2297,7 +2016,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FIELDName12FieldNumber = 412; private int fIELDName12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDName12 { get { return fIELDName12_; } set { @@ -2309,7 +2027,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName13FieldNumber = 413; private int FieldName13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName13 { get { return FieldName13_; } set { @@ -2321,7 +2038,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName14FieldNumber = 414; private int FieldName14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName14 { get { return FieldName14_; } set { @@ -2333,7 +2049,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName15FieldNumber = 415; private int fieldName15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName15 { get { return fieldName15_; } set { @@ -2345,7 +2060,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName16FieldNumber = 416; private int fieldName16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName16 { get { return fieldName16_; } set { @@ -2357,7 +2071,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName17FieldNumber = 417; private int fieldName17_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName17 { get { return fieldName17_; } set { @@ -2369,7 +2082,6 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName18FieldNumber = 418; private int fieldName18_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName18 { get { return fieldName18_; } set { @@ -2394,26 +2106,22 @@ namespace ProtobufTestMessages.Proto3 { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypesProto3); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypesProto3 other) { if (ReferenceEquals(other, null)) { return false; @@ -2577,7 +2285,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (OptionalInt32 != 0) hash ^= OptionalInt32.GetHashCode(); @@ -2671,16 +2378,16 @@ namespace ProtobufTestMessages.Proto3 { hash ^= MapStringForeignMessage.GetHashCode(); hash ^= MapStringNestedEnum.GetHashCode(); hash ^= MapStringForeignEnum.GetHashCode(); - if (HasOneofUint32) hash ^= OneofUint32.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) hash ^= OneofUint32.GetHashCode(); if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) hash ^= OneofNestedMessage.GetHashCode(); - if (HasOneofString) hash ^= OneofString.GetHashCode(); - if (HasOneofBytes) hash ^= OneofBytes.GetHashCode(); - if (HasOneofBool) hash ^= OneofBool.GetHashCode(); - if (HasOneofUint64) hash ^= OneofUint64.GetHashCode(); - if (HasOneofFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OneofFloat); - if (HasOneofDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OneofDouble); - if (HasOneofEnum) hash ^= OneofEnum.GetHashCode(); - if (HasOneofNullValue) hash ^= OneofNullValue.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) hash ^= OneofString.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) hash ^= OneofBytes.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBool) hash ^= OneofBool.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint64) hash ^= OneofUint64.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OneofFloat); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OneofDouble); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) hash ^= OneofEnum.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) hash ^= OneofNullValue.GetHashCode(); if (optionalBoolWrapper_ != null) hash ^= OptionalBoolWrapper.GetHashCode(); if (optionalInt32Wrapper_ != null) hash ^= OptionalInt32Wrapper.GetHashCode(); if (optionalInt64Wrapper_ != null) hash ^= OptionalInt64Wrapper.GetHashCode(); @@ -2739,13 +2446,11 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2910,7 +2615,7 @@ namespace ProtobufTestMessages.Proto3 { unpackedDouble_.WriteTo(output, _repeated_unpackedDouble_codec); unpackedBool_.WriteTo(output, _repeated_unpackedBool_codec); unpackedNestedEnum_.WriteTo(output, _repeated_unpackedNestedEnum_codec); - if (HasOneofUint32) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { output.WriteRawTag(248, 6); output.WriteUInt32(OneofUint32); } @@ -2918,35 +2623,35 @@ namespace ProtobufTestMessages.Proto3 { output.WriteRawTag(130, 7); output.WriteMessage(OneofNestedMessage); } - if (HasOneofString) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { output.WriteRawTag(138, 7); output.WriteString(OneofString); } - if (HasOneofBytes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { output.WriteRawTag(146, 7); output.WriteBytes(OneofBytes); } - if (HasOneofBool) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBool) { output.WriteRawTag(152, 7); output.WriteBool(OneofBool); } - if (HasOneofUint64) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint64) { output.WriteRawTag(160, 7); output.WriteUInt64(OneofUint64); } - if (HasOneofFloat) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofFloat) { output.WriteRawTag(173, 7); output.WriteFloat(OneofFloat); } - if (HasOneofDouble) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofDouble) { output.WriteRawTag(177, 7); output.WriteDouble(OneofDouble); } - if (HasOneofEnum) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) { output.WriteRawTag(184, 7); output.WriteEnum((int) OneofEnum); } - if (HasOneofNullValue) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) { output.WriteRawTag(192, 7); output.WriteEnum((int) OneofNullValue); } @@ -3101,7 +2806,6 @@ namespace ProtobufTestMessages.Proto3 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (OptionalInt32 != 0) { output.WriteRawTag(8); @@ -3263,7 +2967,7 @@ namespace ProtobufTestMessages.Proto3 { unpackedDouble_.WriteTo(ref output, _repeated_unpackedDouble_codec); unpackedBool_.WriteTo(ref output, _repeated_unpackedBool_codec); unpackedNestedEnum_.WriteTo(ref output, _repeated_unpackedNestedEnum_codec); - if (HasOneofUint32) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { output.WriteRawTag(248, 6); output.WriteUInt32(OneofUint32); } @@ -3271,35 +2975,35 @@ namespace ProtobufTestMessages.Proto3 { output.WriteRawTag(130, 7); output.WriteMessage(OneofNestedMessage); } - if (HasOneofString) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { output.WriteRawTag(138, 7); output.WriteString(OneofString); } - if (HasOneofBytes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { output.WriteRawTag(146, 7); output.WriteBytes(OneofBytes); } - if (HasOneofBool) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBool) { output.WriteRawTag(152, 7); output.WriteBool(OneofBool); } - if (HasOneofUint64) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint64) { output.WriteRawTag(160, 7); output.WriteUInt64(OneofUint64); } - if (HasOneofFloat) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofFloat) { output.WriteRawTag(173, 7); output.WriteFloat(OneofFloat); } - if (HasOneofDouble) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofDouble) { output.WriteRawTag(177, 7); output.WriteDouble(OneofDouble); } - if (HasOneofEnum) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) { output.WriteRawTag(184, 7); output.WriteEnum((int) OneofEnum); } - if (HasOneofNullValue) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) { output.WriteRawTag(192, 7); output.WriteEnum((int) OneofNullValue); } @@ -3453,7 +3157,6 @@ namespace ProtobufTestMessages.Proto3 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (OptionalInt32 != 0) { @@ -3593,34 +3296,34 @@ namespace ProtobufTestMessages.Proto3 { size += mapStringForeignMessage_.CalculateSize(_map_mapStringForeignMessage_codec); size += mapStringNestedEnum_.CalculateSize(_map_mapStringNestedEnum_codec); size += mapStringForeignEnum_.CalculateSize(_map_mapStringForeignEnum_codec); - if (HasOneofUint32) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { size += 2 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OneofNestedMessage); } - if (HasOneofString) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { size += 2 + pb::CodedOutputStream.ComputeStringSize(OneofString); } - if (HasOneofBytes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { size += 2 + pb::CodedOutputStream.ComputeBytesSize(OneofBytes); } - if (HasOneofBool) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBool) { size += 2 + 1; } - if (HasOneofUint64) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint64) { size += 2 + pb::CodedOutputStream.ComputeUInt64Size(OneofUint64); } - if (HasOneofFloat) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofFloat) { size += 2 + 4; } - if (HasOneofDouble) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofDouble) { size += 2 + 8; } - if (HasOneofEnum) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) { size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OneofEnum); } - if (HasOneofNullValue) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) { size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OneofNullValue); } if (optionalBoolWrapper_ != null) { @@ -3748,7 +3451,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllTypesProto3 other) { if (other == null) { return; @@ -3880,25 +3582,25 @@ namespace ProtobufTestMessages.Proto3 { unpackedDouble_.Add(other.unpackedDouble_); unpackedBool_.Add(other.unpackedBool_); unpackedNestedEnum_.Add(other.unpackedNestedEnum_); - mapInt32Int32_.MergeFrom(other.mapInt32Int32_); - mapInt64Int64_.MergeFrom(other.mapInt64Int64_); - mapUint32Uint32_.MergeFrom(other.mapUint32Uint32_); - mapUint64Uint64_.MergeFrom(other.mapUint64Uint64_); - mapSint32Sint32_.MergeFrom(other.mapSint32Sint32_); - mapSint64Sint64_.MergeFrom(other.mapSint64Sint64_); - mapFixed32Fixed32_.MergeFrom(other.mapFixed32Fixed32_); - mapFixed64Fixed64_.MergeFrom(other.mapFixed64Fixed64_); - mapSfixed32Sfixed32_.MergeFrom(other.mapSfixed32Sfixed32_); - mapSfixed64Sfixed64_.MergeFrom(other.mapSfixed64Sfixed64_); - mapInt32Float_.MergeFrom(other.mapInt32Float_); - mapInt32Double_.MergeFrom(other.mapInt32Double_); - mapBoolBool_.MergeFrom(other.mapBoolBool_); - mapStringString_.MergeFrom(other.mapStringString_); - mapStringBytes_.MergeFrom(other.mapStringBytes_); - mapStringNestedMessage_.MergeFrom(other.mapStringNestedMessage_); - mapStringForeignMessage_.MergeFrom(other.mapStringForeignMessage_); - mapStringNestedEnum_.MergeFrom(other.mapStringNestedEnum_); - mapStringForeignEnum_.MergeFrom(other.mapStringForeignEnum_); + mapInt32Int32_.Add(other.mapInt32Int32_); + mapInt64Int64_.Add(other.mapInt64Int64_); + mapUint32Uint32_.Add(other.mapUint32Uint32_); + mapUint64Uint64_.Add(other.mapUint64Uint64_); + mapSint32Sint32_.Add(other.mapSint32Sint32_); + mapSint64Sint64_.Add(other.mapSint64Sint64_); + mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); + mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); + mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); + mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); + mapInt32Float_.Add(other.mapInt32Float_); + mapInt32Double_.Add(other.mapInt32Double_); + mapBoolBool_.Add(other.mapBoolBool_); + mapStringString_.Add(other.mapStringString_); + mapStringBytes_.Add(other.mapStringBytes_); + mapStringNestedMessage_.Add(other.mapStringNestedMessage_); + mapStringForeignMessage_.Add(other.mapStringForeignMessage_); + mapStringNestedEnum_.Add(other.mapStringNestedEnum_); + mapStringForeignEnum_.Add(other.mapStringForeignEnum_); if (other.optionalBoolWrapper_ != null) { if (optionalBoolWrapper_ == null || other.OptionalBoolWrapper != false) { OptionalBoolWrapper = other.OptionalBoolWrapper; @@ -4093,7 +3795,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4819,7 +4520,6 @@ namespace ProtobufTestMessages.Proto3 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5543,7 +5243,6 @@ namespace ProtobufTestMessages.Proto3 { #region Nested types /// Container for nested types declared in the TestAllTypesProto3 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("FOO")] Foo = 0, @@ -5559,12 +5258,11 @@ namespace ProtobufTestMessages.Proto3 { [pbr::OriginalName("ALIAS_FOO")] AliasFoo = 0, [pbr::OriginalName("ALIAS_BAR")] AliasBar = 1, [pbr::OriginalName("ALIAS_BAZ")] AliasBaz = 2, - [pbr::OriginalName("MOO", PreferredAlias = false)] Moo = 2, - [pbr::OriginalName("moo", PreferredAlias = false)] Moo_ = 2, + [pbr::OriginalName("QUX", PreferredAlias = false)] Qux = 2, + [pbr::OriginalName("qux", PreferredAlias = false)] Qux_ = 2, [pbr::OriginalName("bAz", PreferredAlias = false)] BAz = 2, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5573,23 +5271,19 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -5597,7 +5291,6 @@ namespace ProtobufTestMessages.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { a_ = other.a_; corecursive_ = other.corecursive_ != null ? other.corecursive_.Clone() : null; @@ -5605,7 +5298,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -5614,7 +5306,6 @@ namespace ProtobufTestMessages.Proto3 { public const int AFieldNumber = 1; private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { return a_; } set { @@ -5626,7 +5317,6 @@ namespace ProtobufTestMessages.Proto3 { public const int CorecursiveFieldNumber = 2; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3 corecursive_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3 Corecursive { get { return corecursive_; } set { @@ -5635,13 +5325,11 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -5655,7 +5343,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (A != 0) hash ^= A.GetHashCode(); @@ -5667,13 +5354,11 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5694,7 +5379,6 @@ namespace ProtobufTestMessages.Proto3 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (A != 0) { output.WriteRawTag(8); @@ -5711,7 +5395,6 @@ namespace ProtobufTestMessages.Proto3 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (A != 0) { @@ -5727,7 +5410,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -5745,7 +5427,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5774,7 +5455,6 @@ namespace ProtobufTestMessages.Proto3 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5805,7 +5485,6 @@ namespace ProtobufTestMessages.Proto3 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ForeignMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5814,23 +5493,19 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage() { OnConstruction(); } @@ -5838,14 +5513,12 @@ namespace ProtobufTestMessages.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage(ForeignMessage other) : this() { c_ = other.c_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage Clone() { return new ForeignMessage(this); } @@ -5854,7 +5527,6 @@ namespace ProtobufTestMessages.Proto3 { public const int CFieldNumber = 1; private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { return c_; } set { @@ -5863,13 +5535,11 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -5882,7 +5552,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (C != 0) hash ^= C.GetHashCode(); @@ -5893,13 +5562,11 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5916,7 +5583,6 @@ namespace ProtobufTestMessages.Proto3 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (C != 0) { output.WriteRawTag(8); @@ -5929,7 +5595,6 @@ namespace ProtobufTestMessages.Proto3 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (C != 0) { @@ -5942,7 +5607,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessage other) { if (other == null) { return; @@ -5954,7 +5618,6 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5976,7 +5639,6 @@ namespace ProtobufTestMessages.Proto3 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5995,325 +5657,6 @@ namespace ProtobufTestMessages.Proto3 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class NullHypothesisProto3 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NullHypothesisProto3()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NullHypothesisProto3() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NullHypothesisProto3(NullHypothesisProto3 other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NullHypothesisProto3 Clone() { - return new NullHypothesisProto3(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as NullHypothesisProto3); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(NullHypothesisProto3 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(NullHypothesisProto3 other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumOnlyProto3 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumOnlyProto3()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOnlyProto3() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOnlyProto3(EnumOnlyProto3 other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOnlyProto3 Clone() { - return new EnumOnlyProto3(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumOnlyProto3); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumOnlyProto3 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumOnlyProto3 other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the EnumOnlyProto3 message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum Bool { - [pbr::OriginalName("kFalse")] KFalse = 0, - [pbr::OriginalName("kTrue")] KTrue = 1, - } - - } - #endregion - - } - #endregion } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs similarity index 84% rename from csharp/src/Google.Protobuf.Test.TestProtos/Unittest.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs index 8512339400cecf861163b4dc15f41d15ba5d49e0..a843c4ae8baf6e4eb405518043fa69b40566074a 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest.proto +// source: unittest.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos.Proto2 { - /// Holder for reflection information generated from csharp/protos/unittest.proto + /// Holder for reflection information generated from unittest.proto public static partial class UnittestReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest.proto + /// File descriptor for unittest.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,649 +24,648 @@ namespace Google.Protobuf.TestProtos.Proto2 { static UnittestReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chxjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0LnByb3RvEhhwcm90b2J1Zl91bml0", - "dGVzdF9wcm90bzIaI2NzaGFycC9wcm90b3MvdW5pdHRlc3RfaW1wb3J0LnBy", - "b3RvIoAaCgxUZXN0QWxsVHlwZXMSFgoOb3B0aW9uYWxfaW50MzIYASABKAUS", - "FgoOb3B0aW9uYWxfaW50NjQYAiABKAMSFwoPb3B0aW9uYWxfdWludDMyGAMg", - "ASgNEhcKD29wdGlvbmFsX3VpbnQ2NBgEIAEoBBIXCg9vcHRpb25hbF9zaW50", - "MzIYBSABKBESFwoPb3B0aW9uYWxfc2ludDY0GAYgASgSEhgKEG9wdGlvbmFs", - "X2ZpeGVkMzIYByABKAcSGAoQb3B0aW9uYWxfZml4ZWQ2NBgIIAEoBhIZChFv", - "cHRpb25hbF9zZml4ZWQzMhgJIAEoDxIZChFvcHRpb25hbF9zZml4ZWQ2NBgK", - "IAEoEBIWCg5vcHRpb25hbF9mbG9hdBgLIAEoAhIXCg9vcHRpb25hbF9kb3Vi", - "bGUYDCABKAESFQoNb3B0aW9uYWxfYm9vbBgNIAEoCBIXCg9vcHRpb25hbF9z", - "dHJpbmcYDiABKAkSFgoOb3B0aW9uYWxfYnl0ZXMYDyABKAwSSwoNb3B0aW9u", - "YWxncm91cBgQIAEoCjI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", - "QWxsVHlwZXMuT3B0aW9uYWxHcm91cBJVChdvcHRpb25hbF9uZXN0ZWRfbWVz", - "c2FnZRgSIAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxs", - "VHlwZXMuTmVzdGVkTWVzc2FnZRJKChhvcHRpb25hbF9mb3JlaWduX21lc3Nh", - "Z2UYEyABKAsyKC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbk1l", - "c3NhZ2USTwoXb3B0aW9uYWxfaW1wb3J0X21lc3NhZ2UYFCABKAsyLi5wcm90", - "b2J1Zl91bml0dGVzdF9pbXBvcnRfcHJvdG8yLkltcG9ydE1lc3NhZ2USTwoU", - "b3B0aW9uYWxfbmVzdGVkX2VudW0YFSABKA4yMS5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SRAoVb3B0aW9uYWxf", - "Zm9yZWlnbl9lbnVtGBYgASgOMiUucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", - "LkZvcmVpZ25FbnVtEkkKFG9wdGlvbmFsX2ltcG9ydF9lbnVtGBcgASgOMisu", - "cHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0X3Byb3RvMi5JbXBvcnRFbnVtEiEK", - "FW9wdGlvbmFsX3N0cmluZ19waWVjZRgYIAEoCUICCAISGQoNb3B0aW9uYWxf", - "Y29yZBgZIAEoCUICCAESXAoeb3B0aW9uYWxfcHVibGljX2ltcG9ydF9tZXNz", - "YWdlGBogASgLMjQucHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0X3Byb3RvMi5Q", - "dWJsaWNJbXBvcnRNZXNzYWdlElcKFW9wdGlvbmFsX2xhenlfbWVzc2FnZRgb", - "IAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMu", - "TmVzdGVkTWVzc2FnZUICKAESFgoOcmVwZWF0ZWRfaW50MzIYHyADKAUSFgoO", - "cmVwZWF0ZWRfaW50NjQYICADKAMSFwoPcmVwZWF0ZWRfdWludDMyGCEgAygN", - "EhcKD3JlcGVhdGVkX3VpbnQ2NBgiIAMoBBIXCg9yZXBlYXRlZF9zaW50MzIY", - "IyADKBESFwoPcmVwZWF0ZWRfc2ludDY0GCQgAygSEhgKEHJlcGVhdGVkX2Zp", - "eGVkMzIYJSADKAcSGAoQcmVwZWF0ZWRfZml4ZWQ2NBgmIAMoBhIZChFyZXBl", - "YXRlZF9zZml4ZWQzMhgnIAMoDxIZChFyZXBlYXRlZF9zZml4ZWQ2NBgoIAMo", - "EBIWCg5yZXBlYXRlZF9mbG9hdBgpIAMoAhIXCg9yZXBlYXRlZF9kb3VibGUY", - "KiADKAESFQoNcmVwZWF0ZWRfYm9vbBgrIAMoCBIXCg9yZXBlYXRlZF9zdHJp", - "bmcYLCADKAkSFgoOcmVwZWF0ZWRfYnl0ZXMYLSADKAwSSwoNcmVwZWF0ZWRn", - "cm91cBguIAMoCjI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxs", - "VHlwZXMuUmVwZWF0ZWRHcm91cBJVChdyZXBlYXRlZF9uZXN0ZWRfbWVzc2Fn", - "ZRgwIAMoCzI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlw", - "ZXMuTmVzdGVkTWVzc2FnZRJKChhyZXBlYXRlZF9mb3JlaWduX21lc3NhZ2UY", - "MSADKAsyKC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbk1lc3Nh", - "Z2USTwoXcmVwZWF0ZWRfaW1wb3J0X21lc3NhZ2UYMiADKAsyLi5wcm90b2J1", - "Zl91bml0dGVzdF9pbXBvcnRfcHJvdG8yLkltcG9ydE1lc3NhZ2USTwoUcmVw", - "ZWF0ZWRfbmVzdGVkX2VudW0YMyADKA4yMS5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SRAoVcmVwZWF0ZWRfZm9y", - "ZWlnbl9lbnVtGDQgAygOMiUucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLkZv", - "cmVpZ25FbnVtEkkKFHJlcGVhdGVkX2ltcG9ydF9lbnVtGDUgAygOMisucHJv", - "dG9idWZfdW5pdHRlc3RfaW1wb3J0X3Byb3RvMi5JbXBvcnRFbnVtEiEKFXJl", - "cGVhdGVkX3N0cmluZ19waWVjZRg2IAMoCUICCAISGQoNcmVwZWF0ZWRfY29y", - "ZBg3IAMoCUICCAESVwoVcmVwZWF0ZWRfbGF6eV9tZXNzYWdlGDkgAygLMjQu", - "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlcy5OZXN0ZWRN", - "ZXNzYWdlQgIoARIZCg1kZWZhdWx0X2ludDMyGD0gASgFOgI0MRIZCg1kZWZh", - "dWx0X2ludDY0GD4gASgDOgI0MhIaCg5kZWZhdWx0X3VpbnQzMhg/IAEoDToC", - "NDMSGgoOZGVmYXVsdF91aW50NjQYQCABKAQ6AjQ0EhsKDmRlZmF1bHRfc2lu", - "dDMyGEEgASgROgMtNDUSGgoOZGVmYXVsdF9zaW50NjQYQiABKBI6AjQ2EhsK", - "D2RlZmF1bHRfZml4ZWQzMhhDIAEoBzoCNDcSGwoPZGVmYXVsdF9maXhlZDY0", - "GEQgASgGOgI0OBIcChBkZWZhdWx0X3NmaXhlZDMyGEUgASgPOgI0ORIdChBk", - "ZWZhdWx0X3NmaXhlZDY0GEYgASgQOgMtNTASGwoNZGVmYXVsdF9mbG9hdBhH", - "IAEoAjoENTEuNRIdCg5kZWZhdWx0X2RvdWJsZRhIIAEoAToFNTIwMDASGgoM", - "ZGVmYXVsdF9ib29sGEkgASgIOgR0cnVlEh0KDmRlZmF1bHRfc3RyaW5nGEog", - "ASgJOgVoZWxsbxIcCg1kZWZhdWx0X2J5dGVzGEsgASgMOgV3b3JsZBJTChNk", - "ZWZhdWx0X25lc3RlZF9lbnVtGFEgASgOMjEucHJvdG9idWZfdW5pdHRlc3Rf", - "cHJvdG8yLlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtOgNCQVISUAoUZGVmYXVs", - "dF9mb3JlaWduX2VudW0YUiABKA4yJS5wcm90b2J1Zl91bml0dGVzdF9wcm90", - "bzIuRm9yZWlnbkVudW06C0ZPUkVJR05fQkFSElQKE2RlZmF1bHRfaW1wb3J0", - "X2VudW0YUyABKA4yKy5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnRfcHJvdG8y", - "LkltcG9ydEVudW06CklNUE9SVF9CQVISJQoUZGVmYXVsdF9zdHJpbmdfcGll", - "Y2UYVCABKAk6A2FiY0ICCAISHQoMZGVmYXVsdF9jb3JkGFUgASgJOgMxMjNC", - "AggBEhYKDG9uZW9mX3VpbnQzMhhvIAEoDUgAElQKFG9uZW9mX25lc3RlZF9t", - "ZXNzYWdlGHAgASgLMjQucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RB", - "bGxUeXBlcy5OZXN0ZWRNZXNzYWdlSAASFgoMb25lb2Zfc3RyaW5nGHEgASgJ", - "SAASFQoLb25lb2ZfYnl0ZXMYciABKAxIABobCg1OZXN0ZWRNZXNzYWdlEgoK", - "AmJiGAEgASgFGhoKDU9wdGlvbmFsR3JvdXASCQoBYRgRIAEoBRoaCg1SZXBl", - "YXRlZEdyb3VwEgkKAWEYLyABKAUiOQoKTmVzdGVkRW51bRIHCgNGT08QARIH", - "CgNCQVIQAhIHCgNCQVoQAxIQCgNORUcQ////////////AUINCgtvbmVvZl9m", - "aWVsZCLQAQoSTmVzdGVkVGVzdEFsbFR5cGVzEjsKBWNoaWxkGAEgASgLMiwu", - "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLk5lc3RlZFRlc3RBbGxUeXBlcxI3", - "CgdwYXlsb2FkGAIgASgLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RBbGxUeXBlcxJECg5yZXBlYXRlZF9jaGlsZBgDIAMoCzIsLnByb3RvYnVm", - "X3VuaXR0ZXN0X3Byb3RvMi5OZXN0ZWRUZXN0QWxsVHlwZXMibQoUVGVzdERl", - "cHJlY2F0ZWRGaWVsZHMSHAoQZGVwcmVjYXRlZF9pbnQzMhgBIAEoBUICGAES", - "JwoZZGVwcmVjYXRlZF9pbnQzMl9pbl9vbmVvZhgCIAEoBUICGAFIAEIOCgxv", - "bmVvZl9maWVsZHMiGwoVVGVzdERlcHJlY2F0ZWRNZXNzYWdlOgIYASImCg5G", - "b3JlaWduTWVzc2FnZRIJCgFjGAEgASgFEgkKAWQYAiABKAUiMAoSVGVzdFJl", - "c2VydmVkRmllbGRzSgQIAhADSgQIDxAQSgQICRAMUgNiYXJSA2JheiIdChFU", - "ZXN0QWxsRXh0ZW5zaW9ucyoICAEQgICAgAIiJAoXT3B0aW9uYWxHcm91cF9l", - "eHRlbnNpb24SCQoBYRgRIAEoBSIkChdSZXBlYXRlZEdyb3VwX2V4dGVuc2lv", - "bhIJCgFhGC8gASgFIrcBCglUZXN0R3JvdXASSAoNb3B0aW9uYWxncm91cBgQ", - "IAEoCjIxLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0R3JvdXAuT3B0", - "aW9uYWxHcm91cBJEChVvcHRpb25hbF9mb3JlaWduX2VudW0YFiABKA4yJS5w", - "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW0aGgoNT3B0aW9u", - "YWxHcm91cBIJCgFhGBEgASgFIh4KElRlc3RHcm91cEV4dGVuc2lvbioICAEQ", - "gICAgAIi4QMKE1Rlc3ROZXN0ZWRFeHRlbnNpb24aJAoXT3B0aW9uYWxHcm91", - "cF9leHRlbnNpb24SCQoBYRgRIAEoBTJACgR0ZXN0EisucHJvdG9idWZfdW5p", - "dHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGOoHIAEoCToEdGVzdDJN", - "ChduZXN0ZWRfc3RyaW5nX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0", - "X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxjrByABKAkylAEKF29wdGlvbmFs", - "Z3JvdXBfZXh0ZW5zaW9uEiwucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RHcm91cEV4dGVuc2lvbhgQIAEoCjJFLnByb3RvYnVmX3VuaXR0ZXN0X3By", - "b3RvMi5UZXN0TmVzdGVkRXh0ZW5zaW9uLk9wdGlvbmFsR3JvdXBfZXh0ZW5z", - "aW9uMnwKH29wdGlvbmFsX2ZvcmVpZ25fZW51bV9leHRlbnNpb24SLC5wcm90", - "b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEdyb3VwRXh0ZW5zaW9uGBYgASgO", - "MiUucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLkZvcmVpZ25FbnVtIvEFCgxU", - "ZXN0UmVxdWlyZWQSCQoBYRgBIAIoBRIOCgZkdW1teTIYAiABKAUSCQoBYhgD", - "IAIoBRIOCgZkdW1teTQYBCABKAUSDgoGZHVtbXk1GAUgASgFEg4KBmR1bW15", - "NhgGIAEoBRIOCgZkdW1teTcYByABKAUSDgoGZHVtbXk4GAggASgFEg4KBmR1", - "bW15ORgJIAEoBRIPCgdkdW1teTEwGAogASgFEg8KB2R1bW15MTEYCyABKAUS", - "DwoHZHVtbXkxMhgMIAEoBRIPCgdkdW1teTEzGA0gASgFEg8KB2R1bW15MTQY", - "DiABKAUSDwoHZHVtbXkxNRgPIAEoBRIPCgdkdW1teTE2GBAgASgFEg8KB2R1", - "bW15MTcYESABKAUSDwoHZHVtbXkxOBgSIAEoBRIPCgdkdW1teTE5GBMgASgF", - "Eg8KB2R1bW15MjAYFCABKAUSDwoHZHVtbXkyMRgVIAEoBRIPCgdkdW1teTIy", - "GBYgASgFEg8KB2R1bW15MjMYFyABKAUSDwoHZHVtbXkyNBgYIAEoBRIPCgdk", - "dW1teTI1GBkgASgFEg8KB2R1bW15MjYYGiABKAUSDwoHZHVtbXkyNxgbIAEo", - "BRIPCgdkdW1teTI4GBwgASgFEg8KB2R1bW15MjkYHSABKAUSDwoHZHVtbXkz", - "MBgeIAEoBRIPCgdkdW1teTMxGB8gASgFEg8KB2R1bW15MzIYICABKAUSCQoB", - "YxghIAIoBTJkCgZzaW5nbGUSKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "VGVzdEFsbEV4dGVuc2lvbnMY6AcgASgLMiYucHJvdG9idWZfdW5pdHRlc3Rf", - "cHJvdG8yLlRlc3RSZXF1aXJlZDJjCgVtdWx0aRIrLnByb3RvYnVmX3VuaXR0", - "ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxjpByADKAsyJi5wcm90b2J1", - "Zl91bml0dGVzdF9wcm90bzIuVGVzdFJlcXVpcmVkIqgBChNUZXN0UmVxdWly", - "ZWRGb3JlaWduEkAKEG9wdGlvbmFsX21lc3NhZ2UYASABKAsyJi5wcm90b2J1", - "Zl91bml0dGVzdF9wcm90bzIuVGVzdFJlcXVpcmVkEkAKEHJlcGVhdGVkX21l", - "c3NhZ2UYAiADKAsyJi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFJl", - "cXVpcmVkEg0KBWR1bW15GAMgASgFItsBChNUZXN0UmVxdWlyZWRNZXNzYWdl", - "EkAKEG9wdGlvbmFsX21lc3NhZ2UYASABKAsyJi5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdFJlcXVpcmVkEkAKEHJlcGVhdGVkX21lc3NhZ2UYAiAD", - "KAsyJi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFJlcXVpcmVkEkAK", - "EHJlcXVpcmVkX21lc3NhZ2UYAyACKAsyJi5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdFJlcXVpcmVkImEKEVRlc3RGb3JlaWduTmVzdGVkEkwKDmZv", - "cmVpZ25fbmVzdGVkGAEgASgLMjQucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", - "LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlIhIKEFRlc3RFbXB0eU1lc3Nh", - "Z2UiKgoeVGVzdEVtcHR5TWVzc2FnZVdpdGhFeHRlbnNpb25zKggIARCAgICA", - "AiI3ChtUZXN0TXVsdGlwbGVFeHRlbnNpb25SYW5nZXMqBAgqECsqBgivIBCU", - "ISoKCICABBCAgICAAiI0ChhUZXN0UmVhbGx5TGFyZ2VUYWdOdW1iZXISCQoB", - "YRgBIAEoBRINCgJiYhj///9/IAEoBSJcChRUZXN0UmVjdXJzaXZlTWVzc2Fn", - "ZRI5CgFhGAEgASgLMi4ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RS", - "ZWN1cnNpdmVNZXNzYWdlEgkKAWkYAiABKAUihAMKFFRlc3RNdXR1YWxSZWN1", - "cnNpb25BEjoKAmJiGAEgASgLMi4ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", - "LlRlc3RNdXR1YWxSZWN1cnNpb25CEkkKCHN1Ymdyb3VwGAIgASgKMjcucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RNdXR1YWxSZWN1cnNpb25BLlN1", - "Ykdyb3VwGkcKClN1Yk1lc3NhZ2USOQoBYhgBIAEoCzIuLnByb3RvYnVmX3Vu", - "aXR0ZXN0X3Byb3RvMi5UZXN0TXV0dWFsUmVjdXJzaW9uQhqbAQoIU3ViR3Jv", - "dXASTgoLc3ViX21lc3NhZ2UYAyABKAsyOS5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdE11dHVhbFJlY3Vyc2lvbkEuU3ViTWVzc2FnZRI/Cg9ub3Rf", - "aW5fdGhpc19zY2MYBCABKAsyJi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "VGVzdEFsbFR5cGVzImkKFFRlc3RNdXR1YWxSZWN1cnNpb25CEjkKAWEYASAB", - "KAsyLi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdE11dHVhbFJlY3Vy", - "c2lvbkESFgoOb3B0aW9uYWxfaW50MzIYAiABKAUi2AEKEVRlc3RJc0luaXRp", - "YWxpemVkEksKC3N1Yl9tZXNzYWdlGAEgASgLMjYucHJvdG9idWZfdW5pdHRl", - "c3RfcHJvdG8yLlRlc3RJc0luaXRpYWxpemVkLlN1Yk1lc3NhZ2UadgoKU3Vi", - "TWVzc2FnZRJRCghzdWJncm91cBgBIAEoCjI/LnByb3RvYnVmX3VuaXR0ZXN0", - "X3Byb3RvMi5UZXN0SXNJbml0aWFsaXplZC5TdWJNZXNzYWdlLlN1Ykdyb3Vw", - "GhUKCFN1Ykdyb3VwEgkKAWkYAiACKAUiwQEKElRlc3REdXBGaWVsZE51bWJl", - "chIJCgFhGAEgASgFEj0KA2ZvbxgCIAEoCjIwLnByb3RvYnVmX3VuaXR0ZXN0", - "X3Byb3RvMi5UZXN0RHVwRmllbGROdW1iZXIuRm9vEj0KA2JhchgDIAEoCjIw", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0RHVwRmllbGROdW1iZXIu", - "QmFyGhAKA0ZvbxIJCgFhGAEgASgFGhAKA0JhchIJCgFhGAEgASgFIlMKEFRl", - "c3RFYWdlck1lc3NhZ2USPwoLc3ViX21lc3NhZ2UYASABKAsyJi5wcm90b2J1", - "Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzQgIoACJSCg9UZXN0TGF6", - "eU1lc3NhZ2USPwoLc3ViX21lc3NhZ2UYASABKAsyJi5wcm90b2J1Zl91bml0", - "dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzQgIoASKOAgoYVGVzdE5lc3RlZE1l", - "c3NhZ2VIYXNCaXRzEmEKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGAEgASgL", - "MkAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3ROZXN0ZWRNZXNzYWdl", - "SGFzQml0cy5OZXN0ZWRNZXNzYWdlGo4BCg1OZXN0ZWRNZXNzYWdlEiQKHG5l", - "c3RlZG1lc3NhZ2VfcmVwZWF0ZWRfaW50MzIYASADKAUSVwolbmVzdGVkbWVz", - "c2FnZV9yZXBlYXRlZF9mb3JlaWdubWVzc2FnZRgCIAMoCzIoLnByb3RvYnVm", - "X3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduTWVzc2FnZSKBBAoXVGVzdENhbWVs", - "Q2FzZUZpZWxkTmFtZXMSFgoOUHJpbWl0aXZlRmllbGQYASABKAUSEwoLU3Ry", - "aW5nRmllbGQYAiABKAkSOAoJRW51bUZpZWxkGAMgASgOMiUucHJvdG9idWZf", - "dW5pdHRlc3RfcHJvdG8yLkZvcmVpZ25FbnVtEj4KDE1lc3NhZ2VGaWVsZBgE", - "IAEoCzIoLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduTWVzc2Fn", - "ZRIcChBTdHJpbmdQaWVjZUZpZWxkGAUgASgJQgIIAhIVCglDb3JkRmllbGQY", - "BiABKAlCAggBEh4KFlJlcGVhdGVkUHJpbWl0aXZlRmllbGQYByADKAUSGwoT", - "UmVwZWF0ZWRTdHJpbmdGaWVsZBgIIAMoCRJAChFSZXBlYXRlZEVudW1GaWVs", - "ZBgJIAMoDjIlLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduRW51", - "bRJGChRSZXBlYXRlZE1lc3NhZ2VGaWVsZBgKIAMoCzIoLnByb3RvYnVmX3Vu", - "aXR0ZXN0X3Byb3RvMi5Gb3JlaWduTWVzc2FnZRIkChhSZXBlYXRlZFN0cmlu", - "Z1BpZWNlRmllbGQYCyADKAlCAggCEh0KEVJlcGVhdGVkQ29yZEZpZWxkGAwg", - "AygJQgIIASLcAQoSVGVzdEZpZWxkT3JkZXJpbmdzEhEKCW15X3N0cmluZxgL", - "IAEoCRIOCgZteV9pbnQYASABKAMSEAoIbXlfZmxvYXQYZSABKAISXAoXb3B0", - "aW9uYWxfbmVzdGVkX21lc3NhZ2UYyAEgASgLMjoucHJvdG9idWZfdW5pdHRl", - "c3RfcHJvdG8yLlRlc3RGaWVsZE9yZGVyaW5ncy5OZXN0ZWRNZXNzYWdlGicK", - "DU5lc3RlZE1lc3NhZ2USCgoCb28YAiABKAMSCgoCYmIYASABKAUqBAgCEAsq", - "BAgMEGUiqgEKF1Rlc3RFeHRlbnNpb25PcmRlcmluZ3MxEhEKCW15X3N0cmlu", - "ZxgBIAEoCTJ8ChN0ZXN0X2V4dF9vcmRlcmluZ3MxEiwucHJvdG9idWZfdW5p", - "dHRlc3RfcHJvdG8yLlRlc3RGaWVsZE9yZGVyaW5ncxgNIAEoCzIxLnByb3Rv", - "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0RXh0ZW5zaW9uT3JkZXJpbmdzMSLw", - "AgoXVGVzdEV4dGVuc2lvbk9yZGVyaW5nczISEQoJbXlfc3RyaW5nGAEgASgJ", - "GsMBChdUZXN0RXh0ZW5zaW9uT3JkZXJpbmdzMxIRCglteV9zdHJpbmcYASAB", - "KAkylAEKE3Rlc3RfZXh0X29yZGVyaW5nczMSLC5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdEZpZWxkT3JkZXJpbmdzGA4gASgLMkkucHJvdG9idWZf", - "dW5pdHRlc3RfcHJvdG8yLlRlc3RFeHRlbnNpb25PcmRlcmluZ3MyLlRlc3RF", - "eHRlbnNpb25PcmRlcmluZ3MzMnwKE3Rlc3RfZXh0X29yZGVyaW5nczISLC5w", - "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEZpZWxkT3JkZXJpbmdzGAwg", - "ASgLMjEucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RFeHRlbnNpb25P", - "cmRlcmluZ3MyIrYHChhUZXN0RXh0cmVtZURlZmF1bHRWYWx1ZXMSPwoNZXNj", - "YXBlZF9ieXRlcxgBIAEoDDooXDAwMFwwMDFcMDA3XDAxMFwwMTRcblxyXHRc", - "MDEzXFxcJ1wiXDM3NhIgCgxsYXJnZV91aW50MzIYAiABKA06CjQyOTQ5Njcy", - "OTUSKgoMbGFyZ2VfdWludDY0GAMgASgEOhQxODQ0Njc0NDA3MzcwOTU1MTYx", - "NRIgCgtzbWFsbF9pbnQzMhgEIAEoBToLLTIxNDc0ODM2NDcSKQoLc21hbGxf", - "aW50NjQYBSABKAM6FC05MjIzMzcyMDM2ODU0Nzc1ODA3EicKEnJlYWxseV9z", - "bWFsbF9pbnQzMhgVIAEoBToLLTIxNDc0ODM2NDgSMAoScmVhbGx5X3NtYWxs", - "X2ludDY0GBYgASgDOhQtOTIyMzM3MjAzNjg1NDc3NTgwOBIYCgt1dGY4X3N0", - "cmluZxgGIAEoCToD4Yi0EhUKCnplcm9fZmxvYXQYByABKAI6ATASFAoJb25l", - "X2Zsb2F0GAggASgCOgExEhgKC3NtYWxsX2Zsb2F0GAkgASgCOgMxLjUSHgoS", - "bmVnYXRpdmVfb25lX2Zsb2F0GAogASgCOgItMRIcCg5uZWdhdGl2ZV9mbG9h", - "dBgLIAEoAjoELTEuNRIaCgtsYXJnZV9mbG9hdBgMIAEoAjoFMmUrMDgSJAoU", - "c21hbGxfbmVnYXRpdmVfZmxvYXQYDSABKAI6Bi04ZS0yOBIXCgppbmZfZG91", - "YmxlGA4gASgBOgNpbmYSHAoObmVnX2luZl9kb3VibGUYDyABKAE6BC1pbmYS", - "FwoKbmFuX2RvdWJsZRgQIAEoAToDbmFuEhYKCWluZl9mbG9hdBgRIAEoAjoD", - "aW5mEhsKDW5lZ19pbmZfZmxvYXQYEiABKAI6BC1pbmYSFgoJbmFuX2Zsb2F0", - "GBMgASgCOgNuYW4SKwoMY3BwX3RyaWdyYXBoGBQgASgJOhU/ID8gPz8gPz8g", - "Pz8/ID8/LyA/Py0SIAoQc3RyaW5nX3dpdGhfemVybxgXIAEoCToGaGVsAGxv", - "EiIKD2J5dGVzX3dpdGhfemVybxgYIAEoDDoJd29yXDAwMGxkEigKFnN0cmlu", - "Z19waWVjZV93aXRoX3plcm8YGSABKAk6BGFiAGNCAggCEiAKDmNvcmRfd2l0", - "aF96ZXJvGBogASgJOgQxMgAzQgIIARImChJyZXBsYWNlbWVudF9zdHJpbmcY", - "GyABKAk6CiR7dW5rbm93bn0iUgoRU3BhcnNlRW51bU1lc3NhZ2USPQoLc3Bh", - "cnNlX2VudW0YASABKA4yKC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dFNwYXJzZUVudW0iGQoJT25lU3RyaW5nEgwKBGRhdGEYASABKAkiGgoKTW9y", - "ZVN0cmluZxIMCgRkYXRhGAEgAygJIhgKCE9uZUJ5dGVzEgwKBGRhdGEYASAB", - "KAwiGQoJTW9yZUJ5dGVzEgwKBGRhdGEYASADKAwiHAoMSW50MzJNZXNzYWdl", - "EgwKBGRhdGEYASABKAUiHQoNVWludDMyTWVzc2FnZRIMCgRkYXRhGAEgASgN", - "IhwKDEludDY0TWVzc2FnZRIMCgRkYXRhGAEgASgDIh0KDVVpbnQ2NE1lc3Nh", - "Z2USDAoEZGF0YRgBIAEoBCIbCgtCb29sTWVzc2FnZRIMCgRkYXRhGAEgASgI", - "It4BCglUZXN0T25lb2YSEQoHZm9vX2ludBgBIAEoBUgAEhQKCmZvb19zdHJp", - "bmcYAiABKAlIABI9Cgtmb29fbWVzc2FnZRgDIAEoCzImLnByb3RvYnVmX3Vu", - "aXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXNIABJACghmb29ncm91cBgEIAEo", - "CjIsLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0T25lb2YuRm9vR3Jv", - "dXBIABogCghGb29Hcm91cBIJCgFhGAUgASgFEgkKAWIYBiABKAlCBQoDZm9v", - "IvUBChxUZXN0T25lb2ZCYWNrd2FyZHNDb21wYXRpYmxlEg8KB2Zvb19pbnQY", - "ASABKAUSEgoKZm9vX3N0cmluZxgCIAEoCRI7Cgtmb29fbWVzc2FnZRgDIAEo", - "CzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMSUQoI", - "Zm9vZ3JvdXAYBCABKAoyPy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dE9uZW9mQmFja3dhcmRzQ29tcGF0aWJsZS5Gb29Hcm91cBogCghGb29Hcm91", - "cBIJCgFhGAUgASgFEgkKAWIYBiABKAkiwQYKClRlc3RPbmVvZjISEQoHZm9v", - "X2ludBgBIAEoBUgAEhQKCmZvb19zdHJpbmcYAiABKAlIABIWCghmb29fY29y", - "ZBgDIAEoCUICCAFIABIeChBmb29fc3RyaW5nX3BpZWNlGAQgASgJQgIIAkgA", - "EhMKCWZvb19ieXRlcxgFIAEoDEgAEkMKCGZvb19lbnVtGAYgASgOMi8ucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RPbmVvZjIuTmVzdGVkRW51bUgA", - "EkkKC2Zvb19tZXNzYWdlGAcgASgLMjIucHJvdG9idWZfdW5pdHRlc3RfcHJv", - "dG8yLlRlc3RPbmVvZjIuTmVzdGVkTWVzc2FnZUgAEkEKCGZvb2dyb3VwGAgg", - "ASgKMi0ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RPbmVvZjIuRm9v", - "R3JvdXBIABJSChBmb29fbGF6eV9tZXNzYWdlGAsgASgLMjIucHJvdG9idWZf", - "dW5pdHRlc3RfcHJvdG8yLlRlc3RPbmVvZjIuTmVzdGVkTWVzc2FnZUICKAFI", - "ABIUCgdiYXJfaW50GAwgASgFOgE1SAESHAoKYmFyX3N0cmluZxgNIAEoCToG", - "U1RSSU5HSAESHAoIYmFyX2NvcmQYDiABKAk6BENPUkRCAggBSAESJgoQYmFy", - "X3N0cmluZ19waWVjZRgPIAEoCToGU1BJRUNFQgIIAkgBEhoKCWJhcl9ieXRl", - "cxgQIAEoDDoFQllURVNIARJICghiYXJfZW51bRgRIAEoDjIvLnByb3RvYnVm", - "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0T25lb2YyLk5lc3RlZEVudW06A0JBUkgB", - "Eg8KB2Jhel9pbnQYEiABKAUSFwoKYmF6X3N0cmluZxgTIAEoCToDQkFaGiAK", - "CEZvb0dyb3VwEgkKAWEYCSABKAUSCQoBYhgKIAEoCRozCg1OZXN0ZWRNZXNz", - "YWdlEg8KB3F1eF9pbnQYASABKAMSEQoJY29yZ2VfaW50GAIgAygFIicKCk5l", - "c3RlZEVudW0SBwoDRk9PEAESBwoDQkFSEAISBwoDQkFaEANCBQoDZm9vQgUK", - "A2JhciK/AQoRVGVzdFJlcXVpcmVkT25lb2YSEQoHZm9vX2ludBgBIAEoBUgA", - "EhQKCmZvb19zdHJpbmcYAiABKAlIABJQCgtmb29fbWVzc2FnZRgDIAEoCzI5", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UmVxdWlyZWRPbmVvZi5O", - "ZXN0ZWRNZXNzYWdlSAAaKAoNTmVzdGVkTWVzc2FnZRIXCg9yZXF1aXJlZF9k", - "b3VibGUYASACKAFCBQoDZm9vIuABCg9UZXN0UmVxdWlyZWRNYXASPwoDZm9v", - "GAEgAygLMjIucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RSZXF1aXJl", - "ZE1hcC5Gb29FbnRyeRpjCghGb29FbnRyeRILCgNrZXkYASABKAUSRgoFdmFs", - "dWUYAiABKAsyNy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFJlcXVp", - "cmVkTWFwLk5lc3RlZE1lc3NhZ2U6AjgBGicKDU5lc3RlZE1lc3NhZ2USFgoO", - "cmVxdWlyZWRfaW50MzIYASACKAUisQMKD1Rlc3RQYWNrZWRUeXBlcxIYCgxw", - "YWNrZWRfaW50MzIYWiADKAVCAhABEhgKDHBhY2tlZF9pbnQ2NBhbIAMoA0IC", - "EAESGQoNcGFja2VkX3VpbnQzMhhcIAMoDUICEAESGQoNcGFja2VkX3VpbnQ2", - "NBhdIAMoBEICEAESGQoNcGFja2VkX3NpbnQzMhheIAMoEUICEAESGQoNcGFj", - "a2VkX3NpbnQ2NBhfIAMoEkICEAESGgoOcGFja2VkX2ZpeGVkMzIYYCADKAdC", - "AhABEhoKDnBhY2tlZF9maXhlZDY0GGEgAygGQgIQARIbCg9wYWNrZWRfc2Zp", - "eGVkMzIYYiADKA9CAhABEhsKD3BhY2tlZF9zZml4ZWQ2NBhjIAMoEEICEAES", - "GAoMcGFja2VkX2Zsb2F0GGQgAygCQgIQARIZCg1wYWNrZWRfZG91YmxlGGUg", - "AygBQgIQARIXCgtwYWNrZWRfYm9vbBhmIAMoCEICEAESPgoLcGFja2VkX2Vu", - "dW0YZyADKA4yJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVu", - "dW1CAhABIs8DChFUZXN0VW5wYWNrZWRUeXBlcxIaCg51bnBhY2tlZF9pbnQz", - "MhhaIAMoBUICEAASGgoOdW5wYWNrZWRfaW50NjQYWyADKANCAhAAEhsKD3Vu", - "cGFja2VkX3VpbnQzMhhcIAMoDUICEAASGwoPdW5wYWNrZWRfdWludDY0GF0g", - "AygEQgIQABIbCg91bnBhY2tlZF9zaW50MzIYXiADKBFCAhAAEhsKD3VucGFj", - "a2VkX3NpbnQ2NBhfIAMoEkICEAASHAoQdW5wYWNrZWRfZml4ZWQzMhhgIAMo", - "B0ICEAASHAoQdW5wYWNrZWRfZml4ZWQ2NBhhIAMoBkICEAASHQoRdW5wYWNr", - "ZWRfc2ZpeGVkMzIYYiADKA9CAhAAEh0KEXVucGFja2VkX3NmaXhlZDY0GGMg", - "AygQQgIQABIaCg51bnBhY2tlZF9mbG9hdBhkIAMoAkICEAASGwoPdW5wYWNr", - "ZWRfZG91YmxlGGUgAygBQgIQABIZCg11bnBhY2tlZF9ib29sGGYgAygIQgIQ", - "ABJACg11bnBhY2tlZF9lbnVtGGcgAygOMiUucHJvdG9idWZfdW5pdHRlc3Rf", - "cHJvdG8yLkZvcmVpZ25FbnVtQgIQACIgChRUZXN0UGFja2VkRXh0ZW5zaW9u", - "cyoICAEQgICAgAIiIgoWVGVzdFVucGFja2VkRXh0ZW5zaW9ucyoICAEQgICA", - "gAIitQQKFVRlc3REeW5hbWljRXh0ZW5zaW9ucxIZChBzY2FsYXJfZXh0ZW5z", - "aW9uGNAPIAEoBxI+Cg5lbnVtX2V4dGVuc2lvbhjRDyABKA4yJS5wcm90b2J1", - "Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW0SYAoWZHluYW1pY19lbnVt", - "X2V4dGVuc2lvbhjSDyABKA4yPy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "VGVzdER5bmFtaWNFeHRlbnNpb25zLkR5bmFtaWNFbnVtVHlwZRJEChFtZXNz", - "YWdlX2V4dGVuc2lvbhjTDyABKAsyKC5wcm90b2J1Zl91bml0dGVzdF9wcm90", - "bzIuRm9yZWlnbk1lc3NhZ2USZgoZZHluYW1pY19tZXNzYWdlX2V4dGVuc2lv", - "bhjUDyABKAsyQi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdER5bmFt", - "aWNFeHRlbnNpb25zLkR5bmFtaWNNZXNzYWdlVHlwZRIbChJyZXBlYXRlZF9l", - "eHRlbnNpb24Y1Q8gAygJEh0KEHBhY2tlZF9leHRlbnNpb24Y1g8gAygRQgIQ", - "ARosChJEeW5hbWljTWVzc2FnZVR5cGUSFgoNZHluYW1pY19maWVsZBi0ECAB", - "KAUiRwoPRHluYW1pY0VudW1UeXBlEhAKC0RZTkFNSUNfRk9PEJgREhAKC0RZ", - "TkFNSUNfQkFSEJkREhAKC0RZTkFNSUNfQkFaEJoRIsABCiNUZXN0UmVwZWF0", - "ZWRTY2FsYXJEaWZmZXJlbnRUYWdTaXplcxIYChByZXBlYXRlZF9maXhlZDMy", - "GAwgAygHEhYKDnJlcGVhdGVkX2ludDMyGA0gAygFEhkKEHJlcGVhdGVkX2Zp", - "eGVkNjQY/g8gAygGEhcKDnJlcGVhdGVkX2ludDY0GP8PIAMoAxIYCg5yZXBl", - "YXRlZF9mbG9hdBj+/w8gAygCEhkKD3JlcGVhdGVkX3VpbnQ2NBj//w8gAygE", - "IoMLChBUZXN0UGFyc2luZ01lcmdlEkIKEnJlcXVpcmVkX2FsbF90eXBlcxgB", - "IAIoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMS", - "QgoSb3B0aW9uYWxfYWxsX3R5cGVzGAIgASgLMiYucHJvdG9idWZfdW5pdHRl", - "c3RfcHJvdG8yLlRlc3RBbGxUeXBlcxJCChJyZXBlYXRlZF9hbGxfdHlwZXMY", - "AyADKAsyJi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVz", - "Ek8KDW9wdGlvbmFsZ3JvdXAYCiABKAoyOC5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdFBhcnNpbmdNZXJnZS5PcHRpb25hbEdyb3VwEk8KDXJlcGVh", - "dGVkZ3JvdXAYFCADKAoyOC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dFBhcnNpbmdNZXJnZS5SZXBlYXRlZEdyb3VwGukEChdSZXBlYXRlZEZpZWxk", - "c0dlbmVyYXRvchI2CgZmaWVsZDEYASADKAsyJi5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdEFsbFR5cGVzEjYKBmZpZWxkMhgCIAMoCzImLnByb3Rv", - "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMSNgoGZmllbGQzGAMg", - "AygLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlcxJZ", - "CgZncm91cDEYCiADKAoySS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dFBhcnNpbmdNZXJnZS5SZXBlYXRlZEZpZWxkc0dlbmVyYXRvci5Hcm91cDES", - "WQoGZ3JvdXAyGBQgAygKMkkucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RQYXJzaW5nTWVyZ2UuUmVwZWF0ZWRGaWVsZHNHZW5lcmF0b3IuR3JvdXAy", - "EjUKBGV4dDEY6AcgAygLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RBbGxUeXBlcxI1CgRleHQyGOkHIAMoCzImLnByb3RvYnVmX3VuaXR0ZXN0", - "X3Byb3RvMi5UZXN0QWxsVHlwZXMaQAoGR3JvdXAxEjYKBmZpZWxkMRgLIAEo", - "CzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMaQAoG", - "R3JvdXAyEjYKBmZpZWxkMRgVIAEoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3By", - "b3RvMi5UZXN0QWxsVHlwZXMaWQoNT3B0aW9uYWxHcm91cBJIChhvcHRpb25h", - "bF9ncm91cF9hbGxfdHlwZXMYCyABKAsyJi5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdEFsbFR5cGVzGlkKDVJlcGVhdGVkR3JvdXASSAoYcmVwZWF0", - "ZWRfZ3JvdXBfYWxsX3R5cGVzGBUgASgLMiYucHJvdG9idWZfdW5pdHRlc3Rf", - "cHJvdG8yLlRlc3RBbGxUeXBlcyoJCOgHEICAgIACMmkKDG9wdGlvbmFsX2V4", - "dBIqLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UGFyc2luZ01lcmdl", - "GOgHIAEoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlw", - "ZXMyaQoMcmVwZWF0ZWRfZXh0EioucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", - "LlRlc3RQYXJzaW5nTWVyZ2UY6QcgAygLMiYucHJvdG9idWZfdW5pdHRlc3Rf", - "cHJvdG8yLlRlc3RBbGxUeXBlcyJEChtUZXN0Q29tbWVudEluamVjdGlvbk1l", - "c3NhZ2USJQoBYRgBIAEoCToaKi8gPC0gTmVpdGhlciBzaG91bGQgdGhpcy4i", - "DAoKRm9vUmVxdWVzdCINCgtGb29SZXNwb25zZSISChBGb29DbGllbnRNZXNz", - "YWdlIhIKEEZvb1NlcnZlck1lc3NhZ2UiDAoKQmFyUmVxdWVzdCINCgtCYXJS", - "ZXNwb25zZSKSAQoMVGVzdEpzb25OYW1lEhMKC2ZpZWxkX25hbWUxGAEgASgF", - "EhIKCmZpZWxkTmFtZTIYAiABKAUSEgoKRmllbGROYW1lMxgDIAEoBRIUCgxf", - "ZmllbGRfbmFtZTQYBCABKAUSEwoLRklFTERfTkFNRTUYBSABKAUSGgoLZmll", - "bGRfbmFtZTYYBiABKAVSBUB0eXBlIqAGChRUZXN0SHVnZUZpZWxkTnVtYmVy", - "cxIaCg5vcHRpb25hbF9pbnQzMhjw+P//ASABKAUSFAoIZml4ZWRfMzIY8fj/", - "/wEgASgFEh4KDnJlcGVhdGVkX2ludDMyGPL4//8BIAMoBUICEAASHAoMcGFj", - "a2VkX2ludDMyGPP4//8BIAMoBUICEAESQAoNb3B0aW9uYWxfZW51bRj0+P//", - "ASABKA4yJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW0S", - "GwoPb3B0aW9uYWxfc3RyaW5nGPX4//8BIAEoCRIaCg5vcHRpb25hbF9ieXRl", - "cxj2+P//ASABKAwSRgoQb3B0aW9uYWxfbWVzc2FnZRj3+P//ASABKAsyKC5w", - "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbk1lc3NhZ2USVwoNb3B0", - "aW9uYWxncm91cBj4+P//ASABKAoyPC5wcm90b2J1Zl91bml0dGVzdF9wcm90", - "bzIuVGVzdEh1Z2VGaWVsZE51bWJlcnMuT3B0aW9uYWxHcm91cBJiChFzdHJp", - "bmdfc3RyaW5nX21hcBj6+P//ASADKAsyQy5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdEh1Z2VGaWVsZE51bWJlcnMuU3RyaW5nU3RyaW5nTWFwRW50", - "cnkSGgoMb25lb2ZfdWludDMyGPv4//8BIAEoDUgAEkoKFG9uZW9mX3Rlc3Rf", - "YWxsX3R5cGVzGPz4//8BIAEoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", - "Mi5UZXN0QWxsVHlwZXNIABIaCgxvbmVvZl9zdHJpbmcY/fj//wEgASgJSAAS", - "GQoLb25lb2ZfYnl0ZXMY/vj//wEgASgMSAAaJAoNT3B0aW9uYWxHcm91cBIT", - "Cgdncm91cF9hGPn4//8BIAEoBRo2ChRTdHJpbmdTdHJpbmdNYXBFbnRyeRIL", - "CgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBKgwI4Kr//wEQ8Pj//wFC", - "DQoLb25lb2ZfZmllbGQisQEKGFRlc3RFeHRlbnNpb25JbnNpZGVUYWJsZRIO", - "CgZmaWVsZDEYASABKAUSDgoGZmllbGQyGAIgASgFEg4KBmZpZWxkMxgDIAEo", - "BRIOCgZmaWVsZDQYBCABKAUSDgoGZmllbGQ2GAYgASgFEg4KBmZpZWxkNxgH", - "IAEoBRIOCgZmaWVsZDgYCCABKAUSDgoGZmllbGQ5GAkgASgFEg8KB2ZpZWxk", - "MTAYCiABKAUqBAgFEAYqQAoLRm9yZWlnbkVudW0SDwoLRk9SRUlHTl9GT08Q", - "BBIPCgtGT1JFSUdOX0JBUhAFEg8KC0ZPUkVJR05fQkFaEAYqSwoUVGVzdEVu", - "dW1XaXRoRHVwVmFsdWUSCAoERk9PMRABEggKBEJBUjEQAhIHCgNCQVoQAxII", - "CgRGT08yEAESCAoEQkFSMhACGgIQASqJAQoOVGVzdFNwYXJzZUVudW0SDAoI", - "U1BBUlNFX0EQexIOCghTUEFSU0VfQhCm5wMSDwoIU1BBUlNFX0MQsrGABhIV", - "CghTUEFSU0VfRBDx//////////8BEhUKCFNQQVJTRV9FELTe/P///////wES", - "DAoIU1BBUlNFX0YQABIMCghTUEFSU0VfRxACKosPCg1WZXJ5TGFyZ2VFbnVt", - "EhYKEkVOVU1fTEFCRUxfREVGQVVMVBAAEhAKDEVOVU1fTEFCRUxfMRABEhAK", - "DEVOVU1fTEFCRUxfMhACEhAKDEVOVU1fTEFCRUxfMxADEhAKDEVOVU1fTEFC", - "RUxfNBAEEhAKDEVOVU1fTEFCRUxfNRAFEhAKDEVOVU1fTEFCRUxfNhAGEhAK", - "DEVOVU1fTEFCRUxfNxAHEhAKDEVOVU1fTEFCRUxfOBAIEhAKDEVOVU1fTEFC", - "RUxfORAJEhEKDUVOVU1fTEFCRUxfMTAQChIRCg1FTlVNX0xBQkVMXzExEAsS", - "EQoNRU5VTV9MQUJFTF8xMhAMEhEKDUVOVU1fTEFCRUxfMTMQDRIRCg1FTlVN", - "X0xBQkVMXzE0EA4SEQoNRU5VTV9MQUJFTF8xNRAPEhEKDUVOVU1fTEFCRUxf", - "MTYQEBIRCg1FTlVNX0xBQkVMXzE3EBESEQoNRU5VTV9MQUJFTF8xOBASEhEK", - "DUVOVU1fTEFCRUxfMTkQExIRCg1FTlVNX0xBQkVMXzIwEBQSEQoNRU5VTV9M", - "QUJFTF8yMRAVEhEKDUVOVU1fTEFCRUxfMjIQFhIRCg1FTlVNX0xBQkVMXzIz", - "EBcSEQoNRU5VTV9MQUJFTF8yNBAYEhEKDUVOVU1fTEFCRUxfMjUQGRIRCg1F", - "TlVNX0xBQkVMXzI2EBoSEQoNRU5VTV9MQUJFTF8yNxAbEhEKDUVOVU1fTEFC", - "RUxfMjgQHBIRCg1FTlVNX0xBQkVMXzI5EB0SEQoNRU5VTV9MQUJFTF8zMBAe", - "EhEKDUVOVU1fTEFCRUxfMzEQHxIRCg1FTlVNX0xBQkVMXzMyECASEQoNRU5V", - "TV9MQUJFTF8zMxAhEhEKDUVOVU1fTEFCRUxfMzQQIhIRCg1FTlVNX0xBQkVM", - "XzM1ECMSEQoNRU5VTV9MQUJFTF8zNhAkEhEKDUVOVU1fTEFCRUxfMzcQJRIR", - "Cg1FTlVNX0xBQkVMXzM4ECYSEQoNRU5VTV9MQUJFTF8zORAnEhEKDUVOVU1f", - "TEFCRUxfNDAQKBIRCg1FTlVNX0xBQkVMXzQxECkSEQoNRU5VTV9MQUJFTF80", - "MhAqEhEKDUVOVU1fTEFCRUxfNDMQKxIRCg1FTlVNX0xBQkVMXzQ0ECwSEQoN", - "RU5VTV9MQUJFTF80NRAtEhEKDUVOVU1fTEFCRUxfNDYQLhIRCg1FTlVNX0xB", - "QkVMXzQ3EC8SEQoNRU5VTV9MQUJFTF80OBAwEhEKDUVOVU1fTEFCRUxfNDkQ", - "MRIRCg1FTlVNX0xBQkVMXzUwEDISEQoNRU5VTV9MQUJFTF81MRAzEhEKDUVO", - "VU1fTEFCRUxfNTIQNBIRCg1FTlVNX0xBQkVMXzUzEDUSEQoNRU5VTV9MQUJF", - "TF81NBA2EhEKDUVOVU1fTEFCRUxfNTUQNxIRCg1FTlVNX0xBQkVMXzU2EDgS", - "EQoNRU5VTV9MQUJFTF81NxA5EhEKDUVOVU1fTEFCRUxfNTgQOhIRCg1FTlVN", - "X0xBQkVMXzU5EDsSEQoNRU5VTV9MQUJFTF82MBA8EhEKDUVOVU1fTEFCRUxf", - "NjEQPRIRCg1FTlVNX0xBQkVMXzYyED4SEQoNRU5VTV9MQUJFTF82MxA/EhEK", - "DUVOVU1fTEFCRUxfNjQQQBIRCg1FTlVNX0xBQkVMXzY1EEESEQoNRU5VTV9M", - "QUJFTF82NhBCEhEKDUVOVU1fTEFCRUxfNjcQQxIRCg1FTlVNX0xBQkVMXzY4", - "EEQSEQoNRU5VTV9MQUJFTF82ORBFEhEKDUVOVU1fTEFCRUxfNzAQRhIRCg1F", - "TlVNX0xBQkVMXzcxEEcSEQoNRU5VTV9MQUJFTF83MhBIEhEKDUVOVU1fTEFC", - "RUxfNzMQSRIRCg1FTlVNX0xBQkVMXzc0EEoSEQoNRU5VTV9MQUJFTF83NRBL", - "EhEKDUVOVU1fTEFCRUxfNzYQTBIRCg1FTlVNX0xBQkVMXzc3EE0SEQoNRU5V", - "TV9MQUJFTF83OBBOEhEKDUVOVU1fTEFCRUxfNzkQTxIRCg1FTlVNX0xBQkVM", - "XzgwEFASEQoNRU5VTV9MQUJFTF84MRBREhEKDUVOVU1fTEFCRUxfODIQUhIR", - "Cg1FTlVNX0xBQkVMXzgzEFMSEQoNRU5VTV9MQUJFTF84NBBUEhEKDUVOVU1f", - "TEFCRUxfODUQVRIRCg1FTlVNX0xBQkVMXzg2EFYSEQoNRU5VTV9MQUJFTF84", - "NxBXEhEKDUVOVU1fTEFCRUxfODgQWBIRCg1FTlVNX0xBQkVMXzg5EFkSEQoN", - "RU5VTV9MQUJFTF85MBBaEhEKDUVOVU1fTEFCRUxfOTEQWxIRCg1FTlVNX0xB", - "QkVMXzkyEFwSEQoNRU5VTV9MQUJFTF85MxBdEhEKDUVOVU1fTEFCRUxfOTQQ", - "XhIRCg1FTlVNX0xBQkVMXzk1EF8SEQoNRU5VTV9MQUJFTF85NhBgEhEKDUVO", - "VU1fTEFCRUxfOTcQYRIRCg1FTlVNX0xBQkVMXzk4EGISEQoNRU5VTV9MQUJF", - "TF85ORBjEhIKDkVOVU1fTEFCRUxfMTAwEGQytQEKC1Rlc3RTZXJ2aWNlElIK", - "A0ZvbxIkLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb29SZXF1ZXN0GiUu", - "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLkZvb1Jlc3BvbnNlElIKA0JhchIk", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5CYXJSZXF1ZXN0GiUucHJvdG9i", - "dWZfdW5pdHRlc3RfcHJvdG8yLkJhclJlc3BvbnNlOk0KGG9wdGlvbmFsX2lu", - "dDMyX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", - "QWxsRXh0ZW5zaW9ucxgBIAEoBTpNChhvcHRpb25hbF9pbnQ2NF9leHRlbnNp", - "b24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lv", - "bnMYAiABKAM6TgoZb3B0aW9uYWxfdWludDMyX2V4dGVuc2lvbhIrLnByb3Rv", - "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgDIAEoDTpO", - "ChlvcHRpb25hbF91aW50NjRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRl", - "c3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGAQgASgEOk4KGW9wdGlvbmFs", - "X3NpbnQzMl9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "VGVzdEFsbEV4dGVuc2lvbnMYBSABKBE6TgoZb3B0aW9uYWxfc2ludDY0X2V4", - "dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0", - "ZW5zaW9ucxgGIAEoEjpPChpvcHRpb25hbF9maXhlZDMyX2V4dGVuc2lvbhIr", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgH", - "IAEoBzpPChpvcHRpb25hbF9maXhlZDY0X2V4dGVuc2lvbhIrLnByb3RvYnVm", - "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgIIAEoBjpQChtv", - "cHRpb25hbF9zZml4ZWQzMl9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYCSABKA86UAobb3B0aW9uYWxf", - "c2ZpeGVkNjRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", - "LlRlc3RBbGxFeHRlbnNpb25zGAogASgQOk0KGG9wdGlvbmFsX2Zsb2F0X2V4", - "dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0", - "ZW5zaW9ucxgLIAEoAjpOChlvcHRpb25hbF9kb3VibGVfZXh0ZW5zaW9uEisu", - "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGAwg", - "ASgBOkwKF29wdGlvbmFsX2Jvb2xfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5p", - "dHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGA0gASgIOk4KGW9wdGlv", - "bmFsX3N0cmluZ19leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90", - "bzIuVGVzdEFsbEV4dGVuc2lvbnMYDiABKAk6TQoYb3B0aW9uYWxfYnl0ZXNf", + "Cg51bml0dGVzdC5wcm90bxIYcHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yGhV1", + "bml0dGVzdF9pbXBvcnQucHJvdG8igBoKDFRlc3RBbGxUeXBlcxIWCg5vcHRp", + "b25hbF9pbnQzMhgBIAEoBRIWCg5vcHRpb25hbF9pbnQ2NBgCIAEoAxIXCg9v", + "cHRpb25hbF91aW50MzIYAyABKA0SFwoPb3B0aW9uYWxfdWludDY0GAQgASgE", + "EhcKD29wdGlvbmFsX3NpbnQzMhgFIAEoERIXCg9vcHRpb25hbF9zaW50NjQY", + "BiABKBISGAoQb3B0aW9uYWxfZml4ZWQzMhgHIAEoBxIYChBvcHRpb25hbF9m", + "aXhlZDY0GAggASgGEhkKEW9wdGlvbmFsX3NmaXhlZDMyGAkgASgPEhkKEW9w", + "dGlvbmFsX3NmaXhlZDY0GAogASgQEhYKDm9wdGlvbmFsX2Zsb2F0GAsgASgC", + "EhcKD29wdGlvbmFsX2RvdWJsZRgMIAEoARIVCg1vcHRpb25hbF9ib29sGA0g", + "ASgIEhcKD29wdGlvbmFsX3N0cmluZxgOIAEoCRIWCg5vcHRpb25hbF9ieXRl", + "cxgPIAEoDBJLCg1vcHRpb25hbGdyb3VwGBAgASgKMjQucHJvdG9idWZfdW5p", + "dHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlcy5PcHRpb25hbEdyb3VwElUKF29w", + "dGlvbmFsX25lc3RlZF9tZXNzYWdlGBIgASgLMjQucHJvdG9idWZfdW5pdHRl", + "c3RfcHJvdG8yLlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlEkoKGG9wdGlv", + "bmFsX2ZvcmVpZ25fbWVzc2FnZRgTIAEoCzIoLnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5Gb3JlaWduTWVzc2FnZRJPChdvcHRpb25hbF9pbXBvcnRfbWVz", + "c2FnZRgUIAEoCzIuLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydF9wcm90bzIu", + "SW1wb3J0TWVzc2FnZRJPChRvcHRpb25hbF9uZXN0ZWRfZW51bRgVIAEoDjIx", + "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMuTmVzdGVk", + "RW51bRJEChVvcHRpb25hbF9mb3JlaWduX2VudW0YFiABKA4yJS5wcm90b2J1", + "Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW0SSQoUb3B0aW9uYWxfaW1w", + "b3J0X2VudW0YFyABKA4yKy5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnRfcHJv", + "dG8yLkltcG9ydEVudW0SIQoVb3B0aW9uYWxfc3RyaW5nX3BpZWNlGBggASgJ", + "QgIIAhIZCg1vcHRpb25hbF9jb3JkGBkgASgJQgIIARJcCh5vcHRpb25hbF9w", + "dWJsaWNfaW1wb3J0X21lc3NhZ2UYGiABKAsyNC5wcm90b2J1Zl91bml0dGVz", + "dF9pbXBvcnRfcHJvdG8yLlB1YmxpY0ltcG9ydE1lc3NhZ2USVwoVb3B0aW9u", + "YWxfbGF6eV9tZXNzYWdlGBsgASgLMjQucHJvdG9idWZfdW5pdHRlc3RfcHJv", + "dG8yLlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlQgIoARIWCg5yZXBlYXRl", + "ZF9pbnQzMhgfIAMoBRIWCg5yZXBlYXRlZF9pbnQ2NBggIAMoAxIXCg9yZXBl", + "YXRlZF91aW50MzIYISADKA0SFwoPcmVwZWF0ZWRfdWludDY0GCIgAygEEhcK", + "D3JlcGVhdGVkX3NpbnQzMhgjIAMoERIXCg9yZXBlYXRlZF9zaW50NjQYJCAD", + "KBISGAoQcmVwZWF0ZWRfZml4ZWQzMhglIAMoBxIYChByZXBlYXRlZF9maXhl", + "ZDY0GCYgAygGEhkKEXJlcGVhdGVkX3NmaXhlZDMyGCcgAygPEhkKEXJlcGVh", + "dGVkX3NmaXhlZDY0GCggAygQEhYKDnJlcGVhdGVkX2Zsb2F0GCkgAygCEhcK", + "D3JlcGVhdGVkX2RvdWJsZRgqIAMoARIVCg1yZXBlYXRlZF9ib29sGCsgAygI", + "EhcKD3JlcGVhdGVkX3N0cmluZxgsIAMoCRIWCg5yZXBlYXRlZF9ieXRlcxgt", + "IAMoDBJLCg1yZXBlYXRlZGdyb3VwGC4gAygKMjQucHJvdG9idWZfdW5pdHRl", + "c3RfcHJvdG8yLlRlc3RBbGxUeXBlcy5SZXBlYXRlZEdyb3VwElUKF3JlcGVh", + "dGVkX25lc3RlZF9tZXNzYWdlGDAgAygLMjQucHJvdG9idWZfdW5pdHRlc3Rf", + "cHJvdG8yLlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlEkoKGHJlcGVhdGVk", + "X2ZvcmVpZ25fbWVzc2FnZRgxIAMoCzIoLnByb3RvYnVmX3VuaXR0ZXN0X3By", + "b3RvMi5Gb3JlaWduTWVzc2FnZRJPChdyZXBlYXRlZF9pbXBvcnRfbWVzc2Fn", + "ZRgyIAMoCzIuLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydF9wcm90bzIuSW1w", + "b3J0TWVzc2FnZRJPChRyZXBlYXRlZF9uZXN0ZWRfZW51bRgzIAMoDjIxLnBy", + "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMuTmVzdGVkRW51", + "bRJEChVyZXBlYXRlZF9mb3JlaWduX2VudW0YNCADKA4yJS5wcm90b2J1Zl91", + "bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW0SSQoUcmVwZWF0ZWRfaW1wb3J0", + "X2VudW0YNSADKA4yKy5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnRfcHJvdG8y", + "LkltcG9ydEVudW0SIQoVcmVwZWF0ZWRfc3RyaW5nX3BpZWNlGDYgAygJQgII", + "AhIZCg1yZXBlYXRlZF9jb3JkGDcgAygJQgIIARJXChVyZXBlYXRlZF9sYXp5", + "X21lc3NhZ2UYOSADKAsyNC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", + "dEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2VCAigBEhkKDWRlZmF1bHRfaW50MzIY", + "PSABKAU6AjQxEhkKDWRlZmF1bHRfaW50NjQYPiABKAM6AjQyEhoKDmRlZmF1", + "bHRfdWludDMyGD8gASgNOgI0MxIaCg5kZWZhdWx0X3VpbnQ2NBhAIAEoBDoC", + "NDQSGwoOZGVmYXVsdF9zaW50MzIYQSABKBE6Ay00NRIaCg5kZWZhdWx0X3Np", + "bnQ2NBhCIAEoEjoCNDYSGwoPZGVmYXVsdF9maXhlZDMyGEMgASgHOgI0NxIb", + "Cg9kZWZhdWx0X2ZpeGVkNjQYRCABKAY6AjQ4EhwKEGRlZmF1bHRfc2ZpeGVk", + "MzIYRSABKA86AjQ5Eh0KEGRlZmF1bHRfc2ZpeGVkNjQYRiABKBA6Ay01MBIb", + "Cg1kZWZhdWx0X2Zsb2F0GEcgASgCOgQ1MS41Eh0KDmRlZmF1bHRfZG91Ymxl", + "GEggASgBOgU1MjAwMBIaCgxkZWZhdWx0X2Jvb2wYSSABKAg6BHRydWUSHQoO", + "ZGVmYXVsdF9zdHJpbmcYSiABKAk6BWhlbGxvEhwKDWRlZmF1bHRfYnl0ZXMY", + "SyABKAw6BXdvcmxkElMKE2RlZmF1bHRfbmVzdGVkX2VudW0YUSABKA4yMS5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZEVu", + "dW06A0JBUhJQChRkZWZhdWx0X2ZvcmVpZ25fZW51bRhSIAEoDjIlLnByb3Rv", + "YnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduRW51bToLRk9SRUlHTl9CQVIS", + "VAoTZGVmYXVsdF9pbXBvcnRfZW51bRhTIAEoDjIrLnByb3RvYnVmX3VuaXR0", + "ZXN0X2ltcG9ydF9wcm90bzIuSW1wb3J0RW51bToKSU1QT1JUX0JBUhIlChRk", + "ZWZhdWx0X3N0cmluZ19waWVjZRhUIAEoCToDYWJjQgIIAhIdCgxkZWZhdWx0", + "X2NvcmQYVSABKAk6AzEyM0ICCAESFgoMb25lb2ZfdWludDMyGG8gASgNSAAS", + "VAoUb25lb2ZfbmVzdGVkX21lc3NhZ2UYcCABKAsyNC5wcm90b2J1Zl91bml0", + "dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2VIABIWCgxv", + "bmVvZl9zdHJpbmcYcSABKAlIABIVCgtvbmVvZl9ieXRlcxhyIAEoDEgAGhsK", + "DU5lc3RlZE1lc3NhZ2USCgoCYmIYASABKAUaGgoNT3B0aW9uYWxHcm91cBIJ", + "CgFhGBEgASgFGhoKDVJlcGVhdGVkR3JvdXASCQoBYRgvIAEoBSI5CgpOZXN0", + "ZWRFbnVtEgcKA0ZPTxABEgcKA0JBUhACEgcKA0JBWhADEhAKA05FRxD/////", + "//////8BQg0KC29uZW9mX2ZpZWxkItABChJOZXN0ZWRUZXN0QWxsVHlwZXMS", + "OwoFY2hpbGQYASABKAsyLC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuTmVz", + "dGVkVGVzdEFsbFR5cGVzEjcKB3BheWxvYWQYAiABKAsyJi5wcm90b2J1Zl91", + "bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzEkQKDnJlcGVhdGVkX2NoaWxk", + "GAMgAygLMiwucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLk5lc3RlZFRlc3RB", + "bGxUeXBlcyJtChRUZXN0RGVwcmVjYXRlZEZpZWxkcxIcChBkZXByZWNhdGVk", + "X2ludDMyGAEgASgFQgIYARInChlkZXByZWNhdGVkX2ludDMyX2luX29uZW9m", + "GAIgASgFQgIYAUgAQg4KDG9uZW9mX2ZpZWxkcyIbChVUZXN0RGVwcmVjYXRl", + "ZE1lc3NhZ2U6AhgBIiYKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUSCQoB", + "ZBgCIAEoBSIwChJUZXN0UmVzZXJ2ZWRGaWVsZHNKBAgCEANKBAgPEBBKBAgJ", + "EAxSA2JhclIDYmF6Ih0KEVRlc3RBbGxFeHRlbnNpb25zKggIARCAgICAAiIk", + "ChdPcHRpb25hbEdyb3VwX2V4dGVuc2lvbhIJCgFhGBEgASgFIiQKF1JlcGVh", + "dGVkR3JvdXBfZXh0ZW5zaW9uEgkKAWEYLyABKAUitwEKCVRlc3RHcm91cBJI", + "Cg1vcHRpb25hbGdyb3VwGBAgASgKMjEucHJvdG9idWZfdW5pdHRlc3RfcHJv", + "dG8yLlRlc3RHcm91cC5PcHRpb25hbEdyb3VwEkQKFW9wdGlvbmFsX2ZvcmVp", + "Z25fZW51bRgWIAEoDjIlLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3Jl", + "aWduRW51bRoaCg1PcHRpb25hbEdyb3VwEgkKAWEYESABKAUiHgoSVGVzdEdy", + "b3VwRXh0ZW5zaW9uKggIARCAgICAAiLhAwoTVGVzdE5lc3RlZEV4dGVuc2lv", + "bhokChdPcHRpb25hbEdyb3VwX2V4dGVuc2lvbhIJCgFhGBEgASgFMkAKBHRl", + "c3QSKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lv", + "bnMY6gcgASgJOgR0ZXN0Mk0KF25lc3RlZF9zdHJpbmdfZXh0ZW5zaW9uEisu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGOsH", + "IAEoCTKUAQoXb3B0aW9uYWxncm91cF9leHRlbnNpb24SLC5wcm90b2J1Zl91", + "bml0dGVzdF9wcm90bzIuVGVzdEdyb3VwRXh0ZW5zaW9uGBAgASgKMkUucHJv", + "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3ROZXN0ZWRFeHRlbnNpb24uT3B0", + "aW9uYWxHcm91cF9leHRlbnNpb24yfAofb3B0aW9uYWxfZm9yZWlnbl9lbnVt", + "X2V4dGVuc2lvbhIsLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0R3Jv", + "dXBFeHRlbnNpb24YFiABKA4yJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", + "Rm9yZWlnbkVudW0i8QUKDFRlc3RSZXF1aXJlZBIJCgFhGAEgAigFEg4KBmR1", + "bW15MhgCIAEoBRIJCgFiGAMgAigFEg4KBmR1bW15NBgEIAEoBRIOCgZkdW1t", + "eTUYBSABKAUSDgoGZHVtbXk2GAYgASgFEg4KBmR1bW15NxgHIAEoBRIOCgZk", + "dW1teTgYCCABKAUSDgoGZHVtbXk5GAkgASgFEg8KB2R1bW15MTAYCiABKAUS", + "DwoHZHVtbXkxMRgLIAEoBRIPCgdkdW1teTEyGAwgASgFEg8KB2R1bW15MTMY", + "DSABKAUSDwoHZHVtbXkxNBgOIAEoBRIPCgdkdW1teTE1GA8gASgFEg8KB2R1", + "bW15MTYYECABKAUSDwoHZHVtbXkxNxgRIAEoBRIPCgdkdW1teTE4GBIgASgF", + "Eg8KB2R1bW15MTkYEyABKAUSDwoHZHVtbXkyMBgUIAEoBRIPCgdkdW1teTIx", + "GBUgASgFEg8KB2R1bW15MjIYFiABKAUSDwoHZHVtbXkyMxgXIAEoBRIPCgdk", + "dW1teTI0GBggASgFEg8KB2R1bW15MjUYGSABKAUSDwoHZHVtbXkyNhgaIAEo", + "BRIPCgdkdW1teTI3GBsgASgFEg8KB2R1bW15MjgYHCABKAUSDwoHZHVtbXky", + "ORgdIAEoBRIPCgdkdW1teTMwGB4gASgFEg8KB2R1bW15MzEYHyABKAUSDwoH", + "ZHVtbXkzMhggIAEoBRIJCgFjGCEgAigFMmQKBnNpbmdsZRIrLnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxjoByABKAsyJi5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFJlcXVpcmVkMmMKBW11bHRp", + "EisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25z", + "GOkHIAMoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UmVxdWly", + "ZWQiqAEKE1Rlc3RSZXF1aXJlZEZvcmVpZ24SQAoQb3B0aW9uYWxfbWVzc2Fn", + "ZRgBIAEoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UmVxdWly", + "ZWQSQAoQcmVwZWF0ZWRfbWVzc2FnZRgCIAMoCzImLnByb3RvYnVmX3VuaXR0", + "ZXN0X3Byb3RvMi5UZXN0UmVxdWlyZWQSDQoFZHVtbXkYAyABKAUi2wEKE1Rl", + "c3RSZXF1aXJlZE1lc3NhZ2USQAoQb3B0aW9uYWxfbWVzc2FnZRgBIAEoCzIm", + "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UmVxdWlyZWQSQAoQcmVw", + "ZWF0ZWRfbWVzc2FnZRgCIAMoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0UmVxdWlyZWQSQAoQcmVxdWlyZWRfbWVzc2FnZRgDIAIoCzImLnBy", + "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UmVxdWlyZWQiYQoRVGVzdEZv", + "cmVpZ25OZXN0ZWQSTAoOZm9yZWlnbl9uZXN0ZWQYASABKAsyNC5wcm90b2J1", + "Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2Ui", + "EgoQVGVzdEVtcHR5TWVzc2FnZSIqCh5UZXN0RW1wdHlNZXNzYWdlV2l0aEV4", + "dGVuc2lvbnMqCAgBEICAgIACIjcKG1Rlc3RNdWx0aXBsZUV4dGVuc2lvblJh", + "bmdlcyoECCoQKyoGCK8gEJQhKgoIgIAEEICAgIACIjQKGFRlc3RSZWFsbHlM", + "YXJnZVRhZ051bWJlchIJCgFhGAEgASgFEg0KAmJiGP///38gASgFIlwKFFRl", + "c3RSZWN1cnNpdmVNZXNzYWdlEjkKAWEYASABKAsyLi5wcm90b2J1Zl91bml0", + "dGVzdF9wcm90bzIuVGVzdFJlY3Vyc2l2ZU1lc3NhZ2USCQoBaRgCIAEoBSKE", + "AwoUVGVzdE11dHVhbFJlY3Vyc2lvbkESOgoCYmIYASABKAsyLi5wcm90b2J1", + "Zl91bml0dGVzdF9wcm90bzIuVGVzdE11dHVhbFJlY3Vyc2lvbkISSQoIc3Vi", + "Z3JvdXAYAiABKAoyNy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdE11", + "dHVhbFJlY3Vyc2lvbkEuU3ViR3JvdXAaRwoKU3ViTWVzc2FnZRI5CgFiGAEg", + "ASgLMi4ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RNdXR1YWxSZWN1", + "cnNpb25CGpsBCghTdWJHcm91cBJOCgtzdWJfbWVzc2FnZRgDIAEoCzI5LnBy", + "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0TXV0dWFsUmVjdXJzaW9uQS5T", + "dWJNZXNzYWdlEj8KD25vdF9pbl90aGlzX3NjYxgEIAEoCzImLnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMiaQoUVGVzdE11dHVhbFJl", + "Y3Vyc2lvbkISOQoBYRgBIAEoCzIuLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0TXV0dWFsUmVjdXJzaW9uQRIWCg5vcHRpb25hbF9pbnQzMhgCIAEo", + "BSLYAQoRVGVzdElzSW5pdGlhbGl6ZWQSSwoLc3ViX21lc3NhZ2UYASABKAsy", + "Ni5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdElzSW5pdGlhbGl6ZWQu", + "U3ViTWVzc2FnZRp2CgpTdWJNZXNzYWdlElEKCHN1Ymdyb3VwGAEgASgKMj8u", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RJc0luaXRpYWxpemVkLlN1", + "Yk1lc3NhZ2UuU3ViR3JvdXAaFQoIU3ViR3JvdXASCQoBaRgCIAIoBSLBAQoS", + "VGVzdER1cEZpZWxkTnVtYmVyEgkKAWEYASABKAUSPQoDZm9vGAIgASgKMjAu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3REdXBGaWVsZE51bWJlci5G", + "b28SPQoDYmFyGAMgASgKMjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", + "c3REdXBGaWVsZE51bWJlci5CYXIaEAoDRm9vEgkKAWEYASABKAUaEAoDQmFy", + "EgkKAWEYASABKAUiUwoQVGVzdEVhZ2VyTWVzc2FnZRI/CgtzdWJfbWVzc2Fn", + "ZRgBIAEoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlw", + "ZXNCAigAIlIKD1Rlc3RMYXp5TWVzc2FnZRI/CgtzdWJfbWVzc2FnZRgBIAEo", + "CzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXNCAigB", + "Io4CChhUZXN0TmVzdGVkTWVzc2FnZUhhc0JpdHMSYQoXb3B0aW9uYWxfbmVz", + "dGVkX21lc3NhZ2UYASABKAsyQC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", + "VGVzdE5lc3RlZE1lc3NhZ2VIYXNCaXRzLk5lc3RlZE1lc3NhZ2UajgEKDU5l", + "c3RlZE1lc3NhZ2USJAocbmVzdGVkbWVzc2FnZV9yZXBlYXRlZF9pbnQzMhgB", + "IAMoBRJXCiVuZXN0ZWRtZXNzYWdlX3JlcGVhdGVkX2ZvcmVpZ25tZXNzYWdl", + "GAIgAygLMigucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLkZvcmVpZ25NZXNz", + "YWdlIoEEChdUZXN0Q2FtZWxDYXNlRmllbGROYW1lcxIWCg5QcmltaXRpdmVG", + "aWVsZBgBIAEoBRITCgtTdHJpbmdGaWVsZBgCIAEoCRI4CglFbnVtRmllbGQY", + "AyABKA4yJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW0S", + "PgoMTWVzc2FnZUZpZWxkGAQgASgLMigucHJvdG9idWZfdW5pdHRlc3RfcHJv", + "dG8yLkZvcmVpZ25NZXNzYWdlEhwKEFN0cmluZ1BpZWNlRmllbGQYBSABKAlC", + "AggCEhUKCUNvcmRGaWVsZBgGIAEoCUICCAESHgoWUmVwZWF0ZWRQcmltaXRp", + "dmVGaWVsZBgHIAMoBRIbChNSZXBlYXRlZFN0cmluZ0ZpZWxkGAggAygJEkAK", + "EVJlcGVhdGVkRW51bUZpZWxkGAkgAygOMiUucHJvdG9idWZfdW5pdHRlc3Rf", + "cHJvdG8yLkZvcmVpZ25FbnVtEkYKFFJlcGVhdGVkTWVzc2FnZUZpZWxkGAog", + "AygLMigucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLkZvcmVpZ25NZXNzYWdl", + "EiQKGFJlcGVhdGVkU3RyaW5nUGllY2VGaWVsZBgLIAMoCUICCAISHQoRUmVw", + "ZWF0ZWRDb3JkRmllbGQYDCADKAlCAggBItwBChJUZXN0RmllbGRPcmRlcmlu", + "Z3MSEQoJbXlfc3RyaW5nGAsgASgJEg4KBm15X2ludBgBIAEoAxIQCghteV9m", + "bG9hdBhlIAEoAhJcChdvcHRpb25hbF9uZXN0ZWRfbWVzc2FnZRjIASABKAsy", + "Oi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEZpZWxkT3JkZXJpbmdz", + "Lk5lc3RlZE1lc3NhZ2UaJwoNTmVzdGVkTWVzc2FnZRIKCgJvbxgCIAEoAxIK", + "CgJiYhgBIAEoBSoECAIQCyoECAwQZSKqAQoXVGVzdEV4dGVuc2lvbk9yZGVy", + "aW5nczESEQoJbXlfc3RyaW5nGAEgASgJMnwKE3Rlc3RfZXh0X29yZGVyaW5n", + "czESLC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEZpZWxkT3JkZXJp", + "bmdzGA0gASgLMjEucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RFeHRl", + "bnNpb25PcmRlcmluZ3MxIvACChdUZXN0RXh0ZW5zaW9uT3JkZXJpbmdzMhIR", + "CglteV9zdHJpbmcYASABKAkawwEKF1Rlc3RFeHRlbnNpb25PcmRlcmluZ3Mz", + "EhEKCW15X3N0cmluZxgBIAEoCTKUAQoTdGVzdF9leHRfb3JkZXJpbmdzMxIs", + "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0RmllbGRPcmRlcmluZ3MY", + "DiABKAsySS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEV4dGVuc2lv", + "bk9yZGVyaW5nczIuVGVzdEV4dGVuc2lvbk9yZGVyaW5nczMyfAoTdGVzdF9l", + "eHRfb3JkZXJpbmdzMhIsLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", + "RmllbGRPcmRlcmluZ3MYDCABKAsyMS5wcm90b2J1Zl91bml0dGVzdF9wcm90", + "bzIuVGVzdEV4dGVuc2lvbk9yZGVyaW5nczIitgcKGFRlc3RFeHRyZW1lRGVm", + "YXVsdFZhbHVlcxI/Cg1lc2NhcGVkX2J5dGVzGAEgASgMOihcMDAwXDAwMVww", + "MDdcMDEwXDAxNFxuXHJcdFwwMTNcXFwnXCJcMzc2EiAKDGxhcmdlX3VpbnQz", + "MhgCIAEoDToKNDI5NDk2NzI5NRIqCgxsYXJnZV91aW50NjQYAyABKAQ6FDE4", + "NDQ2NzQ0MDczNzA5NTUxNjE1EiAKC3NtYWxsX2ludDMyGAQgASgFOgstMjE0", + "NzQ4MzY0NxIpCgtzbWFsbF9pbnQ2NBgFIAEoAzoULTkyMjMzNzIwMzY4NTQ3", + "NzU4MDcSJwoScmVhbGx5X3NtYWxsX2ludDMyGBUgASgFOgstMjE0NzQ4MzY0", + "OBIwChJyZWFsbHlfc21hbGxfaW50NjQYFiABKAM6FC05MjIzMzcyMDM2ODU0", + "Nzc1ODA4EhgKC3V0Zjhfc3RyaW5nGAYgASgJOgPhiLQSFQoKemVyb19mbG9h", + "dBgHIAEoAjoBMBIUCglvbmVfZmxvYXQYCCABKAI6ATESGAoLc21hbGxfZmxv", + "YXQYCSABKAI6AzEuNRIeChJuZWdhdGl2ZV9vbmVfZmxvYXQYCiABKAI6Ai0x", + "EhwKDm5lZ2F0aXZlX2Zsb2F0GAsgASgCOgQtMS41EhoKC2xhcmdlX2Zsb2F0", + "GAwgASgCOgUyZSswOBIkChRzbWFsbF9uZWdhdGl2ZV9mbG9hdBgNIAEoAjoG", + "LThlLTI4EhcKCmluZl9kb3VibGUYDiABKAE6A2luZhIcCg5uZWdfaW5mX2Rv", + "dWJsZRgPIAEoAToELWluZhIXCgpuYW5fZG91YmxlGBAgASgBOgNuYW4SFgoJ", + "aW5mX2Zsb2F0GBEgASgCOgNpbmYSGwoNbmVnX2luZl9mbG9hdBgSIAEoAjoE", + "LWluZhIWCgluYW5fZmxvYXQYEyABKAI6A25hbhIrCgxjcHBfdHJpZ3JhcGgY", + "FCABKAk6FT8gPyA/PyA/PyA/Pz8gPz8vID8/LRIgChBzdHJpbmdfd2l0aF96", + "ZXJvGBcgASgJOgZoZWwAbG8SIgoPYnl0ZXNfd2l0aF96ZXJvGBggASgMOgl3", + "b3JcMDAwbGQSKAoWc3RyaW5nX3BpZWNlX3dpdGhfemVybxgZIAEoCToEYWIA", + "Y0ICCAISIAoOY29yZF93aXRoX3plcm8YGiABKAk6BDEyADNCAggBEiYKEnJl", + "cGxhY2VtZW50X3N0cmluZxgbIAEoCToKJHt1bmtub3dufSJSChFTcGFyc2VF", + "bnVtTWVzc2FnZRI9CgtzcGFyc2VfZW51bRgBIAEoDjIoLnByb3RvYnVmX3Vu", + "aXR0ZXN0X3Byb3RvMi5UZXN0U3BhcnNlRW51bSIZCglPbmVTdHJpbmcSDAoE", + "ZGF0YRgBIAEoCSIaCgpNb3JlU3RyaW5nEgwKBGRhdGEYASADKAkiGAoIT25l", + "Qnl0ZXMSDAoEZGF0YRgBIAEoDCIZCglNb3JlQnl0ZXMSDAoEZGF0YRgBIAMo", + "DCIcCgxJbnQzMk1lc3NhZ2USDAoEZGF0YRgBIAEoBSIdCg1VaW50MzJNZXNz", + "YWdlEgwKBGRhdGEYASABKA0iHAoMSW50NjRNZXNzYWdlEgwKBGRhdGEYASAB", + "KAMiHQoNVWludDY0TWVzc2FnZRIMCgRkYXRhGAEgASgEIhsKC0Jvb2xNZXNz", + "YWdlEgwKBGRhdGEYASABKAgi3gEKCVRlc3RPbmVvZhIRCgdmb29faW50GAEg", + "ASgFSAASFAoKZm9vX3N0cmluZxgCIAEoCUgAEj0KC2Zvb19tZXNzYWdlGAMg", + "ASgLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlc0gA", + "EkAKCGZvb2dyb3VwGAQgASgKMiwucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", + "LlRlc3RPbmVvZi5Gb29Hcm91cEgAGiAKCEZvb0dyb3VwEgkKAWEYBSABKAUS", + "CQoBYhgGIAEoCUIFCgNmb28i9QEKHFRlc3RPbmVvZkJhY2t3YXJkc0NvbXBh", + "dGlibGUSDwoHZm9vX2ludBgBIAEoBRISCgpmb29fc3RyaW5nGAIgASgJEjsK", + "C2Zvb19tZXNzYWdlGAMgASgLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", + "LlRlc3RBbGxUeXBlcxJRCghmb29ncm91cBgEIAEoCjI/LnByb3RvYnVmX3Vu", + "aXR0ZXN0X3Byb3RvMi5UZXN0T25lb2ZCYWNrd2FyZHNDb21wYXRpYmxlLkZv", + "b0dyb3VwGiAKCEZvb0dyb3VwEgkKAWEYBSABKAUSCQoBYhgGIAEoCSLBBgoK", + "VGVzdE9uZW9mMhIRCgdmb29faW50GAEgASgFSAASFAoKZm9vX3N0cmluZxgC", + "IAEoCUgAEhYKCGZvb19jb3JkGAMgASgJQgIIAUgAEh4KEGZvb19zdHJpbmdf", + "cGllY2UYBCABKAlCAggCSAASEwoJZm9vX2J5dGVzGAUgASgMSAASQwoIZm9v", + "X2VudW0YBiABKA4yLy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdE9u", + "ZW9mMi5OZXN0ZWRFbnVtSAASSQoLZm9vX21lc3NhZ2UYByABKAsyMi5wcm90", + "b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdE9uZW9mMi5OZXN0ZWRNZXNzYWdl", + "SAASQQoIZm9vZ3JvdXAYCCABKAoyLS5wcm90b2J1Zl91bml0dGVzdF9wcm90", + "bzIuVGVzdE9uZW9mMi5Gb29Hcm91cEgAElIKEGZvb19sYXp5X21lc3NhZ2UY", + "CyABKAsyMi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdE9uZW9mMi5O", + "ZXN0ZWRNZXNzYWdlQgIoAUgAEhQKB2Jhcl9pbnQYDCABKAU6ATVIARIcCgpi", + "YXJfc3RyaW5nGA0gASgJOgZTVFJJTkdIARIcCghiYXJfY29yZBgOIAEoCToE", + "Q09SREICCAFIARImChBiYXJfc3RyaW5nX3BpZWNlGA8gASgJOgZTUElFQ0VC", + "AggCSAESGgoJYmFyX2J5dGVzGBAgASgMOgVCWVRFU0gBEkgKCGJhcl9lbnVt", + "GBEgASgOMi8ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RPbmVvZjIu", + "TmVzdGVkRW51bToDQkFSSAESDwoHYmF6X2ludBgSIAEoBRIXCgpiYXpfc3Ry", + "aW5nGBMgASgJOgNCQVoaIAoIRm9vR3JvdXASCQoBYRgJIAEoBRIJCgFiGAog", + "ASgJGjMKDU5lc3RlZE1lc3NhZ2USDwoHcXV4X2ludBgBIAEoAxIRCgljb3Jn", + "ZV9pbnQYAiADKAUiJwoKTmVzdGVkRW51bRIHCgNGT08QARIHCgNCQVIQAhIH", + "CgNCQVoQA0IFCgNmb29CBQoDYmFyIr8BChFUZXN0UmVxdWlyZWRPbmVvZhIR", + "Cgdmb29faW50GAEgASgFSAASFAoKZm9vX3N0cmluZxgCIAEoCUgAElAKC2Zv", + "b19tZXNzYWdlGAMgASgLMjkucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", + "c3RSZXF1aXJlZE9uZW9mLk5lc3RlZE1lc3NhZ2VIABooCg1OZXN0ZWRNZXNz", + "YWdlEhcKD3JlcXVpcmVkX2RvdWJsZRgBIAIoAUIFCgNmb28i4AEKD1Rlc3RS", + "ZXF1aXJlZE1hcBI/CgNmb28YASADKAsyMi5wcm90b2J1Zl91bml0dGVzdF9w", + "cm90bzIuVGVzdFJlcXVpcmVkTWFwLkZvb0VudHJ5GmMKCEZvb0VudHJ5EgsK", + "A2tleRgBIAEoBRJGCgV2YWx1ZRgCIAEoCzI3LnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5UZXN0UmVxdWlyZWRNYXAuTmVzdGVkTWVzc2FnZToCOAEaJwoN", + "TmVzdGVkTWVzc2FnZRIWCg5yZXF1aXJlZF9pbnQzMhgBIAIoBSKxAwoPVGVz", + "dFBhY2tlZFR5cGVzEhgKDHBhY2tlZF9pbnQzMhhaIAMoBUICEAESGAoMcGFj", + "a2VkX2ludDY0GFsgAygDQgIQARIZCg1wYWNrZWRfdWludDMyGFwgAygNQgIQ", + "ARIZCg1wYWNrZWRfdWludDY0GF0gAygEQgIQARIZCg1wYWNrZWRfc2ludDMy", + "GF4gAygRQgIQARIZCg1wYWNrZWRfc2ludDY0GF8gAygSQgIQARIaCg5wYWNr", + "ZWRfZml4ZWQzMhhgIAMoB0ICEAESGgoOcGFja2VkX2ZpeGVkNjQYYSADKAZC", + "AhABEhsKD3BhY2tlZF9zZml4ZWQzMhhiIAMoD0ICEAESGwoPcGFja2VkX3Nm", + "aXhlZDY0GGMgAygQQgIQARIYCgxwYWNrZWRfZmxvYXQYZCADKAJCAhABEhkK", + "DXBhY2tlZF9kb3VibGUYZSADKAFCAhABEhcKC3BhY2tlZF9ib29sGGYgAygI", + "QgIQARI+CgtwYWNrZWRfZW51bRhnIAMoDjIlLnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5Gb3JlaWduRW51bUICEAEizwMKEVRlc3RVbnBhY2tlZFR5cGVz", + "EhoKDnVucGFja2VkX2ludDMyGFogAygFQgIQABIaCg51bnBhY2tlZF9pbnQ2", + "NBhbIAMoA0ICEAASGwoPdW5wYWNrZWRfdWludDMyGFwgAygNQgIQABIbCg91", + "bnBhY2tlZF91aW50NjQYXSADKARCAhAAEhsKD3VucGFja2VkX3NpbnQzMhhe", + "IAMoEUICEAASGwoPdW5wYWNrZWRfc2ludDY0GF8gAygSQgIQABIcChB1bnBh", + "Y2tlZF9maXhlZDMyGGAgAygHQgIQABIcChB1bnBhY2tlZF9maXhlZDY0GGEg", + "AygGQgIQABIdChF1bnBhY2tlZF9zZml4ZWQzMhhiIAMoD0ICEAASHQoRdW5w", + "YWNrZWRfc2ZpeGVkNjQYYyADKBBCAhAAEhoKDnVucGFja2VkX2Zsb2F0GGQg", + "AygCQgIQABIbCg91bnBhY2tlZF9kb3VibGUYZSADKAFCAhAAEhkKDXVucGFj", + "a2VkX2Jvb2wYZiADKAhCAhAAEkAKDXVucGFja2VkX2VudW0YZyADKA4yJS5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW1CAhAAIiAKFFRl", + "c3RQYWNrZWRFeHRlbnNpb25zKggIARCAgICAAiIiChZUZXN0VW5wYWNrZWRF", + "eHRlbnNpb25zKggIARCAgICAAiK1BAoVVGVzdER5bmFtaWNFeHRlbnNpb25z", + "EhkKEHNjYWxhcl9leHRlbnNpb24Y0A8gASgHEj4KDmVudW1fZXh0ZW5zaW9u", + "GNEPIAEoDjIlLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduRW51", + "bRJgChZkeW5hbWljX2VudW1fZXh0ZW5zaW9uGNIPIAEoDjI/LnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0RHluYW1pY0V4dGVuc2lvbnMuRHluYW1p", + "Y0VudW1UeXBlEkQKEW1lc3NhZ2VfZXh0ZW5zaW9uGNMPIAEoCzIoLnByb3Rv", + "YnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduTWVzc2FnZRJmChlkeW5hbWlj", + "X21lc3NhZ2VfZXh0ZW5zaW9uGNQPIAEoCzJCLnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5UZXN0RHluYW1pY0V4dGVuc2lvbnMuRHluYW1pY01lc3NhZ2VU", + "eXBlEhsKEnJlcGVhdGVkX2V4dGVuc2lvbhjVDyADKAkSHQoQcGFja2VkX2V4", + "dGVuc2lvbhjWDyADKBFCAhABGiwKEkR5bmFtaWNNZXNzYWdlVHlwZRIWCg1k", + "eW5hbWljX2ZpZWxkGLQQIAEoBSJHCg9EeW5hbWljRW51bVR5cGUSEAoLRFlO", + "QU1JQ19GT08QmBESEAoLRFlOQU1JQ19CQVIQmRESEAoLRFlOQU1JQ19CQVoQ", + "mhEiwAEKI1Rlc3RSZXBlYXRlZFNjYWxhckRpZmZlcmVudFRhZ1NpemVzEhgK", + "EHJlcGVhdGVkX2ZpeGVkMzIYDCADKAcSFgoOcmVwZWF0ZWRfaW50MzIYDSAD", + "KAUSGQoQcmVwZWF0ZWRfZml4ZWQ2NBj+DyADKAYSFwoOcmVwZWF0ZWRfaW50", + "NjQY/w8gAygDEhgKDnJlcGVhdGVkX2Zsb2F0GP7/DyADKAISGQoPcmVwZWF0", + "ZWRfdWludDY0GP//DyADKAQigwsKEFRlc3RQYXJzaW5nTWVyZ2USQgoScmVx", + "dWlyZWRfYWxsX3R5cGVzGAEgAigLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJv", + "dG8yLlRlc3RBbGxUeXBlcxJCChJvcHRpb25hbF9hbGxfdHlwZXMYAiABKAsy", + "Ji5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzEkIKEnJl", + "cGVhdGVkX2FsbF90eXBlcxgDIAMoCzImLnByb3RvYnVmX3VuaXR0ZXN0X3By", + "b3RvMi5UZXN0QWxsVHlwZXMSTwoNb3B0aW9uYWxncm91cBgKIAEoCjI4LnBy", + "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UGFyc2luZ01lcmdlLk9wdGlv", + "bmFsR3JvdXASTwoNcmVwZWF0ZWRncm91cBgUIAMoCjI4LnByb3RvYnVmX3Vu", + "aXR0ZXN0X3Byb3RvMi5UZXN0UGFyc2luZ01lcmdlLlJlcGVhdGVkR3JvdXAa", + "6QQKF1JlcGVhdGVkRmllbGRzR2VuZXJhdG9yEjYKBmZpZWxkMRgBIAMoCzIm", + "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMSNgoGZmll", + "bGQyGAIgAygLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxU", + "eXBlcxI2CgZmaWVsZDMYAyADKAsyJi5wcm90b2J1Zl91bml0dGVzdF9wcm90", + "bzIuVGVzdEFsbFR5cGVzElkKBmdyb3VwMRgKIAMoCjJJLnByb3RvYnVmX3Vu", + "aXR0ZXN0X3Byb3RvMi5UZXN0UGFyc2luZ01lcmdlLlJlcGVhdGVkRmllbGRz", + "R2VuZXJhdG9yLkdyb3VwMRJZCgZncm91cDIYFCADKAoySS5wcm90b2J1Zl91", + "bml0dGVzdF9wcm90bzIuVGVzdFBhcnNpbmdNZXJnZS5SZXBlYXRlZEZpZWxk", + "c0dlbmVyYXRvci5Hcm91cDISNQoEZXh0MRjoByADKAsyJi5wcm90b2J1Zl91", + "bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzEjUKBGV4dDIY6QcgAygLMiYu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlcxpACgZHcm91", + "cDESNgoGZmllbGQxGAsgASgLMiYucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", + "LlRlc3RBbGxUeXBlcxpACgZHcm91cDISNgoGZmllbGQxGBUgASgLMiYucHJv", + "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlcxpZCg1PcHRpb25h", + "bEdyb3VwEkgKGG9wdGlvbmFsX2dyb3VwX2FsbF90eXBlcxgLIAEoCzImLnBy", + "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMaWQoNUmVwZWF0", + "ZWRHcm91cBJIChhyZXBlYXRlZF9ncm91cF9hbGxfdHlwZXMYFSABKAsyJi5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzKgkI6AcQgICA", + "gAIyaQoMb3B0aW9uYWxfZXh0EioucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", + "LlRlc3RQYXJzaW5nTWVyZ2UY6AcgASgLMiYucHJvdG9idWZfdW5pdHRlc3Rf", + "cHJvdG8yLlRlc3RBbGxUeXBlczJpCgxyZXBlYXRlZF9leHQSKi5wcm90b2J1", + "Zl91bml0dGVzdF9wcm90bzIuVGVzdFBhcnNpbmdNZXJnZRjpByADKAsyJi5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzIkQKG1Rlc3RD", + "b21tZW50SW5qZWN0aW9uTWVzc2FnZRIlCgFhGAEgASgJOhoqLyA8LSBOZWl0", + "aGVyIHNob3VsZCB0aGlzLiIMCgpGb29SZXF1ZXN0Ig0KC0Zvb1Jlc3BvbnNl", + "IhIKEEZvb0NsaWVudE1lc3NhZ2UiEgoQRm9vU2VydmVyTWVzc2FnZSIMCgpC", + "YXJSZXF1ZXN0Ig0KC0JhclJlc3BvbnNlIpIBCgxUZXN0SnNvbk5hbWUSEwoL", + "ZmllbGRfbmFtZTEYASABKAUSEgoKZmllbGROYW1lMhgCIAEoBRISCgpGaWVs", + "ZE5hbWUzGAMgASgFEhQKDF9maWVsZF9uYW1lNBgEIAEoBRITCgtGSUVMRF9O", + "QU1FNRgFIAEoBRIaCgtmaWVsZF9uYW1lNhgGIAEoBVIFQHR5cGUioAYKFFRl", + "c3RIdWdlRmllbGROdW1iZXJzEhoKDm9wdGlvbmFsX2ludDMyGPD4//8BIAEo", + "BRIUCghmaXhlZF8zMhjx+P//ASABKAUSHgoOcmVwZWF0ZWRfaW50MzIY8vj/", + "/wEgAygFQgIQABIcCgxwYWNrZWRfaW50MzIY8/j//wEgAygFQgIQARJACg1v", + "cHRpb25hbF9lbnVtGPT4//8BIAEoDjIlLnByb3RvYnVmX3VuaXR0ZXN0X3By", + "b3RvMi5Gb3JlaWduRW51bRIbCg9vcHRpb25hbF9zdHJpbmcY9fj//wEgASgJ", + "EhoKDm9wdGlvbmFsX2J5dGVzGPb4//8BIAEoDBJGChBvcHRpb25hbF9tZXNz", + "YWdlGPf4//8BIAEoCzIoLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3Jl", + "aWduTWVzc2FnZRJXCg1vcHRpb25hbGdyb3VwGPj4//8BIAEoCjI8LnByb3Rv", + "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0SHVnZUZpZWxkTnVtYmVycy5PcHRp", + "b25hbEdyb3VwEmIKEXN0cmluZ19zdHJpbmdfbWFwGPr4//8BIAMoCzJDLnBy", + "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0SHVnZUZpZWxkTnVtYmVycy5T", + "dHJpbmdTdHJpbmdNYXBFbnRyeRIaCgxvbmVvZl91aW50MzIY+/j//wEgASgN", + "SAASSgoUb25lb2ZfdGVzdF9hbGxfdHlwZXMY/Pj//wEgASgLMiYucHJvdG9i", + "dWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlc0gAEhoKDG9uZW9mX3N0", + "cmluZxj9+P//ASABKAlIABIZCgtvbmVvZl9ieXRlcxj++P//ASABKAxIABok", + "Cg1PcHRpb25hbEdyb3VwEhMKB2dyb3VwX2EY+fj//wEgASgFGjYKFFN0cmlu", + "Z1N0cmluZ01hcEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToC", + "OAEqDAjgqv//ARDw+P//AUINCgtvbmVvZl9maWVsZCKxAQoYVGVzdEV4dGVu", + "c2lvbkluc2lkZVRhYmxlEg4KBmZpZWxkMRgBIAEoBRIOCgZmaWVsZDIYAiAB", + "KAUSDgoGZmllbGQzGAMgASgFEg4KBmZpZWxkNBgEIAEoBRIOCgZmaWVsZDYY", + "BiABKAUSDgoGZmllbGQ3GAcgASgFEg4KBmZpZWxkOBgIIAEoBRIOCgZmaWVs", + "ZDkYCSABKAUSDwoHZmllbGQxMBgKIAEoBSoECAUQBipACgtGb3JlaWduRW51", + "bRIPCgtGT1JFSUdOX0ZPTxAEEg8KC0ZPUkVJR05fQkFSEAUSDwoLRk9SRUlH", + "Tl9CQVoQBipLChRUZXN0RW51bVdpdGhEdXBWYWx1ZRIICgRGT08xEAESCAoE", + "QkFSMRACEgcKA0JBWhADEggKBEZPTzIQARIICgRCQVIyEAIaAhABKokBCg5U", + "ZXN0U3BhcnNlRW51bRIMCghTUEFSU0VfQRB7Eg4KCFNQQVJTRV9CEKbnAxIP", + "CghTUEFSU0VfQxCysYAGEhUKCFNQQVJTRV9EEPH//////////wESFQoIU1BB", + "UlNFX0UQtN78////////ARIMCghTUEFSU0VfRhAAEgwKCFNQQVJTRV9HEAIq", + "iw8KDVZlcnlMYXJnZUVudW0SFgoSRU5VTV9MQUJFTF9ERUZBVUxUEAASEAoM", + "RU5VTV9MQUJFTF8xEAESEAoMRU5VTV9MQUJFTF8yEAISEAoMRU5VTV9MQUJF", + "TF8zEAMSEAoMRU5VTV9MQUJFTF80EAQSEAoMRU5VTV9MQUJFTF81EAUSEAoM", + "RU5VTV9MQUJFTF82EAYSEAoMRU5VTV9MQUJFTF83EAcSEAoMRU5VTV9MQUJF", + "TF84EAgSEAoMRU5VTV9MQUJFTF85EAkSEQoNRU5VTV9MQUJFTF8xMBAKEhEK", + "DUVOVU1fTEFCRUxfMTEQCxIRCg1FTlVNX0xBQkVMXzEyEAwSEQoNRU5VTV9M", + "QUJFTF8xMxANEhEKDUVOVU1fTEFCRUxfMTQQDhIRCg1FTlVNX0xBQkVMXzE1", + "EA8SEQoNRU5VTV9MQUJFTF8xNhAQEhEKDUVOVU1fTEFCRUxfMTcQERIRCg1F", + "TlVNX0xBQkVMXzE4EBISEQoNRU5VTV9MQUJFTF8xORATEhEKDUVOVU1fTEFC", + "RUxfMjAQFBIRCg1FTlVNX0xBQkVMXzIxEBUSEQoNRU5VTV9MQUJFTF8yMhAW", + "EhEKDUVOVU1fTEFCRUxfMjMQFxIRCg1FTlVNX0xBQkVMXzI0EBgSEQoNRU5V", + "TV9MQUJFTF8yNRAZEhEKDUVOVU1fTEFCRUxfMjYQGhIRCg1FTlVNX0xBQkVM", + "XzI3EBsSEQoNRU5VTV9MQUJFTF8yOBAcEhEKDUVOVU1fTEFCRUxfMjkQHRIR", + "Cg1FTlVNX0xBQkVMXzMwEB4SEQoNRU5VTV9MQUJFTF8zMRAfEhEKDUVOVU1f", + "TEFCRUxfMzIQIBIRCg1FTlVNX0xBQkVMXzMzECESEQoNRU5VTV9MQUJFTF8z", + "NBAiEhEKDUVOVU1fTEFCRUxfMzUQIxIRCg1FTlVNX0xBQkVMXzM2ECQSEQoN", + "RU5VTV9MQUJFTF8zNxAlEhEKDUVOVU1fTEFCRUxfMzgQJhIRCg1FTlVNX0xB", + "QkVMXzM5ECcSEQoNRU5VTV9MQUJFTF80MBAoEhEKDUVOVU1fTEFCRUxfNDEQ", + "KRIRCg1FTlVNX0xBQkVMXzQyECoSEQoNRU5VTV9MQUJFTF80MxArEhEKDUVO", + "VU1fTEFCRUxfNDQQLBIRCg1FTlVNX0xBQkVMXzQ1EC0SEQoNRU5VTV9MQUJF", + "TF80NhAuEhEKDUVOVU1fTEFCRUxfNDcQLxIRCg1FTlVNX0xBQkVMXzQ4EDAS", + "EQoNRU5VTV9MQUJFTF80ORAxEhEKDUVOVU1fTEFCRUxfNTAQMhIRCg1FTlVN", + "X0xBQkVMXzUxEDMSEQoNRU5VTV9MQUJFTF81MhA0EhEKDUVOVU1fTEFCRUxf", + "NTMQNRIRCg1FTlVNX0xBQkVMXzU0EDYSEQoNRU5VTV9MQUJFTF81NRA3EhEK", + "DUVOVU1fTEFCRUxfNTYQOBIRCg1FTlVNX0xBQkVMXzU3EDkSEQoNRU5VTV9M", + "QUJFTF81OBA6EhEKDUVOVU1fTEFCRUxfNTkQOxIRCg1FTlVNX0xBQkVMXzYw", + "EDwSEQoNRU5VTV9MQUJFTF82MRA9EhEKDUVOVU1fTEFCRUxfNjIQPhIRCg1F", + "TlVNX0xBQkVMXzYzED8SEQoNRU5VTV9MQUJFTF82NBBAEhEKDUVOVU1fTEFC", + "RUxfNjUQQRIRCg1FTlVNX0xBQkVMXzY2EEISEQoNRU5VTV9MQUJFTF82NxBD", + "EhEKDUVOVU1fTEFCRUxfNjgQRBIRCg1FTlVNX0xBQkVMXzY5EEUSEQoNRU5V", + "TV9MQUJFTF83MBBGEhEKDUVOVU1fTEFCRUxfNzEQRxIRCg1FTlVNX0xBQkVM", + "XzcyEEgSEQoNRU5VTV9MQUJFTF83MxBJEhEKDUVOVU1fTEFCRUxfNzQQShIR", + "Cg1FTlVNX0xBQkVMXzc1EEsSEQoNRU5VTV9MQUJFTF83NhBMEhEKDUVOVU1f", + "TEFCRUxfNzcQTRIRCg1FTlVNX0xBQkVMXzc4EE4SEQoNRU5VTV9MQUJFTF83", + "ORBPEhEKDUVOVU1fTEFCRUxfODAQUBIRCg1FTlVNX0xBQkVMXzgxEFESEQoN", + "RU5VTV9MQUJFTF84MhBSEhEKDUVOVU1fTEFCRUxfODMQUxIRCg1FTlVNX0xB", + "QkVMXzg0EFQSEQoNRU5VTV9MQUJFTF84NRBVEhEKDUVOVU1fTEFCRUxfODYQ", + "VhIRCg1FTlVNX0xBQkVMXzg3EFcSEQoNRU5VTV9MQUJFTF84OBBYEhEKDUVO", + "VU1fTEFCRUxfODkQWRIRCg1FTlVNX0xBQkVMXzkwEFoSEQoNRU5VTV9MQUJF", + "TF85MRBbEhEKDUVOVU1fTEFCRUxfOTIQXBIRCg1FTlVNX0xBQkVMXzkzEF0S", + "EQoNRU5VTV9MQUJFTF85NBBeEhEKDUVOVU1fTEFCRUxfOTUQXxIRCg1FTlVN", + "X0xBQkVMXzk2EGASEQoNRU5VTV9MQUJFTF85NxBhEhEKDUVOVU1fTEFCRUxf", + "OTgQYhIRCg1FTlVNX0xBQkVMXzk5EGMSEgoORU5VTV9MQUJFTF8xMDAQZDK1", + "AQoLVGVzdFNlcnZpY2USUgoDRm9vEiQucHJvdG9idWZfdW5pdHRlc3RfcHJv", + "dG8yLkZvb1JlcXVlc3QaJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9v", + "UmVzcG9uc2USUgoDQmFyEiQucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLkJh", + "clJlcXVlc3QaJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuQmFyUmVzcG9u", + "c2U6TQoYb3B0aW9uYWxfaW50MzJfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5p", + "dHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGAEgASgFOk0KGG9wdGlv", + "bmFsX2ludDY0X2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0QWxsRXh0ZW5zaW9ucxgCIAEoAzpOChlvcHRpb25hbF91aW50MzJf", "ZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxF", - "eHRlbnNpb25zGA8gASgMOn8KF29wdGlvbmFsZ3JvdXBfZXh0ZW5zaW9uEisu", - "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGBAg", - "ASgKMjEucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLk9wdGlvbmFsR3JvdXBf", - "ZXh0ZW5zaW9uOowBCiFvcHRpb25hbF9uZXN0ZWRfbWVzc2FnZV9leHRlbnNp", + "eHRlbnNpb25zGAMgASgNOk4KGW9wdGlvbmFsX3VpbnQ2NF9leHRlbnNpb24S", + "Ky5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMY", + "BCABKAQ6TgoZb3B0aW9uYWxfc2ludDMyX2V4dGVuc2lvbhIrLnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgFIAEoETpOChlv", + "cHRpb25hbF9zaW50NjRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3Rf", + "cHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGAYgASgSOk8KGm9wdGlvbmFsX2Zp", + "eGVkMzJfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", + "c3RBbGxFeHRlbnNpb25zGAcgASgHOk8KGm9wdGlvbmFsX2ZpeGVkNjRfZXh0", + "ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRl", + "bnNpb25zGAggASgGOlAKG29wdGlvbmFsX3NmaXhlZDMyX2V4dGVuc2lvbhIr", + "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgJ", + "IAEoDzpQChtvcHRpb25hbF9zZml4ZWQ2NF9leHRlbnNpb24SKy5wcm90b2J1", + "Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYCiABKBA6TQoY", + "b3B0aW9uYWxfZmxvYXRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3Rf", + "cHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGAsgASgCOk4KGW9wdGlvbmFsX2Rv", + "dWJsZV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", + "dEFsbEV4dGVuc2lvbnMYDCABKAE6TAoXb3B0aW9uYWxfYm9vbF9leHRlbnNp", "b24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lv", - "bnMYEiABKAsyNC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5", - "cGVzLk5lc3RlZE1lc3NhZ2U6gQEKIm9wdGlvbmFsX2ZvcmVpZ25fbWVzc2Fn", + "bnMYDSABKAg6TgoZb3B0aW9uYWxfc3RyaW5nX2V4dGVuc2lvbhIrLnByb3Rv", + "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgOIAEoCTpN", + "ChhvcHRpb25hbF9ieXRlc19leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVz", + "dF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYDyABKAw6fwoXb3B0aW9uYWxn", + "cm91cF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", + "dEFsbEV4dGVuc2lvbnMYECABKAoyMS5wcm90b2J1Zl91bml0dGVzdF9wcm90", + "bzIuT3B0aW9uYWxHcm91cF9leHRlbnNpb246jAEKIW9wdGlvbmFsX25lc3Rl", + "ZF9tZXNzYWdlX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0QWxsRXh0ZW5zaW9ucxgSIAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZTqBAQoib3B0aW9u", + "YWxfZm9yZWlnbl9tZXNzYWdlX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0", + "ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgTIAEoCzIoLnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduTWVzc2FnZTqGAQohb3B0aW9uYWxf", + "aW1wb3J0X21lc3NhZ2VfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3Rf", + "cHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGBQgASgLMi4ucHJvdG9idWZfdW5p", + "dHRlc3RfaW1wb3J0X3Byb3RvMi5JbXBvcnRNZXNzYWdlOoYBCh5vcHRpb25h", + "bF9uZXN0ZWRfZW51bV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9w", + "cm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYFSABKA4yMS5wcm90b2J1Zl91bml0", + "dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW06ewofb3B0aW9u", + "YWxfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgWIAEoDjIlLnByb3RvYnVmX3Vu", + "aXR0ZXN0X3Byb3RvMi5Gb3JlaWduRW51bTqAAQoeb3B0aW9uYWxfaW1wb3J0", + "X2VudW1fZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", + "c3RBbGxFeHRlbnNpb25zGBcgASgOMisucHJvdG9idWZfdW5pdHRlc3RfaW1w", + "b3J0X3Byb3RvMi5JbXBvcnRFbnVtOlgKH29wdGlvbmFsX3N0cmluZ19waWVj", "ZV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFs", - "bEV4dGVuc2lvbnMYEyABKAsyKC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "Rm9yZWlnbk1lc3NhZ2U6hgEKIW9wdGlvbmFsX2ltcG9ydF9tZXNzYWdlX2V4", - "dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0", - "ZW5zaW9ucxgUIAEoCzIuLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydF9wcm90", - "bzIuSW1wb3J0TWVzc2FnZTqGAQoeb3B0aW9uYWxfbmVzdGVkX2VudW1fZXh0", - "ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRl", - "bnNpb25zGBUgASgOMjEucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RB", - "bGxUeXBlcy5OZXN0ZWRFbnVtOnsKH29wdGlvbmFsX2ZvcmVpZ25fZW51bV9l", - "eHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4", - "dGVuc2lvbnMYFiABKA4yJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuRm9y", - "ZWlnbkVudW06gAEKHm9wdGlvbmFsX2ltcG9ydF9lbnVtX2V4dGVuc2lvbhIr", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgX", - "IAEoDjIrLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydF9wcm90bzIuSW1wb3J0", - "RW51bTpYCh9vcHRpb25hbF9zdHJpbmdfcGllY2VfZXh0ZW5zaW9uEisucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGBggASgJ", - "QgIIAjpMChdvcHRpb25hbF9jb3JkX2V4dGVuc2lvbhIrLnByb3RvYnVmX3Vu", - "aXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgZIAEoCTqTAQoob3B0", - "aW9uYWxfcHVibGljX2ltcG9ydF9tZXNzYWdlX2V4dGVuc2lvbhIrLnByb3Rv", - "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgaIAEoCzI0", - "LnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydF9wcm90bzIuUHVibGljSW1wb3J0", - "TWVzc2FnZTqOAQofb3B0aW9uYWxfbGF6eV9tZXNzYWdlX2V4dGVuc2lvbhIr", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgb", - "IAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMu", - "TmVzdGVkTWVzc2FnZUICKAE6TQoYcmVwZWF0ZWRfaW50MzJfZXh0ZW5zaW9u", + "bEV4dGVuc2lvbnMYGCABKAlCAggCOlAKF29wdGlvbmFsX2NvcmRfZXh0ZW5z", + "aW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNp", + "b25zGBkgASgJQgIIATqTAQoob3B0aW9uYWxfcHVibGljX2ltcG9ydF9tZXNz", + "YWdlX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", + "QWxsRXh0ZW5zaW9ucxgaIAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9y", + "dF9wcm90bzIuUHVibGljSW1wb3J0TWVzc2FnZTqOAQofb3B0aW9uYWxfbGF6", + "eV9tZXNzYWdlX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0QWxsRXh0ZW5zaW9ucxgbIAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZUICKAE6TQoYcmVw", + "ZWF0ZWRfaW50MzJfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJv", + "dG8yLlRlc3RBbGxFeHRlbnNpb25zGB8gAygFOk0KGHJlcGVhdGVkX2ludDY0", + "X2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxs", + "RXh0ZW5zaW9ucxggIAMoAzpOChlyZXBlYXRlZF91aW50MzJfZXh0ZW5zaW9u", "EisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25z", - "GB8gAygFOk0KGHJlcGVhdGVkX2ludDY0X2V4dGVuc2lvbhIrLnByb3RvYnVm", - "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxggIAMoAzpOChly", - "ZXBlYXRlZF91aW50MzJfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3Rf", - "cHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGCEgAygNOk4KGXJlcGVhdGVkX3Vp", - "bnQ2NF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dEFsbEV4dGVuc2lvbnMYIiADKAQ6TgoZcmVwZWF0ZWRfc2ludDMyX2V4dGVu", - "c2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5z", - "aW9ucxgjIAMoETpOChlyZXBlYXRlZF9zaW50NjRfZXh0ZW5zaW9uEisucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGCQgAygS", - "Ok8KGnJlcGVhdGVkX2ZpeGVkMzJfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5p", - "dHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGCUgAygHOk8KGnJlcGVh", - "dGVkX2ZpeGVkNjRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJv", - "dG8yLlRlc3RBbGxFeHRlbnNpb25zGCYgAygGOlAKG3JlcGVhdGVkX3NmaXhl", - "ZDMyX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", - "QWxsRXh0ZW5zaW9ucxgnIAMoDzpQChtyZXBlYXRlZF9zZml4ZWQ2NF9leHRl", + "GCEgAygNOk4KGXJlcGVhdGVkX3VpbnQ2NF9leHRlbnNpb24SKy5wcm90b2J1", + "Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYIiADKAQ6TgoZ", + "cmVwZWF0ZWRfc2ludDMyX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgjIAMoETpOChlyZXBlYXRlZF9z", + "aW50NjRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", + "c3RBbGxFeHRlbnNpb25zGCQgAygSOk8KGnJlcGVhdGVkX2ZpeGVkMzJfZXh0", + "ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRl", + "bnNpb25zGCUgAygHOk8KGnJlcGVhdGVkX2ZpeGVkNjRfZXh0ZW5zaW9uEisu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGCYg", + "AygGOlAKG3JlcGVhdGVkX3NmaXhlZDMyX2V4dGVuc2lvbhIrLnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgnIAMoDzpQChty", + "ZXBlYXRlZF9zZml4ZWQ2NF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVz", + "dF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYKCADKBA6TQoYcmVwZWF0ZWRf", + "ZmxvYXRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", + "c3RBbGxFeHRlbnNpb25zGCkgAygCOk4KGXJlcGVhdGVkX2RvdWJsZV9leHRl", "bnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVu", - "c2lvbnMYKCADKBA6TQoYcmVwZWF0ZWRfZmxvYXRfZXh0ZW5zaW9uEisucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGCkgAygC", - "Ok4KGXJlcGVhdGVkX2RvdWJsZV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0", - "dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYKiADKAE6TAoXcmVwZWF0", - "ZWRfYm9vbF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "VGVzdEFsbEV4dGVuc2lvbnMYKyADKAg6TgoZcmVwZWF0ZWRfc3RyaW5nX2V4", - "dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0", - "ZW5zaW9ucxgsIAMoCTpNChhyZXBlYXRlZF9ieXRlc19leHRlbnNpb24SKy5w", - "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYLSAD", - "KAw6fwoXcmVwZWF0ZWRncm91cF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0", - "dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYLiADKAoyMS5wcm90b2J1", - "Zl91bml0dGVzdF9wcm90bzIuUmVwZWF0ZWRHcm91cF9leHRlbnNpb246jAEK", - "IXJlcGVhdGVkX25lc3RlZF9tZXNzYWdlX2V4dGVuc2lvbhIrLnByb3RvYnVm", - "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgwIAMoCzI0LnBy", - "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMuTmVzdGVkTWVz", - "c2FnZTqBAQoicmVwZWF0ZWRfZm9yZWlnbl9tZXNzYWdlX2V4dGVuc2lvbhIr", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgx", - "IAMoCzIoLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduTWVzc2Fn", - "ZTqGAQohcmVwZWF0ZWRfaW1wb3J0X21lc3NhZ2VfZXh0ZW5zaW9uEisucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGDIgAygL", - "Mi4ucHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0X3Byb3RvMi5JbXBvcnRNZXNz", - "YWdlOoYBCh5yZXBlYXRlZF9uZXN0ZWRfZW51bV9leHRlbnNpb24SKy5wcm90", - "b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYMyADKA4y", - "MS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3Rl", - "ZEVudW06ewofcmVwZWF0ZWRfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIrLnBy", - "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxg0IAMo", - "DjIlLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduRW51bTqAAQoe", - "cmVwZWF0ZWRfaW1wb3J0X2VudW1fZXh0ZW5zaW9uEisucHJvdG9idWZfdW5p", - "dHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGDUgAygOMisucHJvdG9i", - "dWZfdW5pdHRlc3RfaW1wb3J0X3Byb3RvMi5JbXBvcnRFbnVtOlgKH3JlcGVh", - "dGVkX3N0cmluZ19waWVjZV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYNiADKAlCAggCOkwKF3JlcGVh", - "dGVkX2NvcmRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", - "LlRlc3RBbGxFeHRlbnNpb25zGDcgAygJOo4BCh9yZXBlYXRlZF9sYXp5X21l", + "c2lvbnMYKiADKAE6TAoXcmVwZWF0ZWRfYm9vbF9leHRlbnNpb24SKy5wcm90", + "b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYKyADKAg6", + "TgoZcmVwZWF0ZWRfc3RyaW5nX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0", + "ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxgsIAMoCTpNChhyZXBlYXRl", + "ZF9ieXRlc19leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", + "VGVzdEFsbEV4dGVuc2lvbnMYLSADKAw6fwoXcmVwZWF0ZWRncm91cF9leHRl", + "bnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVu", + "c2lvbnMYLiADKAoyMS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuUmVwZWF0", + "ZWRHcm91cF9leHRlbnNpb246jAEKIXJlcGVhdGVkX25lc3RlZF9tZXNzYWdl", + "X2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxs", + "RXh0ZW5zaW9ucxgwIAMoCzI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5U", + "ZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZTqBAQoicmVwZWF0ZWRfZm9yZWln", + "bl9tZXNzYWdlX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0QWxsRXh0ZW5zaW9ucxgxIAMoCzIoLnByb3RvYnVmX3VuaXR0ZXN0", + "X3Byb3RvMi5Gb3JlaWduTWVzc2FnZTqGAQohcmVwZWF0ZWRfaW1wb3J0X21l", "c3NhZ2VfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RBbGxFeHRlbnNpb25zGDkgAygLMjQucHJvdG9idWZfdW5pdHRlc3RfcHJv", - "dG8yLlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlQgIoATpQChdkZWZhdWx0", - "X2ludDMyX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5U", - "ZXN0QWxsRXh0ZW5zaW9ucxg9IAEoBToCNDE6UAoXZGVmYXVsdF9pbnQ2NF9l", - "eHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4", - "dGVuc2lvbnMYPiABKAM6AjQyOlEKGGRlZmF1bHRfdWludDMyX2V4dGVuc2lv", + "c3RBbGxFeHRlbnNpb25zGDIgAygLMi4ucHJvdG9idWZfdW5pdHRlc3RfaW1w", + "b3J0X3Byb3RvMi5JbXBvcnRNZXNzYWdlOoYBCh5yZXBlYXRlZF9uZXN0ZWRf", + "ZW51bV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", + "dEFsbEV4dGVuc2lvbnMYMyADKA4yMS5wcm90b2J1Zl91bml0dGVzdF9wcm90", + "bzIuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW06ewofcmVwZWF0ZWRfZm9yZWln", + "bl9lbnVtX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5U", + "ZXN0QWxsRXh0ZW5zaW9ucxg0IAMoDjIlLnByb3RvYnVmX3VuaXR0ZXN0X3By", + "b3RvMi5Gb3JlaWduRW51bTqAAQoecmVwZWF0ZWRfaW1wb3J0X2VudW1fZXh0", + "ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRl", + "bnNpb25zGDUgAygOMisucHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0X3Byb3Rv", + "Mi5JbXBvcnRFbnVtOlgKH3JlcGVhdGVkX3N0cmluZ19waWVjZV9leHRlbnNp", + "b24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lv", + "bnMYNiADKAlCAggCOlAKF3JlcGVhdGVkX2NvcmRfZXh0ZW5zaW9uEisucHJv", + "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGDcgAygJ", + "QgIIATqOAQofcmVwZWF0ZWRfbGF6eV9tZXNzYWdlX2V4dGVuc2lvbhIrLnBy", + "b3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxg5IAMo", + "CzI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXMuTmVz", + "dGVkTWVzc2FnZUICKAE6UAoXZGVmYXVsdF9pbnQzMl9leHRlbnNpb24SKy5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYPSAB", + "KAU6AjQxOlAKF2RlZmF1bHRfaW50NjRfZXh0ZW5zaW9uEisucHJvdG9idWZf", + "dW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGD4gASgDOgI0MjpR", + "ChhkZWZhdWx0X3VpbnQzMl9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVz", + "dF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYPyABKA06AjQzOlEKGGRlZmF1", + "bHRfdWludDY0X2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0QWxsRXh0ZW5zaW9ucxhAIAEoBDoCNDQ6UgoYZGVmYXVsdF9zaW50", + "MzJfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RB", + "bGxFeHRlbnNpb25zGEEgASgROgMtNDU6UQoYZGVmYXVsdF9zaW50NjRfZXh0", + "ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRl", + "bnNpb25zGEIgASgSOgI0NjpSChlkZWZhdWx0X2ZpeGVkMzJfZXh0ZW5zaW9u", + "EisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25z", + "GEMgASgHOgI0NzpSChlkZWZhdWx0X2ZpeGVkNjRfZXh0ZW5zaW9uEisucHJv", + "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGEQgASgG", + "OgI0ODpTChpkZWZhdWx0X3NmaXhlZDMyX2V4dGVuc2lvbhIrLnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxhFIAEoDzoCNDk6", + "VAoaZGVmYXVsdF9zZml4ZWQ2NF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0", + "dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYRiABKBA6Ay01MDpSChdk", + "ZWZhdWx0X2Zsb2F0X2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3By", + "b3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxhHIAEoAjoENTEuNTpUChhkZWZhdWx0", + "X2RvdWJsZV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", + "VGVzdEFsbEV4dGVuc2lvbnMYSCABKAE6BTUyMDAwOlEKFmRlZmF1bHRfYm9v", + "bF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFs", + "bEV4dGVuc2lvbnMYSSABKAg6BHRydWU6VAoYZGVmYXVsdF9zdHJpbmdfZXh0", + "ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRl", + "bnNpb25zGEogASgJOgVoZWxsbzpTChdkZWZhdWx0X2J5dGVzX2V4dGVuc2lv", "bhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9u", - "cxg/IAEoDToCNDM6UQoYZGVmYXVsdF91aW50NjRfZXh0ZW5zaW9uEisucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGEAgASgE", - "OgI0NDpSChhkZWZhdWx0X3NpbnQzMl9leHRlbnNpb24SKy5wcm90b2J1Zl91", - "bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYQSABKBE6Ay00NTpR", - "ChhkZWZhdWx0X3NpbnQ2NF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYQiABKBI6AjQ2OlIKGWRlZmF1", - "bHRfZml4ZWQzMl9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90", - "bzIuVGVzdEFsbEV4dGVuc2lvbnMYQyABKAc6AjQ3OlIKGWRlZmF1bHRfZml4", - "ZWQ2NF9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dEFsbEV4dGVuc2lvbnMYRCABKAY6AjQ4OlMKGmRlZmF1bHRfc2ZpeGVkMzJf", - "ZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxF", - "eHRlbnNpb25zGEUgASgPOgI0OTpUChpkZWZhdWx0X3NmaXhlZDY0X2V4dGVu", - "c2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5z", - "aW9ucxhGIAEoEDoDLTUwOlIKF2RlZmF1bHRfZmxvYXRfZXh0ZW5zaW9uEisu", - "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGEcg", - "ASgCOgQ1MS41OlQKGGRlZmF1bHRfZG91YmxlX2V4dGVuc2lvbhIrLnByb3Rv", - "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxhIIAEoAToF", - "NTIwMDA6UQoWZGVmYXVsdF9ib29sX2V4dGVuc2lvbhIrLnByb3RvYnVmX3Vu", - "aXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxhJIAEoCDoEdHJ1ZTpU", - "ChhkZWZhdWx0X3N0cmluZ19leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVz", - "dF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYSiABKAk6BWhlbGxvOlMKF2Rl", - "ZmF1bHRfYnl0ZXNfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJv", - "dG8yLlRlc3RBbGxFeHRlbnNpb25zGEsgASgMOgV3b3JsZDqKAQodZGVmYXVs", - "dF9uZXN0ZWRfZW51bV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYUSABKA4yMS5wcm90b2J1Zl91bml0", - "dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW06A0JBUjqHAQoe", - "ZGVmYXVsdF9mb3JlaWduX2VudW1fZXh0ZW5zaW9uEisucHJvdG9idWZfdW5p", - "dHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGFIgASgOMiUucHJvdG9i", - "dWZfdW5pdHRlc3RfcHJvdG8yLkZvcmVpZ25FbnVtOgtGT1JFSUdOX0JBUjqL", - "AQodZGVmYXVsdF9pbXBvcnRfZW51bV9leHRlbnNpb24SKy5wcm90b2J1Zl91", - "bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYUyABKA4yKy5wcm90", - "b2J1Zl91bml0dGVzdF9pbXBvcnRfcHJvdG8yLkltcG9ydEVudW06CklNUE9S", - "VF9CQVI6XAoeZGVmYXVsdF9zdHJpbmdfcGllY2VfZXh0ZW5zaW9uEisucHJv", - "dG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGFQgASgJ", - "OgNhYmNCAggCOlAKFmRlZmF1bHRfY29yZF9leHRlbnNpb24SKy5wcm90b2J1", - "Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYVSABKAk6AzEy", - "MzpLChZvbmVvZl91aW50MzJfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRl", - "c3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNpb25zGG8gASgNOokBCh5vbmVvZl9u", - "ZXN0ZWRfbWVzc2FnZV9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdEFsbEV4dGVuc2lvbnMYcCABKAsyNC5wcm90b2J1Zl91bml0", - "dGVzdF9wcm90bzIuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2U6SwoWb25l", - "b2Zfc3RyaW5nX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", - "Mi5UZXN0QWxsRXh0ZW5zaW9ucxhxIAEoCTpKChVvbmVvZl9ieXRlc19leHRl", - "bnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFsbEV4dGVu", - "c2lvbnMYciABKAw6SQoTbXlfZXh0ZW5zaW9uX3N0cmluZxIsLnByb3RvYnVm", - "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0RmllbGRPcmRlcmluZ3MYMiABKAk6RgoQ", - "bXlfZXh0ZW5zaW9uX2ludBIsLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5U", - "ZXN0RmllbGRPcmRlcmluZ3MYBSABKAU6UgoWcGFja2VkX2ludDMyX2V4dGVu", - "c2lvbhIuLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UGFja2VkRXh0", - "ZW5zaW9ucxhaIAMoBUICEAE6UgoWcGFja2VkX2ludDY0X2V4dGVuc2lvbhIu", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UGFja2VkRXh0ZW5zaW9u", - "cxhbIAMoA0ICEAE6UwoXcGFja2VkX3VpbnQzMl9leHRlbnNpb24SLi5wcm90", - "b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFBhY2tlZEV4dGVuc2lvbnMYXCAD", - "KA1CAhABOlMKF3BhY2tlZF91aW50NjRfZXh0ZW5zaW9uEi4ucHJvdG9idWZf", - "dW5pdHRlc3RfcHJvdG8yLlRlc3RQYWNrZWRFeHRlbnNpb25zGF0gAygEQgIQ", - "ATpTChdwYWNrZWRfc2ludDMyX2V4dGVuc2lvbhIuLnByb3RvYnVmX3VuaXR0", - "ZXN0X3Byb3RvMi5UZXN0UGFja2VkRXh0ZW5zaW9ucxheIAMoEUICEAE6UwoX", - "cGFja2VkX3NpbnQ2NF9leHRlbnNpb24SLi5wcm90b2J1Zl91bml0dGVzdF9w", - "cm90bzIuVGVzdFBhY2tlZEV4dGVuc2lvbnMYXyADKBJCAhABOlQKGHBhY2tl", - "ZF9maXhlZDMyX2V4dGVuc2lvbhIuLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", - "Mi5UZXN0UGFja2VkRXh0ZW5zaW9ucxhgIAMoB0ICEAE6VAoYcGFja2VkX2Zp", - "eGVkNjRfZXh0ZW5zaW9uEi4ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RQYWNrZWRFeHRlbnNpb25zGGEgAygGQgIQATpVChlwYWNrZWRfc2ZpeGVk", + "cxhLIAEoDDoFd29ybGQ6igEKHWRlZmF1bHRfbmVzdGVkX2VudW1fZXh0ZW5z", + "aW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNp", + "b25zGFEgASgOMjEucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxU", + "eXBlcy5OZXN0ZWRFbnVtOgNCQVI6hwEKHmRlZmF1bHRfZm9yZWlnbl9lbnVt", + "X2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxs", + "RXh0ZW5zaW9ucxhSIAEoDjIlLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5G", + "b3JlaWduRW51bToLRk9SRUlHTl9CQVI6iwEKHWRlZmF1bHRfaW1wb3J0X2Vu", + "dW1fZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RB", + "bGxFeHRlbnNpb25zGFMgASgOMisucHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0", + "X3Byb3RvMi5JbXBvcnRFbnVtOgpJTVBPUlRfQkFSOlwKHmRlZmF1bHRfc3Ry", + "aW5nX3BpZWNlX2V4dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", + "Mi5UZXN0QWxsRXh0ZW5zaW9ucxhUIAEoCToDYWJjQgIIAjpUChZkZWZhdWx0", + "X2NvcmRfZXh0ZW5zaW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", + "c3RBbGxFeHRlbnNpb25zGFUgASgJOgMxMjNCAggBOksKFm9uZW9mX3VpbnQz", + "Ml9leHRlbnNpb24SKy5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdEFs", + "bEV4dGVuc2lvbnMYbyABKA06iQEKHm9uZW9mX25lc3RlZF9tZXNzYWdlX2V4", + "dGVuc2lvbhIrLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0", + "ZW5zaW9ucxhwIAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", + "QWxsVHlwZXMuTmVzdGVkTWVzc2FnZTpLChZvbmVvZl9zdHJpbmdfZXh0ZW5z", + "aW9uEisucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RBbGxFeHRlbnNp", + "b25zGHEgASgJOkoKFW9uZW9mX2J5dGVzX2V4dGVuc2lvbhIrLnByb3RvYnVm", + "X3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsRXh0ZW5zaW9ucxhyIAEoDDpJChNt", + "eV9leHRlbnNpb25fc3RyaW5nEiwucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8y", + "LlRlc3RGaWVsZE9yZGVyaW5ncxgyIAEoCTpGChBteV9leHRlbnNpb25faW50", + "EiwucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RGaWVsZE9yZGVyaW5n", + "cxgFIAEoBTpSChZwYWNrZWRfaW50MzJfZXh0ZW5zaW9uEi4ucHJvdG9idWZf", + "dW5pdHRlc3RfcHJvdG8yLlRlc3RQYWNrZWRFeHRlbnNpb25zGFogAygFQgIQ", + "ATpSChZwYWNrZWRfaW50NjRfZXh0ZW5zaW9uEi4ucHJvdG9idWZfdW5pdHRl", + "c3RfcHJvdG8yLlRlc3RQYWNrZWRFeHRlbnNpb25zGFsgAygDQgIQATpTChdw", + "YWNrZWRfdWludDMyX2V4dGVuc2lvbhIuLnByb3RvYnVmX3VuaXR0ZXN0X3By", + "b3RvMi5UZXN0UGFja2VkRXh0ZW5zaW9ucxhcIAMoDUICEAE6UwoXcGFja2Vk", + "X3VpbnQ2NF9leHRlbnNpb24SLi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", + "VGVzdFBhY2tlZEV4dGVuc2lvbnMYXSADKARCAhABOlMKF3BhY2tlZF9zaW50", "MzJfZXh0ZW5zaW9uEi4ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RQ", - "YWNrZWRFeHRlbnNpb25zGGIgAygPQgIQATpVChlwYWNrZWRfc2ZpeGVkNjRf", - "ZXh0ZW5zaW9uEi4ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RQYWNr", - "ZWRFeHRlbnNpb25zGGMgAygQQgIQATpSChZwYWNrZWRfZmxvYXRfZXh0ZW5z", + "YWNrZWRFeHRlbnNpb25zGF4gAygRQgIQATpTChdwYWNrZWRfc2ludDY0X2V4", + "dGVuc2lvbhIuLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UGFja2Vk", + "RXh0ZW5zaW9ucxhfIAMoEkICEAE6VAoYcGFja2VkX2ZpeGVkMzJfZXh0ZW5z", "aW9uEi4ucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RQYWNrZWRFeHRl", - "bnNpb25zGGQgAygCQgIQATpTChdwYWNrZWRfZG91YmxlX2V4dGVuc2lvbhIu", - "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0UGFja2VkRXh0ZW5zaW9u", - "cxhlIAMoAUICEAE6UQoVcGFja2VkX2Jvb2xfZXh0ZW5zaW9uEi4ucHJvdG9i", - "dWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RQYWNrZWRFeHRlbnNpb25zGGYgAygI", - "QgIQATp4ChVwYWNrZWRfZW51bV9leHRlbnNpb24SLi5wcm90b2J1Zl91bml0", - "dGVzdF9wcm90bzIuVGVzdFBhY2tlZEV4dGVuc2lvbnMYZyADKA4yJS5wcm90", - "b2J1Zl91bml0dGVzdF9wcm90bzIuRm9yZWlnbkVudW1CAhABOlYKGHVucGFj", - "a2VkX2ludDMyX2V4dGVuc2lvbhIwLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3Rv", - "Mi5UZXN0VW5wYWNrZWRFeHRlbnNpb25zGFogAygFQgIQADpWChh1bnBhY2tl", - "ZF9pbnQ2NF9leHRlbnNpb24SMC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "VGVzdFVucGFja2VkRXh0ZW5zaW9ucxhbIAMoA0ICEAA6VwoZdW5wYWNrZWRf", - "dWludDMyX2V4dGVuc2lvbhIwLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5U", - "ZXN0VW5wYWNrZWRFeHRlbnNpb25zGFwgAygNQgIQADpXChl1bnBhY2tlZF91", - "aW50NjRfZXh0ZW5zaW9uEjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RVbnBhY2tlZEV4dGVuc2lvbnMYXSADKARCAhAAOlcKGXVucGFja2VkX3Np", - "bnQzMl9leHRlbnNpb24SMC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dFVucGFja2VkRXh0ZW5zaW9ucxheIAMoEUICEAA6VwoZdW5wYWNrZWRfc2lu", - "dDY0X2V4dGVuc2lvbhIwLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", - "VW5wYWNrZWRFeHRlbnNpb25zGF8gAygSQgIQADpYChp1bnBhY2tlZF9maXhl", - "ZDMyX2V4dGVuc2lvbhIwLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", - "VW5wYWNrZWRFeHRlbnNpb25zGGAgAygHQgIQADpYChp1bnBhY2tlZF9maXhl", - "ZDY0X2V4dGVuc2lvbhIwLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", - "VW5wYWNrZWRFeHRlbnNpb25zGGEgAygGQgIQADpZCht1bnBhY2tlZF9zZml4", - "ZWQzMl9leHRlbnNpb24SMC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVz", - "dFVucGFja2VkRXh0ZW5zaW9ucxhiIAMoD0ICEAA6WQobdW5wYWNrZWRfc2Zp", - "eGVkNjRfZXh0ZW5zaW9uEjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRl", - "c3RVbnBhY2tlZEV4dGVuc2lvbnMYYyADKBBCAhAAOlYKGHVucGFja2VkX2Zs", - "b2F0X2V4dGVuc2lvbhIwLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", - "VW5wYWNrZWRFeHRlbnNpb25zGGQgAygCQgIQADpXChl1bnBhY2tlZF9kb3Vi", - "bGVfZXh0ZW5zaW9uEjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RV", - "bnBhY2tlZEV4dGVuc2lvbnMYZSADKAFCAhAAOlUKF3VucGFja2VkX2Jvb2xf", - "ZXh0ZW5zaW9uEjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBh", - "Y2tlZEV4dGVuc2lvbnMYZiADKAhCAhAAOnwKF3VucGFja2VkX2VudW1fZXh0", - "ZW5zaW9uEjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBhY2tl", - "ZEV4dGVuc2lvbnMYZyADKA4yJS5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", - "Rm9yZWlnbkVudW1CAhAAOnIKDnRlc3RfYWxsX3R5cGVzEi4ucHJvdG9idWZf", - "dW5pdHRlc3RfcHJvdG8yLlRlc3RIdWdlRmllbGROdW1iZXJzGOCq//8BIAEo", - "CzImLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0QWxsVHlwZXM6YQol", - "dGVzdF9leHRlbnNpb25faW5zaWRlX3RhYmxlX2V4dGVuc2lvbhIyLnByb3Rv", - "YnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0RXh0ZW5zaW9uSW5zaWRlVGFibGUY", - "BSABKAVCMkgBgAEBiAEBkAEB+AEBqgIhR29vZ2xlLlByb3RvYnVmLlRlc3RQ", - "cm90b3MuUHJvdG8y")); + "bnNpb25zGGAgAygHQgIQATpUChhwYWNrZWRfZml4ZWQ2NF9leHRlbnNpb24S", + "Li5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFBhY2tlZEV4dGVuc2lv", + "bnMYYSADKAZCAhABOlUKGXBhY2tlZF9zZml4ZWQzMl9leHRlbnNpb24SLi5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFBhY2tlZEV4dGVuc2lvbnMY", + "YiADKA9CAhABOlUKGXBhY2tlZF9zZml4ZWQ2NF9leHRlbnNpb24SLi5wcm90", + "b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFBhY2tlZEV4dGVuc2lvbnMYYyAD", + "KBBCAhABOlIKFnBhY2tlZF9mbG9hdF9leHRlbnNpb24SLi5wcm90b2J1Zl91", + "bml0dGVzdF9wcm90bzIuVGVzdFBhY2tlZEV4dGVuc2lvbnMYZCADKAJCAhAB", + "OlMKF3BhY2tlZF9kb3VibGVfZXh0ZW5zaW9uEi4ucHJvdG9idWZfdW5pdHRl", + "c3RfcHJvdG8yLlRlc3RQYWNrZWRFeHRlbnNpb25zGGUgAygBQgIQATpRChVw", + "YWNrZWRfYm9vbF9leHRlbnNpb24SLi5wcm90b2J1Zl91bml0dGVzdF9wcm90", + "bzIuVGVzdFBhY2tlZEV4dGVuc2lvbnMYZiADKAhCAhABOngKFXBhY2tlZF9l", + "bnVtX2V4dGVuc2lvbhIuLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0", + "UGFja2VkRXh0ZW5zaW9ucxhnIAMoDjIlLnByb3RvYnVmX3VuaXR0ZXN0X3By", + "b3RvMi5Gb3JlaWduRW51bUICEAE6VgoYdW5wYWNrZWRfaW50MzJfZXh0ZW5z", + "aW9uEjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBhY2tlZEV4", + "dGVuc2lvbnMYWiADKAVCAhAAOlYKGHVucGFja2VkX2ludDY0X2V4dGVuc2lv", + "bhIwLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0VW5wYWNrZWRFeHRl", + "bnNpb25zGFsgAygDQgIQADpXChl1bnBhY2tlZF91aW50MzJfZXh0ZW5zaW9u", + "EjAucHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBhY2tlZEV4dGVu", + "c2lvbnMYXCADKA1CAhAAOlcKGXVucGFja2VkX3VpbnQ2NF9leHRlbnNpb24S", + "MC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFVucGFja2VkRXh0ZW5z", + "aW9ucxhdIAMoBEICEAA6VwoZdW5wYWNrZWRfc2ludDMyX2V4dGVuc2lvbhIw", + "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0VW5wYWNrZWRFeHRlbnNp", + "b25zGF4gAygRQgIQADpXChl1bnBhY2tlZF9zaW50NjRfZXh0ZW5zaW9uEjAu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBhY2tlZEV4dGVuc2lv", + "bnMYXyADKBJCAhAAOlgKGnVucGFja2VkX2ZpeGVkMzJfZXh0ZW5zaW9uEjAu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBhY2tlZEV4dGVuc2lv", + "bnMYYCADKAdCAhAAOlgKGnVucGFja2VkX2ZpeGVkNjRfZXh0ZW5zaW9uEjAu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBhY2tlZEV4dGVuc2lv", + "bnMYYSADKAZCAhAAOlkKG3VucGFja2VkX3NmaXhlZDMyX2V4dGVuc2lvbhIw", + "LnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5UZXN0VW5wYWNrZWRFeHRlbnNp", + "b25zGGIgAygPQgIQADpZCht1bnBhY2tlZF9zZml4ZWQ2NF9leHRlbnNpb24S", + "MC5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFVucGFja2VkRXh0ZW5z", + "aW9ucxhjIAMoEEICEAA6VgoYdW5wYWNrZWRfZmxvYXRfZXh0ZW5zaW9uEjAu", + "cHJvdG9idWZfdW5pdHRlc3RfcHJvdG8yLlRlc3RVbnBhY2tlZEV4dGVuc2lv", + "bnMYZCADKAJCAhAAOlcKGXVucGFja2VkX2RvdWJsZV9leHRlbnNpb24SMC5w", + "cm90b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFVucGFja2VkRXh0ZW5zaW9u", + "cxhlIAMoAUICEAA6VQoXdW5wYWNrZWRfYm9vbF9leHRlbnNpb24SMC5wcm90", + "b2J1Zl91bml0dGVzdF9wcm90bzIuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxhm", + "IAMoCEICEAA6fAoXdW5wYWNrZWRfZW51bV9leHRlbnNpb24SMC5wcm90b2J1", + "Zl91bml0dGVzdF9wcm90bzIuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxhnIAMo", + "DjIlLnByb3RvYnVmX3VuaXR0ZXN0X3Byb3RvMi5Gb3JlaWduRW51bUICEAA6", + "cgoOdGVzdF9hbGxfdHlwZXMSLi5wcm90b2J1Zl91bml0dGVzdF9wcm90bzIu", + "VGVzdEh1Z2VGaWVsZE51bWJlcnMY4Kr//wEgASgLMiYucHJvdG9idWZfdW5p", + "dHRlc3RfcHJvdG8yLlRlc3RBbGxUeXBlczphCiV0ZXN0X2V4dGVuc2lvbl9p", + "bnNpZGVfdGFibGVfZXh0ZW5zaW9uEjIucHJvdG9idWZfdW5pdHRlc3RfcHJv", + "dG8yLlRlc3RFeHRlbnNpb25JbnNpZGVUYWJsZRgFIAEoBUIySAGAAQGIAQGQ", + "AQH4AQGqAiFHb29nbGUuUHJvdG9idWYuVGVzdFByb3Rvcy5Qcm90bzI=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.Proto2.UnittestImportReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.Proto2.ForeignEnum), typeof(global::Google.Protobuf.TestProtos.Proto2.TestEnumWithDupValue), typeof(global::Google.Protobuf.TestProtos.Proto2.TestSparseEnum), typeof(global::Google.Protobuf.TestProtos.Proto2.VeryLargeEnum), }, new pb::Extension[] { UnittestExtensions.OptionalInt32Extension, UnittestExtensions.OptionalInt64Extension, UnittestExtensions.OptionalUint32Extension, UnittestExtensions.OptionalUint64Extension, UnittestExtensions.OptionalSint32Extension, UnittestExtensions.OptionalSint64Extension, UnittestExtensions.OptionalFixed32Extension, UnittestExtensions.OptionalFixed64Extension, UnittestExtensions.OptionalSfixed32Extension, UnittestExtensions.OptionalSfixed64Extension, UnittestExtensions.OptionalFloatExtension, UnittestExtensions.OptionalDoubleExtension, UnittestExtensions.OptionalBoolExtension, UnittestExtensions.OptionalStringExtension, UnittestExtensions.OptionalBytesExtension, UnittestExtensions.OptionalGroupExtension, UnittestExtensions.OptionalNestedMessageExtension, UnittestExtensions.OptionalForeignMessageExtension, UnittestExtensions.OptionalImportMessageExtension, UnittestExtensions.OptionalNestedEnumExtension, UnittestExtensions.OptionalForeignEnumExtension, UnittestExtensions.OptionalImportEnumExtension, UnittestExtensions.OptionalStringPieceExtension, UnittestExtensions.OptionalCordExtension, UnittestExtensions.OptionalPublicImportMessageExtension, UnittestExtensions.OptionalLazyMessageExtension, UnittestExtensions.RepeatedInt32Extension, UnittestExtensions.RepeatedInt64Extension, UnittestExtensions.RepeatedUint32Extension, UnittestExtensions.RepeatedUint64Extension, UnittestExtensions.RepeatedSint32Extension, UnittestExtensions.RepeatedSint64Extension, UnittestExtensions.RepeatedFixed32Extension, UnittestExtensions.RepeatedFixed64Extension, UnittestExtensions.RepeatedSfixed32Extension, UnittestExtensions.RepeatedSfixed64Extension, UnittestExtensions.RepeatedFloatExtension, UnittestExtensions.RepeatedDoubleExtension, UnittestExtensions.RepeatedBoolExtension, UnittestExtensions.RepeatedStringExtension, UnittestExtensions.RepeatedBytesExtension, UnittestExtensions.RepeatedGroupExtension, UnittestExtensions.RepeatedNestedMessageExtension, UnittestExtensions.RepeatedForeignMessageExtension, UnittestExtensions.RepeatedImportMessageExtension, UnittestExtensions.RepeatedNestedEnumExtension, UnittestExtensions.RepeatedForeignEnumExtension, UnittestExtensions.RepeatedImportEnumExtension, UnittestExtensions.RepeatedStringPieceExtension, UnittestExtensions.RepeatedCordExtension, UnittestExtensions.RepeatedLazyMessageExtension, UnittestExtensions.DefaultInt32Extension, UnittestExtensions.DefaultInt64Extension, UnittestExtensions.DefaultUint32Extension, UnittestExtensions.DefaultUint64Extension, UnittestExtensions.DefaultSint32Extension, UnittestExtensions.DefaultSint64Extension, UnittestExtensions.DefaultFixed32Extension, UnittestExtensions.DefaultFixed64Extension, UnittestExtensions.DefaultSfixed32Extension, UnittestExtensions.DefaultSfixed64Extension, UnittestExtensions.DefaultFloatExtension, UnittestExtensions.DefaultDoubleExtension, UnittestExtensions.DefaultBoolExtension, UnittestExtensions.DefaultStringExtension, UnittestExtensions.DefaultBytesExtension, UnittestExtensions.DefaultNestedEnumExtension, UnittestExtensions.DefaultForeignEnumExtension, UnittestExtensions.DefaultImportEnumExtension, UnittestExtensions.DefaultStringPieceExtension, UnittestExtensions.DefaultCordExtension, UnittestExtensions.OneofUint32Extension, UnittestExtensions.OneofNestedMessageExtension, UnittestExtensions.OneofStringExtension, UnittestExtensions.OneofBytesExtension, UnittestExtensions.MyExtensionString, UnittestExtensions.MyExtensionInt, UnittestExtensions.PackedInt32Extension, UnittestExtensions.PackedInt64Extension, UnittestExtensions.PackedUint32Extension, UnittestExtensions.PackedUint64Extension, UnittestExtensions.PackedSint32Extension, UnittestExtensions.PackedSint64Extension, UnittestExtensions.PackedFixed32Extension, UnittestExtensions.PackedFixed64Extension, UnittestExtensions.PackedSfixed32Extension, UnittestExtensions.PackedSfixed64Extension, UnittestExtensions.PackedFloatExtension, UnittestExtensions.PackedDoubleExtension, UnittestExtensions.PackedBoolExtension, UnittestExtensions.PackedEnumExtension, UnittestExtensions.UnpackedInt32Extension, UnittestExtensions.UnpackedInt64Extension, UnittestExtensions.UnpackedUint32Extension, UnittestExtensions.UnpackedUint64Extension, UnittestExtensions.UnpackedSint32Extension, UnittestExtensions.UnpackedSint64Extension, UnittestExtensions.UnpackedFixed32Extension, UnittestExtensions.UnpackedFixed64Extension, UnittestExtensions.UnpackedSfixed32Extension, UnittestExtensions.UnpackedSfixed64Extension, UnittestExtensions.UnpackedFloatExtension, UnittestExtensions.UnpackedDoubleExtension, UnittestExtensions.UnpackedBoolExtension, UnittestExtensions.UnpackedEnumExtension, UnittestExtensions.TestAllTypes, UnittestExtensions.TestExtensionInsideTableExtension }, new pbr::GeneratedClrTypeInfo[] { @@ -749,7 +748,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endregion } - /// Holder for extension identifiers generated from the top level of csharp/protos/unittest.proto + /// Holder for extension identifiers generated from the top level of unittest.proto public static partial class UnittestExtensions { /// /// Singular @@ -1121,7 +1120,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// This proto includes every type of field in both singular and repeated /// forms. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestAllTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1132,23 +1130,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int _hasBits0; private int _hasBits1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes() { OnConstruction(); } @@ -1156,7 +1150,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes(TestAllTypes other) : this() { _hasBits0 = other._hasBits0; _hasBits1 = other._hasBits1; @@ -1250,7 +1243,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes Clone() { return new TestAllTypes(this); } @@ -1264,7 +1256,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -1274,13 +1265,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -1291,7 +1280,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long optionalInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalInt64 { get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return OptionalInt64DefaultValue; } } set { @@ -1301,13 +1289,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt64 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "optional_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt64() { _hasBits0 &= ~2; } @@ -1318,7 +1304,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint optionalUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalUint32 { get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return OptionalUint32DefaultValue; } } set { @@ -1328,13 +1313,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint32 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "optional_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint32() { _hasBits0 &= ~4; } @@ -1345,7 +1328,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong optionalUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalUint64 { get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return OptionalUint64DefaultValue; } } set { @@ -1355,13 +1337,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint64 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "optional_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint64() { _hasBits0 &= ~8; } @@ -1372,7 +1352,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSint32 { get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return OptionalSint32DefaultValue; } } set { @@ -1382,13 +1361,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint32 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "optional_sint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint32() { _hasBits0 &= ~16; } @@ -1399,7 +1376,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long optionalSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSint64 { get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return OptionalSint64DefaultValue; } } set { @@ -1409,13 +1385,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint64 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "optional_sint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint64() { _hasBits0 &= ~32; } @@ -1426,7 +1400,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint optionalFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalFixed32 { get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return OptionalFixed32DefaultValue; } } set { @@ -1436,13 +1409,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_fixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed32 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "optional_fixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed32() { _hasBits0 &= ~64; } @@ -1453,7 +1424,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong optionalFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalFixed64 { get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return OptionalFixed64DefaultValue; } } set { @@ -1463,13 +1433,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_fixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed64 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "optional_fixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed64() { _hasBits0 &= ~128; } @@ -1480,7 +1448,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSfixed32 { get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return OptionalSfixed32DefaultValue; } } set { @@ -1490,13 +1457,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sfixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed32 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "optional_sfixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed32() { _hasBits0 &= ~256; } @@ -1507,7 +1472,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long optionalSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSfixed64 { get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return OptionalSfixed64DefaultValue; } } set { @@ -1517,13 +1481,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sfixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed64 { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "optional_sfixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed64() { _hasBits0 &= ~512; } @@ -1534,7 +1496,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float optionalFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OptionalFloat { get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return OptionalFloatDefaultValue; } } set { @@ -1544,13 +1505,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFloat { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "optional_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFloat() { _hasBits0 &= ~1024; } @@ -1561,7 +1520,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double optionalDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OptionalDouble { get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return OptionalDoubleDefaultValue; } } set { @@ -1571,13 +1529,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalDouble { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "optional_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalDouble() { _hasBits0 &= ~2048; } @@ -1588,7 +1544,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } } set { @@ -1598,13 +1553,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBool { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "optional_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBool() { _hasBits0 &= ~4096; } @@ -1615,7 +1568,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -1624,13 +1576,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -1641,7 +1591,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString optionalBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_ ?? OptionalBytesDefaultValue; } set { @@ -1650,13 +1599,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBytes { get { return optionalBytes_ != null; } } /// Clears the value of the "optional_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBytes() { optionalBytes_ = null; } @@ -1665,7 +1612,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupFieldNumber = 16; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -1674,13 +1620,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -1689,7 +1633,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -1701,7 +1644,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage optionalForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage OptionalForeignMessage { get { return optionalForeignMessage_; } set { @@ -1713,7 +1655,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.Proto2.ImportMessage optionalImportMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ImportMessage OptionalImportMessage { get { return optionalImportMessage_; } set { @@ -1727,7 +1668,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum optionalNestedEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum OptionalNestedEnum { get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return OptionalNestedEnumDefaultValue; } } set { @@ -1737,13 +1677,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_nested_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalNestedEnum { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "optional_nested_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalNestedEnum() { _hasBits0 &= ~8192; } @@ -1754,7 +1692,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum optionalForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum OptionalForeignEnum { get { if ((_hasBits0 & 16384) != 0) { return optionalForeignEnum_; } else { return OptionalForeignEnumDefaultValue; } } set { @@ -1764,13 +1701,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalForeignEnum { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "optional_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalForeignEnum() { _hasBits0 &= ~16384; } @@ -1781,7 +1716,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ImportEnum optionalImportEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ImportEnum OptionalImportEnum { get { if ((_hasBits0 & 32768) != 0) { return optionalImportEnum_; } else { return OptionalImportEnumDefaultValue; } } set { @@ -1791,13 +1725,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_import_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalImportEnum { get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "optional_import_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalImportEnum() { _hasBits0 &= ~32768; } @@ -1808,7 +1740,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalStringPiece_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringPiece { get { return optionalStringPiece_ ?? OptionalStringPieceDefaultValue; } set { @@ -1817,13 +1748,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalStringPiece { get { return optionalStringPiece_ != null; } } /// Clears the value of the "optional_string_piece" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalStringPiece() { optionalStringPiece_ = null; } @@ -1834,7 +1763,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalCord_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalCord { get { return optionalCord_ ?? OptionalCordDefaultValue; } set { @@ -1843,13 +1771,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalCord { get { return optionalCord_ != null; } } /// Clears the value of the "optional_cord" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalCord() { optionalCord_ = null; } @@ -1861,7 +1787,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Defined in unittest_import_public.proto /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.PublicImportMessage OptionalPublicImportMessage { get { return optionalPublicImportMessage_; } set { @@ -1873,7 +1798,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalLazyMessageFieldNumber = 27; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage optionalLazyMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage OptionalLazyMessage { get { return optionalLazyMessage_; } set { @@ -1890,7 +1814,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -1901,7 +1824,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(256); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -1912,7 +1834,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt32(264); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -1923,7 +1844,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(272); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -1934,7 +1854,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(280); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -1945,7 +1864,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt64(288); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -1956,7 +1874,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed32(301); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -1967,7 +1884,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed64(305); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -1978,7 +1894,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed32(317); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -1989,7 +1904,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed64(321); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -2000,7 +1914,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFloat(333); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -2011,7 +1924,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForDouble(337); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -2022,7 +1934,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBool(344); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -2033,7 +1944,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -2044,7 +1954,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -2055,7 +1964,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(371, 372, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.RepeatedGroup.Parser); private readonly pbc::RepeatedField repeatedGroup_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedGroup { get { return repeatedGroup_; } } @@ -2066,7 +1974,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -2077,7 +1984,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.Proto2.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -2088,7 +1994,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.Proto2.ImportMessage.Parser); private readonly pbc::RepeatedField repeatedImportMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportMessage { get { return repeatedImportMessage_; } } @@ -2099,7 +2004,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(408, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -2110,7 +2014,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(416, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -2121,7 +2024,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(424, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ImportEnum) x); private readonly pbc::RepeatedField repeatedImportEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportEnum { get { return repeatedImportEnum_; } } @@ -2132,7 +2034,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(434); private readonly pbc::RepeatedField repeatedStringPiece_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPiece { get { return repeatedStringPiece_; } } @@ -2143,7 +2044,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(442); private readonly pbc::RepeatedField repeatedCord_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCord { get { return repeatedCord_; } } @@ -2154,7 +2054,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(458, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedLazyMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedLazyMessage { get { return repeatedLazyMessage_; } } @@ -2168,7 +2067,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Singular with defaults /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DefaultInt32 { get { if ((_hasBits0 & 65536) != 0) { return defaultInt32_; } else { return DefaultInt32DefaultValue; } } set { @@ -2178,13 +2076,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultInt32 { get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "default_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultInt32() { _hasBits0 &= ~65536; } @@ -2195,7 +2091,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long defaultInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DefaultInt64 { get { if ((_hasBits0 & 131072) != 0) { return defaultInt64_; } else { return DefaultInt64DefaultValue; } } set { @@ -2205,13 +2100,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultInt64 { get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "default_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultInt64() { _hasBits0 &= ~131072; } @@ -2222,7 +2115,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint defaultUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint DefaultUint32 { get { if ((_hasBits0 & 262144) != 0) { return defaultUint32_; } else { return DefaultUint32DefaultValue; } } set { @@ -2232,13 +2124,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultUint32 { get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "default_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultUint32() { _hasBits0 &= ~262144; } @@ -2249,7 +2139,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong defaultUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong DefaultUint64 { get { if ((_hasBits0 & 524288) != 0) { return defaultUint64_; } else { return DefaultUint64DefaultValue; } } set { @@ -2259,13 +2148,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultUint64 { get { return (_hasBits0 & 524288) != 0; } } /// Clears the value of the "default_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultUint64() { _hasBits0 &= ~524288; } @@ -2276,7 +2163,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int defaultSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DefaultSint32 { get { if ((_hasBits0 & 1048576) != 0) { return defaultSint32_; } else { return DefaultSint32DefaultValue; } } set { @@ -2286,13 +2172,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSint32 { get { return (_hasBits0 & 1048576) != 0; } } /// Clears the value of the "default_sint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSint32() { _hasBits0 &= ~1048576; } @@ -2303,7 +2187,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long defaultSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DefaultSint64 { get { if ((_hasBits0 & 2097152) != 0) { return defaultSint64_; } else { return DefaultSint64DefaultValue; } } set { @@ -2313,13 +2196,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSint64 { get { return (_hasBits0 & 2097152) != 0; } } /// Clears the value of the "default_sint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSint64() { _hasBits0 &= ~2097152; } @@ -2330,7 +2211,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint defaultFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint DefaultFixed32 { get { if ((_hasBits0 & 4194304) != 0) { return defaultFixed32_; } else { return DefaultFixed32DefaultValue; } } set { @@ -2340,13 +2220,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_fixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultFixed32 { get { return (_hasBits0 & 4194304) != 0; } } /// Clears the value of the "default_fixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultFixed32() { _hasBits0 &= ~4194304; } @@ -2357,7 +2235,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong defaultFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong DefaultFixed64 { get { if ((_hasBits0 & 8388608) != 0) { return defaultFixed64_; } else { return DefaultFixed64DefaultValue; } } set { @@ -2367,13 +2244,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_fixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultFixed64 { get { return (_hasBits0 & 8388608) != 0; } } /// Clears the value of the "default_fixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultFixed64() { _hasBits0 &= ~8388608; } @@ -2384,7 +2259,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int defaultSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DefaultSfixed32 { get { if ((_hasBits0 & 16777216) != 0) { return defaultSfixed32_; } else { return DefaultSfixed32DefaultValue; } } set { @@ -2394,13 +2268,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sfixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSfixed32 { get { return (_hasBits0 & 16777216) != 0; } } /// Clears the value of the "default_sfixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSfixed32() { _hasBits0 &= ~16777216; } @@ -2411,7 +2283,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long defaultSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DefaultSfixed64 { get { if ((_hasBits0 & 33554432) != 0) { return defaultSfixed64_; } else { return DefaultSfixed64DefaultValue; } } set { @@ -2421,13 +2292,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sfixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSfixed64 { get { return (_hasBits0 & 33554432) != 0; } } /// Clears the value of the "default_sfixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSfixed64() { _hasBits0 &= ~33554432; } @@ -2438,7 +2307,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float defaultFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float DefaultFloat { get { if ((_hasBits0 & 67108864) != 0) { return defaultFloat_; } else { return DefaultFloatDefaultValue; } } set { @@ -2448,13 +2316,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultFloat { get { return (_hasBits0 & 67108864) != 0; } } /// Clears the value of the "default_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultFloat() { _hasBits0 &= ~67108864; } @@ -2465,7 +2331,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double defaultDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double DefaultDouble { get { if ((_hasBits0 & 134217728) != 0) { return defaultDouble_; } else { return DefaultDoubleDefaultValue; } } set { @@ -2475,13 +2340,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultDouble { get { return (_hasBits0 & 134217728) != 0; } } /// Clears the value of the "default_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultDouble() { _hasBits0 &= ~134217728; } @@ -2492,7 +2355,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private bool defaultBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool DefaultBool { get { if ((_hasBits0 & 268435456) != 0) { return defaultBool_; } else { return DefaultBoolDefaultValue; } } set { @@ -2502,13 +2364,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultBool { get { return (_hasBits0 & 268435456) != 0; } } /// Clears the value of the "default_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultBool() { _hasBits0 &= ~268435456; } @@ -2519,7 +2379,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string defaultString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultString { get { return defaultString_ ?? DefaultStringDefaultValue; } set { @@ -2528,13 +2387,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultString { get { return defaultString_ != null; } } /// Clears the value of the "default_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultString() { defaultString_ = null; } @@ -2545,7 +2402,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString defaultBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString DefaultBytes { get { return defaultBytes_ ?? DefaultBytesDefaultValue; } set { @@ -2554,13 +2410,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultBytes { get { return defaultBytes_ != null; } } /// Clears the value of the "default_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultBytes() { defaultBytes_ = null; } @@ -2571,7 +2425,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum defaultNestedEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum DefaultNestedEnum { get { if ((_hasBits0 & 536870912) != 0) { return defaultNestedEnum_; } else { return DefaultNestedEnumDefaultValue; } } set { @@ -2581,13 +2434,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_nested_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultNestedEnum { get { return (_hasBits0 & 536870912) != 0; } } /// Clears the value of the "default_nested_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultNestedEnum() { _hasBits0 &= ~536870912; } @@ -2598,7 +2449,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum defaultForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum DefaultForeignEnum { get { if ((_hasBits0 & 1073741824) != 0) { return defaultForeignEnum_; } else { return DefaultForeignEnumDefaultValue; } } set { @@ -2608,13 +2458,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultForeignEnum { get { return (_hasBits0 & 1073741824) != 0; } } /// Clears the value of the "default_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultForeignEnum() { _hasBits0 &= ~1073741824; } @@ -2625,7 +2473,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ImportEnum defaultImportEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ImportEnum DefaultImportEnum { get { if ((_hasBits0 & -2147483648) != 0) { return defaultImportEnum_; } else { return DefaultImportEnumDefaultValue; } } set { @@ -2635,13 +2482,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_import_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultImportEnum { get { return (_hasBits0 & -2147483648) != 0; } } /// Clears the value of the "default_import_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultImportEnum() { _hasBits0 &= ~-2147483648; } @@ -2652,7 +2497,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string defaultStringPiece_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultStringPiece { get { return defaultStringPiece_ ?? DefaultStringPieceDefaultValue; } set { @@ -2661,13 +2505,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultStringPiece { get { return defaultStringPiece_ != null; } } /// Clears the value of the "default_string_piece" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultStringPiece() { defaultStringPiece_ = null; } @@ -2678,7 +2520,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string defaultCord_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultCord { get { return defaultCord_ ?? DefaultCordDefaultValue; } set { @@ -2687,13 +2528,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultCord { get { return defaultCord_ != null; } } /// Clears the value of the "default_cord" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultCord() { defaultCord_ = null; } @@ -2701,7 +2540,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return HasOneofUint32 ? (uint) oneofField_ : 0; } set { @@ -2711,13 +2549,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } } /// Clears the value of the oneof if it's currently set to "oneof_uint32" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint32() { if (HasOneofUint32) { ClearOneofField(); @@ -2727,7 +2563,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage) oneofField_ : null; } set { @@ -2739,7 +2574,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return HasOneofString ? (string) oneofField_ : ""; } set { @@ -2749,13 +2583,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } } /// Clears the value of the oneof if it's currently set to "oneof_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofString() { if (HasOneofString) { ClearOneofField(); @@ -2765,7 +2597,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -2775,13 +2606,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } } /// Clears the value of the oneof if it's currently set to "oneof_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBytes() { if (HasOneofBytes) { ClearOneofField(); @@ -2799,26 +2628,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -2906,7 +2731,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -2992,13 +2816,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3237,7 +3059,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasOptionalInt32) { output.WriteRawTag(8); @@ -3472,7 +3293,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -3657,7 +3477,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllTypes other) { if (other == null) { return; @@ -3865,7 +3684,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4222,7 +4040,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4577,7 +4394,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestAllTypes message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("FOO")] Foo = 1, @@ -4589,7 +4405,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("NEG")] Neg = -1, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -4599,23 +4414,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -4623,7 +4434,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; bb_ = other.bb_; @@ -4631,7 +4441,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -4647,7 +4456,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return BbDefaultValue; } } set { @@ -4657,25 +4465,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bb" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBb { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "bb" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBb() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -4688,7 +4492,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasBb) hash ^= Bb.GetHashCode(); @@ -4699,13 +4502,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4722,7 +4523,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasBb) { output.WriteRawTag(8); @@ -4735,7 +4535,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasBb) { @@ -4748,7 +4547,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -4760,7 +4558,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4782,7 +4579,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4801,7 +4597,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OptionalGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -4811,23 +4606,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -4835,7 +4626,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -4843,7 +4633,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -4854,7 +4643,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -4864,25 +4652,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -4895,7 +4679,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -4906,13 +4689,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4929,7 +4710,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(136, 1); @@ -4942,7 +4722,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -4955,7 +4734,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -4967,7 +4745,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4991,7 +4768,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5012,7 +4788,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class RepeatedGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5022,23 +4797,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Descriptor.NestedTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup() { OnConstruction(); } @@ -5046,7 +4817,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup(RepeatedGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -5054,7 +4824,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup Clone() { return new RepeatedGroup(this); } @@ -5065,7 +4834,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -5075,25 +4843,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -5106,7 +4870,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -5117,13 +4880,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5140,7 +4901,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(248, 2); @@ -5153,7 +4913,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -5166,7 +4925,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedGroup other) { if (other == null) { return; @@ -5178,7 +4936,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5202,7 +4959,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5231,7 +4987,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// This proto includes a recursively nested message. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedTestAllTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5240,23 +4995,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes() { OnConstruction(); } @@ -5264,7 +5015,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes(NestedTestAllTypes other) : this() { child_ = other.child_ != null ? other.child_.Clone() : null; payload_ = other.payload_ != null ? other.payload_.Clone() : null; @@ -5273,7 +5023,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes Clone() { return new NestedTestAllTypes(this); } @@ -5282,7 +5031,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes child_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes Child { get { return child_; } set { @@ -5294,7 +5042,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes payload_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes Payload { get { return payload_; } set { @@ -5308,19 +5055,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes.Parser); private readonly pbc::RepeatedField repeatedChild_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedChild { get { return repeatedChild_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedTestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedTestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -5335,7 +5079,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (child_ != null) hash ^= Child.GetHashCode(); @@ -5348,13 +5091,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5376,7 +5117,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (child_ != null) { output.WriteRawTag(10); @@ -5394,7 +5134,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (child_ != null) { @@ -5411,7 +5150,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedTestAllTypes other) { if (other == null) { return; @@ -5433,7 +5171,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5469,7 +5206,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5502,7 +5238,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestDeprecatedFields : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5512,23 +5247,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields() { OnConstruction(); } @@ -5536,7 +5267,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields(TestDeprecatedFields other) : this() { _hasBits0 = other._hasBits0; deprecatedInt32_ = other.deprecatedInt32_; @@ -5550,7 +5280,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields Clone() { return new TestDeprecatedFields(this); } @@ -5562,7 +5291,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int deprecatedInt32_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DeprecatedInt32 { get { if ((_hasBits0 & 1) != 0) { return deprecatedInt32_; } else { return DeprecatedInt32DefaultValue; } } set { @@ -5573,14 +5301,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Gets whether the "deprecated_int32" field is set [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecatedInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "deprecated_int32" field [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecatedInt32() { _hasBits0 &= ~1; } @@ -5589,7 +5315,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int DeprecatedInt32InOneofFieldNumber = 2; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DeprecatedInt32InOneof { get { return HasDeprecatedInt32InOneof ? (int) oneofFields_ : 0; } set { @@ -5600,14 +5325,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Gets whether the "deprecated_int32_in_oneof" field is set [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecatedInt32InOneof { get { return oneofFieldsCase_ == OneofFieldsOneofCase.DeprecatedInt32InOneof; } } /// Clears the value of the oneof if it's currently set to "deprecated_int32_in_oneof" [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecatedInt32InOneof() { if (HasDeprecatedInt32InOneof) { ClearOneofFields(); @@ -5622,26 +5345,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private OneofFieldsOneofCase oneofFieldsCase_ = OneofFieldsOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldsOneofCase OneofFieldsCase { get { return oneofFieldsCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofFields() { oneofFieldsCase_ = OneofFieldsOneofCase.None; oneofFields_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDeprecatedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDeprecatedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -5656,7 +5375,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasDeprecatedInt32) hash ^= DeprecatedInt32.GetHashCode(); @@ -5669,13 +5387,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5696,7 +5412,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasDeprecatedInt32) { output.WriteRawTag(8); @@ -5713,7 +5428,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasDeprecatedInt32) { @@ -5729,7 +5443,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDeprecatedFields other) { if (other == null) { return; @@ -5747,7 +5460,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5773,7 +5485,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5797,7 +5508,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestDeprecatedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5806,23 +5516,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedMessage() { OnConstruction(); } @@ -5830,25 +5536,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedMessage(TestDeprecatedMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedMessage Clone() { return new TestDeprecatedMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDeprecatedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDeprecatedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -5860,7 +5562,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -5870,13 +5571,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5889,7 +5588,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -5898,7 +5596,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -5908,7 +5605,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDeprecatedMessage other) { if (other == null) { return; @@ -5917,7 +5613,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5935,7 +5630,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5954,7 +5648,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Define these after TestAllTypes to make sure the compiler can handle /// that. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ForeignMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5964,23 +5657,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage() { OnConstruction(); } @@ -5988,7 +5677,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage(ForeignMessage other) : this() { _hasBits0 = other._hasBits0; c_ = other.c_; @@ -5997,7 +5685,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage Clone() { return new ForeignMessage(this); } @@ -6008,7 +5695,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { if ((_hasBits0 & 1) != 0) { return c_; } else { return CDefaultValue; } } set { @@ -6018,13 +5704,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "c" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasC { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "c" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearC() { _hasBits0 &= ~1; } @@ -6035,7 +5719,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int d_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int D { get { if ((_hasBits0 & 2) != 0) { return d_; } else { return DDefaultValue; } } set { @@ -6045,25 +5728,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "d" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasD { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "d" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearD() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -6077,7 +5756,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasC) hash ^= C.GetHashCode(); @@ -6089,13 +5767,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6116,7 +5792,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasC) { output.WriteRawTag(8); @@ -6133,7 +5808,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasC) { @@ -6149,7 +5823,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessage other) { if (other == null) { return; @@ -6164,7 +5837,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6190,7 +5862,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6213,7 +5884,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestReservedFields : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6222,23 +5892,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields() { OnConstruction(); } @@ -6246,25 +5912,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields(TestReservedFields other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields Clone() { return new TestReservedFields(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReservedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReservedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -6276,7 +5938,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -6286,13 +5947,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6305,7 +5964,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -6314,7 +5972,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -6324,7 +5981,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReservedFields other) { if (other == null) { return; @@ -6333,7 +5989,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6351,7 +6006,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6366,7 +6020,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestAllExtensions : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6377,23 +6030,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllExtensions() { OnConstruction(); } @@ -6401,26 +6050,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllExtensions(TestAllExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllExtensions Clone() { return new TestAllExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -6435,7 +6080,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -6448,13 +6092,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6470,7 +6112,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_extensions != null) { _extensions.WriteTo(ref output); @@ -6482,7 +6123,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -6495,7 +6135,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllExtensions other) { if (other == null) { return; @@ -6505,7 +6144,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6525,7 +6163,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6564,7 +6201,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OptionalGroup_extension : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6574,23 +6210,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension() { OnConstruction(); } @@ -6598,7 +6230,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension(OptionalGroup_extension other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -6606,7 +6237,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension Clone() { return new OptionalGroup_extension(this); } @@ -6617,7 +6247,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -6627,25 +6256,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup_extension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup_extension other) { if (ReferenceEquals(other, null)) { return false; @@ -6658,7 +6283,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -6669,13 +6293,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6692,7 +6314,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(136, 1); @@ -6705,7 +6326,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -6718,7 +6338,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup_extension other) { if (other == null) { return; @@ -6730,7 +6349,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6754,7 +6372,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6775,7 +6392,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class RepeatedGroup_extension : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6785,23 +6401,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup_extension() { OnConstruction(); } @@ -6809,7 +6421,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup_extension(RepeatedGroup_extension other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -6817,7 +6428,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup_extension Clone() { return new RepeatedGroup_extension(this); } @@ -6828,7 +6438,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -6838,25 +6447,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedGroup_extension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedGroup_extension other) { if (ReferenceEquals(other, null)) { return false; @@ -6869,7 +6474,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -6880,13 +6484,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6903,7 +6505,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(248, 2); @@ -6916,7 +6517,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -6929,7 +6529,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedGroup_extension other) { if (other == null) { return; @@ -6941,7 +6540,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6965,7 +6563,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6986,7 +6583,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6996,23 +6592,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroup() { OnConstruction(); } @@ -7020,7 +6612,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroup(TestGroup other) : this() { _hasBits0 = other._hasBits0; optionalGroup_ = other.HasOptionalGroup ? other.optionalGroup_.Clone() : null; @@ -7029,7 +6620,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroup Clone() { return new TestGroup(this); } @@ -7038,7 +6628,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupFieldNumber = 16; private global::Google.Protobuf.TestProtos.Proto2.TestGroup.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestGroup.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -7047,13 +6636,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -7064,7 +6651,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum optionalForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum OptionalForeignEnum { get { if ((_hasBits0 & 1) != 0) { return optionalForeignEnum_; } else { return OptionalForeignEnumDefaultValue; } } set { @@ -7074,25 +6660,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalForeignEnum { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalForeignEnum() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -7106,7 +6688,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalGroup) hash ^= OptionalGroup.GetHashCode(); @@ -7118,13 +6699,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7146,7 +6725,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasOptionalGroup) { output.WriteRawTag(131, 1); @@ -7164,7 +6742,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalGroup) { @@ -7180,7 +6757,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestGroup other) { if (other == null) { return; @@ -7198,7 +6774,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7227,7 +6802,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7254,9 +6828,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestGroup message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OptionalGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7266,23 +6838,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestGroup.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -7290,7 +6858,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -7298,7 +6865,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -7309,7 +6875,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -7319,25 +6884,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -7350,7 +6911,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -7361,13 +6921,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7384,7 +6942,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(136, 1); @@ -7397,7 +6954,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -7410,7 +6966,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -7422,7 +6977,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7446,7 +7000,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7472,7 +7025,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestGroupExtension : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7483,23 +7035,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroupExtension() { OnConstruction(); } @@ -7507,26 +7055,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroupExtension(TestGroupExtension other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroupExtension Clone() { return new TestGroupExtension(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestGroupExtension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestGroupExtension other) { if (ReferenceEquals(other, null)) { return false; @@ -7541,7 +7085,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -7554,13 +7097,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7576,7 +7117,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_extensions != null) { _extensions.WriteTo(ref output); @@ -7588,7 +7128,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -7601,7 +7140,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestGroupExtension other) { if (other == null) { return; @@ -7611,7 +7149,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7631,7 +7168,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7670,7 +7206,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestNestedExtension : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7679,23 +7214,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestNestedExtension()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedExtension() { OnConstruction(); } @@ -7703,25 +7234,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedExtension(TestNestedExtension other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedExtension Clone() { return new TestNestedExtension(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestNestedExtension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestNestedExtension other) { if (ReferenceEquals(other, null)) { return false; @@ -7733,7 +7260,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -7743,13 +7269,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7762,7 +7286,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -7771,7 +7294,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -7781,7 +7303,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestNestedExtension other) { if (other == null) { return; @@ -7790,7 +7311,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7808,7 +7328,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7824,9 +7343,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestNestedExtension message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OptionalGroup_extension : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7836,23 +7353,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestNestedExtension.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension() { OnConstruction(); } @@ -7860,7 +7373,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension(OptionalGroup_extension other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -7868,7 +7380,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension Clone() { return new OptionalGroup_extension(this); } @@ -7879,7 +7390,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -7889,25 +7399,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup_extension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup_extension other) { if (ReferenceEquals(other, null)) { return false; @@ -7920,7 +7426,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -7931,13 +7436,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7954,7 +7457,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(136, 1); @@ -7967,7 +7469,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -7980,7 +7481,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup_extension other) { if (other == null) { return; @@ -7992,7 +7492,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -8016,7 +7515,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -8043,7 +7541,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestNestedExtension message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { /// /// Check for bug where string extensions declared in tested scope did not @@ -8073,7 +7570,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// required filed because the code output is basically identical to /// optional fields for all types. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRequired : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -8084,23 +7580,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int _hasBits0; private int _hasBits1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequired() { OnConstruction(); } @@ -8108,7 +7600,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequired(TestRequired other) : this() { _hasBits0 = other._hasBits0; _hasBits1 = other._hasBits1; @@ -8149,7 +7640,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequired Clone() { return new TestRequired(this); } @@ -8160,7 +7650,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -8170,13 +7659,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -8187,7 +7674,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy2 { get { if ((_hasBits0 & 2) != 0) { return dummy2_; } else { return Dummy2DefaultValue; } } set { @@ -8197,13 +7683,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy2 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "dummy2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy2() { _hasBits0 &= ~2; } @@ -8214,7 +7698,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int B { get { if ((_hasBits0 & 4) != 0) { return b_; } else { return BDefaultValue; } } set { @@ -8224,13 +7707,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { _hasBits0 &= ~4; } @@ -8245,7 +7726,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// properly checks multiple elements of has_bits_. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy4 { get { if ((_hasBits0 & 8) != 0) { return dummy4_; } else { return Dummy4DefaultValue; } } set { @@ -8255,13 +7735,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy4" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy4 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "dummy4" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy4() { _hasBits0 &= ~8; } @@ -8272,7 +7750,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy5 { get { if ((_hasBits0 & 16) != 0) { return dummy5_; } else { return Dummy5DefaultValue; } } set { @@ -8282,13 +7759,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy5" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy5 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "dummy5" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy5() { _hasBits0 &= ~16; } @@ -8299,7 +7774,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy6 { get { if ((_hasBits0 & 32) != 0) { return dummy6_; } else { return Dummy6DefaultValue; } } set { @@ -8309,13 +7783,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy6 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "dummy6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy6() { _hasBits0 &= ~32; } @@ -8326,7 +7798,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy7 { get { if ((_hasBits0 & 64) != 0) { return dummy7_; } else { return Dummy7DefaultValue; } } set { @@ -8336,13 +7807,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy7" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy7 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "dummy7" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy7() { _hasBits0 &= ~64; } @@ -8353,7 +7822,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy8 { get { if ((_hasBits0 & 128) != 0) { return dummy8_; } else { return Dummy8DefaultValue; } } set { @@ -8363,13 +7831,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy8" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy8 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "dummy8" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy8() { _hasBits0 &= ~128; } @@ -8380,7 +7846,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy9 { get { if ((_hasBits0 & 256) != 0) { return dummy9_; } else { return Dummy9DefaultValue; } } set { @@ -8390,13 +7855,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy9" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy9 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "dummy9" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy9() { _hasBits0 &= ~256; } @@ -8407,7 +7870,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy10 { get { if ((_hasBits0 & 512) != 0) { return dummy10_; } else { return Dummy10DefaultValue; } } set { @@ -8417,13 +7879,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy10" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy10 { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "dummy10" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy10() { _hasBits0 &= ~512; } @@ -8434,7 +7894,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy11_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy11 { get { if ((_hasBits0 & 1024) != 0) { return dummy11_; } else { return Dummy11DefaultValue; } } set { @@ -8444,13 +7903,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy11" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy11 { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "dummy11" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy11() { _hasBits0 &= ~1024; } @@ -8461,7 +7918,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy12 { get { if ((_hasBits0 & 2048) != 0) { return dummy12_; } else { return Dummy12DefaultValue; } } set { @@ -8471,13 +7927,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy12" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy12 { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "dummy12" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy12() { _hasBits0 &= ~2048; } @@ -8488,7 +7942,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy13 { get { if ((_hasBits0 & 4096) != 0) { return dummy13_; } else { return Dummy13DefaultValue; } } set { @@ -8498,13 +7951,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy13" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy13 { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "dummy13" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy13() { _hasBits0 &= ~4096; } @@ -8515,7 +7966,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy14 { get { if ((_hasBits0 & 8192) != 0) { return dummy14_; } else { return Dummy14DefaultValue; } } set { @@ -8525,13 +7975,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy14" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy14 { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "dummy14" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy14() { _hasBits0 &= ~8192; } @@ -8542,7 +7990,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy15 { get { if ((_hasBits0 & 16384) != 0) { return dummy15_; } else { return Dummy15DefaultValue; } } set { @@ -8552,13 +7999,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy15" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy15 { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "dummy15" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy15() { _hasBits0 &= ~16384; } @@ -8569,7 +8014,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy16 { get { if ((_hasBits0 & 32768) != 0) { return dummy16_; } else { return Dummy16DefaultValue; } } set { @@ -8579,13 +8023,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy16" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy16 { get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "dummy16" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy16() { _hasBits0 &= ~32768; } @@ -8596,7 +8038,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy17_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy17 { get { if ((_hasBits0 & 65536) != 0) { return dummy17_; } else { return Dummy17DefaultValue; } } set { @@ -8606,13 +8047,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy17" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy17 { get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "dummy17" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy17() { _hasBits0 &= ~65536; } @@ -8623,7 +8062,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy18_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy18 { get { if ((_hasBits0 & 131072) != 0) { return dummy18_; } else { return Dummy18DefaultValue; } } set { @@ -8633,13 +8071,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy18" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy18 { get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "dummy18" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy18() { _hasBits0 &= ~131072; } @@ -8650,7 +8086,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy19_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy19 { get { if ((_hasBits0 & 262144) != 0) { return dummy19_; } else { return Dummy19DefaultValue; } } set { @@ -8660,13 +8095,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy19" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy19 { get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "dummy19" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy19() { _hasBits0 &= ~262144; } @@ -8677,7 +8110,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy20_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy20 { get { if ((_hasBits0 & 524288) != 0) { return dummy20_; } else { return Dummy20DefaultValue; } } set { @@ -8687,13 +8119,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy20" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy20 { get { return (_hasBits0 & 524288) != 0; } } /// Clears the value of the "dummy20" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy20() { _hasBits0 &= ~524288; } @@ -8704,7 +8134,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy21_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy21 { get { if ((_hasBits0 & 1048576) != 0) { return dummy21_; } else { return Dummy21DefaultValue; } } set { @@ -8714,13 +8143,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy21" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy21 { get { return (_hasBits0 & 1048576) != 0; } } /// Clears the value of the "dummy21" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy21() { _hasBits0 &= ~1048576; } @@ -8731,7 +8158,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy22_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy22 { get { if ((_hasBits0 & 2097152) != 0) { return dummy22_; } else { return Dummy22DefaultValue; } } set { @@ -8741,13 +8167,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy22" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy22 { get { return (_hasBits0 & 2097152) != 0; } } /// Clears the value of the "dummy22" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy22() { _hasBits0 &= ~2097152; } @@ -8758,7 +8182,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy23_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy23 { get { if ((_hasBits0 & 4194304) != 0) { return dummy23_; } else { return Dummy23DefaultValue; } } set { @@ -8768,13 +8191,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy23" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy23 { get { return (_hasBits0 & 4194304) != 0; } } /// Clears the value of the "dummy23" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy23() { _hasBits0 &= ~4194304; } @@ -8785,7 +8206,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy24_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy24 { get { if ((_hasBits0 & 8388608) != 0) { return dummy24_; } else { return Dummy24DefaultValue; } } set { @@ -8795,13 +8215,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy24" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy24 { get { return (_hasBits0 & 8388608) != 0; } } /// Clears the value of the "dummy24" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy24() { _hasBits0 &= ~8388608; } @@ -8812,7 +8230,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy25_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy25 { get { if ((_hasBits0 & 16777216) != 0) { return dummy25_; } else { return Dummy25DefaultValue; } } set { @@ -8822,13 +8239,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy25" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy25 { get { return (_hasBits0 & 16777216) != 0; } } /// Clears the value of the "dummy25" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy25() { _hasBits0 &= ~16777216; } @@ -8839,7 +8254,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy26_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy26 { get { if ((_hasBits0 & 33554432) != 0) { return dummy26_; } else { return Dummy26DefaultValue; } } set { @@ -8849,13 +8263,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy26" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy26 { get { return (_hasBits0 & 33554432) != 0; } } /// Clears the value of the "dummy26" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy26() { _hasBits0 &= ~33554432; } @@ -8866,7 +8278,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy27_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy27 { get { if ((_hasBits0 & 67108864) != 0) { return dummy27_; } else { return Dummy27DefaultValue; } } set { @@ -8876,13 +8287,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy27" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy27 { get { return (_hasBits0 & 67108864) != 0; } } /// Clears the value of the "dummy27" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy27() { _hasBits0 &= ~67108864; } @@ -8893,7 +8302,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy28_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy28 { get { if ((_hasBits0 & 134217728) != 0) { return dummy28_; } else { return Dummy28DefaultValue; } } set { @@ -8903,13 +8311,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy28" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy28 { get { return (_hasBits0 & 134217728) != 0; } } /// Clears the value of the "dummy28" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy28() { _hasBits0 &= ~134217728; } @@ -8920,7 +8326,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy29_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy29 { get { if ((_hasBits0 & 268435456) != 0) { return dummy29_; } else { return Dummy29DefaultValue; } } set { @@ -8930,13 +8335,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy29" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy29 { get { return (_hasBits0 & 268435456) != 0; } } /// Clears the value of the "dummy29" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy29() { _hasBits0 &= ~268435456; } @@ -8947,7 +8350,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy30_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy30 { get { if ((_hasBits0 & 536870912) != 0) { return dummy30_; } else { return Dummy30DefaultValue; } } set { @@ -8957,13 +8359,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy30" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy30 { get { return (_hasBits0 & 536870912) != 0; } } /// Clears the value of the "dummy30" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy30() { _hasBits0 &= ~536870912; } @@ -8974,7 +8374,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy31_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy31 { get { if ((_hasBits0 & 1073741824) != 0) { return dummy31_; } else { return Dummy31DefaultValue; } } set { @@ -8984,13 +8383,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy31" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy31 { get { return (_hasBits0 & 1073741824) != 0; } } /// Clears the value of the "dummy31" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy31() { _hasBits0 &= ~1073741824; } @@ -9001,7 +8398,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy32 { get { if ((_hasBits0 & -2147483648) != 0) { return dummy32_; } else { return Dummy32DefaultValue; } } set { @@ -9011,13 +8407,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy32 { get { return (_hasBits0 & -2147483648) != 0; } } /// Clears the value of the "dummy32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy32() { _hasBits0 &= ~-2147483648; } @@ -9028,7 +8422,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { if ((_hasBits1 & 1) != 0) { return c_; } else { return CDefaultValue; } } set { @@ -9038,25 +8431,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "c" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasC { get { return (_hasBits1 & 1) != 0; } } /// Clears the value of the "c" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearC() { _hasBits1 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequired); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequired other) { if (ReferenceEquals(other, null)) { return false; @@ -9101,7 +8490,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -9144,13 +8532,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -9295,7 +8681,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(8); @@ -9436,7 +8821,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -9545,7 +8929,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequired other) { if (other == null) { return; @@ -9653,7 +9036,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -9803,7 +9185,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -9951,7 +9332,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestRequired message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension Single = new pb::Extension(1000, pb::FieldCodec.ForMessage(8002, global::Google.Protobuf.TestProtos.Proto2.TestRequired.Parser)); @@ -9962,7 +9342,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRequiredForeign : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -9972,23 +9351,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredForeign() { OnConstruction(); } @@ -9996,7 +9371,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredForeign(TestRequiredForeign other) : this() { _hasBits0 = other._hasBits0; optionalMessage_ = other.optionalMessage_ != null ? other.optionalMessage_.Clone() : null; @@ -10006,7 +9380,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredForeign Clone() { return new TestRequiredForeign(this); } @@ -10015,7 +9388,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestRequired optionalMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequired OptionalMessage { get { return optionalMessage_; } set { @@ -10029,7 +9401,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestRequired.Parser); private readonly pbc::RepeatedField repeatedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessage { get { return repeatedMessage_; } } @@ -10040,7 +9411,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy { get { if ((_hasBits0 & 1) != 0) { return dummy_; } else { return DummyDefaultValue; } } set { @@ -10050,25 +9420,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "dummy" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredForeign); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredForeign other) { if (ReferenceEquals(other, null)) { return false; @@ -10083,7 +9449,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (optionalMessage_ != null) hash ^= OptionalMessage.GetHashCode(); @@ -10096,13 +9461,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10124,7 +9487,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (optionalMessage_ != null) { output.WriteRawTag(10); @@ -10142,7 +9504,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (optionalMessage_ != null) { @@ -10159,7 +9520,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredForeign other) { if (other == null) { return; @@ -10178,7 +9538,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10211,7 +9570,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10241,7 +9599,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRequiredMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10250,23 +9607,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMessage() { OnConstruction(); } @@ -10274,7 +9627,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMessage(TestRequiredMessage other) : this() { optionalMessage_ = other.optionalMessage_ != null ? other.optionalMessage_.Clone() : null; repeatedMessage_ = other.repeatedMessage_.Clone(); @@ -10283,7 +9635,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMessage Clone() { return new TestRequiredMessage(this); } @@ -10292,7 +9643,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestRequired optionalMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequired OptionalMessage { get { return optionalMessage_; } set { @@ -10306,7 +9656,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestRequired.Parser); private readonly pbc::RepeatedField repeatedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessage { get { return repeatedMessage_; } } @@ -10315,7 +9664,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int RequiredMessageFieldNumber = 3; private global::Google.Protobuf.TestProtos.Proto2.TestRequired requiredMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequired RequiredMessage { get { return requiredMessage_; } set { @@ -10324,13 +9672,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -10345,7 +9691,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (optionalMessage_ != null) hash ^= OptionalMessage.GetHashCode(); @@ -10358,13 +9703,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10386,7 +9729,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (optionalMessage_ != null) { output.WriteRawTag(10); @@ -10404,7 +9746,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (optionalMessage_ != null) { @@ -10421,7 +9762,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredMessage other) { if (other == null) { return; @@ -10443,7 +9783,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10479,7 +9818,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10515,7 +9853,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test that we can use NestedMessage from outside TestAllTypes. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestForeignNested : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10524,23 +9861,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested() { OnConstruction(); } @@ -10548,14 +9881,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested(TestForeignNested other) : this() { foreignNested_ = other.foreignNested_ != null ? other.foreignNested_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested Clone() { return new TestForeignNested(this); } @@ -10564,7 +9895,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage foreignNested_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage ForeignNested { get { return foreignNested_; } set { @@ -10573,13 +9903,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestForeignNested); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestForeignNested other) { if (ReferenceEquals(other, null)) { return false; @@ -10592,7 +9920,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (foreignNested_ != null) hash ^= ForeignNested.GetHashCode(); @@ -10603,13 +9930,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10626,7 +9951,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (foreignNested_ != null) { output.WriteRawTag(10); @@ -10639,7 +9963,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (foreignNested_ != null) { @@ -10652,7 +9975,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestForeignNested other) { if (other == null) { return; @@ -10667,7 +9989,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10692,7 +10013,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10717,7 +10037,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// TestEmptyMessage is used to test unknown field support. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestEmptyMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10726,23 +10045,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage() { OnConstruction(); } @@ -10750,25 +10065,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage(TestEmptyMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage Clone() { return new TestEmptyMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEmptyMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEmptyMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -10780,7 +10091,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -10790,13 +10100,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10809,7 +10117,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -10818,7 +10125,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -10828,7 +10134,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEmptyMessage other) { if (other == null) { return; @@ -10837,7 +10142,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10855,7 +10159,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10874,7 +10177,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Like above, but declare all field numbers as potential extensions. No /// actual extensions should ever be defined for this type. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10885,23 +10187,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessageWithExtensions() { OnConstruction(); } @@ -10909,26 +10207,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessageWithExtensions(TestEmptyMessageWithExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessageWithExtensions Clone() { return new TestEmptyMessageWithExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEmptyMessageWithExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEmptyMessageWithExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -10943,7 +10237,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -10956,13 +10249,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10978,7 +10269,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_extensions != null) { _extensions.WriteTo(ref output); @@ -10990,7 +10280,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -11003,7 +10292,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEmptyMessageWithExtensions other) { if (other == null) { return; @@ -11013,7 +10301,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -11033,7 +10320,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -11072,7 +10358,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -11083,23 +10368,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMultipleExtensionRanges() { OnConstruction(); } @@ -11107,26 +10388,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMultipleExtensionRanges(TestMultipleExtensionRanges other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMultipleExtensionRanges Clone() { return new TestMultipleExtensionRanges(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMultipleExtensionRanges); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMultipleExtensionRanges other) { if (ReferenceEquals(other, null)) { return false; @@ -11141,7 +10418,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -11154,13 +10430,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -11176,7 +10450,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_extensions != null) { _extensions.WriteTo(ref output); @@ -11188,7 +10461,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -11201,7 +10473,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMultipleExtensionRanges other) { if (other == null) { return; @@ -11211,7 +10482,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -11231,7 +10501,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -11273,7 +10542,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test that really large tag numbers don't break anything. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestReallyLargeTagNumber : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -11283,23 +10551,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[19]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber() { OnConstruction(); } @@ -11307,7 +10571,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber(TestReallyLargeTagNumber other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -11316,7 +10579,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber Clone() { return new TestReallyLargeTagNumber(this); } @@ -11331,7 +10593,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// three bits to communicate wire type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -11341,13 +10602,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -11358,7 +10617,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { if ((_hasBits0 & 2) != 0) { return bb_; } else { return BbDefaultValue; } } set { @@ -11368,25 +10626,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bb" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBb { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "bb" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBb() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReallyLargeTagNumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReallyLargeTagNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -11400,7 +10654,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -11412,13 +10665,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -11439,7 +10690,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(8); @@ -11456,7 +10706,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -11472,7 +10721,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReallyLargeTagNumber other) { if (other == null) { return; @@ -11487,7 +10735,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -11513,7 +10760,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -11536,7 +10782,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRecursiveMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -11546,23 +10791,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage() { OnConstruction(); } @@ -11570,7 +10811,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage(TestRecursiveMessage other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_ != null ? other.a_.Clone() : null; @@ -11579,7 +10819,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage Clone() { return new TestRecursiveMessage(this); } @@ -11588,7 +10827,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage A { get { return a_; } set { @@ -11602,7 +10840,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { if ((_hasBits0 & 1) != 0) { return i_; } else { return IDefaultValue; } } set { @@ -11612,25 +10849,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "i" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasI { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "i" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearI() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRecursiveMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRecursiveMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -11644,7 +10877,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (a_ != null) hash ^= A.GetHashCode(); @@ -11656,13 +10888,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -11683,7 +10913,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (a_ != null) { output.WriteRawTag(10); @@ -11700,7 +10929,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (a_ != null) { @@ -11716,7 +10944,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRecursiveMessage other) { if (other == null) { return; @@ -11734,7 +10961,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -11763,7 +10989,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -11792,7 +11017,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test that mutual recursion works. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMutualRecursionA : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -11801,23 +11025,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[21]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA() { OnConstruction(); } @@ -11825,7 +11045,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA(TestMutualRecursionA other) : this() { bb_ = other.bb_ != null ? other.bb_.Clone() : null; subGroup_ = other.HasSubGroup ? other.subGroup_.Clone() : null; @@ -11833,7 +11052,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA Clone() { return new TestMutualRecursionA(this); } @@ -11842,7 +11060,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB Bb { get { return bb_; } set { @@ -11854,7 +11071,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubGroupFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubGroup subGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubGroup SubGroup { get { return subGroup_; } set { @@ -11863,25 +11079,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the subgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSubGroup { get { return subGroup_ != null; } } /// Clears the value of the subgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSubGroup() { subGroup_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionA other) { if (ReferenceEquals(other, null)) { return false; @@ -11895,7 +11107,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (bb_ != null) hash ^= Bb.GetHashCode(); @@ -11907,13 +11118,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -11935,7 +11144,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (bb_ != null) { output.WriteRawTag(10); @@ -11953,7 +11161,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (bb_ != null) { @@ -11969,7 +11176,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionA other) { if (other == null) { return; @@ -11990,7 +11196,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -12022,7 +11227,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -12052,9 +11256,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestMutualRecursionA message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SubMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -12063,23 +11265,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage() { OnConstruction(); } @@ -12087,14 +11285,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage(SubMessage other) : this() { b_ = other.b_ != null ? other.b_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage Clone() { return new SubMessage(this); } @@ -12103,7 +11299,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int BFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB B { get { return b_; } set { @@ -12112,13 +11307,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -12131,7 +11324,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (b_ != null) hash ^= B.GetHashCode(); @@ -12142,13 +11334,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -12165,7 +11355,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (b_ != null) { output.WriteRawTag(10); @@ -12178,7 +11367,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (b_ != null) { @@ -12191,7 +11379,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubMessage other) { if (other == null) { return; @@ -12206,7 +11393,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -12231,7 +11417,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -12253,7 +11438,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SubGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -12262,23 +11446,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup() { OnConstruction(); } @@ -12286,7 +11466,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup(SubGroup other) : this() { subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; notInThisScc_ = other.notInThisScc_ != null ? other.notInThisScc_.Clone() : null; @@ -12294,7 +11473,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup Clone() { return new SubGroup(this); } @@ -12306,7 +11484,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Needed because of bug in javatest /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubMessage SubMessage { get { return subMessage_; } set { @@ -12318,7 +11495,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int NotInThisSccFieldNumber = 4; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes notInThisScc_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes NotInThisScc { get { return notInThisScc_; } set { @@ -12327,13 +11503,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -12347,7 +11521,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); @@ -12359,13 +11532,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -12386,7 +11557,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (subMessage_ != null) { output.WriteRawTag(26); @@ -12403,7 +11573,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (subMessage_ != null) { @@ -12419,7 +11588,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubGroup other) { if (other == null) { return; @@ -12440,7 +11608,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -12474,7 +11641,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -12510,7 +11676,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMutualRecursionB : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -12520,23 +11685,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[22]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB() { OnConstruction(); } @@ -12544,7 +11705,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB(TestMutualRecursionB other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_ != null ? other.a_.Clone() : null; @@ -12553,7 +11713,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB Clone() { return new TestMutualRecursionB(this); } @@ -12562,7 +11721,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA A { get { return a_; } set { @@ -12576,7 +11734,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -12586,25 +11743,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionB); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionB other) { if (ReferenceEquals(other, null)) { return false; @@ -12618,7 +11771,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (a_ != null) hash ^= A.GetHashCode(); @@ -12630,13 +11782,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -12657,7 +11807,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (a_ != null) { output.WriteRawTag(10); @@ -12674,7 +11823,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (a_ != null) { @@ -12690,7 +11838,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionB other) { if (other == null) { return; @@ -12708,7 +11855,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -12737,7 +11883,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -12763,7 +11908,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestIsInitialized : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -12772,23 +11916,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestIsInitialized()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestIsInitialized() { OnConstruction(); } @@ -12796,14 +11936,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestIsInitialized(TestIsInitialized other) : this() { subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestIsInitialized Clone() { return new TestIsInitialized(this); } @@ -12812,7 +11950,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage subMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage SubMessage { get { return subMessage_; } set { @@ -12821,13 +11958,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestIsInitialized); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestIsInitialized other) { if (ReferenceEquals(other, null)) { return false; @@ -12840,7 +11975,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); @@ -12851,13 +11985,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -12874,7 +12006,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (subMessage_ != null) { output.WriteRawTag(10); @@ -12887,7 +12018,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (subMessage_ != null) { @@ -12900,7 +12030,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestIsInitialized other) { if (other == null) { return; @@ -12915,7 +12044,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -12940,7 +12068,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -12963,9 +12090,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestIsInitialized message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SubMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -12974,23 +12099,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage() { OnConstruction(); } @@ -12998,14 +12119,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage(SubMessage other) : this() { subGroup_ = other.HasSubGroup ? other.subGroup_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage Clone() { return new SubMessage(this); } @@ -13014,7 +12133,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubGroupFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Types.SubGroup subGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Types.SubGroup SubGroup { get { return subGroup_; } set { @@ -13023,25 +12141,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the subgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSubGroup { get { return subGroup_ != null; } } /// Clears the value of the subgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSubGroup() { subGroup_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -13054,7 +12168,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasSubGroup) hash ^= SubGroup.GetHashCode(); @@ -13065,13 +12178,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -13089,7 +12200,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasSubGroup) { output.WriteRawTag(11); @@ -13103,7 +12213,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasSubGroup) { @@ -13116,7 +12225,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubMessage other) { if (other == null) { return; @@ -13131,7 +12239,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -13156,7 +12263,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -13179,9 +12285,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the SubMessage message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SubGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -13191,23 +12295,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup() { OnConstruction(); } @@ -13215,7 +12315,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup(SubGroup other) : this() { _hasBits0 = other._hasBits0; i_ = other.i_; @@ -13223,7 +12322,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup Clone() { return new SubGroup(this); } @@ -13234,7 +12332,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { if ((_hasBits0 & 1) != 0) { return i_; } else { return IDefaultValue; } } set { @@ -13244,25 +12341,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "i" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasI { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "i" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearI() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -13275,7 +12368,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasI) hash ^= I.GetHashCode(); @@ -13286,13 +12378,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -13309,7 +12399,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasI) { output.WriteRawTag(16); @@ -13322,7 +12411,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasI) { @@ -13335,7 +12423,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubGroup other) { if (other == null) { return; @@ -13347,7 +12434,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -13371,7 +12457,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -13404,11 +12489,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test that groups have disjoint field numbers from their siblings and - /// parents. This is NOT possible in proto1; only google.protobuf. When - /// attempting to compile with proto1, this will emit an error; so we only - /// include it in protobuf_unittest_proto. + /// parents. This is NOT possible in proto1; only google.protobuf. When attempting + /// to compile with proto1, this will emit an error; so we only include it + /// in protobuf_unittest_proto. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestDupFieldNumber : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -13418,23 +12502,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[24]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDupFieldNumber() { OnConstruction(); } @@ -13442,7 +12522,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDupFieldNumber(TestDupFieldNumber other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -13452,7 +12531,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDupFieldNumber Clone() { return new TestDupFieldNumber(this); } @@ -13466,7 +12544,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// NO_PROTO1 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -13476,13 +12553,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -13491,7 +12566,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int FooFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Foo foo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Foo Foo { get { return foo_; } set { @@ -13500,13 +12574,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the foo field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFoo { get { return foo_ != null; } } /// Clears the value of the foo field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { foo_ = null; } @@ -13515,7 +12587,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int BarFieldNumber = 3; private global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Bar bar_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Bar Bar { get { return bar_; } set { @@ -13524,25 +12595,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the bar field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBar { get { return bar_ != null; } } /// Clears the value of the bar field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBar() { bar_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDupFieldNumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDupFieldNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -13557,7 +12624,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -13570,13 +12636,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -13603,7 +12667,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(8); @@ -13626,7 +12689,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -13645,7 +12707,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDupFieldNumber other) { if (other == null) { return; @@ -13669,7 +12730,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -13705,7 +12765,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -13739,9 +12798,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestDupFieldNumber message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Foo : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -13751,23 +12808,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo() { OnConstruction(); } @@ -13775,7 +12828,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo(Foo other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -13783,7 +12835,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo Clone() { return new Foo(this); } @@ -13794,7 +12845,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -13804,25 +12854,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Foo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Foo other) { if (ReferenceEquals(other, null)) { return false; @@ -13835,7 +12881,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -13846,13 +12891,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -13869,7 +12912,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(8); @@ -13882,7 +12924,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -13895,7 +12936,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Foo other) { if (other == null) { return; @@ -13907,7 +12947,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -13931,7 +12970,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -13952,7 +12990,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Bar : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -13962,23 +12999,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar() { OnConstruction(); } @@ -13986,7 +13019,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar(Bar other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -13994,7 +13026,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar Clone() { return new Bar(this); } @@ -14005,7 +13036,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -14015,25 +13045,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Bar); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Bar other) { if (ReferenceEquals(other, null)) { return false; @@ -14046,7 +13072,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -14057,13 +13082,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -14080,7 +13103,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(8); @@ -14093,7 +13115,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -14106,7 +13127,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Bar other) { if (other == null) { return; @@ -14118,7 +13138,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -14142,7 +13161,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -14171,7 +13189,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Additional messages for testing lazy fields. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestEagerMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -14180,23 +13197,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEagerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[25]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEagerMessage() { OnConstruction(); } @@ -14204,14 +13217,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEagerMessage(TestEagerMessage other) : this() { subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEagerMessage Clone() { return new TestEagerMessage(this); } @@ -14220,7 +13231,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes SubMessage { get { return subMessage_; } set { @@ -14229,13 +13239,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEagerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEagerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -14248,7 +13256,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); @@ -14259,13 +13266,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -14282,7 +13287,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (subMessage_ != null) { output.WriteRawTag(10); @@ -14295,7 +13299,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (subMessage_ != null) { @@ -14308,7 +13311,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEagerMessage other) { if (other == null) { return; @@ -14323,7 +13325,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -14348,7 +13349,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -14370,7 +13370,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestLazyMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -14379,23 +13378,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestLazyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[26]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestLazyMessage() { OnConstruction(); } @@ -14403,14 +13398,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestLazyMessage(TestLazyMessage other) : this() { subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestLazyMessage Clone() { return new TestLazyMessage(this); } @@ -14419,7 +13412,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes SubMessage { get { return subMessage_; } set { @@ -14428,13 +13420,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestLazyMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestLazyMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -14447,7 +13437,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); @@ -14458,13 +13447,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -14481,7 +13468,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (subMessage_ != null) { output.WriteRawTag(10); @@ -14494,7 +13480,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (subMessage_ != null) { @@ -14507,7 +13492,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestLazyMessage other) { if (other == null) { return; @@ -14522,7 +13506,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -14547,7 +13530,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -14572,7 +13554,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Needed for a Python test. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestNestedMessageHasBits : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -14581,23 +13562,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestNestedMessageHasBits()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[27]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedMessageHasBits() { OnConstruction(); } @@ -14605,14 +13582,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedMessageHasBits(TestNestedMessageHasBits other) : this() { optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedMessageHasBits Clone() { return new TestNestedMessageHasBits(this); } @@ -14621,7 +13596,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalNestedMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -14630,13 +13604,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestNestedMessageHasBits); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestNestedMessageHasBits other) { if (ReferenceEquals(other, null)) { return false; @@ -14649,7 +13621,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); @@ -14660,13 +13631,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -14683,7 +13652,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (optionalNestedMessage_ != null) { output.WriteRawTag(10); @@ -14696,7 +13664,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (optionalNestedMessage_ != null) { @@ -14709,7 +13676,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestNestedMessageHasBits other) { if (other == null) { return; @@ -14724,7 +13690,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -14749,7 +13714,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -14772,9 +13736,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestNestedMessageHasBits message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -14783,23 +13745,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -14807,7 +13765,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { nestedmessageRepeatedInt32_ = other.nestedmessageRepeatedInt32_.Clone(); nestedmessageRepeatedForeignmessage_ = other.nestedmessageRepeatedForeignmessage_.Clone(); @@ -14815,7 +13772,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -14826,7 +13782,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(8); private readonly pbc::RepeatedField nestedmessageRepeatedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField NestedmessageRepeatedInt32 { get { return nestedmessageRepeatedInt32_; } } @@ -14837,19 +13792,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.ForeignMessage.Parser); private readonly pbc::RepeatedField nestedmessageRepeatedForeignmessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField NestedmessageRepeatedForeignmessage { get { return nestedmessageRepeatedForeignmessage_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -14863,7 +13815,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= nestedmessageRepeatedInt32_.GetHashCode(); @@ -14875,13 +13826,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -14896,7 +13845,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { nestedmessageRepeatedInt32_.WriteTo(ref output, _repeated_nestedmessageRepeatedInt32_codec); nestedmessageRepeatedForeignmessage_.WriteTo(ref output, _repeated_nestedmessageRepeatedForeignmessage_codec); @@ -14907,7 +13855,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += nestedmessageRepeatedInt32_.CalculateSize(_repeated_nestedmessageRepeatedInt32_codec); @@ -14919,7 +13866,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -14930,7 +13876,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -14957,7 +13902,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -14990,7 +13934,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Test message with CamelCase field names. This violates Protocol Buffer /// standard style. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestCamelCaseFieldNames : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -15000,23 +13943,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[28]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames() { OnConstruction(); } @@ -15024,7 +13963,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames(TestCamelCaseFieldNames other) : this() { _hasBits0 = other._hasBits0; primitiveField_ = other.primitiveField_; @@ -15043,7 +13981,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames Clone() { return new TestCamelCaseFieldNames(this); } @@ -15054,7 +13991,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int primitiveField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PrimitiveField { get { if ((_hasBits0 & 1) != 0) { return primitiveField_; } else { return PrimitiveFieldDefaultValue; } } set { @@ -15064,13 +14000,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "PrimitiveField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPrimitiveField { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "PrimitiveField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPrimitiveField() { _hasBits0 &= ~1; } @@ -15081,7 +14015,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string stringField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return stringField_ ?? StringFieldDefaultValue; } set { @@ -15090,13 +14023,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "StringField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringField { get { return stringField_ != null; } } /// Clears the value of the "StringField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringField() { stringField_ = null; } @@ -15107,7 +14038,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum enumField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum EnumField { get { if ((_hasBits0 & 2) != 0) { return enumField_; } else { return EnumFieldDefaultValue; } } set { @@ -15117,13 +14047,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "EnumField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnumField { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "EnumField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnumField() { _hasBits0 &= ~2; } @@ -15132,7 +14060,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage messageField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage MessageField { get { return messageField_; } set { @@ -15146,7 +14073,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string stringPieceField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringPieceField { get { return stringPieceField_ ?? StringPieceFieldDefaultValue; } set { @@ -15155,13 +14081,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "StringPieceField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringPieceField { get { return stringPieceField_ != null; } } /// Clears the value of the "StringPieceField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringPieceField() { stringPieceField_ = null; } @@ -15172,7 +14096,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string cordField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string CordField { get { return cordField_ ?? CordFieldDefaultValue; } set { @@ -15181,13 +14104,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "CordField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCordField { get { return cordField_ != null; } } /// Clears the value of the "CordField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCordField() { cordField_ = null; } @@ -15198,7 +14119,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(56); private readonly pbc::RepeatedField repeatedPrimitiveField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedPrimitiveField { get { return repeatedPrimitiveField_; } } @@ -15209,7 +14129,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(66); private readonly pbc::RepeatedField repeatedStringField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringField { get { return repeatedStringField_; } } @@ -15220,7 +14139,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(72, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField repeatedEnumField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedEnumField { get { return repeatedEnumField_; } } @@ -15231,7 +14149,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.Proto2.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedMessageField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessageField { get { return repeatedMessageField_; } } @@ -15242,7 +14159,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(90); private readonly pbc::RepeatedField repeatedStringPieceField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPieceField { get { return repeatedStringPieceField_; } } @@ -15253,19 +14169,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(98); private readonly pbc::RepeatedField repeatedCordField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCordField { get { return repeatedCordField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCamelCaseFieldNames); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCamelCaseFieldNames other) { if (ReferenceEquals(other, null)) { return false; @@ -15289,7 +14202,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasPrimitiveField) hash ^= PrimitiveField.GetHashCode(); @@ -15311,13 +14223,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -15360,7 +14270,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasPrimitiveField) { output.WriteRawTag(8); @@ -15399,7 +14308,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasPrimitiveField) { @@ -15433,7 +14341,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCamelCaseFieldNames other) { if (other == null) { return; @@ -15469,7 +14376,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -15540,7 +14446,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -15612,7 +14517,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// We list fields out of order, to ensure that we're using field number and not /// field index to determine serialization order. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestFieldOrderings : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -15624,23 +14528,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[29]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings() { OnConstruction(); } @@ -15648,7 +14548,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings(TestFieldOrderings other) : this() { _hasBits0 = other._hasBits0; myString_ = other.myString_; @@ -15660,7 +14559,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings Clone() { return new TestFieldOrderings(this); } @@ -15671,7 +14569,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -15680,13 +14577,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } @@ -15697,7 +14592,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long myInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long MyInt { get { if ((_hasBits0 & 1) != 0) { return myInt_; } else { return MyIntDefaultValue; } } set { @@ -15707,13 +14601,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyInt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "my_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyInt() { _hasBits0 &= ~1; } @@ -15724,7 +14616,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float myFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float MyFloat { get { if ((_hasBits0 & 2) != 0) { return myFloat_; } else { return MyFloatDefaultValue; } } set { @@ -15734,13 +14625,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyFloat { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "my_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyFloat() { _hasBits0 &= ~2; } @@ -15749,7 +14638,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -15758,13 +14646,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestFieldOrderings); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestFieldOrderings other) { if (ReferenceEquals(other, null)) { return false; @@ -15783,7 +14669,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); @@ -15800,13 +14685,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -15838,7 +14721,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasMyInt) { output.WriteRawTag(8); @@ -15866,7 +14748,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -15891,7 +14772,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestFieldOrderings other) { if (other == null) { return; @@ -15916,7 +14796,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -15955,7 +14834,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -16014,9 +14892,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestFieldOrderings message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -16026,23 +14902,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -16050,7 +14922,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; oo_ = other.oo_; @@ -16059,7 +14930,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -16070,7 +14940,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long oo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Oo { get { if ((_hasBits0 & 2) != 0) { return oo_; } else { return OoDefaultValue; } } set { @@ -16080,13 +14949,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oo" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOo { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "oo" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOo() { _hasBits0 &= ~2; } @@ -16102,7 +14969,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return BbDefaultValue; } } set { @@ -16112,25 +14978,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bb" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBb { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "bb" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBb() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -16144,7 +15006,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOo) hash ^= Oo.GetHashCode(); @@ -16156,13 +15017,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -16183,7 +15042,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasBb) { output.WriteRawTag(8); @@ -16200,7 +15058,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOo) { @@ -16216,7 +15073,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -16231,7 +15087,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -16257,7 +15112,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -16285,7 +15139,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestExtensionOrderings1 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -16294,23 +15147,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[30]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings1() { OnConstruction(); } @@ -16318,14 +15167,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings1(TestExtensionOrderings1 other) : this() { myString_ = other.myString_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings1 Clone() { return new TestExtensionOrderings1(this); } @@ -16336,7 +15183,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -16345,25 +15191,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionOrderings1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionOrderings1 other) { if (ReferenceEquals(other, null)) { return false; @@ -16376,7 +15218,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); @@ -16387,13 +15228,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -16410,7 +15249,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasMyString) { output.WriteRawTag(10); @@ -16423,7 +15261,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -16436,7 +15273,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionOrderings1 other) { if (other == null) { return; @@ -16448,7 +15284,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -16470,7 +15305,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -16490,7 +15324,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings1 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension TestExtOrderings1 = new pb::Extension(13, pb::FieldCodec.ForMessage(106, global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings1.Parser)); @@ -16499,7 +15332,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestExtensionOrderings2 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -16508,23 +15340,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[31]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings2() { OnConstruction(); } @@ -16532,14 +15360,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings2(TestExtensionOrderings2 other) : this() { myString_ = other.myString_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings2 Clone() { return new TestExtensionOrderings2(this); } @@ -16550,7 +15376,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -16559,25 +15384,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionOrderings2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionOrderings2 other) { if (ReferenceEquals(other, null)) { return false; @@ -16590,7 +15411,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); @@ -16601,13 +15421,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -16624,7 +15442,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasMyString) { output.WriteRawTag(10); @@ -16637,7 +15454,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -16650,7 +15466,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionOrderings2 other) { if (other == null) { return; @@ -16662,7 +15477,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -16684,7 +15498,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -16704,9 +15517,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestExtensionOrderings2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestExtensionOrderings3 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -16715,23 +15526,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings3() { OnConstruction(); } @@ -16739,14 +15546,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings3(TestExtensionOrderings3 other) : this() { myString_ = other.myString_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings3 Clone() { return new TestExtensionOrderings3(this); } @@ -16757,7 +15562,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -16766,25 +15570,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionOrderings3); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionOrderings3 other) { if (ReferenceEquals(other, null)) { return false; @@ -16797,7 +15597,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); @@ -16808,13 +15607,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -16831,7 +15628,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasMyString) { output.WriteRawTag(10); @@ -16844,7 +15640,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -16857,7 +15652,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionOrderings3 other) { if (other == null) { return; @@ -16869,7 +15663,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -16891,7 +15684,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -16911,7 +15703,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings3 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension TestExtOrderings3 = new pb::Extension(14, pb::FieldCodec.ForMessage(114, global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings2.Types.TestExtensionOrderings3.Parser)); @@ -16926,7 +15717,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension TestExtOrderings2 = new pb::Extension(12, pb::FieldCodec.ForMessage(98, global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings2.Parser)); @@ -16935,7 +15725,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestExtremeDefaultValues : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -16945,23 +15734,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[32]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtremeDefaultValues() { OnConstruction(); } @@ -16969,7 +15754,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtremeDefaultValues(TestExtremeDefaultValues other) : this() { _hasBits0 = other._hasBits0; escapedBytes_ = other.escapedBytes_; @@ -17003,7 +15787,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtremeDefaultValues Clone() { return new TestExtremeDefaultValues(this); } @@ -17014,7 +15797,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString escapedBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString EscapedBytes { get { return escapedBytes_ ?? EscapedBytesDefaultValue; } set { @@ -17023,13 +15805,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "escaped_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEscapedBytes { get { return escapedBytes_ != null; } } /// Clears the value of the "escaped_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEscapedBytes() { escapedBytes_ = null; } @@ -17040,7 +15820,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint largeUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint LargeUint32 { get { if ((_hasBits0 & 1) != 0) { return largeUint32_; } else { return LargeUint32DefaultValue; } } set { @@ -17050,13 +15829,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "large_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLargeUint32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "large_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLargeUint32() { _hasBits0 &= ~1; } @@ -17067,7 +15844,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong largeUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong LargeUint64 { get { if ((_hasBits0 & 2) != 0) { return largeUint64_; } else { return LargeUint64DefaultValue; } } set { @@ -17077,13 +15853,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "large_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLargeUint64 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "large_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLargeUint64() { _hasBits0 &= ~2; } @@ -17094,7 +15868,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int smallInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SmallInt32 { get { if ((_hasBits0 & 4) != 0) { return smallInt32_; } else { return SmallInt32DefaultValue; } } set { @@ -17104,13 +15877,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallInt32 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "small_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallInt32() { _hasBits0 &= ~4; } @@ -17121,7 +15892,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long smallInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SmallInt64 { get { if ((_hasBits0 & 8) != 0) { return smallInt64_; } else { return SmallInt64DefaultValue; } } set { @@ -17131,13 +15901,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallInt64 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "small_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallInt64() { _hasBits0 &= ~8; } @@ -17148,7 +15916,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int reallySmallInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int ReallySmallInt32 { get { if ((_hasBits0 & 131072) != 0) { return reallySmallInt32_; } else { return ReallySmallInt32DefaultValue; } } set { @@ -17158,13 +15925,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "really_small_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasReallySmallInt32 { get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "really_small_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearReallySmallInt32() { _hasBits0 &= ~131072; } @@ -17175,7 +15940,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long reallySmallInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long ReallySmallInt64 { get { if ((_hasBits0 & 262144) != 0) { return reallySmallInt64_; } else { return ReallySmallInt64DefaultValue; } } set { @@ -17185,13 +15949,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "really_small_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasReallySmallInt64 { get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "really_small_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearReallySmallInt64() { _hasBits0 &= ~262144; } @@ -17207,7 +15969,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// lots of people use editors that would be confused by this.) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Utf8String { get { return utf8String_ ?? Utf8StringDefaultValue; } set { @@ -17216,13 +15977,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "utf8_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasUtf8String { get { return utf8String_ != null; } } /// Clears the value of the "utf8_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearUtf8String() { utf8String_ = null; } @@ -17236,7 +15995,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Tests for single-precision floating-point values. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float ZeroFloat { get { if ((_hasBits0 & 16) != 0) { return zeroFloat_; } else { return ZeroFloatDefaultValue; } } set { @@ -17246,13 +16004,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "zero_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasZeroFloat { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "zero_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearZeroFloat() { _hasBits0 &= ~16; } @@ -17263,7 +16019,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float oneFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OneFloat { get { if ((_hasBits0 & 32) != 0) { return oneFloat_; } else { return OneFloatDefaultValue; } } set { @@ -17273,13 +16028,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "one_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneFloat { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "one_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneFloat() { _hasBits0 &= ~32; } @@ -17290,7 +16043,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float smallFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float SmallFloat { get { if ((_hasBits0 & 64) != 0) { return smallFloat_; } else { return SmallFloatDefaultValue; } } set { @@ -17300,13 +16052,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallFloat { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "small_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallFloat() { _hasBits0 &= ~64; } @@ -17317,7 +16067,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float negativeOneFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NegativeOneFloat { get { if ((_hasBits0 & 128) != 0) { return negativeOneFloat_; } else { return NegativeOneFloatDefaultValue; } } set { @@ -17327,13 +16076,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "negative_one_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegativeOneFloat { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "negative_one_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegativeOneFloat() { _hasBits0 &= ~128; } @@ -17344,7 +16091,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float negativeFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NegativeFloat { get { if ((_hasBits0 & 256) != 0) { return negativeFloat_; } else { return NegativeFloatDefaultValue; } } set { @@ -17354,13 +16100,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "negative_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegativeFloat { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "negative_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegativeFloat() { _hasBits0 &= ~256; } @@ -17374,7 +16118,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Using exponents /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float LargeFloat { get { if ((_hasBits0 & 512) != 0) { return largeFloat_; } else { return LargeFloatDefaultValue; } } set { @@ -17384,13 +16127,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "large_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLargeFloat { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "large_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLargeFloat() { _hasBits0 &= ~512; } @@ -17401,7 +16142,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float smallNegativeFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float SmallNegativeFloat { get { if ((_hasBits0 & 1024) != 0) { return smallNegativeFloat_; } else { return SmallNegativeFloatDefaultValue; } } set { @@ -17411,13 +16151,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_negative_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallNegativeFloat { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "small_negative_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallNegativeFloat() { _hasBits0 &= ~1024; } @@ -17431,7 +16169,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Text for nonfinite floating-point values. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double InfDouble { get { if ((_hasBits0 & 2048) != 0) { return infDouble_; } else { return InfDoubleDefaultValue; } } set { @@ -17441,13 +16178,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "inf_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasInfDouble { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "inf_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearInfDouble() { _hasBits0 &= ~2048; } @@ -17458,7 +16193,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double negInfDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double NegInfDouble { get { if ((_hasBits0 & 4096) != 0) { return negInfDouble_; } else { return NegInfDoubleDefaultValue; } } set { @@ -17468,13 +16202,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "neg_inf_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegInfDouble { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "neg_inf_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegInfDouble() { _hasBits0 &= ~4096; } @@ -17485,7 +16217,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double nanDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double NanDouble { get { if ((_hasBits0 & 8192) != 0) { return nanDouble_; } else { return NanDoubleDefaultValue; } } set { @@ -17495,13 +16226,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "nan_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNanDouble { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "nan_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNanDouble() { _hasBits0 &= ~8192; } @@ -17512,7 +16241,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float infFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float InfFloat { get { if ((_hasBits0 & 16384) != 0) { return infFloat_; } else { return InfFloatDefaultValue; } } set { @@ -17522,13 +16250,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "inf_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasInfFloat { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "inf_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearInfFloat() { _hasBits0 &= ~16384; } @@ -17539,7 +16265,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float negInfFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NegInfFloat { get { if ((_hasBits0 & 32768) != 0) { return negInfFloat_; } else { return NegInfFloatDefaultValue; } } set { @@ -17549,13 +16274,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "neg_inf_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegInfFloat { get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "neg_inf_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegInfFloat() { _hasBits0 &= ~32768; } @@ -17566,7 +16289,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float nanFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NanFloat { get { if ((_hasBits0 & 65536) != 0) { return nanFloat_; } else { return NanFloatDefaultValue; } } set { @@ -17576,13 +16298,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "nan_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNanFloat { get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "nan_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNanFloat() { _hasBits0 &= ~65536; } @@ -17600,7 +16320,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// literals. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string CppTrigraph { get { return cppTrigraph_ ?? CppTrigraphDefaultValue; } set { @@ -17609,13 +16328,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "cpp_trigraph" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCppTrigraph { get { return cppTrigraph_ != null; } } /// Clears the value of the "cpp_trigraph" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCppTrigraph() { cppTrigraph_ = null; } @@ -17629,7 +16346,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// String defaults containing the character '\000' /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringWithZero { get { return stringWithZero_ ?? StringWithZeroDefaultValue; } set { @@ -17638,13 +16354,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "string_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringWithZero { get { return stringWithZero_ != null; } } /// Clears the value of the "string_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringWithZero() { stringWithZero_ = null; } @@ -17655,7 +16369,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString bytesWithZero_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BytesWithZero { get { return bytesWithZero_ ?? BytesWithZeroDefaultValue; } set { @@ -17664,13 +16377,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bytes_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBytesWithZero { get { return bytesWithZero_ != null; } } /// Clears the value of the "bytes_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBytesWithZero() { bytesWithZero_ = null; } @@ -17681,7 +16392,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string stringPieceWithZero_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringPieceWithZero { get { return stringPieceWithZero_ ?? StringPieceWithZeroDefaultValue; } set { @@ -17690,13 +16400,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "string_piece_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringPieceWithZero { get { return stringPieceWithZero_ != null; } } /// Clears the value of the "string_piece_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringPieceWithZero() { stringPieceWithZero_ = null; } @@ -17707,7 +16415,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string cordWithZero_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string CordWithZero { get { return cordWithZero_ ?? CordWithZeroDefaultValue; } set { @@ -17716,13 +16423,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "cord_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCordWithZero { get { return cordWithZero_ != null; } } /// Clears the value of the "cord_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCordWithZero() { cordWithZero_ = null; } @@ -17733,7 +16438,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string replacementString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ReplacementString { get { return replacementString_ ?? ReplacementStringDefaultValue; } set { @@ -17742,25 +16446,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "replacement_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasReplacementString { get { return replacementString_ != null; } } /// Clears the value of the "replacement_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearReplacementString() { replacementString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtremeDefaultValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtremeDefaultValues other) { if (ReferenceEquals(other, null)) { return false; @@ -17799,7 +16499,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasEscapedBytes) hash ^= EscapedBytes.GetHashCode(); @@ -17836,13 +16535,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -17963,7 +16660,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasEscapedBytes) { output.WriteRawTag(10); @@ -18080,7 +16776,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasEscapedBytes) { @@ -18171,7 +16866,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtremeDefaultValues other) { if (other == null) { return; @@ -18261,7 +16955,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -18387,7 +17080,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -18510,7 +17202,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SparseEnumMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -18520,23 +17211,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[33]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage() { OnConstruction(); } @@ -18544,7 +17231,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage(SparseEnumMessage other) : this() { _hasBits0 = other._hasBits0; sparseEnum_ = other.sparseEnum_; @@ -18552,7 +17238,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage Clone() { return new SparseEnumMessage(this); } @@ -18563,7 +17248,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestSparseEnum sparseEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestSparseEnum SparseEnum { get { if ((_hasBits0 & 1) != 0) { return sparseEnum_; } else { return SparseEnumDefaultValue; } } set { @@ -18573,25 +17257,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "sparse_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSparseEnum { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "sparse_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSparseEnum() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseEnumMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseEnumMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -18604,7 +17284,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasSparseEnum) hash ^= SparseEnum.GetHashCode(); @@ -18615,13 +17294,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -18638,7 +17315,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasSparseEnum) { output.WriteRawTag(8); @@ -18651,7 +17327,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasSparseEnum) { @@ -18664,7 +17339,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseEnumMessage other) { if (other == null) { return; @@ -18676,7 +17350,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -18698,7 +17371,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -18720,7 +17392,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test String and Bytes: string is for valid UTF-8 strings /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OneString : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -18729,23 +17400,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[34]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString() { OnConstruction(); } @@ -18753,14 +17420,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString(OneString other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString Clone() { return new OneString(this); } @@ -18771,7 +17436,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Data { get { return data_ ?? DataDefaultValue; } set { @@ -18780,25 +17444,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return data_ != null; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { data_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneString other) { if (ReferenceEquals(other, null)) { return false; @@ -18811,7 +17471,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -18822,13 +17481,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -18845,7 +17502,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasData) { output.WriteRawTag(10); @@ -18858,7 +17514,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -18871,7 +17526,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneString other) { if (other == null) { return; @@ -18883,7 +17537,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -18905,7 +17558,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -18924,7 +17576,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MoreString : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -18933,23 +17584,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[35]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString() { OnConstruction(); } @@ -18957,14 +17604,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString(MoreString other) : this() { data_ = other.data_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString Clone() { return new MoreString(this); } @@ -18975,19 +17620,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Data { get { return data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreString other) { if (ReferenceEquals(other, null)) { return false; @@ -19000,7 +17642,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= data_.GetHashCode(); @@ -19011,13 +17652,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -19031,7 +17670,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { data_.WriteTo(ref output, _repeated_data_codec); if (_unknownFields != null) { @@ -19041,7 +17679,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += data_.CalculateSize(_repeated_data_codec); @@ -19052,7 +17689,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreString other) { if (other == null) { return; @@ -19062,7 +17698,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -19084,7 +17719,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -19103,7 +17737,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OneBytes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -19112,23 +17745,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[36]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes() { OnConstruction(); } @@ -19136,14 +17765,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes(OneBytes other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes Clone() { return new OneBytes(this); } @@ -19154,7 +17781,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Data { get { return data_ ?? DataDefaultValue; } set { @@ -19163,25 +17789,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return data_ != null; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { data_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -19194,7 +17816,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -19205,13 +17826,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -19228,7 +17847,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasData) { output.WriteRawTag(10); @@ -19241,7 +17859,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -19254,7 +17871,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneBytes other) { if (other == null) { return; @@ -19266,7 +17882,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -19288,7 +17903,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -19307,7 +17921,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MoreBytes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -19316,23 +17929,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[37]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes() { OnConstruction(); } @@ -19340,14 +17949,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes(MoreBytes other) : this() { data_ = other.data_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes Clone() { return new MoreBytes(this); } @@ -19358,19 +17965,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBytes(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Data { get { return data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -19383,7 +17987,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= data_.GetHashCode(); @@ -19394,13 +17997,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -19414,7 +18015,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { data_.WriteTo(ref output, _repeated_data_codec); if (_unknownFields != null) { @@ -19424,7 +18024,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += data_.CalculateSize(_repeated_data_codec); @@ -19435,7 +18034,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreBytes other) { if (other == null) { return; @@ -19445,7 +18043,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -19467,7 +18064,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -19489,7 +18085,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test int32, uint32, int64, uint64, and bool are all compatible /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Int32Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -19499,23 +18094,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[38]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message() { OnConstruction(); } @@ -19523,7 +18114,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message(Int32Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -19531,7 +18121,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message Clone() { return new Int32Message(this); } @@ -19542,7 +18131,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -19552,25 +18140,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -19583,7 +18167,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -19594,13 +18177,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -19617,7 +18198,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasData) { output.WriteRawTag(8); @@ -19630,7 +18210,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -19643,7 +18222,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int32Message other) { if (other == null) { return; @@ -19655,7 +18233,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -19677,7 +18254,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -19696,7 +18272,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Uint32Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -19706,23 +18281,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[39]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message() { OnConstruction(); } @@ -19730,7 +18301,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message(Uint32Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -19738,7 +18308,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message Clone() { return new Uint32Message(this); } @@ -19749,7 +18318,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -19759,25 +18327,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -19790,7 +18354,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -19801,13 +18364,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -19824,7 +18385,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasData) { output.WriteRawTag(8); @@ -19837,7 +18397,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -19850,7 +18409,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint32Message other) { if (other == null) { return; @@ -19862,7 +18420,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -19884,7 +18441,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -19903,7 +18459,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Int64Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -19913,23 +18468,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[40]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message() { OnConstruction(); } @@ -19937,7 +18488,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message(Int64Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -19945,7 +18495,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message Clone() { return new Int64Message(this); } @@ -19956,7 +18505,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -19966,25 +18514,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -19997,7 +18541,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -20008,13 +18551,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -20031,7 +18572,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasData) { output.WriteRawTag(8); @@ -20044,7 +18584,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -20057,7 +18596,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int64Message other) { if (other == null) { return; @@ -20069,7 +18607,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -20091,7 +18628,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -20110,7 +18646,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Uint64Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -20120,23 +18655,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[41]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message() { OnConstruction(); } @@ -20144,7 +18675,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message(Uint64Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -20152,7 +18682,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message Clone() { return new Uint64Message(this); } @@ -20163,7 +18692,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -20173,25 +18701,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -20204,7 +18728,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -20215,13 +18738,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -20238,7 +18759,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasData) { output.WriteRawTag(8); @@ -20251,7 +18771,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -20264,7 +18783,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint64Message other) { if (other == null) { return; @@ -20276,7 +18794,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -20298,7 +18815,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -20317,7 +18833,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class BoolMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -20327,23 +18842,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[42]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage() { OnConstruction(); } @@ -20351,7 +18862,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage(BoolMessage other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -20359,7 +18869,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage Clone() { return new BoolMessage(this); } @@ -20370,7 +18879,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private bool data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -20380,25 +18888,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BoolMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BoolMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -20411,7 +18915,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -20422,13 +18925,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -20445,7 +18946,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasData) { output.WriteRawTag(8); @@ -20458,7 +18958,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -20471,7 +18970,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BoolMessage other) { if (other == null) { return; @@ -20483,7 +18981,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -20505,7 +19002,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -20527,7 +19023,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test oneofs. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestOneof : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -20536,23 +19031,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[43]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof() { OnConstruction(); } @@ -20560,7 +19051,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof(TestOneof other) : this() { switch (other.FooCase) { case FooOneofCase.FooInt: @@ -20581,7 +19071,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof Clone() { return new TestOneof(this); } @@ -20589,7 +19078,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { return HasFooInt ? (int) foo_ : 0; } set { @@ -20599,13 +19087,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return fooCase_ == FooOneofCase.FooInt; } } /// Clears the value of the oneof if it's currently set to "foo_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { if (HasFooInt) { ClearFoo(); @@ -20615,7 +19101,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return HasFooString ? (string) foo_ : ""; } set { @@ -20625,13 +19110,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooCase_ == FooOneofCase.FooString; } } /// Clears the value of the oneof if it's currently set to "foo_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { if (HasFooString) { ClearFoo(); @@ -20641,7 +19124,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes) foo_ : null; } set { @@ -20653,7 +19135,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foogroup" field. public const int FooGroupFieldNumber = 4; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup FooGroup { get { return HasFooGroup ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup) foo_ : null; } set { @@ -20663,13 +19144,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foogroup" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooGroup { get { return fooCase_ == FooOneofCase.FooGroup; } } /// Clears the value of the oneof if it's currently set to "foogroup" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooGroup() { if (HasFooGroup) { ClearFoo(); @@ -20687,26 +19166,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneof); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneof other) { if (ReferenceEquals(other, null)) { return false; @@ -20723,7 +19198,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); @@ -20738,13 +19212,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -20774,7 +19246,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasFooInt) { output.WriteRawTag(8); @@ -20800,7 +19271,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -20822,7 +19292,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneof other) { if (other == null) { return; @@ -20852,7 +19321,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -20896,7 +19364,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -20938,9 +19405,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestOneof message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -20950,23 +19415,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneof.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup() { OnConstruction(); } @@ -20974,7 +19435,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup(FooGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -20983,7 +19443,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup Clone() { return new FooGroup(this); } @@ -20994,7 +19453,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -21004,13 +19462,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -21021,7 +19477,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string B { get { return b_ ?? BDefaultValue; } set { @@ -21030,25 +19485,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return b_ != null; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { b_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -21062,7 +19513,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -21074,13 +19524,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -21101,7 +19549,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(40); @@ -21118,7 +19565,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -21134,7 +19580,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooGroup other) { if (other == null) { return; @@ -21149,7 +19594,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -21177,7 +19621,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -21207,7 +19650,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestOneofBackwardsCompatible : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -21217,23 +19659,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[44]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneofBackwardsCompatible() { OnConstruction(); } @@ -21241,7 +19679,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneofBackwardsCompatible(TestOneofBackwardsCompatible other) : this() { _hasBits0 = other._hasBits0; fooInt_ = other.fooInt_; @@ -21252,7 +19689,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneofBackwardsCompatible Clone() { return new TestOneofBackwardsCompatible(this); } @@ -21263,7 +19699,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fooInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { if ((_hasBits0 & 1) != 0) { return fooInt_; } else { return FooIntDefaultValue; } } set { @@ -21273,13 +19708,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "foo_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { _hasBits0 &= ~1; } @@ -21290,7 +19723,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string fooString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return fooString_ ?? FooStringDefaultValue; } set { @@ -21299,13 +19731,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooString_ != null; } } /// Clears the value of the "foo_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { fooString_ = null; } @@ -21314,7 +19744,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int FooMessageFieldNumber = 3; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes fooMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes FooMessage { get { return fooMessage_; } set { @@ -21326,7 +19755,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int FooGroupFieldNumber = 4; private global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Types.FooGroup fooGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Types.FooGroup FooGroup { get { return fooGroup_; } set { @@ -21335,25 +19763,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the foogroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooGroup { get { return fooGroup_ != null; } } /// Clears the value of the foogroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooGroup() { fooGroup_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneofBackwardsCompatible); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneofBackwardsCompatible other) { if (ReferenceEquals(other, null)) { return false; @@ -21369,7 +19793,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); @@ -21383,13 +19806,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -21419,7 +19840,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasFooInt) { output.WriteRawTag(8); @@ -21445,7 +19865,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -21467,7 +19886,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneofBackwardsCompatible other) { if (other == null) { return; @@ -21494,7 +19912,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -21534,7 +19951,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -21572,9 +19988,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestOneofBackwardsCompatible message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -21584,23 +19998,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup() { OnConstruction(); } @@ -21608,7 +20018,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup(FooGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -21617,7 +20026,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup Clone() { return new FooGroup(this); } @@ -21628,7 +20036,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -21638,13 +20045,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -21655,7 +20060,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string B { get { return b_ ?? BDefaultValue; } set { @@ -21664,25 +20068,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return b_ != null; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { b_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -21696,7 +20096,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -21708,13 +20107,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -21735,7 +20132,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(40); @@ -21752,7 +20148,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -21768,7 +20163,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooGroup other) { if (other == null) { return; @@ -21783,7 +20177,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -21811,7 +20204,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -21841,7 +20233,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestOneof2 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -21851,23 +20242,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[45]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof2() { OnConstruction(); } @@ -21875,7 +20262,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof2(TestOneof2 other) : this() { _hasBits0 = other._hasBits0; bazInt_ = other.bazInt_; @@ -21935,7 +20321,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof2 Clone() { return new TestOneof2(this); } @@ -21943,7 +20328,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { return HasFooInt ? (int) foo_ : 0; } set { @@ -21953,13 +20337,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return fooCase_ == FooOneofCase.FooInt; } } /// Clears the value of the oneof if it's currently set to "foo_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { if (HasFooInt) { ClearFoo(); @@ -21969,7 +20351,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return HasFooString ? (string) foo_ : ""; } set { @@ -21979,13 +20360,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooCase_ == FooOneofCase.FooString; } } /// Clears the value of the oneof if it's currently set to "foo_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { if (HasFooString) { ClearFoo(); @@ -21995,7 +20374,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_cord" field. public const int FooCordFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooCord { get { return HasFooCord ? (string) foo_ : ""; } set { @@ -22005,13 +20383,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooCord { get { return fooCase_ == FooOneofCase.FooCord; } } /// Clears the value of the oneof if it's currently set to "foo_cord" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooCord() { if (HasFooCord) { ClearFoo(); @@ -22021,7 +20397,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string_piece" field. public const int FooStringPieceFieldNumber = 4; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooStringPiece { get { return HasFooStringPiece ? (string) foo_ : ""; } set { @@ -22031,13 +20406,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooStringPiece { get { return fooCase_ == FooOneofCase.FooStringPiece; } } /// Clears the value of the oneof if it's currently set to "foo_string_piece" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooStringPiece() { if (HasFooStringPiece) { ClearFoo(); @@ -22047,7 +20420,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_bytes" field. public const int FooBytesFieldNumber = 5; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString FooBytes { get { return HasFooBytes ? (pb::ByteString) foo_ : pb::ByteString.Empty; } set { @@ -22057,13 +20429,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooBytes { get { return fooCase_ == FooOneofCase.FooBytes; } } /// Clears the value of the oneof if it's currently set to "foo_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooBytes() { if (HasFooBytes) { ClearFoo(); @@ -22073,7 +20443,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_enum" field. public const int FooEnumFieldNumber = 6; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum FooEnum { get { return HasFooEnum ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum) foo_ : global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum.Foo; } set { @@ -22083,13 +20452,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooEnum { get { return fooCase_ == FooOneofCase.FooEnum; } } /// Clears the value of the oneof if it's currently set to "foo_enum" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooEnum() { if (HasFooEnum) { ClearFoo(); @@ -22099,7 +20466,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 7; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage) foo_ : null; } set { @@ -22111,7 +20477,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foogroup" field. public const int FooGroupFieldNumber = 8; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup FooGroup { get { return HasFooGroup ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup) foo_ : null; } set { @@ -22121,13 +20486,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foogroup" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooGroup { get { return fooCase_ == FooOneofCase.FooGroup; } } /// Clears the value of the oneof if it's currently set to "foogroup" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooGroup() { if (HasFooGroup) { ClearFoo(); @@ -22137,7 +20500,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_lazy_message" field. public const int FooLazyMessageFieldNumber = 11; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage FooLazyMessage { get { return fooCase_ == FooOneofCase.FooLazyMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage) foo_ : null; } set { @@ -22149,7 +20511,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_int" field. public const int BarIntFieldNumber = 12; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int BarInt { get { return HasBarInt ? (int) bar_ : 5; } set { @@ -22159,13 +20520,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarInt { get { return barCase_ == BarOneofCase.BarInt; } } /// Clears the value of the oneof if it's currently set to "bar_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarInt() { if (HasBarInt) { ClearBar(); @@ -22175,7 +20534,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_string" field. public const int BarStringFieldNumber = 13; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BarString { get { return HasBarString ? (string) bar_ : global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("U1RSSU5H"), 0, 6); } set { @@ -22185,13 +20543,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarString { get { return barCase_ == BarOneofCase.BarString; } } /// Clears the value of the oneof if it's currently set to "bar_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarString() { if (HasBarString) { ClearBar(); @@ -22201,7 +20557,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_cord" field. public const int BarCordFieldNumber = 14; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BarCord { get { return HasBarCord ? (string) bar_ : global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("Q09SRA=="), 0, 4); } set { @@ -22211,13 +20566,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarCord { get { return barCase_ == BarOneofCase.BarCord; } } /// Clears the value of the oneof if it's currently set to "bar_cord" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarCord() { if (HasBarCord) { ClearBar(); @@ -22227,7 +20580,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_string_piece" field. public const int BarStringPieceFieldNumber = 15; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BarStringPiece { get { return HasBarStringPiece ? (string) bar_ : global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("U1BJRUNF"), 0, 6); } set { @@ -22237,13 +20589,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarStringPiece { get { return barCase_ == BarOneofCase.BarStringPiece; } } /// Clears the value of the oneof if it's currently set to "bar_string_piece" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarStringPiece() { if (HasBarStringPiece) { ClearBar(); @@ -22253,7 +20603,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_bytes" field. public const int BarBytesFieldNumber = 16; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BarBytes { get { return HasBarBytes ? (pb::ByteString) bar_ : pb::ByteString.FromBase64("QllURVM="); } set { @@ -22263,13 +20612,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarBytes { get { return barCase_ == BarOneofCase.BarBytes; } } /// Clears the value of the oneof if it's currently set to "bar_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarBytes() { if (HasBarBytes) { ClearBar(); @@ -22279,7 +20626,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_enum" field. public const int BarEnumFieldNumber = 17; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum BarEnum { get { return HasBarEnum ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum) bar_ : global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum.Bar; } set { @@ -22289,13 +20635,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarEnum { get { return barCase_ == BarOneofCase.BarEnum; } } /// Clears the value of the oneof if it's currently set to "bar_enum" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarEnum() { if (HasBarEnum) { ClearBar(); @@ -22308,7 +20652,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int bazInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int BazInt { get { if ((_hasBits0 & 1) != 0) { return bazInt_; } else { return BazIntDefaultValue; } } set { @@ -22318,13 +20661,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "baz_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBazInt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "baz_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBazInt() { _hasBits0 &= ~1; } @@ -22335,7 +20676,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string bazString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BazString { get { return bazString_ ?? BazStringDefaultValue; } set { @@ -22344,13 +20684,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "baz_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBazString { get { return bazString_ != null; } } /// Clears the value of the "baz_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBazString() { bazString_ = null; } @@ -22371,13 +20709,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; @@ -22396,26 +20732,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private BarOneofCase barCase_ = BarOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarOneofCase BarCase { get { return barCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBar() { barCase_ = BarOneofCase.None; bar_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneof2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneof2 other) { if (ReferenceEquals(other, null)) { return false; @@ -22446,7 +20778,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); @@ -22475,13 +20806,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -22563,7 +20892,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasFooInt) { output.WriteRawTag(8); @@ -22641,7 +20969,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -22702,7 +21029,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneof2 other) { if (other == null) { return; @@ -22777,7 +21103,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -22880,7 +21205,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -22981,7 +21305,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestOneof2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("FOO")] Foo = 1, @@ -22989,7 +21312,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("BAZ")] Baz = 3, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -22999,23 +21321,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup() { OnConstruction(); } @@ -23023,7 +21341,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup(FooGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -23032,7 +21349,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup Clone() { return new FooGroup(this); } @@ -23043,7 +21359,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -23053,13 +21368,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -23070,7 +21383,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string B { get { return b_ ?? BDefaultValue; } set { @@ -23079,25 +21391,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return b_ != null; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { b_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -23111,7 +21419,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -23123,13 +21430,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -23150,7 +21455,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(72); @@ -23167,7 +21471,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -23183,7 +21486,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooGroup other) { if (other == null) { return; @@ -23198,7 +21500,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -23226,7 +21527,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -23251,7 +21551,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -23261,23 +21560,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -23285,7 +21580,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; quxInt_ = other.quxInt_; @@ -23294,7 +21588,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -23305,7 +21598,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long quxInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long QuxInt { get { if ((_hasBits0 & 1) != 0) { return quxInt_; } else { return QuxIntDefaultValue; } } set { @@ -23315,13 +21607,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "qux_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasQuxInt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "qux_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearQuxInt() { _hasBits0 &= ~1; } @@ -23332,19 +21622,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(16); private readonly pbc::RepeatedField corgeInt_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField CorgeInt { get { return corgeInt_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -23358,7 +21645,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasQuxInt) hash ^= QuxInt.GetHashCode(); @@ -23370,13 +21656,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -23394,7 +21678,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasQuxInt) { output.WriteRawTag(8); @@ -23408,7 +21691,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasQuxInt) { @@ -23422,7 +21704,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -23435,7 +21716,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -23462,7 +21742,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -23491,7 +21770,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRequiredOneof : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -23500,23 +21778,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[46]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredOneof() { OnConstruction(); } @@ -23524,7 +21798,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredOneof(TestRequiredOneof other) : this() { switch (other.FooCase) { case FooOneofCase.FooInt: @@ -23542,7 +21815,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredOneof Clone() { return new TestRequiredOneof(this); } @@ -23550,7 +21822,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { return HasFooInt ? (int) foo_ : 0; } set { @@ -23560,13 +21831,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return fooCase_ == FooOneofCase.FooInt; } } /// Clears the value of the oneof if it's currently set to "foo_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { if (HasFooInt) { ClearFoo(); @@ -23576,7 +21845,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return HasFooString ? (string) foo_ : ""; } set { @@ -23586,13 +21854,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooCase_ == FooOneofCase.FooString; } } /// Clears the value of the oneof if it's currently set to "foo_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { if (HasFooString) { ClearFoo(); @@ -23602,7 +21868,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage) foo_ : null; } set { @@ -23621,26 +21886,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredOneof); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredOneof other) { if (ReferenceEquals(other, null)) { return false; @@ -23656,7 +21917,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); @@ -23670,13 +21930,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -23701,7 +21959,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasFooInt) { output.WriteRawTag(8); @@ -23722,7 +21979,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -23741,7 +21997,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredOneof other) { if (other == null) { return; @@ -23765,7 +22020,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -23800,7 +22054,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -23833,9 +22086,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestRequiredOneof message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -23845,23 +22096,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -23869,7 +22116,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; requiredDouble_ = other.requiredDouble_; @@ -23877,7 +22123,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -23888,7 +22133,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double requiredDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double RequiredDouble { get { if ((_hasBits0 & 1) != 0) { return requiredDouble_; } else { return RequiredDoubleDefaultValue; } } set { @@ -23898,25 +22142,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "required_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasRequiredDouble { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "required_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearRequiredDouble() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -23929,7 +22169,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasRequiredDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(RequiredDouble); @@ -23940,13 +22179,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -23963,7 +22200,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasRequiredDouble) { output.WriteRawTag(9); @@ -23976,7 +22212,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasRequiredDouble) { @@ -23989,7 +22224,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -24001,7 +22235,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -24023,7 +22256,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -24047,7 +22279,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRequiredMap : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -24056,23 +22287,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[47]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMap() { OnConstruction(); } @@ -24080,14 +22307,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMap(TestRequiredMap other) : this() { foo_ = other.foo_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMap Clone() { return new TestRequiredMap(this); } @@ -24098,19 +22323,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestRequiredMap.Types.NestedMessage.Parser), 10); private readonly pbc::MapField foo_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Foo { get { return foo_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredMap other) { if (ReferenceEquals(other, null)) { return false; @@ -24123,7 +22345,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Foo.GetHashCode(); @@ -24134,13 +22355,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -24154,7 +22373,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { foo_.WriteTo(ref output, _map_foo_codec); if (_unknownFields != null) { @@ -24164,7 +22382,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += foo_.CalculateSize(_map_foo_codec); @@ -24175,17 +22392,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredMap other) { if (other == null) { return; } - foo_.MergeFrom(other.foo_); + foo_.Add(other.foo_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -24207,7 +22422,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -24227,9 +22441,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestRequiredMap message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -24239,23 +22451,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestRequiredMap.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -24263,7 +22471,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; requiredInt32_ = other.requiredInt32_; @@ -24271,7 +22478,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -24282,7 +22488,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int requiredInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int RequiredInt32 { get { if ((_hasBits0 & 1) != 0) { return requiredInt32_; } else { return RequiredInt32DefaultValue; } } set { @@ -24292,25 +22497,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "required_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasRequiredInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "required_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearRequiredInt32() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -24323,7 +22524,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasRequiredInt32) hash ^= RequiredInt32.GetHashCode(); @@ -24334,13 +22534,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -24357,7 +22555,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasRequiredInt32) { output.WriteRawTag(8); @@ -24370,7 +22567,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasRequiredInt32) { @@ -24383,7 +22579,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -24395,7 +22590,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -24417,7 +22611,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -24441,7 +22634,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestPackedTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -24450,23 +22642,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[48]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes() { OnConstruction(); } @@ -24474,7 +22662,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes(TestPackedTypes other) : this() { packedInt32_ = other.packedInt32_.Clone(); packedInt64_ = other.packedInt64_.Clone(); @@ -24494,7 +22681,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes Clone() { return new TestPackedTypes(this); } @@ -24505,7 +22691,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(722); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -24516,7 +22701,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(730); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -24527,7 +22711,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt32(738); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -24538,7 +22721,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(746); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -24549,7 +22731,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(754); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -24560,7 +22741,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt64(762); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -24571,7 +22751,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed32(770); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -24582,7 +22761,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed64(778); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -24593,7 +22771,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed32(786); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -24604,7 +22781,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed64(794); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -24615,7 +22791,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFloat(802); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -24626,7 +22801,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForDouble(810); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -24637,7 +22811,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBool(818); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -24648,19 +22821,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField packedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedEnum { get { return packedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestPackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestPackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -24686,7 +22856,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= packedInt32_.GetHashCode(); @@ -24710,13 +22879,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -24743,7 +22910,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { packedInt32_.WriteTo(ref output, _repeated_packedInt32_codec); packedInt64_.WriteTo(ref output, _repeated_packedInt64_codec); @@ -24766,7 +22932,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); @@ -24790,7 +22955,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestPackedTypes other) { if (other == null) { return; @@ -24813,7 +22977,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -24901,7 +23064,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -24990,7 +23152,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// A message with the same fields as TestPackedTypes, but without packing. Used /// to test packed <-> unpacked wire compatibility. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestUnpackedTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -24999,23 +23160,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[49]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes() { OnConstruction(); } @@ -25023,7 +23180,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes(TestUnpackedTypes other) : this() { unpackedInt32_ = other.unpackedInt32_.Clone(); unpackedInt64_ = other.unpackedInt64_.Clone(); @@ -25043,7 +23199,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes Clone() { return new TestUnpackedTypes(this); } @@ -25054,7 +23209,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(720); private readonly pbc::RepeatedField unpackedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -25065,7 +23219,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(728); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -25076,7 +23229,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt32(736); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -25087,7 +23239,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(744); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -25098,7 +23249,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(752); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -25109,7 +23259,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt64(760); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -25120,7 +23269,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed32(773); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -25131,7 +23279,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed64(777); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -25142,7 +23289,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed32(789); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -25153,7 +23299,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed64(793); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -25164,7 +23309,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFloat(805); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -25175,7 +23319,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForDouble(809); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -25186,7 +23329,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBool(816); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -25197,19 +23339,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField unpackedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedEnum { get { return unpackedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestUnpackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestUnpackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -25235,7 +23374,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= unpackedInt32_.GetHashCode(); @@ -25259,13 +23397,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -25292,7 +23428,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { unpackedInt32_.WriteTo(ref output, _repeated_unpackedInt32_codec); unpackedInt64_.WriteTo(ref output, _repeated_unpackedInt64_codec); @@ -25315,7 +23450,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); @@ -25339,7 +23473,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestUnpackedTypes other) { if (other == null) { return; @@ -25362,7 +23495,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -25450,7 +23582,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -25535,7 +23666,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestPackedExtensions : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -25546,23 +23676,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[50]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedExtensions() { OnConstruction(); } @@ -25570,26 +23696,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedExtensions(TestPackedExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedExtensions Clone() { return new TestPackedExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestPackedExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestPackedExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -25604,7 +23726,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -25617,13 +23738,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -25639,7 +23758,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_extensions != null) { _extensions.WriteTo(ref output); @@ -25651,7 +23769,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -25664,7 +23781,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestPackedExtensions other) { if (other == null) { return; @@ -25674,7 +23790,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -25694,7 +23809,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -25733,7 +23847,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestUnpackedExtensions : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -25744,23 +23857,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[51]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedExtensions() { OnConstruction(); } @@ -25768,26 +23877,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedExtensions(TestUnpackedExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedExtensions Clone() { return new TestUnpackedExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestUnpackedExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestUnpackedExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -25802,7 +23907,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -25815,13 +23919,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -25837,7 +23939,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_extensions != null) { _extensions.WriteTo(ref output); @@ -25849,7 +23950,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -25862,7 +23962,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestUnpackedExtensions other) { if (other == null) { return; @@ -25872,7 +23971,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -25892,7 +23990,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -25936,7 +24033,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// a set of extensions to TestAllExtensions dynamically, based on the fields /// of this message type. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestDynamicExtensions : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -25946,23 +24042,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[52]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDynamicExtensions() { OnConstruction(); } @@ -25970,7 +24062,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDynamicExtensions(TestDynamicExtensions other) : this() { _hasBits0 = other._hasBits0; scalarExtension_ = other.scalarExtension_; @@ -25984,7 +24075,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDynamicExtensions Clone() { return new TestDynamicExtensions(this); } @@ -25995,7 +24085,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint scalarExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint ScalarExtension { get { if ((_hasBits0 & 1) != 0) { return scalarExtension_; } else { return ScalarExtensionDefaultValue; } } set { @@ -26005,13 +24094,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "scalar_extension" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasScalarExtension { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "scalar_extension" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearScalarExtension() { _hasBits0 &= ~1; } @@ -26022,7 +24109,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum enumExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum EnumExtension { get { if ((_hasBits0 & 2) != 0) { return enumExtension_; } else { return EnumExtensionDefaultValue; } } set { @@ -26032,13 +24118,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "enum_extension" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnumExtension { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "enum_extension" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnumExtension() { _hasBits0 &= ~2; } @@ -26049,7 +24133,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicEnumType dynamicEnumExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { get { if ((_hasBits0 & 4) != 0) { return dynamicEnumExtension_; } else { return DynamicEnumExtensionDefaultValue; } } set { @@ -26059,13 +24142,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dynamic_enum_extension" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDynamicEnumExtension { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "dynamic_enum_extension" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDynamicEnumExtension() { _hasBits0 &= ~4; } @@ -26074,7 +24155,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int MessageExtensionFieldNumber = 2003; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage messageExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage MessageExtension { get { return messageExtension_; } set { @@ -26086,7 +24166,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int DynamicMessageExtensionFieldNumber = 2004; private global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType dynamicMessageExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { get { return dynamicMessageExtension_; } set { @@ -26100,7 +24179,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(16042); private readonly pbc::RepeatedField repeatedExtension_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedExtension { get { return repeatedExtension_; } } @@ -26111,19 +24189,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(16050); private readonly pbc::RepeatedField packedExtension_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedExtension { get { return packedExtension_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDynamicExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDynamicExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -26142,7 +24217,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasScalarExtension) hash ^= ScalarExtension.GetHashCode(); @@ -26159,13 +24233,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -26200,7 +24272,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasScalarExtension) { output.WriteRawTag(133, 125); @@ -26231,7 +24302,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasScalarExtension) { @@ -26258,7 +24328,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDynamicExtensions other) { if (other == null) { return; @@ -26290,7 +24359,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -26343,7 +24411,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -26394,7 +24461,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestDynamicExtensions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum DynamicEnumType { [pbr::OriginalName("DYNAMIC_FOO")] DynamicFoo = 2200, @@ -26402,7 +24468,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("DYNAMIC_BAZ")] DynamicBaz = 2202, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class DynamicMessageType : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -26412,23 +24477,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DynamicMessageType() { OnConstruction(); } @@ -26436,7 +24497,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DynamicMessageType(DynamicMessageType other) : this() { _hasBits0 = other._hasBits0; dynamicField_ = other.dynamicField_; @@ -26444,7 +24504,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DynamicMessageType Clone() { return new DynamicMessageType(this); } @@ -26455,7 +24514,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dynamicField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DynamicField { get { if ((_hasBits0 & 1) != 0) { return dynamicField_; } else { return DynamicFieldDefaultValue; } } set { @@ -26465,25 +24523,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dynamic_field" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDynamicField { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "dynamic_field" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDynamicField() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DynamicMessageType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DynamicMessageType other) { if (ReferenceEquals(other, null)) { return false; @@ -26496,7 +24550,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasDynamicField) hash ^= DynamicField.GetHashCode(); @@ -26507,13 +24560,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -26530,7 +24581,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasDynamicField) { output.WriteRawTag(160, 131, 1); @@ -26543,7 +24593,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasDynamicField) { @@ -26556,7 +24605,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DynamicMessageType other) { if (other == null) { return; @@ -26568,7 +24616,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -26590,7 +24637,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -26614,7 +24660,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -26623,23 +24668,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRepeatedScalarDifferentTagSizes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[53]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes() { OnConstruction(); } @@ -26647,7 +24688,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes(TestRepeatedScalarDifferentTagSizes other) : this() { repeatedFixed32_ = other.repeatedFixed32_.Clone(); repeatedInt32_ = other.repeatedInt32_.Clone(); @@ -26659,7 +24699,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes Clone() { return new TestRepeatedScalarDifferentTagSizes(this); } @@ -26675,7 +24714,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// in TestAllTypes didn't trigger the check. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -26689,7 +24727,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Check for a varint type, just for good measure. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -26703,7 +24740,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// These have two-byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -26714,7 +24750,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(16376); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -26728,7 +24763,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Three byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -26739,19 +24773,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(2097144); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRepeatedScalarDifferentTagSizes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRepeatedScalarDifferentTagSizes other) { if (ReferenceEquals(other, null)) { return false; @@ -26769,7 +24800,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= repeatedFixed32_.GetHashCode(); @@ -26785,13 +24815,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -26810,7 +24838,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); @@ -26825,7 +24852,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); @@ -26841,7 +24867,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRepeatedScalarDifferentTagSizes other) { if (other == null) { return; @@ -26856,7 +24881,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -26904,7 +24928,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -26953,7 +24976,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Test that if an optional or required message/group field appears multiple /// times in the input, they need to be merged. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestParsingMerge : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -26964,23 +24986,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[54]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestParsingMerge() { OnConstruction(); } @@ -26988,7 +25006,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestParsingMerge(TestParsingMerge other) : this() { requiredAllTypes_ = other.requiredAllTypes_ != null ? other.requiredAllTypes_.Clone() : null; optionalAllTypes_ = other.optionalAllTypes_ != null ? other.optionalAllTypes_.Clone() : null; @@ -27000,7 +25017,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestParsingMerge Clone() { return new TestParsingMerge(this); } @@ -27009,7 +25025,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int RequiredAllTypesFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes requiredAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes RequiredAllTypes { get { return requiredAllTypes_; } set { @@ -27021,7 +25036,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalAllTypesFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes optionalAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes OptionalAllTypes { get { return optionalAllTypes_; } set { @@ -27035,7 +25049,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField repeatedAllTypes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedAllTypes { get { return repeatedAllTypes_; } } @@ -27044,7 +25057,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupFieldNumber = 10; private global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -27053,13 +25065,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -27070,19 +25080,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(163, 164, global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedGroup.Parser); private readonly pbc::RepeatedField repeatedGroup_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedGroup { get { return repeatedGroup_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestParsingMerge); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestParsingMerge other) { if (ReferenceEquals(other, null)) { return false; @@ -27102,7 +25109,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (requiredAllTypes_ != null) hash ^= RequiredAllTypes.GetHashCode(); @@ -27120,13 +25126,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -27157,7 +25161,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (requiredAllTypes_ != null) { output.WriteRawTag(10); @@ -27184,7 +25187,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (requiredAllTypes_ != null) { @@ -27208,7 +25210,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestParsingMerge other) { if (other == null) { return; @@ -27238,7 +25239,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -27287,7 +25287,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -27356,7 +25355,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestParsingMerge message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// RepeatedFieldsGenerator defines matching field types as TestParsingMerge, @@ -27365,7 +25363,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Repeated fields in RepeatedFieldsGenerator are expected to be merged into /// the corresponding required/optional fields in TestParsingMerge. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class RepeatedFieldsGenerator : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -27374,23 +25371,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedFieldsGenerator()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedFieldsGenerator() { OnConstruction(); } @@ -27398,7 +25391,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedFieldsGenerator(RepeatedFieldsGenerator other) : this() { field1_ = other.field1_.Clone(); field2_ = other.field2_.Clone(); @@ -27411,7 +25403,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedFieldsGenerator Clone() { return new RepeatedFieldsGenerator(this); } @@ -27422,7 +25413,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField field1_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field1 { get { return field1_; } } @@ -27433,7 +25423,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField field2_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field2 { get { return field2_; } } @@ -27444,7 +25433,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField field3_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field3 { get { return field3_; } } @@ -27455,7 +25443,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(83, 84, global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Types.Group1.Parser); private readonly pbc::RepeatedField group1_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Group1 { get { return group1_; } } @@ -27466,7 +25453,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(163, 164, global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Types.Group2.Parser); private readonly pbc::RepeatedField group2_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Group2 { get { return group2_; } } @@ -27477,7 +25463,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(8002, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField ext1_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Ext1 { get { return ext1_; } } @@ -27488,19 +25473,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(8010, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField ext2_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Ext2 { get { return ext2_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedFieldsGenerator); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedFieldsGenerator other) { if (ReferenceEquals(other, null)) { return false; @@ -27519,7 +25501,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= field1_.GetHashCode(); @@ -27536,13 +25517,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -27562,7 +25541,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { field1_.WriteTo(ref output, _repeated_field1_codec); field2_.WriteTo(ref output, _repeated_field2_codec); @@ -27578,7 +25556,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += field1_.CalculateSize(_repeated_field1_codec); @@ -27595,7 +25572,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedFieldsGenerator other) { if (other == null) { return; @@ -27611,7 +25587,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -27657,7 +25632,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -27701,9 +25675,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the RepeatedFieldsGenerator message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Group1 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -27712,23 +25684,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Group1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group1() { OnConstruction(); } @@ -27736,14 +25704,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group1(Group1 other) : this() { field1_ = other.field1_ != null ? other.field1_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group1 Clone() { return new Group1(this); } @@ -27752,7 +25718,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int Field1FieldNumber = 11; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes field1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes Field1 { get { return field1_; } set { @@ -27761,13 +25726,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Group1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Group1 other) { if (ReferenceEquals(other, null)) { return false; @@ -27780,7 +25743,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (field1_ != null) hash ^= Field1.GetHashCode(); @@ -27791,13 +25753,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -27814,7 +25774,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (field1_ != null) { output.WriteRawTag(90); @@ -27827,7 +25786,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (field1_ != null) { @@ -27840,7 +25798,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Group1 other) { if (other == null) { return; @@ -27855,7 +25812,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -27882,7 +25838,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -27906,7 +25861,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Group2 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -27915,23 +25869,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Group2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group2() { OnConstruction(); } @@ -27939,14 +25889,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group2(Group2 other) : this() { field1_ = other.field1_ != null ? other.field1_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group2 Clone() { return new Group2(this); } @@ -27955,7 +25903,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int Field1FieldNumber = 21; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes field1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes Field1 { get { return field1_; } set { @@ -27964,13 +25911,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Group2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Group2 other) { if (ReferenceEquals(other, null)) { return false; @@ -27983,7 +25928,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (field1_ != null) hash ^= Field1.GetHashCode(); @@ -27994,13 +25938,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -28017,7 +25959,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (field1_ != null) { output.WriteRawTag(170, 1); @@ -28030,7 +25971,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (field1_ != null) { @@ -28043,7 +25983,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Group2 other) { if (other == null) { return; @@ -28058,7 +25997,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -28085,7 +26023,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -28114,7 +26051,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OptionalGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -28123,23 +26059,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -28147,14 +26079,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { optionalGroupAllTypes_ = other.optionalGroupAllTypes_ != null ? other.optionalGroupAllTypes_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -28163,7 +26093,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupAllTypesFieldNumber = 11; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes optionalGroupAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes OptionalGroupAllTypes { get { return optionalGroupAllTypes_; } set { @@ -28172,13 +26101,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -28191,7 +26118,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (optionalGroupAllTypes_ != null) hash ^= OptionalGroupAllTypes.GetHashCode(); @@ -28202,13 +26128,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -28225,7 +26149,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (optionalGroupAllTypes_ != null) { output.WriteRawTag(90); @@ -28238,7 +26161,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (optionalGroupAllTypes_ != null) { @@ -28251,7 +26173,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -28266,7 +26187,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -28293,7 +26213,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -28317,7 +26236,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class RepeatedGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -28326,23 +26244,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Descriptor.NestedTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup() { OnConstruction(); } @@ -28350,14 +26264,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup(RepeatedGroup other) : this() { repeatedGroupAllTypes_ = other.repeatedGroupAllTypes_ != null ? other.repeatedGroupAllTypes_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup Clone() { return new RepeatedGroup(this); } @@ -28366,7 +26278,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int RepeatedGroupAllTypesFieldNumber = 21; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes repeatedGroupAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes RepeatedGroupAllTypes { get { return repeatedGroupAllTypes_; } set { @@ -28375,13 +26286,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -28394,7 +26303,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (repeatedGroupAllTypes_ != null) hash ^= RepeatedGroupAllTypes.GetHashCode(); @@ -28405,13 +26313,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -28428,7 +26334,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (repeatedGroupAllTypes_ != null) { output.WriteRawTag(170, 1); @@ -28441,7 +26346,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (repeatedGroupAllTypes_ != null) { @@ -28454,7 +26358,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedGroup other) { if (other == null) { return; @@ -28469,7 +26372,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -28496,7 +26398,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -28526,7 +26427,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestParsingMerge message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension OptionalExt = new pb::Extension(1000, pb::FieldCodec.ForMessage(8002, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser)); @@ -28537,7 +26437,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestCommentInjectionMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -28546,23 +26445,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCommentInjectionMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[55]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage() { OnConstruction(); } @@ -28570,14 +26465,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage(TestCommentInjectionMessage other) : this() { a_ = other.a_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage Clone() { return new TestCommentInjectionMessage(this); } @@ -28591,7 +26484,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// */ <- This should not close the generated doc comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string A { get { return a_ ?? ADefaultValue; } set { @@ -28600,25 +26492,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return a_ != null; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { a_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCommentInjectionMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCommentInjectionMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -28631,7 +26519,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -28642,13 +26529,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -28665,7 +26550,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasA) { output.WriteRawTag(10); @@ -28678,7 +26562,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -28691,7 +26574,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCommentInjectionMessage other) { if (other == null) { return; @@ -28703,7 +26585,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -28725,7 +26606,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -28747,7 +26627,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test that RPC services work. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -28756,23 +26635,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[56]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest() { OnConstruction(); } @@ -28780,25 +26655,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest(FooRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest Clone() { return new FooRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -28810,7 +26681,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -28820,13 +26690,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -28839,7 +26707,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -28848,7 +26715,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -28858,7 +26724,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooRequest other) { if (other == null) { return; @@ -28867,7 +26732,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -28885,7 +26749,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -28900,7 +26763,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -28909,23 +26771,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[57]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse() { OnConstruction(); } @@ -28933,25 +26791,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse(FooResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse Clone() { return new FooResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -28963,7 +26817,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -28973,13 +26826,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -28992,7 +26843,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -29001,7 +26851,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -29011,7 +26860,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooResponse other) { if (other == null) { return; @@ -29020,7 +26868,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -29038,7 +26885,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -29053,7 +26899,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooClientMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -29062,23 +26907,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[58]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage() { OnConstruction(); } @@ -29086,25 +26927,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage(FooClientMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage Clone() { return new FooClientMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooClientMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -29116,7 +26953,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -29126,13 +26962,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -29145,7 +26979,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -29154,7 +26987,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -29164,7 +26996,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooClientMessage other) { if (other == null) { return; @@ -29173,7 +27004,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -29191,7 +27021,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -29206,7 +27035,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooServerMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -29215,23 +27043,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[59]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage() { OnConstruction(); } @@ -29239,25 +27063,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage(FooServerMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage Clone() { return new FooServerMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooServerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -29269,7 +27089,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -29279,13 +27098,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -29298,7 +27115,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -29307,7 +27123,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -29317,7 +27132,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooServerMessage other) { if (other == null) { return; @@ -29326,7 +27140,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -29344,7 +27157,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -29359,7 +27171,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class BarRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -29368,23 +27179,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[60]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest() { OnConstruction(); } @@ -29392,25 +27199,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest(BarRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest Clone() { return new BarRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -29422,7 +27225,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -29432,13 +27234,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -29451,7 +27251,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -29460,7 +27259,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -29470,7 +27268,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarRequest other) { if (other == null) { return; @@ -29479,7 +27276,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -29497,7 +27293,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -29512,7 +27307,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class BarResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -29521,23 +27315,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[61]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse() { OnConstruction(); } @@ -29545,25 +27335,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse(BarResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse Clone() { return new BarResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -29575,7 +27361,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -29585,13 +27370,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -29604,7 +27387,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -29613,7 +27395,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -29623,7 +27404,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarResponse other) { if (other == null) { return; @@ -29632,7 +27412,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -29650,7 +27429,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -29665,7 +27443,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestJsonName : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -29675,23 +27452,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[62]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName() { OnConstruction(); } @@ -29699,7 +27472,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName(TestJsonName other) : this() { _hasBits0 = other._hasBits0; fieldName1_ = other.fieldName1_; @@ -29712,7 +27484,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName Clone() { return new TestJsonName(this); } @@ -29723,7 +27494,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName1 { get { if ((_hasBits0 & 1) != 0) { return fieldName1_; } else { return FieldName1DefaultValue; } } set { @@ -29733,13 +27503,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field_name1" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName1 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "field_name1" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName1() { _hasBits0 &= ~1; } @@ -29750,7 +27518,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName2 { get { if ((_hasBits0 & 2) != 0) { return fieldName2_; } else { return FieldName2DefaultValue; } } set { @@ -29760,13 +27527,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "fieldName2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName2 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "fieldName2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName2() { _hasBits0 &= ~2; } @@ -29777,7 +27542,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName3 { get { if ((_hasBits0 & 4) != 0) { return fieldName3_; } else { return FieldName3DefaultValue; } } set { @@ -29787,13 +27551,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "FieldName3" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName3 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "FieldName3" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName3() { _hasBits0 &= ~4; } @@ -29804,7 +27566,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int FieldName4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName4 { get { if ((_hasBits0 & 8) != 0) { return FieldName4_; } else { return FieldName4DefaultValue; } } set { @@ -29814,13 +27575,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "_field_name4" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName4 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "_field_name4" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName4() { _hasBits0 &= ~8; } @@ -29831,7 +27590,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fIELDNAME5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDNAME5 { get { if ((_hasBits0 & 16) != 0) { return fIELDNAME5_; } else { return FIELDNAME5DefaultValue; } } set { @@ -29841,13 +27599,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "FIELD_NAME5" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFIELDNAME5 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "FIELD_NAME5" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFIELDNAME5() { _hasBits0 &= ~16; } @@ -29858,7 +27614,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName6 { get { if ((_hasBits0 & 32) != 0) { return fieldName6_; } else { return FieldName6DefaultValue; } } set { @@ -29868,25 +27623,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field_name6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName6 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "field_name6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName6() { _hasBits0 &= ~32; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestJsonName); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestJsonName other) { if (ReferenceEquals(other, null)) { return false; @@ -29904,7 +27655,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFieldName1) hash ^= FieldName1.GetHashCode(); @@ -29920,13 +27670,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -29963,7 +27711,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasFieldName1) { output.WriteRawTag(8); @@ -29996,7 +27743,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFieldName1) { @@ -30024,7 +27770,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestJsonName other) { if (other == null) { return; @@ -30051,7 +27796,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -30093,7 +27837,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -30132,7 +27875,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestHugeFieldNumbers : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -30144,23 +27886,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[63]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestHugeFieldNumbers() { OnConstruction(); } @@ -30168,7 +27906,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestHugeFieldNumbers(TestHugeFieldNumbers other) : this() { _hasBits0 = other._hasBits0; optionalInt32_ = other.optionalInt32_; @@ -30201,7 +27938,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestHugeFieldNumbers Clone() { return new TestHugeFieldNumbers(this); } @@ -30212,7 +27948,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -30222,13 +27957,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -30239,7 +27972,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fixed32 { get { if ((_hasBits0 & 2) != 0) { return fixed32_; } else { return Fixed32DefaultValue; } } set { @@ -30249,13 +27981,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "fixed_32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFixed32 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "fixed_32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFixed32() { _hasBits0 &= ~2; } @@ -30266,7 +27996,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(4294960016); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -30277,7 +28006,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(4294960026); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -30288,7 +28016,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum optionalEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum OptionalEnum { get { if ((_hasBits0 & 4) != 0) { return optionalEnum_; } else { return OptionalEnumDefaultValue; } } set { @@ -30298,13 +28025,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalEnum { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "optional_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalEnum() { _hasBits0 &= ~4; } @@ -30315,7 +28040,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -30324,13 +28048,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -30341,7 +28063,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString optionalBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_ ?? OptionalBytesDefaultValue; } set { @@ -30350,13 +28071,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBytes { get { return optionalBytes_ != null; } } /// Clears the value of the "optional_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBytes() { optionalBytes_ = null; } @@ -30365,7 +28084,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalMessageFieldNumber = 536870007; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage optionalMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage OptionalMessage { get { return optionalMessage_; } set { @@ -30377,7 +28095,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupFieldNumber = 536870008; private global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -30386,13 +28103,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -30403,7 +28118,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 4294960082); private readonly pbc::MapField stringStringMap_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField StringStringMap { get { return stringStringMap_; } } @@ -30411,7 +28125,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 536870011; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return HasOneofUint32 ? (uint) oneofField_ : 0; } set { @@ -30421,13 +28134,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } } /// Clears the value of the oneof if it's currently set to "oneof_uint32" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint32() { if (HasOneofUint32) { ClearOneofField(); @@ -30437,7 +28148,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_test_all_types" field. public const int OneofTestAllTypesFieldNumber = 536870012; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes OneofTestAllTypes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes) oneofField_ : null; } set { @@ -30449,7 +28159,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 536870013; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return HasOneofString ? (string) oneofField_ : ""; } set { @@ -30459,13 +28168,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } } /// Clears the value of the oneof if it's currently set to "oneof_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofString() { if (HasOneofString) { ClearOneofField(); @@ -30475,7 +28182,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 536870014; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -30485,13 +28191,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } } /// Clears the value of the oneof if it's currently set to "oneof_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBytes() { if (HasOneofBytes) { ClearOneofField(); @@ -30509,26 +28213,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestHugeFieldNumbers); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestHugeFieldNumbers other) { if (ReferenceEquals(other, null)) { return false; @@ -30558,7 +28258,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -30586,13 +28285,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -30656,7 +28353,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasOptionalInt32) { output.WriteRawTag(128, 199, 255, 255, 15); @@ -30716,7 +28412,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -30765,7 +28460,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestHugeFieldNumbers other) { if (other == null) { return; @@ -30799,7 +28493,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } OptionalGroup.MergeFrom(other.OptionalGroup); } - stringStringMap_.MergeFrom(other.stringStringMap_); + stringStringMap_.Add(other.stringStringMap_); switch (other.OneofFieldCase) { case OneofFieldOneofCase.OneofUint32: OneofUint32 = other.OneofUint32; @@ -30823,7 +28517,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -30912,7 +28605,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -31021,9 +28713,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestHugeFieldNumbers message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OptionalGroup : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -31033,23 +28723,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -31057,7 +28743,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; groupA_ = other.groupA_; @@ -31065,7 +28750,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -31076,7 +28760,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int groupA_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int GroupA { get { if ((_hasBits0 & 1) != 0) { return groupA_; } else { return GroupADefaultValue; } } set { @@ -31086,25 +28769,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "group_a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasGroupA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "group_a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearGroupA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -31117,7 +28796,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasGroupA) hash ^= GroupA.GetHashCode(); @@ -31128,13 +28806,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -31151,7 +28827,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasGroupA) { output.WriteRawTag(200, 199, 255, 255, 15); @@ -31164,7 +28839,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasGroupA) { @@ -31177,7 +28851,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -31189,7 +28862,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -31213,7 +28885,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -31239,7 +28910,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestExtensionInsideTable : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -31251,23 +28921,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[64]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionInsideTable() { OnConstruction(); } @@ -31275,7 +28941,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionInsideTable(TestExtensionInsideTable other) : this() { _hasBits0 = other._hasBits0; field1_ = other.field1_; @@ -31292,7 +28957,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionInsideTable Clone() { return new TestExtensionInsideTable(this); } @@ -31303,7 +28967,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field1 { get { if ((_hasBits0 & 1) != 0) { return field1_; } else { return Field1DefaultValue; } } set { @@ -31313,13 +28976,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field1" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField1 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "field1" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField1() { _hasBits0 &= ~1; } @@ -31330,7 +28991,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field2 { get { if ((_hasBits0 & 2) != 0) { return field2_; } else { return Field2DefaultValue; } } set { @@ -31340,13 +29000,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField2 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "field2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField2() { _hasBits0 &= ~2; } @@ -31357,7 +29015,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field3 { get { if ((_hasBits0 & 4) != 0) { return field3_; } else { return Field3DefaultValue; } } set { @@ -31367,13 +29024,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field3" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField3 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "field3" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField3() { _hasBits0 &= ~4; } @@ -31384,7 +29039,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field4 { get { if ((_hasBits0 & 8) != 0) { return field4_; } else { return Field4DefaultValue; } } set { @@ -31394,13 +29048,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field4" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField4 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "field4" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField4() { _hasBits0 &= ~8; } @@ -31411,7 +29063,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field6 { get { if ((_hasBits0 & 16) != 0) { return field6_; } else { return Field6DefaultValue; } } set { @@ -31421,13 +29072,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField6 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "field6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField6() { _hasBits0 &= ~16; } @@ -31438,7 +29087,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field7 { get { if ((_hasBits0 & 32) != 0) { return field7_; } else { return Field7DefaultValue; } } set { @@ -31448,13 +29096,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field7" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField7 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "field7" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField7() { _hasBits0 &= ~32; } @@ -31465,7 +29111,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field8 { get { if ((_hasBits0 & 64) != 0) { return field8_; } else { return Field8DefaultValue; } } set { @@ -31475,13 +29120,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field8" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField8 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "field8" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField8() { _hasBits0 &= ~64; } @@ -31492,7 +29135,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field9 { get { if ((_hasBits0 & 128) != 0) { return field9_; } else { return Field9DefaultValue; } } set { @@ -31502,13 +29144,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field9" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField9 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "field9" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField9() { _hasBits0 &= ~128; } @@ -31519,7 +29159,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field10 { get { if ((_hasBits0 & 256) != 0) { return field10_; } else { return Field10DefaultValue; } } set { @@ -31529,25 +29168,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field10" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField10 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "field10" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField10() { _hasBits0 &= ~256; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionInsideTable); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionInsideTable other) { if (ReferenceEquals(other, null)) { return false; @@ -31571,7 +29206,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasField1) hash ^= Field1.GetHashCode(); @@ -31593,13 +29227,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -31651,7 +29283,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasField1) { output.WriteRawTag(8); @@ -31699,7 +29330,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasField1) { @@ -31739,7 +29369,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionInsideTable other) { if (other == null) { return; @@ -31776,7 +29405,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -31832,7 +29460,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs similarity index 79% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs index 093aba3d0b9062f5b932154bfe8985db41d6685b..84a4a7eda20e3952bead5efb250f304174261dcd 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_custom_options_proto3.proto +// source: unittest_custom_options_proto3.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace UnitTest.Issues.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_custom_options_proto3.proto + /// Holder for reflection information generated from unittest_custom_options_proto3.proto public static partial class UnittestCustomOptionsProto3Reflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_custom_options_proto3.proto + /// File descriptor for unittest_custom_options_proto3.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,118 +24,119 @@ namespace UnitTest.Issues.TestProtos { static UnittestCustomOptionsProto3Reflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CjJjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2N1c3RvbV9vcHRpb25zX3Byb3Rv", - "My5wcm90bxIRcHJvdG9idWZfdW5pdHRlc3QaIGdvb2dsZS9wcm90b2J1Zi9k", - "ZXNjcmlwdG9yLnByb3RvItcBChxUZXN0TWVzc2FnZVdpdGhDdXN0b21PcHRp", - "b25zEh4KBmZpZWxkMRgBIAEoCUIOCAHB4MMdLeF1CgIAAAASFQoLb25lb2Zf", - "ZmllbGQYAiABKAVIACJTCgZBbkVudW0SFgoSQU5FTlVNX1VOU1BFQ0lGSUVE", - "EAASDwoLQU5FTlVNX1ZBTDEQARIWCgtBTkVOVU1fVkFMMhACGgWwhvoFexoI", - "xfbJHev8//86EAgA4OnCHcj//////////wFCGQoHQW5PbmVvZhIO+KzDHZ3/", - "/////////wEiGAoWQ3VzdG9tT3B0aW9uRm9vUmVxdWVzdCIZChdDdXN0b21P", - "cHRpb25Gb29SZXNwb25zZSIeChxDdXN0b21PcHRpb25Gb29DbGllbnRNZXNz", - "YWdlIh4KHEN1c3RvbU9wdGlvbkZvb1NlcnZlck1lc3NhZ2UijwEKGkR1bW15", - "TWVzc2FnZUNvbnRhaW5pbmdFbnVtInEKDFRlc3RFbnVtVHlwZRIgChxURVNU", - "X09QVElPTl9FTlVNX1VOU1BFQ0lGSUVEEAASGgoWVEVTVF9PUFRJT05fRU5V", - "TV9UWVBFMRAWEiMKFlRFU1RfT1BUSU9OX0VOVU1fVFlQRTIQ6f//////////", - "ASIhCh9EdW1teU1lc3NhZ2VJbnZhbGlkQXNPcHRpb25UeXBlIooBChxDdXN0", - "b21PcHRpb25NaW5JbnRlZ2VyVmFsdWVzOmqZ1qgdAAAAAAAAAICtja8dAAAA", - "gJHurx0AAAAAAAAAAJ31rx0AAAAA+JewHf///////////wGAxLAd/////w/4", - "9bAdAICTsh0AsLyyHYCAgICAgICAgAHoxrIdgICAgPj/////AdDesh0AIpEB", - "ChxDdXN0b21PcHRpb25NYXhJbnRlZ2VyVmFsdWVzOnGZ1qgd/////////3+t", - "ja8d////f5Hurx3//////////531rx3/////+JewHf7//////////wGAxLAd", - "/v///w/49bAd////////////AYCTsh3/////D7C8sh3//////////3/oxrId", - "/////wfQ3rIdASJuChdDdXN0b21PcHRpb25PdGhlclZhbHVlczpTiNmiHen/", - "/////////wGy2aIdC0hlbGxvAFdvcmxkqtyiHQ5IZWxsbywgIldvcmxkIunc", - "oh37WYxCysDzP/Xfox3nh0VB6MayHZz//////////wEiNAocU2V0dGluZ1Jl", - "YWxzRnJvbVBvc2l0aXZlSW50czoU6dyiHQAAAAAAQGNA9d+jHQAAQEEiNAoc", - "U2V0dGluZ1JlYWxzRnJvbU5lZ2F0aXZlSW50czoU6dyiHQAAAAAAQGPA9d+j", - "HQAAQMEiSwoSQ29tcGxleE9wdGlvblR5cGUxEgsKA2ZvbxgBIAEoBRIMCgRm", - "b28yGAIgASgFEgwKBGZvbzMYAyABKAUSDAoEZm9vNBgEIAMoBSKBAwoSQ29t", - "cGxleE9wdGlvblR5cGUyEjIKA2JhchgBIAEoCzIlLnByb3RvYnVmX3VuaXR0", - "ZXN0LkNvbXBsZXhPcHRpb25UeXBlMRILCgNiYXoYAiABKAUSRgoEZnJlZBgD", - "IAEoCzI4LnByb3RvYnVmX3VuaXR0ZXN0LkNvbXBsZXhPcHRpb25UeXBlMi5D", - "b21wbGV4T3B0aW9uVHlwZTQSSAoGYmFybmV5GAQgAygLMjgucHJvdG9idWZf", - "dW5pdHRlc3QuQ29tcGxleE9wdGlvblR5cGUyLkNvbXBsZXhPcHRpb25UeXBl", - "NBqXAQoSQ29tcGxleE9wdGlvblR5cGU0Eg0KBXdhbGRvGAEgASgFMnIKDGNv", - "bXBsZXhfb3B0NBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxiK", - "9dEDIAEoCzI4LnByb3RvYnVmX3VuaXR0ZXN0LkNvbXBsZXhPcHRpb25UeXBl", - "Mi5Db21wbGV4T3B0aW9uVHlwZTQiIQoSQ29tcGxleE9wdGlvblR5cGUzEgsK", - "A3F1eBgBIAEoBSJOChVWYXJpb3VzQ29tcGxleE9wdGlvbnM6NdKojx0DCLMP", - "+t6QHQIICar9kB0WCgMI5wUQ2wcaAwjBAiICCGUiAwjUAaLilR0GCCoiAmNY", - "IkwKCUFnZ3JlZ2F0ZRIJCgFpGAEgASgFEgkKAXMYAiABKAkSKQoDc3ViGAMg", - "ASgLMhwucHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlIlkKEEFnZ3JlZ2F0", - "ZU1lc3NhZ2USKQoJZmllbGRuYW1lGAEgASgFQhbyoYc7ERIPRmllbGRBbm5v", - "dGF0aW9uOhrC0YY7FQhlEhFNZXNzYWdlQW5ub3RhdGlvbiKXAQoQTmVzdGVk", - "T3B0aW9uVHlwZRo7Cg1OZXN0ZWRNZXNzYWdlEiIKDG5lc3RlZF9maWVsZBgB", - "IAEoBUIMweDDHeoDAAAAAAAAOgbg6cId6QciRgoKTmVzdGVkRW51bRIPCgtV", - "TlNQRUNJRklFRBAAEh0KEU5FU1RFRF9FTlVNX1ZBTFVFEAEaBrCG+gXsBxoI", - "xfbJHesDAAAqUgoKTWV0aG9kT3B0MRIaChZNRVRIT0RPUFQxX1VOU1BFQ0lG", - "SUVEEAASEwoPTUVUSE9ET1BUMV9WQUwxEAESEwoPTUVUSE9ET1BUMV9WQUwy", - "EAIqXgoNQWdncmVnYXRlRW51bRIPCgtVTlNQRUNJRklFRBAAEiUKBVZBTFVF", - "EAEaGsr8iTsVEhNFbnVtVmFsdWVBbm5vdGF0aW9uGhWSlYg7EBIORW51bUFu", - "bm90YXRpb24yjgEKHFRlc3RTZXJ2aWNlV2l0aEN1c3RvbU9wdGlvbnMSYwoD", - "Rm9vEikucHJvdG9idWZfdW5pdHRlc3QuQ3VzdG9tT3B0aW9uRm9vUmVxdWVz", - "dBoqLnByb3RvYnVmX3VuaXR0ZXN0LkN1c3RvbU9wdGlvbkZvb1Jlc3BvbnNl", - "IgXg+oweAhoJkLKLHtPbgMtJMpkBChBBZ2dyZWdhdGVTZXJ2aWNlEmsKBk1l", - "dGhvZBIjLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3JlZ2F0ZU1lc3NhZ2UaIy5w", - "cm90b2J1Zl91bml0dGVzdC5BZ2dyZWdhdGVNZXNzYWdlIhfKyJY7EhIQTWV0", - "aG9kQW5ub3RhdGlvbhoYyvuOOxMSEVNlcnZpY2VBbm5vdGF0aW9uOjIKCWZp", - "bGVfb3B0MRIcLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxiOndgDIAEo", - "BDo4CgxtZXNzYWdlX29wdDESHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9w", - "dGlvbnMYnK3YAyABKAU6NAoKZmllbGRfb3B0MRIdLmdvb2dsZS5wcm90b2J1", - "Zi5GaWVsZE9wdGlvbnMYiLzYAyABKAY6NAoKb25lb2Zfb3B0MRIdLmdvb2ds", - "ZS5wcm90b2J1Zi5PbmVvZk9wdGlvbnMYz7XYAyABKAU6MgoJZW51bV9vcHQx", - "EhwuZ29vZ2xlLnByb3RvYnVmLkVudW1PcHRpb25zGOie2QMgASgPOjwKD2Vu", - "dW1fdmFsdWVfb3B0MRIhLmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVPcHRp", - "b25zGOagXyABKAU6OAoMc2VydmljZV9vcHQxEh8uZ29vZ2xlLnByb3RvYnVm", - "LlNlcnZpY2VPcHRpb25zGKK24QMgASgSOlUKC21ldGhvZF9vcHQxEh4uZ29v", - "Z2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYrM/hAyABKA4yHS5wcm90b2J1", - "Zl91bml0dGVzdC5NZXRob2RPcHQxOjQKCGJvb2xfb3B0Eh8uZ29vZ2xlLnBy", - "b3RvYnVmLk1lc3NhZ2VPcHRpb25zGOqr1gMgASgIOjUKCWludDMyX29wdBIf", - "Lmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjtqNYDIAEoBTo1Cglp", - "bnQ2NF9vcHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYxqfW", - "AyABKAM6NgoKdWludDMyX29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdl", - "T3B0aW9ucxiwotYDIAEoDTo2Cgp1aW50NjRfb3B0Eh8uZ29vZ2xlLnByb3Rv", - "YnVmLk1lc3NhZ2VPcHRpb25zGN+O1gMgASgEOjYKCnNpbnQzMl9vcHQSHy5n", - "b29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYwIjWAyABKBE6NgoKc2lu", - "dDY0X29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxj/gtYD", - "IAEoEjo3CgtmaXhlZDMyX29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdl", - "T3B0aW9ucxjT/tUDIAEoBzo3CgtmaXhlZDY0X29wdBIfLmdvb2dsZS5wcm90", - "b2J1Zi5NZXNzYWdlT3B0aW9ucxji/dUDIAEoBjo4CgxzZml4ZWQzMl9vcHQS", - "Hy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY1fHVAyABKA86OAoM", - "c2ZpeGVkNjRfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25z", - "GOOK1QMgASgQOjUKCWZsb2F0X29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNz", - "YWdlT3B0aW9ucxj+u9QDIAEoAjo2Cgpkb3VibGVfb3B0Eh8uZ29vZ2xlLnBy", - "b3RvYnVmLk1lc3NhZ2VPcHRpb25zGM2r1AMgASgBOjYKCnN0cmluZ19vcHQS", - "Hy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYxavUAyABKAk6NQoJ", - "Ynl0ZXNfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGJar", - "1AMgASgMOnAKCGVudW1fb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VP", - "cHRpb25zGJGr1AMgASgOMjoucHJvdG9idWZfdW5pdHRlc3QuRHVtbXlNZXNz", - "YWdlQ29udGFpbmluZ0VudW0uVGVzdEVudW1UeXBlOnAKEG1lc3NhZ2VfdHlw", - "ZV9vcHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYr/LTAyAB", - "KAsyMi5wcm90b2J1Zl91bml0dGVzdC5EdW1teU1lc3NhZ2VJbnZhbGlkQXNP", - "cHRpb25UeXBlOl8KDGNvbXBsZXhfb3B0MRIfLmdvb2dsZS5wcm90b2J1Zi5N", - "ZXNzYWdlT3B0aW9ucxik3NIDIAEoCzIlLnByb3RvYnVmX3VuaXR0ZXN0LkNv", - "bXBsZXhPcHRpb25UeXBlMTpfCgxjb21wbGV4X29wdDISHy5nb29nbGUucHJv", - "dG9idWYuTWVzc2FnZU9wdGlvbnMY1Y/SAyABKAsyJS5wcm90b2J1Zl91bml0", - "dGVzdC5Db21wbGV4T3B0aW9uVHlwZTI6XwoMY29tcGxleF9vcHQzEh8uZ29v", - "Z2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGO+L0gMgASgLMiUucHJvdG9i", - "dWZfdW5pdHRlc3QuQ29tcGxleE9wdGlvblR5cGUzOk4KB2ZpbGVvcHQSHC5n", - "b29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMYz92wByABKAsyHC5wcm90b2J1", - "Zl91bml0dGVzdC5BZ2dyZWdhdGU6UAoGbXNnb3B0Eh8uZ29vZ2xlLnByb3Rv", - "YnVmLk1lc3NhZ2VPcHRpb25zGJjqsAcgASgLMhwucHJvdG9idWZfdW5pdHRl", - "c3QuQWdncmVnYXRlOlAKCGZpZWxkb3B0Eh0uZ29vZ2xlLnByb3RvYnVmLkZp", - "ZWxkT3B0aW9ucxie9LAHIAEoCzIcLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3Jl", - "Z2F0ZTpOCgdlbnVtb3B0EhwuZ29vZ2xlLnByb3RvYnVmLkVudW1PcHRpb25z", - "GNKCsQcgASgLMhwucHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlOlYKCmVu", - "dW12YWxvcHQSIS5nb29nbGUucHJvdG9idWYuRW51bVZhbHVlT3B0aW9ucxjJ", - "n7EHIAEoCzIcLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3JlZ2F0ZTpUCgpzZXJ2", - "aWNlb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLlNlcnZpY2VPcHRpb25zGLnvsQcg", - "ASgLMhwucHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlOlIKCW1ldGhvZG9w", - "dBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGInpsgcgASgLMhwu", - "cHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlQlWqAhpVbml0VGVzdC5Jc3N1", - "ZXMuVGVzdFByb3Rvc/DowR3qrcDlJPrshTsqCGQSDkZpbGVBbm5vdGF0aW9u", - "GhYSFE5lc3RlZEZpbGVBbm5vdGF0aW9uYgZwcm90bzM=")); + "CiR1bml0dGVzdF9jdXN0b21fb3B0aW9uc19wcm90bzMucHJvdG8SEXByb3Rv", + "YnVmX3VuaXR0ZXN0GiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90", + "byLXAQocVGVzdE1lc3NhZ2VXaXRoQ3VzdG9tT3B0aW9ucxIeCgZmaWVsZDEY", + "ASABKAlCDggBweDDHS3hdQoCAAAAEhUKC29uZW9mX2ZpZWxkGAIgASgFSAAi", + "UwoGQW5FbnVtEhYKEkFORU5VTV9VTlNQRUNJRklFRBAAEg8KC0FORU5VTV9W", + "QUwxEAESFgoLQU5FTlVNX1ZBTDIQAhoFsIb6BXsaCMX2yR3r/P//OhAIAODp", + "wh3I//////////8BQhkKB0FuT25lb2YSDviswx2d//////////8BIhgKFkN1", + "c3RvbU9wdGlvbkZvb1JlcXVlc3QiGQoXQ3VzdG9tT3B0aW9uRm9vUmVzcG9u", + "c2UiHgocQ3VzdG9tT3B0aW9uRm9vQ2xpZW50TWVzc2FnZSIeChxDdXN0b21P", + "cHRpb25Gb29TZXJ2ZXJNZXNzYWdlIo8BChpEdW1teU1lc3NhZ2VDb250YWlu", + "aW5nRW51bSJxCgxUZXN0RW51bVR5cGUSIAocVEVTVF9PUFRJT05fRU5VTV9V", + "TlNQRUNJRklFRBAAEhoKFlRFU1RfT1BUSU9OX0VOVU1fVFlQRTEQFhIjChZU", + "RVNUX09QVElPTl9FTlVNX1RZUEUyEOn//////////wEiIQofRHVtbXlNZXNz", + "YWdlSW52YWxpZEFzT3B0aW9uVHlwZSKKAQocQ3VzdG9tT3B0aW9uTWluSW50", + "ZWdlclZhbHVlczpq0N6yHQDoxrIdgICAgPj/////AbC8sh2AgICAgICAgIAB", + "gJOyHQD49bAdAIDEsB3/////D/iXsB3///////////8BnfWvHQAAAACR7q8d", + "AAAAAAAAAACtja8dAAAAgJnWqB0AAAAAAAAAgCKRAQocQ3VzdG9tT3B0aW9u", + "TWF4SW50ZWdlclZhbHVlczpx0N6yHQHoxrId/////wewvLId//////////9/", + "gJOyHf////8P+PWwHf///////////wGAxLAd/v///w/4l7Ad/v//////////", + "AZ31rx3/////ke6vHf//////////rY2vHf///3+Z1qgd/////////38ibgoX", + "Q3VzdG9tT3B0aW9uT3RoZXJWYWx1ZXM6U+jGsh2c//////////8B9d+jHeeH", + "RUHp3KId+1mMQsrA8z+q3KIdDkhlbGxvLCAiV29ybGQistmiHQtIZWxsbwBX", + "b3JsZIjZoh3p//////////8BIjQKHFNldHRpbmdSZWFsc0Zyb21Qb3NpdGl2", + "ZUludHM6FPXfox0AAEBB6dyiHQAAAAAAQGNAIjQKHFNldHRpbmdSZWFsc0Zy", + "b21OZWdhdGl2ZUludHM6FPXfox0AAEDB6dyiHQAAAAAAQGPAIksKEkNvbXBs", + "ZXhPcHRpb25UeXBlMRILCgNmb28YASABKAUSDAoEZm9vMhgCIAEoBRIMCgRm", + "b28zGAMgASgFEgwKBGZvbzQYBCADKAUigQMKEkNvbXBsZXhPcHRpb25UeXBl", + "MhIyCgNiYXIYASABKAsyJS5wcm90b2J1Zl91bml0dGVzdC5Db21wbGV4T3B0", + "aW9uVHlwZTESCwoDYmF6GAIgASgFEkYKBGZyZWQYAyABKAsyOC5wcm90b2J1", + "Zl91bml0dGVzdC5Db21wbGV4T3B0aW9uVHlwZTIuQ29tcGxleE9wdGlvblR5", + "cGU0EkgKBmJhcm5leRgEIAMoCzI4LnByb3RvYnVmX3VuaXR0ZXN0LkNvbXBs", + "ZXhPcHRpb25UeXBlMi5Db21wbGV4T3B0aW9uVHlwZTQalwEKEkNvbXBsZXhP", + "cHRpb25UeXBlNBINCgV3YWxkbxgBIAEoBTJyCgxjb21wbGV4X29wdDQSHy5n", + "b29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYivXRAyABKAsyOC5wcm90", + "b2J1Zl91bml0dGVzdC5Db21wbGV4T3B0aW9uVHlwZTIuQ29tcGxleE9wdGlv", + "blR5cGU0IiEKEkNvbXBsZXhPcHRpb25UeXBlMxILCgNxdXgYASABKAUibAoV", + "VmFyaW91c0NvbXBsZXhPcHRpb25zOlOi4pUdAggqouKVHQIgY6LilR0CIFiq", + "/ZAdAxDbB6r9kB0FCgMI5wXSqI8dAwizD6r9kB0FGgMIwQKq/ZAdBCICCGWq", + "/ZAdBSIDCNQB+t6QHQIICSJMCglBZ2dyZWdhdGUSCQoBaRgBIAEoBRIJCgFz", + "GAIgASgJEikKA3N1YhgDIAEoCzIcLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3Jl", + "Z2F0ZSJZChBBZ2dyZWdhdGVNZXNzYWdlEikKCWZpZWxkbmFtZRgBIAEoBUIW", + "8qGHOxESD0ZpZWxkQW5ub3RhdGlvbjoawtGGOxUIZRIRTWVzc2FnZUFubm90", + "YXRpb24ilwEKEE5lc3RlZE9wdGlvblR5cGUaOwoNTmVzdGVkTWVzc2FnZRIi", + "CgxuZXN0ZWRfZmllbGQYASABKAVCDMHgwx3qAwAAAAAAADoG4OnCHekHIkYK", + "Ck5lc3RlZEVudW0SDwoLVU5TUEVDSUZJRUQQABIdChFORVNURURfRU5VTV9W", + "QUxVRRABGgawhvoF7AcaCMX2yR3rAwAAKlIKCk1ldGhvZE9wdDESGgoWTUVU", + "SE9ET1BUMV9VTlNQRUNJRklFRBAAEhMKD01FVEhPRE9QVDFfVkFMMRABEhMK", + "D01FVEhPRE9QVDFfVkFMMhACKl4KDUFnZ3JlZ2F0ZUVudW0SDwoLVU5TUEVD", + "SUZJRUQQABIlCgVWQUxVRRABGhrK/Ik7FRITRW51bVZhbHVlQW5ub3RhdGlv", + "bhoVkpWIOxASDkVudW1Bbm5vdGF0aW9uMo4BChxUZXN0U2VydmljZVdpdGhD", + "dXN0b21PcHRpb25zEmMKA0ZvbxIpLnByb3RvYnVmX3VuaXR0ZXN0LkN1c3Rv", + "bU9wdGlvbkZvb1JlcXVlc3QaKi5wcm90b2J1Zl91bml0dGVzdC5DdXN0b21P", + "cHRpb25Gb29SZXNwb25zZSIF4PqMHgIaCZCyix7T24DLSTKZAQoQQWdncmVn", + "YXRlU2VydmljZRJrCgZNZXRob2QSIy5wcm90b2J1Zl91bml0dGVzdC5BZ2dy", + "ZWdhdGVNZXNzYWdlGiMucHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlTWVz", + "c2FnZSIXysiWOxISEE1ldGhvZEFubm90YXRpb24aGMr7jjsTEhFTZXJ2aWNl", + "QW5ub3RhdGlvbjoyCglmaWxlX29wdDESHC5nb29nbGUucHJvdG9idWYuRmls", + "ZU9wdGlvbnMYjp3YAyABKAQ6OAoMbWVzc2FnZV9vcHQxEh8uZ29vZ2xlLnBy", + "b3RvYnVmLk1lc3NhZ2VPcHRpb25zGJyt2AMgASgFOjQKCmZpZWxkX29wdDES", + "HS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGIi82AMgASgGOjQKCm9u", + "ZW9mX29wdDESHS5nb29nbGUucHJvdG9idWYuT25lb2ZPcHRpb25zGM+12AMg", + "ASgFOjIKCWVudW1fb3B0MRIcLmdvb2dsZS5wcm90b2J1Zi5FbnVtT3B0aW9u", + "cxjontkDIAEoDzo8Cg9lbnVtX3ZhbHVlX29wdDESIS5nb29nbGUucHJvdG9i", + "dWYuRW51bVZhbHVlT3B0aW9ucxjmoF8gASgFOjgKDHNlcnZpY2Vfb3B0MRIf", + "Lmdvb2dsZS5wcm90b2J1Zi5TZXJ2aWNlT3B0aW9ucxiituEDIAEoEjpVCgtt", + "ZXRob2Rfb3B0MRIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGKzP", + "4QMgASgOMh0ucHJvdG9idWZfdW5pdHRlc3QuTWV0aG9kT3B0MTo0Cghib29s", + "X29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjqq9YDIAEo", + "CDo1CglpbnQzMl9vcHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlv", + "bnMY7ajWAyABKAU6NQoJaW50NjRfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1l", + "c3NhZ2VPcHRpb25zGMan1gMgASgDOjYKCnVpbnQzMl9vcHQSHy5nb29nbGUu", + "cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYsKLWAyABKA06NgoKdWludDY0X29w", + "dBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjfjtYDIAEoBDo2", + "CgpzaW50MzJfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25z", + "GMCI1gMgASgROjYKCnNpbnQ2NF9vcHQSHy5nb29nbGUucHJvdG9idWYuTWVz", + "c2FnZU9wdGlvbnMY/4LWAyABKBI6NwoLZml4ZWQzMl9vcHQSHy5nb29nbGUu", + "cHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY0/7VAyABKAc6NwoLZml4ZWQ2NF9v", + "cHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY4v3VAyABKAY6", + "OAoMc2ZpeGVkMzJfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRp", + "b25zGNXx1QMgASgPOjgKDHNmaXhlZDY0X29wdBIfLmdvb2dsZS5wcm90b2J1", + "Zi5NZXNzYWdlT3B0aW9ucxjjitUDIAEoEDo1CglmbG9hdF9vcHQSHy5nb29n", + "bGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY/rvUAyABKAI6NgoKZG91Ymxl", + "X29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjNq9QDIAEo", + "ATo2CgpzdHJpbmdfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRp", + "b25zGMWr1AMgASgJOjUKCWJ5dGVzX29wdBIfLmdvb2dsZS5wcm90b2J1Zi5N", + "ZXNzYWdlT3B0aW9ucxiWq9QDIAEoDDpwCghlbnVtX29wdBIfLmdvb2dsZS5w", + "cm90b2J1Zi5NZXNzYWdlT3B0aW9ucxiRq9QDIAEoDjI6LnByb3RvYnVmX3Vu", + "aXR0ZXN0LkR1bW15TWVzc2FnZUNvbnRhaW5pbmdFbnVtLlRlc3RFbnVtVHlw", + "ZTpwChBtZXNzYWdlX3R5cGVfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3Nh", + "Z2VPcHRpb25zGK/y0wMgASgLMjIucHJvdG9idWZfdW5pdHRlc3QuRHVtbXlN", + "ZXNzYWdlSW52YWxpZEFzT3B0aW9uVHlwZTpfCgxjb21wbGV4X29wdDESHy5n", + "b29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYpNzSAyABKAsyJS5wcm90", + "b2J1Zl91bml0dGVzdC5Db21wbGV4T3B0aW9uVHlwZTE6XwoMY29tcGxleF9v", + "cHQyEh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGNWP0gMgASgL", + "MiUucHJvdG9idWZfdW5pdHRlc3QuQ29tcGxleE9wdGlvblR5cGUyOl8KDGNv", + "bXBsZXhfb3B0MxIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjv", + "i9IDIAEoCzIlLnByb3RvYnVmX3VuaXR0ZXN0LkNvbXBsZXhPcHRpb25UeXBl", + "MzpOCgdmaWxlb3B0EhwuZ29vZ2xlLnByb3RvYnVmLkZpbGVPcHRpb25zGM/d", + "sAcgASgLMhwucHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlOlAKBm1zZ29w", + "dBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxiY6rAHIAEoCzIc", + "LnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3JlZ2F0ZTpQCghmaWVsZG9wdBIdLmdv", + "b2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMYnvSwByABKAsyHC5wcm90b2J1", + "Zl91bml0dGVzdC5BZ2dyZWdhdGU6TgoHZW51bW9wdBIcLmdvb2dsZS5wcm90", + "b2J1Zi5FbnVtT3B0aW9ucxjSgrEHIAEoCzIcLnByb3RvYnVmX3VuaXR0ZXN0", + "LkFnZ3JlZ2F0ZTpWCgplbnVtdmFsb3B0EiEuZ29vZ2xlLnByb3RvYnVmLkVu", + "dW1WYWx1ZU9wdGlvbnMYyZ+xByABKAsyHC5wcm90b2J1Zl91bml0dGVzdC5B", + "Z2dyZWdhdGU6VAoKc2VydmljZW9wdBIfLmdvb2dsZS5wcm90b2J1Zi5TZXJ2", + "aWNlT3B0aW9ucxi577EHIAEoCzIcLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3Jl", + "Z2F0ZTpSCgltZXRob2RvcHQSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0", + "aW9ucxiJ6bIHIAEoCzIcLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3JlZ2F0ZUJV", + "qgIaVW5pdFRlc3QuSXNzdWVzLlRlc3RQcm90b3Pw6MEd6q3A5ST67IU7Kghk", + "Eg5GaWxlQW5ub3RhdGlvbhoWEhROZXN0ZWRGaWxlQW5ub3RhdGlvbmIGcHJv", + "dG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.MethodOpt1), typeof(global::UnitTest.Issues.TestProtos.AggregateEnum), }, new pb::Extension[] { UnittestCustomOptionsProto3Extensions.FileOpt1, UnittestCustomOptionsProto3Extensions.MessageOpt1, UnittestCustomOptionsProto3Extensions.FieldOpt1, UnittestCustomOptionsProto3Extensions.OneofOpt1, UnittestCustomOptionsProto3Extensions.EnumOpt1, UnittestCustomOptionsProto3Extensions.EnumValueOpt1, UnittestCustomOptionsProto3Extensions.ServiceOpt1, UnittestCustomOptionsProto3Extensions.MethodOpt1, UnittestCustomOptionsProto3Extensions.BoolOpt, UnittestCustomOptionsProto3Extensions.Int32Opt, UnittestCustomOptionsProto3Extensions.Int64Opt, UnittestCustomOptionsProto3Extensions.Uint32Opt, UnittestCustomOptionsProto3Extensions.Uint64Opt, UnittestCustomOptionsProto3Extensions.Sint32Opt, UnittestCustomOptionsProto3Extensions.Sint64Opt, UnittestCustomOptionsProto3Extensions.Fixed32Opt, UnittestCustomOptionsProto3Extensions.Fixed64Opt, UnittestCustomOptionsProto3Extensions.Sfixed32Opt, UnittestCustomOptionsProto3Extensions.Sfixed64Opt, UnittestCustomOptionsProto3Extensions.FloatOpt, UnittestCustomOptionsProto3Extensions.DoubleOpt, UnittestCustomOptionsProto3Extensions.StringOpt, UnittestCustomOptionsProto3Extensions.BytesOpt, UnittestCustomOptionsProto3Extensions.EnumOpt, UnittestCustomOptionsProto3Extensions.MessageTypeOpt, UnittestCustomOptionsProto3Extensions.ComplexOpt1, UnittestCustomOptionsProto3Extensions.ComplexOpt2, UnittestCustomOptionsProto3Extensions.ComplexOpt3, UnittestCustomOptionsProto3Extensions.Fileopt, UnittestCustomOptionsProto3Extensions.Msgopt, UnittestCustomOptionsProto3Extensions.Fieldopt, UnittestCustomOptionsProto3Extensions.Enumopt, UnittestCustomOptionsProto3Extensions.Enumvalopt, UnittestCustomOptionsProto3Extensions.Serviceopt, UnittestCustomOptionsProto3Extensions.Methodopt }, new pbr::GeneratedClrTypeInfo[] { @@ -163,7 +164,7 @@ namespace UnitTest.Issues.TestProtos { #endregion } - /// Holder for extension identifiers generated from the top level of csharp/protos/unittest_custom_options_proto3.proto + /// Holder for extension identifiers generated from the top level of unittest_custom_options_proto3.proto public static partial class UnittestCustomOptionsProto3Extensions { public static readonly pb::Extension FileOpt1 = new pb::Extension(7736974, pb::FieldCodec.ForUInt64(61895792, 0UL)); @@ -256,7 +257,6 @@ namespace UnitTest.Issues.TestProtos { /// A test message with custom options at all possible locations (and also some /// regular options, to make sure they interact nicely). /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMessageWithCustomOptions : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -265,23 +265,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageWithCustomOptions()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageWithCustomOptions() { OnConstruction(); } @@ -289,7 +285,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageWithCustomOptions(TestMessageWithCustomOptions other) : this() { field1_ = other.field1_; switch (other.AnOneofCase) { @@ -302,7 +297,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageWithCustomOptions Clone() { return new TestMessageWithCustomOptions(this); } @@ -311,7 +305,6 @@ namespace UnitTest.Issues.TestProtos { public const int Field1FieldNumber = 1; private string field1_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field1 { get { return field1_; } set { @@ -322,28 +315,13 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "oneof_field" field. public const int OneofFieldFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OneofField { - get { return HasOneofField ? (int) anOneof_ : 0; } + get { return anOneofCase_ == AnOneofOneofCase.OneofField ? (int) anOneof_ : 0; } set { anOneof_ = value; anOneofCase_ = AnOneofOneofCase.OneofField; } } - /// Gets whether the "oneof_field" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofField { - get { return anOneofCase_ == AnOneofOneofCase.OneofField; } - } - /// Clears the value of the oneof if it's currently set to "oneof_field" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofField() { - if (HasOneofField) { - ClearAnOneof(); - } - } private object anOneof_; /// Enum of possible cases for the "AnOneof" oneof. @@ -353,26 +331,22 @@ namespace UnitTest.Issues.TestProtos { } private AnOneofOneofCase anOneofCase_ = AnOneofOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AnOneofOneofCase AnOneofCase { get { return anOneofCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearAnOneof() { anOneofCase_ = AnOneofOneofCase.None; anOneof_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMessageWithCustomOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMessageWithCustomOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -387,11 +361,10 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Field1.Length != 0) hash ^= Field1.GetHashCode(); - if (HasOneofField) hash ^= OneofField.GetHashCode(); + if (anOneofCase_ == AnOneofOneofCase.OneofField) hash ^= OneofField.GetHashCode(); hash ^= (int) anOneofCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -400,13 +373,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -415,7 +386,7 @@ namespace UnitTest.Issues.TestProtos { output.WriteRawTag(10); output.WriteString(Field1); } - if (HasOneofField) { + if (anOneofCase_ == AnOneofOneofCase.OneofField) { output.WriteRawTag(16); output.WriteInt32(OneofField); } @@ -427,13 +398,12 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Field1.Length != 0) { output.WriteRawTag(10); output.WriteString(Field1); } - if (HasOneofField) { + if (anOneofCase_ == AnOneofOneofCase.OneofField) { output.WriteRawTag(16); output.WriteInt32(OneofField); } @@ -444,13 +414,12 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Field1.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Field1); } - if (HasOneofField) { + if (anOneofCase_ == AnOneofOneofCase.OneofField) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(OneofField); } if (_unknownFields != null) { @@ -460,7 +429,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMessageWithCustomOptions other) { if (other == null) { return; @@ -478,7 +446,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -504,7 +471,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -528,7 +494,6 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the TestMessageWithCustomOptions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum AnEnum { [pbr::OriginalName("ANENUM_UNSPECIFIED")] Unspecified = 0, @@ -545,7 +510,6 @@ namespace UnitTest.Issues.TestProtos { /// A test RPC service with custom options at all possible locations (and also /// some regular options, to make sure they interact nicely). /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CustomOptionFooRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -554,23 +518,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooRequest() { OnConstruction(); } @@ -578,25 +538,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooRequest(CustomOptionFooRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooRequest Clone() { return new CustomOptionFooRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -608,7 +564,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -618,13 +573,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -637,7 +590,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -646,7 +598,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -656,7 +607,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooRequest other) { if (other == null) { return; @@ -665,7 +615,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -683,7 +632,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -698,7 +646,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CustomOptionFooResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -707,23 +654,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooResponse() { OnConstruction(); } @@ -731,25 +674,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooResponse(CustomOptionFooResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooResponse Clone() { return new CustomOptionFooResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -761,7 +700,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -771,13 +709,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -790,7 +726,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -799,7 +734,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -809,7 +743,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooResponse other) { if (other == null) { return; @@ -818,7 +751,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -836,7 +768,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -851,7 +782,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CustomOptionFooClientMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -860,23 +790,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooClientMessage() { OnConstruction(); } @@ -884,25 +810,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooClientMessage(CustomOptionFooClientMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooClientMessage Clone() { return new CustomOptionFooClientMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooClientMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -914,7 +836,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -924,13 +845,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -943,7 +862,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -952,7 +870,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -962,7 +879,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooClientMessage other) { if (other == null) { return; @@ -971,7 +887,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -989,7 +904,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1004,7 +918,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CustomOptionFooServerMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1013,23 +926,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooServerMessage() { OnConstruction(); } @@ -1037,25 +946,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooServerMessage(CustomOptionFooServerMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooServerMessage Clone() { return new CustomOptionFooServerMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooServerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1067,7 +972,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1077,13 +981,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1096,7 +998,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1105,7 +1006,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1115,7 +1015,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooServerMessage other) { if (other == null) { return; @@ -1124,7 +1023,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1142,7 +1040,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1157,7 +1054,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class DummyMessageContainingEnum : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1166,23 +1062,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessageContainingEnum()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageContainingEnum() { OnConstruction(); } @@ -1190,25 +1082,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageContainingEnum(DummyMessageContainingEnum other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageContainingEnum Clone() { return new DummyMessageContainingEnum(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DummyMessageContainingEnum); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DummyMessageContainingEnum other) { if (ReferenceEquals(other, null)) { return false; @@ -1220,7 +1108,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1230,13 +1117,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1249,7 +1134,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1258,7 +1142,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1268,7 +1151,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DummyMessageContainingEnum other) { if (other == null) { return; @@ -1277,7 +1159,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1295,7 +1176,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1311,7 +1191,6 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the DummyMessageContainingEnum message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum TestEnumType { [pbr::OriginalName("TEST_OPTION_ENUM_UNSPECIFIED")] TestOptionEnumUnspecified = 0, @@ -1324,7 +1203,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class DummyMessageInvalidAsOptionType : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1333,23 +1211,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessageInvalidAsOptionType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageInvalidAsOptionType() { OnConstruction(); } @@ -1357,25 +1231,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageInvalidAsOptionType(DummyMessageInvalidAsOptionType other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageInvalidAsOptionType Clone() { return new DummyMessageInvalidAsOptionType(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DummyMessageInvalidAsOptionType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DummyMessageInvalidAsOptionType other) { if (ReferenceEquals(other, null)) { return false; @@ -1387,7 +1257,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1397,13 +1266,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1416,7 +1283,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1425,7 +1291,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1435,7 +1300,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DummyMessageInvalidAsOptionType other) { if (other == null) { return; @@ -1444,7 +1308,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1462,7 +1325,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1477,7 +1339,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CustomOptionMinIntegerValues : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1486,23 +1347,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionMinIntegerValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMinIntegerValues() { OnConstruction(); } @@ -1510,25 +1367,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMinIntegerValues(CustomOptionMinIntegerValues other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMinIntegerValues Clone() { return new CustomOptionMinIntegerValues(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionMinIntegerValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionMinIntegerValues other) { if (ReferenceEquals(other, null)) { return false; @@ -1540,7 +1393,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1550,13 +1402,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1569,7 +1419,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1578,7 +1427,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1588,7 +1436,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionMinIntegerValues other) { if (other == null) { return; @@ -1597,7 +1444,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1615,7 +1461,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1630,7 +1475,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CustomOptionMaxIntegerValues : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1639,23 +1483,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionMaxIntegerValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMaxIntegerValues() { OnConstruction(); } @@ -1663,25 +1503,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMaxIntegerValues(CustomOptionMaxIntegerValues other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMaxIntegerValues Clone() { return new CustomOptionMaxIntegerValues(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionMaxIntegerValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionMaxIntegerValues other) { if (ReferenceEquals(other, null)) { return false; @@ -1693,7 +1529,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1703,13 +1538,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1722,7 +1555,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1731,7 +1563,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1741,7 +1572,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionMaxIntegerValues other) { if (other == null) { return; @@ -1750,7 +1580,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1768,7 +1597,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1783,7 +1611,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CustomOptionOtherValues : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1792,23 +1619,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionOtherValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionOtherValues() { OnConstruction(); } @@ -1816,25 +1639,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionOtherValues(CustomOptionOtherValues other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionOtherValues Clone() { return new CustomOptionOtherValues(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionOtherValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionOtherValues other) { if (ReferenceEquals(other, null)) { return false; @@ -1846,7 +1665,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1856,13 +1674,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1875,7 +1691,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1884,7 +1699,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1894,7 +1708,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionOtherValues other) { if (other == null) { return; @@ -1903,7 +1716,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1921,7 +1733,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1936,7 +1747,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SettingRealsFromPositiveInts : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1945,23 +1755,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SettingRealsFromPositiveInts()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromPositiveInts() { OnConstruction(); } @@ -1969,25 +1775,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromPositiveInts(SettingRealsFromPositiveInts other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromPositiveInts Clone() { return new SettingRealsFromPositiveInts(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SettingRealsFromPositiveInts); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SettingRealsFromPositiveInts other) { if (ReferenceEquals(other, null)) { return false; @@ -1999,7 +1801,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -2009,13 +1810,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2028,7 +1827,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -2037,7 +1835,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -2047,7 +1844,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SettingRealsFromPositiveInts other) { if (other == null) { return; @@ -2056,7 +1852,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2074,7 +1869,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2089,7 +1883,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SettingRealsFromNegativeInts : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2098,23 +1891,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SettingRealsFromNegativeInts()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromNegativeInts() { OnConstruction(); } @@ -2122,25 +1911,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromNegativeInts(SettingRealsFromNegativeInts other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromNegativeInts Clone() { return new SettingRealsFromNegativeInts(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SettingRealsFromNegativeInts); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SettingRealsFromNegativeInts other) { if (ReferenceEquals(other, null)) { return false; @@ -2152,7 +1937,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -2162,13 +1946,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2181,7 +1963,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -2190,7 +1971,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -2200,7 +1980,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SettingRealsFromNegativeInts other) { if (other == null) { return; @@ -2209,7 +1988,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2227,7 +2005,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2242,7 +2019,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ComplexOptionType1 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2251,23 +2027,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType1() { OnConstruction(); } @@ -2275,7 +2047,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType1(ComplexOptionType1 other) : this() { foo_ = other.foo_; foo2_ = other.foo2_; @@ -2285,7 +2056,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType1 Clone() { return new ComplexOptionType1(this); } @@ -2294,7 +2064,6 @@ namespace UnitTest.Issues.TestProtos { public const int FooFieldNumber = 1; private int foo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Foo { get { return foo_; } set { @@ -2306,7 +2075,6 @@ namespace UnitTest.Issues.TestProtos { public const int Foo2FieldNumber = 2; private int foo2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Foo2 { get { return foo2_; } set { @@ -2318,7 +2086,6 @@ namespace UnitTest.Issues.TestProtos { public const int Foo3FieldNumber = 3; private int foo3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Foo3 { get { return foo3_; } set { @@ -2332,19 +2099,16 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForInt32(34); private readonly pbc::RepeatedField foo4_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Foo4 { get { return foo4_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType1 other) { if (ReferenceEquals(other, null)) { return false; @@ -2360,7 +2124,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Foo != 0) hash ^= Foo.GetHashCode(); @@ -2374,13 +2137,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2406,7 +2167,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Foo != 0) { output.WriteRawTag(8); @@ -2428,7 +2188,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Foo != 0) { @@ -2448,7 +2207,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType1 other) { if (other == null) { return; @@ -2467,7 +2225,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2502,7 +2259,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2534,7 +2290,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ComplexOptionType2 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2543,23 +2298,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType2() { OnConstruction(); } @@ -2567,7 +2318,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType2(ComplexOptionType2 other) : this() { bar_ = other.bar_ != null ? other.bar_.Clone() : null; baz_ = other.baz_; @@ -2577,7 +2327,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType2 Clone() { return new ComplexOptionType2(this); } @@ -2586,7 +2335,6 @@ namespace UnitTest.Issues.TestProtos { public const int BarFieldNumber = 1; private global::UnitTest.Issues.TestProtos.ComplexOptionType1 bar_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.ComplexOptionType1 Bar { get { return bar_; } set { @@ -2598,7 +2346,6 @@ namespace UnitTest.Issues.TestProtos { public const int BazFieldNumber = 2; private int baz_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Baz { get { return baz_; } set { @@ -2610,7 +2357,6 @@ namespace UnitTest.Issues.TestProtos { public const int FredFieldNumber = 3; private global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 fred_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 Fred { get { return fred_; } set { @@ -2624,19 +2370,16 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Parser); private readonly pbc::RepeatedField barney_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Barney { get { return barney_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType2 other) { if (ReferenceEquals(other, null)) { return false; @@ -2652,7 +2395,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (bar_ != null) hash ^= Bar.GetHashCode(); @@ -2666,13 +2408,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2698,7 +2438,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (bar_ != null) { output.WriteRawTag(10); @@ -2720,7 +2459,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (bar_ != null) { @@ -2740,7 +2478,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType2 other) { if (other == null) { return; @@ -2765,7 +2502,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2805,7 +2541,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2843,9 +2578,7 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the ComplexOptionType2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ComplexOptionType4 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2854,23 +2587,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType4()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.ComplexOptionType2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType4() { OnConstruction(); } @@ -2878,14 +2607,12 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType4(ComplexOptionType4 other) : this() { waldo_ = other.waldo_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType4 Clone() { return new ComplexOptionType4(this); } @@ -2894,7 +2621,6 @@ namespace UnitTest.Issues.TestProtos { public const int WaldoFieldNumber = 1; private int waldo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Waldo { get { return waldo_; } set { @@ -2903,13 +2629,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType4); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType4 other) { if (ReferenceEquals(other, null)) { return false; @@ -2922,7 +2646,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Waldo != 0) hash ^= Waldo.GetHashCode(); @@ -2933,13 +2656,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2956,7 +2677,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Waldo != 0) { output.WriteRawTag(8); @@ -2969,7 +2689,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Waldo != 0) { @@ -2982,7 +2701,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType4 other) { if (other == null) { return; @@ -2994,7 +2712,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3016,7 +2733,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3036,7 +2752,6 @@ namespace UnitTest.Issues.TestProtos { #region Extensions /// Container for extensions for other messages declared in the ComplexOptionType4 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension ComplexOpt4 = new pb::Extension(7633546, pb::FieldCodec.ForMessage(61068370, global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Parser)); @@ -3050,7 +2765,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ComplexOptionType3 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3059,23 +2773,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType3() { OnConstruction(); } @@ -3083,14 +2793,12 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType3(ComplexOptionType3 other) : this() { qux_ = other.qux_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType3 Clone() { return new ComplexOptionType3(this); } @@ -3099,7 +2807,6 @@ namespace UnitTest.Issues.TestProtos { public const int QuxFieldNumber = 1; private int qux_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Qux { get { return qux_; } set { @@ -3108,13 +2815,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType3); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType3 other) { if (ReferenceEquals(other, null)) { return false; @@ -3127,7 +2832,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Qux != 0) hash ^= Qux.GetHashCode(); @@ -3138,13 +2842,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3161,7 +2863,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Qux != 0) { output.WriteRawTag(8); @@ -3174,7 +2875,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Qux != 0) { @@ -3187,7 +2887,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType3 other) { if (other == null) { return; @@ -3199,7 +2898,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3221,7 +2919,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3243,7 +2940,6 @@ namespace UnitTest.Issues.TestProtos { /// /// Note that we try various different ways of naming the same extension. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class VariousComplexOptions : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3252,23 +2948,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VariousComplexOptions()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public VariousComplexOptions() { OnConstruction(); } @@ -3276,25 +2968,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public VariousComplexOptions(VariousComplexOptions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public VariousComplexOptions Clone() { return new VariousComplexOptions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as VariousComplexOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(VariousComplexOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -3306,7 +2994,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -3316,13 +3003,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3335,7 +3020,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -3344,7 +3028,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -3354,7 +3037,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(VariousComplexOptions other) { if (other == null) { return; @@ -3363,7 +3045,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3381,7 +3062,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3399,7 +3079,6 @@ namespace UnitTest.Issues.TestProtos { /// /// A helper type used to test aggregate option parsing /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Aggregate : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3408,23 +3087,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Aggregate()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Aggregate() { OnConstruction(); } @@ -3432,7 +3107,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Aggregate(Aggregate other) : this() { i_ = other.i_; s_ = other.s_; @@ -3441,7 +3115,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Aggregate Clone() { return new Aggregate(this); } @@ -3450,7 +3123,6 @@ namespace UnitTest.Issues.TestProtos { public const int IFieldNumber = 1; private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { return i_; } set { @@ -3462,7 +3134,6 @@ namespace UnitTest.Issues.TestProtos { public const int SFieldNumber = 2; private string s_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string S { get { return s_; } set { @@ -3477,7 +3148,6 @@ namespace UnitTest.Issues.TestProtos { /// A nested object /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.Aggregate Sub { get { return sub_; } set { @@ -3486,13 +3156,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Aggregate); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Aggregate other) { if (ReferenceEquals(other, null)) { return false; @@ -3507,7 +3175,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (I != 0) hash ^= I.GetHashCode(); @@ -3520,13 +3187,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3551,7 +3216,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (I != 0) { output.WriteRawTag(8); @@ -3572,7 +3236,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (I != 0) { @@ -3591,7 +3254,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Aggregate other) { if (other == null) { return; @@ -3612,7 +3274,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3645,7 +3306,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3675,7 +3335,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class AggregateMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3684,23 +3343,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AggregateMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AggregateMessage() { OnConstruction(); } @@ -3708,14 +3363,12 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AggregateMessage(AggregateMessage other) : this() { fieldname_ = other.fieldname_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AggregateMessage Clone() { return new AggregateMessage(this); } @@ -3724,7 +3377,6 @@ namespace UnitTest.Issues.TestProtos { public const int FieldnameFieldNumber = 1; private int fieldname_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fieldname { get { return fieldname_; } set { @@ -3733,13 +3385,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as AggregateMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(AggregateMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -3752,7 +3402,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Fieldname != 0) hash ^= Fieldname.GetHashCode(); @@ -3763,13 +3412,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3786,7 +3433,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Fieldname != 0) { output.WriteRawTag(8); @@ -3799,7 +3445,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Fieldname != 0) { @@ -3812,7 +3457,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(AggregateMessage other) { if (other == null) { return; @@ -3824,7 +3468,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3846,7 +3489,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3868,7 +3510,6 @@ namespace UnitTest.Issues.TestProtos { /// /// Test custom options for nested type. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedOptionType : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3877,23 +3518,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedOptionType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOptionType() { OnConstruction(); } @@ -3901,25 +3538,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOptionType(NestedOptionType other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOptionType Clone() { return new NestedOptionType(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedOptionType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedOptionType other) { if (ReferenceEquals(other, null)) { return false; @@ -3931,7 +3564,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -3941,13 +3573,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3960,7 +3590,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -3969,7 +3598,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -3979,7 +3607,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedOptionType other) { if (other == null) { return; @@ -3988,7 +3615,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4006,7 +3632,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4022,14 +3647,12 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the NestedOptionType message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, [pbr::OriginalName("NESTED_ENUM_VALUE")] Value = 1, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -4038,23 +3661,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.NestedOptionType.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -4062,14 +3681,12 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { nestedField_ = other.nestedField_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -4078,7 +3695,6 @@ namespace UnitTest.Issues.TestProtos { public const int NestedFieldFieldNumber = 1; private int nestedField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int NestedField { get { return nestedField_; } set { @@ -4087,13 +3703,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -4106,7 +3720,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (NestedField != 0) hash ^= NestedField.GetHashCode(); @@ -4117,13 +3730,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4140,7 +3751,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (NestedField != 0) { output.WriteRawTag(8); @@ -4153,7 +3763,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (NestedField != 0) { @@ -4166,7 +3775,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -4178,7 +3786,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4200,7 +3807,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs similarity index 78% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs index 218b32fcc46d4967014a17d0f80f1c7447cbb28b..14b054ccbbae2ea3dcccdc7299c46af49991186d 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_import.proto +// source: unittest_import.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos.Proto2 { - /// Holder for reflection information generated from csharp/protos/unittest_import.proto + /// Holder for reflection information generated from unittest_import.proto public static partial class UnittestImportReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_import.proto + /// File descriptor for unittest_import.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,13 +24,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { static UnittestImportReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiNjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2ltcG9ydC5wcm90bxIfcHJvdG9i", - "dWZfdW5pdHRlc3RfaW1wb3J0X3Byb3RvMhoqY3NoYXJwL3Byb3Rvcy91bml0", - "dGVzdF9pbXBvcnRfcHVibGljLnByb3RvIhoKDUltcG9ydE1lc3NhZ2USCQoB", - "ZBgBIAEoBSo8CgpJbXBvcnRFbnVtEg4KCklNUE9SVF9GT08QBxIOCgpJTVBP", - "UlRfQkFSEAgSDgoKSU1QT1JUX0JBWhAJKjEKEEltcG9ydEVudW1Gb3JNYXAS", - "CwoHVU5LTk9XThAAEgcKA0ZPTxABEgcKA0JBUhACQilIAfgBAaoCIUdvb2ds", - "ZS5Qcm90b2J1Zi5UZXN0UHJvdG9zLlByb3RvMlAA")); + "ChV1bml0dGVzdF9pbXBvcnQucHJvdG8SH3Byb3RvYnVmX3VuaXR0ZXN0X2lt", + "cG9ydF9wcm90bzIaHHVuaXR0ZXN0X2ltcG9ydF9wdWJsaWMucHJvdG8iGgoN", + "SW1wb3J0TWVzc2FnZRIJCgFkGAEgASgFKjwKCkltcG9ydEVudW0SDgoKSU1Q", + "T1JUX0ZPTxAHEg4KCklNUE9SVF9CQVIQCBIOCgpJTVBPUlRfQkFaEAkqMQoQ", + "SW1wb3J0RW51bUZvck1hcBILCgdVTktOT1dOEAASBwoDRk9PEAESBwoDQkFS", + "EAJCKUgB+AEBqgIhR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3MuUHJvdG8y", + "UAA=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.Proto2.UnittestImportPublicReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.Proto2.ImportEnum), typeof(global::Google.Protobuf.TestProtos.Proto2.ImportEnumForMap), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -59,7 +59,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endregion #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ImportMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -69,23 +68,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestImportReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage() { OnConstruction(); } @@ -93,7 +88,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage(ImportMessage other) : this() { _hasBits0 = other._hasBits0; d_ = other.d_; @@ -101,7 +95,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage Clone() { return new ImportMessage(this); } @@ -112,7 +105,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int d_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int D { get { if ((_hasBits0 & 1) != 0) { return d_; } else { return DDefaultValue; } } set { @@ -122,25 +114,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "d" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasD { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "d" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearD() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -153,7 +141,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasD) hash ^= D.GetHashCode(); @@ -164,13 +151,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -187,7 +172,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasD) { output.WriteRawTag(8); @@ -200,7 +184,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasD) { @@ -213,7 +196,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ImportMessage other) { if (other == null) { return; @@ -225,7 +207,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -247,7 +228,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs similarity index 77% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs index 0b9055d7993f841751f3f9fb746afe3964c0815e..ecdf40979c2bd2040ef925f1e5d92ed1aab90bbf 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_import_proto3.proto +// source: unittest_import_proto3.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_import_proto3.proto + /// Holder for reflection information generated from unittest_import_proto3.proto public static partial class UnittestImportProto3Reflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_import_proto3.proto + /// File descriptor for unittest_import_proto3.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,13 +24,12 @@ namespace Google.Protobuf.TestProtos { static UnittestImportProto3Reflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cipjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2ltcG9ydF9wcm90bzMucHJvdG8S", - "GHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydBoxY3NoYXJwL3Byb3Rvcy91bml0", - "dGVzdF9pbXBvcnRfcHVibGljX3Byb3RvMy5wcm90byIaCg1JbXBvcnRNZXNz", - "YWdlEgkKAWQYASABKAUqWQoKSW1wb3J0RW51bRIbChdJTVBPUlRfRU5VTV9V", - "TlNQRUNJRklFRBAAEg4KCklNUE9SVF9GT08QBxIOCgpJTVBPUlRfQkFSEAgS", - "DgoKSU1QT1JUX0JBWhAJQh2qAhpHb29nbGUuUHJvdG9idWYuVGVzdFByb3Rv", - "c1AAYgZwcm90bzM=")); + "Chx1bml0dGVzdF9pbXBvcnRfcHJvdG8zLnByb3RvEhhwcm90b2J1Zl91bml0", + "dGVzdF9pbXBvcnQaI3VuaXR0ZXN0X2ltcG9ydF9wdWJsaWNfcHJvdG8zLnBy", + "b3RvIhoKDUltcG9ydE1lc3NhZ2USCQoBZBgBIAEoBSpZCgpJbXBvcnRFbnVt", + "EhsKF0lNUE9SVF9FTlVNX1VOU1BFQ0lGSUVEEAASDgoKSU1QT1JUX0ZPTxAH", + "Eg4KCklNUE9SVF9CQVIQCBIOCgpJTVBPUlRfQkFaEAlCHaoCGkdvb2dsZS5Q", + "cm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3Reflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ImportEnum), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -51,7 +50,6 @@ namespace Google.Protobuf.TestProtos { #endregion #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ImportMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -60,23 +58,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImportMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage() { OnConstruction(); } @@ -84,14 +78,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage(ImportMessage other) : this() { d_ = other.d_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage Clone() { return new ImportMessage(this); } @@ -100,7 +92,6 @@ namespace Google.Protobuf.TestProtos { public const int DFieldNumber = 1; private int d_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int D { get { return d_; } set { @@ -109,13 +100,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -128,7 +117,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (D != 0) hash ^= D.GetHashCode(); @@ -139,13 +127,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -162,7 +148,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (D != 0) { output.WriteRawTag(8); @@ -175,7 +160,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (D != 0) { @@ -188,7 +172,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ImportMessage other) { if (other == null) { return; @@ -200,7 +183,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -222,7 +204,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs similarity index 79% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs index 7835b14baed2af62cfe1ad6bc17586a54011bb78..24c29e9708262fd82178d7c8c0c0cee0e5134217 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_import_public.proto +// source: unittest_import_public.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos.Proto2 { - /// Holder for reflection information generated from csharp/protos/unittest_import_public.proto + /// Holder for reflection information generated from unittest_import_public.proto public static partial class UnittestImportPublicReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_import_public.proto + /// File descriptor for unittest_import_public.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,10 +24,9 @@ namespace Google.Protobuf.TestProtos.Proto2 { static UnittestImportPublicReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cipjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2ltcG9ydF9wdWJsaWMucHJvdG8S", - "H3Byb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydF9wcm90bzIiIAoTUHVibGljSW1w", - "b3J0TWVzc2FnZRIJCgFlGAEgASgFQiSqAiFHb29nbGUuUHJvdG9idWYuVGVz", - "dFByb3Rvcy5Qcm90bzI=")); + "Chx1bml0dGVzdF9pbXBvcnRfcHVibGljLnByb3RvEh9wcm90b2J1Zl91bml0", + "dGVzdF9pbXBvcnRfcHJvdG8yIiAKE1B1YmxpY0ltcG9ydE1lc3NhZ2USCQoB", + "ZRgBIAEoBUIkqgIhR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3MuUHJvdG8y")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -38,7 +37,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class PublicImportMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -48,23 +46,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestImportPublicReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage() { OnConstruction(); } @@ -72,7 +66,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage(PublicImportMessage other) : this() { _hasBits0 = other._hasBits0; e_ = other.e_; @@ -80,7 +73,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage Clone() { return new PublicImportMessage(this); } @@ -91,7 +83,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int e_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int E { get { if ((_hasBits0 & 1) != 0) { return e_; } else { return EDefaultValue; } } set { @@ -101,25 +92,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "e" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasE { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "e" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearE() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as PublicImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(PublicImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -132,7 +119,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasE) hash ^= E.GetHashCode(); @@ -143,13 +129,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -166,7 +150,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasE) { output.WriteRawTag(8); @@ -179,7 +162,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasE) { @@ -192,7 +174,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(PublicImportMessage other) { if (other == null) { return; @@ -204,7 +185,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -226,7 +206,6 @@ namespace Google.Protobuf.TestProtos.Proto2 { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs similarity index 78% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs index 3851f0bfd8182869231423c890847f410323684e..2d77a639fa35b75743a851c75b906cd8e9ac512a 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_import_public_proto3.proto +// source: unittest_import_public_proto3.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_import_public_proto3.proto + /// Holder for reflection information generated from unittest_import_public_proto3.proto public static partial class UnittestImportPublicProto3Reflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_import_public_proto3.proto + /// File descriptor for unittest_import_public_proto3.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,10 +24,10 @@ namespace Google.Protobuf.TestProtos { static UnittestImportPublicProto3Reflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CjFjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2ltcG9ydF9wdWJsaWNfcHJvdG8z", - "LnByb3RvEhhwcm90b2J1Zl91bml0dGVzdF9pbXBvcnQiIAoTUHVibGljSW1w", - "b3J0TWVzc2FnZRIJCgFlGAEgASgFQh2qAhpHb29nbGUuUHJvdG9idWYuVGVz", - "dFByb3Rvc2IGcHJvdG8z")); + "CiN1bml0dGVzdF9pbXBvcnRfcHVibGljX3Byb3RvMy5wcm90bxIYcHJvdG9i", + "dWZfdW5pdHRlc3RfaW1wb3J0IiAKE1B1YmxpY0ltcG9ydE1lc3NhZ2USCQoB", + "ZRgBIAEoBUIdqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3Rv", + "Mw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -38,7 +38,6 @@ namespace Google.Protobuf.TestProtos { } #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class PublicImportMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -47,23 +46,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PublicImportMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage() { OnConstruction(); } @@ -71,14 +66,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage(PublicImportMessage other) : this() { e_ = other.e_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage Clone() { return new PublicImportMessage(this); } @@ -87,7 +80,6 @@ namespace Google.Protobuf.TestProtos { public const int EFieldNumber = 1; private int e_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int E { get { return e_; } set { @@ -96,13 +88,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as PublicImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(PublicImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -115,7 +105,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (E != 0) hash ^= E.GetHashCode(); @@ -126,13 +115,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -149,7 +136,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (E != 0) { output.WriteRawTag(8); @@ -162,7 +148,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (E != 0) { @@ -175,7 +160,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(PublicImportMessage other) { if (other == null) { return; @@ -187,7 +171,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -209,7 +192,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.cs similarity index 71% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.cs index e51ba2eb42ac6526e02a7ef96189a45ee062a051..56fde4f00a24a521cca599588546c35016e41bfb 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_issue6936_a.proto +// source: unittest_issue6936_a.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace UnitTest.Issues.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_issue6936_a.proto + /// Holder for reflection information generated from unittest_issue6936_a.proto public static partial class UnittestIssue6936AReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_issue6936_a.proto + /// File descriptor for unittest_issue6936_a.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,10 +24,10 @@ namespace UnitTest.Issues.TestProtos { static UnittestIssue6936AReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cihjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2lzc3VlNjkzNl9hLnByb3RvEg91", - "bml0dGVzdF9pc3N1ZXMaIGdvb2dsZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnBy", - "b3RvOi4KA29wdBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjQ", - "hgMgASgJQh2qAhpVbml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); + "Chp1bml0dGVzdF9pc3N1ZTY5MzZfYS5wcm90bxIPdW5pdHRlc3RfaXNzdWVz", + "GiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90bzouCgNvcHQSHy5n", + "b29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY0IYDIAEoCUIdqgIaVW5p", + "dFRlc3QuSXNzdWVzLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { UnittestIssue6936AExtensions.Opt }, null)); @@ -35,7 +35,7 @@ namespace UnitTest.Issues.TestProtos { #endregion } - /// Holder for extension identifiers generated from the top level of csharp/protos/unittest_issue6936_a.proto + /// Holder for extension identifiers generated from the top level of unittest_issue6936_a.proto public static partial class UnittestIssue6936AExtensions { public static readonly pb::Extension Opt = new pb::Extension(50000, pb::FieldCodec.ForString(400002, "")); diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs similarity index 76% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs index d5320c710be143f23648cf9c67a801d34e55b910..e22bf0f8ffb4f9cc82974042f3958618403d6c10 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_issue6936_b.proto +// source: unittest_issue6936_b.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace UnitTest.Issues.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_issue6936_b.proto + /// Holder for reflection information generated from unittest_issue6936_b.proto public static partial class UnittestIssue6936BReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_issue6936_b.proto + /// File descriptor for unittest_issue6936_b.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,10 +24,9 @@ namespace UnitTest.Issues.TestProtos { static UnittestIssue6936BReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cihjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2lzc3VlNjkzNl9iLnByb3RvEg91", - "bml0dGVzdF9pc3N1ZXMaKGNzaGFycC9wcm90b3MvdW5pdHRlc3RfaXNzdWU2", - "OTM2X2EucHJvdG8iDgoDRm9vOgeCtRgDZm9vQh2qAhpVbml0VGVzdC5Jc3N1", - "ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); + "Chp1bml0dGVzdF9pc3N1ZTY5MzZfYi5wcm90bxIPdW5pdHRlc3RfaXNzdWVz", + "Ghp1bml0dGVzdF9pc3N1ZTY5MzZfYS5wcm90byIOCgNGb286B4K1GANmb29C", + "HaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::UnitTest.Issues.TestProtos.UnittestIssue6936AReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -38,7 +37,6 @@ namespace UnitTest.Issues.TestProtos { } #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Foo : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -47,23 +45,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Foo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssue6936BReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo() { OnConstruction(); } @@ -71,25 +65,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo(Foo other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo Clone() { return new Foo(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Foo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Foo other) { if (ReferenceEquals(other, null)) { return false; @@ -101,7 +91,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -111,13 +100,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -130,7 +117,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -139,7 +125,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -149,7 +134,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Foo other) { if (other == null) { return; @@ -158,7 +142,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -176,7 +159,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs similarity index 78% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs index a63965aaa0690027dcad67dc17679f0d7141d092..21d36300f87c7c7211bb9920e3f19e8a1c01f13e 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_issue6936_c.proto +// source: unittest_issue6936_c.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace UnitTest.Issues.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_issue6936_c.proto + /// Holder for reflection information generated from unittest_issue6936_c.proto public static partial class UnittestIssue6936CReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_issue6936_c.proto + /// File descriptor for unittest_issue6936_c.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,12 +24,11 @@ namespace UnitTest.Issues.TestProtos { static UnittestIssue6936CReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cihjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2lzc3VlNjkzNl9jLnByb3RvEg91", - "bml0dGVzdF9pc3N1ZXMaKGNzaGFycC9wcm90b3MvdW5pdHRlc3RfaXNzdWU2", - "OTM2X2EucHJvdG8aKGNzaGFycC9wcm90b3MvdW5pdHRlc3RfaXNzdWU2OTM2", - "X2IucHJvdG8iMQoDQmFyEiEKA2ZvbxgBIAEoCzIULnVuaXR0ZXN0X2lzc3Vl", - "cy5Gb286B4K1GANiYXJCHaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9z", - "YgZwcm90bzM=")); + "Chp1bml0dGVzdF9pc3N1ZTY5MzZfYy5wcm90bxIPdW5pdHRlc3RfaXNzdWVz", + "Ghp1bml0dGVzdF9pc3N1ZTY5MzZfYS5wcm90bxoadW5pdHRlc3RfaXNzdWU2", + "OTM2X2IucHJvdG8iMQoDQmFyEiEKA2ZvbxgBIAEoCzIULnVuaXR0ZXN0X2lz", + "c3Vlcy5Gb286B4K1GANiYXJCHaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJv", + "dG9zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::UnitTest.Issues.TestProtos.UnittestIssue6936AReflection.Descriptor, global::UnitTest.Issues.TestProtos.UnittestIssue6936BReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -40,7 +39,6 @@ namespace UnitTest.Issues.TestProtos { } #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Bar : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -49,23 +47,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bar()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssue6936CReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar() { OnConstruction(); } @@ -73,14 +67,12 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar(Bar other) : this() { foo_ = other.foo_ != null ? other.foo_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar Clone() { return new Bar(this); } @@ -89,7 +81,6 @@ namespace UnitTest.Issues.TestProtos { public const int FooFieldNumber = 1; private global::UnitTest.Issues.TestProtos.Foo foo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.Foo Foo { get { return foo_; } set { @@ -98,13 +89,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Bar); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Bar other) { if (ReferenceEquals(other, null)) { return false; @@ -117,7 +106,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (foo_ != null) hash ^= Foo.GetHashCode(); @@ -128,13 +116,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -151,7 +137,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (foo_ != null) { output.WriteRawTag(10); @@ -164,7 +149,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (foo_ != null) { @@ -177,7 +161,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Bar other) { if (other == null) { return; @@ -192,7 +175,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -217,7 +199,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs similarity index 59% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs index 72fb9f5d483970f301e735d20558f91be3777100..4377cf3a19cfc134f0164990573de5fba88bb862 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_issues.proto +// source: unittest_issues.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace UnitTest.Issues.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_issues.proto + /// Holder for reflection information generated from unittest_issues.proto public static partial class UnittestIssuesReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_issues.proto + /// File descriptor for unittest_issues.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,51 +24,41 @@ namespace UnitTest.Issues.TestProtos { static UnittestIssuesReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiNjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2lzc3Vlcy5wcm90bxIPdW5pdHRl", - "c3RfaXNzdWVzGhxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvIicKCElz", - "c3VlMzA3GhsKCk5lc3RlZE9uY2UaDQoLTmVzdGVkVHdpY2UisAEKE05lZ2F0", - "aXZlRW51bU1lc3NhZ2USLAoFdmFsdWUYASABKA4yHS51bml0dGVzdF9pc3N1", - "ZXMuTmVnYXRpdmVFbnVtEjEKBnZhbHVlcxgCIAMoDjIdLnVuaXR0ZXN0X2lz", - "c3Vlcy5OZWdhdGl2ZUVudW1CAhAAEjgKDXBhY2tlZF92YWx1ZXMYAyADKA4y", - "HS51bml0dGVzdF9pc3N1ZXMuTmVnYXRpdmVFbnVtQgIQASIVCg9EZXByZWNh", - "dGVkQ2hpbGQ6AhgBIrkCChdEZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5Q", - "cmltaXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiAD", - "KAVCAhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vl", - "cy5EZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIg", - "LnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1W", - "YWx1ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUIC", - "GAESNgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJl", - "Y2F0ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1S", - "ZXNlcnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiAB", - "KAUaEAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmlu", - "ZxITCgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABIS", - "CghvMV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghv", - "Ml9pbnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQK", - "Am8yIksKDFRlc3RKc29uTmFtZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0", - "aW9uGAIgASgJUgRkZXNjEhIKBGd1aWQYAyABKAlSBGV4aWQifwoMT25lb2ZN", - "ZXJnaW5nEg4KBHRleHQYASABKAlIABI2CgZuZXN0ZWQYAiABKAsyJC51bml0", - "dGVzdF9pc3N1ZXMuT25lb2ZNZXJnaW5nLk5lc3RlZEgAGh4KBk5lc3RlZBIJ", - "CgF4GAEgASgFEgkKAXkYAiABKAVCBwoFdmFsdWUiawoWTnVsbFZhbHVlT3V0", - "c2lkZVN0cnVjdBIWCgxzdHJpbmdfdmFsdWUYASABKAlIABIwCgpudWxsX3Zh", - "bHVlGAIgASgOMhouZ29vZ2xlLnByb3RvYnVmLk51bGxWYWx1ZUgAQgcKBXZh", - "bHVlIkUKE051bGxWYWx1ZU5vdEluT25lb2YSLgoKbnVsbF92YWx1ZRgCIAEo", - "DjIaLmdvb2dsZS5wcm90b2J1Zi5OdWxsVmFsdWUiYAoXTWl4ZWRSZWd1bGFy", - "QW5kT3B0aW9uYWwSFQoNcmVndWxhcl9maWVsZBgBIAEoCRIbCg5vcHRpb25h", - "bF9maWVsZBgCIAEoCUgAiAEBQhEKD19vcHRpb25hbF9maWVsZCI5ChJPbmVv", - "ZldpdGhOb25lRmllbGQSCwoBeBgBIAEoCUgAEg4KBG5vbmUYAiABKAlIAEIG", - "CgR0ZXN0IjUKEU9uZW9mV2l0aE5vbmVOYW1lEgsKAXgYASABKAlIABILCgF5", - "GAIgASgJSABCBgoEbm9uZSKTAgoZRGlzYW1iaWd1YXRlQ29tbW9uTWVtYmVy", - "cxIjChtkaXNhbWJpZ3VhdGVfY29tbW9uX21lbWJlcnMYASABKAUSDQoFdHlw", - "ZXMYAiABKAUSEgoKZGVzY3JpcHRvchgDIAEoBRIOCgZlcXVhbHMYBCABKAUS", - "EQoJdG9fc3RyaW5nGAUgASgFEhUKDWdldF9oYXNoX2NvZGUYBiABKAUSEAoI", - "d3JpdGVfdG8YByABKAUSDQoFY2xvbmUYCCABKAUSFgoOY2FsY3VsYXRlX3Np", - "emUYCSABKAUSEgoKbWVyZ2VfZnJvbRgKIAEoBRIXCg9vbl9jb25zdHJ1Y3Rp", - "b24YCyABKAUSDgoGcGFyc2VyGAwgASgFIj0KEUlzc3VlMTE5ODdNZXNzYWdl", - "EgwKAWEYASABKAVSAWISDAoBYhgCIAEoBVIBYRIMCgFjGAMgASgFUgFkKlUK", - "DE5lZ2F0aXZlRW51bRIWChJORUdBVElWRV9FTlVNX1pFUk8QABIWCglGaXZl", - "QmVsb3cQ+///////////ARIVCghNaW51c09uZRD///////////8BKjYKDkRl", - "cHJlY2F0ZWRFbnVtEhcKD0RFUFJFQ0FURURfWkVSTxAAGgIIARIHCgNvbmUQ", - "ARoCGAFCHaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM=")); + "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcxocZ29v", + "Z2xlL3Byb3RvYnVmL3N0cnVjdC5wcm90byInCghJc3N1ZTMwNxobCgpOZXN0", + "ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdhdGl2ZUVudW1NZXNzYWdl", + "EiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51", + "bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9pc3N1ZXMuTmVnYXRpdmVF", + "bnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygOMh0udW5pdHRlc3RfaXNz", + "dWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVjYXRlZENoaWxkIrkCChdE", + "ZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5QcmltaXRpdmVWYWx1ZRgBIAEo", + "BUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVCAhgBEjoKDE1lc3NhZ2VW", + "YWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRC", + "AhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E", + "ZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1ZRgFIAEoDjIfLnVuaXR0", + "ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAESNgoJRW51bUFycmF5GAYg", + "AygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0ZWRFbnVtQgIYASIZCglJ", + "dGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNlcnZlZE5hbWVzEg0KBXR5", + "cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUaEAoOU29tZU5lc3RlZFR5", + "cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxITCgtwbGFpbl9pbnQzMhgE", + "IAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghvMV9pbnQzMhgFIAEoBUgA", + "EhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9pbnQzMhgGIAEoBUgBEhMK", + "CW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8yIksKDFRlc3RKc29uTmFt", + "ZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9uGAIgASgJUgRkZXNjEhIK", + "BGd1aWQYAyABKAlSBGV4aWQifwoMT25lb2ZNZXJnaW5nEg4KBHRleHQYASAB", + "KAlIABI2CgZuZXN0ZWQYAiABKAsyJC51bml0dGVzdF9pc3N1ZXMuT25lb2ZN", + "ZXJnaW5nLk5lc3RlZEgAGh4KBk5lc3RlZBIJCgF4GAEgASgFEgkKAXkYAiAB", + "KAVCBwoFdmFsdWUiawoWTnVsbFZhbHVlT3V0c2lkZVN0cnVjdBIWCgxzdHJp", + "bmdfdmFsdWUYASABKAlIABIwCgpudWxsX3ZhbHVlGAIgASgOMhouZ29vZ2xl", + "LnByb3RvYnVmLk51bGxWYWx1ZUgAQgcKBXZhbHVlIkUKE051bGxWYWx1ZU5v", + "dEluT25lb2YSLgoKbnVsbF92YWx1ZRgCIAEoDjIaLmdvb2dsZS5wcm90b2J1", + "Zi5OdWxsVmFsdWUiYAoXTWl4ZWRSZWd1bGFyQW5kT3B0aW9uYWwSFQoNcmVn", + "dWxhcl9maWVsZBgBIAEoCRIbCg5vcHRpb25hbF9maWVsZBgCIAEoCUgAiAEB", + "QhEKD19vcHRpb25hbF9maWVsZCpVCgxOZWdhdGl2ZUVudW0SFgoSTkVHQVRJ", + "VkVfRU5VTV9aRVJPEAASFgoJRml2ZUJlbG93EPv//////////wESFQoITWlu", + "dXNPbmUQ////////////ASouCg5EZXByZWNhdGVkRW51bRITCg9ERVBSRUNB", + "VEVEX1pFUk8QABIHCgNvbmUQAUIdqgIaVW5pdFRlc3QuSXNzdWVzLlRlc3RQ", + "cm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -83,11 +73,7 @@ namespace UnitTest.Issues.TestProtos { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging), global::UnitTest.Issues.TestProtos.OneofMerging.Parser, new[]{ "Text", "Nested" }, new[]{ "Value" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested), global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested.Parser, new[]{ "X", "Y" }, null, null, null, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NullValueOutsideStruct), global::UnitTest.Issues.TestProtos.NullValueOutsideStruct.Parser, new[]{ "StringValue", "NullValue" }, new[]{ "Value" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NullValueNotInOneof), global::UnitTest.Issues.TestProtos.NullValueNotInOneof.Parser, new[]{ "NullValue" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.MixedRegularAndOptional), global::UnitTest.Issues.TestProtos.MixedRegularAndOptional.Parser, new[]{ "RegularField", "OptionalField" }, new[]{ "OptionalField" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofWithNoneField), global::UnitTest.Issues.TestProtos.OneofWithNoneField.Parser, new[]{ "X", "None" }, new[]{ "Test" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofWithNoneName), global::UnitTest.Issues.TestProtos.OneofWithNoneName.Parser, new[]{ "X", "Y" }, new[]{ "None" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.DisambiguateCommonMembers), global::UnitTest.Issues.TestProtos.DisambiguateCommonMembers.Parser, new[]{ "DisambiguateCommonMembers_", "Types_", "Descriptor_", "Equals_", "ToString_", "GetHashCode_", "WriteTo_", "Clone_", "CalculateSize_", "MergeFrom_", "OnConstruction_", "Parser_" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue11987Message), global::UnitTest.Issues.TestProtos.Issue11987Message.Parser, new[]{ "A", "B", "C" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.MixedRegularAndOptional), global::UnitTest.Issues.TestProtos.MixedRegularAndOptional.Parser, new[]{ "RegularField", "OptionalField" }, new[]{ "OptionalField" }, null, null, null) })); } #endregion @@ -100,9 +86,7 @@ namespace UnitTest.Issues.TestProtos { [pbr::OriginalName("MinusOne")] MinusOne = -1, } - [global::System.ObsoleteAttribute] public enum DeprecatedEnum { - [global::System.ObsoleteAttribute] [pbr::OriginalName("DEPRECATED_ZERO")] DeprecatedZero = 0, [pbr::OriginalName("one")] One = 1, } @@ -114,7 +98,6 @@ namespace UnitTest.Issues.TestProtos { /// Issue 307: when generating doubly-nested types, any references /// should be of the form A.Types.B.Types.C. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Issue307 : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -123,23 +106,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Issue307()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Issue307() { OnConstruction(); } @@ -147,25 +126,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Issue307(Issue307 other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Issue307 Clone() { return new Issue307(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Issue307); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Issue307 other) { if (ReferenceEquals(other, null)) { return false; @@ -177,7 +152,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -187,13 +161,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -206,7 +178,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -215,7 +186,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -225,7 +195,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Issue307 other) { if (other == null) { return; @@ -234,7 +203,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -252,7 +220,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -268,9 +235,7 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the Issue307 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedOnce : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -279,23 +244,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedOnce()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOnce() { OnConstruction(); } @@ -303,25 +264,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOnce(NestedOnce other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOnce Clone() { return new NestedOnce(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedOnce); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedOnce other) { if (ReferenceEquals(other, null)) { return false; @@ -333,7 +290,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -343,13 +299,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -362,7 +316,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -371,7 +324,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -381,7 +333,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedOnce other) { if (other == null) { return; @@ -390,7 +341,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -408,7 +358,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -424,9 +373,7 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the NestedOnce message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedTwice : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -435,23 +382,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTwice()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTwice() { OnConstruction(); } @@ -459,25 +402,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTwice(NestedTwice other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTwice Clone() { return new NestedTwice(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedTwice); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedTwice other) { if (ReferenceEquals(other, null)) { return false; @@ -489,7 +428,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -499,13 +437,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -518,7 +454,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -527,7 +462,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -537,7 +471,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedTwice other) { if (other == null) { return; @@ -546,7 +479,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -564,7 +496,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -589,7 +520,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NegativeEnumMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -598,23 +528,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NegativeEnumMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NegativeEnumMessage() { OnConstruction(); } @@ -622,7 +548,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NegativeEnumMessage(NegativeEnumMessage other) : this() { value_ = other.value_; values_ = other.values_.Clone(); @@ -631,7 +556,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NegativeEnumMessage Clone() { return new NegativeEnumMessage(this); } @@ -640,7 +564,6 @@ namespace UnitTest.Issues.TestProtos { public const int ValueFieldNumber = 1; private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.Zero; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.NegativeEnum Value { get { return value_; } set { @@ -654,7 +577,6 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Values { get { return values_; } } @@ -665,19 +587,16 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); private readonly pbc::RepeatedField packedValues_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedValues { get { return packedValues_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NegativeEnumMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NegativeEnumMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -692,7 +611,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) hash ^= Value.GetHashCode(); @@ -705,13 +623,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -730,7 +646,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) { output.WriteRawTag(8); @@ -745,7 +660,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) { @@ -760,7 +674,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NegativeEnumMessage other) { if (other == null) { return; @@ -774,7 +687,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -806,7 +718,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -835,8 +746,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class DeprecatedChild : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -845,23 +754,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedChild()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedChild() { OnConstruction(); } @@ -869,25 +774,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedChild(DeprecatedChild other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedChild Clone() { return new DeprecatedChild(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DeprecatedChild); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DeprecatedChild other) { if (ReferenceEquals(other, null)) { return false; @@ -899,7 +800,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -909,13 +809,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -928,7 +826,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -937,7 +834,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -947,7 +843,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DeprecatedChild other) { if (other == null) { return; @@ -956,7 +851,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -974,7 +868,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -989,7 +882,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class DeprecatedFieldsMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -998,23 +890,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedFieldsMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedFieldsMessage() { OnConstruction(); } @@ -1022,7 +910,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() { primitiveValue_ = other.primitiveValue_; primitiveArray_ = other.primitiveArray_.Clone(); @@ -1034,7 +921,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedFieldsMessage Clone() { return new DeprecatedFieldsMessage(this); } @@ -1044,7 +930,6 @@ namespace UnitTest.Issues.TestProtos { private int primitiveValue_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PrimitiveValue { get { return primitiveValue_; } set { @@ -1059,7 +944,6 @@ namespace UnitTest.Issues.TestProtos { private readonly pbc::RepeatedField primitiveArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PrimitiveArray { get { return primitiveArray_; } } @@ -1069,7 +953,6 @@ namespace UnitTest.Issues.TestProtos { private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { get { return messageValue_; } set { @@ -1084,7 +967,6 @@ namespace UnitTest.Issues.TestProtos { private readonly pbc::RepeatedField messageArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField MessageArray { get { return messageArray_; } } @@ -1094,7 +976,6 @@ namespace UnitTest.Issues.TestProtos { private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { get { return enumValue_; } set { @@ -1109,19 +990,16 @@ namespace UnitTest.Issues.TestProtos { private readonly pbc::RepeatedField enumArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField EnumArray { get { return enumArray_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DeprecatedFieldsMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DeprecatedFieldsMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1139,7 +1017,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode(); @@ -1155,13 +1032,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1189,7 +1064,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (PrimitiveValue != 0) { output.WriteRawTag(8); @@ -1213,7 +1087,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (PrimitiveValue != 0) { @@ -1235,7 +1108,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DeprecatedFieldsMessage other) { if (other == null) { return; @@ -1259,7 +1131,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1306,7 +1177,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1353,7 +1223,6 @@ namespace UnitTest.Issues.TestProtos { /// /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ItemField : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1362,23 +1231,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ItemField()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ItemField() { OnConstruction(); } @@ -1386,14 +1251,12 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ItemField(ItemField other) : this() { item_ = other.item_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ItemField Clone() { return new ItemField(this); } @@ -1402,7 +1265,6 @@ namespace UnitTest.Issues.TestProtos { public const int ItemFieldNumber = 1; private int item_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Item { get { return item_; } set { @@ -1411,13 +1273,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ItemField); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ItemField other) { if (ReferenceEquals(other, null)) { return false; @@ -1430,7 +1290,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Item != 0) hash ^= Item.GetHashCode(); @@ -1441,13 +1300,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1464,7 +1321,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Item != 0) { output.WriteRawTag(8); @@ -1477,7 +1333,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Item != 0) { @@ -1490,7 +1345,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ItemField other) { if (other == null) { return; @@ -1502,7 +1356,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1524,7 +1377,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1543,7 +1395,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ReservedNames : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1552,23 +1403,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedNames()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedNames() { OnConstruction(); } @@ -1576,7 +1423,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedNames(ReservedNames other) : this() { types_ = other.types_; descriptor_ = other.descriptor_; @@ -1584,7 +1430,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedNames Clone() { return new ReservedNames(this); } @@ -1593,7 +1438,6 @@ namespace UnitTest.Issues.TestProtos { public const int Types_FieldNumber = 1; private int types_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Types_ { get { return types_; } set { @@ -1605,7 +1449,6 @@ namespace UnitTest.Issues.TestProtos { public const int Descriptor_FieldNumber = 2; private int descriptor_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Descriptor_ { get { return descriptor_; } set { @@ -1614,13 +1457,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ReservedNames); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ReservedNames other) { if (ReferenceEquals(other, null)) { return false; @@ -1634,7 +1475,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Types_ != 0) hash ^= Types_.GetHashCode(); @@ -1646,13 +1486,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1673,7 +1511,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Types_ != 0) { output.WriteRawTag(8); @@ -1690,7 +1527,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Types_ != 0) { @@ -1706,7 +1542,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ReservedNames other) { if (other == null) { return; @@ -1721,7 +1556,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1747,7 +1581,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1771,12 +1604,10 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the ReservedNames message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Force a nested type called Types /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SomeNestedType : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1785,23 +1616,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SomeNestedType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SomeNestedType() { OnConstruction(); } @@ -1809,25 +1636,21 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SomeNestedType(SomeNestedType other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SomeNestedType Clone() { return new SomeNestedType(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SomeNestedType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SomeNestedType other) { if (ReferenceEquals(other, null)) { return false; @@ -1839,7 +1662,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1849,13 +1671,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1868,7 +1688,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1877,7 +1696,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1887,7 +1705,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SomeNestedType other) { if (other == null) { return; @@ -1896,7 +1713,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1914,7 +1730,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1946,7 +1761,6 @@ namespace UnitTest.Issues.TestProtos { /// Alternatively, consider just adding this to /// unittest_proto3.proto if multiple platforms want it. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestJsonFieldOrdering : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1955,23 +1769,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonFieldOrdering()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonFieldOrdering() { OnConstruction(); } @@ -1979,7 +1789,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() { plainInt32_ = other.plainInt32_; plainString_ = other.plainString_; @@ -2005,7 +1814,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonFieldOrdering Clone() { return new TestJsonFieldOrdering(this); } @@ -2014,7 +1822,6 @@ namespace UnitTest.Issues.TestProtos { public const int PlainInt32FieldNumber = 4; private int plainInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PlainInt32 { get { return plainInt32_; } set { @@ -2025,60 +1832,29 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "o1_string" field. public const int O1StringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string O1String { - get { return HasO1String ? (string) o1_ : ""; } + get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; } set { o1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); o1Case_ = O1OneofCase.O1String; } } - /// Gets whether the "o1_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasO1String { - get { return o1Case_ == O1OneofCase.O1String; } - } - /// Clears the value of the oneof if it's currently set to "o1_string" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearO1String() { - if (HasO1String) { - ClearO1(); - } - } /// Field number for the "o1_int32" field. public const int O1Int32FieldNumber = 5; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int O1Int32 { - get { return HasO1Int32 ? (int) o1_ : 0; } + get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; } set { o1_ = value; o1Case_ = O1OneofCase.O1Int32; } } - /// Gets whether the "o1_int32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasO1Int32 { - get { return o1Case_ == O1OneofCase.O1Int32; } - } - /// Clears the value of the oneof if it's currently set to "o1_int32" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearO1Int32() { - if (HasO1Int32) { - ClearO1(); - } - } /// Field number for the "plain_string" field. public const int PlainStringFieldNumber = 1; private string plainString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string PlainString { get { return plainString_; } set { @@ -2089,54 +1865,24 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "o2_int32" field. public const int O2Int32FieldNumber = 6; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int O2Int32 { - get { return HasO2Int32 ? (int) o2_ : 0; } + get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; } set { o2_ = value; o2Case_ = O2OneofCase.O2Int32; } } - /// Gets whether the "o2_int32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasO2Int32 { - get { return o2Case_ == O2OneofCase.O2Int32; } - } - /// Clears the value of the oneof if it's currently set to "o2_int32" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearO2Int32() { - if (HasO2Int32) { - ClearO2(); - } - } /// Field number for the "o2_string" field. public const int O2StringFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string O2String { - get { return HasO2String ? (string) o2_ : ""; } + get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; } set { o2_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); o2Case_ = O2OneofCase.O2String; } } - /// Gets whether the "o2_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasO2String { - get { return o2Case_ == O2OneofCase.O2String; } - } - /// Clears the value of the oneof if it's currently set to "o2_string" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearO2String() { - if (HasO2String) { - ClearO2(); - } - } private object o1_; /// Enum of possible cases for the "o1" oneof. @@ -2147,13 +1893,11 @@ namespace UnitTest.Issues.TestProtos { } private O1OneofCase o1Case_ = O1OneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public O1OneofCase O1Case { get { return o1Case_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearO1() { o1Case_ = O1OneofCase.None; o1_ = null; @@ -2168,26 +1912,22 @@ namespace UnitTest.Issues.TestProtos { } private O2OneofCase o2Case_ = O2OneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public O2OneofCase O2Case { get { return o2Case_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearO2() { o2Case_ = O2OneofCase.None; o2_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestJsonFieldOrdering); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestJsonFieldOrdering other) { if (ReferenceEquals(other, null)) { return false; @@ -2207,15 +1947,14 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode(); - if (HasO1String) hash ^= O1String.GetHashCode(); - if (HasO1Int32) hash ^= O1Int32.GetHashCode(); + if (o1Case_ == O1OneofCase.O1String) hash ^= O1String.GetHashCode(); + if (o1Case_ == O1OneofCase.O1Int32) hash ^= O1Int32.GetHashCode(); if (PlainString.Length != 0) hash ^= PlainString.GetHashCode(); - if (HasO2Int32) hash ^= O2Int32.GetHashCode(); - if (HasO2String) hash ^= O2String.GetHashCode(); + if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode(); + if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode(); hash ^= (int) o1Case_; hash ^= (int) o2Case_; if (_unknownFields != null) { @@ -2225,13 +1964,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2240,11 +1977,11 @@ namespace UnitTest.Issues.TestProtos { output.WriteRawTag(10); output.WriteString(PlainString); } - if (HasO1String) { + if (o1Case_ == O1OneofCase.O1String) { output.WriteRawTag(18); output.WriteString(O1String); } - if (HasO2String) { + if (o2Case_ == O2OneofCase.O2String) { output.WriteRawTag(26); output.WriteString(O2String); } @@ -2252,11 +1989,11 @@ namespace UnitTest.Issues.TestProtos { output.WriteRawTag(32); output.WriteInt32(PlainInt32); } - if (HasO1Int32) { + if (o1Case_ == O1OneofCase.O1Int32) { output.WriteRawTag(40); output.WriteInt32(O1Int32); } - if (HasO2Int32) { + if (o2Case_ == O2OneofCase.O2Int32) { output.WriteRawTag(48); output.WriteInt32(O2Int32); } @@ -2268,17 +2005,16 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (PlainString.Length != 0) { output.WriteRawTag(10); output.WriteString(PlainString); } - if (HasO1String) { + if (o1Case_ == O1OneofCase.O1String) { output.WriteRawTag(18); output.WriteString(O1String); } - if (HasO2String) { + if (o2Case_ == O2OneofCase.O2String) { output.WriteRawTag(26); output.WriteString(O2String); } @@ -2286,11 +2022,11 @@ namespace UnitTest.Issues.TestProtos { output.WriteRawTag(32); output.WriteInt32(PlainInt32); } - if (HasO1Int32) { + if (o1Case_ == O1OneofCase.O1Int32) { output.WriteRawTag(40); output.WriteInt32(O1Int32); } - if (HasO2Int32) { + if (o2Case_ == O2OneofCase.O2Int32) { output.WriteRawTag(48); output.WriteInt32(O2Int32); } @@ -2301,25 +2037,24 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (PlainInt32 != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainInt32); } - if (HasO1String) { + if (o1Case_ == O1OneofCase.O1String) { size += 1 + pb::CodedOutputStream.ComputeStringSize(O1String); } - if (HasO1Int32) { + if (o1Case_ == O1OneofCase.O1Int32) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(O1Int32); } if (PlainString.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(PlainString); } - if (HasO2Int32) { + if (o2Case_ == O2OneofCase.O2Int32) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(O2Int32); } - if (HasO2String) { + if (o2Case_ == O2OneofCase.O2String) { size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String); } if (_unknownFields != null) { @@ -2329,7 +2064,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestJsonFieldOrdering other) { if (other == null) { return; @@ -2362,7 +2096,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2404,7 +2137,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2443,7 +2175,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestJsonName : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2452,23 +2183,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonName()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName() { OnConstruction(); } @@ -2476,7 +2203,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName(TestJsonName other) : this() { name_ = other.name_; description_ = other.description_; @@ -2485,7 +2211,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName Clone() { return new TestJsonName(this); } @@ -2497,7 +2222,6 @@ namespace UnitTest.Issues.TestProtos { /// Message for testing the effects for of the json_name option /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -2509,7 +2233,6 @@ namespace UnitTest.Issues.TestProtos { public const int DescriptionFieldNumber = 2; private string description_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Description { get { return description_; } set { @@ -2521,7 +2244,6 @@ namespace UnitTest.Issues.TestProtos { public const int GuidFieldNumber = 3; private string guid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Guid { get { return guid_; } set { @@ -2530,13 +2252,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestJsonName); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestJsonName other) { if (ReferenceEquals(other, null)) { return false; @@ -2551,7 +2271,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -2564,13 +2283,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2595,7 +2312,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -2616,7 +2332,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -2635,7 +2350,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestJsonName other) { if (other == null) { return; @@ -2653,7 +2367,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2683,7 +2396,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2715,7 +2427,6 @@ namespace UnitTest.Issues.TestProtos { /// oneof case, which is itself a message type, the submessages should /// be merged. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OneofMerging : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2724,23 +2435,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofMerging()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofMerging() { OnConstruction(); } @@ -2748,7 +2455,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofMerging(OneofMerging other) : this() { switch (other.ValueCase) { case ValueOneofCase.Text: @@ -2763,7 +2469,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofMerging Clone() { return new OneofMerging(this); } @@ -2771,33 +2476,17 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "text" field. public const int TextFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Text { - get { return HasText ? (string) value_ : ""; } + get { return valueCase_ == ValueOneofCase.Text ? (string) value_ : ""; } set { value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); valueCase_ = ValueOneofCase.Text; } } - /// Gets whether the "text" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasText { - get { return valueCase_ == ValueOneofCase.Text; } - } - /// Clears the value of the oneof if it's currently set to "text" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearText() { - if (HasText) { - ClearValue(); - } - } /// Field number for the "nested" field. public const int NestedFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested Nested { get { return valueCase_ == ValueOneofCase.Nested ? (global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested) value_ : null; } set { @@ -2815,26 +2504,22 @@ namespace UnitTest.Issues.TestProtos { } private ValueOneofCase valueCase_ = ValueOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueOneofCase ValueCase { get { return valueCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneofMerging); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneofMerging other) { if (ReferenceEquals(other, null)) { return false; @@ -2849,10 +2534,9 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasText) hash ^= Text.GetHashCode(); + if (valueCase_ == ValueOneofCase.Text) hash ^= Text.GetHashCode(); if (valueCase_ == ValueOneofCase.Nested) hash ^= Nested.GetHashCode(); hash ^= (int) valueCase_; if (_unknownFields != null) { @@ -2862,18 +2546,16 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (HasText) { + if (valueCase_ == ValueOneofCase.Text) { output.WriteRawTag(10); output.WriteString(Text); } @@ -2889,9 +2571,8 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasText) { + if (valueCase_ == ValueOneofCase.Text) { output.WriteRawTag(10); output.WriteString(Text); } @@ -2906,10 +2587,9 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasText) { + if (valueCase_ == ValueOneofCase.Text) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Text); } if (valueCase_ == ValueOneofCase.Nested) { @@ -2922,7 +2602,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneofMerging other) { if (other == null) { return; @@ -2943,7 +2622,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2974,7 +2652,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3003,9 +2680,7 @@ namespace UnitTest.Issues.TestProtos { #region Nested types /// Container for nested types declared in the OneofMerging message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Nested : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3014,23 +2689,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Nested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.OneofMerging.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Nested() { OnConstruction(); } @@ -3038,7 +2709,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Nested(Nested other) : this() { x_ = other.x_; y_ = other.y_; @@ -3046,7 +2716,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Nested Clone() { return new Nested(this); } @@ -3055,7 +2724,6 @@ namespace UnitTest.Issues.TestProtos { public const int XFieldNumber = 1; private int x_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int X { get { return x_; } set { @@ -3067,7 +2735,6 @@ namespace UnitTest.Issues.TestProtos { public const int YFieldNumber = 2; private int y_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Y { get { return y_; } set { @@ -3076,13 +2743,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Nested); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Nested other) { if (ReferenceEquals(other, null)) { return false; @@ -3096,7 +2761,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (X != 0) hash ^= X.GetHashCode(); @@ -3108,13 +2772,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3135,7 +2797,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (X != 0) { output.WriteRawTag(8); @@ -3152,7 +2813,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (X != 0) { @@ -3168,7 +2828,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Nested other) { if (other == null) { return; @@ -3183,7 +2842,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3209,7 +2867,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3237,7 +2894,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NullValueOutsideStruct : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3246,23 +2902,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NullValueOutsideStruct()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NullValueOutsideStruct() { OnConstruction(); } @@ -3270,7 +2922,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NullValueOutsideStruct(NullValueOutsideStruct other) : this() { switch (other.ValueCase) { case ValueOneofCase.StringValue: @@ -3285,7 +2936,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NullValueOutsideStruct Clone() { return new NullValueOutsideStruct(this); } @@ -3293,54 +2943,24 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "string_value" field. public const int StringValueFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringValue { - get { return HasStringValue ? (string) value_ : ""; } + get { return valueCase_ == ValueOneofCase.StringValue ? (string) value_ : ""; } set { value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); valueCase_ = ValueOneofCase.StringValue; } } - /// Gets whether the "string_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasStringValue { - get { return valueCase_ == ValueOneofCase.StringValue; } - } - /// Clears the value of the oneof if it's currently set to "string_value" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearStringValue() { - if (HasStringValue) { - ClearValue(); - } - } /// Field number for the "null_value" field. public const int NullValueFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { - get { return HasNullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) value_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } + get { return valueCase_ == ValueOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) value_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } set { value_ = value; valueCase_ = ValueOneofCase.NullValue; } } - /// Gets whether the "null_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNullValue { - get { return valueCase_ == ValueOneofCase.NullValue; } - } - /// Clears the value of the oneof if it's currently set to "null_value" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNullValue() { - if (HasNullValue) { - ClearValue(); - } - } private object value_; /// Enum of possible cases for the "value" oneof. @@ -3351,26 +2971,22 @@ namespace UnitTest.Issues.TestProtos { } private ValueOneofCase valueCase_ = ValueOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueOneofCase ValueCase { get { return valueCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NullValueOutsideStruct); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NullValueOutsideStruct other) { if (ReferenceEquals(other, null)) { return false; @@ -3385,11 +3001,10 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasStringValue) hash ^= StringValue.GetHashCode(); - if (HasNullValue) hash ^= NullValue.GetHashCode(); + if (valueCase_ == ValueOneofCase.StringValue) hash ^= StringValue.GetHashCode(); + if (valueCase_ == ValueOneofCase.NullValue) hash ^= NullValue.GetHashCode(); hash ^= (int) valueCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -3398,22 +3013,20 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (HasStringValue) { + if (valueCase_ == ValueOneofCase.StringValue) { output.WriteRawTag(10); output.WriteString(StringValue); } - if (HasNullValue) { + if (valueCase_ == ValueOneofCase.NullValue) { output.WriteRawTag(16); output.WriteEnum((int) NullValue); } @@ -3425,13 +3038,12 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasStringValue) { + if (valueCase_ == ValueOneofCase.StringValue) { output.WriteRawTag(10); output.WriteString(StringValue); } - if (HasNullValue) { + if (valueCase_ == ValueOneofCase.NullValue) { output.WriteRawTag(16); output.WriteEnum((int) NullValue); } @@ -3442,13 +3054,12 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasStringValue) { + if (valueCase_ == ValueOneofCase.StringValue) { size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue); } - if (HasNullValue) { + if (valueCase_ == ValueOneofCase.NullValue) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NullValue); } if (_unknownFields != null) { @@ -3458,7 +3069,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NullValueOutsideStruct other) { if (other == null) { return; @@ -3476,7 +3086,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3503,7 +3112,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3527,7 +3135,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NullValueNotInOneof : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3536,23 +3143,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NullValueNotInOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NullValueNotInOneof() { OnConstruction(); } @@ -3560,14 +3163,12 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NullValueNotInOneof(NullValueNotInOneof other) : this() { nullValue_ = other.nullValue_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NullValueNotInOneof Clone() { return new NullValueNotInOneof(this); } @@ -3576,7 +3177,6 @@ namespace UnitTest.Issues.TestProtos { public const int NullValueFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.NullValue nullValue_ = global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { get { return nullValue_; } set { @@ -3585,13 +3185,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NullValueNotInOneof); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NullValueNotInOneof other) { if (ReferenceEquals(other, null)) { return false; @@ -3604,7 +3202,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) hash ^= NullValue.GetHashCode(); @@ -3615,13 +3212,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3638,7 +3233,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { output.WriteRawTag(16); @@ -3651,7 +3245,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { @@ -3664,7 +3257,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NullValueNotInOneof other) { if (other == null) { return; @@ -3676,7 +3268,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3698,7 +3289,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3717,7 +3307,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MixedRegularAndOptional : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3726,23 +3315,19 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixedRegularAndOptional()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MixedRegularAndOptional() { OnConstruction(); } @@ -3750,7 +3335,6 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MixedRegularAndOptional(MixedRegularAndOptional other) : this() { regularField_ = other.regularField_; optionalField_ = other.optionalField_; @@ -3758,7 +3342,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MixedRegularAndOptional Clone() { return new MixedRegularAndOptional(this); } @@ -3767,7 +3350,6 @@ namespace UnitTest.Issues.TestProtos { public const int RegularFieldFieldNumber = 1; private string regularField_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string RegularField { get { return regularField_; } set { @@ -3777,38 +3359,31 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "optional_field" field. public const int OptionalFieldFieldNumber = 2; - private readonly static string OptionalFieldDefaultValue = ""; - private string optionalField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalField { - get { return optionalField_ ?? OptionalFieldDefaultValue; } + get { return optionalField_ ?? ""; } set { optionalField_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Gets whether the "optional_field" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalField { get { return optionalField_ != null; } } /// Clears the value of the "optional_field" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalField() { optionalField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MixedRegularAndOptional); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MixedRegularAndOptional other) { if (ReferenceEquals(other, null)) { return false; @@ -3822,7 +3397,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (RegularField.Length != 0) hash ^= RegularField.GetHashCode(); @@ -3834,13 +3408,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3861,7 +3433,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (RegularField.Length != 0) { output.WriteRawTag(10); @@ -3878,7 +3449,6 @@ namespace UnitTest.Issues.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (RegularField.Length != 0) { @@ -3894,7 +3464,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MixedRegularAndOptional other) { if (other == null) { return; @@ -3909,7 +3478,6 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3935,7 +3503,6 @@ namespace UnitTest.Issues.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3958,1446 +3525,6 @@ namespace UnitTest.Issues.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class OneofWithNoneField : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofWithNoneField()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofWithNoneField() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofWithNoneField(OneofWithNoneField other) : this() { - switch (other.TestCase) { - case TestOneofCase.X: - X = other.X; - break; - case TestOneofCase.None_: - None = other.None; - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofWithNoneField Clone() { - return new OneofWithNoneField(this); - } - - /// Field number for the "x" field. - public const int XFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string X { - get { return HasX ? (string) test_ : ""; } - set { - test_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - testCase_ = TestOneofCase.X; - } - } - /// Gets whether the "x" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasX { - get { return testCase_ == TestOneofCase.X; } - } - /// Clears the value of the oneof if it's currently set to "x" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearX() { - if (HasX) { - ClearTest(); - } - } - - /// Field number for the "none" field. - public const int NoneFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string None { - get { return HasNone ? (string) test_ : ""; } - set { - test_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - testCase_ = TestOneofCase.None_; - } - } - /// Gets whether the "none" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNone { - get { return testCase_ == TestOneofCase.None_; } - } - /// Clears the value of the oneof if it's currently set to "none" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNone() { - if (HasNone) { - ClearTest(); - } - } - - private object test_; - /// Enum of possible cases for the "test" oneof. - public enum TestOneofCase { - None = 0, - X = 1, - None_ = 2, - } - private TestOneofCase testCase_ = TestOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TestOneofCase TestCase { - get { return testCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearTest() { - testCase_ = TestOneofCase.None; - test_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OneofWithNoneField); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OneofWithNoneField other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (X != other.X) return false; - if (None != other.None) return false; - if (TestCase != other.TestCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasX) hash ^= X.GetHashCode(); - if (HasNone) hash ^= None.GetHashCode(); - hash ^= (int) testCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasX) { - output.WriteRawTag(10); - output.WriteString(X); - } - if (HasNone) { - output.WriteRawTag(18); - output.WriteString(None); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasX) { - output.WriteRawTag(10); - output.WriteString(X); - } - if (HasNone) { - output.WriteRawTag(18); - output.WriteString(None); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasX) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(X); - } - if (HasNone) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(None); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OneofWithNoneField other) { - if (other == null) { - return; - } - switch (other.TestCase) { - case TestOneofCase.X: - X = other.X; - break; - case TestOneofCase.None_: - None = other.None; - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - X = input.ReadString(); - break; - } - case 18: { - None = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - X = input.ReadString(); - break; - } - case 18: { - None = input.ReadString(); - break; - } - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class OneofWithNoneName : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofWithNoneName()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[13]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofWithNoneName() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofWithNoneName(OneofWithNoneName other) : this() { - switch (other.NoneCase) { - case NoneOneofCase.X: - X = other.X; - break; - case NoneOneofCase.Y: - Y = other.Y; - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofWithNoneName Clone() { - return new OneofWithNoneName(this); - } - - /// Field number for the "x" field. - public const int XFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string X { - get { return HasX ? (string) none_ : ""; } - set { - none_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - noneCase_ = NoneOneofCase.X; - } - } - /// Gets whether the "x" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasX { - get { return noneCase_ == NoneOneofCase.X; } - } - /// Clears the value of the oneof if it's currently set to "x" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearX() { - if (HasX) { - ClearNone(); - } - } - - /// Field number for the "y" field. - public const int YFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Y { - get { return HasY ? (string) none_ : ""; } - set { - none_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - noneCase_ = NoneOneofCase.Y; - } - } - /// Gets whether the "y" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasY { - get { return noneCase_ == NoneOneofCase.Y; } - } - /// Clears the value of the oneof if it's currently set to "y" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearY() { - if (HasY) { - ClearNone(); - } - } - - private object none_; - /// Enum of possible cases for the "none" oneof. - public enum NoneOneofCase { - None = 0, - X = 1, - Y = 2, - } - private NoneOneofCase noneCase_ = NoneOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NoneOneofCase NoneCase { - get { return noneCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNone() { - noneCase_ = NoneOneofCase.None; - none_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OneofWithNoneName); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OneofWithNoneName other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (X != other.X) return false; - if (Y != other.Y) return false; - if (NoneCase != other.NoneCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasX) hash ^= X.GetHashCode(); - if (HasY) hash ^= Y.GetHashCode(); - hash ^= (int) noneCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasX) { - output.WriteRawTag(10); - output.WriteString(X); - } - if (HasY) { - output.WriteRawTag(18); - output.WriteString(Y); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasX) { - output.WriteRawTag(10); - output.WriteString(X); - } - if (HasY) { - output.WriteRawTag(18); - output.WriteString(Y); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasX) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(X); - } - if (HasY) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Y); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OneofWithNoneName other) { - if (other == null) { - return; - } - switch (other.NoneCase) { - case NoneOneofCase.X: - X = other.X; - break; - case NoneOneofCase.Y: - Y = other.Y; - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - X = input.ReadString(); - break; - } - case 18: { - Y = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - X = input.ReadString(); - break; - } - case 18: { - Y = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// Issue 8810 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class DisambiguateCommonMembers : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DisambiguateCommonMembers()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[14]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DisambiguateCommonMembers() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DisambiguateCommonMembers(DisambiguateCommonMembers other) : this() { - disambiguateCommonMembers_ = other.disambiguateCommonMembers_; - types_ = other.types_; - descriptor_ = other.descriptor_; - equals_ = other.equals_; - toString_ = other.toString_; - getHashCode_ = other.getHashCode_; - writeTo_ = other.writeTo_; - clone_ = other.clone_; - calculateSize_ = other.calculateSize_; - mergeFrom_ = other.mergeFrom_; - onConstruction_ = other.onConstruction_; - parser_ = other.parser_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DisambiguateCommonMembers Clone() { - return new DisambiguateCommonMembers(this); - } - - /// Field number for the "disambiguate_common_members" field. - public const int DisambiguateCommonMembers_FieldNumber = 1; - private int disambiguateCommonMembers_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int DisambiguateCommonMembers_ { - get { return disambiguateCommonMembers_; } - set { - disambiguateCommonMembers_ = value; - } - } - - /// Field number for the "types" field. - public const int Types_FieldNumber = 2; - private int types_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Types_ { - get { return types_; } - set { - types_ = value; - } - } - - /// Field number for the "descriptor" field. - public const int Descriptor_FieldNumber = 3; - private int descriptor_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Descriptor_ { - get { return descriptor_; } - set { - descriptor_ = value; - } - } - - /// Field number for the "equals" field. - public const int Equals_FieldNumber = 4; - private int equals_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Equals_ { - get { return equals_; } - set { - equals_ = value; - } - } - - /// Field number for the "to_string" field. - public const int ToString_FieldNumber = 5; - private int toString_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int ToString_ { - get { return toString_; } - set { - toString_ = value; - } - } - - /// Field number for the "get_hash_code" field. - public const int GetHashCode_FieldNumber = 6; - private int getHashCode_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int GetHashCode_ { - get { return getHashCode_; } - set { - getHashCode_ = value; - } - } - - /// Field number for the "write_to" field. - public const int WriteTo_FieldNumber = 7; - private int writeTo_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int WriteTo_ { - get { return writeTo_; } - set { - writeTo_ = value; - } - } - - /// Field number for the "clone" field. - public const int Clone_FieldNumber = 8; - private int clone_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Clone_ { - get { return clone_; } - set { - clone_ = value; - } - } - - /// Field number for the "calculate_size" field. - public const int CalculateSize_FieldNumber = 9; - private int calculateSize_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize_ { - get { return calculateSize_; } - set { - calculateSize_ = value; - } - } - - /// Field number for the "merge_from" field. - public const int MergeFrom_FieldNumber = 10; - private int mergeFrom_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int MergeFrom_ { - get { return mergeFrom_; } - set { - mergeFrom_ = value; - } - } - - /// Field number for the "on_construction" field. - public const int OnConstruction_FieldNumber = 11; - private int onConstruction_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int OnConstruction_ { - get { return onConstruction_; } - set { - onConstruction_ = value; - } - } - - /// Field number for the "parser" field. - public const int Parser_FieldNumber = 12; - private int parser_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Parser_ { - get { return parser_; } - set { - parser_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as DisambiguateCommonMembers); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(DisambiguateCommonMembers other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (DisambiguateCommonMembers_ != other.DisambiguateCommonMembers_) return false; - if (Types_ != other.Types_) return false; - if (Descriptor_ != other.Descriptor_) return false; - if (Equals_ != other.Equals_) return false; - if (ToString_ != other.ToString_) return false; - if (GetHashCode_ != other.GetHashCode_) return false; - if (WriteTo_ != other.WriteTo_) return false; - if (Clone_ != other.Clone_) return false; - if (CalculateSize_ != other.CalculateSize_) return false; - if (MergeFrom_ != other.MergeFrom_) return false; - if (OnConstruction_ != other.OnConstruction_) return false; - if (Parser_ != other.Parser_) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (DisambiguateCommonMembers_ != 0) hash ^= DisambiguateCommonMembers_.GetHashCode(); - if (Types_ != 0) hash ^= Types_.GetHashCode(); - if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode(); - if (Equals_ != 0) hash ^= Equals_.GetHashCode(); - if (ToString_ != 0) hash ^= ToString_.GetHashCode(); - if (GetHashCode_ != 0) hash ^= GetHashCode_.GetHashCode(); - if (WriteTo_ != 0) hash ^= WriteTo_.GetHashCode(); - if (Clone_ != 0) hash ^= Clone_.GetHashCode(); - if (CalculateSize_ != 0) hash ^= CalculateSize_.GetHashCode(); - if (MergeFrom_ != 0) hash ^= MergeFrom_.GetHashCode(); - if (OnConstruction_ != 0) hash ^= OnConstruction_.GetHashCode(); - if (Parser_ != 0) hash ^= Parser_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (DisambiguateCommonMembers_ != 0) { - output.WriteRawTag(8); - output.WriteInt32(DisambiguateCommonMembers_); - } - if (Types_ != 0) { - output.WriteRawTag(16); - output.WriteInt32(Types_); - } - if (Descriptor_ != 0) { - output.WriteRawTag(24); - output.WriteInt32(Descriptor_); - } - if (Equals_ != 0) { - output.WriteRawTag(32); - output.WriteInt32(Equals_); - } - if (ToString_ != 0) { - output.WriteRawTag(40); - output.WriteInt32(ToString_); - } - if (GetHashCode_ != 0) { - output.WriteRawTag(48); - output.WriteInt32(GetHashCode_); - } - if (WriteTo_ != 0) { - output.WriteRawTag(56); - output.WriteInt32(WriteTo_); - } - if (Clone_ != 0) { - output.WriteRawTag(64); - output.WriteInt32(Clone_); - } - if (CalculateSize_ != 0) { - output.WriteRawTag(72); - output.WriteInt32(CalculateSize_); - } - if (MergeFrom_ != 0) { - output.WriteRawTag(80); - output.WriteInt32(MergeFrom_); - } - if (OnConstruction_ != 0) { - output.WriteRawTag(88); - output.WriteInt32(OnConstruction_); - } - if (Parser_ != 0) { - output.WriteRawTag(96); - output.WriteInt32(Parser_); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (DisambiguateCommonMembers_ != 0) { - output.WriteRawTag(8); - output.WriteInt32(DisambiguateCommonMembers_); - } - if (Types_ != 0) { - output.WriteRawTag(16); - output.WriteInt32(Types_); - } - if (Descriptor_ != 0) { - output.WriteRawTag(24); - output.WriteInt32(Descriptor_); - } - if (Equals_ != 0) { - output.WriteRawTag(32); - output.WriteInt32(Equals_); - } - if (ToString_ != 0) { - output.WriteRawTag(40); - output.WriteInt32(ToString_); - } - if (GetHashCode_ != 0) { - output.WriteRawTag(48); - output.WriteInt32(GetHashCode_); - } - if (WriteTo_ != 0) { - output.WriteRawTag(56); - output.WriteInt32(WriteTo_); - } - if (Clone_ != 0) { - output.WriteRawTag(64); - output.WriteInt32(Clone_); - } - if (CalculateSize_ != 0) { - output.WriteRawTag(72); - output.WriteInt32(CalculateSize_); - } - if (MergeFrom_ != 0) { - output.WriteRawTag(80); - output.WriteInt32(MergeFrom_); - } - if (OnConstruction_ != 0) { - output.WriteRawTag(88); - output.WriteInt32(OnConstruction_); - } - if (Parser_ != 0) { - output.WriteRawTag(96); - output.WriteInt32(Parser_); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (DisambiguateCommonMembers_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(DisambiguateCommonMembers_); - } - if (Types_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Types_); - } - if (Descriptor_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_); - } - if (Equals_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Equals_); - } - if (ToString_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(ToString_); - } - if (GetHashCode_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(GetHashCode_); - } - if (WriteTo_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(WriteTo_); - } - if (Clone_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Clone_); - } - if (CalculateSize_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(CalculateSize_); - } - if (MergeFrom_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MergeFrom_); - } - if (OnConstruction_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(OnConstruction_); - } - if (Parser_ != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Parser_); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(DisambiguateCommonMembers other) { - if (other == null) { - return; - } - if (other.DisambiguateCommonMembers_ != 0) { - DisambiguateCommonMembers_ = other.DisambiguateCommonMembers_; - } - if (other.Types_ != 0) { - Types_ = other.Types_; - } - if (other.Descriptor_ != 0) { - Descriptor_ = other.Descriptor_; - } - if (other.Equals_ != 0) { - Equals_ = other.Equals_; - } - if (other.ToString_ != 0) { - ToString_ = other.ToString_; - } - if (other.GetHashCode_ != 0) { - GetHashCode_ = other.GetHashCode_; - } - if (other.WriteTo_ != 0) { - WriteTo_ = other.WriteTo_; - } - if (other.Clone_ != 0) { - Clone_ = other.Clone_; - } - if (other.CalculateSize_ != 0) { - CalculateSize_ = other.CalculateSize_; - } - if (other.MergeFrom_ != 0) { - MergeFrom_ = other.MergeFrom_; - } - if (other.OnConstruction_ != 0) { - OnConstruction_ = other.OnConstruction_; - } - if (other.Parser_ != 0) { - Parser_ = other.Parser_; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - DisambiguateCommonMembers_ = input.ReadInt32(); - break; - } - case 16: { - Types_ = input.ReadInt32(); - break; - } - case 24: { - Descriptor_ = input.ReadInt32(); - break; - } - case 32: { - Equals_ = input.ReadInt32(); - break; - } - case 40: { - ToString_ = input.ReadInt32(); - break; - } - case 48: { - GetHashCode_ = input.ReadInt32(); - break; - } - case 56: { - WriteTo_ = input.ReadInt32(); - break; - } - case 64: { - Clone_ = input.ReadInt32(); - break; - } - case 72: { - CalculateSize_ = input.ReadInt32(); - break; - } - case 80: { - MergeFrom_ = input.ReadInt32(); - break; - } - case 88: { - OnConstruction_ = input.ReadInt32(); - break; - } - case 96: { - Parser_ = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - DisambiguateCommonMembers_ = input.ReadInt32(); - break; - } - case 16: { - Types_ = input.ReadInt32(); - break; - } - case 24: { - Descriptor_ = input.ReadInt32(); - break; - } - case 32: { - Equals_ = input.ReadInt32(); - break; - } - case 40: { - ToString_ = input.ReadInt32(); - break; - } - case 48: { - GetHashCode_ = input.ReadInt32(); - break; - } - case 56: { - WriteTo_ = input.ReadInt32(); - break; - } - case 64: { - Clone_ = input.ReadInt32(); - break; - } - case 72: { - CalculateSize_ = input.ReadInt32(); - break; - } - case 80: { - MergeFrom_ = input.ReadInt32(); - break; - } - case 88: { - OnConstruction_ = input.ReadInt32(); - break; - } - case 96: { - Parser_ = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Issue11987Message : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Issue11987Message()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[15]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Issue11987Message() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Issue11987Message(Issue11987Message other) : this() { - a_ = other.a_; - b_ = other.b_; - c_ = other.c_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Issue11987Message Clone() { - return new Issue11987Message(this); - } - - /// Field number for the "a" field. - public const int AFieldNumber = 1; - private int a_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int A { - get { return a_; } - set { - a_ = value; - } - } - - /// Field number for the "b" field. - public const int BFieldNumber = 2; - private int b_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int B { - get { return b_; } - set { - b_ = value; - } - } - - /// Field number for the "c" field. - public const int CFieldNumber = 3; - private int c_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int C { - get { return c_; } - set { - c_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Issue11987Message); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Issue11987Message other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (A != other.A) return false; - if (B != other.B) return false; - if (C != other.C) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (A != 0) hash ^= A.GetHashCode(); - if (B != 0) hash ^= B.GetHashCode(); - if (C != 0) hash ^= C.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (A != 0) { - output.WriteRawTag(8); - output.WriteInt32(A); - } - if (B != 0) { - output.WriteRawTag(16); - output.WriteInt32(B); - } - if (C != 0) { - output.WriteRawTag(24); - output.WriteInt32(C); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (A != 0) { - output.WriteRawTag(8); - output.WriteInt32(A); - } - if (B != 0) { - output.WriteRawTag(16); - output.WriteInt32(B); - } - if (C != 0) { - output.WriteRawTag(24); - output.WriteInt32(C); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (A != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(A); - } - if (B != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(B); - } - if (C != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(C); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Issue11987Message other) { - if (other == null) { - return; - } - if (other.A != 0) { - A = other.A; - } - if (other.B != 0) { - B = other.B; - } - if (other.C != 0) { - C = other.C; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - A = input.ReadInt32(); - break; - } - case 16: { - B = input.ReadInt32(); - break; - } - case 24: { - C = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - A = input.ReadInt32(); - break; - } - case 16: { - B = input.ReadInt32(); - break; - } - case 24: { - C = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - #endregion } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs similarity index 83% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs index d41ef6e4792d193dccf844d2d588ef8adf902182..b81eb573836d0b847a8672525332d86cbd2693ae 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_proto3.proto +// source: unittest_proto3.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { - /// Holder for reflection information generated from csharp/protos/unittest_proto3.proto + /// Holder for reflection information generated from unittest_proto3.proto public static partial class UnittestProto3Reflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_proto3.proto + /// File descriptor for unittest_proto3.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,139 +24,138 @@ namespace Google.Protobuf.TestProtos { static UnittestProto3Reflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiNjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X3Byb3RvMy5wcm90bxIScHJvdG9i", - "dWZfdW5pdHRlc3QzGipjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X2ltcG9ydF9w", - "cm90bzMucHJvdG8i+Q8KDFRlc3RBbGxUeXBlcxIUCgxzaW5nbGVfaW50MzIY", - "ASABKAUSFAoMc2luZ2xlX2ludDY0GAIgASgDEhUKDXNpbmdsZV91aW50MzIY", - "AyABKA0SFQoNc2luZ2xlX3VpbnQ2NBgEIAEoBBIVCg1zaW5nbGVfc2ludDMy", - "GAUgASgREhUKDXNpbmdsZV9zaW50NjQYBiABKBISFgoOc2luZ2xlX2ZpeGVk", - "MzIYByABKAcSFgoOc2luZ2xlX2ZpeGVkNjQYCCABKAYSFwoPc2luZ2xlX3Nm", - "aXhlZDMyGAkgASgPEhcKD3NpbmdsZV9zZml4ZWQ2NBgKIAEoEBIUCgxzaW5n", - "bGVfZmxvYXQYCyABKAISFQoNc2luZ2xlX2RvdWJsZRgMIAEoARITCgtzaW5n", - "bGVfYm9vbBgNIAEoCBIVCg1zaW5nbGVfc3RyaW5nGA4gASgJEhQKDHNpbmds", - "ZV9ieXRlcxgPIAEoDBJNChVzaW5nbGVfbmVzdGVkX21lc3NhZ2UYEiABKAsy", - "Li5wcm90b2J1Zl91bml0dGVzdDMuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3Nh", - "Z2USQgoWc2luZ2xlX2ZvcmVpZ25fbWVzc2FnZRgTIAEoCzIiLnByb3RvYnVm", - "X3VuaXR0ZXN0My5Gb3JlaWduTWVzc2FnZRJGChVzaW5nbGVfaW1wb3J0X21l", - "c3NhZ2UYFCABKAsyJy5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0", - "TWVzc2FnZRJHChJzaW5nbGVfbmVzdGVkX2VudW0YFSABKA4yKy5wcm90b2J1", - "Zl91bml0dGVzdDMuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SPAoTc2luZ2xl", - "X2ZvcmVpZ25fZW51bRgWIAEoDjIfLnByb3RvYnVmX3VuaXR0ZXN0My5Gb3Jl", - "aWduRW51bRJAChJzaW5nbGVfaW1wb3J0X2VudW0YFyABKA4yJC5wcm90b2J1", - "Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bRJTChxzaW5nbGVfcHVibGlj", - "X2ltcG9ydF9tZXNzYWdlGBogASgLMi0ucHJvdG9idWZfdW5pdHRlc3RfaW1w", - "b3J0LlB1YmxpY0ltcG9ydE1lc3NhZ2USFgoOcmVwZWF0ZWRfaW50MzIYHyAD", - "KAUSFgoOcmVwZWF0ZWRfaW50NjQYICADKAMSFwoPcmVwZWF0ZWRfdWludDMy", - "GCEgAygNEhcKD3JlcGVhdGVkX3VpbnQ2NBgiIAMoBBIXCg9yZXBlYXRlZF9z", - "aW50MzIYIyADKBESFwoPcmVwZWF0ZWRfc2ludDY0GCQgAygSEhgKEHJlcGVh", - "dGVkX2ZpeGVkMzIYJSADKAcSGAoQcmVwZWF0ZWRfZml4ZWQ2NBgmIAMoBhIZ", - "ChFyZXBlYXRlZF9zZml4ZWQzMhgnIAMoDxIZChFyZXBlYXRlZF9zZml4ZWQ2", - "NBgoIAMoEBIWCg5yZXBlYXRlZF9mbG9hdBgpIAMoAhIXCg9yZXBlYXRlZF9k", - "b3VibGUYKiADKAESFQoNcmVwZWF0ZWRfYm9vbBgrIAMoCBIXCg9yZXBlYXRl", - "ZF9zdHJpbmcYLCADKAkSFgoOcmVwZWF0ZWRfYnl0ZXMYLSADKAwSTwoXcmVw", - "ZWF0ZWRfbmVzdGVkX21lc3NhZ2UYMCADKAsyLi5wcm90b2J1Zl91bml0dGVz", - "dDMuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2USRAoYcmVwZWF0ZWRfZm9y", - "ZWlnbl9tZXNzYWdlGDEgAygLMiIucHJvdG9idWZfdW5pdHRlc3QzLkZvcmVp", - "Z25NZXNzYWdlEkgKF3JlcGVhdGVkX2ltcG9ydF9tZXNzYWdlGDIgAygLMicu", - "cHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0LkltcG9ydE1lc3NhZ2USSQoUcmVw", - "ZWF0ZWRfbmVzdGVkX2VudW0YMyADKA4yKy5wcm90b2J1Zl91bml0dGVzdDMu", - "VGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SPgoVcmVwZWF0ZWRfZm9yZWlnbl9l", - "bnVtGDQgAygOMh8ucHJvdG9idWZfdW5pdHRlc3QzLkZvcmVpZ25FbnVtEkIK", - "FHJlcGVhdGVkX2ltcG9ydF9lbnVtGDUgAygOMiQucHJvdG9idWZfdW5pdHRl", - "c3RfaW1wb3J0LkltcG9ydEVudW0SVQoecmVwZWF0ZWRfcHVibGljX2ltcG9y", - "dF9tZXNzYWdlGDYgAygLMi0ucHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0LlB1", - "YmxpY0ltcG9ydE1lc3NhZ2USFgoMb25lb2ZfdWludDMyGG8gASgNSAASTgoU", - "b25lb2ZfbmVzdGVkX21lc3NhZ2UYcCABKAsyLi5wcm90b2J1Zl91bml0dGVz", - "dDMuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2VIABIWCgxvbmVvZl9zdHJp", - "bmcYcSABKAlIABIVCgtvbmVvZl9ieXRlcxhyIAEoDEgAGhsKDU5lc3RlZE1l", - "c3NhZ2USCgoCYmIYASABKAUiVgoKTmVzdGVkRW51bRIbChdORVNURURfRU5V", - "TV9VTlNQRUNJRklFRBAAEgcKA0ZPTxABEgcKA0JBUhACEgcKA0JBWhADEhAK", - "A05FRxD///////////8BQg0KC29uZW9mX2ZpZWxkIr4BChJOZXN0ZWRUZXN0", - "QWxsVHlwZXMSNQoFY2hpbGQYASABKAsyJi5wcm90b2J1Zl91bml0dGVzdDMu", - "TmVzdGVkVGVzdEFsbFR5cGVzEjEKB3BheWxvYWQYAiABKAsyIC5wcm90b2J1", - "Zl91bml0dGVzdDMuVGVzdEFsbFR5cGVzEj4KDnJlcGVhdGVkX2NoaWxkGAMg", - "AygLMiYucHJvdG9idWZfdW5pdHRlc3QzLk5lc3RlZFRlc3RBbGxUeXBlcyI0", - "ChRUZXN0RGVwcmVjYXRlZEZpZWxkcxIcChBkZXByZWNhdGVkX2ludDMyGAEg", - "ASgFQgIYASIbCg5Gb3JlaWduTWVzc2FnZRIJCgFjGAEgASgFIjAKElRlc3RS", - "ZXNlcnZlZEZpZWxkc0oECAIQA0oECA8QEEoECAkQDFIDYmFyUgNiYXoiWwoR", - "VGVzdEZvcmVpZ25OZXN0ZWQSRgoOZm9yZWlnbl9uZXN0ZWQYASABKAsyLi5w", - "cm90b2J1Zl91bml0dGVzdDMuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2Ui", - "NAoYVGVzdFJlYWxseUxhcmdlVGFnTnVtYmVyEgkKAWEYASABKAUSDQoCYmIY", - "////fyABKAUiVgoUVGVzdFJlY3Vyc2l2ZU1lc3NhZ2USMwoBYRgBIAEoCzIo", - "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0UmVjdXJzaXZlTWVzc2FnZRIJCgFp", - "GAIgASgFIkwKFFRlc3RNdXR1YWxSZWN1cnNpb25BEjQKAmJiGAEgASgLMigu", - "cHJvdG9idWZfdW5pdHRlc3QzLlRlc3RNdXR1YWxSZWN1cnNpb25CImMKFFRl", - "c3RNdXR1YWxSZWN1cnNpb25CEjMKAWEYASABKAsyKC5wcm90b2J1Zl91bml0", - "dGVzdDMuVGVzdE11dHVhbFJlY3Vyc2lvbkESFgoOb3B0aW9uYWxfaW50MzIY", - "AiABKAUiTQoSVGVzdEVudW1BbGxvd0FsaWFzEjcKBXZhbHVlGAEgASgOMigu", - "cHJvdG9idWZfdW5pdHRlc3QzLlRlc3RFbnVtV2l0aER1cFZhbHVlIu8CChdU", - "ZXN0Q2FtZWxDYXNlRmllbGROYW1lcxIWCg5QcmltaXRpdmVGaWVsZBgBIAEo", - "BRITCgtTdHJpbmdGaWVsZBgCIAEoCRIyCglFbnVtRmllbGQYAyABKA4yHy5w", - "cm90b2J1Zl91bml0dGVzdDMuRm9yZWlnbkVudW0SOAoMTWVzc2FnZUZpZWxk", - "GAQgASgLMiIucHJvdG9idWZfdW5pdHRlc3QzLkZvcmVpZ25NZXNzYWdlEh4K", - "FlJlcGVhdGVkUHJpbWl0aXZlRmllbGQYByADKAUSGwoTUmVwZWF0ZWRTdHJp", - "bmdGaWVsZBgIIAMoCRI6ChFSZXBlYXRlZEVudW1GaWVsZBgJIAMoDjIfLnBy", - "b3RvYnVmX3VuaXR0ZXN0My5Gb3JlaWduRW51bRJAChRSZXBlYXRlZE1lc3Nh", - "Z2VGaWVsZBgKIAMoCzIiLnByb3RvYnVmX3VuaXR0ZXN0My5Gb3JlaWduTWVz", - "c2FnZSLIAQoSVGVzdEZpZWxkT3JkZXJpbmdzEhEKCW15X3N0cmluZxgLIAEo", - "CRIOCgZteV9pbnQYASABKAMSEAoIbXlfZmxvYXQYZSABKAISVAoVc2luZ2xl", - "X25lc3RlZF9tZXNzYWdlGMgBIAEoCzI0LnByb3RvYnVmX3VuaXR0ZXN0My5U", - "ZXN0RmllbGRPcmRlcmluZ3MuTmVzdGVkTWVzc2FnZRonCg1OZXN0ZWRNZXNz", - "YWdlEgoKAm9vGAIgASgDEgoKAmJiGAEgASgFIkwKEVNwYXJzZUVudW1NZXNz", - "YWdlEjcKC3NwYXJzZV9lbnVtGAEgASgOMiIucHJvdG9idWZfdW5pdHRlc3Qz", - "LlRlc3RTcGFyc2VFbnVtIhkKCU9uZVN0cmluZxIMCgRkYXRhGAEgASgJIhoK", - "Ck1vcmVTdHJpbmcSDAoEZGF0YRgBIAMoCSIYCghPbmVCeXRlcxIMCgRkYXRh", - "GAEgASgMIhkKCU1vcmVCeXRlcxIMCgRkYXRhGAEgASgMIhwKDEludDMyTWVz", - "c2FnZRIMCgRkYXRhGAEgASgFIh0KDVVpbnQzMk1lc3NhZ2USDAoEZGF0YRgB", - "IAEoDSIcCgxJbnQ2NE1lc3NhZ2USDAoEZGF0YRgBIAEoAyIdCg1VaW50NjRN", - "ZXNzYWdlEgwKBGRhdGEYASABKAQiGwoLQm9vbE1lc3NhZ2USDAoEZGF0YRgB", - "IAEoCCJ0CglUZXN0T25lb2YSEQoHZm9vX2ludBgBIAEoBUgAEhQKCmZvb19z", - "dHJpbmcYAiABKAlIABI3Cgtmb29fbWVzc2FnZRgDIAEoCzIgLnByb3RvYnVm", - "X3VuaXR0ZXN0My5UZXN0QWxsVHlwZXNIAEIFCgNmb28iqwMKD1Rlc3RQYWNr", - "ZWRUeXBlcxIYCgxwYWNrZWRfaW50MzIYWiADKAVCAhABEhgKDHBhY2tlZF9p", - "bnQ2NBhbIAMoA0ICEAESGQoNcGFja2VkX3VpbnQzMhhcIAMoDUICEAESGQoN", - "cGFja2VkX3VpbnQ2NBhdIAMoBEICEAESGQoNcGFja2VkX3NpbnQzMhheIAMo", - "EUICEAESGQoNcGFja2VkX3NpbnQ2NBhfIAMoEkICEAESGgoOcGFja2VkX2Zp", - "eGVkMzIYYCADKAdCAhABEhoKDnBhY2tlZF9maXhlZDY0GGEgAygGQgIQARIb", - "Cg9wYWNrZWRfc2ZpeGVkMzIYYiADKA9CAhABEhsKD3BhY2tlZF9zZml4ZWQ2", - "NBhjIAMoEEICEAESGAoMcGFja2VkX2Zsb2F0GGQgAygCQgIQARIZCg1wYWNr", - "ZWRfZG91YmxlGGUgAygBQgIQARIXCgtwYWNrZWRfYm9vbBhmIAMoCEICEAES", - "OAoLcGFja2VkX2VudW0YZyADKA4yHy5wcm90b2J1Zl91bml0dGVzdDMuRm9y", - "ZWlnbkVudW1CAhABIskDChFUZXN0VW5wYWNrZWRUeXBlcxIaCg51bnBhY2tl", - "ZF9pbnQzMhhaIAMoBUICEAASGgoOdW5wYWNrZWRfaW50NjQYWyADKANCAhAA", - "EhsKD3VucGFja2VkX3VpbnQzMhhcIAMoDUICEAASGwoPdW5wYWNrZWRfdWlu", - "dDY0GF0gAygEQgIQABIbCg91bnBhY2tlZF9zaW50MzIYXiADKBFCAhAAEhsK", - "D3VucGFja2VkX3NpbnQ2NBhfIAMoEkICEAASHAoQdW5wYWNrZWRfZml4ZWQz", - "MhhgIAMoB0ICEAASHAoQdW5wYWNrZWRfZml4ZWQ2NBhhIAMoBkICEAASHQoR", - "dW5wYWNrZWRfc2ZpeGVkMzIYYiADKA9CAhAAEh0KEXVucGFja2VkX3NmaXhl", - "ZDY0GGMgAygQQgIQABIaCg51bnBhY2tlZF9mbG9hdBhkIAMoAkICEAASGwoP", - "dW5wYWNrZWRfZG91YmxlGGUgAygBQgIQABIZCg11bnBhY2tlZF9ib29sGGYg", - "AygIQgIQABI6Cg11bnBhY2tlZF9lbnVtGGcgAygOMh8ucHJvdG9idWZfdW5p", - "dHRlc3QzLkZvcmVpZ25FbnVtQgIQACLAAQojVGVzdFJlcGVhdGVkU2NhbGFy", - "RGlmZmVyZW50VGFnU2l6ZXMSGAoQcmVwZWF0ZWRfZml4ZWQzMhgMIAMoBxIW", - "Cg5yZXBlYXRlZF9pbnQzMhgNIAMoBRIZChByZXBlYXRlZF9maXhlZDY0GP4P", - "IAMoBhIXCg5yZXBlYXRlZF9pbnQ2NBj/DyADKAMSGAoOcmVwZWF0ZWRfZmxv", - "YXQY/v8PIAMoAhIZCg9yZXBlYXRlZF91aW50NjQY//8PIAMoBCIoChtUZXN0", - "Q29tbWVudEluamVjdGlvbk1lc3NhZ2USCQoBYRgBIAEoCSIMCgpGb29SZXF1", - "ZXN0Ig0KC0Zvb1Jlc3BvbnNlIhIKEEZvb0NsaWVudE1lc3NhZ2UiEgoQRm9v", - "U2VydmVyTWVzc2FnZSIMCgpCYXJSZXF1ZXN0Ig0KC0JhclJlc3BvbnNlIhIK", - "EFRlc3RFbXB0eU1lc3NhZ2UicAoOQ29tbWVudE1lc3NhZ2USDAoEdGV4dBgB", - "IAEoCRorChROZXN0ZWRDb21tZW50TWVzc2FnZRITCgtuZXN0ZWRfdGV4dBgB", - "IAEoCSIjChFOZXN0ZWRDb21tZW50RW51bRIOCgpaRVJPX1ZBTFVFEAAqWQoL", - "Rm9yZWlnbkVudW0SFwoTRk9SRUlHTl9VTlNQRUNJRklFRBAAEg8KC0ZPUkVJ", - "R05fRk9PEAQSDwoLRk9SRUlHTl9CQVIQBRIPCgtGT1JFSUdOX0JBWhAGKnUK", - "FFRlc3RFbnVtV2l0aER1cFZhbHVlEigKJFRFU1RfRU5VTV9XSVRIX0RVUF9W", - "QUxVRV9VTlNQRUNJRklFRBAAEggKBEZPTzEQARIICgRCQVIxEAISBwoDQkFa", - "EAMSCAoERk9PMhABEggKBEJBUjIQAhoCEAEqnQEKDlRlc3RTcGFyc2VFbnVt", - "EiAKHFRFU1RfU1BBUlNFX0VOVU1fVU5TUEVDSUZJRUQQABIMCghTUEFSU0Vf", - "QRB7Eg4KCFNQQVJTRV9CEKbnAxIPCghTUEFSU0VfQxCysYAGEhUKCFNQQVJT", - "RV9EEPH//////////wESFQoIU1BBUlNFX0UQtN78////////ARIMCghTUEFS", - "U0VfRxACKh0KC0NvbW1lbnRFbnVtEg4KClpFUk9fVkFMVUUQADKdAQoLVGVz", - "dFNlcnZpY2USRgoDRm9vEh4ucHJvdG9idWZfdW5pdHRlc3QzLkZvb1JlcXVl", - "c3QaHy5wcm90b2J1Zl91bml0dGVzdDMuRm9vUmVzcG9uc2USRgoDQmFyEh4u", - "cHJvdG9idWZfdW5pdHRlc3QzLkJhclJlcXVlc3QaHy5wcm90b2J1Zl91bml0", - "dGVzdDMuQmFyUmVzcG9uc2VCLEINVW5pdHRlc3RQcm90b6oCGkdvb2dsZS5Q", - "cm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); + "ChV1bml0dGVzdF9wcm90bzMucHJvdG8SEnByb3RvYnVmX3VuaXR0ZXN0Mxoc", + "dW5pdHRlc3RfaW1wb3J0X3Byb3RvMy5wcm90byL5DwoMVGVzdEFsbFR5cGVz", + "EhQKDHNpbmdsZV9pbnQzMhgBIAEoBRIUCgxzaW5nbGVfaW50NjQYAiABKAMS", + "FQoNc2luZ2xlX3VpbnQzMhgDIAEoDRIVCg1zaW5nbGVfdWludDY0GAQgASgE", + "EhUKDXNpbmdsZV9zaW50MzIYBSABKBESFQoNc2luZ2xlX3NpbnQ2NBgGIAEo", + "EhIWCg5zaW5nbGVfZml4ZWQzMhgHIAEoBxIWCg5zaW5nbGVfZml4ZWQ2NBgI", + "IAEoBhIXCg9zaW5nbGVfc2ZpeGVkMzIYCSABKA8SFwoPc2luZ2xlX3NmaXhl", + "ZDY0GAogASgQEhQKDHNpbmdsZV9mbG9hdBgLIAEoAhIVCg1zaW5nbGVfZG91", + "YmxlGAwgASgBEhMKC3NpbmdsZV9ib29sGA0gASgIEhUKDXNpbmdsZV9zdHJp", + "bmcYDiABKAkSFAoMc2luZ2xlX2J5dGVzGA8gASgMEk0KFXNpbmdsZV9uZXN0", + "ZWRfbWVzc2FnZRgSIAEoCzIuLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QWxs", + "VHlwZXMuTmVzdGVkTWVzc2FnZRJCChZzaW5nbGVfZm9yZWlnbl9tZXNzYWdl", + "GBMgASgLMiIucHJvdG9idWZfdW5pdHRlc3QzLkZvcmVpZ25NZXNzYWdlEkYK", + "FXNpbmdsZV9pbXBvcnRfbWVzc2FnZRgUIAEoCzInLnByb3RvYnVmX3VuaXR0", + "ZXN0X2ltcG9ydC5JbXBvcnRNZXNzYWdlEkcKEnNpbmdsZV9uZXN0ZWRfZW51", + "bRgVIAEoDjIrLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QWxsVHlwZXMuTmVz", + "dGVkRW51bRI8ChNzaW5nbGVfZm9yZWlnbl9lbnVtGBYgASgOMh8ucHJvdG9i", + "dWZfdW5pdHRlc3QzLkZvcmVpZ25FbnVtEkAKEnNpbmdsZV9pbXBvcnRfZW51", + "bRgXIAEoDjIkLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydC5JbXBvcnRFbnVt", + "ElMKHHNpbmdsZV9wdWJsaWNfaW1wb3J0X21lc3NhZ2UYGiABKAsyLS5wcm90", + "b2J1Zl91bml0dGVzdF9pbXBvcnQuUHVibGljSW1wb3J0TWVzc2FnZRIWCg5y", + "ZXBlYXRlZF9pbnQzMhgfIAMoBRIWCg5yZXBlYXRlZF9pbnQ2NBggIAMoAxIX", + "Cg9yZXBlYXRlZF91aW50MzIYISADKA0SFwoPcmVwZWF0ZWRfdWludDY0GCIg", + "AygEEhcKD3JlcGVhdGVkX3NpbnQzMhgjIAMoERIXCg9yZXBlYXRlZF9zaW50", + "NjQYJCADKBISGAoQcmVwZWF0ZWRfZml4ZWQzMhglIAMoBxIYChByZXBlYXRl", + "ZF9maXhlZDY0GCYgAygGEhkKEXJlcGVhdGVkX3NmaXhlZDMyGCcgAygPEhkK", + "EXJlcGVhdGVkX3NmaXhlZDY0GCggAygQEhYKDnJlcGVhdGVkX2Zsb2F0GCkg", + "AygCEhcKD3JlcGVhdGVkX2RvdWJsZRgqIAMoARIVCg1yZXBlYXRlZF9ib29s", + "GCsgAygIEhcKD3JlcGVhdGVkX3N0cmluZxgsIAMoCRIWCg5yZXBlYXRlZF9i", + "eXRlcxgtIAMoDBJPChdyZXBlYXRlZF9uZXN0ZWRfbWVzc2FnZRgwIAMoCzIu", + "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2Fn", + "ZRJEChhyZXBlYXRlZF9mb3JlaWduX21lc3NhZ2UYMSADKAsyIi5wcm90b2J1", + "Zl91bml0dGVzdDMuRm9yZWlnbk1lc3NhZ2USSAoXcmVwZWF0ZWRfaW1wb3J0", + "X21lc3NhZ2UYMiADKAsyJy5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1w", + "b3J0TWVzc2FnZRJJChRyZXBlYXRlZF9uZXN0ZWRfZW51bRgzIAMoDjIrLnBy", + "b3RvYnVmX3VuaXR0ZXN0My5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bRI+ChVy", + "ZXBlYXRlZF9mb3JlaWduX2VudW0YNCADKA4yHy5wcm90b2J1Zl91bml0dGVz", + "dDMuRm9yZWlnbkVudW0SQgoUcmVwZWF0ZWRfaW1wb3J0X2VudW0YNSADKA4y", + "JC5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bRJVCh5yZXBl", + "YXRlZF9wdWJsaWNfaW1wb3J0X21lc3NhZ2UYNiADKAsyLS5wcm90b2J1Zl91", + "bml0dGVzdF9pbXBvcnQuUHVibGljSW1wb3J0TWVzc2FnZRIWCgxvbmVvZl91", + "aW50MzIYbyABKA1IABJOChRvbmVvZl9uZXN0ZWRfbWVzc2FnZRhwIAEoCzIu", + "LnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2Fn", + "ZUgAEhYKDG9uZW9mX3N0cmluZxhxIAEoCUgAEhUKC29uZW9mX2J5dGVzGHIg", + "ASgMSAAaGwoNTmVzdGVkTWVzc2FnZRIKCgJiYhgBIAEoBSJWCgpOZXN0ZWRF", + "bnVtEhsKF05FU1RFRF9FTlVNX1VOU1BFQ0lGSUVEEAASBwoDRk9PEAESBwoD", + "QkFSEAISBwoDQkFaEAMSEAoDTkVHEP///////////wFCDQoLb25lb2ZfZmll", + "bGQivgEKEk5lc3RlZFRlc3RBbGxUeXBlcxI1CgVjaGlsZBgBIAEoCzImLnBy", + "b3RvYnVmX3VuaXR0ZXN0My5OZXN0ZWRUZXN0QWxsVHlwZXMSMQoHcGF5bG9h", + "ZBgCIAEoCzIgLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QWxsVHlwZXMSPgoO", + "cmVwZWF0ZWRfY2hpbGQYAyADKAsyJi5wcm90b2J1Zl91bml0dGVzdDMuTmVz", + "dGVkVGVzdEFsbFR5cGVzIjQKFFRlc3REZXByZWNhdGVkRmllbGRzEhwKEGRl", + "cHJlY2F0ZWRfaW50MzIYASABKAVCAhgBIhsKDkZvcmVpZ25NZXNzYWdlEgkK", + "AWMYASABKAUiMAoSVGVzdFJlc2VydmVkRmllbGRzSgQIAhADSgQIDxAQSgQI", + "CRAMUgNiYXJSA2JheiJbChFUZXN0Rm9yZWlnbk5lc3RlZBJGCg5mb3JlaWdu", + "X25lc3RlZBgBIAEoCzIuLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0QWxsVHlw", + "ZXMuTmVzdGVkTWVzc2FnZSI0ChhUZXN0UmVhbGx5TGFyZ2VUYWdOdW1iZXIS", + "CQoBYRgBIAEoBRINCgJiYhj///9/IAEoBSJWChRUZXN0UmVjdXJzaXZlTWVz", + "c2FnZRIzCgFhGAEgASgLMigucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RSZWN1", + "cnNpdmVNZXNzYWdlEgkKAWkYAiABKAUiTAoUVGVzdE11dHVhbFJlY3Vyc2lv", + "bkESNAoCYmIYASABKAsyKC5wcm90b2J1Zl91bml0dGVzdDMuVGVzdE11dHVh", + "bFJlY3Vyc2lvbkIiYwoUVGVzdE11dHVhbFJlY3Vyc2lvbkISMwoBYRgBIAEo", + "CzIoLnByb3RvYnVmX3VuaXR0ZXN0My5UZXN0TXV0dWFsUmVjdXJzaW9uQRIW", + "Cg5vcHRpb25hbF9pbnQzMhgCIAEoBSJNChJUZXN0RW51bUFsbG93QWxpYXMS", + "NwoFdmFsdWUYASABKA4yKC5wcm90b2J1Zl91bml0dGVzdDMuVGVzdEVudW1X", + "aXRoRHVwVmFsdWUi7wIKF1Rlc3RDYW1lbENhc2VGaWVsZE5hbWVzEhYKDlBy", + "aW1pdGl2ZUZpZWxkGAEgASgFEhMKC1N0cmluZ0ZpZWxkGAIgASgJEjIKCUVu", + "dW1GaWVsZBgDIAEoDjIfLnByb3RvYnVmX3VuaXR0ZXN0My5Gb3JlaWduRW51", + "bRI4CgxNZXNzYWdlRmllbGQYBCABKAsyIi5wcm90b2J1Zl91bml0dGVzdDMu", + "Rm9yZWlnbk1lc3NhZ2USHgoWUmVwZWF0ZWRQcmltaXRpdmVGaWVsZBgHIAMo", + "BRIbChNSZXBlYXRlZFN0cmluZ0ZpZWxkGAggAygJEjoKEVJlcGVhdGVkRW51", + "bUZpZWxkGAkgAygOMh8ucHJvdG9idWZfdW5pdHRlc3QzLkZvcmVpZ25FbnVt", + "EkAKFFJlcGVhdGVkTWVzc2FnZUZpZWxkGAogAygLMiIucHJvdG9idWZfdW5p", + "dHRlc3QzLkZvcmVpZ25NZXNzYWdlIsgBChJUZXN0RmllbGRPcmRlcmluZ3MS", + "EQoJbXlfc3RyaW5nGAsgASgJEg4KBm15X2ludBgBIAEoAxIQCghteV9mbG9h", + "dBhlIAEoAhJUChVzaW5nbGVfbmVzdGVkX21lc3NhZ2UYyAEgASgLMjQucHJv", + "dG9idWZfdW5pdHRlc3QzLlRlc3RGaWVsZE9yZGVyaW5ncy5OZXN0ZWRNZXNz", + "YWdlGicKDU5lc3RlZE1lc3NhZ2USCgoCb28YAiABKAMSCgoCYmIYASABKAUi", + "TAoRU3BhcnNlRW51bU1lc3NhZ2USNwoLc3BhcnNlX2VudW0YASABKA4yIi5w", + "cm90b2J1Zl91bml0dGVzdDMuVGVzdFNwYXJzZUVudW0iGQoJT25lU3RyaW5n", + "EgwKBGRhdGEYASABKAkiGgoKTW9yZVN0cmluZxIMCgRkYXRhGAEgAygJIhgK", + "CE9uZUJ5dGVzEgwKBGRhdGEYASABKAwiGQoJTW9yZUJ5dGVzEgwKBGRhdGEY", + "ASABKAwiHAoMSW50MzJNZXNzYWdlEgwKBGRhdGEYASABKAUiHQoNVWludDMy", + "TWVzc2FnZRIMCgRkYXRhGAEgASgNIhwKDEludDY0TWVzc2FnZRIMCgRkYXRh", + "GAEgASgDIh0KDVVpbnQ2NE1lc3NhZ2USDAoEZGF0YRgBIAEoBCIbCgtCb29s", + "TWVzc2FnZRIMCgRkYXRhGAEgASgIInQKCVRlc3RPbmVvZhIRCgdmb29faW50", + "GAEgASgFSAASFAoKZm9vX3N0cmluZxgCIAEoCUgAEjcKC2Zvb19tZXNzYWdl", + "GAMgASgLMiAucHJvdG9idWZfdW5pdHRlc3QzLlRlc3RBbGxUeXBlc0gAQgUK", + "A2ZvbyKrAwoPVGVzdFBhY2tlZFR5cGVzEhgKDHBhY2tlZF9pbnQzMhhaIAMo", + "BUICEAESGAoMcGFja2VkX2ludDY0GFsgAygDQgIQARIZCg1wYWNrZWRfdWlu", + "dDMyGFwgAygNQgIQARIZCg1wYWNrZWRfdWludDY0GF0gAygEQgIQARIZCg1w", + "YWNrZWRfc2ludDMyGF4gAygRQgIQARIZCg1wYWNrZWRfc2ludDY0GF8gAygS", + "QgIQARIaCg5wYWNrZWRfZml4ZWQzMhhgIAMoB0ICEAESGgoOcGFja2VkX2Zp", + "eGVkNjQYYSADKAZCAhABEhsKD3BhY2tlZF9zZml4ZWQzMhhiIAMoD0ICEAES", + "GwoPcGFja2VkX3NmaXhlZDY0GGMgAygQQgIQARIYCgxwYWNrZWRfZmxvYXQY", + "ZCADKAJCAhABEhkKDXBhY2tlZF9kb3VibGUYZSADKAFCAhABEhcKC3BhY2tl", + "ZF9ib29sGGYgAygIQgIQARI4CgtwYWNrZWRfZW51bRhnIAMoDjIfLnByb3Rv", + "YnVmX3VuaXR0ZXN0My5Gb3JlaWduRW51bUICEAEiyQMKEVRlc3RVbnBhY2tl", + "ZFR5cGVzEhoKDnVucGFja2VkX2ludDMyGFogAygFQgIQABIaCg51bnBhY2tl", + "ZF9pbnQ2NBhbIAMoA0ICEAASGwoPdW5wYWNrZWRfdWludDMyGFwgAygNQgIQ", + "ABIbCg91bnBhY2tlZF91aW50NjQYXSADKARCAhAAEhsKD3VucGFja2VkX3Np", + "bnQzMhheIAMoEUICEAASGwoPdW5wYWNrZWRfc2ludDY0GF8gAygSQgIQABIc", + "ChB1bnBhY2tlZF9maXhlZDMyGGAgAygHQgIQABIcChB1bnBhY2tlZF9maXhl", + "ZDY0GGEgAygGQgIQABIdChF1bnBhY2tlZF9zZml4ZWQzMhhiIAMoD0ICEAAS", + "HQoRdW5wYWNrZWRfc2ZpeGVkNjQYYyADKBBCAhAAEhoKDnVucGFja2VkX2Zs", + "b2F0GGQgAygCQgIQABIbCg91bnBhY2tlZF9kb3VibGUYZSADKAFCAhAAEhkK", + "DXVucGFja2VkX2Jvb2wYZiADKAhCAhAAEjoKDXVucGFja2VkX2VudW0YZyAD", + "KA4yHy5wcm90b2J1Zl91bml0dGVzdDMuRm9yZWlnbkVudW1CAhAAIsABCiNU", + "ZXN0UmVwZWF0ZWRTY2FsYXJEaWZmZXJlbnRUYWdTaXplcxIYChByZXBlYXRl", + "ZF9maXhlZDMyGAwgAygHEhYKDnJlcGVhdGVkX2ludDMyGA0gAygFEhkKEHJl", + "cGVhdGVkX2ZpeGVkNjQY/g8gAygGEhcKDnJlcGVhdGVkX2ludDY0GP8PIAMo", + "AxIYCg5yZXBlYXRlZF9mbG9hdBj+/w8gAygCEhkKD3JlcGVhdGVkX3VpbnQ2", + "NBj//w8gAygEIigKG1Rlc3RDb21tZW50SW5qZWN0aW9uTWVzc2FnZRIJCgFh", + "GAEgASgJIgwKCkZvb1JlcXVlc3QiDQoLRm9vUmVzcG9uc2UiEgoQRm9vQ2xp", + "ZW50TWVzc2FnZSISChBGb29TZXJ2ZXJNZXNzYWdlIgwKCkJhclJlcXVlc3Qi", + "DQoLQmFyUmVzcG9uc2UiEgoQVGVzdEVtcHR5TWVzc2FnZSJwCg5Db21tZW50", + "TWVzc2FnZRIMCgR0ZXh0GAEgASgJGisKFE5lc3RlZENvbW1lbnRNZXNzYWdl", + "EhMKC25lc3RlZF90ZXh0GAEgASgJIiMKEU5lc3RlZENvbW1lbnRFbnVtEg4K", + "ClpFUk9fVkFMVUUQACpZCgtGb3JlaWduRW51bRIXChNGT1JFSUdOX1VOU1BF", + "Q0lGSUVEEAASDwoLRk9SRUlHTl9GT08QBBIPCgtGT1JFSUdOX0JBUhAFEg8K", + "C0ZPUkVJR05fQkFaEAYqdQoUVGVzdEVudW1XaXRoRHVwVmFsdWUSKAokVEVT", + "VF9FTlVNX1dJVEhfRFVQX1ZBTFVFX1VOU1BFQ0lGSUVEEAASCAoERk9PMRAB", + "EggKBEJBUjEQAhIHCgNCQVoQAxIICgRGT08yEAESCAoEQkFSMhACGgIQASqd", + "AQoOVGVzdFNwYXJzZUVudW0SIAocVEVTVF9TUEFSU0VfRU5VTV9VTlNQRUNJ", + "RklFRBAAEgwKCFNQQVJTRV9BEHsSDgoIU1BBUlNFX0IQpucDEg8KCFNQQVJT", + "RV9DELKxgAYSFQoIU1BBUlNFX0QQ8f//////////ARIVCghTUEFSU0VfRRC0", + "3vz///////8BEgwKCFNQQVJTRV9HEAIqHQoLQ29tbWVudEVudW0SDgoKWkVS", + "T19WQUxVRRAAMp0BCgtUZXN0U2VydmljZRJGCgNGb28SHi5wcm90b2J1Zl91", + "bml0dGVzdDMuRm9vUmVxdWVzdBofLnByb3RvYnVmX3VuaXR0ZXN0My5Gb29S", + "ZXNwb25zZRJGCgNCYXISHi5wcm90b2J1Zl91bml0dGVzdDMuQmFyUmVxdWVz", + "dBofLnByb3RvYnVmX3VuaXR0ZXN0My5CYXJSZXNwb25zZUIsQg1Vbml0dGVz", + "dFByb3RvqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportProto3Reflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ForeignEnum), typeof(global::Google.Protobuf.TestProtos.TestEnumWithDupValue), typeof(global::Google.Protobuf.TestProtos.TestSparseEnum), typeof(global::Google.Protobuf.TestProtos.CommentEnum), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -255,7 +254,6 @@ namespace Google.Protobuf.TestProtos { /// This proto includes every type of field in both singular and repeated /// forms. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestAllTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -264,23 +262,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes() { OnConstruction(); } @@ -288,7 +282,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes(TestAllTypes other) : this() { singleInt32_ = other.singleInt32_; singleInt64_ = other.singleInt64_; @@ -353,7 +346,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes Clone() { return new TestAllTypes(this); } @@ -365,7 +357,6 @@ namespace Google.Protobuf.TestProtos { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SingleInt32 { get { return singleInt32_; } set { @@ -377,7 +368,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleInt64FieldNumber = 2; private long singleInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SingleInt64 { get { return singleInt64_; } set { @@ -389,7 +379,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint32FieldNumber = 3; private uint singleUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint SingleUint32 { get { return singleUint32_; } set { @@ -401,7 +390,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint64FieldNumber = 4; private ulong singleUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong SingleUint64 { get { return singleUint64_; } set { @@ -413,7 +401,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint32FieldNumber = 5; private int singleSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SingleSint32 { get { return singleSint32_; } set { @@ -425,7 +412,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint64FieldNumber = 6; private long singleSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SingleSint64 { get { return singleSint64_; } set { @@ -437,7 +423,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed32FieldNumber = 7; private uint singleFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint SingleFixed32 { get { return singleFixed32_; } set { @@ -449,7 +434,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed64FieldNumber = 8; private ulong singleFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong SingleFixed64 { get { return singleFixed64_; } set { @@ -461,7 +445,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed32FieldNumber = 9; private int singleSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SingleSfixed32 { get { return singleSfixed32_; } set { @@ -473,7 +456,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed64FieldNumber = 10; private long singleSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SingleSfixed64 { get { return singleSfixed64_; } set { @@ -485,7 +467,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleFloatFieldNumber = 11; private float singleFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float SingleFloat { get { return singleFloat_; } set { @@ -497,7 +478,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleDoubleFieldNumber = 12; private double singleDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double SingleDouble { get { return singleDouble_; } set { @@ -509,7 +489,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleBoolFieldNumber = 13; private bool singleBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool SingleBool { get { return singleBool_; } set { @@ -521,7 +500,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleStringFieldNumber = 14; private string singleString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string SingleString { get { return singleString_; } set { @@ -533,7 +511,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleBytesFieldNumber = 15; private pb::ByteString singleBytes_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString SingleBytes { get { return singleBytes_; } set { @@ -545,7 +522,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage singleNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -557,7 +533,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.ForeignMessage singleForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignMessage SingleForeignMessage { get { return singleForeignMessage_; } set { @@ -569,7 +544,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.ImportMessage singleImportMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ImportMessage SingleImportMessage { get { return singleImportMessage_; } set { @@ -581,7 +555,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedEnumFieldNumber = 21; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum singleNestedEnum_ = global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum SingleNestedEnum { get { return singleNestedEnum_; } set { @@ -593,7 +566,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignEnumFieldNumber = 22; private global::Google.Protobuf.TestProtos.ForeignEnum singleForeignEnum_ = global::Google.Protobuf.TestProtos.ForeignEnum.ForeignUnspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignEnum SingleForeignEnum { get { return singleForeignEnum_; } set { @@ -605,7 +577,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportEnumFieldNumber = 23; private global::Google.Protobuf.TestProtos.ImportEnum singleImportEnum_ = global::Google.Protobuf.TestProtos.ImportEnum.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ImportEnum SingleImportEnum { get { return singleImportEnum_; } set { @@ -620,7 +591,6 @@ namespace Google.Protobuf.TestProtos { /// Defined in unittest_import_public.proto /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.PublicImportMessage SinglePublicImportMessage { get { return singlePublicImportMessage_; } set { @@ -637,7 +607,6 @@ namespace Google.Protobuf.TestProtos { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -648,7 +617,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(258); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -659,7 +627,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt32(266); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -670,7 +637,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(274); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -681,7 +647,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt32(282); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -692,7 +657,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt64(290); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -703,7 +667,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed32(298); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -714,7 +677,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed64(306); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -725,7 +687,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed32(314); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -736,7 +697,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed64(322); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -747,7 +707,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFloat(330); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -758,7 +717,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForDouble(338); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -769,7 +727,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBool(346); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -780,7 +737,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -791,7 +747,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -802,7 +757,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -813,7 +767,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -824,7 +777,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.ImportMessage.Parser); private readonly pbc::RepeatedField repeatedImportMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportMessage { get { return repeatedImportMessage_; } } @@ -835,7 +787,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -846,7 +797,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -857,7 +807,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x); private readonly pbc::RepeatedField repeatedImportEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportEnum { get { return repeatedImportEnum_; } } @@ -871,7 +820,6 @@ namespace Google.Protobuf.TestProtos { /// Defined in unittest_import_public.proto /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedPublicImportMessage { get { return repeatedPublicImportMessage_; } } @@ -879,33 +827,17 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { - get { return HasOneofUint32 ? (uint) oneofField_ : 0; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } set { oneofField_ = value; oneofFieldCase_ = OneofFieldOneofCase.OneofUint32; } } - /// Gets whether the "oneof_uint32" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofUint32 { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } - } - /// Clears the value of the oneof if it's currently set to "oneof_uint32" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofUint32() { - if (HasOneofUint32) { - ClearOneofField(); - } - } /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage) oneofField_ : null; } set { @@ -917,54 +849,24 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { - get { return HasOneofString ? (string) oneofField_ : ""; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } set { oneofField_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); oneofFieldCase_ = OneofFieldOneofCase.OneofString; } } - /// Gets whether the "oneof_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofString { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } - } - /// Clears the value of the oneof if it's currently set to "oneof_string" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofString() { - if (HasOneofString) { - ClearOneofField(); - } - } /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { - get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { oneofField_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); oneofFieldCase_ = OneofFieldOneofCase.OneofBytes; } } - /// Gets whether the "oneof_bytes" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofBytes { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } - } - /// Clears the value of the oneof if it's currently set to "oneof_bytes" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofBytes() { - if (HasOneofBytes) { - ClearOneofField(); - } - } private object oneofField_; /// Enum of possible cases for the "oneof_field" oneof. @@ -977,26 +879,22 @@ namespace Google.Protobuf.TestProtos { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -1057,7 +955,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (SingleInt32 != 0) hash ^= SingleInt32.GetHashCode(); @@ -1104,10 +1001,10 @@ namespace Google.Protobuf.TestProtos { hash ^= repeatedForeignEnum_.GetHashCode(); hash ^= repeatedImportEnum_.GetHashCode(); hash ^= repeatedPublicImportMessage_.GetHashCode(); - if (HasOneofUint32) hash ^= OneofUint32.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) hash ^= OneofUint32.GetHashCode(); if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) hash ^= OneofNestedMessage.GetHashCode(); - if (HasOneofString) hash ^= OneofString.GetHashCode(); - if (HasOneofBytes) hash ^= OneofBytes.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) hash ^= OneofString.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) hash ^= OneofBytes.GetHashCode(); hash ^= (int) oneofFieldCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -1116,13 +1013,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1237,7 +1132,7 @@ namespace Google.Protobuf.TestProtos { repeatedForeignEnum_.WriteTo(output, _repeated_repeatedForeignEnum_codec); repeatedImportEnum_.WriteTo(output, _repeated_repeatedImportEnum_codec); repeatedPublicImportMessage_.WriteTo(output, _repeated_repeatedPublicImportMessage_codec); - if (HasOneofUint32) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { output.WriteRawTag(248, 6); output.WriteUInt32(OneofUint32); } @@ -1245,11 +1140,11 @@ namespace Google.Protobuf.TestProtos { output.WriteRawTag(130, 7); output.WriteMessage(OneofNestedMessage); } - if (HasOneofString) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { output.WriteRawTag(138, 7); output.WriteString(OneofString); } - if (HasOneofBytes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { output.WriteRawTag(146, 7); output.WriteBytes(OneofBytes); } @@ -1261,7 +1156,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (SingleInt32 != 0) { output.WriteRawTag(8); @@ -1373,7 +1267,7 @@ namespace Google.Protobuf.TestProtos { repeatedForeignEnum_.WriteTo(ref output, _repeated_repeatedForeignEnum_codec); repeatedImportEnum_.WriteTo(ref output, _repeated_repeatedImportEnum_codec); repeatedPublicImportMessage_.WriteTo(ref output, _repeated_repeatedPublicImportMessage_codec); - if (HasOneofUint32) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { output.WriteRawTag(248, 6); output.WriteUInt32(OneofUint32); } @@ -1381,11 +1275,11 @@ namespace Google.Protobuf.TestProtos { output.WriteRawTag(130, 7); output.WriteMessage(OneofNestedMessage); } - if (HasOneofString) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { output.WriteRawTag(138, 7); output.WriteString(OneofString); } - if (HasOneofBytes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { output.WriteRawTag(146, 7); output.WriteBytes(OneofBytes); } @@ -1396,7 +1290,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (SingleInt32 != 0) { @@ -1487,16 +1380,16 @@ namespace Google.Protobuf.TestProtos { size += repeatedForeignEnum_.CalculateSize(_repeated_repeatedForeignEnum_codec); size += repeatedImportEnum_.CalculateSize(_repeated_repeatedImportEnum_codec); size += repeatedPublicImportMessage_.CalculateSize(_repeated_repeatedPublicImportMessage_codec); - if (HasOneofUint32) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { size += 2 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OneofNestedMessage); } - if (HasOneofString) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { size += 2 + pb::CodedOutputStream.ComputeStringSize(OneofString); } - if (HasOneofBytes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { size += 2 + pb::CodedOutputStream.ComputeBytesSize(OneofBytes); } if (_unknownFields != null) { @@ -1506,7 +1399,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllTypes other) { if (other == null) { return; @@ -1633,7 +1525,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1876,7 +1767,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2117,7 +2007,6 @@ namespace Google.Protobuf.TestProtos { #region Nested types /// Container for nested types declared in the TestAllTypes message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("NESTED_ENUM_UNSPECIFIED")] Unspecified = 0, @@ -2130,7 +2019,6 @@ namespace Google.Protobuf.TestProtos { [pbr::OriginalName("NEG")] Neg = -1, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2139,23 +2027,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestAllTypes.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -2163,14 +2047,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { bb_ = other.bb_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -2184,7 +2066,6 @@ namespace Google.Protobuf.TestProtos { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { return bb_; } set { @@ -2193,13 +2074,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -2212,7 +2091,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Bb != 0) hash ^= Bb.GetHashCode(); @@ -2223,13 +2101,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2246,7 +2122,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Bb != 0) { output.WriteRawTag(8); @@ -2259,7 +2134,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Bb != 0) { @@ -2272,7 +2146,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -2284,7 +2157,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2306,7 +2178,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2333,7 +2204,6 @@ namespace Google.Protobuf.TestProtos { /// /// This proto includes a recursively nested message. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedTestAllTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2342,23 +2212,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes() { OnConstruction(); } @@ -2366,7 +2232,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes(NestedTestAllTypes other) : this() { child_ = other.child_ != null ? other.child_.Clone() : null; payload_ = other.payload_ != null ? other.payload_.Clone() : null; @@ -2375,7 +2240,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes Clone() { return new NestedTestAllTypes(this); } @@ -2384,7 +2248,6 @@ namespace Google.Protobuf.TestProtos { public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.NestedTestAllTypes child_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.NestedTestAllTypes Child { get { return child_; } set { @@ -2396,7 +2259,6 @@ namespace Google.Protobuf.TestProtos { public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.TestAllTypes payload_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes Payload { get { return payload_; } set { @@ -2410,19 +2272,16 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.NestedTestAllTypes.Parser); private readonly pbc::RepeatedField repeatedChild_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedChild { get { return repeatedChild_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedTestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedTestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -2437,7 +2296,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (child_ != null) hash ^= Child.GetHashCode(); @@ -2450,13 +2308,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2478,7 +2334,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (child_ != null) { output.WriteRawTag(10); @@ -2496,7 +2351,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (child_ != null) { @@ -2513,7 +2367,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedTestAllTypes other) { if (other == null) { return; @@ -2535,7 +2388,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2571,7 +2423,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2604,7 +2455,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestDeprecatedFields : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2613,23 +2463,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields() { OnConstruction(); } @@ -2637,14 +2483,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields(TestDeprecatedFields other) : this() { deprecatedInt32_ = other.deprecatedInt32_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields Clone() { return new TestDeprecatedFields(this); } @@ -2654,7 +2498,6 @@ namespace Google.Protobuf.TestProtos { private int deprecatedInt32_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DeprecatedInt32 { get { return deprecatedInt32_; } set { @@ -2663,13 +2506,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDeprecatedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDeprecatedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -2682,7 +2523,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (DeprecatedInt32 != 0) hash ^= DeprecatedInt32.GetHashCode(); @@ -2693,13 +2533,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2716,7 +2554,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (DeprecatedInt32 != 0) { output.WriteRawTag(8); @@ -2729,7 +2566,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (DeprecatedInt32 != 0) { @@ -2742,7 +2578,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDeprecatedFields other) { if (other == null) { return; @@ -2754,7 +2589,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2776,7 +2610,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2799,7 +2632,6 @@ namespace Google.Protobuf.TestProtos { /// Define these after TestAllTypes to make sure the compiler can handle /// that. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class ForeignMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2808,23 +2640,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage() { OnConstruction(); } @@ -2832,14 +2660,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage(ForeignMessage other) : this() { c_ = other.c_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage Clone() { return new ForeignMessage(this); } @@ -2848,7 +2674,6 @@ namespace Google.Protobuf.TestProtos { public const int CFieldNumber = 1; private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { return c_; } set { @@ -2857,13 +2682,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -2876,7 +2699,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (C != 0) hash ^= C.GetHashCode(); @@ -2887,13 +2709,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2910,7 +2730,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (C != 0) { output.WriteRawTag(8); @@ -2923,7 +2742,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (C != 0) { @@ -2936,7 +2754,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessage other) { if (other == null) { return; @@ -2948,7 +2765,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2970,7 +2786,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2989,7 +2804,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestReservedFields : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2998,23 +2812,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields() { OnConstruction(); } @@ -3022,25 +2832,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields(TestReservedFields other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields Clone() { return new TestReservedFields(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReservedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReservedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -3052,7 +2858,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -3062,13 +2867,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3081,7 +2884,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -3090,7 +2892,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -3100,7 +2901,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReservedFields other) { if (other == null) { return; @@ -3109,7 +2909,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3127,7 +2926,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3145,7 +2943,6 @@ namespace Google.Protobuf.TestProtos { /// /// Test that we can use NestedMessage from outside TestAllTypes. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestForeignNested : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3154,23 +2951,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested() { OnConstruction(); } @@ -3178,14 +2971,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested(TestForeignNested other) : this() { foreignNested_ = other.foreignNested_ != null ? other.foreignNested_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested Clone() { return new TestForeignNested(this); } @@ -3194,7 +2985,6 @@ namespace Google.Protobuf.TestProtos { public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { get { return foreignNested_; } set { @@ -3203,13 +2993,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestForeignNested); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestForeignNested other) { if (ReferenceEquals(other, null)) { return false; @@ -3222,7 +3010,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (foreignNested_ != null) hash ^= ForeignNested.GetHashCode(); @@ -3233,13 +3020,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3256,7 +3041,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (foreignNested_ != null) { output.WriteRawTag(10); @@ -3269,7 +3053,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (foreignNested_ != null) { @@ -3282,7 +3065,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestForeignNested other) { if (other == null) { return; @@ -3297,7 +3079,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3322,7 +3103,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3347,7 +3127,6 @@ namespace Google.Protobuf.TestProtos { /// /// Test that really large tag numbers don't break anything. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestReallyLargeTagNumber : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3356,23 +3135,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber() { OnConstruction(); } @@ -3380,7 +3155,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber(TestReallyLargeTagNumber other) : this() { a_ = other.a_; bb_ = other.bb_; @@ -3388,7 +3162,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber Clone() { return new TestReallyLargeTagNumber(this); } @@ -3401,7 +3174,6 @@ namespace Google.Protobuf.TestProtos { /// three bits to communicate wire type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { return a_; } set { @@ -3413,7 +3185,6 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 268435455; private int bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { return bb_; } set { @@ -3422,13 +3193,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReallyLargeTagNumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReallyLargeTagNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -3442,7 +3211,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (A != 0) hash ^= A.GetHashCode(); @@ -3454,13 +3222,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3481,7 +3247,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (A != 0) { output.WriteRawTag(8); @@ -3498,7 +3263,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (A != 0) { @@ -3514,7 +3278,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReallyLargeTagNumber other) { if (other == null) { return; @@ -3529,7 +3292,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3555,7 +3317,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3578,7 +3339,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRecursiveMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3587,23 +3347,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRecursiveMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage() { OnConstruction(); } @@ -3611,7 +3367,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage(TestRecursiveMessage other) : this() { a_ = other.a_ != null ? other.a_.Clone() : null; i_ = other.i_; @@ -3619,7 +3374,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage Clone() { return new TestRecursiveMessage(this); } @@ -3628,7 +3382,6 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestRecursiveMessage a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestRecursiveMessage A { get { return a_; } set { @@ -3640,7 +3393,6 @@ namespace Google.Protobuf.TestProtos { public const int IFieldNumber = 2; private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { return i_; } set { @@ -3649,13 +3401,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRecursiveMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRecursiveMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -3669,7 +3419,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (a_ != null) hash ^= A.GetHashCode(); @@ -3681,13 +3430,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3708,7 +3455,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (a_ != null) { output.WriteRawTag(10); @@ -3725,7 +3471,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (a_ != null) { @@ -3741,7 +3486,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRecursiveMessage other) { if (other == null) { return; @@ -3759,7 +3503,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3788,7 +3531,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3817,7 +3559,6 @@ namespace Google.Protobuf.TestProtos { /// /// Test that mutual recursion works. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMutualRecursionA : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -3826,23 +3567,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA() { OnConstruction(); } @@ -3850,14 +3587,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA(TestMutualRecursionA other) : this() { bb_ = other.bb_ != null ? other.bb_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA Clone() { return new TestMutualRecursionA(this); } @@ -3866,7 +3601,6 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionB bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestMutualRecursionB Bb { get { return bb_; } set { @@ -3875,13 +3609,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionA other) { if (ReferenceEquals(other, null)) { return false; @@ -3894,7 +3626,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (bb_ != null) hash ^= Bb.GetHashCode(); @@ -3905,13 +3636,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3928,7 +3657,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (bb_ != null) { output.WriteRawTag(10); @@ -3941,7 +3669,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (bb_ != null) { @@ -3954,7 +3681,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionA other) { if (other == null) { return; @@ -3969,7 +3695,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3994,7 +3719,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4016,7 +3740,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestMutualRecursionB : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -4025,23 +3748,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionB()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB() { OnConstruction(); } @@ -4049,7 +3768,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB(TestMutualRecursionB other) : this() { a_ = other.a_ != null ? other.a_.Clone() : null; optionalInt32_ = other.optionalInt32_; @@ -4057,7 +3775,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB Clone() { return new TestMutualRecursionB(this); } @@ -4066,7 +3783,6 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionA a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestMutualRecursionA A { get { return a_; } set { @@ -4078,7 +3794,6 @@ namespace Google.Protobuf.TestProtos { public const int OptionalInt32FieldNumber = 2; private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { return optionalInt32_; } set { @@ -4087,13 +3802,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionB); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionB other) { if (ReferenceEquals(other, null)) { return false; @@ -4107,7 +3820,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (a_ != null) hash ^= A.GetHashCode(); @@ -4119,13 +3831,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4146,7 +3856,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (a_ != null) { output.WriteRawTag(10); @@ -4163,7 +3872,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (a_ != null) { @@ -4179,7 +3887,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionB other) { if (other == null) { return; @@ -4197,7 +3904,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4226,7 +3932,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4252,7 +3957,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestEnumAllowAlias : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -4261,23 +3965,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEnumAllowAlias()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEnumAllowAlias() { OnConstruction(); } @@ -4285,14 +3985,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEnumAllowAlias(TestEnumAllowAlias other) : this() { value_ = other.value_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEnumAllowAlias Clone() { return new TestEnumAllowAlias(this); } @@ -4301,7 +3999,6 @@ namespace Google.Protobuf.TestProtos { public const int ValueFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestEnumWithDupValue value_ = global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestEnumWithDupValue Value { get { return value_; } set { @@ -4310,13 +4007,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEnumAllowAlias); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEnumAllowAlias other) { if (ReferenceEquals(other, null)) { return false; @@ -4329,7 +4024,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Value != global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified) hash ^= Value.GetHashCode(); @@ -4340,13 +4034,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4363,7 +4055,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Value != global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified) { output.WriteRawTag(8); @@ -4376,7 +4067,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Value != global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified) { @@ -4389,7 +4079,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEnumAllowAlias other) { if (other == null) { return; @@ -4401,7 +4090,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4423,7 +4111,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4446,7 +4133,6 @@ namespace Google.Protobuf.TestProtos { /// Test message with CamelCase field names. This violates Protocol Buffer /// standard style. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestCamelCaseFieldNames : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -4455,23 +4141,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCamelCaseFieldNames()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames() { OnConstruction(); } @@ -4479,7 +4161,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames(TestCamelCaseFieldNames other) : this() { primitiveField_ = other.primitiveField_; stringField_ = other.stringField_; @@ -4493,7 +4174,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames Clone() { return new TestCamelCaseFieldNames(this); } @@ -4502,7 +4182,6 @@ namespace Google.Protobuf.TestProtos { public const int PrimitiveFieldFieldNumber = 1; private int primitiveField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PrimitiveField { get { return primitiveField_; } set { @@ -4514,7 +4193,6 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 2; private string stringField_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return stringField_; } set { @@ -4526,7 +4204,6 @@ namespace Google.Protobuf.TestProtos { public const int EnumFieldFieldNumber = 3; private global::Google.Protobuf.TestProtos.ForeignEnum enumField_ = global::Google.Protobuf.TestProtos.ForeignEnum.ForeignUnspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignEnum EnumField { get { return enumField_; } set { @@ -4538,7 +4215,6 @@ namespace Google.Protobuf.TestProtos { public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.ForeignMessage messageField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignMessage MessageField { get { return messageField_; } set { @@ -4552,7 +4228,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt32(58); private readonly pbc::RepeatedField repeatedPrimitiveField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedPrimitiveField { get { return repeatedPrimitiveField_; } } @@ -4563,7 +4238,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForString(66); private readonly pbc::RepeatedField repeatedStringField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringField { get { return repeatedStringField_; } } @@ -4574,7 +4248,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField repeatedEnumField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedEnumField { get { return repeatedEnumField_; } } @@ -4585,19 +4258,16 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedMessageField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessageField { get { return repeatedMessageField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCamelCaseFieldNames); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCamelCaseFieldNames other) { if (ReferenceEquals(other, null)) { return false; @@ -4617,7 +4287,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (PrimitiveField != 0) hash ^= PrimitiveField.GetHashCode(); @@ -4635,13 +4304,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4674,7 +4341,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (PrimitiveField != 0) { output.WriteRawTag(8); @@ -4703,7 +4369,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (PrimitiveField != 0) { @@ -4729,7 +4394,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCamelCaseFieldNames other) { if (other == null) { return; @@ -4757,7 +4421,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4812,7 +4475,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4868,7 +4530,6 @@ namespace Google.Protobuf.TestProtos { /// We list fields out of order, to ensure that we're using field number and not /// field index to determine serialization order. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestFieldOrderings : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -4877,23 +4538,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestFieldOrderings()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings() { OnConstruction(); } @@ -4901,7 +4558,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings(TestFieldOrderings other) : this() { myString_ = other.myString_; myInt_ = other.myInt_; @@ -4911,7 +4567,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings Clone() { return new TestFieldOrderings(this); } @@ -4920,7 +4575,6 @@ namespace Google.Protobuf.TestProtos { public const int MyStringFieldNumber = 11; private string myString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_; } set { @@ -4932,7 +4586,6 @@ namespace Google.Protobuf.TestProtos { public const int MyIntFieldNumber = 1; private long myInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long MyInt { get { return myInt_; } set { @@ -4944,7 +4597,6 @@ namespace Google.Protobuf.TestProtos { public const int MyFloatFieldNumber = 101; private float myFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float MyFloat { get { return myFloat_; } set { @@ -4956,7 +4608,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage singleNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -4965,13 +4616,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestFieldOrderings); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestFieldOrderings other) { if (ReferenceEquals(other, null)) { return false; @@ -4987,7 +4636,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (MyString.Length != 0) hash ^= MyString.GetHashCode(); @@ -5001,13 +4649,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5036,7 +4682,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (MyInt != 0L) { output.WriteRawTag(8); @@ -5061,7 +4706,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (MyString.Length != 0) { @@ -5083,7 +4727,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestFieldOrderings other) { if (other == null) { return; @@ -5107,7 +4750,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5144,7 +4786,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5179,9 +4820,7 @@ namespace Google.Protobuf.TestProtos { #region Nested types /// Container for nested types declared in the TestFieldOrderings message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5190,23 +4829,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestFieldOrderings.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -5214,7 +4849,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { oo_ = other.oo_; bb_ = other.bb_; @@ -5222,7 +4856,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -5231,7 +4864,6 @@ namespace Google.Protobuf.TestProtos { public const int OoFieldNumber = 2; private long oo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Oo { get { return oo_; } set { @@ -5248,7 +4880,6 @@ namespace Google.Protobuf.TestProtos { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { return bb_; } set { @@ -5257,13 +4888,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -5277,7 +4906,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Oo != 0L) hash ^= Oo.GetHashCode(); @@ -5289,13 +4917,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5316,7 +4942,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Bb != 0) { output.WriteRawTag(8); @@ -5333,7 +4958,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Oo != 0L) { @@ -5349,7 +4973,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -5364,7 +4987,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5390,7 +5012,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5418,7 +5039,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class SparseEnumMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5427,23 +5047,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseEnumMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage() { OnConstruction(); } @@ -5451,14 +5067,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage(SparseEnumMessage other) : this() { sparseEnum_ = other.sparseEnum_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage Clone() { return new SparseEnumMessage(this); } @@ -5467,7 +5081,6 @@ namespace Google.Protobuf.TestProtos { public const int SparseEnumFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestSparseEnum sparseEnum_ = global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestSparseEnum SparseEnum { get { return sparseEnum_; } set { @@ -5476,13 +5089,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseEnumMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseEnumMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -5495,7 +5106,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified) hash ^= SparseEnum.GetHashCode(); @@ -5506,13 +5116,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5529,7 +5137,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified) { output.WriteRawTag(8); @@ -5542,7 +5149,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified) { @@ -5555,7 +5161,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseEnumMessage other) { if (other == null) { return; @@ -5567,7 +5172,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5589,7 +5193,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5611,7 +5214,6 @@ namespace Google.Protobuf.TestProtos { /// /// Test String and Bytes: string is for valid UTF-8 strings /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OneString : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5620,23 +5222,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString() { OnConstruction(); } @@ -5644,14 +5242,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString(OneString other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString Clone() { return new OneString(this); } @@ -5660,7 +5256,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private string data_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Data { get { return data_; } set { @@ -5669,13 +5264,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneString other) { if (ReferenceEquals(other, null)) { return false; @@ -5688,7 +5281,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data.Length != 0) hash ^= Data.GetHashCode(); @@ -5699,13 +5291,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5722,7 +5312,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data.Length != 0) { output.WriteRawTag(10); @@ -5735,7 +5324,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data.Length != 0) { @@ -5748,7 +5336,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneString other) { if (other == null) { return; @@ -5760,7 +5347,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5782,7 +5368,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5801,7 +5386,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MoreString : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5810,23 +5394,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString() { OnConstruction(); } @@ -5834,14 +5414,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString(MoreString other) : this() { data_ = other.data_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString Clone() { return new MoreString(this); } @@ -5852,19 +5430,16 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Data { get { return data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreString other) { if (ReferenceEquals(other, null)) { return false; @@ -5877,7 +5452,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= data_.GetHashCode(); @@ -5888,13 +5462,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5908,7 +5480,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { data_.WriteTo(ref output, _repeated_data_codec); if (_unknownFields != null) { @@ -5918,7 +5489,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += data_.CalculateSize(_repeated_data_codec); @@ -5929,7 +5499,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreString other) { if (other == null) { return; @@ -5939,7 +5508,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5961,7 +5529,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5980,7 +5547,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OneBytes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -5989,23 +5555,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes() { OnConstruction(); } @@ -6013,14 +5575,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes(OneBytes other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes Clone() { return new OneBytes(this); } @@ -6029,7 +5589,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Data { get { return data_; } set { @@ -6038,13 +5597,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -6057,7 +5614,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data.Length != 0) hash ^= Data.GetHashCode(); @@ -6068,13 +5624,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6091,7 +5645,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data.Length != 0) { output.WriteRawTag(10); @@ -6104,7 +5657,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data.Length != 0) { @@ -6117,7 +5669,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneBytes other) { if (other == null) { return; @@ -6129,7 +5680,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6151,7 +5701,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6170,7 +5719,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MoreBytes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6179,23 +5727,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes() { OnConstruction(); } @@ -6203,14 +5747,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes(MoreBytes other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes Clone() { return new MoreBytes(this); } @@ -6219,7 +5761,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Data { get { return data_; } set { @@ -6228,13 +5769,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -6247,7 +5786,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data.Length != 0) hash ^= Data.GetHashCode(); @@ -6258,13 +5796,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6281,7 +5817,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data.Length != 0) { output.WriteRawTag(10); @@ -6294,7 +5829,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data.Length != 0) { @@ -6307,7 +5841,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreBytes other) { if (other == null) { return; @@ -6319,7 +5852,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6341,7 +5873,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6363,7 +5894,6 @@ namespace Google.Protobuf.TestProtos { /// /// Test int32, uint32, int64, uint64, and bool are all compatible /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Int32Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6372,23 +5902,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message() { OnConstruction(); } @@ -6396,14 +5922,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message(Int32Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message Clone() { return new Int32Message(this); } @@ -6412,7 +5936,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private int data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Data { get { return data_; } set { @@ -6421,13 +5944,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -6440,7 +5961,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0) hash ^= Data.GetHashCode(); @@ -6451,13 +5971,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6474,7 +5992,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data != 0) { output.WriteRawTag(8); @@ -6487,7 +6004,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0) { @@ -6500,7 +6016,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int32Message other) { if (other == null) { return; @@ -6512,7 +6027,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6534,7 +6048,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6553,7 +6066,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Uint32Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6562,23 +6074,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint32Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[19]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message() { OnConstruction(); } @@ -6586,14 +6094,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message(Uint32Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message Clone() { return new Uint32Message(this); } @@ -6602,7 +6108,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private uint data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint Data { get { return data_; } set { @@ -6611,13 +6116,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -6630,7 +6133,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0) hash ^= Data.GetHashCode(); @@ -6641,13 +6143,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6664,7 +6164,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data != 0) { output.WriteRawTag(8); @@ -6677,7 +6176,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0) { @@ -6690,7 +6188,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint32Message other) { if (other == null) { return; @@ -6702,7 +6199,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6724,7 +6220,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6743,7 +6238,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Int64Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6752,23 +6246,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int64Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message() { OnConstruction(); } @@ -6776,14 +6266,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message(Int64Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message Clone() { return new Int64Message(this); } @@ -6792,7 +6280,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private long data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Data { get { return data_; } set { @@ -6801,13 +6288,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -6820,7 +6305,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0L) hash ^= Data.GetHashCode(); @@ -6831,13 +6315,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6854,7 +6336,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data != 0L) { output.WriteRawTag(8); @@ -6867,7 +6348,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0L) { @@ -6880,7 +6360,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int64Message other) { if (other == null) { return; @@ -6892,7 +6371,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6914,7 +6392,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6933,7 +6410,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Uint64Message : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -6942,23 +6418,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint64Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[21]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message() { OnConstruction(); } @@ -6966,14 +6438,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message(Uint64Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message Clone() { return new Uint64Message(this); } @@ -6982,7 +6452,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private ulong data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Data { get { return data_; } set { @@ -6991,13 +6460,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -7010,7 +6477,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0UL) hash ^= Data.GetHashCode(); @@ -7021,13 +6487,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7044,7 +6508,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data != 0UL) { output.WriteRawTag(8); @@ -7057,7 +6520,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0UL) { @@ -7070,7 +6532,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint64Message other) { if (other == null) { return; @@ -7082,7 +6543,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7104,7 +6564,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7123,7 +6582,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class BoolMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7132,23 +6590,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[22]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage() { OnConstruction(); } @@ -7156,14 +6610,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage(BoolMessage other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage Clone() { return new BoolMessage(this); } @@ -7172,7 +6624,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private bool data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Data { get { return data_; } set { @@ -7181,13 +6632,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BoolMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BoolMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -7200,7 +6649,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != false) hash ^= Data.GetHashCode(); @@ -7211,13 +6659,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7234,7 +6680,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Data != false) { output.WriteRawTag(8); @@ -7247,7 +6692,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != false) { @@ -7260,7 +6704,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BoolMessage other) { if (other == null) { return; @@ -7272,7 +6715,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7294,7 +6736,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7316,7 +6757,6 @@ namespace Google.Protobuf.TestProtos { /// /// Test oneofs. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestOneof : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7325,23 +6765,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof() { OnConstruction(); } @@ -7349,7 +6785,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof(TestOneof other) : this() { switch (other.FooCase) { case FooOneofCase.FooInt: @@ -7367,7 +6802,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof Clone() { return new TestOneof(this); } @@ -7375,59 +6809,28 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { - get { return HasFooInt ? (int) foo_ : 0; } + get { return fooCase_ == FooOneofCase.FooInt ? (int) foo_ : 0; } set { foo_ = value; fooCase_ = FooOneofCase.FooInt; } } - /// Gets whether the "foo_int" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasFooInt { - get { return fooCase_ == FooOneofCase.FooInt; } - } - /// Clears the value of the oneof if it's currently set to "foo_int" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearFooInt() { - if (HasFooInt) { - ClearFoo(); - } - } /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { - get { return HasFooString ? (string) foo_ : ""; } + get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; } set { foo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); fooCase_ = FooOneofCase.FooString; } } - /// Gets whether the "foo_string" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasFooString { - get { return fooCase_ == FooOneofCase.FooString; } - } - /// Clears the value of the oneof if it's currently set to "foo_string" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearFooString() { - if (HasFooString) { - ClearFoo(); - } - } /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes) foo_ : null; } set { @@ -7446,26 +6849,22 @@ namespace Google.Protobuf.TestProtos { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneof); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneof other) { if (ReferenceEquals(other, null)) { return false; @@ -7481,11 +6880,10 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasFooInt) hash ^= FooInt.GetHashCode(); - if (HasFooString) hash ^= FooString.GetHashCode(); + if (fooCase_ == FooOneofCase.FooInt) hash ^= FooInt.GetHashCode(); + if (fooCase_ == FooOneofCase.FooString) hash ^= FooString.GetHashCode(); if (fooCase_ == FooOneofCase.FooMessage) hash ^= FooMessage.GetHashCode(); hash ^= (int) fooCase_; if (_unknownFields != null) { @@ -7495,22 +6893,20 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (HasFooInt) { + if (fooCase_ == FooOneofCase.FooInt) { output.WriteRawTag(8); output.WriteInt32(FooInt); } - if (HasFooString) { + if (fooCase_ == FooOneofCase.FooString) { output.WriteRawTag(18); output.WriteString(FooString); } @@ -7526,13 +6922,12 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasFooInt) { + if (fooCase_ == FooOneofCase.FooInt) { output.WriteRawTag(8); output.WriteInt32(FooInt); } - if (HasFooString) { + if (fooCase_ == FooOneofCase.FooString) { output.WriteRawTag(18); output.WriteString(FooString); } @@ -7547,13 +6942,12 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasFooInt) { + if (fooCase_ == FooOneofCase.FooInt) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(FooInt); } - if (HasFooString) { + if (fooCase_ == FooOneofCase.FooString) { size += 1 + pb::CodedOutputStream.ComputeStringSize(FooString); } if (fooCase_ == FooOneofCase.FooMessage) { @@ -7566,7 +6960,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneof other) { if (other == null) { return; @@ -7590,7 +6983,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7625,7 +7017,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7657,7 +7048,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestPackedTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -7666,23 +7056,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[24]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes() { OnConstruction(); } @@ -7690,7 +7076,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes(TestPackedTypes other) : this() { packedInt32_ = other.packedInt32_.Clone(); packedInt64_ = other.packedInt64_.Clone(); @@ -7710,7 +7095,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes Clone() { return new TestPackedTypes(this); } @@ -7721,7 +7105,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt32(722); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -7732,7 +7115,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(730); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -7743,7 +7125,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt32(738); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -7754,7 +7135,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(746); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -7765,7 +7145,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt32(754); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -7776,7 +7155,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt64(762); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -7787,7 +7165,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed32(770); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -7798,7 +7175,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed64(778); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -7809,7 +7185,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed32(786); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -7820,7 +7195,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed64(794); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -7831,7 +7205,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFloat(802); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -7842,7 +7215,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForDouble(810); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -7853,7 +7225,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBool(818); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -7864,19 +7235,16 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField packedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedEnum { get { return packedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestPackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestPackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -7902,7 +7270,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= packedInt32_.GetHashCode(); @@ -7926,13 +7293,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7959,7 +7324,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { packedInt32_.WriteTo(ref output, _repeated_packedInt32_codec); packedInt64_.WriteTo(ref output, _repeated_packedInt64_codec); @@ -7982,7 +7346,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); @@ -8006,7 +7369,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestPackedTypes other) { if (other == null) { return; @@ -8029,7 +7391,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -8117,7 +7478,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -8206,7 +7566,6 @@ namespace Google.Protobuf.TestProtos { /// A message with the same fields as TestPackedTypes, but without packing. Used /// to test packed <-> unpacked wire compatibility. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestUnpackedTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -8215,23 +7574,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[25]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes() { OnConstruction(); } @@ -8239,7 +7594,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes(TestUnpackedTypes other) : this() { unpackedInt32_ = other.unpackedInt32_.Clone(); unpackedInt64_ = other.unpackedInt64_.Clone(); @@ -8259,7 +7613,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes Clone() { return new TestUnpackedTypes(this); } @@ -8270,7 +7623,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt32(720); private readonly pbc::RepeatedField unpackedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -8281,7 +7633,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(728); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -8292,7 +7643,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt32(736); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -8303,7 +7653,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(744); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -8314,7 +7663,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt32(752); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -8325,7 +7673,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt64(760); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -8336,7 +7683,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed32(773); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -8347,7 +7693,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed64(777); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -8358,7 +7703,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed32(789); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -8369,7 +7713,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed64(793); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -8380,7 +7723,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFloat(805); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -8391,7 +7733,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForDouble(809); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -8402,7 +7743,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBool(816); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -8413,19 +7753,16 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField unpackedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedEnum { get { return unpackedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestUnpackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestUnpackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -8451,7 +7788,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= unpackedInt32_.GetHashCode(); @@ -8475,13 +7811,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -8508,7 +7842,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { unpackedInt32_.WriteTo(ref output, _repeated_unpackedInt32_codec); unpackedInt64_.WriteTo(ref output, _repeated_unpackedInt64_codec); @@ -8531,7 +7864,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); @@ -8555,7 +7887,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestUnpackedTypes other) { if (other == null) { return; @@ -8578,7 +7909,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -8666,7 +7996,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -8751,7 +8080,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -8760,23 +8088,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRepeatedScalarDifferentTagSizes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[26]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes() { OnConstruction(); } @@ -8784,7 +8108,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes(TestRepeatedScalarDifferentTagSizes other) : this() { repeatedFixed32_ = other.repeatedFixed32_.Clone(); repeatedInt32_ = other.repeatedInt32_.Clone(); @@ -8796,7 +8119,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes Clone() { return new TestRepeatedScalarDifferentTagSizes(this); } @@ -8812,7 +8134,6 @@ namespace Google.Protobuf.TestProtos { /// in TestAllTypes didn't trigger the check. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -8826,7 +8147,6 @@ namespace Google.Protobuf.TestProtos { /// Check for a varint type, just for good measure. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -8840,7 +8160,6 @@ namespace Google.Protobuf.TestProtos { /// These have two-byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -8851,7 +8170,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(16378); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -8865,7 +8183,6 @@ namespace Google.Protobuf.TestProtos { /// Three byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -8876,19 +8193,16 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(2097146); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRepeatedScalarDifferentTagSizes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRepeatedScalarDifferentTagSizes other) { if (ReferenceEquals(other, null)) { return false; @@ -8906,7 +8220,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= repeatedFixed32_.GetHashCode(); @@ -8922,13 +8235,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -8947,7 +8258,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); @@ -8962,7 +8272,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); @@ -8978,7 +8287,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRepeatedScalarDifferentTagSizes other) { if (other == null) { return; @@ -8993,7 +8301,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -9041,7 +8348,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -9086,7 +8392,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestCommentInjectionMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -9095,23 +8400,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCommentInjectionMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[27]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage() { OnConstruction(); } @@ -9119,14 +8420,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage(TestCommentInjectionMessage other) : this() { a_ = other.a_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage Clone() { return new TestCommentInjectionMessage(this); } @@ -9138,7 +8437,6 @@ namespace Google.Protobuf.TestProtos { /// */ <- This should not close the generated doc comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string A { get { return a_; } set { @@ -9147,13 +8445,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCommentInjectionMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCommentInjectionMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -9166,7 +8462,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (A.Length != 0) hash ^= A.GetHashCode(); @@ -9177,13 +8472,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -9200,7 +8493,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (A.Length != 0) { output.WriteRawTag(10); @@ -9213,7 +8505,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (A.Length != 0) { @@ -9226,7 +8517,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCommentInjectionMessage other) { if (other == null) { return; @@ -9238,7 +8528,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -9260,7 +8549,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -9282,7 +8570,6 @@ namespace Google.Protobuf.TestProtos { /// /// Test that RPC services work. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -9291,23 +8578,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[28]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest() { OnConstruction(); } @@ -9315,25 +8598,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest(FooRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest Clone() { return new FooRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -9345,7 +8624,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -9355,13 +8633,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -9374,7 +8650,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -9383,7 +8658,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -9393,7 +8667,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooRequest other) { if (other == null) { return; @@ -9402,7 +8675,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -9420,7 +8692,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -9435,7 +8706,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -9444,23 +8714,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[29]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse() { OnConstruction(); } @@ -9468,25 +8734,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse(FooResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse Clone() { return new FooResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -9498,7 +8760,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -9508,13 +8769,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -9527,7 +8786,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -9536,7 +8794,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -9546,7 +8803,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooResponse other) { if (other == null) { return; @@ -9555,7 +8811,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -9573,7 +8828,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -9588,7 +8842,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooClientMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -9597,23 +8850,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[30]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage() { OnConstruction(); } @@ -9621,25 +8870,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage(FooClientMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage Clone() { return new FooClientMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooClientMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -9651,7 +8896,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -9661,13 +8905,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -9680,7 +8922,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -9689,7 +8930,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -9699,7 +8939,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooClientMessage other) { if (other == null) { return; @@ -9708,7 +8947,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -9726,7 +8964,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -9741,7 +8978,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooServerMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -9750,23 +8986,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[31]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage() { OnConstruction(); } @@ -9774,25 +9006,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage(FooServerMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage Clone() { return new FooServerMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooServerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -9804,7 +9032,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -9814,13 +9041,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -9833,7 +9058,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -9842,7 +9066,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -9852,7 +9075,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooServerMessage other) { if (other == null) { return; @@ -9861,7 +9083,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -9879,7 +9100,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -9894,7 +9114,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class BarRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -9903,23 +9122,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[32]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest() { OnConstruction(); } @@ -9927,25 +9142,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest(BarRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest Clone() { return new BarRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -9957,7 +9168,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -9967,13 +9177,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -9986,7 +9194,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -9995,7 +9202,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -10005,7 +9211,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarRequest other) { if (other == null) { return; @@ -10014,7 +9219,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10032,7 +9236,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10047,7 +9250,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class BarResponse : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10056,23 +9258,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[33]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse() { OnConstruction(); } @@ -10080,25 +9278,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse(BarResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse Clone() { return new BarResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -10110,7 +9304,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -10120,13 +9313,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10139,7 +9330,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -10148,7 +9338,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -10158,7 +9347,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarResponse other) { if (other == null) { return; @@ -10167,7 +9355,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10185,7 +9372,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10200,7 +9386,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestEmptyMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10209,23 +9394,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[34]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage() { OnConstruction(); } @@ -10233,25 +9414,21 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage(TestEmptyMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage Clone() { return new TestEmptyMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEmptyMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEmptyMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -10263,7 +9440,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -10273,13 +9449,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10292,7 +9466,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -10301,7 +9474,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -10311,7 +9483,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEmptyMessage other) { if (other == null) { return; @@ -10320,7 +9491,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10338,7 +9508,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10356,7 +9525,6 @@ namespace Google.Protobuf.TestProtos { /// /// This is a leading comment /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class CommentMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10365,23 +9533,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CommentMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[35]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CommentMessage() { OnConstruction(); } @@ -10389,14 +9553,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CommentMessage(CommentMessage other) : this() { text_ = other.text_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CommentMessage Clone() { return new CommentMessage(this); } @@ -10408,7 +9570,6 @@ namespace Google.Protobuf.TestProtos { /// Leading field comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Text { get { return text_; } set { @@ -10417,13 +9578,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CommentMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CommentMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -10436,7 +9595,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Text.Length != 0) hash ^= Text.GetHashCode(); @@ -10447,13 +9605,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10470,7 +9626,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Text.Length != 0) { output.WriteRawTag(10); @@ -10483,7 +9638,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Text.Length != 0) { @@ -10496,7 +9650,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CommentMessage other) { if (other == null) { return; @@ -10508,7 +9661,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10530,7 +9682,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -10550,7 +9701,6 @@ namespace Google.Protobuf.TestProtos { #region Nested types /// Container for nested types declared in the CommentMessage message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Leading nested enum comment @@ -10565,7 +9715,6 @@ namespace Google.Protobuf.TestProtos { /// /// Leading nested message comment /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedCommentMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -10574,23 +9723,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedCommentMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.CommentMessage.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedCommentMessage() { OnConstruction(); } @@ -10598,14 +9743,12 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedCommentMessage(NestedCommentMessage other) : this() { nestedText_ = other.nestedText_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedCommentMessage Clone() { return new NestedCommentMessage(this); } @@ -10617,7 +9760,6 @@ namespace Google.Protobuf.TestProtos { /// Leading nested message field comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string NestedText { get { return nestedText_; } set { @@ -10626,13 +9768,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedCommentMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedCommentMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -10645,7 +9785,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (NestedText.Length != 0) hash ^= NestedText.GetHashCode(); @@ -10656,13 +9795,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -10679,7 +9816,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (NestedText.Length != 0) { output.WriteRawTag(10); @@ -10692,7 +9828,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (NestedText.Length != 0) { @@ -10705,7 +9840,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedCommentMessage other) { if (other == null) { return; @@ -10717,7 +9851,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -10739,7 +9872,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs similarity index 74% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs index da3aa01d471b6d35c9e909072f9ade84b1b0fcea..7d3a238eb4100f7261e61830bfe20d4ab0f10196 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs @@ -2,7 +2,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/unittest_proto3_optional.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -25,62 +25,55 @@ namespace ProtobufUnittest { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Ci5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJvdG8zX29wdGlvbmFsLnBy", - "b3RvEhFwcm90b2J1Zl91bml0dGVzdBogZ29vZ2xlL3Byb3RvYnVmL2Rlc2Ny", - "aXB0b3IucHJvdG8isQoKElRlc3RQcm90bzNPcHRpb25hbBIbCg5vcHRpb25h", - "bF9pbnQzMhgBIAEoBUgAiAEBEhsKDm9wdGlvbmFsX2ludDY0GAIgASgDSAGI", - "AQESHAoPb3B0aW9uYWxfdWludDMyGAMgASgNSAKIAQESHAoPb3B0aW9uYWxf", - "dWludDY0GAQgASgESAOIAQESHAoPb3B0aW9uYWxfc2ludDMyGAUgASgRSASI", - "AQESHAoPb3B0aW9uYWxfc2ludDY0GAYgASgSSAWIAQESHQoQb3B0aW9uYWxf", - "Zml4ZWQzMhgHIAEoB0gGiAEBEh0KEG9wdGlvbmFsX2ZpeGVkNjQYCCABKAZI", - "B4gBARIeChFvcHRpb25hbF9zZml4ZWQzMhgJIAEoD0gIiAEBEh4KEW9wdGlv", - "bmFsX3NmaXhlZDY0GAogASgQSAmIAQESGwoOb3B0aW9uYWxfZmxvYXQYCyAB", - "KAJICogBARIcCg9vcHRpb25hbF9kb3VibGUYDCABKAFIC4gBARIaCg1vcHRp", - "b25hbF9ib29sGA0gASgISAyIAQESHAoPb3B0aW9uYWxfc3RyaW5nGA4gASgJ", - "SA2IAQESGwoOb3B0aW9uYWxfYnl0ZXMYDyABKAxIDogBARIeCg1vcHRpb25h", - "bF9jb3JkGBAgASgJQgIIAUgPiAEBElkKF29wdGlvbmFsX25lc3RlZF9tZXNz", - "YWdlGBIgASgLMjMucHJvdG9idWZfdW5pdHRlc3QuVGVzdFByb3RvM09wdGlv", - "bmFsLk5lc3RlZE1lc3NhZ2VIEIgBARJZChNsYXp5X25lc3RlZF9tZXNzYWdl", - "GBMgASgLMjMucHJvdG9idWZfdW5pdHRlc3QuVGVzdFByb3RvM09wdGlvbmFs", - "Lk5lc3RlZE1lc3NhZ2VCAigBSBGIAQESUwoUb3B0aW9uYWxfbmVzdGVkX2Vu", - "dW0YFSABKA4yMC5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJvdG8zT3B0aW9u", - "YWwuTmVzdGVkRW51bUgSiAEBEhYKDnNpbmd1bGFyX2ludDMyGBYgASgFEhYK", - "DnNpbmd1bGFyX2ludDY0GBcgASgDGicKDU5lc3RlZE1lc3NhZ2USDwoCYmIY", - "ASABKAVIAIgBAUIFCgNfYmIiSgoKTmVzdGVkRW51bRIPCgtVTlNQRUNJRklF", - "RBAAEgcKA0ZPTxABEgcKA0JBUhACEgcKA0JBWhADEhAKA05FRxD/////////", - "//8BQhEKD19vcHRpb25hbF9pbnQzMkIRCg9fb3B0aW9uYWxfaW50NjRCEgoQ", - "X29wdGlvbmFsX3VpbnQzMkISChBfb3B0aW9uYWxfdWludDY0QhIKEF9vcHRp", - "b25hbF9zaW50MzJCEgoQX29wdGlvbmFsX3NpbnQ2NEITChFfb3B0aW9uYWxf", - "Zml4ZWQzMkITChFfb3B0aW9uYWxfZml4ZWQ2NEIUChJfb3B0aW9uYWxfc2Zp", - "eGVkMzJCFAoSX29wdGlvbmFsX3NmaXhlZDY0QhEKD19vcHRpb25hbF9mbG9h", - "dEISChBfb3B0aW9uYWxfZG91YmxlQhAKDl9vcHRpb25hbF9ib29sQhIKEF9v", - "cHRpb25hbF9zdHJpbmdCEQoPX29wdGlvbmFsX2J5dGVzQhAKDl9vcHRpb25h", - "bF9jb3JkQhoKGF9vcHRpb25hbF9uZXN0ZWRfbWVzc2FnZUIWChRfbGF6eV9u", - "ZXN0ZWRfbWVzc2FnZUIXChVfb3B0aW9uYWxfbmVzdGVkX2VudW0iiQIKGVRl", - "c3RQcm90bzNPcHRpb25hbE1lc3NhZ2USUgoObmVzdGVkX21lc3NhZ2UYASAB", - "KAsyOi5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJvdG8zT3B0aW9uYWxNZXNz", - "YWdlLk5lc3RlZE1lc3NhZ2USYAoXb3B0aW9uYWxfbmVzdGVkX21lc3NhZ2UY", - "AiABKAsyOi5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJvdG8zT3B0aW9uYWxN", - "ZXNzYWdlLk5lc3RlZE1lc3NhZ2VIAIgBARoaCg1OZXN0ZWRNZXNzYWdlEgkK", - "AXMYASABKAlCGgoYX29wdGlvbmFsX25lc3RlZF9tZXNzYWdlIqkBChhQcm90", - "bzNPcHRpb25hbEV4dGVuc2lvbnMyPAoPZXh0X25vX29wdGlvbmFsEh8uZ29v", - "Z2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGIjN2akBIAEoBTJBChFleHRf", - "d2l0aF9vcHRpb25hbBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9u", - "cxiJzdmpASABKAWIAQE6DMDozM0KCMjozM0KEEI4CiFjb20uZ29vZ2xlLnBy", - "b3RvYnVmLnRlc3RpbmcucHJvdG9QAaoCEFByb3RvYnVmVW5pdHRlc3RiBnBy", + "b3RvEhFwcm90b2J1Zl91bml0dGVzdCKxCgoSVGVzdFByb3RvM09wdGlvbmFs", + "EhsKDm9wdGlvbmFsX2ludDMyGAEgASgFSACIAQESGwoOb3B0aW9uYWxfaW50", + "NjQYAiABKANIAYgBARIcCg9vcHRpb25hbF91aW50MzIYAyABKA1IAogBARIc", + "Cg9vcHRpb25hbF91aW50NjQYBCABKARIA4gBARIcCg9vcHRpb25hbF9zaW50", + "MzIYBSABKBFIBIgBARIcCg9vcHRpb25hbF9zaW50NjQYBiABKBJIBYgBARId", + "ChBvcHRpb25hbF9maXhlZDMyGAcgASgHSAaIAQESHQoQb3B0aW9uYWxfZml4", + "ZWQ2NBgIIAEoBkgHiAEBEh4KEW9wdGlvbmFsX3NmaXhlZDMyGAkgASgPSAiI", + "AQESHgoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBBICYgBARIbCg5vcHRpb25h", + "bF9mbG9hdBgLIAEoAkgKiAEBEhwKD29wdGlvbmFsX2RvdWJsZRgMIAEoAUgL", + "iAEBEhoKDW9wdGlvbmFsX2Jvb2wYDSABKAhIDIgBARIcCg9vcHRpb25hbF9z", + "dHJpbmcYDiABKAlIDYgBARIbCg5vcHRpb25hbF9ieXRlcxgPIAEoDEgOiAEB", + "Eh4KDW9wdGlvbmFsX2NvcmQYECABKAlCAggBSA+IAQESWQoXb3B0aW9uYWxf", + "bmVzdGVkX21lc3NhZ2UYEiABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0", + "UHJvdG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUgQiAEBElkKE2xhenlfbmVz", + "dGVkX21lc3NhZ2UYEyABKAsyMy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJv", + "dG8zT3B0aW9uYWwuTmVzdGVkTWVzc2FnZUICKAFIEYgBARJTChRvcHRpb25h", + "bF9uZXN0ZWRfZW51bRgVIAEoDjIwLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQ", + "cm90bzNPcHRpb25hbC5OZXN0ZWRFbnVtSBKIAQESFgoOc2luZ3VsYXJfaW50", + "MzIYFiABKAUSFgoOc2luZ3VsYXJfaW50NjQYFyABKAMaJwoNTmVzdGVkTWVz", + "c2FnZRIPCgJiYhgBIAEoBUgAiAEBQgUKA19iYiJKCgpOZXN0ZWRFbnVtEg8K", + "C1VOU1BFQ0lGSUVEEAASBwoDRk9PEAESBwoDQkFSEAISBwoDQkFaEAMSEAoD", + "TkVHEP///////////wFCEQoPX29wdGlvbmFsX2ludDMyQhEKD19vcHRpb25h", + "bF9pbnQ2NEISChBfb3B0aW9uYWxfdWludDMyQhIKEF9vcHRpb25hbF91aW50", + "NjRCEgoQX29wdGlvbmFsX3NpbnQzMkISChBfb3B0aW9uYWxfc2ludDY0QhMK", + "EV9vcHRpb25hbF9maXhlZDMyQhMKEV9vcHRpb25hbF9maXhlZDY0QhQKEl9v", + "cHRpb25hbF9zZml4ZWQzMkIUChJfb3B0aW9uYWxfc2ZpeGVkNjRCEQoPX29w", + "dGlvbmFsX2Zsb2F0QhIKEF9vcHRpb25hbF9kb3VibGVCEAoOX29wdGlvbmFs", + "X2Jvb2xCEgoQX29wdGlvbmFsX3N0cmluZ0IRCg9fb3B0aW9uYWxfYnl0ZXNC", + "EAoOX29wdGlvbmFsX2NvcmRCGgoYX29wdGlvbmFsX25lc3RlZF9tZXNzYWdl", + "QhYKFF9sYXp5X25lc3RlZF9tZXNzYWdlQhcKFV9vcHRpb25hbF9uZXN0ZWRf", + "ZW51bSKJAgoZVGVzdFByb3RvM09wdGlvbmFsTWVzc2FnZRJSCg5uZXN0ZWRf", + "bWVzc2FnZRgBIAEoCzI6LnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQcm90bzNP", + "cHRpb25hbE1lc3NhZ2UuTmVzdGVkTWVzc2FnZRJgChdvcHRpb25hbF9uZXN0", + "ZWRfbWVzc2FnZRgCIAEoCzI6LnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQcm90", + "bzNPcHRpb25hbE1lc3NhZ2UuTmVzdGVkTWVzc2FnZUgAiAEBGhoKDU5lc3Rl", + "ZE1lc3NhZ2USCQoBcxgBIAEoCUIaChhfb3B0aW9uYWxfbmVzdGVkX21lc3Nh", + "Z2VCJQohY29tLmdvb2dsZS5wcm90b2J1Zi50ZXN0aW5nLnByb3RvUAFiBnBy", "b3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, + new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional), global::ProtobufUnittest.TestProto3Optional.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum", "SingularInt32", "SingularInt64" }, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum" }, new[]{ typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage), global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage.Parser, new[]{ "Bb" }, new[]{ "Bb" }, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Parser, new[]{ "NestedMessage", "OptionalNestedMessage" }, new[]{ "OptionalNestedMessage" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage.Parser, new[]{ "S" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.Proto3OptionalExtensions), global::ProtobufUnittest.Proto3OptionalExtensions.Parser, null, null, null, new pb::Extension[] { global::ProtobufUnittest.Proto3OptionalExtensions.Extensions.ExtNoOptional, global::ProtobufUnittest.Proto3OptionalExtensions.Extensions.ExtWithOptional }, null) + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Parser, new[]{ "NestedMessage", "OptionalNestedMessage" }, new[]{ "OptionalNestedMessage" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage.Parser, new[]{ "S" }, null, null, null, null)}) })); } #endregion } #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestProto3Optional : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -90,23 +83,19 @@ namespace ProtobufUnittest { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestProto3Optional() { OnConstruction(); } @@ -114,7 +103,6 @@ namespace ProtobufUnittest { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestProto3Optional(TestProto3Optional other) : this() { _hasBits0 = other._hasBits0; optionalInt32_ = other.optionalInt32_; @@ -142,23 +130,19 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestProto3Optional Clone() { return new TestProto3Optional(this); } /// Field number for the "optional_int32" field. public const int OptionalInt32FieldNumber = 1; - private readonly static int OptionalInt32DefaultValue = 0; - private int optionalInt32_; /// /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { - get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } + get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return 0; } } set { _hasBits0 |= 1; optionalInt32_ = value; @@ -166,26 +150,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } /// Field number for the "optional_int64" field. public const int OptionalInt64FieldNumber = 2; - private readonly static long OptionalInt64DefaultValue = 0L; - private long optionalInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalInt64 { - get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return OptionalInt64DefaultValue; } } + get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return 0L; } } set { _hasBits0 |= 2; optionalInt64_ = value; @@ -193,26 +172,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt64 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "optional_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt64() { _hasBits0 &= ~2; } /// Field number for the "optional_uint32" field. public const int OptionalUint32FieldNumber = 3; - private readonly static uint OptionalUint32DefaultValue = 0; - private uint optionalUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalUint32 { - get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return OptionalUint32DefaultValue; } } + get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return 0; } } set { _hasBits0 |= 4; optionalUint32_ = value; @@ -220,26 +194,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint32 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "optional_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint32() { _hasBits0 &= ~4; } /// Field number for the "optional_uint64" field. public const int OptionalUint64FieldNumber = 4; - private readonly static ulong OptionalUint64DefaultValue = 0UL; - private ulong optionalUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalUint64 { - get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return OptionalUint64DefaultValue; } } + get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return 0UL; } } set { _hasBits0 |= 8; optionalUint64_ = value; @@ -247,26 +216,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint64 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "optional_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint64() { _hasBits0 &= ~8; } /// Field number for the "optional_sint32" field. public const int OptionalSint32FieldNumber = 5; - private readonly static int OptionalSint32DefaultValue = 0; - private int optionalSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSint32 { - get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return OptionalSint32DefaultValue; } } + get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return 0; } } set { _hasBits0 |= 16; optionalSint32_ = value; @@ -274,26 +238,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_sint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint32 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "optional_sint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint32() { _hasBits0 &= ~16; } /// Field number for the "optional_sint64" field. public const int OptionalSint64FieldNumber = 6; - private readonly static long OptionalSint64DefaultValue = 0L; - private long optionalSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSint64 { - get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return OptionalSint64DefaultValue; } } + get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return 0L; } } set { _hasBits0 |= 32; optionalSint64_ = value; @@ -301,26 +260,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_sint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint64 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "optional_sint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint64() { _hasBits0 &= ~32; } /// Field number for the "optional_fixed32" field. public const int OptionalFixed32FieldNumber = 7; - private readonly static uint OptionalFixed32DefaultValue = 0; - private uint optionalFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalFixed32 { - get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return OptionalFixed32DefaultValue; } } + get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return 0; } } set { _hasBits0 |= 64; optionalFixed32_ = value; @@ -328,26 +282,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_fixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed32 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "optional_fixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed32() { _hasBits0 &= ~64; } /// Field number for the "optional_fixed64" field. public const int OptionalFixed64FieldNumber = 8; - private readonly static ulong OptionalFixed64DefaultValue = 0UL; - private ulong optionalFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalFixed64 { - get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return OptionalFixed64DefaultValue; } } + get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return 0UL; } } set { _hasBits0 |= 128; optionalFixed64_ = value; @@ -355,26 +304,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_fixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed64 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "optional_fixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed64() { _hasBits0 &= ~128; } /// Field number for the "optional_sfixed32" field. public const int OptionalSfixed32FieldNumber = 9; - private readonly static int OptionalSfixed32DefaultValue = 0; - private int optionalSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSfixed32 { - get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return OptionalSfixed32DefaultValue; } } + get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return 0; } } set { _hasBits0 |= 256; optionalSfixed32_ = value; @@ -382,26 +326,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_sfixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed32 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "optional_sfixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed32() { _hasBits0 &= ~256; } /// Field number for the "optional_sfixed64" field. public const int OptionalSfixed64FieldNumber = 10; - private readonly static long OptionalSfixed64DefaultValue = 0L; - private long optionalSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSfixed64 { - get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return OptionalSfixed64DefaultValue; } } + get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return 0L; } } set { _hasBits0 |= 512; optionalSfixed64_ = value; @@ -409,26 +348,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_sfixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed64 { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "optional_sfixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed64() { _hasBits0 &= ~512; } /// Field number for the "optional_float" field. public const int OptionalFloatFieldNumber = 11; - private readonly static float OptionalFloatDefaultValue = 0F; - private float optionalFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OptionalFloat { - get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return OptionalFloatDefaultValue; } } + get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return 0F; } } set { _hasBits0 |= 1024; optionalFloat_ = value; @@ -436,26 +370,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFloat { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "optional_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFloat() { _hasBits0 &= ~1024; } /// Field number for the "optional_double" field. public const int OptionalDoubleFieldNumber = 12; - private readonly static double OptionalDoubleDefaultValue = 0D; - private double optionalDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OptionalDouble { - get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return OptionalDoubleDefaultValue; } } + get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return 0D; } } set { _hasBits0 |= 2048; optionalDouble_ = value; @@ -463,26 +392,21 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalDouble { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "optional_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalDouble() { _hasBits0 &= ~2048; } /// Field number for the "optional_bool" field. public const int OptionalBoolFieldNumber = 13; - private readonly static bool OptionalBoolDefaultValue = false; - private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { - get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } } + get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return false; } } set { _hasBits0 |= 4096; optionalBool_ = value; @@ -490,91 +414,74 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBool { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "optional_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBool() { _hasBits0 &= ~4096; } /// Field number for the "optional_string" field. public const int OptionalStringFieldNumber = 14; - private readonly static string OptionalStringDefaultValue = ""; - private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { - get { return optionalString_ ?? OptionalStringDefaultValue; } + get { return optionalString_ ?? ""; } set { optionalString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } /// Field number for the "optional_bytes" field. public const int OptionalBytesFieldNumber = 15; - private readonly static pb::ByteString OptionalBytesDefaultValue = pb::ByteString.Empty; - private pb::ByteString optionalBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { - get { return optionalBytes_ ?? OptionalBytesDefaultValue; } + get { return optionalBytes_ ?? pb::ByteString.Empty; } set { optionalBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Gets whether the "optional_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBytes { get { return optionalBytes_ != null; } } /// Clears the value of the "optional_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBytes() { optionalBytes_ = null; } /// Field number for the "optional_cord" field. public const int OptionalCordFieldNumber = 16; - private readonly static string OptionalCordDefaultValue = ""; - private string optionalCord_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalCord { - get { return optionalCord_ ?? OptionalCordDefaultValue; } + get { return optionalCord_ ?? ""; } set { optionalCord_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Gets whether the "optional_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalCord { get { return optionalCord_ != null; } } /// Clears the value of the "optional_cord" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalCord() { optionalCord_ = null; } @@ -583,7 +490,6 @@ namespace ProtobufUnittest { public const int OptionalNestedMessageFieldNumber = 18; private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -595,7 +501,6 @@ namespace ProtobufUnittest { public const int LazyNestedMessageFieldNumber = 19; private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage lazyNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage LazyNestedMessage { get { return lazyNestedMessage_; } set { @@ -605,13 +510,10 @@ namespace ProtobufUnittest { /// Field number for the "optional_nested_enum" field. public const int OptionalNestedEnumFieldNumber = 21; - private readonly static global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum OptionalNestedEnumDefaultValue = global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum.Unspecified; - private global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum optionalNestedEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum OptionalNestedEnum { - get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return OptionalNestedEnumDefaultValue; } } + get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum.Unspecified; } } set { _hasBits0 |= 8192; optionalNestedEnum_ = value; @@ -619,13 +521,11 @@ namespace ProtobufUnittest { } /// Gets whether the "optional_nested_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalNestedEnum { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "optional_nested_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalNestedEnum() { _hasBits0 &= ~8192; } @@ -637,7 +537,6 @@ namespace ProtobufUnittest { /// Add some non-optional fields to verify we can mix them. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SingularInt32 { get { return singularInt32_; } set { @@ -649,7 +548,6 @@ namespace ProtobufUnittest { public const int SingularInt64FieldNumber = 23; private long singularInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SingularInt64 { get { return singularInt64_; } set { @@ -658,13 +556,11 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestProto3Optional); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestProto3Optional other) { if (ReferenceEquals(other, null)) { return false; @@ -697,7 +593,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -728,13 +623,11 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -831,7 +724,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasOptionalInt32) { output.WriteRawTag(8); @@ -924,7 +816,6 @@ namespace ProtobufUnittest { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -997,7 +888,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestProto3Optional other) { if (other == null) { return; @@ -1075,7 +965,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1183,7 +1072,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1289,7 +1177,6 @@ namespace ProtobufUnittest { #region Nested types /// Container for nested types declared in the TestProto3Optional message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, @@ -1302,7 +1189,6 @@ namespace ProtobufUnittest { [pbr::OriginalName("NEG")] Neg = -1, } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1312,23 +1198,19 @@ namespace ProtobufUnittest { private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufUnittest.TestProto3Optional.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -1336,7 +1218,6 @@ namespace ProtobufUnittest { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; bb_ = other.bb_; @@ -1344,15 +1225,12 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } /// Field number for the "bb" field. public const int BbFieldNumber = 1; - private readonly static int BbDefaultValue = 0; - private int bb_; /// /// The field name "b" fails to compile in proto1 because it conflicts with @@ -1360,9 +1238,8 @@ namespace ProtobufUnittest { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { - get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return BbDefaultValue; } } + get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return 0; } } set { _hasBits0 |= 1; bb_ = value; @@ -1370,25 +1247,21 @@ namespace ProtobufUnittest { } /// Gets whether the "bb" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBb { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "bb" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBb() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1401,7 +1274,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasBb) hash ^= Bb.GetHashCode(); @@ -1412,13 +1284,11 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1435,7 +1305,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasBb) { output.WriteRawTag(8); @@ -1448,7 +1317,6 @@ namespace ProtobufUnittest { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasBb) { @@ -1461,7 +1329,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -1473,7 +1340,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1495,7 +1361,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1519,7 +1384,6 @@ namespace ProtobufUnittest { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestProto3OptionalMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1528,23 +1392,19 @@ namespace ProtobufUnittest { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestProto3OptionalMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestProto3OptionalMessage() { OnConstruction(); } @@ -1552,7 +1412,6 @@ namespace ProtobufUnittest { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestProto3OptionalMessage(TestProto3OptionalMessage other) : this() { nestedMessage_ = other.nestedMessage_ != null ? other.nestedMessage_.Clone() : null; optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; @@ -1560,7 +1419,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestProto3OptionalMessage Clone() { return new TestProto3OptionalMessage(this); } @@ -1569,7 +1427,6 @@ namespace ProtobufUnittest { public const int NestedMessageFieldNumber = 1; private global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage nestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage NestedMessage { get { return nestedMessage_; } set { @@ -1581,7 +1438,6 @@ namespace ProtobufUnittest { public const int OptionalNestedMessageFieldNumber = 2; private global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -1590,13 +1446,11 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestProto3OptionalMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestProto3OptionalMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1610,7 +1464,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (nestedMessage_ != null) hash ^= NestedMessage.GetHashCode(); @@ -1622,13 +1475,11 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1649,7 +1500,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (nestedMessage_ != null) { output.WriteRawTag(10); @@ -1666,7 +1516,6 @@ namespace ProtobufUnittest { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (nestedMessage_ != null) { @@ -1682,7 +1531,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestProto3OptionalMessage other) { if (other == null) { return; @@ -1703,7 +1551,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1735,7 +1582,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1765,9 +1611,7 @@ namespace ProtobufUnittest { #region Nested types /// Container for nested types declared in the TestProto3OptionalMessage message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class NestedMessage : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1776,23 +1620,19 @@ namespace ProtobufUnittest { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufUnittest.TestProto3OptionalMessage.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -1800,14 +1640,12 @@ namespace ProtobufUnittest { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { s_ = other.s_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -1816,7 +1654,6 @@ namespace ProtobufUnittest { public const int SFieldNumber = 1; private string s_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string S { get { return s_; } set { @@ -1825,13 +1662,11 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1844,7 +1679,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (S.Length != 0) hash ^= S.GetHashCode(); @@ -1855,13 +1689,11 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1878,7 +1710,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (S.Length != 0) { output.WriteRawTag(10); @@ -1891,7 +1722,6 @@ namespace ProtobufUnittest { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (S.Length != 0) { @@ -1904,7 +1734,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -1916,7 +1745,6 @@ namespace ProtobufUnittest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1938,7 +1766,6 @@ namespace ProtobufUnittest { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1962,171 +1789,6 @@ namespace ProtobufUnittest { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Proto3OptionalExtensions : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Proto3OptionalExtensions()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Proto3OptionalExtensions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Proto3OptionalExtensions(Proto3OptionalExtensions other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Proto3OptionalExtensions Clone() { - return new Proto3OptionalExtensions(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Proto3OptionalExtensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Proto3OptionalExtensions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Proto3OptionalExtensions other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - #region Extensions - /// Container for extensions for other messages declared in the Proto3OptionalExtensions message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Extensions { - public static readonly pb::Extension ExtNoOptional = - new pb::Extension(355886728, pb::FieldCodec.ForInt32(2847093824, 0)); - public static readonly pb::Extension ExtWithOptional = - new pb::Extension(355886729, pb::FieldCodec.ForInt32(2847093832, 0)); - } - #endregion - - } - #endregion } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestRetention.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestRetention.pb.cs deleted file mode 100644 index 1381d5fbc63d87efe0df65a2ba0f41ed23ecd578..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestRetention.pb.cs +++ /dev/null @@ -1,1145 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/unittest_retention.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace ProtobufUnittest { - - /// Holder for reflection information generated from google/protobuf/unittest_retention.proto - public static partial class UnittestRetentionReflection { - - #region Descriptor - /// File descriptor for google/protobuf/unittest_retention.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static UnittestRetentionReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Cihnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcmV0ZW50aW9uLnByb3RvEhFw", - "cm90b2J1Zl91bml0dGVzdBogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3Iu", - "cHJvdG8icAoOT3B0aW9uc01lc3NhZ2USEwoLcGxhaW5fZmllbGQYASABKAUS", - "JAoXcnVudGltZV9yZXRlbnRpb25fZmllbGQYAiABKAVCA4gBARIjChZzb3Vy", - "Y2VfcmV0ZW50aW9uX2ZpZWxkGAMgASgFQgOIAQIiFgoIRXh0ZW5kZWUqBAgB", - "EAIqBAgCEAMi4wEKD1RvcExldmVsTWVzc2FnZRIVCgFmGAEgASgCQgqauu2E", - "DwQIARACEgsKAWkYAiABKANIABobCg1OZXN0ZWRNZXNzYWdlOgqaxd6FDwQI", - "ARACIiwKCk5lc3RlZEVudW0SEgoOTkVTVEVEX1VOS05PV04QABoK+p6qhA8E", - "CAEQAioQCAoQZRoKopjfhQ8ECAEQAjIyCgFzEhsucHJvdG9idWZfdW5pdHRl", - "c3QuRXh0ZW5kZWUYAiABKAlCCpq67YQPBAgBEAI6CprF3oUPBAgBEAJCDwoB", - "bxIKitu3hA8ECAEQAio9CgxUb3BMZXZlbEVudW0SIQoRVE9QX0xFVkVMX1VO", - "S05PV04QABoK0t2phA8ECAEQAhoK+p6qhA8ECAEQAjJ0CgdTZXJ2aWNlEl0K", - "B0RvU3R1ZmYSIi5wcm90b2J1Zl91bml0dGVzdC5Ub3BMZXZlbE1lc3NhZ2Ua", - "Ii5wcm90b2J1Zl91bml0dGVzdC5Ub3BMZXZlbE1lc3NhZ2UiCuKu+IMPBAgB", - "EAIaCuqHi4QPBAgBEAI6NgoMcGxhaW5fb3B0aW9uEhwuZ29vZ2xlLnByb3Rv", - "YnVmLkZpbGVPcHRpb25zGMa17PABIAEoBTpHChhydW50aW1lX3JldGVudGlv", - "bl9vcHRpb24SHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMYnJLp8AEg", - "ASgFQgOIAQE6RgoXc291cmNlX3JldGVudGlvbl9vcHRpb24SHC5nb29nbGUu", - "cHJvdG9idWYuRmlsZU9wdGlvbnMY1Kzf8AEgASgFQgOIAQI6WAoLZmlsZV9v", - "cHRpb24SHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMYgPLe8AEgASgL", - "MiEucHJvdG9idWZfdW5pdHRlc3QuT3B0aW9uc01lc3NhZ2U6XQoQcmVwZWF0", - "ZWRfb3B0aW9ucxIcLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxiS/tvw", - "ASADKAsyIS5wcm90b2J1Zl91bml0dGVzdC5PcHRpb25zTWVzc2FnZTptChZl", - "eHRlbnNpb25fcmFuZ2Vfb3B0aW9uEiYuZ29vZ2xlLnByb3RvYnVmLkV4dGVu", - "c2lvblJhbmdlT3B0aW9ucxiE89vwASABKAsyIS5wcm90b2J1Zl91bml0dGVz", - "dC5PcHRpb25zTWVzc2FnZTpeCg5tZXNzYWdlX29wdGlvbhIfLmdvb2dsZS5w", - "cm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjT6NvwASABKAsyIS5wcm90b2J1Zl91", - "bml0dGVzdC5PcHRpb25zTWVzc2FnZTpaCgxmaWVsZF9vcHRpb24SHS5nb29n", - "bGUucHJvdG9idWYuRmllbGRPcHRpb25zGKPXzfABIAEoCzIhLnByb3RvYnVm", - "X3VuaXR0ZXN0Lk9wdGlvbnNNZXNzYWdlOloKDG9uZW9mX29wdGlvbhIdLmdv", - "b2dsZS5wcm90b2J1Zi5PbmVvZk9wdGlvbnMYsfvG8AEgASgLMiEucHJvdG9i", - "dWZfdW5pdHRlc3QuT3B0aW9uc01lc3NhZ2U6WAoLZW51bV9vcHRpb24SHC5n", - "b29nbGUucHJvdG9idWYuRW51bU9wdGlvbnMY76PF8AEgASgLMiEucHJvdG9i", - "dWZfdW5pdHRlc3QuT3B0aW9uc01lc3NhZ2U6YwoRZW51bV9lbnRyeV9vcHRp", - "b24SIS5nb29nbGUucHJvdG9idWYuRW51bVZhbHVlT3B0aW9ucxjam8XwASAB", - "KAsyIS5wcm90b2J1Zl91bml0dGVzdC5PcHRpb25zTWVzc2FnZTpeCg5zZXJ2", - "aWNlX29wdGlvbhIfLmdvb2dsZS5wcm90b2J1Zi5TZXJ2aWNlT3B0aW9ucxj9", - "sMHwASABKAsyIS5wcm90b2J1Zl91bml0dGVzdC5PcHRpb25zTWVzc2FnZTpc", - "Cg1tZXRob2Rfb3B0aW9uEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlv", - "bnMY7IW/8AEgASgLMiEucHJvdG9idWZfdW5pdHRlc3QuT3B0aW9uc01lc3Nh", - "Z2U6MgoBaRIbLnByb3RvYnVmX3VuaXR0ZXN0LkV4dGVuZGVlGAEgASgFQgqa", - "uu2EDwQIARACQjOqAhBQcm90b2J1ZlVuaXR0ZXN0kvHfhQ8ECAEQAoKQ94UP", - "BAgBEALgkcmGDwKwrOOGDwE=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ProtobufUnittest.TopLevelEnum), }, new pb::Extension[] { UnittestRetentionExtensions.PlainOption, UnittestRetentionExtensions.RuntimeRetentionOption, UnittestRetentionExtensions.SourceRetentionOption, UnittestRetentionExtensions.FileOption, UnittestRetentionExtensions.RepeatedOptions, UnittestRetentionExtensions.ExtensionRangeOption, UnittestRetentionExtensions.MessageOption, UnittestRetentionExtensions.FieldOption, UnittestRetentionExtensions.OneofOption, UnittestRetentionExtensions.EnumOption, UnittestRetentionExtensions.EnumEntryOption, UnittestRetentionExtensions.ServiceOption, UnittestRetentionExtensions.MethodOption, UnittestRetentionExtensions.I }, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.OptionsMessage), global::ProtobufUnittest.OptionsMessage.Parser, new[]{ "PlainField", "RuntimeRetentionField", "SourceRetentionField" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.Extendee), global::ProtobufUnittest.Extendee.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TopLevelMessage), global::ProtobufUnittest.TopLevelMessage.Parser, new[]{ "F", "I" }, new[]{ "O" }, new[]{ typeof(global::ProtobufUnittest.TopLevelMessage.Types.NestedEnum) }, new pb::Extension[] { global::ProtobufUnittest.TopLevelMessage.Extensions.S }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TopLevelMessage.Types.NestedMessage), global::ProtobufUnittest.TopLevelMessage.Types.NestedMessage.Parser, null, null, null, null, null)}) - })); - } - #endregion - - } - /// Holder for extension identifiers generated from the top level of google/protobuf/unittest_retention.proto - public static partial class UnittestRetentionExtensions { - public static readonly pb::Extension PlainOption = - new pb::Extension(505092806, pb::FieldCodec.ForInt32(4040742448, 0)); - public static readonly pb::Extension RuntimeRetentionOption = - new pb::Extension(505039132, pb::FieldCodec.ForInt32(4040313056, 0)); - public static readonly pb::Extension SourceRetentionOption = - new pb::Extension(504878676, pb::FieldCodec.ForInt32(4039029408, 0)); - public static readonly pb::Extension FileOption = - new pb::Extension(504871168, pb::FieldCodec.ForMessage(4038969346, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::RepeatedExtension RepeatedOptions = - new pb::RepeatedExtension(504823570, pb::FieldCodec.ForMessage(4038588562, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension ExtensionRangeOption = - new pb::Extension(504822148, pb::FieldCodec.ForMessage(4038577186, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension MessageOption = - new pb::Extension(504820819, pb::FieldCodec.ForMessage(4038566554, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension FieldOption = - new pb::Extension(504589219, pb::FieldCodec.ForMessage(4036713754, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension OneofOption = - new pb::Extension(504479153, pb::FieldCodec.ForMessage(4035833226, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension EnumOption = - new pb::Extension(504451567, pb::FieldCodec.ForMessage(4035612538, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension EnumEntryOption = - new pb::Extension(504450522, pb::FieldCodec.ForMessage(4035604178, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension ServiceOption = - new pb::Extension(504387709, pb::FieldCodec.ForMessage(4035101674, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension MethodOption = - new pb::Extension(504349420, pb::FieldCodec.ForMessage(4034795362, global::ProtobufUnittest.OptionsMessage.Parser)); - public static readonly pb::Extension I = - new pb::Extension(1, pb::FieldCodec.ForInt32(8, 0)); - } - - #region Enums - public enum TopLevelEnum { - [pbr::OriginalName("TOP_LEVEL_UNKNOWN")] TopLevelUnknown = 0, - } - - #endregion - - #region Messages - /// - /// Retention attributes set on fields nested within a message - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class OptionsMessage : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionsMessage()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufUnittest.UnittestRetentionReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OptionsMessage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OptionsMessage(OptionsMessage other) : this() { - _hasBits0 = other._hasBits0; - plainField_ = other.plainField_; - runtimeRetentionField_ = other.runtimeRetentionField_; - sourceRetentionField_ = other.sourceRetentionField_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OptionsMessage Clone() { - return new OptionsMessage(this); - } - - /// Field number for the "plain_field" field. - public const int PlainFieldFieldNumber = 1; - private readonly static int PlainFieldDefaultValue = 0; - - private int plainField_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int PlainField { - get { if ((_hasBits0 & 1) != 0) { return plainField_; } else { return PlainFieldDefaultValue; } } - set { - _hasBits0 |= 1; - plainField_ = value; - } - } - /// Gets whether the "plain_field" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPlainField { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "plain_field" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPlainField() { - _hasBits0 &= ~1; - } - - /// Field number for the "runtime_retention_field" field. - public const int RuntimeRetentionFieldFieldNumber = 2; - private readonly static int RuntimeRetentionFieldDefaultValue = 0; - - private int runtimeRetentionField_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int RuntimeRetentionField { - get { if ((_hasBits0 & 2) != 0) { return runtimeRetentionField_; } else { return RuntimeRetentionFieldDefaultValue; } } - set { - _hasBits0 |= 2; - runtimeRetentionField_ = value; - } - } - /// Gets whether the "runtime_retention_field" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRuntimeRetentionField { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "runtime_retention_field" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRuntimeRetentionField() { - _hasBits0 &= ~2; - } - - /// Field number for the "source_retention_field" field. - public const int SourceRetentionFieldFieldNumber = 3; - private readonly static int SourceRetentionFieldDefaultValue = 0; - - private int sourceRetentionField_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int SourceRetentionField { - get { if ((_hasBits0 & 4) != 0) { return sourceRetentionField_; } else { return SourceRetentionFieldDefaultValue; } } - set { - _hasBits0 |= 4; - sourceRetentionField_ = value; - } - } - /// Gets whether the "source_retention_field" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSourceRetentionField { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "source_retention_field" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSourceRetentionField() { - _hasBits0 &= ~4; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OptionsMessage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OptionsMessage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (PlainField != other.PlainField) return false; - if (RuntimeRetentionField != other.RuntimeRetentionField) return false; - if (SourceRetentionField != other.SourceRetentionField) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasPlainField) hash ^= PlainField.GetHashCode(); - if (HasRuntimeRetentionField) hash ^= RuntimeRetentionField.GetHashCode(); - if (HasSourceRetentionField) hash ^= SourceRetentionField.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasPlainField) { - output.WriteRawTag(8); - output.WriteInt32(PlainField); - } - if (HasRuntimeRetentionField) { - output.WriteRawTag(16); - output.WriteInt32(RuntimeRetentionField); - } - if (HasSourceRetentionField) { - output.WriteRawTag(24); - output.WriteInt32(SourceRetentionField); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasPlainField) { - output.WriteRawTag(8); - output.WriteInt32(PlainField); - } - if (HasRuntimeRetentionField) { - output.WriteRawTag(16); - output.WriteInt32(RuntimeRetentionField); - } - if (HasSourceRetentionField) { - output.WriteRawTag(24); - output.WriteInt32(SourceRetentionField); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasPlainField) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlainField); - } - if (HasRuntimeRetentionField) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(RuntimeRetentionField); - } - if (HasSourceRetentionField) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(SourceRetentionField); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OptionsMessage other) { - if (other == null) { - return; - } - if (other.HasPlainField) { - PlainField = other.PlainField; - } - if (other.HasRuntimeRetentionField) { - RuntimeRetentionField = other.RuntimeRetentionField; - } - if (other.HasSourceRetentionField) { - SourceRetentionField = other.SourceRetentionField; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - PlainField = input.ReadInt32(); - break; - } - case 16: { - RuntimeRetentionField = input.ReadInt32(); - break; - } - case 24: { - SourceRetentionField = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - PlainField = input.ReadInt32(); - break; - } - case 16: { - RuntimeRetentionField = input.ReadInt32(); - break; - } - case 24: { - SourceRetentionField = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Extendee : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Extendee()); - private pb::UnknownFieldSet _unknownFields; - private pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufUnittest.UnittestRetentionReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Extendee() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Extendee(Extendee other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Extendee Clone() { - return new Extendee(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Extendee); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Extendee other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Extendee other) { - if (other == null) { - return; - } - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class TopLevelMessage : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TopLevelMessage()); - private pb::UnknownFieldSet _unknownFields; - private pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufUnittest.UnittestRetentionReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TopLevelMessage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TopLevelMessage(TopLevelMessage other) : this() { - _hasBits0 = other._hasBits0; - f_ = other.f_; - switch (other.OCase) { - case OOneofCase.I: - I = other.I; - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TopLevelMessage Clone() { - return new TopLevelMessage(this); - } - - /// Field number for the "f" field. - public const int FFieldNumber = 1; - private readonly static float FDefaultValue = 0F; - - private float f_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float F { - get { if ((_hasBits0 & 1) != 0) { return f_; } else { return FDefaultValue; } } - set { - _hasBits0 |= 1; - f_ = value; - } - } - /// Gets whether the "f" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasF { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "f" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearF() { - _hasBits0 &= ~1; - } - - /// Field number for the "i" field. - public const int IFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long I { - get { return HasI ? (long) o_ : 0L; } - set { - o_ = value; - oCase_ = OOneofCase.I; - } - } - /// Gets whether the "i" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasI { - get { return oCase_ == OOneofCase.I; } - } - /// Clears the value of the oneof if it's currently set to "i" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearI() { - if (HasI) { - ClearO(); - } - } - - private object o_; - /// Enum of possible cases for the "o" oneof. - public enum OOneofCase { - None = 0, - I = 2, - } - private OOneofCase oCase_ = OOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OOneofCase OCase { - get { return oCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearO() { - oCase_ = OOneofCase.None; - o_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as TopLevelMessage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(TopLevelMessage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(F, other.F)) return false; - if (I != other.I) return false; - if (OCase != other.OCase) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasF) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(F); - if (HasI) hash ^= I.GetHashCode(); - hash ^= (int) oCase_; - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasF) { - output.WriteRawTag(13); - output.WriteFloat(F); - } - if (HasI) { - output.WriteRawTag(16); - output.WriteInt64(I); - } - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasF) { - output.WriteRawTag(13); - output.WriteFloat(F); - } - if (HasI) { - output.WriteRawTag(16); - output.WriteInt64(I); - } - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasF) { - size += 1 + 4; - } - if (HasI) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(I); - } - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(TopLevelMessage other) { - if (other == null) { - return; - } - if (other.HasF) { - F = other.F; - } - switch (other.OCase) { - case OOneofCase.I: - I = other.I; - break; - } - - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 13: { - F = input.ReadFloat(); - break; - } - case 16: { - I = input.ReadInt64(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 13: { - F = input.ReadFloat(); - break; - } - case 16: { - I = input.ReadInt64(); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - #region Nested types - /// Container for nested types declared in the TopLevelMessage message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum NestedEnum { - [pbr::OriginalName("NESTED_UNKNOWN")] NestedUnknown = 0, - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class NestedMessage : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::ProtobufUnittest.TopLevelMessage.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NestedMessage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NestedMessage(NestedMessage other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NestedMessage Clone() { - return new NestedMessage(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as NestedMessage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(NestedMessage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(NestedMessage other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - } - #endregion - - #region Extensions - /// Container for extensions for other messages declared in the TopLevelMessage message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Extensions { - public static readonly pb::Extension S = - new pb::Extension(2, pb::FieldCodec.ForString(18, "")); - } - #endregion - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs similarity index 81% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs index 5202b9f0f98381bd500606336da87310435c4a80..7ed1580ab2c50914207c2eb71a267964cc17270c 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs @@ -1,8 +1,8 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: csharp/protos/unittest_selfreferential_options.proto +// source: unittest_selfreferential_options.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { - /// Holder for reflection information generated from csharp/protos/unittest_selfreferential_options.proto + /// Holder for reflection information generated from unittest_selfreferential_options.proto public static partial class UnittestSelfreferentialOptionsReflection { #region Descriptor - /// File descriptor for csharp/protos/unittest_selfreferential_options.proto + /// File descriptor for unittest_selfreferential_options.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,21 +24,20 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { static UnittestSelfreferentialOptionsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CjRjc2hhcnAvcHJvdG9zL3VuaXR0ZXN0X3NlbGZyZWZlcmVudGlhbF9vcHRp", - "b25zLnByb3RvEilwcm90b2J1Zl91bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxf", - "b3B0aW9ucxogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8iTAoK", - "Rm9vT3B0aW9ucxIeCgdpbnRfb3B0GAEgASgFQg3KPgoIAcA+Aso+AggDEhMK", - "A2ZvbxgCIAEoBUIGyj4DENIJKgkI6AcQgICAgAI6OQoLYmFyX29wdGlvbnMS", - "HS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGOgHIAEoBUIEwD7SCTpq", - "Cgtmb29fb3B0aW9ucxIdLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMY", - "6QcgASgLMjUucHJvdG9idWZfdW5pdHRlc3Rfc2VsZnJlZmVyZW50aWFsX29w", - "dGlvbnMuRm9vT3B0aW9uczpLCgtmb29faW50X29wdBI1LnByb3RvYnVmX3Vu", - "aXR0ZXN0X3NlbGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlvbnMY6Acg", - "ASgFOoIBCgtmb29fZm9vX29wdBI1LnByb3RvYnVmX3VuaXR0ZXN0X3NlbGZy", - "ZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlvbnMY6QcgASgLMjUucHJvdG9i", - "dWZfdW5pdHRlc3Rfc2VsZnJlZmVyZW50aWFsX29wdGlvbnMuRm9vT3B0aW9u", - "c0I0qgIxVW5pdFRlc3QuSXNzdWVzLlRlc3RQcm90b3MuU2VsZnJlZmVyZW50", - "aWFsT3B0aW9ucw==")); + "CiZ1bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0aW9ucy5wcm90bxIpcHJv", + "dG9idWZfdW5pdHRlc3Rfc2VsZnJlZmVyZW50aWFsX29wdGlvbnMaIGdvb2ds", + "ZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnByb3RvIkwKCkZvb09wdGlvbnMSHgoH", + "aW50X29wdBgBIAEoBUINyj4KCAHAPgLKPgIIAxITCgNmb28YAiABKAVCBso+", + "AxDSCSoJCOgHEICAgIACOjkKC2Jhcl9vcHRpb25zEh0uZ29vZ2xlLnByb3Rv", + "YnVmLkZpZWxkT3B0aW9ucxjoByABKAVCBMA+0gk6agoLZm9vX29wdGlvbnMS", + "HS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGOkHIAEoCzI1LnByb3Rv", + "YnVmX3VuaXR0ZXN0X3NlbGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlv", + "bnM6SwoLZm9vX2ludF9vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVm", + "ZXJlbnRpYWxfb3B0aW9ucy5Gb29PcHRpb25zGOgHIAEoBTqCAQoLZm9vX2Zv", + "b19vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0", + "aW9ucy5Gb29PcHRpb25zGOkHIAEoCzI1LnByb3RvYnVmX3VuaXR0ZXN0X3Nl", + "bGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlvbnNCNKoCMVVuaXRUZXN0", + "Lklzc3Vlcy5UZXN0UHJvdG9zLlNlbGZyZWZlcmVudGlhbE9wdGlvbnM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { UnittestSelfreferentialOptionsExtensions.BarOptions, UnittestSelfreferentialOptionsExtensions.FooOptions, UnittestSelfreferentialOptionsExtensions.FooIntOpt, UnittestSelfreferentialOptionsExtensions.FooFooOpt }, new pbr::GeneratedClrTypeInfo[] { @@ -48,7 +47,7 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { #endregion } - /// Holder for extension identifiers generated from the top level of csharp/protos/unittest_selfreferential_options.proto + /// Holder for extension identifiers generated from the top level of unittest_selfreferential_options.proto public static partial class UnittestSelfreferentialOptionsExtensions { /// /// Custom field option used on the definition of that field option. @@ -64,7 +63,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class FooOptions : pb::IExtendableMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -76,23 +74,19 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOptions() { OnConstruction(); } @@ -100,7 +94,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOptions(FooOptions other) : this() { _hasBits0 = other._hasBits0; intOpt_ = other.intOpt_; @@ -110,7 +103,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOptions Clone() { return new FooOptions(this); } @@ -124,7 +116,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { /// Custom field option used in definition of the extension message. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int IntOpt { get { if ((_hasBits0 & 1) != 0) { return intOpt_; } else { return IntOptDefaultValue; } } set { @@ -134,13 +125,11 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } /// Gets whether the "int_opt" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasIntOpt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "int_opt" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearIntOpt() { _hasBits0 &= ~1; } @@ -154,7 +143,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { /// Custom field option used in definition of the custom option's message. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Foo { get { if ((_hasBits0 & 2) != 0) { return foo_; } else { return FooDefaultValue; } } set { @@ -164,25 +152,21 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } /// Gets whether the "foo" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFoo { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "foo" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -199,7 +183,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasIntOpt) hash ^= IntOpt.GetHashCode(); @@ -214,13 +197,11 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -244,7 +225,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasIntOpt) { output.WriteRawTag(8); @@ -264,7 +244,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasIntOpt) { @@ -283,7 +262,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooOptions other) { if (other == null) { return; @@ -299,7 +277,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -327,7 +304,6 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.pb.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs similarity index 93% rename from csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.pb.cs rename to csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs index 179282d9c9853a4c301ed9594f335033ce81f439..996e928cfd5236b59ef1741301d4cf4779d6e86b 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.pb.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs @@ -2,7 +2,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/unittest_well_known_types.proto // -#pragma warning disable 1591, 0612, 3021, 8981 +#pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; @@ -179,7 +179,6 @@ namespace Google.Protobuf.TestProtos { /// Each wrapper type is included separately, as languages /// map handle different wrappers in different ways. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class TestWellKnownTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -188,23 +187,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestWellKnownTypes() { OnConstruction(); } @@ -212,7 +207,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestWellKnownTypes(TestWellKnownTypes other) : this() { anyField_ = other.anyField_ != null ? other.anyField_.Clone() : null; apiField_ = other.apiField_ != null ? other.apiField_.Clone() : null; @@ -237,7 +231,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestWellKnownTypes Clone() { return new TestWellKnownTypes(this); } @@ -246,7 +239,6 @@ namespace Google.Protobuf.TestProtos { public const int AnyFieldFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Any anyField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return anyField_; } set { @@ -258,7 +250,6 @@ namespace Google.Protobuf.TestProtos { public const int ApiFieldFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Api apiField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return apiField_; } set { @@ -270,7 +261,6 @@ namespace Google.Protobuf.TestProtos { public const int DurationFieldFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Duration durationField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return durationField_; } set { @@ -282,7 +272,6 @@ namespace Google.Protobuf.TestProtos { public const int EmptyFieldFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Empty emptyField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return emptyField_; } set { @@ -294,7 +283,6 @@ namespace Google.Protobuf.TestProtos { public const int FieldMaskFieldFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.FieldMask fieldMaskField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return fieldMaskField_; } set { @@ -306,7 +294,6 @@ namespace Google.Protobuf.TestProtos { public const int SourceContextFieldFieldNumber = 6; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContextField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return sourceContextField_; } set { @@ -318,7 +305,6 @@ namespace Google.Protobuf.TestProtos { public const int StructFieldFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Struct structField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return structField_; } set { @@ -330,7 +316,6 @@ namespace Google.Protobuf.TestProtos { public const int TimestampFieldFieldNumber = 8; private global::Google.Protobuf.WellKnownTypes.Timestamp timestampField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return timestampField_; } set { @@ -342,7 +327,6 @@ namespace Google.Protobuf.TestProtos { public const int TypeFieldFieldNumber = 9; private global::Google.Protobuf.WellKnownTypes.Type typeField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return typeField_; } set { @@ -355,7 +339,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private double? doubleField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField { get { return doubleField_; } set { @@ -369,7 +352,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_floatField_codec = pb::FieldCodec.ForStructWrapper(90); private float? floatField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float? FloatField { get { return floatField_; } set { @@ -383,7 +365,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); private long? int64Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field { get { return int64Field_; } set { @@ -397,7 +378,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); private ulong? uint64Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong? Uint64Field { get { return uint64Field_; } set { @@ -411,7 +391,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); private int? int32Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int? Int32Field { get { return int32Field_; } set { @@ -425,7 +404,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); private uint? uint32Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint? Uint32Field { get { return uint32Field_; } set { @@ -439,7 +417,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_boolField_codec = pb::FieldCodec.ForStructWrapper(130); private bool? boolField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool? BoolField { get { return boolField_; } set { @@ -453,7 +430,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_stringField_codec = pb::FieldCodec.ForClassWrapper(138); private string stringField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return stringField_; } set { @@ -467,7 +443,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); private pb::ByteString bytesField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BytesField { get { return bytesField_; } set { @@ -483,7 +458,6 @@ namespace Google.Protobuf.TestProtos { /// Part of struct, but useful to be able to test separately /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Value ValueField { get { return valueField_; } set { @@ -492,13 +466,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -529,7 +501,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (anyField_ != null) hash ^= AnyField.GetHashCode(); @@ -558,13 +529,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -644,7 +613,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (anyField_ != null) { output.WriteRawTag(10); @@ -720,7 +688,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (anyField_ != null) { @@ -787,7 +754,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestWellKnownTypes other) { if (other == null) { return; @@ -901,7 +867,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1052,7 +1017,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1203,7 +1167,6 @@ namespace Google.Protobuf.TestProtos { /// /// A repeated field for each well-known type. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class RepeatedWellKnownTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1212,23 +1175,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedWellKnownTypes() { OnConstruction(); } @@ -1236,7 +1195,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedWellKnownTypes(RepeatedWellKnownTypes other) : this() { anyField_ = other.anyField_.Clone(); apiField_ = other.apiField_.Clone(); @@ -1260,7 +1218,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedWellKnownTypes Clone() { return new RepeatedWellKnownTypes(this); } @@ -1271,7 +1228,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Any.Parser); private readonly pbc::RepeatedField anyField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField AnyField { get { return anyField_; } } @@ -1282,7 +1238,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser); private readonly pbc::RepeatedField apiField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ApiField { get { return apiField_; } } @@ -1293,7 +1248,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Duration.Parser); private readonly pbc::RepeatedField durationField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField DurationField { get { return durationField_; } } @@ -1304,7 +1258,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Empty.Parser); private readonly pbc::RepeatedField emptyField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField EmptyField { get { return emptyField_; } } @@ -1315,7 +1268,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); private readonly pbc::RepeatedField fieldMaskField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField FieldMaskField { get { return fieldMaskField_; } } @@ -1326,7 +1278,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser); private readonly pbc::RepeatedField sourceContextField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField SourceContextField { get { return sourceContextField_; } } @@ -1337,7 +1288,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Struct.Parser); private readonly pbc::RepeatedField structField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField StructField { get { return structField_; } } @@ -1348,7 +1298,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); private readonly pbc::RepeatedField timestampField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TimestampField { get { return timestampField_; } } @@ -1359,7 +1308,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Type.Parser); private readonly pbc::RepeatedField typeField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TypeField { get { return typeField_; } } @@ -1373,7 +1321,6 @@ namespace Google.Protobuf.TestProtos { /// These don't actually make a lot of sense, but they're not prohibited... /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField DoubleField { get { return doubleField_; } } @@ -1384,7 +1331,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(90); private readonly pbc::RepeatedField floatField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField FloatField { get { return floatField_; } } @@ -1395,7 +1341,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(98); private readonly pbc::RepeatedField int64Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int64Field { get { return int64Field_; } } @@ -1406,7 +1351,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(106); private readonly pbc::RepeatedField uint64Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Uint64Field { get { return uint64Field_; } } @@ -1417,7 +1361,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(114); private readonly pbc::RepeatedField int32Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int32Field { get { return int32Field_; } } @@ -1428,7 +1371,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(122); private readonly pbc::RepeatedField uint32Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Uint32Field { get { return uint32Field_; } } @@ -1439,7 +1381,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(130); private readonly pbc::RepeatedField boolField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField BoolField { get { return boolField_; } } @@ -1450,7 +1391,6 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForClassWrapper(138); private readonly pbc::RepeatedField stringField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField StringField { get { return stringField_; } } @@ -1461,19 +1401,16 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForClassWrapper(146); private readonly pbc::RepeatedField bytesField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField BytesField { get { return bytesField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -1503,7 +1440,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= anyField_.GetHashCode(); @@ -1531,13 +1467,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1568,7 +1502,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { anyField_.WriteTo(ref output, _repeated_anyField_codec); apiField_.WriteTo(ref output, _repeated_apiField_codec); @@ -1595,7 +1528,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += anyField_.CalculateSize(_repeated_anyField_codec); @@ -1623,7 +1555,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedWellKnownTypes other) { if (other == null) { return; @@ -1650,7 +1581,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1740,7 +1670,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1827,7 +1756,6 @@ namespace Google.Protobuf.TestProtos { } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class OneofWellKnownTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1836,23 +1764,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofWellKnownTypes() { OnConstruction(); } @@ -1860,7 +1784,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofWellKnownTypes(OneofWellKnownTypes other) : this() { switch (other.OneofFieldCase) { case OneofFieldOneofCase.AnyField: @@ -1923,7 +1846,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofWellKnownTypes Clone() { return new OneofWellKnownTypes(this); } @@ -1931,7 +1853,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "any_field" field. public const int AnyFieldFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return oneofFieldCase_ == OneofFieldOneofCase.AnyField ? (global::Google.Protobuf.WellKnownTypes.Any) oneofField_ : null; } set { @@ -1943,7 +1864,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "api_field" field. public const int ApiFieldFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return oneofFieldCase_ == OneofFieldOneofCase.ApiField ? (global::Google.Protobuf.WellKnownTypes.Api) oneofField_ : null; } set { @@ -1955,7 +1875,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "duration_field" field. public const int DurationFieldFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return oneofFieldCase_ == OneofFieldOneofCase.DurationField ? (global::Google.Protobuf.WellKnownTypes.Duration) oneofField_ : null; } set { @@ -1967,7 +1886,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "empty_field" field. public const int EmptyFieldFieldNumber = 4; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return oneofFieldCase_ == OneofFieldOneofCase.EmptyField ? (global::Google.Protobuf.WellKnownTypes.Empty) oneofField_ : null; } set { @@ -1979,7 +1897,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "field_mask_field" field. public const int FieldMaskFieldFieldNumber = 5; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField ? (global::Google.Protobuf.WellKnownTypes.FieldMask) oneofField_ : null; } set { @@ -1991,7 +1908,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "source_context_field" field. public const int SourceContextFieldFieldNumber = 6; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return oneofFieldCase_ == OneofFieldOneofCase.SourceContextField ? (global::Google.Protobuf.WellKnownTypes.SourceContext) oneofField_ : null; } set { @@ -2003,7 +1919,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "struct_field" field. public const int StructFieldFieldNumber = 7; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return oneofFieldCase_ == OneofFieldOneofCase.StructField ? (global::Google.Protobuf.WellKnownTypes.Struct) oneofField_ : null; } set { @@ -2015,7 +1930,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "timestamp_field" field. public const int TimestampFieldFieldNumber = 8; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return oneofFieldCase_ == OneofFieldOneofCase.TimestampField ? (global::Google.Protobuf.WellKnownTypes.Timestamp) oneofField_ : null; } set { @@ -2027,7 +1941,6 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "type_field" field. public const int TypeFieldFieldNumber = 9; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return oneofFieldCase_ == OneofFieldOneofCase.TypeField ? (global::Google.Protobuf.WellKnownTypes.Type) oneofField_ : null; } set { @@ -2040,7 +1953,6 @@ namespace Google.Protobuf.TestProtos { public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _oneof_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField { get { return oneofFieldCase_ == OneofFieldOneofCase.DoubleField ? (double?) oneofField_ : (double?) null; } set { @@ -2053,7 +1965,6 @@ namespace Google.Protobuf.TestProtos { public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _oneof_floatField_codec = pb::FieldCodec.ForStructWrapper(90); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float? FloatField { get { return oneofFieldCase_ == OneofFieldOneofCase.FloatField ? (float?) oneofField_ : (float?) null; } set { @@ -2066,7 +1977,6 @@ namespace Google.Protobuf.TestProtos { public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _oneof_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int64Field ? (long?) oneofField_ : (long?) null; } set { @@ -2079,7 +1989,6 @@ namespace Google.Protobuf.TestProtos { public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _oneof_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong? Uint64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint64Field ? (ulong?) oneofField_ : (ulong?) null; } set { @@ -2092,7 +2001,6 @@ namespace Google.Protobuf.TestProtos { public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _oneof_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int? Int32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int32Field ? (int?) oneofField_ : (int?) null; } set { @@ -2105,7 +2013,6 @@ namespace Google.Protobuf.TestProtos { public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _oneof_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint? Uint32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint32Field ? (uint?) oneofField_ : (uint?) null; } set { @@ -2118,7 +2025,6 @@ namespace Google.Protobuf.TestProtos { public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _oneof_boolField_codec = pb::FieldCodec.ForStructWrapper(130); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool? BoolField { get { return oneofFieldCase_ == OneofFieldOneofCase.BoolField ? (bool?) oneofField_ : (bool?) null; } set { @@ -2131,7 +2037,6 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _oneof_stringField_codec = pb::FieldCodec.ForClassWrapper(138); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return oneofFieldCase_ == OneofFieldOneofCase.StringField ? (string) oneofField_ : (string) null; } set { @@ -2144,7 +2049,6 @@ namespace Google.Protobuf.TestProtos { public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _oneof_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BytesField { get { return oneofFieldCase_ == OneofFieldOneofCase.BytesField ? (pb::ByteString) oneofField_ : (pb::ByteString) null; } set { @@ -2178,26 +2082,22 @@ namespace Google.Protobuf.TestProtos { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneofWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneofWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -2228,7 +2128,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) hash ^= AnyField.GetHashCode(); @@ -2257,13 +2156,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2339,7 +2236,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) { output.WriteRawTag(10); @@ -2411,7 +2307,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) { @@ -2475,7 +2370,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneofWellKnownTypes other) { if (other == null) { return; @@ -2568,7 +2462,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2703,7 +2596,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2840,7 +2732,6 @@ namespace Google.Protobuf.TestProtos { /// need to worry about the value part of the map being the /// well-known types, as messages can't be map keys. /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class MapWellKnownTypes : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -2849,23 +2740,19 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MapWellKnownTypes() { OnConstruction(); } @@ -2873,7 +2760,6 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MapWellKnownTypes(MapWellKnownTypes other) : this() { anyField_ = other.anyField_.Clone(); apiField_ = other.apiField_.Clone(); @@ -2897,7 +2783,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MapWellKnownTypes Clone() { return new MapWellKnownTypes(this); } @@ -2908,7 +2793,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 10); private readonly pbc::MapField anyField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField AnyField { get { return anyField_; } } @@ -2919,7 +2803,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser), 18); private readonly pbc::MapField apiField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField ApiField { get { return apiField_; } } @@ -2930,7 +2813,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Duration.Parser), 26); private readonly pbc::MapField durationField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField DurationField { get { return durationField_; } } @@ -2941,7 +2823,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Empty.Parser), 34); private readonly pbc::MapField emptyField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField EmptyField { get { return emptyField_; } } @@ -2952,7 +2833,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser), 42); private readonly pbc::MapField fieldMaskField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField FieldMaskField { get { return fieldMaskField_; } } @@ -2963,7 +2843,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser), 50); private readonly pbc::MapField sourceContextField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField SourceContextField { get { return sourceContextField_; } } @@ -2974,7 +2853,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Struct.Parser), 58); private readonly pbc::MapField structField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField StructField { get { return structField_; } } @@ -2985,7 +2863,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser), 66); private readonly pbc::MapField timestampField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField TimestampField { get { return timestampField_; } } @@ -2996,7 +2873,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Type.Parser), 74); private readonly pbc::MapField typeField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField TypeField { get { return typeField_; } } @@ -3007,7 +2883,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 82); private readonly pbc::MapField doubleField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField DoubleField { get { return doubleField_; } } @@ -3018,7 +2893,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 90); private readonly pbc::MapField floatField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField FloatField { get { return floatField_; } } @@ -3029,7 +2903,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 98); private readonly pbc::MapField int64Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Int64Field { get { return int64Field_; } } @@ -3040,7 +2913,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 106); private readonly pbc::MapField uint64Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Uint64Field { get { return uint64Field_; } } @@ -3051,7 +2923,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 114); private readonly pbc::MapField int32Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Int32Field { get { return int32Field_; } } @@ -3062,7 +2933,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 122); private readonly pbc::MapField uint32Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Uint32Field { get { return uint32Field_; } } @@ -3073,7 +2943,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 130); private readonly pbc::MapField boolField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField BoolField { get { return boolField_; } } @@ -3084,7 +2953,6 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForClassWrapper(18), 138); private readonly pbc::MapField stringField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField StringField { get { return stringField_; } } @@ -3095,19 +2963,16 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForClassWrapper(18), 146); private readonly pbc::MapField bytesField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField BytesField { get { return bytesField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MapWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MapWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -3137,7 +3002,6 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= AnyField.GetHashCode(); @@ -3165,13 +3029,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3202,7 +3064,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { anyField_.WriteTo(ref output, _map_anyField_codec); apiField_.WriteTo(ref output, _map_apiField_codec); @@ -3229,7 +3090,6 @@ namespace Google.Protobuf.TestProtos { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += anyField_.CalculateSize(_map_anyField_codec); @@ -3257,34 +3117,32 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MapWellKnownTypes other) { if (other == null) { return; } - anyField_.MergeFrom(other.anyField_); - apiField_.MergeFrom(other.apiField_); - durationField_.MergeFrom(other.durationField_); - emptyField_.MergeFrom(other.emptyField_); - fieldMaskField_.MergeFrom(other.fieldMaskField_); - sourceContextField_.MergeFrom(other.sourceContextField_); - structField_.MergeFrom(other.structField_); - timestampField_.MergeFrom(other.timestampField_); - typeField_.MergeFrom(other.typeField_); - doubleField_.MergeFrom(other.doubleField_); - floatField_.MergeFrom(other.floatField_); - int64Field_.MergeFrom(other.int64Field_); - uint64Field_.MergeFrom(other.uint64Field_); - int32Field_.MergeFrom(other.int32Field_); - uint32Field_.MergeFrom(other.uint32Field_); - boolField_.MergeFrom(other.boolField_); - stringField_.MergeFrom(other.stringField_); - bytesField_.MergeFrom(other.bytesField_); + anyField_.Add(other.anyField_); + apiField_.Add(other.apiField_); + durationField_.Add(other.durationField_); + emptyField_.Add(other.emptyField_); + fieldMaskField_.Add(other.fieldMaskField_); + sourceContextField_.Add(other.sourceContextField_); + structField_.Add(other.structField_); + timestampField_.Add(other.timestampField_); + typeField_.Add(other.typeField_); + doubleField_.Add(other.doubleField_); + floatField_.Add(other.floatField_); + int64Field_.Add(other.int64Field_); + uint64Field_.Add(other.uint64Field_); + int32Field_.Add(other.int32Field_); + uint32Field_.Add(other.uint32Field_); + boolField_.Add(other.boolField_); + stringField_.Add(other.stringField_); + bytesField_.Add(other.bytesField_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3374,7 +3232,6 @@ namespace Google.Protobuf.TestProtos { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs b/csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs index 4ee98391e02917e9dbc4ab5ce98ac1c49fa8fa2a..5b9913b29035ff6ea80ff86e6e8741686a9fd699 100644 --- a/csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs +++ b/csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -19,7 +42,7 @@ namespace Google.Protobuf.Buffers /// ArrayBufferWriter is originally from corefx, and has been contributed to Protobuf /// https://github.com/dotnet/runtime/blob/071da4c41aa808c949a773b92dca6f88de9d11f3/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs /// - internal sealed class TestArrayBufferWriter : IBufferWriter + internal sealed class ArrayBufferWriter : IBufferWriter { private T[] _buffer; private int _index; @@ -27,10 +50,10 @@ namespace Google.Protobuf.Buffers private const int DefaultInitialBufferSize = 256; /// - /// Creates an instance of an , in which data can be written to, + /// Creates an instance of an , in which data can be written to, /// with the default initial capacity. /// - public TestArrayBufferWriter() + public ArrayBufferWriter() { _buffer = new T[0]; _index = 0; @@ -43,14 +66,14 @@ namespace Google.Protobuf.Buffers public int? MaxGrowBy { get; set; } /// - /// Creates an instance of an , in which data can be written to, + /// Creates an instance of an , in which data can be written to, /// with an initial capacity specified. /// /// The minimum capacity with which to initialize the underlying buffer. /// /// Thrown when is not positive (i.e. less than or equal to 0). /// - public TestArrayBufferWriter(int initialCapacity) + public ArrayBufferWriter(int initialCapacity) { if (initialCapacity <= 0) throw new ArgumentException(nameof(initialCapacity)); @@ -88,7 +111,7 @@ namespace Google.Protobuf.Buffers /// Clears the data written to the underlying buffer. /// /// - /// You must clear the before trying to re-use it. + /// You must clear the before trying to re-use it. /// public void Clear() { diff --git a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs index 5bae81eb819bb836770bf4fb2a26e5f6286e80e8..adbbc3ef5470a5feab9b1b6128449d2cb7648c73 100644 --- a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs +++ b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs @@ -1,406 +1,265 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Text; -using NUnit.Framework; -using System.IO; -using System.Collections.Generic; -using System.Collections; -using System.Linq; -using System.Buffers; -using System.Runtime.InteropServices; -using System.Threading; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; - -namespace Google.Protobuf -{ - public class ByteStringTest - { - [Test] - public void Equality() - { - ByteString b1 = ByteString.CopyFrom(1, 2, 3); - ByteString b2 = ByteString.CopyFrom(1, 2, 3); - ByteString b3 = ByteString.CopyFrom(1, 2, 4); - ByteString b4 = ByteString.CopyFrom(1, 2, 3, 4); - EqualityTester.AssertEquality(b1, b1); - EqualityTester.AssertEquality(b1, b2); - EqualityTester.AssertInequality(b1, b3); - EqualityTester.AssertInequality(b1, b4); - EqualityTester.AssertInequality(b1, null); - EqualityTester.AssertEquality(ByteString.Empty, ByteString.Empty); -#pragma warning disable 1718 // Deliberately calling ==(b1, b1) and !=(b1, b1) - Assert.IsTrue(b1 == b1); - Assert.IsTrue(b1 == b2); - Assert.IsFalse(b1 == b3); - Assert.IsFalse(b1 == b4); - Assert.IsFalse(b1 == null); - Assert.IsTrue((ByteString) null == null); - Assert.IsFalse(b1 != b1); - Assert.IsFalse(b1 != b2); - Assert.IsTrue(ByteString.Empty == ByteString.Empty); -#pragma warning restore 1718 - Assert.IsTrue(b1 != b3); - Assert.IsTrue(b1 != b4); - Assert.IsTrue(b1 != null); - Assert.IsFalse((ByteString) null != null); - } - - [Test] - public void EmptyByteStringHasZeroSize() - { - Assert.AreEqual(0, ByteString.Empty.Length); - } - - [Test] - public void CopyFromStringWithExplicitEncoding() - { - ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode); - Assert.AreEqual(4, bs.Length); - Assert.AreEqual(65, bs[0]); - Assert.AreEqual(0, bs[1]); - Assert.AreEqual(66, bs[2]); - Assert.AreEqual(0, bs[3]); - } - - [Test] - public void IsEmptyWhenEmpty() - { - Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty); - } - - [Test] - public void IsEmptyWhenNotEmpty() - { - Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty); - } - - [Test] - public void CopyFromByteArrayCopiesContents() - { - byte[] data = new byte[1]; - data[0] = 10; - ByteString bs = ByteString.CopyFrom(data); - Assert.AreEqual(10, bs[0]); - data[0] = 5; - Assert.AreEqual(10, bs[0]); - } - - [Test] - public void CopyFromReadOnlySpanCopiesContents() - { - byte[] data = new byte[1]; - data[0] = 10; - ReadOnlySpan byteSpan = data; - var bs = ByteString.CopyFrom(byteSpan); - Assert.AreEqual(10, bs[0]); - data[0] = 5; - Assert.AreEqual(10, bs[0]); - } - - [Test] - public void ToByteArrayCopiesContents() - { - ByteString bs = ByteString.CopyFromUtf8("Hello"); - byte[] data = bs.ToByteArray(); - Assert.AreEqual((byte)'H', data[0]); - Assert.AreEqual((byte)'H', bs[0]); - data[0] = 0; - Assert.AreEqual(0, data[0]); - Assert.AreEqual((byte)'H', bs[0]); - } - - [Test] - public void CopyFromUtf8UsesUtf8() - { - ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(0xe2, bs[0]); - Assert.AreEqual(0x82, bs[1]); - Assert.AreEqual(0xac, bs[2]); - } - - [Test] - public void CopyFromPortion() - { - byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; - ByteString bs = ByteString.CopyFrom(data, 2, 3); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(2, bs[0]); - Assert.AreEqual(3, bs[1]); - } - - [Test] - public void CopyTo() - { - byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; - ByteString bs = ByteString.CopyFrom(data); - - byte[] dest = new byte[data.Length]; - bs.CopyTo(dest, 0); - - CollectionAssert.AreEqual(data, dest); - } - - [Test] - public void GetEnumerator() - { - byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; - ByteString bs = ByteString.CopyFrom(data); - - IEnumerator genericEnumerator = bs.GetEnumerator(); - Assert.IsTrue(genericEnumerator.MoveNext()); - Assert.AreEqual(0, genericEnumerator.Current); - - IEnumerator enumerator = ((IEnumerable)bs).GetEnumerator(); - Assert.IsTrue(enumerator.MoveNext()); - Assert.AreEqual(0, enumerator.Current); - - // Call via LINQ - CollectionAssert.AreEqual(bs.Span.ToArray(), bs.ToArray()); - } - - [Test] - public void UnsafeWrap() - { - byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; - ByteString bs = UnsafeByteOperations.UnsafeWrap(data.AsMemory(2, 3)); - ReadOnlySpan s = bs.Span; - - Assert.AreEqual(3, s.Length); - Assert.AreEqual(2, s[0]); - Assert.AreEqual(3, s[1]); - Assert.AreEqual(4, s[2]); - - // Check that the value is not a copy - data[2] = byte.MaxValue; - Assert.AreEqual(byte.MaxValue, s[0]); - } - - [Test] - public void CreateCodedInput_FromArraySegment() - { - byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; - ByteString bs = UnsafeByteOperations.UnsafeWrap(data.AsMemory(2, 3)); - CodedInputStream codedInputStream = bs.CreateCodedInput(); - - byte[] bytes = codedInputStream.ReadRawBytes(3); - - Assert.AreEqual(3, bytes.Length); - Assert.AreEqual(2, bytes[0]); - Assert.AreEqual(3, bytes[1]); - Assert.AreEqual(4, bytes[2]); - Assert.IsTrue(codedInputStream.IsAtEnd); - } - - [Test] - public void WriteToStream() - { - byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; - ByteString bs = ByteString.CopyFrom(data); - - MemoryStream ms = new MemoryStream(); - bs.WriteTo(ms); - - CollectionAssert.AreEqual(data, ms.ToArray()); - } - - [Test] - public void WriteToStream_Stackalloc() - { - byte[] data = Encoding.UTF8.GetBytes("Hello world"); - Span s = stackalloc byte[data.Length]; - data.CopyTo(s); - - MemoryStream ms = new MemoryStream(); - - using (UnmanagedMemoryManager manager = new UnmanagedMemoryManager(s)) - { - ByteString bs = ByteString.AttachBytes(manager.Memory); - - bs.WriteTo(ms); - } - - CollectionAssert.AreEqual(data, ms.ToArray()); - } - - [Test] - public void ToStringUtf8() - { - ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual("\u20ac", bs.ToStringUtf8()); - } - - [Test] - public void ToStringWithExplicitEncoding() - { - ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode); - Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode)); - } - - [Test] - public void ToString_Stackalloc() - { - byte[] data = Encoding.UTF8.GetBytes("Hello world"); - Span s = stackalloc byte[data.Length]; - data.CopyTo(s); - - using var manager = new UnmanagedMemoryManager(s); - ByteString bs = ByteString.AttachBytes(manager.Memory); - Assert.AreEqual("Hello world", bs.ToString(Encoding.UTF8)); - } - - [Test] - public void FromBase64_WithText() - { - byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; - string base64 = Convert.ToBase64String(data); - ByteString bs = ByteString.FromBase64(base64); - Assert.AreEqual(data, bs.ToByteArray()); - } - - [Test] - public void FromBase64_Empty() - { - // Optimization which also fixes issue 61. - Assert.AreSame(ByteString.Empty, ByteString.FromBase64("")); - } - - [Test] - public void ToBase64_Array() - { - ByteString bs = ByteString.CopyFrom(Encoding.UTF8.GetBytes("Hello world")); - - Assert.AreEqual("SGVsbG8gd29ybGQ=", bs.ToBase64()); - } - - [Test] - public void ToBase64_Stackalloc() - { - byte[] data = Encoding.UTF8.GetBytes("Hello world"); - Span s = stackalloc byte[data.Length]; - data.CopyTo(s); - - using var manager = new UnmanagedMemoryManager(s); - ByteString bs = ByteString.AttachBytes(manager.Memory); - Assert.AreEqual("SGVsbG8gd29ybGQ=", bs.ToBase64()); - } - - [Test] - public void FromStream_Seekable() - { - var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); - // Consume the first byte, just to test that it's "from current position" - stream.ReadByte(); - var actual = ByteString.FromStream(stream); - ByteString expected = ByteString.CopyFrom(2, 3, 4, 5); - Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); - } - - [Test] - public void FromStream_NotSeekable() - { - var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); - // Consume the first byte, just to test that it's "from current position" - stream.ReadByte(); - // Wrap the original stream in LimitedInputStream, which has CanSeek=false - var limitedStream = new LimitedInputStream(stream, 3); - var actual = ByteString.FromStream(limitedStream); - ByteString expected = ByteString.CopyFrom(2, 3, 4); - Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); - } - - [Test] - public async Task FromStreamAsync_Seekable() - { - var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); - // Consume the first byte, just to test that it's "from current position" - stream.ReadByte(); - var actual = await ByteString.FromStreamAsync(stream); - ByteString expected = ByteString.CopyFrom(2, 3, 4, 5); - Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); - } - - [Test] - public async Task FromStreamAsync_NotSeekable() - { - var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); - // Consume the first byte, just to test that it's "from current position" - stream.ReadByte(); - // Wrap the original stream in LimitedInputStream, which has CanSeek=false - var limitedStream = new LimitedInputStream(stream, 3); - var actual = await ByteString.FromStreamAsync(limitedStream); - ByteString expected = ByteString.CopyFrom(2, 3, 4); - Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); - } - - [Test] - public void GetHashCode_Regression() - { - // We used to have an awful hash algorithm where only the last four - // bytes were relevant. This is a regression test for - // https://github.com/protocolbuffers/protobuf/issues/2511 - - ByteString b1 = ByteString.CopyFrom(100, 1, 2, 3, 4); - ByteString b2 = ByteString.CopyFrom(200, 1, 2, 3, 4); - Assert.AreNotEqual(b1.GetHashCode(), b2.GetHashCode()); - } - - [Test] - public void GetContentsAsReadOnlySpan() - { - var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); - var copied = byteString.Span.ToArray(); - CollectionAssert.AreEqual(byteString, copied); - } - - [Test] - public void GetContentsAsReadOnlyMemory() - { - var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); - var copied = byteString.Memory.ToArray(); - CollectionAssert.AreEqual(byteString, copied); - } - - // Create Memory from non-array source. - // Use by ByteString tests that have optimized path for array backed Memory. - private sealed unsafe class UnmanagedMemoryManager : MemoryManager where T : unmanaged - { - private readonly T* _pointer; - private readonly int _length; - - public UnmanagedMemoryManager(Span span) - { - fixed (T* ptr = &MemoryMarshal.GetReference(span)) - { - _pointer = ptr; - _length = span.Length; - } - } - - public override Span GetSpan() => new Span(_pointer, _length); - - public override MemoryHandle Pin(int elementIndex = 0) - { - if (elementIndex < 0 || elementIndex >= _length) - { - throw new ArgumentOutOfRangeException(nameof(elementIndex)); - } - - return new MemoryHandle(_pointer + elementIndex); - } - - public override void Unpin() { } - - protected override void Dispose(bool disposing) { } - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Text; +using NUnit.Framework; +using System.IO; +#if !NET35 +using System.Threading.Tasks; +#endif + +namespace Google.Protobuf +{ + public class ByteStringTest + { + [Test] + public void Equality() + { + ByteString b1 = ByteString.CopyFrom(1, 2, 3); + ByteString b2 = ByteString.CopyFrom(1, 2, 3); + ByteString b3 = ByteString.CopyFrom(1, 2, 4); + ByteString b4 = ByteString.CopyFrom(1, 2, 3, 4); + EqualityTester.AssertEquality(b1, b1); + EqualityTester.AssertEquality(b1, b2); + EqualityTester.AssertInequality(b1, b3); + EqualityTester.AssertInequality(b1, b4); + EqualityTester.AssertInequality(b1, null); +#pragma warning disable 1718 // Deliberately calling ==(b1, b1) and !=(b1, b1) + Assert.IsTrue(b1 == b1); + Assert.IsTrue(b1 == b2); + Assert.IsFalse(b1 == b3); + Assert.IsFalse(b1 == b4); + Assert.IsFalse(b1 == null); + Assert.IsTrue((ByteString) null == null); + Assert.IsFalse(b1 != b1); + Assert.IsFalse(b1 != b2); +#pragma warning disable 1718 + Assert.IsTrue(b1 != b3); + Assert.IsTrue(b1 != b4); + Assert.IsTrue(b1 != null); + Assert.IsFalse((ByteString) null != null); + } + + [Test] + public void EmptyByteStringHasZeroSize() + { + Assert.AreEqual(0, ByteString.Empty.Length); + } + + [Test] + public void CopyFromStringWithExplicitEncoding() + { + ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode); + Assert.AreEqual(4, bs.Length); + Assert.AreEqual(65, bs[0]); + Assert.AreEqual(0, bs[1]); + Assert.AreEqual(66, bs[2]); + Assert.AreEqual(0, bs[3]); + } + + [Test] + public void IsEmptyWhenEmpty() + { + Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty); + } + + [Test] + public void IsEmptyWhenNotEmpty() + { + Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty); + } + + [Test] + public void CopyFromByteArrayCopiesContents() + { + byte[] data = new byte[1]; + data[0] = 10; + ByteString bs = ByteString.CopyFrom(data); + Assert.AreEqual(10, bs[0]); + data[0] = 5; + Assert.AreEqual(10, bs[0]); + } + + [Test] + public void CopyFromReadOnlySpanCopiesContents() + { + byte[] data = new byte[1]; + data[0] = 10; + ReadOnlySpan byteSpan = data; + var bs = ByteString.CopyFrom(byteSpan); + Assert.AreEqual(10, bs[0]); + data[0] = 5; + Assert.AreEqual(10, bs[0]); + } + + [Test] + public void ToByteArrayCopiesContents() + { + ByteString bs = ByteString.CopyFromUtf8("Hello"); + byte[] data = bs.ToByteArray(); + Assert.AreEqual((byte)'H', data[0]); + Assert.AreEqual((byte)'H', bs[0]); + data[0] = 0; + Assert.AreEqual(0, data[0]); + Assert.AreEqual((byte)'H', bs[0]); + } + + [Test] + public void CopyFromUtf8UsesUtf8() + { + ByteString bs = ByteString.CopyFromUtf8("\u20ac"); + Assert.AreEqual(3, bs.Length); + Assert.AreEqual(0xe2, bs[0]); + Assert.AreEqual(0x82, bs[1]); + Assert.AreEqual(0xac, bs[2]); + } + + [Test] + public void CopyFromPortion() + { + byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; + ByteString bs = ByteString.CopyFrom(data, 2, 3); + Assert.AreEqual(3, bs.Length); + Assert.AreEqual(2, bs[0]); + Assert.AreEqual(3, bs[1]); + } + + [Test] + public void ToStringUtf8() + { + ByteString bs = ByteString.CopyFromUtf8("\u20ac"); + Assert.AreEqual("\u20ac", bs.ToStringUtf8()); + } + + [Test] + public void ToStringWithExplicitEncoding() + { + ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode); + Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode)); + } + + [Test] + public void FromBase64_WithText() + { + byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; + string base64 = Convert.ToBase64String(data); + ByteString bs = ByteString.FromBase64(base64); + Assert.AreEqual(data, bs.ToByteArray()); + } + + [Test] + public void FromBase64_Empty() + { + // Optimization which also fixes issue 61. + Assert.AreSame(ByteString.Empty, ByteString.FromBase64("")); + } + + [Test] + public void FromStream_Seekable() + { + var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); + // Consume the first byte, just to test that it's "from current position" + stream.ReadByte(); + var actual = ByteString.FromStream(stream); + ByteString expected = ByteString.CopyFrom(2, 3, 4, 5); + Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); + } + + [Test] + public void FromStream_NotSeekable() + { + var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); + // Consume the first byte, just to test that it's "from current position" + stream.ReadByte(); + // Wrap the original stream in LimitedInputStream, which has CanSeek=false + var limitedStream = new LimitedInputStream(stream, 3); + var actual = ByteString.FromStream(limitedStream); + ByteString expected = ByteString.CopyFrom(2, 3, 4); + Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); + } + +#if !NET35 + [Test] + public async Task FromStreamAsync_Seekable() + { + var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); + // Consume the first byte, just to test that it's "from current position" + stream.ReadByte(); + var actual = await ByteString.FromStreamAsync(stream); + ByteString expected = ByteString.CopyFrom(2, 3, 4, 5); + Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); + } + + [Test] + public async Task FromStreamAsync_NotSeekable() + { + var stream = new MemoryStream(new byte[] { 1, 2, 3, 4, 5 }); + // Consume the first byte, just to test that it's "from current position" + stream.ReadByte(); + // Wrap the original stream in LimitedInputStream, which has CanSeek=false + var limitedStream = new LimitedInputStream(stream, 3); + var actual = await ByteString.FromStreamAsync(limitedStream); + ByteString expected = ByteString.CopyFrom(2, 3, 4); + Assert.AreEqual(expected, actual, $"{expected.ToBase64()} != {actual.ToBase64()}"); + } +#endif + + [Test] + public void GetHashCode_Regression() + { + // We used to have an awful hash algorithm where only the last four + // bytes were relevant. This is a regression test for + // https://github.com/protocolbuffers/protobuf/issues/2511 + + ByteString b1 = ByteString.CopyFrom(100, 1, 2, 3, 4); + ByteString b2 = ByteString.CopyFrom(200, 1, 2, 3, 4); + Assert.AreNotEqual(b1.GetHashCode(), b2.GetHashCode()); + } + + [Test] + public void GetContentsAsReadOnlySpan() + { + var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); + var copied = byteString.Span.ToArray(); + CollectionAssert.AreEqual(byteString, copied); + } + + [Test] + public void GetContentsAsReadOnlyMemory() + { + var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); + var copied = byteString.Memory.ToArray(); + CollectionAssert.AreEqual(byteString, copied); + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs b/csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs index 6cacd805837080434657926abc95ba2929d0bcb7..23af28870ab4bc62fa76a582ac75172a5b4206a7 100644 --- a/csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs +++ b/csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; diff --git a/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs index 2020de5da3a5a5e698892ad9fc4add4cbbddec73..0ad286f3787f58829429d71d9971e4c91c9c6679 100644 --- a/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs +++ b/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs @@ -1,979 +1,980 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Buffers; -using System.IO; -using Google.Protobuf.TestProtos; -using Proto2 = Google.Protobuf.TestProtos.Proto2; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class CodedInputStreamTest - { - /// - /// Helper to construct a byte array from a bunch of bytes. The inputs are - /// actually ints so that I can use hex notation and not get stupid errors - /// about precision. - /// - private static byte[] Bytes(params int[] bytesAsInts) - { - byte[] bytes = new byte[bytesAsInts.Length]; - for (int i = 0; i < bytesAsInts.Length; i++) - { - bytes[i] = (byte) bytesAsInts[i]; - } - return bytes; - } - - /// - /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() - /// - private static void AssertReadVarint(byte[] data, ulong value) - { - CodedInputStream input = new CodedInputStream(data); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); - Assert.IsTrue(input.IsAtEnd); - - input = new CodedInputStream(data); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); - - AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => - { - Assert.AreEqual((uint) value, ctx.ReadUInt32()); - }, true); - - AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => - { - Assert.AreEqual(value, ctx.ReadUInt64()); - }, true); - - // Try different block sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); - - input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); - - AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, bufferSize), (ref ParseContext ctx) => - { - Assert.AreEqual((uint) value, ctx.ReadUInt32()); - }, true); - - AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, bufferSize), (ref ParseContext ctx) => - { - Assert.AreEqual(value, ctx.ReadUInt64()); - }, true); - } - - // Try reading directly from a MemoryStream. We want to verify that it - // doesn't read past the end of the input, so write an extra byte - this - // lets us test the position at the end. - MemoryStream memoryStream = new MemoryStream(); - memoryStream.Write(data, 0, data.Length); - memoryStream.WriteByte(0); - memoryStream.Position = 0; - Assert.AreEqual((uint) value, CodedInputStream.ReadRawVarint32(memoryStream)); - Assert.AreEqual(data.Length, memoryStream.Position); - } - - /// - /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and - /// expects them to fail with an InvalidProtocolBufferException whose - /// description matches the given one. - /// - private static void AssertReadVarintFailure(InvalidProtocolBufferException expected, byte[] data) - { - CodedInputStream input = new CodedInputStream(data); - var exception = Assert.Throws(() => input.ReadRawVarint32()); - Assert.AreEqual(expected.Message, exception.Message); - - input = new CodedInputStream(data); - exception = Assert.Throws(() => input.ReadRawVarint64()); - Assert.AreEqual(expected.Message, exception.Message); - - AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => - { - try - { - ctx.ReadUInt32(); - Assert.Fail(); - } - catch (InvalidProtocolBufferException ex) - { - Assert.AreEqual(expected.Message, ex.Message); - } - }, false); - - AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => - { - try - { - ctx.ReadUInt64(); - Assert.Fail(); - } - catch (InvalidProtocolBufferException ex) - { - Assert.AreEqual(expected.Message, ex.Message); - } - }, false); - - // Make sure we get the same error when reading directly from a Stream. - exception = Assert.Throws(() => CodedInputStream.ReadRawVarint32(new MemoryStream(data))); - Assert.AreEqual(expected.Message, exception.Message); - } - - private delegate void ParseContextAssertAction(ref ParseContext ctx); - - private static void AssertReadFromParseContext(ReadOnlySequence input, ParseContextAssertAction assertAction, bool assertIsAtEnd) - { - // Check as ReadOnlySequence - ParseContext.Initialize(input, out ParseContext parseCtx); - assertAction(ref parseCtx); - if (assertIsAtEnd) - { - Assert.IsTrue(SegmentedBufferHelper.IsAtEnd(ref parseCtx.buffer, ref parseCtx.state)); - } - - // Check as ReadOnlySpan - ParseContext.Initialize(input.ToArray().AsSpan(), out ParseContext spanParseContext); - assertAction(ref spanParseContext); - if (assertIsAtEnd) - { - Assert.IsTrue(SegmentedBufferHelper.IsAtEnd(ref spanParseContext.buffer, ref spanParseContext.state)); - } - } - - [Test] - public void ReadVarint() - { - AssertReadVarint(Bytes(0x00), 0); - AssertReadVarint(Bytes(0x01), 1); - AssertReadVarint(Bytes(0x7f), 127); - // 14882 - AssertReadVarint(Bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); - // 2961488830 - AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - AssertReadVarint(Bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49)); - // 11964378330978735131 - AssertReadVarint(Bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), - (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bUL << 28) | (0x56UL << 35) | (0x00UL << 42) | - (0x05UL << 49) | (0x26UL << 56) | (0x01UL << 63)); - - // Failures - AssertReadVarintFailure( - InvalidProtocolBufferException.MalformedVarint(), - Bytes(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x00)); - AssertReadVarintFailure( - InvalidProtocolBufferException.TruncatedMessage(), - Bytes(0x80)); - } - - /// - /// Parses the given bytes using ReadRawLittleEndian32() and checks - /// that the result matches the given value. - /// - private static void AssertReadLittleEndian32(byte[] data, uint value) - { - CodedInputStream input = new CodedInputStream(data); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); - - AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => - { - Assert.AreEqual(value, ctx.ReadFixed32()); - }, true); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - input = new CodedInputStream( - new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); - - AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, blockSize), (ref ParseContext ctx) => - { - Assert.AreEqual(value, ctx.ReadFixed32()); - }, true); - } - } - - /// - /// Parses the given bytes using ReadRawLittleEndian64() and checks - /// that the result matches the given value. - /// - private static void AssertReadLittleEndian64(byte[] data, ulong value) - { - CodedInputStream input = new CodedInputStream(data); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); - - AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => - { - Assert.AreEqual(value, ctx.ReadFixed64()); - }, true); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - input = new CodedInputStream( - new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); - - AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, blockSize), (ref ParseContext ctx) => - { - Assert.AreEqual(value, ctx.ReadFixed64()); - }, true); - } - } - - [Test] - public void ReadLittleEndian() - { - AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); - AssertReadLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); - - AssertReadLittleEndian64(Bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), - 0x123456789abcdef0L); - AssertReadLittleEndian64( - Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL); - } - - [Test] - public void DecodeZigZag32() - { - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(0)); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(1)); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(2)); - Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag32(3)); - Assert.AreEqual(0x3FFFFFFF, ParsingPrimitives.DecodeZigZag32(0x7FFFFFFE)); - Assert.AreEqual(unchecked((int) 0xC0000000), ParsingPrimitives.DecodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0x7FFFFFFF, ParsingPrimitives.DecodeZigZag32(0xFFFFFFFE)); - Assert.AreEqual(unchecked((int) 0x80000000), ParsingPrimitives.DecodeZigZag32(0xFFFFFFFF)); - } - - [Test] - public void DecodeZigZag64() - { - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(0)); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(1)); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(2)); - Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag64(3)); - Assert.AreEqual(0x000000003FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFFL)); - Assert.AreEqual(0x000000007FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFFL)); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0x8000000000000000L), ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); - } - - [Test] - public void ReadWholeMessage_VaryingBlockSizes() - { - TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); - - byte[] rawBytes = message.ToByteArray(); - Assert.AreEqual(rawBytes.Length, message.CalculateSize()); - TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(rawBytes); - Assert.AreEqual(message, message2); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) - { - message2 = TestAllTypes.Parser.ParseFrom(new SmallBlockInputStream(rawBytes, blockSize)); - Assert.AreEqual(message, message2); - } - } - - [Test] - public void ReadWholeMessage_VaryingBlockSizes_FromSequence() - { - TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); - - byte[] rawBytes = message.ToByteArray(); - Assert.AreEqual(rawBytes.Length, message.CalculateSize()); - TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(rawBytes); - Assert.AreEqual(message, message2); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) - { - message2 = TestAllTypes.Parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(rawBytes, blockSize)); - Assert.AreEqual(message, message2); - } - } - - [Test] - public void ReadInt32Wrapper_VariableBlockSizes() - { - byte[] rawBytes = new byte[] { 202, 1, 11, 8, 254, 255, 255, 255, 255, 255, 255, 255, 255, 1 }; - - for (int blockSize = 1; blockSize <= rawBytes.Length; blockSize++) - { - ReadOnlySequence data = ReadOnlySequenceFactory.CreateWithContent(rawBytes, blockSize); - AssertReadFromParseContext(data, (ref ParseContext ctx) => - { - ctx.ReadTag(); - - var value = ParsingPrimitivesWrappers.ReadInt32Wrapper(ref ctx); - - Assert.AreEqual(-2, value); - }, true); - } - } - - [Test] - public void ReadHugeBlob() - { - // Allocate and initialize a 1MB blob. - byte[] blob = new byte[1 << 20]; - for (int i = 0; i < blob.Length; i++) - { - blob[i] = (byte) i; - } - - // Make a message containing it. - var message = new TestAllTypes { SingleBytes = ByteString.CopyFrom(blob) }; - - // Serialize and parse it. Make sure to parse from an InputStream, not - // directly from a ByteString, so that CodedInputStream uses buffered - // reading. - TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(message.ToByteString()); - - Assert.AreEqual(message, message2); - } - - [Test] - public void ReadMaliciouslyLargeBlob() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(0x7FFFFFFF); - output.WriteRawBytes(new byte[32]); // Pad with a few random bytes. - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms); - Assert.AreEqual(tag, input.ReadTag()); - - Assert.Throws(() => input.ReadBytes()); - } - - [Test] - public void ReadBlobGreaterThanCurrentLimit() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(4); - output.WriteRawBytes(new byte[4]); // Pad with a few random bytes. - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms); - Assert.AreEqual(tag, input.ReadTag()); - - // Specify limit smaller than data length - input.PushLimit(3); - Assert.Throws(() => input.ReadBytes()); - - AssertReadFromParseContext(new ReadOnlySequence(ms.ToArray()), (ref ParseContext ctx) => - { - Assert.AreEqual(tag, ctx.ReadTag()); - SegmentedBufferHelper.PushLimit(ref ctx.state, 3); - try - { - ctx.ReadBytes(); - Assert.Fail(); - } - catch (InvalidProtocolBufferException) {} - }, true); - } - - [Test] - public void ReadStringGreaterThanCurrentLimit() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(4); - output.WriteRawBytes(new byte[4]); // Pad with a few random bytes. - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms.ToArray()); - Assert.AreEqual(tag, input.ReadTag()); - - // Specify limit smaller than data length - input.PushLimit(3); - Assert.Throws(() => input.ReadString()); - - AssertReadFromParseContext(new ReadOnlySequence(ms.ToArray()), (ref ParseContext ctx) => - { - Assert.AreEqual(tag, ctx.ReadTag()); - SegmentedBufferHelper.PushLimit(ref ctx.state, 3); - try - { - ctx.ReadString(); - Assert.Fail(); - } - catch (InvalidProtocolBufferException) { } - }, true); - } - - // Representations of a tag for field 0 with various wire types - [Test] - [TestCase(0)] - [TestCase(1)] - [TestCase(2)] - [TestCase(3)] - [TestCase(4)] - [TestCase(5)] - public void ReadTag_ZeroFieldRejected(byte tag) - { - CodedInputStream cis = new CodedInputStream(new byte[] { tag }); - Assert.Throws(() => cis.ReadTag()); - } - - internal static TestRecursiveMessage MakeRecursiveMessage(int depth) - { - if (depth == 0) - { - return new TestRecursiveMessage { I = 5 }; - } - else - { - return new TestRecursiveMessage { A = MakeRecursiveMessage(depth - 1) }; - } - } - - internal static void AssertMessageDepth(TestRecursiveMessage message, int depth) - { - if (depth == 0) - { - Assert.IsNull(message.A); - Assert.AreEqual(5, message.I); - } - else - { - Assert.IsNotNull(message.A); - AssertMessageDepth(message.A, depth - 1); - } - } - - [Test] - public void MaliciousRecursion() - { - ByteString atRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit).ToByteString(); - ByteString beyondRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit + 1).ToByteString(); - - AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(atRecursiveLimit), CodedInputStream.DefaultRecursionLimit); - - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(beyondRecursiveLimit)); - - CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(atRecursiveLimit.ToByteArray()), 1000000, CodedInputStream.DefaultRecursionLimit - 1); - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(input)); - } - - private static byte[] MakeMaliciousRecursionUnknownFieldsPayload(int recursionDepth) - { - // generate recursively nested groups that will be parsed as unknown fields - int unknownFieldNumber = 14; // an unused field number - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - for (int i = 0; i < recursionDepth; i++) - { - output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.StartGroup)); - } - for (int i = 0; i < recursionDepth; i++) - { - output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.EndGroup)); - } - output.Flush(); - return ms.ToArray(); - } - - [Test] - public void MaliciousRecursion_UnknownFields() - { - byte[] payloadAtRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit); - byte[] payloadBeyondRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit + 1); - - Assert.DoesNotThrow(() => TestRecursiveMessage.Parser.ParseFrom(payloadAtRecursiveLimit)); - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(payloadBeyondRecursiveLimit)); - } - - [Test] - public void ReadGroup_WrongEndGroupTag() - { - int groupFieldNumber = Proto2.TestAllTypes.OptionalGroupFieldNumber; - - // write Proto2.TestAllTypes with "optional_group" set, but use wrong EndGroup closing tag - var ms = new MemoryStream(); - var output = new CodedOutputStream(ms); - output.WriteTag(WireFormat.MakeTag(groupFieldNumber, WireFormat.WireType.StartGroup)); - output.WriteGroup(new Proto2.TestAllTypes.Types.OptionalGroup { A = 12345 }); - // end group with different field number - output.WriteTag(WireFormat.MakeTag(groupFieldNumber + 1, WireFormat.WireType.EndGroup)); - output.Flush(); - var payload = ms.ToArray(); - - Assert.Throws(() => Proto2.TestAllTypes.Parser.ParseFrom(payload)); - } - - [Test] - public void ReadGroup_UnknownFields_WrongEndGroupTag() - { - var ms = new MemoryStream(); - var output = new CodedOutputStream(ms); - output.WriteTag(WireFormat.MakeTag(14, WireFormat.WireType.StartGroup)); - // end group with different field number - output.WriteTag(WireFormat.MakeTag(15, WireFormat.WireType.EndGroup)); - output.Flush(); - var payload = ms.ToArray(); - - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(payload)); - } - - [Test] - public void SizeLimit() - { - // Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't - // apply to the latter case. - MemoryStream ms = new MemoryStream(SampleMessages.CreateFullTestAllTypes().ToByteArray()); - CodedInputStream input = CodedInputStream.CreateWithLimits(ms, 16, 100); - Assert.Throws(() => TestAllTypes.Parser.ParseFrom(input)); - } - - /// - /// Tests that if we read an string that contains invalid UTF-8, no exception - /// is thrown. Instead, the invalid bytes are replaced with the Unicode - /// "replacement character" U+FFFD. - /// - [Test] - public void ReadInvalidUtf8() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(1); - output.WriteRawBytes(new byte[] {0x80}); - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms); - - Assert.AreEqual(tag, input.ReadTag()); - string text = input.ReadString(); - Assert.AreEqual('\ufffd', text[0]); - } - - [Test] - public void ReadNegativeSizedStringThrowsInvalidProtocolBufferException() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteLength(-1); - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms); - - Assert.AreEqual(tag, input.ReadTag()); - Assert.Throws(() => input.ReadString()); - } - - [Test] - public void ReadNegativeSizedBytesThrowsInvalidProtocolBufferException() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteLength(-1); - output.Flush(); - ms.Position = 0; - - var input = new CodedInputStream(ms); - - Assert.AreEqual(tag, input.ReadTag()); - Assert.Throws(() => input.ReadBytes()); - } - - /// - /// A stream which limits the number of bytes it reads at a time. - /// We use this to make sure that CodedInputStream doesn't screw up when - /// reading in small blocks. - /// - private sealed class SmallBlockInputStream : MemoryStream - { - private readonly int blockSize; - - public SmallBlockInputStream(byte[] data, int blockSize) - : base(data) - { - this.blockSize = blockSize; - } - - public override int Read(byte[] buffer, int offset, int count) - { - return base.Read(buffer, offset, Math.Min(count, blockSize)); - } - } - - [Test] - public void TestNegativeEnum() - { - byte[] bytes = { 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01 }; - CodedInputStream input = new CodedInputStream(bytes); - Assert.AreEqual((int)SampleEnum.NegativeValue, input.ReadEnum()); - Assert.IsTrue(input.IsAtEnd); - } - - //Issue 71: CodedInputStream.ReadBytes go to slow path unnecessarily - [Test] - public void TestSlowPathAvoidance() - { - using var ms = new MemoryStream(); - var output = new CodedOutputStream(ms); - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteBytes(ByteString.CopyFrom(new byte[100])); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteBytes(ByteString.CopyFrom(new byte[100])); - output.Flush(); - - ms.Position = 0; - CodedInputStream input = new CodedInputStream(ms, new byte[ms.Length / 2], 0, 0, false); - - uint tag = input.ReadTag(); - Assert.AreEqual(1, WireFormat.GetTagFieldNumber(tag)); - Assert.AreEqual(100, input.ReadBytes().Length); - - tag = input.ReadTag(); - Assert.AreEqual(2, WireFormat.GetTagFieldNumber(tag)); - Assert.AreEqual(100, input.ReadBytes().Length); - } - - [Test] - public void MaximumFieldNumber() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - - int fieldNumber = 0x1FFFFFFF; - uint tag = WireFormat.MakeTag(fieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteString("field 1"); - output.Flush(); - ms.Position = 0; - - CodedInputStream input = new CodedInputStream(ms); - - Assert.AreEqual(tag, input.ReadTag()); - Assert.AreEqual(fieldNumber, WireFormat.GetTagFieldNumber(tag)); - } - - [Test] - public void Tag0Throws() - { - var input = new CodedInputStream(new byte[] { 0 }); - Assert.Throws(() => input.ReadTag()); - } - - [Test] - public void SkipGroup() - { - // Create an output stream with a group in: - // Field 1: string "field 1" - // Field 2: group containing: - // Field 1: fixed int32 value 100 - // Field 2: string "ignore me" - // Field 3: nested group containing - // Field 1: fixed int64 value 1000 - // Field 3: string "field 3" - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteString("field 1"); - - // The outer group... - output.WriteTag(2, WireFormat.WireType.StartGroup); - output.WriteTag(1, WireFormat.WireType.Fixed32); - output.WriteFixed32(100); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteString("ignore me"); - // The nested group... - output.WriteTag(3, WireFormat.WireType.StartGroup); - output.WriteTag(1, WireFormat.WireType.Fixed64); - output.WriteFixed64(1000); - // Note: Not sure the field number is relevant for end group... - output.WriteTag(3, WireFormat.WireType.EndGroup); - - // End the outer group - output.WriteTag(2, WireFormat.WireType.EndGroup); - - output.WriteTag(3, WireFormat.WireType.LengthDelimited); - output.WriteString("field 3"); - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag()); - Assert.AreEqual("field 1", input.ReadString()); - Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag()); - input.SkipLastField(); // Should consume the whole group, including the nested one. - Assert.AreEqual(WireFormat.MakeTag(3, WireFormat.WireType.LengthDelimited), input.ReadTag()); - Assert.AreEqual("field 3", input.ReadString()); - } - - [Test] - public void SkipGroup_WrongEndGroupTag() - { - // Create an output stream with: - // Field 1: string "field 1" - // Start group 2 - // Field 3: fixed int32 - // End group 4 (should give an error) - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteString("field 1"); - - // The outer group... - output.WriteTag(2, WireFormat.WireType.StartGroup); - output.WriteTag(3, WireFormat.WireType.Fixed32); - output.WriteFixed32(100); - output.WriteTag(4, WireFormat.WireType.EndGroup); - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag()); - Assert.AreEqual("field 1", input.ReadString()); - Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag()); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void RogueEndGroupTag() - { - // If we have an end-group tag without a leading start-group tag, generated - // code will just call SkipLastField... so that should fail. - - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.EndGroup); - output.Flush(); - stream.Position = 0; - - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.EndGroup), input.ReadTag()); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void EndOfStreamReachedWhileSkippingGroup() - { - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - output.WriteTag(1, WireFormat.WireType.StartGroup); - output.WriteTag(2, WireFormat.WireType.StartGroup); - output.WriteTag(2, WireFormat.WireType.EndGroup); - - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - input.ReadTag(); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void RecursionLimitAppliedWhileSkippingGroup() - { - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++) - { - output.WriteTag(1, WireFormat.WireType.StartGroup); - } - for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++) - { - output.WriteTag(1, WireFormat.WireType.EndGroup); - } - output.Flush(); - stream.Position = 0; - - // Now act like a generated client - var input = new CodedInputStream(stream); - Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.StartGroup), input.ReadTag()); - Assert.Throws(input.SkipLastField); - } - - [Test] - public void Construction_Invalid() - { - Assert.Throws(() => new CodedInputStream((byte[]) null)); - Assert.Throws(() => new CodedInputStream(null, 0, 0)); - Assert.Throws(() => new CodedInputStream((Stream) null)); - Assert.Throws(() => new CodedInputStream(new byte[10], 100, 0)); - Assert.Throws(() => new CodedInputStream(new byte[10], 5, 10)); - } - - [Test] - public void CreateWithLimits_InvalidLimits() - { - var stream = new MemoryStream(); - Assert.Throws(() => CodedInputStream.CreateWithLimits(stream, 0, 1)); - Assert.Throws(() => CodedInputStream.CreateWithLimits(stream, 1, 0)); - } - - [Test] - public void Dispose_DisposesUnderlyingStream() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanRead); - using (var cis = new CodedInputStream(memoryStream)) - { - } - Assert.IsFalse(memoryStream.CanRead); // Disposed - } - - [Test] - public void Dispose_WithLeaveOpen() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanRead); - using (var cis = new CodedInputStream(memoryStream, true)) - { - } - Assert.IsTrue(memoryStream.CanRead); // We left the stream open - } - - [Test] - public void Dispose_FromByteArray() - { - var stream = new CodedInputStream(new byte[10]); - stream.Dispose(); - } - - [Test] - public void TestParseMessagesCloseTo2G() - { - byte[] serializedMessage = GenerateBigSerializedMessage(); - // How many of these big messages do we need to take us near our 2GB limit? - int count = int.MaxValue / serializedMessage.Length; - // Now make a MemoryStream that will fake a near-2GB stream of messages by returning - // our big serialized message 'count' times. - using var stream = new RepeatingMemoryStream(serializedMessage, count); - Assert.DoesNotThrow(() => TestAllTypes.Parser.ParseFrom(stream)); - } - - [Test] - public void TestParseMessagesOver2G() - { - byte[] serializedMessage = GenerateBigSerializedMessage(); - // How many of these big messages do we need to take us near our 2GB limit? - int count = int.MaxValue / serializedMessage.Length; - // Now add one to take us over the 2GB limit - count++; - // Now make a MemoryStream that will fake a near-2GB stream of messages by returning - // our big serialized message 'count' times. - using var stream = new RepeatingMemoryStream(serializedMessage, count); - Assert.Throws(() => TestAllTypes.Parser.ParseFrom(stream), - "Protocol message was too large. May be malicious. " + - "Use CodedInputStream.SetSizeLimit() to increase the size limit."); - } - - /// A serialized big message - private static byte[] GenerateBigSerializedMessage() - { - byte[] value = new byte[16 * 1024 * 1024]; - TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); - message.SingleBytes = ByteString.CopyFrom(value); - return message.ToByteArray(); - } - - /// - /// A MemoryStream that repeats a byte arrays' content a number of times. - /// Simulates really large input without consuming loads of memory. Used above - /// to test the parsing behavior when the input size exceeds 2GB or close to it. - /// - private class RepeatingMemoryStream: MemoryStream - { - private readonly byte[] bytes; - private readonly int maxIterations; - private int index = 0; - - public RepeatingMemoryStream(byte[] bytes, int maxIterations) - { - this.bytes = bytes; - this.maxIterations = maxIterations; - } - - public override int Read(byte[] buffer, int offset, int count) - { - if (bytes.Length == 0) - { - return 0; - } - int numBytesCopiedTotal = 0; - while (numBytesCopiedTotal < count && index < maxIterations) - { - int numBytesToCopy = Math.Min(bytes.Length - (int)Position, count); - Array.Copy(bytes, (int)Position, buffer, offset, numBytesToCopy); - numBytesCopiedTotal += numBytesToCopy; - offset += numBytesToCopy; - count -= numBytesCopiedTotal; - Position += numBytesToCopy; - if (Position >= bytes.Length) - { - Position = 0; - index++; - } - } - return numBytesCopiedTotal; - } - } - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.IO; +using Google.Protobuf.TestProtos; +using Proto2 = Google.Protobuf.TestProtos.Proto2; +using NUnit.Framework; + +namespace Google.Protobuf +{ + public class CodedInputStreamTest + { + /// + /// Helper to construct a byte array from a bunch of bytes. The inputs are + /// actually ints so that I can use hex notation and not get stupid errors + /// about precision. + /// + private static byte[] Bytes(params int[] bytesAsInts) + { + byte[] bytes = new byte[bytesAsInts.Length]; + for (int i = 0; i < bytesAsInts.Length; i++) + { + bytes[i] = (byte) bytesAsInts[i]; + } + return bytes; + } + + /// + /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() + /// + private static void AssertReadVarint(byte[] data, ulong value) + { + CodedInputStream input = new CodedInputStream(data); + Assert.AreEqual((uint) value, input.ReadRawVarint32()); + Assert.IsTrue(input.IsAtEnd); + + input = new CodedInputStream(data); + Assert.AreEqual(value, input.ReadRawVarint64()); + Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual((uint) value, ctx.ReadUInt32()); + }, true); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadUInt64()); + }, true); + + // Try different block sizes. + for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) + { + input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize)); + Assert.AreEqual((uint) value, input.ReadRawVarint32()); + + input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize)); + Assert.AreEqual(value, input.ReadRawVarint64()); + Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, bufferSize), (ref ParseContext ctx) => + { + Assert.AreEqual((uint) value, ctx.ReadUInt32()); + }, true); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, bufferSize), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadUInt64()); + }, true); + } + + // Try reading directly from a MemoryStream. We want to verify that it + // doesn't read past the end of the input, so write an extra byte - this + // lets us test the position at the end. + MemoryStream memoryStream = new MemoryStream(); + memoryStream.Write(data, 0, data.Length); + memoryStream.WriteByte(0); + memoryStream.Position = 0; + Assert.AreEqual((uint) value, CodedInputStream.ReadRawVarint32(memoryStream)); + Assert.AreEqual(data.Length, memoryStream.Position); + } + + /// + /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and + /// expects them to fail with an InvalidProtocolBufferException whose + /// description matches the given one. + /// + private static void AssertReadVarintFailure(InvalidProtocolBufferException expected, byte[] data) + { + CodedInputStream input = new CodedInputStream(data); + var exception = Assert.Throws(() => input.ReadRawVarint32()); + Assert.AreEqual(expected.Message, exception.Message); + + input = new CodedInputStream(data); + exception = Assert.Throws(() => input.ReadRawVarint64()); + Assert.AreEqual(expected.Message, exception.Message); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + try + { + ctx.ReadUInt32(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException ex) + { + Assert.AreEqual(expected.Message, ex.Message); + } + }, false); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + try + { + ctx.ReadUInt64(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException ex) + { + Assert.AreEqual(expected.Message, ex.Message); + } + }, false); + + // Make sure we get the same error when reading directly from a Stream. + exception = Assert.Throws(() => CodedInputStream.ReadRawVarint32(new MemoryStream(data))); + Assert.AreEqual(expected.Message, exception.Message); + } + + private delegate void ParseContextAssertAction(ref ParseContext ctx); + + private static void AssertReadFromParseContext(ReadOnlySequence input, ParseContextAssertAction assertAction, bool assertIsAtEnd) + { + ParseContext.Initialize(input, out ParseContext parseCtx); + assertAction(ref parseCtx); + if (assertIsAtEnd) + { + Assert.IsTrue(SegmentedBufferHelper.IsAtEnd(ref parseCtx.buffer, ref parseCtx.state)); + } + } + + [Test] + public void ReadVarint() + { + AssertReadVarint(Bytes(0x00), 0); + AssertReadVarint(Bytes(0x01), 1); + AssertReadVarint(Bytes(0x7f), 127); + // 14882 + AssertReadVarint(Bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); + // 2961488830 + AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), + (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | + (0x0bL << 28)); + + // 64-bit + // 7256456126 + AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), + (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | + (0x1bL << 28)); + // 41256202580718336 + AssertReadVarint(Bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), + (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | + (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49)); + // 11964378330978735131 + AssertReadVarint(Bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), + (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | + (0x3bUL << 28) | (0x56UL << 35) | (0x00UL << 42) | + (0x05UL << 49) | (0x26UL << 56) | (0x01UL << 63)); + + // Failures + AssertReadVarintFailure( + InvalidProtocolBufferException.MalformedVarint(), + Bytes(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x00)); + AssertReadVarintFailure( + InvalidProtocolBufferException.TruncatedMessage(), + Bytes(0x80)); + } + + /// + /// Parses the given bytes using ReadRawLittleEndian32() and checks + /// that the result matches the given value. + /// + private static void AssertReadLittleEndian32(byte[] data, uint value) + { + CodedInputStream input = new CodedInputStream(data); + Assert.AreEqual(value, input.ReadRawLittleEndian32()); + Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed32()); + }, true); + + // Try different block sizes. + for (int blockSize = 1; blockSize <= 16; blockSize *= 2) + { + input = new CodedInputStream( + new SmallBlockInputStream(data, blockSize)); + Assert.AreEqual(value, input.ReadRawLittleEndian32()); + Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, blockSize), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed32()); + }, true); + } + } + + /// + /// Parses the given bytes using ReadRawLittleEndian64() and checks + /// that the result matches the given value. + /// + private static void AssertReadLittleEndian64(byte[] data, ulong value) + { + CodedInputStream input = new CodedInputStream(data); + Assert.AreEqual(value, input.ReadRawLittleEndian64()); + Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed64()); + }, true); + + // Try different block sizes. + for (int blockSize = 1; blockSize <= 16; blockSize *= 2) + { + input = new CodedInputStream( + new SmallBlockInputStream(data, blockSize)); + Assert.AreEqual(value, input.ReadRawLittleEndian64()); + Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, blockSize), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed64()); + }, true); + } + } + + [Test] + public void ReadLittleEndian() + { + AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); + AssertReadLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); + + AssertReadLittleEndian64(Bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), + 0x123456789abcdef0L); + AssertReadLittleEndian64( + Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL); + } + + [Test] + public void DecodeZigZag32() + { + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(0)); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(1)); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(2)); + Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag32(3)); + Assert.AreEqual(0x3FFFFFFF, ParsingPrimitives.DecodeZigZag32(0x7FFFFFFE)); + Assert.AreEqual(unchecked((int) 0xC0000000), ParsingPrimitives.DecodeZigZag32(0x7FFFFFFF)); + Assert.AreEqual(0x7FFFFFFF, ParsingPrimitives.DecodeZigZag32(0xFFFFFFFE)); + Assert.AreEqual(unchecked((int) 0x80000000), ParsingPrimitives.DecodeZigZag32(0xFFFFFFFF)); + } + + [Test] + public void DecodeZigZag64() + { + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(0)); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(1)); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(2)); + Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag64(3)); + Assert.AreEqual(0x000000003FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFEL)); + Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFFL)); + Assert.AreEqual(0x000000007FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFEL)); + Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFFL)); + Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); + Assert.AreEqual(unchecked((long) 0x8000000000000000L), ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); + } + + [Test] + public void ReadWholeMessage_VaryingBlockSizes() + { + TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); + + byte[] rawBytes = message.ToByteArray(); + Assert.AreEqual(rawBytes.Length, message.CalculateSize()); + TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(rawBytes); + Assert.AreEqual(message, message2); + + // Try different block sizes. + for (int blockSize = 1; blockSize < 256; blockSize *= 2) + { + message2 = TestAllTypes.Parser.ParseFrom(new SmallBlockInputStream(rawBytes, blockSize)); + Assert.AreEqual(message, message2); + } + } + + [Test] + public void ReadWholeMessage_VaryingBlockSizes_FromSequence() + { + TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); + + byte[] rawBytes = message.ToByteArray(); + Assert.AreEqual(rawBytes.Length, message.CalculateSize()); + TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(rawBytes); + Assert.AreEqual(message, message2); + + // Try different block sizes. + for (int blockSize = 1; blockSize < 256; blockSize *= 2) + { + message2 = TestAllTypes.Parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(rawBytes, blockSize)); + Assert.AreEqual(message, message2); + } + } + + [Test] + public void ReadInt32Wrapper_VariableBlockSizes() + { + byte[] rawBytes = new byte[] { 202, 1, 11, 8, 254, 255, 255, 255, 255, 255, 255, 255, 255, 1 }; + + for (int blockSize = 1; blockSize <= rawBytes.Length; blockSize++) + { + ReadOnlySequence data = ReadOnlySequenceFactory.CreateWithContent(rawBytes, blockSize); + AssertReadFromParseContext(data, (ref ParseContext ctx) => + { + ctx.ReadTag(); + + var value = ParsingPrimitivesWrappers.ReadInt32Wrapper(ref ctx); + + Assert.AreEqual(-2, value); + }, true); + } + } + + [Test] + public void ReadHugeBlob() + { + // Allocate and initialize a 1MB blob. + byte[] blob = new byte[1 << 20]; + for (int i = 0; i < blob.Length; i++) + { + blob[i] = (byte) i; + } + + // Make a message containing it. + var message = new TestAllTypes { SingleBytes = ByteString.CopyFrom(blob) }; + + // Serialize and parse it. Make sure to parse from an InputStream, not + // directly from a ByteString, so that CodedInputStream uses buffered + // reading. + TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(message.ToByteString()); + + Assert.AreEqual(message, message2); + } + + [Test] + public void ReadMaliciouslyLargeBlob() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteRawVarint32(0x7FFFFFFF); + output.WriteRawBytes(new byte[32]); // Pad with a few random bytes. + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms); + Assert.AreEqual(tag, input.ReadTag()); + + Assert.Throws(() => input.ReadBytes()); + } + + [Test] + public void ReadBlobGreaterThanCurrentLimit() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteRawVarint32(4); + output.WriteRawBytes(new byte[4]); // Pad with a few random bytes. + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms); + Assert.AreEqual(tag, input.ReadTag()); + + // Specify limit smaller than data length + input.PushLimit(3); + Assert.Throws(() => input.ReadBytes()); + + AssertReadFromParseContext(new ReadOnlySequence(ms.ToArray()), (ref ParseContext ctx) => + { + Assert.AreEqual(tag, ctx.ReadTag()); + SegmentedBufferHelper.PushLimit(ref ctx.state, 3); + try + { + ctx.ReadBytes(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException) {} + }, true); + } + + [Test] + public void ReadStringGreaterThanCurrentLimit() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteRawVarint32(4); + output.WriteRawBytes(new byte[4]); // Pad with a few random bytes. + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms.ToArray()); + Assert.AreEqual(tag, input.ReadTag()); + + // Specify limit smaller than data length + input.PushLimit(3); + Assert.Throws(() => input.ReadString()); + + AssertReadFromParseContext(new ReadOnlySequence(ms.ToArray()), (ref ParseContext ctx) => + { + Assert.AreEqual(tag, ctx.ReadTag()); + SegmentedBufferHelper.PushLimit(ref ctx.state, 3); + try + { + ctx.ReadString(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException) { } + }, true); + } + + // Representations of a tag for field 0 with various wire types + [Test] + [TestCase(0)] + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + [TestCase(4)] + [TestCase(5)] + public void ReadTag_ZeroFieldRejected(byte tag) + { + CodedInputStream cis = new CodedInputStream(new byte[] { tag }); + Assert.Throws(() => cis.ReadTag()); + } + + internal static TestRecursiveMessage MakeRecursiveMessage(int depth) + { + if (depth == 0) + { + return new TestRecursiveMessage { I = 5 }; + } + else + { + return new TestRecursiveMessage { A = MakeRecursiveMessage(depth - 1) }; + } + } + + internal static void AssertMessageDepth(TestRecursiveMessage message, int depth) + { + if (depth == 0) + { + Assert.IsNull(message.A); + Assert.AreEqual(5, message.I); + } + else + { + Assert.IsNotNull(message.A); + AssertMessageDepth(message.A, depth - 1); + } + } + + [Test] + public void MaliciousRecursion() + { + ByteString atRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit).ToByteString(); + ByteString beyondRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit + 1).ToByteString(); + + AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(atRecursiveLimit), CodedInputStream.DefaultRecursionLimit); + + Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(beyondRecursiveLimit)); + + CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(atRecursiveLimit.ToByteArray()), 1000000, CodedInputStream.DefaultRecursionLimit - 1); + Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(input)); + } + + private static byte[] MakeMaliciousRecursionUnknownFieldsPayload(int recursionDepth) + { + // generate recursively nested groups that will be parsed as unknown fields + int unknownFieldNumber = 14; // an unused field number + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + for (int i = 0; i < recursionDepth; i++) + { + output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.StartGroup)); + } + for (int i = 0; i < recursionDepth; i++) + { + output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.EndGroup)); + } + output.Flush(); + return ms.ToArray(); + } + + [Test] + public void MaliciousRecursion_UnknownFields() + { + byte[] payloadAtRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit); + byte[] payloadBeyondRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit + 1); + + Assert.DoesNotThrow(() => TestRecursiveMessage.Parser.ParseFrom(payloadAtRecursiveLimit)); + Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(payloadBeyondRecursiveLimit)); + } + + [Test] + public void ReadGroup_WrongEndGroupTag() + { + int groupFieldNumber = Proto2.TestAllTypes.OptionalGroupFieldNumber; + + // write Proto2.TestAllTypes with "optional_group" set, but use wrong EndGroup closing tag + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + output.WriteTag(WireFormat.MakeTag(groupFieldNumber, WireFormat.WireType.StartGroup)); + output.WriteGroup(new Proto2.TestAllTypes.Types.OptionalGroup { A = 12345 }); + // end group with different field number + output.WriteTag(WireFormat.MakeTag(groupFieldNumber + 1, WireFormat.WireType.EndGroup)); + output.Flush(); + var payload = ms.ToArray(); + + Assert.Throws(() => Proto2.TestAllTypes.Parser.ParseFrom(payload)); + } + + [Test] + public void ReadGroup_UnknownFields_WrongEndGroupTag() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + output.WriteTag(WireFormat.MakeTag(14, WireFormat.WireType.StartGroup)); + // end group with different field number + output.WriteTag(WireFormat.MakeTag(15, WireFormat.WireType.EndGroup)); + output.Flush(); + var payload = ms.ToArray(); + + Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(payload)); + } + + [Test] + public void SizeLimit() + { + // Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't + // apply to the latter case. + MemoryStream ms = new MemoryStream(SampleMessages.CreateFullTestAllTypes().ToByteArray()); + CodedInputStream input = CodedInputStream.CreateWithLimits(ms, 16, 100); + Assert.Throws(() => TestAllTypes.Parser.ParseFrom(input)); + } + + /// + /// Tests that if we read an string that contains invalid UTF-8, no exception + /// is thrown. Instead, the invalid bytes are replaced with the Unicode + /// "replacement character" U+FFFD. + /// + [Test] + public void ReadInvalidUtf8() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteRawVarint32(1); + output.WriteRawBytes(new byte[] {0x80}); + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms); + + Assert.AreEqual(tag, input.ReadTag()); + string text = input.ReadString(); + Assert.AreEqual('\ufffd', text[0]); + } + + [Test] + public void ReadNegativeSizedStringThrowsInvalidProtocolBufferException() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteLength(-1); + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms); + + Assert.AreEqual(tag, input.ReadTag()); + Assert.Throws(() => input.ReadString()); + } + + [Test] + public void ReadNegativeSizedBytesThrowsInvalidProtocolBufferException() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteLength(-1); + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms); + + Assert.AreEqual(tag, input.ReadTag()); + Assert.Throws(() => input.ReadBytes()); + } + + /// + /// A stream which limits the number of bytes it reads at a time. + /// We use this to make sure that CodedInputStream doesn't screw up when + /// reading in small blocks. + /// + private sealed class SmallBlockInputStream : MemoryStream + { + private readonly int blockSize; + + public SmallBlockInputStream(byte[] data, int blockSize) + : base(data) + { + this.blockSize = blockSize; + } + + public override int Read(byte[] buffer, int offset, int count) + { + return base.Read(buffer, offset, Math.Min(count, blockSize)); + } + } + + [Test] + public void TestNegativeEnum() + { + byte[] bytes = { 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01 }; + CodedInputStream input = new CodedInputStream(bytes); + Assert.AreEqual((int)SampleEnum.NegativeValue, input.ReadEnum()); + Assert.IsTrue(input.IsAtEnd); + } + + //Issue 71: CodedInputStream.ReadBytes go to slow path unnecessarily + [Test] + public void TestSlowPathAvoidance() + { + using (var ms = new MemoryStream()) + { + CodedOutputStream output = new CodedOutputStream(ms); + output.WriteTag(1, WireFormat.WireType.LengthDelimited); + output.WriteBytes(ByteString.CopyFrom(new byte[100])); + output.WriteTag(2, WireFormat.WireType.LengthDelimited); + output.WriteBytes(ByteString.CopyFrom(new byte[100])); + output.Flush(); + + ms.Position = 0; + CodedInputStream input = new CodedInputStream(ms, new byte[ms.Length / 2], 0, 0, false); + + uint tag = input.ReadTag(); + Assert.AreEqual(1, WireFormat.GetTagFieldNumber(tag)); + Assert.AreEqual(100, input.ReadBytes().Length); + + tag = input.ReadTag(); + Assert.AreEqual(2, WireFormat.GetTagFieldNumber(tag)); + Assert.AreEqual(100, input.ReadBytes().Length); + } + } + + [Test] + public void Tag0Throws() + { + var input = new CodedInputStream(new byte[] { 0 }); + Assert.Throws(() => input.ReadTag()); + } + + [Test] + public void SkipGroup() + { + // Create an output stream with a group in: + // Field 1: string "field 1" + // Field 2: group containing: + // Field 1: fixed int32 value 100 + // Field 2: string "ignore me" + // Field 3: nested group containing + // Field 1: fixed int64 value 1000 + // Field 3: string "field 3" + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(1, WireFormat.WireType.LengthDelimited); + output.WriteString("field 1"); + + // The outer group... + output.WriteTag(2, WireFormat.WireType.StartGroup); + output.WriteTag(1, WireFormat.WireType.Fixed32); + output.WriteFixed32(100); + output.WriteTag(2, WireFormat.WireType.LengthDelimited); + output.WriteString("ignore me"); + // The nested group... + output.WriteTag(3, WireFormat.WireType.StartGroup); + output.WriteTag(1, WireFormat.WireType.Fixed64); + output.WriteFixed64(1000); + // Note: Not sure the field number is relevant for end group... + output.WriteTag(3, WireFormat.WireType.EndGroup); + + // End the outer group + output.WriteTag(2, WireFormat.WireType.EndGroup); + + output.WriteTag(3, WireFormat.WireType.LengthDelimited); + output.WriteString("field 3"); + output.Flush(); + stream.Position = 0; + + // Now act like a generated client + var input = new CodedInputStream(stream); + Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag()); + Assert.AreEqual("field 1", input.ReadString()); + Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag()); + input.SkipLastField(); // Should consume the whole group, including the nested one. + Assert.AreEqual(WireFormat.MakeTag(3, WireFormat.WireType.LengthDelimited), input.ReadTag()); + Assert.AreEqual("field 3", input.ReadString()); + } + + [Test] + public void SkipGroup_WrongEndGroupTag() + { + // Create an output stream with: + // Field 1: string "field 1" + // Start group 2 + // Field 3: fixed int32 + // End group 4 (should give an error) + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(1, WireFormat.WireType.LengthDelimited); + output.WriteString("field 1"); + + // The outer group... + output.WriteTag(2, WireFormat.WireType.StartGroup); + output.WriteTag(3, WireFormat.WireType.Fixed32); + output.WriteFixed32(100); + output.WriteTag(4, WireFormat.WireType.EndGroup); + output.Flush(); + stream.Position = 0; + + // Now act like a generated client + var input = new CodedInputStream(stream); + Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag()); + Assert.AreEqual("field 1", input.ReadString()); + Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag()); + Assert.Throws(input.SkipLastField); + } + + [Test] + public void RogueEndGroupTag() + { + // If we have an end-group tag without a leading start-group tag, generated + // code will just call SkipLastField... so that should fail. + + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(1, WireFormat.WireType.EndGroup); + output.Flush(); + stream.Position = 0; + + var input = new CodedInputStream(stream); + Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.EndGroup), input.ReadTag()); + Assert.Throws(input.SkipLastField); + } + + [Test] + public void EndOfStreamReachedWhileSkippingGroup() + { + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(1, WireFormat.WireType.StartGroup); + output.WriteTag(2, WireFormat.WireType.StartGroup); + output.WriteTag(2, WireFormat.WireType.EndGroup); + + output.Flush(); + stream.Position = 0; + + // Now act like a generated client + var input = new CodedInputStream(stream); + input.ReadTag(); + Assert.Throws(input.SkipLastField); + } + + [Test] + public void RecursionLimitAppliedWhileSkippingGroup() + { + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++) + { + output.WriteTag(1, WireFormat.WireType.StartGroup); + } + for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++) + { + output.WriteTag(1, WireFormat.WireType.EndGroup); + } + output.Flush(); + stream.Position = 0; + + // Now act like a generated client + var input = new CodedInputStream(stream); + Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.StartGroup), input.ReadTag()); + Assert.Throws(input.SkipLastField); + } + + [Test] + public void Construction_Invalid() + { + Assert.Throws(() => new CodedInputStream((byte[]) null)); + Assert.Throws(() => new CodedInputStream(null, 0, 0)); + Assert.Throws(() => new CodedInputStream((Stream) null)); + Assert.Throws(() => new CodedInputStream(new byte[10], 100, 0)); + Assert.Throws(() => new CodedInputStream(new byte[10], 5, 10)); + } + + [Test] + public void CreateWithLimits_InvalidLimits() + { + var stream = new MemoryStream(); + Assert.Throws(() => CodedInputStream.CreateWithLimits(stream, 0, 1)); + Assert.Throws(() => CodedInputStream.CreateWithLimits(stream, 1, 0)); + } + + [Test] + public void Dispose_DisposesUnderlyingStream() + { + var memoryStream = new MemoryStream(); + Assert.IsTrue(memoryStream.CanRead); + using (var cis = new CodedInputStream(memoryStream)) + { + } + Assert.IsFalse(memoryStream.CanRead); // Disposed + } + + [Test] + public void Dispose_WithLeaveOpen() + { + var memoryStream = new MemoryStream(); + Assert.IsTrue(memoryStream.CanRead); + using (var cis = new CodedInputStream(memoryStream, true)) + { + } + Assert.IsTrue(memoryStream.CanRead); // We left the stream open + } + + [Test] + public void Dispose_FromByteArray() + { + var stream = new CodedInputStream(new byte[10]); + stream.Dispose(); + } + + [Test] + public void TestParseMessagesCloseTo2G() + { + byte[] serializedMessage = GenerateBigSerializedMessage(); + // How many of these big messages do we need to take us near our 2GB limit? + int count = Int32.MaxValue / serializedMessage.Length; + // Now make a MemoryStream that will fake a near-2GB stream of messages by returning + // our big serialized message 'count' times. + using (RepeatingMemoryStream stream = new RepeatingMemoryStream(serializedMessage, count)) + { + Assert.DoesNotThrow(()=>TestAllTypes.Parser.ParseFrom(stream)); + } + } + + [Test] + public void TestParseMessagesOver2G() + { + byte[] serializedMessage = GenerateBigSerializedMessage(); + // How many of these big messages do we need to take us near our 2GB limit? + int count = Int32.MaxValue / serializedMessage.Length; + // Now add one to take us over the 2GB limit + count++; + // Now make a MemoryStream that will fake a near-2GB stream of messages by returning + // our big serialized message 'count' times. + using (RepeatingMemoryStream stream = new RepeatingMemoryStream(serializedMessage, count)) + { + Assert.Throws(() => TestAllTypes.Parser.ParseFrom(stream), + "Protocol message was too large. May be malicious. " + + "Use CodedInputStream.SetSizeLimit() to increase the size limit."); + } + } + + /// A serialized big message + private static byte[] GenerateBigSerializedMessage() + { + byte[] value = new byte[16 * 1024 * 1024]; + TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); + message.SingleBytes = ByteString.CopyFrom(value); + return message.ToByteArray(); + } + + /// + /// A MemoryStream that repeats a byte arrays' content a number of times. + /// Simulates really large input without consuming loads of memory. Used above + /// to test the parsing behavior when the input size exceeds 2GB or close to it. + /// + private class RepeatingMemoryStream: MemoryStream + { + private readonly byte[] bytes; + private readonly int maxIterations; + private int index = 0; + + public RepeatingMemoryStream(byte[] bytes, int maxIterations) + { + this.bytes = bytes; + this.maxIterations = maxIterations; + } + + public override int Read(byte[] buffer, int offset, int count) + { + if (bytes.Length == 0) + { + return 0; + } + int numBytesCopiedTotal = 0; + while (numBytesCopiedTotal < count && index < maxIterations) + { + int numBytesToCopy = Math.Min(bytes.Length - (int)Position, count); + Array.Copy(bytes, (int)Position, buffer, offset, numBytesToCopy); + numBytesCopiedTotal += numBytesToCopy; + offset += numBytesToCopy; + count -= numBytesCopiedTotal; + Position += numBytesToCopy; + if (Position >= bytes.Length) + { + Position = 0; + index++; + } + } + return numBytesCopiedTotal; + } + } + } +} diff --git a/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs b/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs index 2c509f2fede8167ccd8ac51f6a31393c23461e9b..1c77e121d3eb156cf67b72ad773363cb4ceb71cc 100644 --- a/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs +++ b/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs @@ -1,556 +1,520 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using Google.Protobuf.TestProtos; -using Google.Protobuf.Buffers; -using NUnit.Framework; -using System.Text; - -namespace Google.Protobuf -{ - public class CodedOutputStreamTest - { - /// - /// Writes the given value using WriteRawVarint32() and WriteRawVarint64() and - /// checks that the result matches the given bytes - /// - private static void AssertWriteVarint(byte[] data, ulong value) - { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >> 32) == 0) - { - // CodedOutputStream - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawVarint32((uint) value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - // IBufferWriter - var bufferWriter = new TestArrayBufferWriter(); - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteUInt32((uint) value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - - // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); - } - - { - // CodedOutputStream - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawVarint64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - // IBufferWriter - var bufferWriter = new TestArrayBufferWriter(); - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteUInt64(value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - - // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); - } - - // Try different buffer sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >> 32) == 0) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput, bufferSize); - output.WriteRawVarint32((uint) value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - var bufferWriter = new TestArrayBufferWriter { MaxGrowBy = bufferSize }; - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteUInt32((uint) value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - } - - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput, bufferSize); - output.WriteRawVarint64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - var bufferWriter = new TestArrayBufferWriter { MaxGrowBy = bufferSize }; - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteUInt64(value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - } - - } - } - - /// - /// Tests WriteRawVarint32() and WriteRawVarint64() - /// - [Test] - public void WriteVarint() - { - AssertWriteVarint(new byte[] {0x00}, 0); - AssertWriteVarint(new byte[] {0x01}, 1); - AssertWriteVarint(new byte[] {0x7f}, 127); - // 14882 - AssertWriteVarint(new byte[] {0xa2, 0x74}, (0x22 << 0) | (0x74 << 7)); - // 2961488830 - AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x0b}, - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x1b}, - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - AssertWriteVarint( - new byte[] {0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49}, - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43UL << 28) | (0x49L << 35) | (0x24UL << 42) | (0x49UL << 49)); - // 11964378330978735131 - AssertWriteVarint( - new byte[] {0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01}, - unchecked((ulong) - ((0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bL << 28) | (0x56L << 35) | (0x00L << 42) | - (0x05L << 49) | (0x26L << 56) | (0x01L << 63)))); - } - - /// - /// Parses the given bytes using WriteRawLittleEndian32() and checks - /// that the result matches the given value. - /// - private static void AssertWriteLittleEndian32(byte[] data, uint value) - { - { - var rawOutput = new MemoryStream(); - var output = new CodedOutputStream(rawOutput); - output.WriteRawLittleEndian32(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - var bufferWriter = new TestArrayBufferWriter(); - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteFixed32(value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - } - - // Try different buffer sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - var rawOutput = new MemoryStream(); - var output = new CodedOutputStream(rawOutput, bufferSize); - output.WriteRawLittleEndian32(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - var bufferWriter = new TestArrayBufferWriter { MaxGrowBy = bufferSize }; - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteFixed32(value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - } - } - - /// - /// Parses the given bytes using WriteRawLittleEndian64() and checks - /// that the result matches the given value. - /// - private static void AssertWriteLittleEndian64(byte[] data, ulong value) - { - { - var rawOutput = new MemoryStream(); - var output = new CodedOutputStream(rawOutput); - output.WriteRawLittleEndian64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - var bufferWriter = new TestArrayBufferWriter(); - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteFixed64(value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - } - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - var rawOutput = new MemoryStream(); - var output = new CodedOutputStream(rawOutput, blockSize); - output.WriteRawLittleEndian64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); - - var bufferWriter = new TestArrayBufferWriter { MaxGrowBy = blockSize }; - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteFixed64(value); - ctx.Flush(); - Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); - } - } - - /// - /// Tests writeRawLittleEndian32() and writeRawLittleEndian64(). - /// - [Test] - public void WriteLittleEndian() - { - AssertWriteLittleEndian32(new byte[] {0x78, 0x56, 0x34, 0x12}, 0x12345678); - AssertWriteLittleEndian32(new byte[] {0xf0, 0xde, 0xbc, 0x9a}, 0x9abcdef0); - - AssertWriteLittleEndian64( - new byte[] {0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12}, - 0x123456789abcdef0L); - AssertWriteLittleEndian64( - new byte[] {0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a}, - 0x9abcdef012345678UL); - } - - [Test] - public void WriteWholeMessage_VaryingBlockSizes() - { - TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); - - byte[] rawBytes = message.ToByteArray(); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput, blockSize); - message.WriteTo(output); - output.Flush(); - Assert.AreEqual(rawBytes, rawOutput.ToArray()); - - var bufferWriter = new TestArrayBufferWriter { MaxGrowBy = blockSize }; - message.WriteTo(bufferWriter); - Assert.AreEqual(rawBytes, bufferWriter.WrittenSpan.ToArray()); - } - } - - [Test] - public void WriteContext_WritesWithFlushes() - { - TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); - - MemoryStream expectedOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(expectedOutput); - output.WriteMessage(message); - output.Flush(); - byte[] expectedBytes1 = expectedOutput.ToArray(); - - output.WriteMessage(message); - output.Flush(); - byte[] expectedBytes2 = expectedOutput.ToArray(); - - var bufferWriter = new TestArrayBufferWriter(); - WriteContext.Initialize(bufferWriter, out WriteContext ctx); - ctx.WriteMessage(message); - ctx.Flush(); - Assert.AreEqual(expectedBytes1, bufferWriter.WrittenSpan.ToArray()); - - ctx.WriteMessage(message); - ctx.Flush(); - Assert.AreEqual(expectedBytes2, bufferWriter.WrittenSpan.ToArray()); - } - - [Test] - public void EncodeZigZag32() - { - Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag32(0)); - Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag32(-1)); - Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag32(1)); - Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag32(-2)); - Assert.AreEqual(0x7FFFFFFEu, WritingPrimitives.EncodeZigZag32(0x3FFFFFFF)); - Assert.AreEqual(0x7FFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0xC0000000))); - Assert.AreEqual(0xFFFFFFFEu, WritingPrimitives.EncodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0xFFFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0x80000000))); - } - - [Test] - public void EncodeZigZag64() - { - Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag64(0)); - Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag64(-1)); - Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag64(1)); - Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag64(-2)); - Assert.AreEqual(0x000000007FFFFFFEuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); - Assert.AreEqual(0x000000007FFFFFFFuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); - Assert.AreEqual(0x00000000FFFFFFFEuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); - Assert.AreEqual(0x00000000FFFFFFFFuL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, - WritingPrimitives.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); - } - - [Test] - public void RoundTripZigZag32() - { - // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) - // were chosen semi-randomly via keyboard bashing. - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(0))); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(1))); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-1))); - Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(14927))); - Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-3612))); - } - - [Test] - public void RoundTripZigZag64() - { - Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(0))); - Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(1))); - Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-1))); - Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(14927))); - Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-3612))); - - Assert.AreEqual(856912304801416L, - ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(856912304801416L))); - Assert.AreEqual(-75123905439571256L, - ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-75123905439571256L))); - } - - [Test] - public void TestNegativeEnumNoTag() - { - Assert.AreEqual(10, CodedOutputStream.ComputeInt32Size(-2)); - Assert.AreEqual(10, CodedOutputStream.ComputeEnumSize((int) SampleEnum.NegativeValue)); - - byte[] bytes = new byte[10]; - CodedOutputStream output = new CodedOutputStream(bytes); - output.WriteEnum((int) SampleEnum.NegativeValue); - - Assert.AreEqual(0, output.SpaceLeft); - Assert.AreEqual("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); - } - - [Test] - public void TestCodedInputOutputPosition() - { - byte[] content = new byte[110]; - for (int i = 0; i < content.Length; i++) - { - content[i] = (byte)i; - } - - byte[] child = new byte[120]; - { - MemoryStream ms = new MemoryStream(child); - CodedOutputStream cout = new CodedOutputStream(ms, 20); - // Field 11: numeric value: 500 - cout.WriteTag(11, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); - cout.WriteInt32(500); - Assert.AreEqual(3, cout.Position); - //Field 12: length delimited 120 bytes - cout.WriteTag(12, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); - cout.WriteBytes(ByteString.CopyFrom(content)); - Assert.AreEqual(115, cout.Position); - // Field 13: fixed numeric value: 501 - cout.WriteTag(13, WireFormat.WireType.Fixed32); - Assert.AreEqual(116, cout.Position); - cout.WriteSFixed32(501); - Assert.AreEqual(120, cout.Position); - cout.Flush(); - } - - byte[] bytes = new byte[130]; - { - CodedOutputStream cout = new CodedOutputStream(bytes); - // Field 1: numeric value: 500 - cout.WriteTag(1, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); - cout.WriteInt32(500); - Assert.AreEqual(3, cout.Position); - //Field 2: length delimited 120 bytes - cout.WriteTag(2, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); - cout.WriteBytes(ByteString.CopyFrom(child)); - Assert.AreEqual(125, cout.Position); - // Field 3: fixed numeric value: 500 - cout.WriteTag(3, WireFormat.WireType.Fixed32); - Assert.AreEqual(126, cout.Position); - cout.WriteSFixed32(501); - Assert.AreEqual(130, cout.Position); - cout.Flush(); - } - // Now test Input stream: - { - CodedInputStream cin = new CodedInputStream(new MemoryStream(bytes), new byte[50], 0, 0, false); - Assert.AreEqual(0, cin.Position); - // Field 1: - uint tag = cin.ReadTag(); - Assert.AreEqual(1, tag >> 3); - Assert.AreEqual(1, cin.Position); - Assert.AreEqual(500, cin.ReadInt32()); - Assert.AreEqual(3, cin.Position); - //Field 2: - tag = cin.ReadTag(); - Assert.AreEqual(2, tag >> 3); - Assert.AreEqual(4, cin.Position); - int childlen = cin.ReadLength(); - Assert.AreEqual(120, childlen); - Assert.AreEqual(5, cin.Position); - int oldlimit = cin.PushLimit((int)childlen); - Assert.AreEqual(5, cin.Position); - // Now we are reading child message - { - // Field 11: numeric value: 500 - tag = cin.ReadTag(); - Assert.AreEqual(11, tag >> 3); - Assert.AreEqual(6, cin.Position); - Assert.AreEqual(500, cin.ReadInt32()); - Assert.AreEqual(8, cin.Position); - //Field 12: length delimited 120 bytes - tag = cin.ReadTag(); - Assert.AreEqual(12, tag >> 3); - Assert.AreEqual(9, cin.Position); - ByteString bstr = cin.ReadBytes(); - Assert.AreEqual(110, bstr.Length); - Assert.AreEqual((byte) 109, bstr[109]); - Assert.AreEqual(120, cin.Position); - // Field 13: fixed numeric value: 501 - tag = cin.ReadTag(); - Assert.AreEqual(13, tag >> 3); - // ROK - Previously broken here, this returned 126 failing to account for bufferSizeAfterLimit - Assert.AreEqual(121, cin.Position); - Assert.AreEqual(501, cin.ReadSFixed32()); - Assert.AreEqual(125, cin.Position); - Assert.IsTrue(cin.IsAtEnd); - } - cin.PopLimit(oldlimit); - Assert.AreEqual(125, cin.Position); - // Field 3: fixed numeric value: 501 - tag = cin.ReadTag(); - Assert.AreEqual(3, tag >> 3); - Assert.AreEqual(126, cin.Position); - Assert.AreEqual(501, cin.ReadSFixed32()); - Assert.AreEqual(130, cin.Position); - Assert.IsTrue(cin.IsAtEnd); - } - } - - [Test] - public void Dispose_DisposesUnderlyingStream() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanWrite); - using (var cos = new CodedOutputStream(memoryStream)) - { - cos.WriteRawBytes(new byte[] {0}); - Assert.AreEqual(0, memoryStream.Position); // Not flushed yet - } - Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to MemoryStream - Assert.IsFalse(memoryStream.CanWrite); // Disposed - } - - [Test] - public void Dispose_WithLeaveOpen() - { - var memoryStream = new MemoryStream(); - Assert.IsTrue(memoryStream.CanWrite); - using (var cos = new CodedOutputStream(memoryStream, true)) - { - cos.WriteRawBytes(new byte[] {0}); - Assert.AreEqual(0, memoryStream.Position); // Not flushed yet - } - Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream - Assert.IsTrue(memoryStream.CanWrite); // We left the stream open - } - - [Test] - public void Dispose_FromByteArray() - { - var stream = new CodedOutputStream(new byte[10]); - stream.Dispose(); - } - - [Test] - public void WriteString_AsciiSmall_MaxUtf8SizeExceedsBuffer() - { - var buffer = new byte[5]; - var output = new CodedOutputStream(buffer); - output.WriteString("ABC"); - - output.Flush(); - - // Verify written content - var input = new CodedInputStream(buffer); - Assert.AreEqual("ABC", input.ReadString()); - } - - [Test] - public void WriteStringsOfDifferentSizes_Ascii() - { - for (int i = 1; i <= 1024; i++) - { - var buffer = new byte[4096]; - var output = new CodedOutputStream(buffer); - var sb = new StringBuilder(); - for (int j = 0; j < i; j++) - { - sb.Append((j % 10).ToString()); // incrementing numbers, repeating - } - var s = sb.ToString(); - output.WriteString(s); - - output.Flush(); - - // Verify written content - var input = new CodedInputStream(buffer); - Assert.AreEqual(s, input.ReadString()); - } - } - - [Test] - public void WriteStringsOfDifferentSizes_Unicode() - { - for (int i = 1; i <= 1024; i++) - { - var buffer = new byte[4096]; - var output = new CodedOutputStream(buffer); - var sb = new StringBuilder(); - for (int j = 0; j < i; j++) - { - char c = (char)((j % 10) + 10112); - sb.Append(c.ToString()); // incrementing unicode numbers, repeating - } - var s = sb.ToString(); - output.WriteString(s); - - output.Flush(); - - // Verify written content - var input = new CodedInputStream(buffer); - - Assert.AreEqual(s, input.ReadString()); - } - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; +using Google.Protobuf.TestProtos; +using Google.Protobuf.Buffers; +using NUnit.Framework; + +namespace Google.Protobuf +{ + public class CodedOutputStreamTest + { + /// + /// Writes the given value using WriteRawVarint32() and WriteRawVarint64() and + /// checks that the result matches the given bytes + /// + private static void AssertWriteVarint(byte[] data, ulong value) + { + // Only do 32-bit write if the value fits in 32 bits. + if ((value >> 32) == 0) + { + // CodedOutputStream + MemoryStream rawOutput = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(rawOutput); + output.WriteRawVarint32((uint) value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + // IBufferWriter + var bufferWriter = new ArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt32((uint) value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + + // Also try computing size. + Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); + } + + { + // CodedOutputStream + MemoryStream rawOutput = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(rawOutput); + output.WriteRawVarint64(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + // IBufferWriter + var bufferWriter = new ArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + + // Also try computing size. + Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); + } + + // Try different buffer sizes. + for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) + { + // Only do 32-bit write if the value fits in 32 bits. + if ((value >> 32) == 0) + { + MemoryStream rawOutput = new MemoryStream(); + CodedOutputStream output = + new CodedOutputStream(rawOutput, bufferSize); + output.WriteRawVarint32((uint) value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new ArrayBufferWriter(); + bufferWriter.MaxGrowBy = bufferSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt32((uint) value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } + + { + MemoryStream rawOutput = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(rawOutput, bufferSize); + output.WriteRawVarint64(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new ArrayBufferWriter(); + bufferWriter.MaxGrowBy = bufferSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } + + } + } + + /// + /// Tests WriteRawVarint32() and WriteRawVarint64() + /// + [Test] + public void WriteVarint() + { + AssertWriteVarint(new byte[] {0x00}, 0); + AssertWriteVarint(new byte[] {0x01}, 1); + AssertWriteVarint(new byte[] {0x7f}, 127); + // 14882 + AssertWriteVarint(new byte[] {0xa2, 0x74}, (0x22 << 0) | (0x74 << 7)); + // 2961488830 + AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x0b}, + (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | + (0x0bL << 28)); + + // 64-bit + // 7256456126 + AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x1b}, + (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | + (0x1bL << 28)); + // 41256202580718336 + AssertWriteVarint( + new byte[] {0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49}, + (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | + (0x43UL << 28) | (0x49L << 35) | (0x24UL << 42) | (0x49UL << 49)); + // 11964378330978735131 + AssertWriteVarint( + new byte[] {0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01}, + unchecked((ulong) + ((0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | + (0x3bL << 28) | (0x56L << 35) | (0x00L << 42) | + (0x05L << 49) | (0x26L << 56) | (0x01L << 63)))); + } + + /// + /// Parses the given bytes using WriteRawLittleEndian32() and checks + /// that the result matches the given value. + /// + private static void AssertWriteLittleEndian32(byte[] data, uint value) + { + { + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput); + output.WriteRawLittleEndian32(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new ArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed32(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } + + // Try different buffer sizes. + for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) + { + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput, bufferSize); + output.WriteRawLittleEndian32(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new ArrayBufferWriter(); + bufferWriter.MaxGrowBy = bufferSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed32(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } + } + + /// + /// Parses the given bytes using WriteRawLittleEndian64() and checks + /// that the result matches the given value. + /// + private static void AssertWriteLittleEndian64(byte[] data, ulong value) + { + { + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput); + output.WriteRawLittleEndian64(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new ArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } + + // Try different block sizes. + for (int blockSize = 1; blockSize <= 16; blockSize *= 2) + { + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput, blockSize); + output.WriteRawLittleEndian64(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new ArrayBufferWriter(); + bufferWriter.MaxGrowBy = blockSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } + } + + /// + /// Tests writeRawLittleEndian32() and writeRawLittleEndian64(). + /// + [Test] + public void WriteLittleEndian() + { + AssertWriteLittleEndian32(new byte[] {0x78, 0x56, 0x34, 0x12}, 0x12345678); + AssertWriteLittleEndian32(new byte[] {0xf0, 0xde, 0xbc, 0x9a}, 0x9abcdef0); + + AssertWriteLittleEndian64( + new byte[] {0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12}, + 0x123456789abcdef0L); + AssertWriteLittleEndian64( + new byte[] {0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a}, + 0x9abcdef012345678UL); + } + + [Test] + public void WriteWholeMessage_VaryingBlockSizes() + { + TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); + + byte[] rawBytes = message.ToByteArray(); + + // Try different block sizes. + for (int blockSize = 1; blockSize < 256; blockSize *= 2) + { + MemoryStream rawOutput = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(rawOutput, blockSize); + message.WriteTo(output); + output.Flush(); + Assert.AreEqual(rawBytes, rawOutput.ToArray()); + + var bufferWriter = new ArrayBufferWriter(); + bufferWriter.MaxGrowBy = blockSize; + message.WriteTo(bufferWriter); + Assert.AreEqual(rawBytes, bufferWriter.WrittenSpan.ToArray()); + } + } + + [Test] + public void WriteContext_WritesWithFlushes() + { + TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); + + MemoryStream expectedOutput = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(expectedOutput); + output.WriteMessage(message); + output.Flush(); + byte[] expectedBytes1 = expectedOutput.ToArray(); + + output.WriteMessage(message); + output.Flush(); + byte[] expectedBytes2 = expectedOutput.ToArray(); + + var bufferWriter = new ArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteMessage(message); + ctx.Flush(); + Assert.AreEqual(expectedBytes1, bufferWriter.WrittenSpan.ToArray()); + + ctx.WriteMessage(message); + ctx.Flush(); + Assert.AreEqual(expectedBytes2, bufferWriter.WrittenSpan.ToArray()); + } + + [Test] + public void EncodeZigZag32() + { + Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag32(0)); + Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag32(-1)); + Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag32(1)); + Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag32(-2)); + Assert.AreEqual(0x7FFFFFFEu, WritingPrimitives.EncodeZigZag32(0x3FFFFFFF)); + Assert.AreEqual(0x7FFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0xC0000000))); + Assert.AreEqual(0xFFFFFFFEu, WritingPrimitives.EncodeZigZag32(0x7FFFFFFF)); + Assert.AreEqual(0xFFFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0x80000000))); + } + + [Test] + public void EncodeZigZag64() + { + Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag64(0)); + Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag64(-1)); + Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag64(1)); + Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag64(-2)); + Assert.AreEqual(0x000000007FFFFFFEuL, + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); + Assert.AreEqual(0x000000007FFFFFFFuL, + WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); + Assert.AreEqual(0x00000000FFFFFFFEuL, + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); + Assert.AreEqual(0x00000000FFFFFFFFuL, + WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); + Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); + Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); + } + + [Test] + public void RoundTripZigZag32() + { + // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) + // were chosen semi-randomly via keyboard bashing. + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(0))); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(1))); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-1))); + Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(14927))); + Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-3612))); + } + + [Test] + public void RoundTripZigZag64() + { + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(0))); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(1))); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-1))); + Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(14927))); + Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-3612))); + + Assert.AreEqual(856912304801416L, + ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(856912304801416L))); + Assert.AreEqual(-75123905439571256L, + ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-75123905439571256L))); + } + + [Test] + public void TestNegativeEnumNoTag() + { + Assert.AreEqual(10, CodedOutputStream.ComputeInt32Size(-2)); + Assert.AreEqual(10, CodedOutputStream.ComputeEnumSize((int) SampleEnum.NegativeValue)); + + byte[] bytes = new byte[10]; + CodedOutputStream output = new CodedOutputStream(bytes); + output.WriteEnum((int) SampleEnum.NegativeValue); + + Assert.AreEqual(0, output.SpaceLeft); + Assert.AreEqual("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); + } + + [Test] + public void TestCodedInputOutputPosition() + { + byte[] content = new byte[110]; + for (int i = 0; i < content.Length; i++) + content[i] = (byte)i; + + byte[] child = new byte[120]; + { + MemoryStream ms = new MemoryStream(child); + CodedOutputStream cout = new CodedOutputStream(ms, 20); + // Field 11: numeric value: 500 + cout.WriteTag(11, WireFormat.WireType.Varint); + Assert.AreEqual(1, cout.Position); + cout.WriteInt32(500); + Assert.AreEqual(3, cout.Position); + //Field 12: length delimited 120 bytes + cout.WriteTag(12, WireFormat.WireType.LengthDelimited); + Assert.AreEqual(4, cout.Position); + cout.WriteBytes(ByteString.CopyFrom(content)); + Assert.AreEqual(115, cout.Position); + // Field 13: fixed numeric value: 501 + cout.WriteTag(13, WireFormat.WireType.Fixed32); + Assert.AreEqual(116, cout.Position); + cout.WriteSFixed32(501); + Assert.AreEqual(120, cout.Position); + cout.Flush(); + } + + byte[] bytes = new byte[130]; + { + CodedOutputStream cout = new CodedOutputStream(bytes); + // Field 1: numeric value: 500 + cout.WriteTag(1, WireFormat.WireType.Varint); + Assert.AreEqual(1, cout.Position); + cout.WriteInt32(500); + Assert.AreEqual(3, cout.Position); + //Field 2: length delimited 120 bytes + cout.WriteTag(2, WireFormat.WireType.LengthDelimited); + Assert.AreEqual(4, cout.Position); + cout.WriteBytes(ByteString.CopyFrom(child)); + Assert.AreEqual(125, cout.Position); + // Field 3: fixed numeric value: 500 + cout.WriteTag(3, WireFormat.WireType.Fixed32); + Assert.AreEqual(126, cout.Position); + cout.WriteSFixed32(501); + Assert.AreEqual(130, cout.Position); + cout.Flush(); + } + // Now test Input stream: + { + CodedInputStream cin = new CodedInputStream(new MemoryStream(bytes), new byte[50], 0, 0, false); + Assert.AreEqual(0, cin.Position); + // Field 1: + uint tag = cin.ReadTag(); + Assert.AreEqual(1, tag >> 3); + Assert.AreEqual(1, cin.Position); + Assert.AreEqual(500, cin.ReadInt32()); + Assert.AreEqual(3, cin.Position); + //Field 2: + tag = cin.ReadTag(); + Assert.AreEqual(2, tag >> 3); + Assert.AreEqual(4, cin.Position); + int childlen = cin.ReadLength(); + Assert.AreEqual(120, childlen); + Assert.AreEqual(5, cin.Position); + int oldlimit = cin.PushLimit((int)childlen); + Assert.AreEqual(5, cin.Position); + // Now we are reading child message + { + // Field 11: numeric value: 500 + tag = cin.ReadTag(); + Assert.AreEqual(11, tag >> 3); + Assert.AreEqual(6, cin.Position); + Assert.AreEqual(500, cin.ReadInt32()); + Assert.AreEqual(8, cin.Position); + //Field 12: length delimited 120 bytes + tag = cin.ReadTag(); + Assert.AreEqual(12, tag >> 3); + Assert.AreEqual(9, cin.Position); + ByteString bstr = cin.ReadBytes(); + Assert.AreEqual(110, bstr.Length); + Assert.AreEqual((byte) 109, bstr[109]); + Assert.AreEqual(120, cin.Position); + // Field 13: fixed numeric value: 501 + tag = cin.ReadTag(); + Assert.AreEqual(13, tag >> 3); + // ROK - Previously broken here, this returned 126 failing to account for bufferSizeAfterLimit + Assert.AreEqual(121, cin.Position); + Assert.AreEqual(501, cin.ReadSFixed32()); + Assert.AreEqual(125, cin.Position); + Assert.IsTrue(cin.IsAtEnd); + } + cin.PopLimit(oldlimit); + Assert.AreEqual(125, cin.Position); + // Field 3: fixed numeric value: 501 + tag = cin.ReadTag(); + Assert.AreEqual(3, tag >> 3); + Assert.AreEqual(126, cin.Position); + Assert.AreEqual(501, cin.ReadSFixed32()); + Assert.AreEqual(130, cin.Position); + Assert.IsTrue(cin.IsAtEnd); + } + } + + [Test] + public void Dispose_DisposesUnderlyingStream() + { + var memoryStream = new MemoryStream(); + Assert.IsTrue(memoryStream.CanWrite); + using (var cos = new CodedOutputStream(memoryStream)) + { + cos.WriteRawBytes(new byte[] {0}); + Assert.AreEqual(0, memoryStream.Position); // Not flushed yet + } + Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to MemoryStream + Assert.IsFalse(memoryStream.CanWrite); // Disposed + } + + [Test] + public void Dispose_WithLeaveOpen() + { + var memoryStream = new MemoryStream(); + Assert.IsTrue(memoryStream.CanWrite); + using (var cos = new CodedOutputStream(memoryStream, true)) + { + cos.WriteRawBytes(new byte[] {0}); + Assert.AreEqual(0, memoryStream.Position); // Not flushed yet + } + Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream + Assert.IsTrue(memoryStream.CanWrite); // We left the stream open + } + + [Test] + public void Dispose_FromByteArray() + { + var stream = new CodedOutputStream(new byte[10]); + stream.Dispose(); + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs index b464deb76a97b3354e4ca103c0821b17dcbe6ae5..d8cdee0f0f752a8e11c526d6897e2e94aa00f5dc 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -68,12 +91,10 @@ namespace Google.Protobuf.Collections [Test] public void AddPreservesInsertionOrder() { - var map = new MapField - { - { "a", "v1" }, - { "b", "v2" }, - { "c", "v3" } - }; + var map = new MapField(); + map.Add("a", "v1"); + map.Add("b", "v2"); + map.Add("c", "v3"); map.Remove("b"); map.Add("d", "v4"); CollectionAssert.AreEqual(new[] { "a", "c", "d" }, map.Keys); @@ -83,17 +104,13 @@ namespace Google.Protobuf.Collections [Test] public void EqualityIsOrderInsensitive() { - var map1 = new MapField - { - { "a", "v1" }, - { "b", "v2" } - }; + var map1 = new MapField(); + map1.Add("a", "v1"); + map1.Add("b", "v2"); - var map2 = new MapField - { - { "b", "v2" }, - { "a", "v1" } - }; + var map2 = new MapField(); + map2.Add("b", "v2"); + map2.Add("a", "v1"); EqualityTester.AssertEquality(map1, map2); } @@ -101,17 +118,13 @@ namespace Google.Protobuf.Collections [Test] public void EqualityIsKeySensitive() { - var map1 = new MapField - { - { "first key", "v1" }, - { "second key", "v2" } - }; + var map1 = new MapField(); + map1.Add("first key", "v1"); + map1.Add("second key", "v2"); - var map2 = new MapField - { - { "third key", "v1" }, - { "fourth key", "v2" } - }; + var map2 = new MapField(); + map2.Add("third key", "v1"); + map2.Add("fourth key", "v2"); EqualityTester.AssertInequality(map1, map2); } @@ -130,17 +143,13 @@ namespace Google.Protobuf.Collections { // Note: Without some care, it's a little easier than one might // hope to see hash collisions, but only in some environments... - var map1 = new MapField - { - { "a", "first value" }, - { "b", "second value" } - }; + var map1 = new MapField(); + map1.Add("a", "first value"); + map1.Add("b", "second value"); - var map2 = new MapField - { - { "a", "third value" }, - { "b", "fourth value" } - }; + var map2 = new MapField(); + map2.Add("a", "third value"); + map2.Add("b", "fourth value"); EqualityTester.AssertInequality(map1, map2); } @@ -174,7 +183,8 @@ namespace Google.Protobuf.Collections [Test] public void Add_KeyAlreadyExists() { - var map = new MapField { { "foo", "bar" } }; + var map = new MapField(); + map.Add("foo", "bar"); Assert.Throws(() => map.Add("foo", "baz")); } @@ -201,7 +211,8 @@ namespace Google.Protobuf.Collections [Test] public void Remove_Key() { - var map = new MapField { { "foo", "bar" } }; + var map = new MapField(); + map.Add("foo", "bar"); Assert.AreEqual(1, map.Count); Assert.IsFalse(map.Remove("missing")); Assert.AreEqual(1, map.Count); @@ -213,7 +224,8 @@ namespace Google.Protobuf.Collections [Test] public void Remove_Pair() { - var map = new MapField { { "foo", "bar" } }; + var map = new MapField(); + map.Add("foo", "bar"); ICollection> collection = map; Assert.AreEqual(1, map.Count); Assert.IsFalse(collection.Remove(NewKeyValuePair("wrong key", "bar"))); @@ -228,7 +240,8 @@ namespace Google.Protobuf.Collections [Test] public void CopyTo_Pair() { - var map = new MapField { { "foo", "bar" } }; + var map = new MapField(); + map.Add("foo", "bar"); ICollection> collection = map; KeyValuePair[] array = new KeyValuePair[3]; collection.CopyTo(array, 1); @@ -257,7 +270,8 @@ namespace Google.Protobuf.Collections [Test] public void Indexer_Set() { - var map = new MapField { ["x"] = "y" }; + var map = new MapField(); + map["x"] = "y"; Assert.AreEqual("y", map["x"]); map["x"] = "z"; // This won't throw, unlike Add. Assert.AreEqual("z", map["x"]); @@ -343,10 +357,12 @@ namespace Google.Protobuf.Collections IDictionary dictionary = map; var array = new DictionaryEntry[3]; dictionary.CopyTo(array, 1); - CollectionAssert.AreEqual(new[] { default, new DictionaryEntry("x", "y"), default }, array); + CollectionAssert.AreEqual(new[] { default(DictionaryEntry), new DictionaryEntry("x", "y"), default(DictionaryEntry) }, + array); var objectArray = new object[3]; dictionary.CopyTo(objectArray, 1); - CollectionAssert.AreEqual(new object[] { null, new DictionaryEntry("x", "y"), null }, objectArray); + CollectionAssert.AreEqual(new object[] { null, new DictionaryEntry("x", "y"), null }, + objectArray); } [Test] @@ -564,7 +580,8 @@ namespace Google.Protobuf.Collections }; Assert.AreEqual("x", map[SampleNaNs.Regular]); Assert.AreEqual("y", map[SampleNaNs.SignallingFlipped]); - Assert.False(map.TryGetValue(SampleNaNs.PayloadFlipped, out _)); + string ignored; + Assert.False(map.TryGetValue(SampleNaNs.PayloadFlipped, out ignored)); } [Test] @@ -594,30 +611,7 @@ namespace Google.Protobuf.Collections Assert.IsTrue(input.IsAtEnd); } - [Test] - public void AddEntriesFrom_CodedInputStream_MissingKey() - { - // map will have string key and string value - var keyTag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - var valueTag = WireFormat.MakeTag(2, WireFormat.WireType.LengthDelimited); - - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - output.WriteLength(11); // total of valueTag + value - output.WriteTag(valueTag); - output.WriteString("the_value"); - output.Flush(); - - var field = new MapField(); - var mapCodec = new MapField.Codec(FieldCodec.ForString(keyTag, ""), FieldCodec.ForString(valueTag, ""), 10); - var input = new CodedInputStream(memoryStream.ToArray()); - - field.AddEntriesFrom(input, mapCodec); - CollectionAssert.AreEquivalent(new[] { "" }, field.Keys); - CollectionAssert.AreEquivalent(new[] { "the_value" }, field.Values); - Assert.IsTrue(input.IsAtEnd); - } - +#if !NET35 [Test] public void IDictionaryKeys_Equals_IReadOnlyDictionaryKeys() { @@ -631,59 +625,7 @@ namespace Google.Protobuf.Collections var map = new MapField { { "foo", "bar" }, { "x", "y" } }; CollectionAssert.AreEquivalent(((IDictionary)map).Values, ((IReadOnlyDictionary)map).Values); } - - [Test] - public void SortIntKeys_RandomOrder() - { - var map = new MapField() { { 1, "val" }, { -1, "val"}, { 0, "val" } }; - var sortedList = map.GetSortedListCopy(map.ToList()).ToList(); - var sortedKeys = sortedList.Select(kvp => kvp.Key); - CollectionAssert.AreEqual(new[] { -1, 0, 1 }, sortedKeys); - } - - [Test] - public void SortIntKeys_Empty() - { - var map = new MapField { }; - var sortedList = map.GetSortedListCopy(map.ToList()).ToList(); - var sortedKeys = sortedList.Select(kvp => kvp.Key); - Assert.IsEmpty(sortedKeys); - } - - [Test] - public void SortStringKeys_RandomOrder() - { - var map = new MapField { { "a", "val" }, { "c", "val" }, { "b", "val" } }; - var sortedList = map.GetSortedListCopy(map.ToList()).ToList(); - var sortedKeys = sortedList.Select(kvp => kvp.Key); - CollectionAssert.AreEqual(new[] { "a", "b", "c" }, sortedKeys); - } - - [Test] - public void SortStringKeys_EnsureOrdinalSort() - { - var map = new MapField - { - { "i", "val" } , { "I", "val" }, { "ı", "val" }, { "İ", "val" } - }; - var sortedList = map.GetSortedListCopy(map.ToList()); - var sortedKeys = sortedList.Select(kvp => kvp.Key); - // Assert Ordinal sort I, i, ı, İ (Non-ordinal sort returns i, I, İ, ı) - // I == 0x49 , i == 0x69 , İ == 0x130 , ı == 0x131 - CollectionAssert.AreEqual(new[] { "I", "i", "İ", "ı" }, sortedKeys); - } - - [Test] - public void SortBoolKeys() - { - var map = new MapField - { - { true, "val" } , { false, "val" } - }; - var sortedList = map.GetSortedListCopy(map.ToList()); - var sortedKeys = sortedList.Select(kvp => kvp.Key); - CollectionAssert.AreEqual(new[] { false, true }, sortedKeys); - } +#endif private static KeyValuePair NewKeyValuePair(TKey key, TValue value) { diff --git a/csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs b/csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs index 5ab0cfb51589c1b107185dd67cb382436ffa20d1..594a879865ac9d5b1000f37e8fd953fa0ef0394c 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; diff --git a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs index 6d0911ff13c359dbbc340e3d0d0e865a0956b0fd..61453e5ab2e6d6f22ea41c04779d7d04d93854a8 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs @@ -1,15 +1,39 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Text; @@ -35,7 +59,8 @@ namespace Google.Protobuf.Collections [Test] public void Add_SingleItem() { - var list = new RepeatedField { "foo" }; + var list = new RepeatedField(); + list.Add("foo"); Assert.AreEqual(1, list.Count); Assert.AreEqual("foo", list[0]); } @@ -43,7 +68,8 @@ namespace Google.Protobuf.Collections [Test] public void Add_Sequence() { - var list = new RepeatedField { new[] { "foo", "bar" } }; + var list = new RepeatedField(); + list.Add(new[] { "foo", "bar" }); Assert.AreEqual(2, list.Count); Assert.AreEqual("foo", list[0]); Assert.AreEqual("bar", list[1]); @@ -267,13 +293,15 @@ namespace Google.Protobuf.Collections public void Enumerator() { var list = new RepeatedField { "first", "second" }; - using var enumerator = list.GetEnumerator(); - Assert.IsTrue(enumerator.MoveNext()); - Assert.AreEqual("first", enumerator.Current); - Assert.IsTrue(enumerator.MoveNext()); - Assert.AreEqual("second", enumerator.Current); - Assert.IsFalse(enumerator.MoveNext()); - Assert.IsFalse(enumerator.MoveNext()); + using (var enumerator = list.GetEnumerator()) + { + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual("first", enumerator.Current); + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual("second", enumerator.Current); + Assert.IsFalse(enumerator.MoveNext()); + Assert.IsFalse(enumerator.MoveNext()); + } } [Test] @@ -812,7 +840,7 @@ namespace Google.Protobuf.Collections var list2 = new RepeatedField { SampleNaNs.Regular, SampleNaNs.PayloadFlipped }; var list3 = new RepeatedField { SampleNaNs.Regular, SampleNaNs.SignallingFlipped }; - // All SampleNaNs have the same hashcode under certain targets (e.g. netcoreapp3.1) + // All SampleNaNs have the same hashcode under certain targets (e.g. netcoreapp2.1) EqualityTester.AssertInequality(list1, list2, checkHashcode: false); EqualityTester.AssertEquality(list1, list3); Assert.True(list1.Contains(SampleNaNs.SignallingFlipped)); @@ -865,17 +893,5 @@ namespace Google.Protobuf.Collections Assert.DoesNotThrow(() => list.Capacity = 0, "Can set Capacity to 0"); Assert.AreEqual(0, list.Capacity); } - - [Test] - public void Clear_CapacityUnaffected() - { - var list = new RepeatedField { 1 }; - Assert.AreEqual(1, list.Count); - Assert.AreEqual(8, list.Capacity); - - list.Clear(); - Assert.AreEqual(0, list.Count); - Assert.AreEqual(8, list.Capacity); - } } } diff --git a/csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs b/csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs index 483cd295749be5761217965c0274a04ede57b686..df23a09cd4c4df4b51a379052620064d062ff71e 100644 --- a/csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt b/csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs similarity index 57% rename from java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt rename to csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs index 2723f278310883a709e9769a118864ac86b94db6..48c0725fa6654a4631bc5a43cd7d1c2ebf382fed 100644 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt +++ b/csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs @@ -1,5 +1,6 @@ +#region Copyright notice and license // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2015 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without @@ -27,29 +28,40 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion -package com.google.protobuf.kotlin +#if NET35 +using System; +using System.IO; +using NUnit.Framework; +using Google.Protobuf.Compatibility; -import com.google.protobuf.ExtensionLite -import com.google.protobuf.GeneratedMessageV3 +namespace Google.Protobuf.Test.Compatibility +{ + public class StreamExtensionsTest + { + [Test] + public void CopyToNullArgument() + { + var memoryStream = new MemoryStream(); + Assert.Throws(() => memoryStream.CopyTo(null)); + } -/** Sets the current value of the proto extension in this builder. */ -operator fun < - M : GeneratedMessageV3.ExtendableMessage, - B : GeneratedMessageV3.ExtendableBuilder, - T : Any> B.set(extension: ExtensionLite, value: T) { - setExtension(extension, value) -} - -/** Gets the current value of the proto extension. */ -operator fun < - M : GeneratedMessageV3.ExtendableMessage, - MorBT : GeneratedMessageV3.ExtendableMessageOrBuilder, - T : Any> MorBT.get(extension: ExtensionLite): T = getExtension(extension) + [Test] + public void CopyToTest() + { + byte[] bytesToStream = new byte[] { 0x31, 0x08, 0xFF, 0x00 }; + Stream source = new MemoryStream(bytesToStream); + Stream destination = new MemoryStream((int)source.Length); + source.CopyTo(destination); + destination.Seek(0, SeekOrigin.Begin); -/** Returns true if the specified extension is set on this builder. */ -operator fun < - M : GeneratedMessageV3.ExtendableMessage, - MorBT : GeneratedMessageV3.ExtendableMessageOrBuilder> MorBT.contains( - extension: ExtensionLite -): Boolean = hasExtension(extension) + Assert.AreEqual(0x31, destination.ReadByte()); + Assert.AreEqual(0x08, destination.ReadByte()); + Assert.AreEqual(0xFF, destination.ReadByte()); + Assert.AreEqual(0x00, destination.ReadByte()); + Assert.AreEqual(-1, destination.ReadByte()); + } + } +} +#endif diff --git a/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs b/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs index 33f8eedf0788e136ca5b37f8c6910acadc97c6eb..5d86c20896e13aca28a263cfbe5a2d8c0448343e 100644 --- a/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs @@ -1,17 +1,40 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion - using NUnit.Framework; using System; using System.Collections.Generic; using System.Reflection; +#if !NET35 namespace Google.Protobuf.Compatibility { public class TypeExtensionsTest @@ -91,3 +114,4 @@ namespace Google.Protobuf.Compatibility } } } +#endif diff --git a/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs b/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs index cb02fc71ab2a9d39912ab81282662fb653a6750e..34d5b9f98cbb42f1bac40f9a163a45ef7a2b9f27 100644 --- a/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs +++ b/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs @@ -1,44 +1,55 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Reflection; -using Google.Protobuf.TestProtos; -using NUnit.Framework; -using UnitTest.Issues.TestProtos; - -#pragma warning disable CS0612 // Type or member is obsolete -namespace Google.Protobuf -{ - public class DeprecatedMemberTest - { - private static void AssertIsDeprecated(MemberInfo member) - { - Assert.NotNull(member); - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); - } - - [Test] - public void TestDepreatedPrimitiveValue() => - AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty(nameof(TestDeprecatedFields.DeprecatedInt32))); - - [Test] - public void TestDeprecatedMessage() => - AssertIsDeprecated(typeof(DeprecatedChild)); - - [Test] - public void TestDeprecatedEnum() => - AssertIsDeprecated(typeof(DeprecatedEnum)); - - [Test] - public void TestDeprecatedEnumValue() => - AssertIsDeprecated(typeof(DeprecatedEnum).GetField(nameof(DeprecatedEnum.DeprecatedZero))); - } -} -#pragma warning restore CS0612 // Type or member is obsolete +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Reflection; +using Google.Protobuf.TestProtos; +using NUnit.Framework; + +namespace Google.Protobuf +{ + public class DeprecatedMemberTest + { + private static void AssertIsDeprecated(MemberInfo member) + { + Assert.NotNull(member); + Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); + } + + [Test] + public void TestDepreatedPrimitiveValue() + { + AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty("DeprecatedInt32")); + } + + } +} diff --git a/csharp/src/Google.Protobuf.Test/EqualityTester.cs b/csharp/src/Google.Protobuf.Test/EqualityTester.cs index 8a3187f95cfa0665ba0b8380a336b34746757de1..d4b3c1341ac68e278f75969d901d349c33347085 100644 --- a/csharp/src/Google.Protobuf.Test/EqualityTester.cs +++ b/csharp/src/Google.Protobuf.Test/EqualityTester.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs b/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs index f71653fc8f4d05c2ec64c2aaddcb4f00afa2392e..aceb4a68f7b296b7dd8f423caad6c474bdd57592 100644 --- a/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs +++ b/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs @@ -1,207 +1,122 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Collections; -using Google.Protobuf.TestProtos.Proto2; -using NUnit.Framework; - -using static Google.Protobuf.TestProtos.Proto2.UnittestExtensions; - -namespace Google.Protobuf -{ - public class ExtensionSetTest - { - [Test] - public void EmptyExtensionSet() - { - ExtensionSet extensions = new ExtensionSet(); - Assert.AreEqual(0, extensions.CalculateSize()); - } - - [Test] - public void MergeExtensionSet() - { - ExtensionSet extensions = null; - ExtensionSet.Set(ref extensions, OptionalBoolExtension, true); - - ExtensionSet other = null; - - Assert.IsFalse(ExtensionSet.Has(ref other, OptionalBoolExtension)); - ExtensionSet.MergeFrom(ref other, extensions); - Assert.IsTrue(ExtensionSet.Has(ref other, OptionalBoolExtension)); - } - - [Test] - public void TestMergeCodedInput() - { - var message = new TestAllExtensions(); - message.SetExtension(OptionalBoolExtension, true); - var serialized = message.ToByteArray(); - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertReadingMessage( - TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { OptionalBoolExtension }), - serialized, - other => - { - Assert.AreEqual(message, other); - Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); - }); - } - - [Test] - public void TestMergeMessage() - { - var message = new TestAllExtensions(); - message.SetExtension(OptionalBoolExtension, true); - - var other = new TestAllExtensions(); - - Assert.AreNotEqual(message, other); - Assert.AreNotEqual(message.CalculateSize(), other.CalculateSize()); - - other.MergeFrom(message); - - Assert.AreEqual(message, other); - Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); - } - - [Test] - public void TryMergeFieldFrom_CodedInputStream() - { - var message = new TestAllExtensions(); - message.SetExtension(OptionalStringExtension, "abcd"); - - var input = new CodedInputStream(message.ToByteArray()); - input.ExtensionRegistry = new ExtensionRegistry { OptionalStringExtension }; - input.ReadTag(); // TryMergeFieldFrom expects that a tag was just read and will inspect the LastTag value - - ExtensionSet extensionSet = null; - // test the legacy overload of TryMergeFieldFrom that takes a CodedInputStream - Assert.IsTrue(ExtensionSet.TryMergeFieldFrom(ref extensionSet, input)); - Assert.AreEqual("abcd", ExtensionSet.Get(ref extensionSet, OptionalStringExtension)); - } - - [Test] - public void GetSingle() - { - var extensionValue = new TestAllTypes.Types.NestedMessage() { Bb = 42 }; - var untypedExtension = new Extension(OptionalNestedMessageExtension.FieldNumber, codec: null); - var wrongTypedExtension = new Extension(OptionalNestedMessageExtension.FieldNumber, codec: null); - - var message = new TestAllExtensions(); - - var value1 = message.GetExtension(untypedExtension); - Assert.IsNull(value1); - - message.SetExtension(OptionalNestedMessageExtension, extensionValue); - var value2 = message.GetExtension(untypedExtension); - Assert.IsNotNull(value2); - - var valueBytes = ((IMessage)value2).ToByteArray(); - var parsedValue = TestProtos.Proto2.TestAllTypes.Types.NestedMessage.Parser.ParseFrom(valueBytes); - Assert.AreEqual(extensionValue, parsedValue); - - var ex = Assert.Throws(() => message.GetExtension(wrongTypedExtension)); - - var fullAssemblyName = typeof(TestAllTypes).Assembly.FullName; - var expectedMessage = $"The stored extension value has a type of 'Google.Protobuf.TestProtos.Proto2.TestAllTypes+Types+NestedMessage, {fullAssemblyName}'. " + - $"This a different from the requested type of 'Google.Protobuf.TestProtos.Proto2.TestAllTypes, {fullAssemblyName}'."; - Assert.AreEqual(expectedMessage, ex.Message); - } - - [Test] - public void GetRepeated() - { - var extensionValue = new TestAllTypes.Types.NestedMessage() { Bb = 42 }; - var untypedExtension = new Extension(RepeatedNestedMessageExtension.FieldNumber, codec: null); - var wrongTypedExtension = new RepeatedExtension(RepeatedNestedMessageExtension.FieldNumber, codec: null); - - var message = new TestAllExtensions(); - - var value1 = message.GetExtension(untypedExtension); - Assert.IsNull(value1); - - var repeatedField = message.GetOrInitializeExtension(RepeatedNestedMessageExtension); - repeatedField.Add(extensionValue); - - var value2 = message.GetExtension(untypedExtension); - Assert.IsNotNull(value2); - Assert.AreEqual(1, value2.Count); - - var valueBytes = ((IMessage)value2[0]).ToByteArray(); - var parsedValue = TestProtos.Proto2.TestAllTypes.Types.NestedMessage.Parser.ParseFrom(valueBytes); - Assert.AreEqual(extensionValue, parsedValue); - - var ex = Assert.Throws(() => message.GetExtension(wrongTypedExtension)); - - var fullAssemblyName = typeof(TestAllTypes).Assembly.FullName; - var expectedMessage = $"The stored extension value has a type of 'Google.Protobuf.TestProtos.Proto2.TestAllTypes+Types+NestedMessage, {fullAssemblyName}'. " + - $"This a different from the requested type of 'Google.Protobuf.TestProtos.Proto2.TestAllTypes, {fullAssemblyName}'."; - Assert.AreEqual(expectedMessage, ex.Message); - } - - [Test] - public void TestEquals() - { - var message = new TestAllExtensions(); - message.SetExtension(OptionalBoolExtension, true); - - var other = new TestAllExtensions(); - - Assert.AreNotEqual(message, other); - Assert.AreNotEqual(message.CalculateSize(), other.CalculateSize()); - - other.SetExtension(OptionalBoolExtension, true); - - Assert.AreEqual(message, other); - Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); - } - - [Test] - public void TestHashCode() - { - var message = new TestAllExtensions(); - var hashCode = message.GetHashCode(); - - message.SetExtension(OptionalBoolExtension, true); - - Assert.AreNotEqual(hashCode, message.GetHashCode()); - } - - [Test] - public void TestClone() - { - var message = new TestAllExtensions(); - message.SetExtension(OptionalBoolExtension, true); - - var other = message.Clone(); - - Assert.AreEqual(message, other); - Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); - } - - [Test] - public void TestDefaultValueRoundTrip() - { - var message = new TestAllExtensions(); - message.SetExtension(OptionalBoolExtension, false); - Assert.IsFalse(message.GetExtension(OptionalBoolExtension)); - Assert.IsTrue(message.HasExtension(OptionalBoolExtension)); - - var bytes = message.ToByteArray(); - var registry = new ExtensionRegistry { OptionalBoolExtension }; - var parsed = TestAllExtensions.Parser.WithExtensionRegistry(registry).ParseFrom(bytes); - Assert.IsFalse(parsed.GetExtension(OptionalBoolExtension)); - Assert.IsTrue(parsed.HasExtension(OptionalBoolExtension)); - } - } -} +using Google.Protobuf.TestProtos.Proto2; +using NUnit.Framework; + +using static Google.Protobuf.TestProtos.Proto2.UnittestExtensions; + +namespace Google.Protobuf +{ + public class ExtensionSetTest + { + [Test] + public void EmptyExtensionSet() + { + ExtensionSet extensions = new ExtensionSet(); + Assert.AreEqual(0, extensions.CalculateSize()); + } + + [Test] + public void MergeExtensionSet() + { + ExtensionSet extensions = null; + ExtensionSet.Set(ref extensions, OptionalBoolExtension, true); + + ExtensionSet other = null; + + Assert.IsFalse(ExtensionSet.Has(ref other, OptionalBoolExtension)); + ExtensionSet.MergeFrom(ref other, extensions); + Assert.IsTrue(ExtensionSet.Has(ref other, OptionalBoolExtension)); + } + + [Test] + public void TestMergeCodedInput() + { + var message = new TestAllExtensions(); + message.SetExtension(OptionalBoolExtension, true); + var serialized = message.ToByteArray(); + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertReadingMessage( + TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { OptionalBoolExtension }), + serialized, + other => + { + Assert.AreEqual(message, other); + Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); + }); + } + + [Test] + public void TestMergeMessage() + { + var message = new TestAllExtensions(); + message.SetExtension(OptionalBoolExtension, true); + + var other = new TestAllExtensions(); + + Assert.AreNotEqual(message, other); + Assert.AreNotEqual(message.CalculateSize(), other.CalculateSize()); + + other.MergeFrom(message); + + Assert.AreEqual(message, other); + Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); + } + + [Test] + public void TryMergeFieldFrom_CodedInputStream() + { + var message = new TestAllExtensions(); + message.SetExtension(OptionalStringExtension, "abcd"); + + var input = new CodedInputStream(message.ToByteArray()); + input.ExtensionRegistry = new ExtensionRegistry() { OptionalStringExtension }; + input.ReadTag(); // TryMergeFieldFrom expects that a tag was just read and will inspect the LastTag value + + ExtensionSet extensionSet = null; + // test the legacy overload of TryMergeFieldFrom that takes a CodedInputStream + Assert.IsTrue(ExtensionSet.TryMergeFieldFrom(ref extensionSet, input)); + Assert.AreEqual("abcd", ExtensionSet.Get(ref extensionSet, OptionalStringExtension)); + } + + [Test] + public void TestEquals() + { + var message = new TestAllExtensions(); + message.SetExtension(OptionalBoolExtension, true); + + var other = new TestAllExtensions(); + + Assert.AreNotEqual(message, other); + Assert.AreNotEqual(message.CalculateSize(), other.CalculateSize()); + + other.SetExtension(OptionalBoolExtension, true); + + Assert.AreEqual(message, other); + Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); + } + + [Test] + public void TestHashCode() + { + var message = new TestAllExtensions(); + var hashCode = message.GetHashCode(); + + message.SetExtension(OptionalBoolExtension, true); + + Assert.AreNotEqual(hashCode, message.GetHashCode()); + } + + [Test] + public void TestClone() + { + var message = new TestAllExtensions(); + message.SetExtension(OptionalBoolExtension, true); + + var other = message.Clone(); + + Assert.AreEqual(message, other); + Assert.AreEqual(message.CalculateSize(), message.CalculateSize()); + } + } +} diff --git a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs index 34ac84a8d63405b8c67372c10e364e275901fcf3..7f366926fa02c4c016f63467e20d3a054b4b8c47 100644 --- a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs +++ b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.Collections.Generic; @@ -146,6 +169,7 @@ namespace Google.Protobuf // WriteTagAndValue ignores default values var stream = new MemoryStream(); CodedOutputStream codedOutput; +#if !NET35 codedOutput = new CodedOutputStream(stream); codec.WriteTagAndValue(codedOutput, codec.DefaultValue); codedOutput.Flush(); @@ -155,6 +179,7 @@ namespace Google.Protobuf { Assert.AreEqual(default(T), codec.DefaultValue); } +#endif // The plain ValueWriter/ValueReader delegates don't. if (codec.DefaultValue != null) // This part isn't appropriate for message types. diff --git a/csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs b/csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs index 380ef72d370418cf8179c59ae36c5bca55f9f90d..f71744a8745a4b6f0cba686a252b4b4d3c138304 100644 --- a/csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs +++ b/csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs @@ -1,12 +1,36 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System.Collections.Generic; using Google.Protobuf.Collections; using Google.Protobuf.TestProtos; using NUnit.Framework; @@ -408,89 +432,5 @@ namespace Google.Protobuf Assert.IsNotNull(destination.Payload); } - [Test] - public void MergeWrapperFieldsWithNonNullFieldsInSource() - { - // Instantiate a destination with wrapper-based field types. - var destination = new TestWellKnownTypes() - { - StringField = "Hello", - Int32Field = 12, - Int64Field = 24, - BoolField = true, - }; - - // Set up a targeted update. - var source = new TestWellKnownTypes() - { - StringField = "Hi", - Int64Field = 240 - }; - - Merge(new FieldMaskTree().AddFieldPath("string_field").AddFieldPath("int64_field"), - source, - destination, - new FieldMask.MergeOptions(), - false); - - // Make sure the targeted fields changed. - Assert.AreEqual("Hi", destination.StringField); - Assert.AreEqual(240, destination.Int64Field); - - // Prove that non-targeted fields stay intact... - Assert.AreEqual(12, destination.Int32Field); - Assert.IsTrue(destination.BoolField); - - // ...including default values which were not explicitly set in the destination object. - Assert.IsNull(destination.FloatField); - } - - [Test] - [TestCase(false, "Hello", 24)] - [TestCase(true, null, null)] - public void MergeWrapperFieldsWithNullFieldsInSource( - bool replaceMessageFields, - string expectedStringValue, - long? expectedInt64Value) - { - // Instantiate a destination with wrapper-based field types. - var destination = new TestWellKnownTypes() - { - StringField = "Hello", - Int32Field = 12, - Int64Field = 24, - BoolField = true, - }; - - // Set up a targeted update with null valued fields. - var source = new TestWellKnownTypes() - { - StringField = null, - Int64Field = null - }; - - Merge(new FieldMaskTree().AddFieldPath("string_field").AddFieldPath("int64_field"), - source, - destination, - new FieldMask.MergeOptions() - { - ReplaceMessageFields = replaceMessageFields - }, - false); - - // Make sure the targeted fields changed according to our expectations, depending on the value of ReplaceMessageFields. - // When ReplaceMessageFields is false, the null values are not applied to the destination, because, although wrapped types - // are semantically primitives, FieldMaskTree.Merge still treats them as message types in order to maintain consistency with other Protobuf - // libraries such as Java and C++. - Assert.AreEqual(expectedStringValue, destination.StringField); - Assert.AreEqual(expectedInt64Value, destination.Int64Field); - - // Prove that non-targeted fields stay intact... - Assert.AreEqual(12, destination.Int32Field); - Assert.IsTrue(destination.BoolField); - - // ...including default values which were not explicitly set in the destination object. - Assert.IsNull(destination.FloatField); - } } } diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs index aa1a1301615dafb5e0910170b88578809bef26fb..1abed60563c86ed7e1b79da12cfec8c7a549ebe6 100644 --- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs +++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs @@ -1,404 +1,384 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.TestProtos.Proto2; -using Proto2 = Google.Protobuf.TestProtos.Proto2; -using NUnit.Framework; - -using static Google.Protobuf.TestProtos.Proto2.UnittestExtensions; - -namespace Google.Protobuf -{ - /// - /// Tests around the generated TestAllTypes message in unittest.proto - /// - public partial class GeneratedMessageTest - { - [Test] - public void DefaultProto2Values() - { - var message = new TestAllTypes(); - Assert.AreEqual(false, message.OptionalBool); - Assert.AreEqual(ByteString.Empty, message.OptionalBytes); - Assert.AreEqual(0.0, message.OptionalDouble); - Assert.AreEqual(0, message.OptionalFixed32); - Assert.AreEqual(0L, message.OptionalFixed64); - Assert.AreEqual(0.0f, message.OptionalFloat); - Assert.AreEqual(ForeignEnum.ForeignFoo, message.OptionalForeignEnum); - Assert.IsNull(message.OptionalForeignMessage); - Assert.AreEqual(ImportEnum.ImportFoo, message.OptionalImportEnum); - Assert.IsNull(message.OptionalImportMessage); - Assert.AreEqual(0, message.OptionalInt32); - Assert.AreEqual(0L, message.OptionalInt64); - Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Foo, message.OptionalNestedEnum); - Assert.IsNull(message.OptionalNestedMessage); - Assert.IsNull(message.OptionalPublicImportMessage); - Assert.AreEqual(0, message.OptionalSfixed32); - Assert.AreEqual(0L, message.OptionalSfixed64); - Assert.AreEqual(0, message.OptionalSint32); - Assert.AreEqual(0L, message.OptionalSint64); - Assert.AreEqual("", message.OptionalString); - Assert.AreEqual(0U, message.OptionalUint32); - Assert.AreEqual(0UL, message.OptionalUint64); - - // Repeated fields - Assert.AreEqual(0, message.RepeatedBool.Count); - Assert.AreEqual(0, message.RepeatedBytes.Count); - Assert.AreEqual(0, message.RepeatedDouble.Count); - Assert.AreEqual(0, message.RepeatedFixed32.Count); - Assert.AreEqual(0, message.RepeatedFixed64.Count); - Assert.AreEqual(0, message.RepeatedFloat.Count); - Assert.AreEqual(0, message.RepeatedForeignEnum.Count); - Assert.AreEqual(0, message.RepeatedForeignMessage.Count); - Assert.AreEqual(0, message.RepeatedImportEnum.Count); - Assert.AreEqual(0, message.RepeatedImportMessage.Count); - Assert.AreEqual(0, message.RepeatedNestedEnum.Count); - Assert.AreEqual(0, message.RepeatedNestedMessage.Count); - Assert.AreEqual(0, message.RepeatedSfixed32.Count); - Assert.AreEqual(0, message.RepeatedSfixed64.Count); - Assert.AreEqual(0, message.RepeatedSint32.Count); - Assert.AreEqual(0, message.RepeatedSint64.Count); - Assert.AreEqual(0, message.RepeatedString.Count); - Assert.AreEqual(0, message.RepeatedUint32.Count); - Assert.AreEqual(0, message.RepeatedUint64.Count); - - // Oneof fields - Assert.AreEqual(Proto2.TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - - Assert.AreEqual(true, message.DefaultBool); - Assert.AreEqual(ByteString.CopyFromUtf8("world"), message.DefaultBytes); - Assert.AreEqual("123", message.DefaultCord); - Assert.AreEqual(52e3, message.DefaultDouble); - Assert.AreEqual(47, message.DefaultFixed32); - Assert.AreEqual(48, message.DefaultFixed64); - Assert.AreEqual(51.5, message.DefaultFloat); - Assert.AreEqual(ForeignEnum.ForeignBar, message.DefaultForeignEnum); - Assert.AreEqual(ImportEnum.ImportBar, message.DefaultImportEnum); - Assert.AreEqual(41, message.DefaultInt32); - Assert.AreEqual(42, message.DefaultInt64); - Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Bar, message.DefaultNestedEnum); - Assert.AreEqual(49, message.DefaultSfixed32); - Assert.AreEqual(-50, message.DefaultSfixed64); - Assert.AreEqual(-45, message.DefaultSint32); - Assert.AreEqual(46, message.DefaultSint64); - Assert.AreEqual("hello", message.DefaultString); - Assert.AreEqual("abc", message.DefaultStringPiece); - Assert.AreEqual(43, message.DefaultUint32); - Assert.AreEqual(44, message.DefaultUint64); - - Assert.False(message.HasDefaultBool); - Assert.False(message.HasDefaultBytes); - Assert.False(message.HasDefaultCord); - Assert.False(message.HasDefaultDouble); - Assert.False(message.HasDefaultFixed32); - Assert.False(message.HasDefaultFixed64); - Assert.False(message.HasDefaultFloat); - Assert.False(message.HasDefaultForeignEnum); - Assert.False(message.HasDefaultImportEnum); - Assert.False(message.HasDefaultInt32); - Assert.False(message.HasDefaultInt64); - Assert.False(message.HasDefaultNestedEnum); - Assert.False(message.HasDefaultSfixed32); - Assert.False(message.HasDefaultSfixed64); - Assert.False(message.HasDefaultSint32); - Assert.False(message.HasDefaultSint64); - Assert.False(message.HasDefaultString); - Assert.False(message.HasDefaultStringPiece); - Assert.False(message.HasDefaultUint32); - Assert.False(message.HasDefaultUint64); - } - - [Test] - public void DefaultExtensionValues() - { - var message = new TestAllExtensions(); - Assert.AreEqual(false, message.GetExtension(OptionalBoolExtension)); - Assert.AreEqual(ByteString.Empty, message.GetExtension(OptionalBytesExtension)); - Assert.AreEqual(0.0, message.GetExtension(OptionalDoubleExtension)); - Assert.AreEqual(0, message.GetExtension(OptionalFixed32Extension)); - Assert.AreEqual(0L, message.GetExtension(OptionalFixed64Extension)); - Assert.AreEqual(0.0f, message.GetExtension(OptionalFloatExtension)); - Assert.AreEqual(ForeignEnum.ForeignFoo, message.GetExtension(OptionalForeignEnumExtension)); - Assert.IsNull(message.GetExtension(OptionalForeignMessageExtension)); - Assert.AreEqual(ImportEnum.ImportFoo, message.GetExtension(OptionalImportEnumExtension)); - Assert.IsNull(message.GetExtension(OptionalImportMessageExtension)); - Assert.AreEqual(0, message.GetExtension(OptionalInt32Extension)); - Assert.AreEqual(0L, message.GetExtension(OptionalInt64Extension)); - Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Foo, message.GetExtension(OptionalNestedEnumExtension)); - Assert.IsNull(message.GetExtension(OptionalNestedMessageExtension)); - Assert.IsNull(message.GetExtension(OptionalPublicImportMessageExtension)); - Assert.AreEqual(0, message.GetExtension(OptionalSfixed32Extension)); - Assert.AreEqual(0L, message.GetExtension(OptionalSfixed64Extension)); - Assert.AreEqual(0, message.GetExtension(OptionalSint32Extension)); - Assert.AreEqual(0L, message.GetExtension(OptionalSint64Extension)); - Assert.AreEqual("", message.GetExtension(OptionalStringExtension)); - Assert.AreEqual(0U, message.GetExtension(OptionalUint32Extension)); - Assert.AreEqual(0UL, message.GetExtension(OptionalUint64Extension)); - - // Repeated fields - Assert.IsNull(message.GetExtension(RepeatedBoolExtension)); - Assert.IsNull(message.GetExtension(RepeatedBytesExtension)); - Assert.IsNull(message.GetExtension(RepeatedDoubleExtension)); - Assert.IsNull(message.GetExtension(RepeatedFixed32Extension)); - Assert.IsNull(message.GetExtension(RepeatedFixed64Extension)); - Assert.IsNull(message.GetExtension(RepeatedFloatExtension)); - Assert.IsNull(message.GetExtension(RepeatedForeignEnumExtension)); - Assert.IsNull(message.GetExtension(RepeatedForeignMessageExtension)); - Assert.IsNull(message.GetExtension(RepeatedImportEnumExtension)); - Assert.IsNull(message.GetExtension(RepeatedImportMessageExtension)); - Assert.IsNull(message.GetExtension(RepeatedNestedEnumExtension)); - Assert.IsNull(message.GetExtension(RepeatedNestedMessageExtension)); - Assert.IsNull(message.GetExtension(RepeatedSfixed32Extension)); - Assert.IsNull(message.GetExtension(RepeatedSfixed64Extension)); - Assert.IsNull(message.GetExtension(RepeatedSint32Extension)); - Assert.IsNull(message.GetExtension(RepeatedSint64Extension)); - Assert.IsNull(message.GetExtension(RepeatedStringExtension)); - Assert.IsNull(message.GetExtension(RepeatedUint32Extension)); - Assert.IsNull(message.GetExtension(RepeatedUint64Extension)); - - // Oneof fields - Assert.AreEqual(0, message.GetExtension(OneofUint32Extension)); - Assert.AreEqual("", message.GetExtension(OneofStringExtension)); - Assert.AreEqual(ByteString.Empty, message.GetExtension(OneofBytesExtension)); - Assert.IsNull(message.GetExtension(OneofNestedMessageExtension)); - - Assert.AreEqual(true, message.GetExtension(DefaultBoolExtension)); - Assert.AreEqual(ByteString.CopyFromUtf8("world"), message.GetExtension(DefaultBytesExtension)); - Assert.AreEqual("123", message.GetExtension(DefaultCordExtension)); - Assert.AreEqual(52e3, message.GetExtension(DefaultDoubleExtension)); - Assert.AreEqual(47, message.GetExtension(DefaultFixed32Extension)); - Assert.AreEqual(48, message.GetExtension(DefaultFixed64Extension)); - Assert.AreEqual(51.5, message.GetExtension(DefaultFloatExtension)); - Assert.AreEqual(ForeignEnum.ForeignBar, message.GetExtension(DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.ImportBar, message.GetExtension(DefaultImportEnumExtension)); - Assert.AreEqual(41, message.GetExtension(DefaultInt32Extension)); - Assert.AreEqual(42, message.GetExtension(DefaultInt64Extension)); - Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Bar, message.GetExtension(DefaultNestedEnumExtension)); - Assert.AreEqual(49, message.GetExtension(DefaultSfixed32Extension)); - Assert.AreEqual(-50, message.GetExtension(DefaultSfixed64Extension)); - Assert.AreEqual(-45, message.GetExtension(DefaultSint32Extension)); - Assert.AreEqual(46, message.GetExtension(DefaultSint64Extension)); - Assert.AreEqual("hello", message.GetExtension(DefaultStringExtension)); - Assert.AreEqual("abc", message.GetExtension(DefaultStringPieceExtension)); - Assert.AreEqual(43, message.GetExtension(DefaultUint32Extension)); - Assert.AreEqual(44, message.GetExtension(DefaultUint64Extension)); - - Assert.False(message.HasExtension(DefaultBoolExtension)); - Assert.False(message.HasExtension(DefaultBytesExtension)); - Assert.False(message.HasExtension(DefaultCordExtension)); - Assert.False(message.HasExtension(DefaultDoubleExtension)); - Assert.False(message.HasExtension(DefaultFixed32Extension)); - Assert.False(message.HasExtension(DefaultFixed64Extension)); - Assert.False(message.HasExtension(DefaultFloatExtension)); - Assert.False(message.HasExtension(DefaultForeignEnumExtension)); - Assert.False(message.HasExtension(DefaultImportEnumExtension)); - Assert.False(message.HasExtension(DefaultInt32Extension)); - Assert.False(message.HasExtension(DefaultInt64Extension)); - Assert.False(message.HasExtension(DefaultNestedEnumExtension)); - Assert.False(message.HasExtension(DefaultSfixed32Extension)); - Assert.False(message.HasExtension(DefaultSfixed64Extension)); - Assert.False(message.HasExtension(DefaultSint32Extension)); - Assert.False(message.HasExtension(DefaultSint64Extension)); - Assert.False(message.HasExtension(DefaultStringExtension)); - Assert.False(message.HasExtension(DefaultStringPieceExtension)); - Assert.False(message.HasExtension(DefaultUint32Extension)); - Assert.False(message.HasExtension(DefaultUint64Extension)); - } - - [Test] - public void FieldPresence() - { - var message = new TestAllTypes(); - - Assert.False(message.HasOptionalBool); - Assert.False(message.OptionalBool); - - message.OptionalBool = true; - - Assert.True(message.HasOptionalBool); - Assert.True(message.OptionalBool); - - message.OptionalBool = false; - - Assert.True(message.HasOptionalBool); - Assert.False(message.OptionalBool); - - message.ClearOptionalBool(); - - Assert.False(message.HasOptionalBool); - Assert.False(message.OptionalBool); - - Assert.False(message.HasDefaultBool); - Assert.True(message.DefaultBool); - - message.DefaultBool = false; - - Assert.True(message.HasDefaultBool); - Assert.False(message.DefaultBool); - - message.DefaultBool = true; - - Assert.True(message.HasDefaultBool); - Assert.True(message.DefaultBool); - - message.ClearDefaultBool(); - - Assert.False(message.HasDefaultBool); - Assert.True(message.DefaultBool); - } - - [Test] - public void RequiredFields() - { - var message = new TestRequired(); - Assert.False(message.IsInitialized()); - - message.A = 1; - message.B = 2; - message.C = 3; - - Assert.True(message.IsInitialized()); - } - - /// - /// Code was accidentally left in message parser that threw exceptions when missing required fields after parsing. - /// We've decided to not throw exceptions on missing fields, instead leaving it up to the consumer how they - /// want to check and handle missing fields. - /// - [Test] - public void RequiredFieldsNoThrow() - { - Assert.DoesNotThrow(() => MessageParsingHelpers.AssertReadingMessage(TestRequired.Parser, new byte[0], m => { })); - Assert.DoesNotThrow(() => MessageParsingHelpers.AssertReadingMessage(TestRequired.Parser as MessageParser, new byte[0], m => { })); - } - - [Test] - public void RequiredFieldsInExtensions() - { - var message = new TestAllExtensions(); - Assert.True(message.IsInitialized()); - - message.SetExtension(TestRequired.Extensions.Single, new TestRequired()); - - Assert.False(message.IsInitialized()); - - var extensionMessage = message.GetExtension(TestRequired.Extensions.Single); - extensionMessage.A = 1; - extensionMessage.B = 2; - extensionMessage.C = 3; - - Assert.True(message.IsInitialized()); - - message.GetOrInitializeExtension(TestRequired.Extensions.Multi); - - Assert.True(message.IsInitialized()); - - message.GetExtension(TestRequired.Extensions.Multi).Add(new TestRequired()); - - Assert.False(message.IsInitialized()); - - extensionMessage = message.GetExtension(TestRequired.Extensions.Multi)[0]; - extensionMessage.A = 1; - extensionMessage.B = 2; - extensionMessage.C = 3; - - Assert.True(message.IsInitialized()); - - message.SetExtension(UnittestExtensions.OptionalBoolExtension, true); - - Assert.True(message.IsInitialized()); - - message.GetOrInitializeExtension(UnittestExtensions.RepeatedBoolExtension).Add(true); - - Assert.True(message.IsInitialized()); - } - - [Test] - public void RequiredFieldInNestedMessageMapValue() - { - var message = new TestRequiredMap(); - message.Foo.Add(0, new TestRequiredMap.Types.NestedMessage()); - - Assert.False(message.IsInitialized()); - - message.Foo[0].RequiredInt32 = 12; - - Assert.True(message.IsInitialized()); - } - - [Test] - public void RoundTrip_Groups() - { - var message = new TestAllTypes - { - OptionalGroup = new TestAllTypes.Types.OptionalGroup - { - A = 10 - }, - RepeatedGroup = - { - new TestAllTypes.Types.RepeatedGroup { A = 10 }, - new TestAllTypes.Types.RepeatedGroup { A = 20 }, - new TestAllTypes.Types.RepeatedGroup { A = 30 } - } - }; - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip(Proto2.TestAllTypes.Parser, message); - } - - [Test] - public void RoundTrip_ExtensionGroups() - { - var message = new TestAllExtensions(); - message.SetExtension(UnittestExtensions.OptionalGroupExtension, new OptionalGroup_extension { A = 10 }); - message.GetOrInitializeExtension(UnittestExtensions.RepeatedGroupExtension).AddRange(new[] - { - new RepeatedGroup_extension { A = 10 }, - new RepeatedGroup_extension { A = 20 }, - new RepeatedGroup_extension { A = 30 } - }); - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip( - TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { UnittestExtensions.OptionalGroupExtension, UnittestExtensions.RepeatedGroupExtension }), - message); - } - - [Test] - public void RoundTrip_NestedExtensionGroup() - { - var message = new TestGroupExtension(); - message.SetExtension(TestNestedExtension.Extensions.OptionalGroupExtension, new TestNestedExtension.Types.OptionalGroup_extension { A = 10 }); - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip( - TestGroupExtension.Parser.WithExtensionRegistry(new ExtensionRegistry() { TestNestedExtension.Extensions.OptionalGroupExtension }), - message); - } - - [Test] - public void RoundTrip_ParseUsingCodedInput() - { - var message = new TestAllExtensions(); - message.SetExtension(UnittestExtensions.OptionalBoolExtension, true); - byte[] bytes = message.ToByteArray(); - using CodedInputStream input = new CodedInputStream(bytes); - var parsed = TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { UnittestExtensions.OptionalBoolExtension }).ParseFrom(input); - Assert.AreEqual(message, parsed); - } - } -} +using Google.Protobuf.TestProtos.Proto2; +using Proto2 = Google.Protobuf.TestProtos.Proto2; +using NUnit.Framework; + +using static Google.Protobuf.TestProtos.Proto2.UnittestExtensions; + +namespace Google.Protobuf +{ + /// + /// Tests around the generated TestAllTypes message in unittest.proto + /// + public partial class GeneratedMessageTest + { + [Test] + public void DefaultProto2Values() + { + var message = new TestAllTypes(); + Assert.AreEqual(false, message.OptionalBool); + Assert.AreEqual(ByteString.Empty, message.OptionalBytes); + Assert.AreEqual(0.0, message.OptionalDouble); + Assert.AreEqual(0, message.OptionalFixed32); + Assert.AreEqual(0L, message.OptionalFixed64); + Assert.AreEqual(0.0f, message.OptionalFloat); + Assert.AreEqual(ForeignEnum.ForeignFoo, message.OptionalForeignEnum); + Assert.IsNull(message.OptionalForeignMessage); + Assert.AreEqual(ImportEnum.ImportFoo, message.OptionalImportEnum); + Assert.IsNull(message.OptionalImportMessage); + Assert.AreEqual(0, message.OptionalInt32); + Assert.AreEqual(0L, message.OptionalInt64); + Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Foo, message.OptionalNestedEnum); + Assert.IsNull(message.OptionalNestedMessage); + Assert.IsNull(message.OptionalPublicImportMessage); + Assert.AreEqual(0, message.OptionalSfixed32); + Assert.AreEqual(0L, message.OptionalSfixed64); + Assert.AreEqual(0, message.OptionalSint32); + Assert.AreEqual(0L, message.OptionalSint64); + Assert.AreEqual("", message.OptionalString); + Assert.AreEqual(0U, message.OptionalUint32); + Assert.AreEqual(0UL, message.OptionalUint64); + + // Repeated fields + Assert.AreEqual(0, message.RepeatedBool.Count); + Assert.AreEqual(0, message.RepeatedBytes.Count); + Assert.AreEqual(0, message.RepeatedDouble.Count); + Assert.AreEqual(0, message.RepeatedFixed32.Count); + Assert.AreEqual(0, message.RepeatedFixed64.Count); + Assert.AreEqual(0, message.RepeatedFloat.Count); + Assert.AreEqual(0, message.RepeatedForeignEnum.Count); + Assert.AreEqual(0, message.RepeatedForeignMessage.Count); + Assert.AreEqual(0, message.RepeatedImportEnum.Count); + Assert.AreEqual(0, message.RepeatedImportMessage.Count); + Assert.AreEqual(0, message.RepeatedNestedEnum.Count); + Assert.AreEqual(0, message.RepeatedNestedMessage.Count); + Assert.AreEqual(0, message.RepeatedSfixed32.Count); + Assert.AreEqual(0, message.RepeatedSfixed64.Count); + Assert.AreEqual(0, message.RepeatedSint32.Count); + Assert.AreEqual(0, message.RepeatedSint64.Count); + Assert.AreEqual(0, message.RepeatedString.Count); + Assert.AreEqual(0, message.RepeatedUint32.Count); + Assert.AreEqual(0, message.RepeatedUint64.Count); + + // Oneof fields + Assert.AreEqual(Proto2.TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); + Assert.AreEqual(0, message.OneofUint32); + Assert.AreEqual("", message.OneofString); + Assert.AreEqual(ByteString.Empty, message.OneofBytes); + Assert.IsNull(message.OneofNestedMessage); + + Assert.AreEqual(true, message.DefaultBool); + Assert.AreEqual(ByteString.CopyFromUtf8("world"), message.DefaultBytes); + Assert.AreEqual("123", message.DefaultCord); + Assert.AreEqual(52e3, message.DefaultDouble); + Assert.AreEqual(47, message.DefaultFixed32); + Assert.AreEqual(48, message.DefaultFixed64); + Assert.AreEqual(51.5, message.DefaultFloat); + Assert.AreEqual(ForeignEnum.ForeignBar, message.DefaultForeignEnum); + Assert.AreEqual(ImportEnum.ImportBar, message.DefaultImportEnum); + Assert.AreEqual(41, message.DefaultInt32); + Assert.AreEqual(42, message.DefaultInt64); + Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Bar, message.DefaultNestedEnum); + Assert.AreEqual(49, message.DefaultSfixed32); + Assert.AreEqual(-50, message.DefaultSfixed64); + Assert.AreEqual(-45, message.DefaultSint32); + Assert.AreEqual(46, message.DefaultSint64); + Assert.AreEqual("hello", message.DefaultString); + Assert.AreEqual("abc", message.DefaultStringPiece); + Assert.AreEqual(43, message.DefaultUint32); + Assert.AreEqual(44, message.DefaultUint64); + + Assert.False(message.HasDefaultBool); + Assert.False(message.HasDefaultBytes); + Assert.False(message.HasDefaultCord); + Assert.False(message.HasDefaultDouble); + Assert.False(message.HasDefaultFixed32); + Assert.False(message.HasDefaultFixed64); + Assert.False(message.HasDefaultFloat); + Assert.False(message.HasDefaultForeignEnum); + Assert.False(message.HasDefaultImportEnum); + Assert.False(message.HasDefaultInt32); + Assert.False(message.HasDefaultInt64); + Assert.False(message.HasDefaultNestedEnum); + Assert.False(message.HasDefaultSfixed32); + Assert.False(message.HasDefaultSfixed64); + Assert.False(message.HasDefaultSint32); + Assert.False(message.HasDefaultSint64); + Assert.False(message.HasDefaultString); + Assert.False(message.HasDefaultStringPiece); + Assert.False(message.HasDefaultUint32); + Assert.False(message.HasDefaultUint64); + } + + [Test] + public void DefaultExtensionValues() + { + var message = new TestAllExtensions(); + Assert.AreEqual(false, message.GetExtension(OptionalBoolExtension)); + Assert.AreEqual(ByteString.Empty, message.GetExtension(OptionalBytesExtension)); + Assert.AreEqual(0.0, message.GetExtension(OptionalDoubleExtension)); + Assert.AreEqual(0, message.GetExtension(OptionalFixed32Extension)); + Assert.AreEqual(0L, message.GetExtension(OptionalFixed64Extension)); + Assert.AreEqual(0.0f, message.GetExtension(OptionalFloatExtension)); + Assert.AreEqual(ForeignEnum.ForeignFoo, message.GetExtension(OptionalForeignEnumExtension)); + Assert.IsNull(message.GetExtension(OptionalForeignMessageExtension)); + Assert.AreEqual(ImportEnum.ImportFoo, message.GetExtension(OptionalImportEnumExtension)); + Assert.IsNull(message.GetExtension(OptionalImportMessageExtension)); + Assert.AreEqual(0, message.GetExtension(OptionalInt32Extension)); + Assert.AreEqual(0L, message.GetExtension(OptionalInt64Extension)); + Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Foo, message.GetExtension(OptionalNestedEnumExtension)); + Assert.IsNull(message.GetExtension(OptionalNestedMessageExtension)); + Assert.IsNull(message.GetExtension(OptionalPublicImportMessageExtension)); + Assert.AreEqual(0, message.GetExtension(OptionalSfixed32Extension)); + Assert.AreEqual(0L, message.GetExtension(OptionalSfixed64Extension)); + Assert.AreEqual(0, message.GetExtension(OptionalSint32Extension)); + Assert.AreEqual(0L, message.GetExtension(OptionalSint64Extension)); + Assert.AreEqual("", message.GetExtension(OptionalStringExtension)); + Assert.AreEqual(0U, message.GetExtension(OptionalUint32Extension)); + Assert.AreEqual(0UL, message.GetExtension(OptionalUint64Extension)); + + // Repeated fields + Assert.IsNull(message.GetExtension(RepeatedBoolExtension)); + Assert.IsNull(message.GetExtension(RepeatedBytesExtension)); + Assert.IsNull(message.GetExtension(RepeatedDoubleExtension)); + Assert.IsNull(message.GetExtension(RepeatedFixed32Extension)); + Assert.IsNull(message.GetExtension(RepeatedFixed64Extension)); + Assert.IsNull(message.GetExtension(RepeatedFloatExtension)); + Assert.IsNull(message.GetExtension(RepeatedForeignEnumExtension)); + Assert.IsNull(message.GetExtension(RepeatedForeignMessageExtension)); + Assert.IsNull(message.GetExtension(RepeatedImportEnumExtension)); + Assert.IsNull(message.GetExtension(RepeatedImportMessageExtension)); + Assert.IsNull(message.GetExtension(RepeatedNestedEnumExtension)); + Assert.IsNull(message.GetExtension(RepeatedNestedMessageExtension)); + Assert.IsNull(message.GetExtension(RepeatedSfixed32Extension)); + Assert.IsNull(message.GetExtension(RepeatedSfixed64Extension)); + Assert.IsNull(message.GetExtension(RepeatedSint32Extension)); + Assert.IsNull(message.GetExtension(RepeatedSint64Extension)); + Assert.IsNull(message.GetExtension(RepeatedStringExtension)); + Assert.IsNull(message.GetExtension(RepeatedUint32Extension)); + Assert.IsNull(message.GetExtension(RepeatedUint64Extension)); + + // Oneof fields + Assert.AreEqual(0, message.GetExtension(OneofUint32Extension)); + Assert.AreEqual("", message.GetExtension(OneofStringExtension)); + Assert.AreEqual(ByteString.Empty, message.GetExtension(OneofBytesExtension)); + Assert.IsNull(message.GetExtension(OneofNestedMessageExtension)); + + Assert.AreEqual(true, message.GetExtension(DefaultBoolExtension)); + Assert.AreEqual(ByteString.CopyFromUtf8("world"), message.GetExtension(DefaultBytesExtension)); + Assert.AreEqual("123", message.GetExtension(DefaultCordExtension)); + Assert.AreEqual(52e3, message.GetExtension(DefaultDoubleExtension)); + Assert.AreEqual(47, message.GetExtension(DefaultFixed32Extension)); + Assert.AreEqual(48, message.GetExtension(DefaultFixed64Extension)); + Assert.AreEqual(51.5, message.GetExtension(DefaultFloatExtension)); + Assert.AreEqual(ForeignEnum.ForeignBar, message.GetExtension(DefaultForeignEnumExtension)); + Assert.AreEqual(ImportEnum.ImportBar, message.GetExtension(DefaultImportEnumExtension)); + Assert.AreEqual(41, message.GetExtension(DefaultInt32Extension)); + Assert.AreEqual(42, message.GetExtension(DefaultInt64Extension)); + Assert.AreEqual(Proto2.TestAllTypes.Types.NestedEnum.Bar, message.GetExtension(DefaultNestedEnumExtension)); + Assert.AreEqual(49, message.GetExtension(DefaultSfixed32Extension)); + Assert.AreEqual(-50, message.GetExtension(DefaultSfixed64Extension)); + Assert.AreEqual(-45, message.GetExtension(DefaultSint32Extension)); + Assert.AreEqual(46, message.GetExtension(DefaultSint64Extension)); + Assert.AreEqual("hello", message.GetExtension(DefaultStringExtension)); + Assert.AreEqual("abc", message.GetExtension(DefaultStringPieceExtension)); + Assert.AreEqual(43, message.GetExtension(DefaultUint32Extension)); + Assert.AreEqual(44, message.GetExtension(DefaultUint64Extension)); + + Assert.False(message.HasExtension(DefaultBoolExtension)); + Assert.False(message.HasExtension(DefaultBytesExtension)); + Assert.False(message.HasExtension(DefaultCordExtension)); + Assert.False(message.HasExtension(DefaultDoubleExtension)); + Assert.False(message.HasExtension(DefaultFixed32Extension)); + Assert.False(message.HasExtension(DefaultFixed64Extension)); + Assert.False(message.HasExtension(DefaultFloatExtension)); + Assert.False(message.HasExtension(DefaultForeignEnumExtension)); + Assert.False(message.HasExtension(DefaultImportEnumExtension)); + Assert.False(message.HasExtension(DefaultInt32Extension)); + Assert.False(message.HasExtension(DefaultInt64Extension)); + Assert.False(message.HasExtension(DefaultNestedEnumExtension)); + Assert.False(message.HasExtension(DefaultSfixed32Extension)); + Assert.False(message.HasExtension(DefaultSfixed64Extension)); + Assert.False(message.HasExtension(DefaultSint32Extension)); + Assert.False(message.HasExtension(DefaultSint64Extension)); + Assert.False(message.HasExtension(DefaultStringExtension)); + Assert.False(message.HasExtension(DefaultStringPieceExtension)); + Assert.False(message.HasExtension(DefaultUint32Extension)); + Assert.False(message.HasExtension(DefaultUint64Extension)); + } + + [Test] + public void FieldPresence() + { + var message = new TestAllTypes(); + + Assert.False(message.HasOptionalBool); + Assert.False(message.OptionalBool); + + message.OptionalBool = true; + + Assert.True(message.HasOptionalBool); + Assert.True(message.OptionalBool); + + message.OptionalBool = false; + + Assert.True(message.HasOptionalBool); + Assert.False(message.OptionalBool); + + message.ClearOptionalBool(); + + Assert.False(message.HasOptionalBool); + Assert.False(message.OptionalBool); + + Assert.False(message.HasDefaultBool); + Assert.True(message.DefaultBool); + + message.DefaultBool = false; + + Assert.True(message.HasDefaultBool); + Assert.False(message.DefaultBool); + + message.DefaultBool = true; + + Assert.True(message.HasDefaultBool); + Assert.True(message.DefaultBool); + + message.ClearDefaultBool(); + + Assert.False(message.HasDefaultBool); + Assert.True(message.DefaultBool); + } + + [Test] + public void RequiredFields() + { + var message = new TestRequired(); + Assert.False(message.IsInitialized()); + + message.A = 1; + message.B = 2; + message.C = 3; + + Assert.True(message.IsInitialized()); + } + + /// + /// Code was accidentally left in message parser that threw exceptions when missing required fields after parsing. + /// We've decided to not throw exceptions on missing fields, instead leaving it up to the consumer how they + /// want to check and handle missing fields. + /// + [Test] + public void RequiredFieldsNoThrow() + { + Assert.DoesNotThrow(() => MessageParsingHelpers.AssertReadingMessage(TestRequired.Parser, new byte[0], m => { })); + Assert.DoesNotThrow(() => MessageParsingHelpers.AssertReadingMessage(TestRequired.Parser as MessageParser, new byte[0], m => { })); + } + + [Test] + public void RequiredFieldsInExtensions() + { + var message = new TestAllExtensions(); + Assert.True(message.IsInitialized()); + + message.SetExtension(TestRequired.Extensions.Single, new TestRequired()); + + Assert.False(message.IsInitialized()); + + var extensionMessage = message.GetExtension(TestRequired.Extensions.Single); + extensionMessage.A = 1; + extensionMessage.B = 2; + extensionMessage.C = 3; + + Assert.True(message.IsInitialized()); + + message.GetOrInitializeExtension(TestRequired.Extensions.Multi); + + Assert.True(message.IsInitialized()); + + message.GetExtension(TestRequired.Extensions.Multi).Add(new TestRequired()); + + Assert.False(message.IsInitialized()); + + extensionMessage = message.GetExtension(TestRequired.Extensions.Multi)[0]; + extensionMessage.A = 1; + extensionMessage.B = 2; + extensionMessage.C = 3; + + Assert.True(message.IsInitialized()); + + message.SetExtension(UnittestExtensions.OptionalBoolExtension, true); + + Assert.True(message.IsInitialized()); + + message.GetOrInitializeExtension(UnittestExtensions.RepeatedBoolExtension).Add(true); + + Assert.True(message.IsInitialized()); + } + + [Test] + public void RequiredFieldInNestedMessageMapValue() + { + var message = new TestRequiredMap(); + message.Foo.Add(0, new TestRequiredMap.Types.NestedMessage()); + + Assert.False(message.IsInitialized()); + + message.Foo[0].RequiredInt32 = 12; + + Assert.True(message.IsInitialized()); + } + + [Test] + public void RoundTrip_Groups() + { + var message = new TestAllTypes + { + OptionalGroup = new TestAllTypes.Types.OptionalGroup + { + A = 10 + }, + RepeatedGroup = + { + new TestAllTypes.Types.RepeatedGroup { A = 10 }, + new TestAllTypes.Types.RepeatedGroup { A = 20 }, + new TestAllTypes.Types.RepeatedGroup { A = 30 } + } + }; + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(Proto2.TestAllTypes.Parser, message); + } + + [Test] + public void RoundTrip_ExtensionGroups() + { + var message = new TestAllExtensions(); + message.SetExtension(UnittestExtensions.OptionalGroupExtension, new OptionalGroup_extension { A = 10 }); + message.GetOrInitializeExtension(UnittestExtensions.RepeatedGroupExtension).AddRange(new[] + { + new RepeatedGroup_extension { A = 10 }, + new RepeatedGroup_extension { A = 20 }, + new RepeatedGroup_extension { A = 30 } + }); + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip( + TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { UnittestExtensions.OptionalGroupExtension, UnittestExtensions.RepeatedGroupExtension }), + message); + } + + [Test] + public void RoundTrip_NestedExtensionGroup() + { + var message = new TestGroupExtension(); + message.SetExtension(TestNestedExtension.Extensions.OptionalGroupExtension, new TestNestedExtension.Types.OptionalGroup_extension { A = 10 }); + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip( + TestGroupExtension.Parser.WithExtensionRegistry(new ExtensionRegistry() { TestNestedExtension.Extensions.OptionalGroupExtension }), + message); + } + } +} diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs index 49cf771347c56a3070c0962335e263d419dfc454..06af5e9e9a043c071e94cc1d70daada3f7341f70 100644 --- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs +++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs @@ -1,889 +1,799 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using Google.Protobuf.TestProtos; -using NUnit.Framework; -using System.Linq; -using Google.Protobuf.WellKnownTypes; -using Google.Protobuf.Collections; - -namespace Google.Protobuf -{ - /// - /// Tests around the generated TestAllTypes message. - /// - public partial class GeneratedMessageTest - { - [Test] - public void EmptyMessageFieldDistinctFromMissingMessageField() - { - // This demonstrates what we're really interested in... - var message1 = new TestAllTypes { SingleForeignMessage = new ForeignMessage() }; - var message2 = new TestAllTypes(); // SingleForeignMessage is null - EqualityTester.AssertInequality(message1, message2); - } - - [Test] - public void DefaultValues() - { - // Single fields - var message = new TestAllTypes(); - Assert.AreEqual(false, message.SingleBool); - Assert.AreEqual(ByteString.Empty, message.SingleBytes); - Assert.AreEqual(0.0, message.SingleDouble); - Assert.AreEqual(0, message.SingleFixed32); - Assert.AreEqual(0L, message.SingleFixed64); - Assert.AreEqual(0.0f, message.SingleFloat); - Assert.AreEqual(ForeignEnum.ForeignUnspecified, message.SingleForeignEnum); - Assert.IsNull(message.SingleForeignMessage); - Assert.AreEqual(ImportEnum.Unspecified, message.SingleImportEnum); - Assert.IsNull(message.SingleImportMessage); - Assert.AreEqual(0, message.SingleInt32); - Assert.AreEqual(0L, message.SingleInt64); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.Unspecified, message.SingleNestedEnum); - Assert.IsNull(message.SingleNestedMessage); - Assert.IsNull(message.SinglePublicImportMessage); - Assert.AreEqual(0, message.SingleSfixed32); - Assert.AreEqual(0L, message.SingleSfixed64); - Assert.AreEqual(0, message.SingleSint32); - Assert.AreEqual(0L, message.SingleSint64); - Assert.AreEqual("", message.SingleString); - Assert.AreEqual(0U, message.SingleUint32); - Assert.AreEqual(0UL, message.SingleUint64); - - // Repeated fields - Assert.AreEqual(0, message.RepeatedBool.Count); - Assert.AreEqual(0, message.RepeatedBytes.Count); - Assert.AreEqual(0, message.RepeatedDouble.Count); - Assert.AreEqual(0, message.RepeatedFixed32.Count); - Assert.AreEqual(0, message.RepeatedFixed64.Count); - Assert.AreEqual(0, message.RepeatedFloat.Count); - Assert.AreEqual(0, message.RepeatedForeignEnum.Count); - Assert.AreEqual(0, message.RepeatedForeignMessage.Count); - Assert.AreEqual(0, message.RepeatedImportEnum.Count); - Assert.AreEqual(0, message.RepeatedImportMessage.Count); - Assert.AreEqual(0, message.RepeatedNestedEnum.Count); - Assert.AreEqual(0, message.RepeatedNestedMessage.Count); - Assert.AreEqual(0, message.RepeatedPublicImportMessage.Count); - Assert.AreEqual(0, message.RepeatedSfixed32.Count); - Assert.AreEqual(0, message.RepeatedSfixed64.Count); - Assert.AreEqual(0, message.RepeatedSint32.Count); - Assert.AreEqual(0, message.RepeatedSint64.Count); - Assert.AreEqual(0, message.RepeatedString.Count); - Assert.AreEqual(0, message.RepeatedUint32.Count); - Assert.AreEqual(0, message.RepeatedUint64.Count); - - // Oneof fields - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - } - - [Test] - public void NullStringAndBytesRejected() - { - var message = new TestAllTypes(); - Assert.Throws(() => message.SingleString = null); - Assert.Throws(() => message.OneofString = null); - Assert.Throws(() => message.SingleBytes = null); - Assert.Throws(() => message.OneofBytes = null); - } - - [Test] - public void RoundTrip_Empty() - { - var message = new TestAllTypes(); - // Without setting any values, there's nothing to write. - byte[] bytes = message.ToByteArray(); - Assert.AreEqual(0, bytes.Length); - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); - } - - [Test] - public void RoundTrip_SingleValues() - { - var message = new TestAllTypes - { - SingleBool = true, - SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), - SingleDouble = 23.5, - SingleFixed32 = 23, - SingleFixed64 = 1234567890123, - SingleFloat = 12.25f, - SingleForeignEnum = ForeignEnum.ForeignBar, - SingleForeignMessage = new ForeignMessage { C = 10 }, - SingleImportEnum = ImportEnum.ImportBaz, - SingleImportMessage = new ImportMessage { D = 20 }, - SingleInt32 = 100, - SingleInt64 = 3210987654321, - SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, - SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 35 }, - SinglePublicImportMessage = new PublicImportMessage { E = 54 }, - SingleSfixed32 = -123, - SingleSfixed64 = -12345678901234, - SingleSint32 = -456, - SingleSint64 = -12345678901235, - SingleString = "test", - SingleUint32 = uint.MaxValue, - SingleUint64 = ulong.MaxValue - }; - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); - } - - [Test] - public void RoundTrip_RepeatedValues() - { - var message = new TestAllTypes - { - RepeatedBool = { true, false }, - RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.CopyFrom(5, 6) }, - RepeatedDouble = { -12.25, 23.5 }, - RepeatedFixed32 = { uint.MaxValue, 23 }, - RepeatedFixed64 = { ulong.MaxValue, 1234567890123 }, - RepeatedFloat = { 100f, 12.25f }, - RepeatedForeignEnum = { ForeignEnum.ForeignFoo, ForeignEnum.ForeignBar }, - RepeatedForeignMessage = { new ForeignMessage(), new ForeignMessage { C = 10 } }, - RepeatedImportEnum = { ImportEnum.ImportBaz, ImportEnum.Unspecified }, - RepeatedImportMessage = { new ImportMessage { D = 20 }, new ImportMessage { D = 25 } }, - RepeatedInt32 = { 100, 200 }, - RepeatedInt64 = { 3210987654321, long.MaxValue }, - RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAllTypes.Types.NestedEnum.Neg }, - RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage { Bb = 35 }, new TestAllTypes.Types.NestedMessage { Bb = 10 } }, - RepeatedPublicImportMessage = { new PublicImportMessage { E = 54 }, new PublicImportMessage { E = -1 } }, - RepeatedSfixed32 = { -123, 123 }, - RepeatedSfixed64 = { -12345678901234, 12345678901234 }, - RepeatedSint32 = { -456, 100 }, - RepeatedSint64 = { -12345678901235, 123 }, - RepeatedString = { "foo", "bar" }, - RepeatedUint32 = { uint.MaxValue, uint.MinValue }, - RepeatedUint64 = { ulong.MaxValue, uint.MinValue } - }; - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); - } - - // Note that not every map within map_unittest_proto3 is used. They all go through very - // similar code paths. The fact that all maps are present is validation that we have codecs - // for every type. - [Test] - public void RoundTrip_Maps() - { - var message = new TestMap - { - MapBoolBool = { - { false, true }, - { true, false } - }, - MapInt32Bytes = { - { 5, ByteString.CopyFrom(6, 7, 8) }, - { 25, ByteString.CopyFrom(1, 2, 3, 4, 5) }, - { 10, ByteString.Empty } - }, - MapInt32ForeignMessage = { - { 0, new ForeignMessage { C = 10 } }, - { 5, new ForeignMessage() }, - }, - MapInt32Enum = { - { 1, MapEnum.Bar }, - { 2000, MapEnum.Foo } - } - }; - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip(TestMap.Parser, message); - } - - [Test] - public void MapWithEmptyEntry() - { - var message = new TestMap - { - MapInt32Bytes = { { 0, ByteString.Empty } } - }; - - byte[] bytes = message.ToByteArray(); - Assert.AreEqual(2, bytes.Length); // Tag for field entry (1 byte), length of entry (0; 1 byte) - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - bytes, - parsed=> - { - Assert.AreEqual(1, parsed.MapInt32Bytes.Count); - Assert.AreEqual(ByteString.Empty, parsed.MapInt32Bytes[0]); - }); - } - - [Test] - public void MapWithOnlyValue() - { - // Hand-craft the stream to contain a single entry with just a value. - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - output.WriteTag(TestMap.MapInt32ForeignMessageFieldNumber, WireFormat.WireType.LengthDelimited); - var nestedMessage = new ForeignMessage { C = 20 }; - // Size of the entry (tag, size written by WriteMessage, data written by WriteMessage) - output.WriteLength(2 + nestedMessage.CalculateSize()); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteMessage(nestedMessage); - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - memoryStream.ToArray(), - parsed => - { - Assert.AreEqual(nestedMessage, parsed.MapInt32ForeignMessage[0]); - }); - } - - [Test] - public void MapWithOnlyKey_PrimitiveValue() - { - // Hand-craft the stream to contain a single entry with just a key. - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - output.WriteTag(TestMap.MapInt32DoubleFieldNumber, WireFormat.WireType.LengthDelimited); - int key = 10; - output.WriteLength(1 + CodedOutputStream.ComputeInt32Size(key)); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - memoryStream.ToArray(), - parsed => - { - Assert.AreEqual(0.0, parsed.MapInt32Double[key]); - }); - } - - [Test] - public void MapWithOnlyKey_MessageValue() - { - // Hand-craft the stream to contain a single entry with just a key. - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - output.WriteTag(TestMap.MapInt32ForeignMessageFieldNumber, WireFormat.WireType.LengthDelimited); - int key = 10; - output.WriteLength(1 + CodedOutputStream.ComputeInt32Size(key)); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - memoryStream.ToArray(), - parsed => - { - Assert.AreEqual(new ForeignMessage(), parsed.MapInt32ForeignMessage[key]); - }); - } - - [Test] - public void MapIgnoresExtraFieldsWithinEntryMessages() - { - // Hand-craft the stream to contain a single entry with three fields - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - - var key = 10; // Field 1 - var value = 20; // Field 2 - var extra = 30; // Field 3 - - // Each field can be represented in a single byte, with a single byte tag. - // Total message size: 6 bytes. - output.WriteLength(6); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value); - output.WriteTag(3, WireFormat.WireType.Varint); - output.WriteInt32(extra); - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - memoryStream.ToArray(), - parsed => - { - Assert.AreEqual(value, parsed.MapInt32Int32[key]); - }); - } - - [Test] - public void MapFieldOrderIsIrrelevant() - { - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - - var key = 10; - var value = 20; - - // Each field can be represented in a single byte, with a single byte tag. - // Total message size: 4 bytes. - output.WriteLength(4); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - memoryStream.ToArray(), - parsed => - { - Assert.AreEqual(value, parsed.MapInt32Int32[key]); - }); - } - - [Test] - public void MapNonContiguousEntries() - { - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - // Message structure: - // Entry for MapInt32Int32 - // Entry for MapStringString - // Entry for MapInt32Int32 - - // First entry - var key1 = 10; - var value1 = 20; - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key1); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value1); - - // Second entry - var key2 = "a"; - var value2 = "b"; - output.WriteTag(TestMap.MapStringStringFieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(6); // 3 bytes per entry: tag, size, character - output.WriteTag(1, WireFormat.WireType.LengthDelimited); - output.WriteString(key2); - output.WriteTag(2, WireFormat.WireType.LengthDelimited); - output.WriteString(value2); - - // Third entry - var key3 = 15; - var value3 = 25; - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key3); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value3); - - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - memoryStream.ToArray(), - parsed => - { - var expected = new TestMap - { - MapInt32Int32 = { { key1, value1 }, { key3, value3 } }, - MapStringString = { { key2, value2 } } - }; - Assert.AreEqual(expected, parsed); - }); - } - - [Test] - public void DuplicateKeys_LastEntryWins() - { - var memoryStream = new MemoryStream(); - var output = new CodedOutputStream(memoryStream); - - var key = 10; - var value1 = 20; - var value2 = 30; - - // First entry - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value1); - - // Second entry - same key, different value - output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteLength(4); - output.WriteTag(1, WireFormat.WireType.Varint); - output.WriteInt32(key); - output.WriteTag(2, WireFormat.WireType.Varint); - output.WriteInt32(value2); - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestMap.Parser, - memoryStream.ToArray(), - parsed => - { - Assert.AreEqual(value2, parsed.MapInt32Int32[key]); - }); - } - - [Test] - public void CloneSingleNonMessageValues() - { - var original = new TestAllTypes - { - SingleBool = true, - SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), - SingleDouble = 23.5, - SingleFixed32 = 23, - SingleFixed64 = 1234567890123, - SingleFloat = 12.25f, - SingleInt32 = 100, - SingleInt64 = 3210987654321, - SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, - SingleSfixed32 = -123, - SingleSfixed64 = -12345678901234, - SingleSint32 = -456, - SingleSint64 = -12345678901235, - SingleString = "test", - SingleUint32 = uint.MaxValue, - SingleUint64 = ulong.MaxValue - }; - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreEqual(original, clone); - // Just as a single example - clone.SingleInt32 = 150; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneRepeatedNonMessageValues() - { - var original = new TestAllTypes - { - RepeatedBool = { true, false }, - RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.CopyFrom(5, 6) }, - RepeatedDouble = { -12.25, 23.5 }, - RepeatedFixed32 = { uint.MaxValue, 23 }, - RepeatedFixed64 = { ulong.MaxValue, 1234567890123 }, - RepeatedFloat = { 100f, 12.25f }, - RepeatedInt32 = { 100, 200 }, - RepeatedInt64 = { 3210987654321, long.MaxValue }, - RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAllTypes.Types.NestedEnum.Neg }, - RepeatedSfixed32 = { -123, 123 }, - RepeatedSfixed64 = { -12345678901234, 12345678901234 }, - RepeatedSint32 = { -456, 100 }, - RepeatedSint64 = { -12345678901235, 123 }, - RepeatedString = { "foo", "bar" }, - RepeatedUint32 = { uint.MaxValue, uint.MinValue }, - RepeatedUint64 = { ulong.MaxValue, uint.MinValue } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreEqual(original, clone); - // Just as a single example - clone.RepeatedDouble.Add(25.5); - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneSingleMessageField() - { - var original = new TestAllTypes - { - SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 20 } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreNotSame(original.SingleNestedMessage, clone.SingleNestedMessage); - Assert.AreEqual(original, clone); - - clone.SingleNestedMessage.Bb = 30; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneRepeatedMessageField() - { - var original = new TestAllTypes - { - RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage { Bb = 20 } } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreNotSame(original.RepeatedNestedMessage, clone.RepeatedNestedMessage); - Assert.AreNotSame(original.RepeatedNestedMessage[0], clone.RepeatedNestedMessage[0]); - Assert.AreEqual(original, clone); - - clone.RepeatedNestedMessage[0].Bb = 30; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void CloneOneofField() - { - var original = new TestAllTypes - { - OneofNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 20 } - }; - - var clone = original.Clone(); - Assert.AreNotSame(original, clone); - Assert.AreEqual(original, clone); - - // We should have cloned the message - original.OneofNestedMessage.Bb = 30; - Assert.AreNotEqual(original, clone); - } - - [Test] - public void OneofProperties() - { - // Switch the oneof case between each of the different options, and check everything behaves - // as expected in each case. - var message = new TestAllTypes(); - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - - message.OneofString = "sample"; - Assert.AreEqual("sample", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofString, message.OneofFieldCase); - - var bytes = ByteString.CopyFrom(1, 2, 3); - message.OneofBytes = bytes; - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(bytes, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofBytes, message.OneofFieldCase); - - message.OneofUint32 = 20; - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(20, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message.OneofFieldCase); - - var nestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 25 }; - message.OneofNestedMessage = nestedMessage; - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.AreEqual(nestedMessage, message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofNestedMessage, message.OneofFieldCase); - - message.ClearOneofField(); - Assert.AreEqual("", message.OneofString); - Assert.AreEqual(0, message.OneofUint32); - Assert.AreEqual(ByteString.Empty, message.OneofBytes); - Assert.IsNull(message.OneofNestedMessage); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); - } - - [Test] - public void Oneof_DefaultValuesNotEqual() - { - var message1 = new TestAllTypes { OneofString = "" }; - var message2 = new TestAllTypes { OneofUint32 = 0 }; - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofString, message1.OneofFieldCase); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message2.OneofFieldCase); - Assert.AreNotEqual(message1, message2); - } - - [Test] - public void OneofSerialization_NonDefaultValue() - { - var message = new TestAllTypes - { - OneofString = "this would take a bit of space", - OneofUint32 = 10 - }; - var bytes = message.ToByteArray(); - Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - no string! - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message, parsedMessage => - { - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, parsedMessage.OneofFieldCase); - }); - } - - [Test] - public void OneofSerialization_DefaultValue() - { - var message = new TestAllTypes - { - OneofString = "this would take a bit of space", - OneofUint32 = 0 // This is the default value for UInt32; normally wouldn't be serialized - }; - var bytes = message.ToByteArray(); - Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - it's still serialized - - MessageParsingHelpers.AssertWritingMessage(message); - - MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message, parsedMessage => - { - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, parsedMessage.OneofFieldCase); - }); - } - - [Test] - public void MapStringString_DeterministicTrue_ThenBytesIdentical() - { - // Define three strings consisting of different versions of the letter I. - // LATIN CAPITAL LETTER I (U+0049) - string capitalLetterI = "I"; - // LATIN SMALL LETTER I (U+0069) - string smallLetterI = "i"; - // LATIN SMALL LETTER DOTLESS I (U+0131) - string smallLetterDotlessI = "\u0131"; - var testMap1 = new TestMap(); - - testMap1.MapStringString.Add(smallLetterDotlessI, "value_"+smallLetterDotlessI); - testMap1.MapStringString.Add(smallLetterI, "value_"+smallLetterI); - testMap1.MapStringString.Add(capitalLetterI, "content_"+capitalLetterI); - var bytes1 = SerializeTestMap(testMap1, true); - - var testMap2 = new TestMap(); - testMap2.MapStringString.Add(capitalLetterI, "content_"+capitalLetterI); - testMap2.MapStringString.Add(smallLetterI, "value_"+smallLetterI); - testMap2.MapStringString.Add(smallLetterDotlessI, "value_"+smallLetterDotlessI); - - var bytes2 = SerializeTestMap(testMap2, true); - var parsedBytes2 = TestMap.Parser.ParseFrom(bytes2); - var parsedBytes1 = TestMap.Parser.ParseFrom(bytes1); - Assert.IsTrue(bytes1.SequenceEqual(bytes2)); - } - - [Test] - public void MapInt32Bytes_DeterministicTrue_ThenBytesIdentical() - { - var testMap1 = new TestMap(); - testMap1.MapInt32Bytes.Add(1, ByteString.CopyFromUtf8("test1")); - testMap1.MapInt32Bytes.Add(2, ByteString.CopyFromUtf8("test2")); - var bytes1 = SerializeTestMap(testMap1, true); - - var testMap2 = new TestMap(); - testMap2.MapInt32Bytes.Add(2, ByteString.CopyFromUtf8("test2")); - testMap2.MapInt32Bytes.Add(1, ByteString.CopyFromUtf8("test1")); - var bytes2 = SerializeTestMap(testMap2, true); - - Assert.IsTrue(bytes1.SequenceEqual(bytes2)); - } - - [Test] - public void MapInt32Bytes_DeterministicFalse_ThenBytesDifferent() - { - var testMap1 = new TestMap(); - testMap1.MapInt32Bytes.Add(1, ByteString.CopyFromUtf8("test1")); - testMap1.MapInt32Bytes.Add(2, ByteString.CopyFromUtf8("test2")); - var bytes1 = SerializeTestMap(testMap1, false); - - var testMap2 = new TestMap(); - testMap2.MapInt32Bytes.Add(2, ByteString.CopyFromUtf8("test2")); - testMap2.MapInt32Bytes.Add(1, ByteString.CopyFromUtf8("test1")); - var bytes2 = SerializeTestMap(testMap2, false); - - Assert.IsFalse(bytes1.SequenceEqual(bytes2)); - } - - private byte[] SerializeTestMap(TestMap testMap, bool deterministic) - { - using var memoryStream = new MemoryStream(); - var codedOutputStream = new CodedOutputStream(memoryStream); - codedOutputStream.Deterministic = deterministic; - - testMap.WriteTo(codedOutputStream); - codedOutputStream.Flush(); - - memoryStream.Seek(0, SeekOrigin.Begin); - return memoryStream.ToArray(); - } - - [Test] - public void DiscardUnknownFields_RealDataStillRead() - { - var message = SampleMessages.CreateFullTestAllTypes(); - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - var unusedFieldNumber = 23456; - Assert.IsFalse(TestAllTypes.Descriptor.Fields.InDeclarationOrder().Select(x => x.FieldNumber).Contains(unusedFieldNumber)); - output.WriteTag(unusedFieldNumber, WireFormat.WireType.LengthDelimited); - output.WriteString("ignore me"); - message.WriteTo(output); - output.Flush(); - - MessageParsingHelpers.AssertReadingMessage( - TestAllTypes.Parser, - stream.ToArray(), - parsed => - { - // TODO: Add test back when DiscardUnknownFields API is supported. - // Assert.AreEqual(message, parsed); - }); - } - - [Test] - public void DiscardUnknownFields_AllTypes() - { - // Simple way of ensuring we can skip all kinds of fields. - var data = SampleMessages.CreateFullTestAllTypes().ToByteArray(); - var empty = Empty.Parser.ParseFrom(data); - - MessageParsingHelpers.AssertReadingMessage( - Empty.Parser, - data, - parsed => - { - // TODO: Add test back when DiscardUnknownFields API is supported. - // Assert.AreNotEqual(new Empty(), empty); - }); - } - - // This was originally seen as a conformance test failure. - [Test] - public void TruncatedMessageFieldThrows() - { - // 130, 3 is the message tag - // 1 is the data length - but there's no data. - var data = new byte[] { 130, 3, 1 }; - MessageParsingHelpers.AssertReadingMessageThrows(TestAllTypes.Parser, data); - } - - /// - /// Demonstrates current behaviour with an extraneous end group tag - see issue 688 - /// for details; we may want to change this. - /// - [Test] - public void ExtraEndGroupThrows() - { - var stream = new MemoryStream(); - var output = new CodedOutputStream(stream); - - output.WriteTag(TestAllTypes.SingleFixed32FieldNumber, WireFormat.WireType.Fixed32); - output.WriteFixed32(123); - output.WriteTag(100, WireFormat.WireType.EndGroup); - - output.Flush(); - - stream.Position = 0; - MessageParsingHelpers.AssertReadingMessageThrows(TestAllTypes.Parser, stream.ToArray()); - } - - [Test] - public void CustomDiagnosticMessage_DirectToStringCall() - { - var message = new ForeignMessage { C = 31 }; - Assert.AreEqual("{ \"c\": 31, \"@cInHex\": \"1f\" }", message.ToString()); - Assert.AreEqual("{ \"c\": 31 }", JsonFormatter.Default.Format(message)); - } - - [Test] - public void CustomDiagnosticMessage_Nested() - { - var message = new TestAllTypes { SingleForeignMessage = new ForeignMessage { C = 16 } }; - Assert.AreEqual("{ \"singleForeignMessage\": { \"c\": 16, \"@cInHex\": \"10\" } }", message.ToString()); - Assert.AreEqual("{ \"singleForeignMessage\": { \"c\": 16 } }", JsonFormatter.Default.Format(message)); - } - - [Test] - public void CustomDiagnosticMessage_DirectToTextWriterCall() - { - var message = new ForeignMessage { C = 31 }; - var writer = new StringWriter(); - JsonFormatter.Default.Format(message, writer); - Assert.AreEqual("{ \"c\": 31 }", writer.ToString()); - } - - [Test] - public void NaNComparisons() - { - var message1 = new TestAllTypes { SingleDouble = SampleNaNs.Regular }; - var message2 = new TestAllTypes { SingleDouble = SampleNaNs.PayloadFlipped }; - var message3 = new TestAllTypes { SingleDouble = SampleNaNs.Regular }; - - EqualityTester.AssertInequality(message1, message2); - EqualityTester.AssertEquality(message1, message3); - } - - [Test] - [TestCase(false)] - [TestCase(true)] - public void MapFieldMerging(bool direct) - { - var message1 = new TestMap - { - MapStringString = - { - { "x1", "y1" }, - { "common", "message1" } - } - }; - var message2 = new TestMap - { - MapStringString = - { - { "x2", "y2" }, - { "common", "message2" } - } - }; - if (direct) - { - message1.MergeFrom(message2); - } - else - { - message1.MergeFrom(message2.ToByteArray()); - } - - var expected = new MapField - { - { "x1", "y1" }, - { "x2", "y2" }, - { "common", "message2" } - }; - Assert.AreEqual(expected, message1.MapStringString); - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; +using Google.Protobuf.TestProtos; +using Proto2 = Google.Protobuf.TestProtos.Proto2; +using NUnit.Framework; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Google.Protobuf.WellKnownTypes; + +namespace Google.Protobuf +{ + /// + /// Tests around the generated TestAllTypes message. + /// + public partial class GeneratedMessageTest + { + [Test] + public void EmptyMessageFieldDistinctFromMissingMessageField() + { + // This demonstrates what we're really interested in... + var message1 = new TestAllTypes { SingleForeignMessage = new ForeignMessage() }; + var message2 = new TestAllTypes(); // SingleForeignMessage is null + EqualityTester.AssertInequality(message1, message2); + } + + [Test] + public void DefaultValues() + { + // Single fields + var message = new TestAllTypes(); + Assert.AreEqual(false, message.SingleBool); + Assert.AreEqual(ByteString.Empty, message.SingleBytes); + Assert.AreEqual(0.0, message.SingleDouble); + Assert.AreEqual(0, message.SingleFixed32); + Assert.AreEqual(0L, message.SingleFixed64); + Assert.AreEqual(0.0f, message.SingleFloat); + Assert.AreEqual(ForeignEnum.ForeignUnspecified, message.SingleForeignEnum); + Assert.IsNull(message.SingleForeignMessage); + Assert.AreEqual(ImportEnum.Unspecified, message.SingleImportEnum); + Assert.IsNull(message.SingleImportMessage); + Assert.AreEqual(0, message.SingleInt32); + Assert.AreEqual(0L, message.SingleInt64); + Assert.AreEqual(TestAllTypes.Types.NestedEnum.Unspecified, message.SingleNestedEnum); + Assert.IsNull(message.SingleNestedMessage); + Assert.IsNull(message.SinglePublicImportMessage); + Assert.AreEqual(0, message.SingleSfixed32); + Assert.AreEqual(0L, message.SingleSfixed64); + Assert.AreEqual(0, message.SingleSint32); + Assert.AreEqual(0L, message.SingleSint64); + Assert.AreEqual("", message.SingleString); + Assert.AreEqual(0U, message.SingleUint32); + Assert.AreEqual(0UL, message.SingleUint64); + + // Repeated fields + Assert.AreEqual(0, message.RepeatedBool.Count); + Assert.AreEqual(0, message.RepeatedBytes.Count); + Assert.AreEqual(0, message.RepeatedDouble.Count); + Assert.AreEqual(0, message.RepeatedFixed32.Count); + Assert.AreEqual(0, message.RepeatedFixed64.Count); + Assert.AreEqual(0, message.RepeatedFloat.Count); + Assert.AreEqual(0, message.RepeatedForeignEnum.Count); + Assert.AreEqual(0, message.RepeatedForeignMessage.Count); + Assert.AreEqual(0, message.RepeatedImportEnum.Count); + Assert.AreEqual(0, message.RepeatedImportMessage.Count); + Assert.AreEqual(0, message.RepeatedNestedEnum.Count); + Assert.AreEqual(0, message.RepeatedNestedMessage.Count); + Assert.AreEqual(0, message.RepeatedPublicImportMessage.Count); + Assert.AreEqual(0, message.RepeatedSfixed32.Count); + Assert.AreEqual(0, message.RepeatedSfixed64.Count); + Assert.AreEqual(0, message.RepeatedSint32.Count); + Assert.AreEqual(0, message.RepeatedSint64.Count); + Assert.AreEqual(0, message.RepeatedString.Count); + Assert.AreEqual(0, message.RepeatedUint32.Count); + Assert.AreEqual(0, message.RepeatedUint64.Count); + + // Oneof fields + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); + Assert.AreEqual(0, message.OneofUint32); + Assert.AreEqual("", message.OneofString); + Assert.AreEqual(ByteString.Empty, message.OneofBytes); + Assert.IsNull(message.OneofNestedMessage); + } + + [Test] + public void NullStringAndBytesRejected() + { + var message = new TestAllTypes(); + Assert.Throws(() => message.SingleString = null); + Assert.Throws(() => message.OneofString = null); + Assert.Throws(() => message.SingleBytes = null); + Assert.Throws(() => message.OneofBytes = null); + } + + [Test] + public void RoundTrip_Empty() + { + var message = new TestAllTypes(); + // Without setting any values, there's nothing to write. + byte[] bytes = message.ToByteArray(); + Assert.AreEqual(0, bytes.Length); + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); + } + + [Test] + public void RoundTrip_SingleValues() + { + var message = new TestAllTypes + { + SingleBool = true, + SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), + SingleDouble = 23.5, + SingleFixed32 = 23, + SingleFixed64 = 1234567890123, + SingleFloat = 12.25f, + SingleForeignEnum = ForeignEnum.ForeignBar, + SingleForeignMessage = new ForeignMessage { C = 10 }, + SingleImportEnum = ImportEnum.ImportBaz, + SingleImportMessage = new ImportMessage { D = 20 }, + SingleInt32 = 100, + SingleInt64 = 3210987654321, + SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, + SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 35 }, + SinglePublicImportMessage = new PublicImportMessage { E = 54 }, + SingleSfixed32 = -123, + SingleSfixed64 = -12345678901234, + SingleSint32 = -456, + SingleSint64 = -12345678901235, + SingleString = "test", + SingleUint32 = uint.MaxValue, + SingleUint64 = ulong.MaxValue + }; + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); + } + + [Test] + public void RoundTrip_RepeatedValues() + { + var message = new TestAllTypes + { + RepeatedBool = { true, false }, + RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.CopyFrom(5, 6) }, + RepeatedDouble = { -12.25, 23.5 }, + RepeatedFixed32 = { uint.MaxValue, 23 }, + RepeatedFixed64 = { ulong.MaxValue, 1234567890123 }, + RepeatedFloat = { 100f, 12.25f }, + RepeatedForeignEnum = { ForeignEnum.ForeignFoo, ForeignEnum.ForeignBar }, + RepeatedForeignMessage = { new ForeignMessage(), new ForeignMessage { C = 10 } }, + RepeatedImportEnum = { ImportEnum.ImportBaz, ImportEnum.Unspecified }, + RepeatedImportMessage = { new ImportMessage { D = 20 }, new ImportMessage { D = 25 } }, + RepeatedInt32 = { 100, 200 }, + RepeatedInt64 = { 3210987654321, long.MaxValue }, + RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAllTypes.Types.NestedEnum.Neg }, + RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage { Bb = 35 }, new TestAllTypes.Types.NestedMessage { Bb = 10 } }, + RepeatedPublicImportMessage = { new PublicImportMessage { E = 54 }, new PublicImportMessage { E = -1 } }, + RepeatedSfixed32 = { -123, 123 }, + RepeatedSfixed64 = { -12345678901234, 12345678901234 }, + RepeatedSint32 = { -456, 100 }, + RepeatedSint64 = { -12345678901235, 123 }, + RepeatedString = { "foo", "bar" }, + RepeatedUint32 = { uint.MaxValue, uint.MinValue }, + RepeatedUint64 = { ulong.MaxValue, uint.MinValue } + }; + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); + } + + // Note that not every map within map_unittest_proto3 is used. They all go through very + // similar code paths. The fact that all maps are present is validation that we have codecs + // for every type. + [Test] + public void RoundTrip_Maps() + { + var message = new TestMap + { + MapBoolBool = { + { false, true }, + { true, false } + }, + MapInt32Bytes = { + { 5, ByteString.CopyFrom(6, 7, 8) }, + { 25, ByteString.CopyFrom(1, 2, 3, 4, 5) }, + { 10, ByteString.Empty } + }, + MapInt32ForeignMessage = { + { 0, new ForeignMessage { C = 10 } }, + { 5, new ForeignMessage() }, + }, + MapInt32Enum = { + { 1, MapEnum.Bar }, + { 2000, MapEnum.Foo } + } + }; + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestMap.Parser, message); + } + + [Test] + public void MapWithEmptyEntry() + { + var message = new TestMap + { + MapInt32Bytes = { { 0, ByteString.Empty } } + }; + + byte[] bytes = message.ToByteArray(); + Assert.AreEqual(2, bytes.Length); // Tag for field entry (1 byte), length of entry (0; 1 byte) + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + bytes, + parsed=> + { + Assert.AreEqual(1, parsed.MapInt32Bytes.Count); + Assert.AreEqual(ByteString.Empty, parsed.MapInt32Bytes[0]); + }); + } + + [Test] + public void MapWithOnlyValue() + { + // Hand-craft the stream to contain a single entry with just a value. + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + output.WriteTag(TestMap.MapInt32ForeignMessageFieldNumber, WireFormat.WireType.LengthDelimited); + var nestedMessage = new ForeignMessage { C = 20 }; + // Size of the entry (tag, size written by WriteMessage, data written by WriteMessage) + output.WriteLength(2 + nestedMessage.CalculateSize()); + output.WriteTag(2, WireFormat.WireType.LengthDelimited); + output.WriteMessage(nestedMessage); + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(nestedMessage, parsed.MapInt32ForeignMessage[0]); + }); + } + + [Test] + public void MapWithOnlyKey_PrimitiveValue() + { + // Hand-craft the stream to contain a single entry with just a key. + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + output.WriteTag(TestMap.MapInt32DoubleFieldNumber, WireFormat.WireType.LengthDelimited); + int key = 10; + output.WriteLength(1 + CodedOutputStream.ComputeInt32Size(key)); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key); + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(0.0, parsed.MapInt32Double[key]); + }); + } + + [Test] + public void MapWithOnlyKey_MessageValue() + { + // Hand-craft the stream to contain a single entry with just a key. + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + output.WriteTag(TestMap.MapInt32ForeignMessageFieldNumber, WireFormat.WireType.LengthDelimited); + int key = 10; + output.WriteLength(1 + CodedOutputStream.ComputeInt32Size(key)); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key); + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(new ForeignMessage(), parsed.MapInt32ForeignMessage[key]); + }); + } + + [Test] + public void MapIgnoresExtraFieldsWithinEntryMessages() + { + // Hand-craft the stream to contain a single entry with three fields + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + + output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); + + var key = 10; // Field 1 + var value = 20; // Field 2 + var extra = 30; // Field 3 + + // Each field can be represented in a single byte, with a single byte tag. + // Total message size: 6 bytes. + output.WriteLength(6); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key); + output.WriteTag(2, WireFormat.WireType.Varint); + output.WriteInt32(value); + output.WriteTag(3, WireFormat.WireType.Varint); + output.WriteInt32(extra); + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(value, parsed.MapInt32Int32[key]); + }); + } + + [Test] + public void MapFieldOrderIsIrrelevant() + { + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + + output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); + + var key = 10; + var value = 20; + + // Each field can be represented in a single byte, with a single byte tag. + // Total message size: 4 bytes. + output.WriteLength(4); + output.WriteTag(2, WireFormat.WireType.Varint); + output.WriteInt32(value); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key); + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(value, parsed.MapInt32Int32[key]); + }); + } + + [Test] + public void MapNonContiguousEntries() + { + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + + // Message structure: + // Entry for MapInt32Int32 + // Entry for MapStringString + // Entry for MapInt32Int32 + + // First entry + var key1 = 10; + var value1 = 20; + output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); + output.WriteLength(4); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key1); + output.WriteTag(2, WireFormat.WireType.Varint); + output.WriteInt32(value1); + + // Second entry + var key2 = "a"; + var value2 = "b"; + output.WriteTag(TestMap.MapStringStringFieldNumber, WireFormat.WireType.LengthDelimited); + output.WriteLength(6); // 3 bytes per entry: tag, size, character + output.WriteTag(1, WireFormat.WireType.LengthDelimited); + output.WriteString(key2); + output.WriteTag(2, WireFormat.WireType.LengthDelimited); + output.WriteString(value2); + + // Third entry + var key3 = 15; + var value3 = 25; + output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); + output.WriteLength(4); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key3); + output.WriteTag(2, WireFormat.WireType.Varint); + output.WriteInt32(value3); + + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + var expected = new TestMap + { + MapInt32Int32 = { { key1, value1 }, { key3, value3 } }, + MapStringString = { { key2, value2 } } + }; + Assert.AreEqual(expected, parsed); + }); + } + + [Test] + public void DuplicateKeys_LastEntryWins() + { + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + + var key = 10; + var value1 = 20; + var value2 = 30; + + // First entry + output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); + output.WriteLength(4); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key); + output.WriteTag(2, WireFormat.WireType.Varint); + output.WriteInt32(value1); + + // Second entry - same key, different value + output.WriteTag(TestMap.MapInt32Int32FieldNumber, WireFormat.WireType.LengthDelimited); + output.WriteLength(4); + output.WriteTag(1, WireFormat.WireType.Varint); + output.WriteInt32(key); + output.WriteTag(2, WireFormat.WireType.Varint); + output.WriteInt32(value2); + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(value2, parsed.MapInt32Int32[key]); + }); + } + + [Test] + public void CloneSingleNonMessageValues() + { + var original = new TestAllTypes + { + SingleBool = true, + SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), + SingleDouble = 23.5, + SingleFixed32 = 23, + SingleFixed64 = 1234567890123, + SingleFloat = 12.25f, + SingleInt32 = 100, + SingleInt64 = 3210987654321, + SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, + SingleSfixed32 = -123, + SingleSfixed64 = -12345678901234, + SingleSint32 = -456, + SingleSint64 = -12345678901235, + SingleString = "test", + SingleUint32 = uint.MaxValue, + SingleUint64 = ulong.MaxValue + }; + var clone = original.Clone(); + Assert.AreNotSame(original, clone); + Assert.AreEqual(original, clone); + // Just as a single example + clone.SingleInt32 = 150; + Assert.AreNotEqual(original, clone); + } + + [Test] + public void CloneRepeatedNonMessageValues() + { + var original = new TestAllTypes + { + RepeatedBool = { true, false }, + RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.CopyFrom(5, 6) }, + RepeatedDouble = { -12.25, 23.5 }, + RepeatedFixed32 = { uint.MaxValue, 23 }, + RepeatedFixed64 = { ulong.MaxValue, 1234567890123 }, + RepeatedFloat = { 100f, 12.25f }, + RepeatedInt32 = { 100, 200 }, + RepeatedInt64 = { 3210987654321, long.MaxValue }, + RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAllTypes.Types.NestedEnum.Neg }, + RepeatedSfixed32 = { -123, 123 }, + RepeatedSfixed64 = { -12345678901234, 12345678901234 }, + RepeatedSint32 = { -456, 100 }, + RepeatedSint64 = { -12345678901235, 123 }, + RepeatedString = { "foo", "bar" }, + RepeatedUint32 = { uint.MaxValue, uint.MinValue }, + RepeatedUint64 = { ulong.MaxValue, uint.MinValue } + }; + + var clone = original.Clone(); + Assert.AreNotSame(original, clone); + Assert.AreEqual(original, clone); + // Just as a single example + clone.RepeatedDouble.Add(25.5); + Assert.AreNotEqual(original, clone); + } + + [Test] + public void CloneSingleMessageField() + { + var original = new TestAllTypes + { + SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 20 } + }; + + var clone = original.Clone(); + Assert.AreNotSame(original, clone); + Assert.AreNotSame(original.SingleNestedMessage, clone.SingleNestedMessage); + Assert.AreEqual(original, clone); + + clone.SingleNestedMessage.Bb = 30; + Assert.AreNotEqual(original, clone); + } + + [Test] + public void CloneRepeatedMessageField() + { + var original = new TestAllTypes + { + RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage { Bb = 20 } } + }; + + var clone = original.Clone(); + Assert.AreNotSame(original, clone); + Assert.AreNotSame(original.RepeatedNestedMessage, clone.RepeatedNestedMessage); + Assert.AreNotSame(original.RepeatedNestedMessage[0], clone.RepeatedNestedMessage[0]); + Assert.AreEqual(original, clone); + + clone.RepeatedNestedMessage[0].Bb = 30; + Assert.AreNotEqual(original, clone); + } + + [Test] + public void CloneOneofField() + { + var original = new TestAllTypes + { + OneofNestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 20 } + }; + + var clone = original.Clone(); + Assert.AreNotSame(original, clone); + Assert.AreEqual(original, clone); + + // We should have cloned the message + original.OneofNestedMessage.Bb = 30; + Assert.AreNotEqual(original, clone); + } + + [Test] + public void OneofProperties() + { + // Switch the oneof case between each of the different options, and check everything behaves + // as expected in each case. + var message = new TestAllTypes(); + Assert.AreEqual("", message.OneofString); + Assert.AreEqual(0, message.OneofUint32); + Assert.AreEqual(ByteString.Empty, message.OneofBytes); + Assert.IsNull(message.OneofNestedMessage); + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); + + message.OneofString = "sample"; + Assert.AreEqual("sample", message.OneofString); + Assert.AreEqual(0, message.OneofUint32); + Assert.AreEqual(ByteString.Empty, message.OneofBytes); + Assert.IsNull(message.OneofNestedMessage); + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofString, message.OneofFieldCase); + + var bytes = ByteString.CopyFrom(1, 2, 3); + message.OneofBytes = bytes; + Assert.AreEqual("", message.OneofString); + Assert.AreEqual(0, message.OneofUint32); + Assert.AreEqual(bytes, message.OneofBytes); + Assert.IsNull(message.OneofNestedMessage); + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofBytes, message.OneofFieldCase); + + message.OneofUint32 = 20; + Assert.AreEqual("", message.OneofString); + Assert.AreEqual(20, message.OneofUint32); + Assert.AreEqual(ByteString.Empty, message.OneofBytes); + Assert.IsNull(message.OneofNestedMessage); + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message.OneofFieldCase); + + var nestedMessage = new TestAllTypes.Types.NestedMessage { Bb = 25 }; + message.OneofNestedMessage = nestedMessage; + Assert.AreEqual("", message.OneofString); + Assert.AreEqual(0, message.OneofUint32); + Assert.AreEqual(ByteString.Empty, message.OneofBytes); + Assert.AreEqual(nestedMessage, message.OneofNestedMessage); + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofNestedMessage, message.OneofFieldCase); + + message.ClearOneofField(); + Assert.AreEqual("", message.OneofString); + Assert.AreEqual(0, message.OneofUint32); + Assert.AreEqual(ByteString.Empty, message.OneofBytes); + Assert.IsNull(message.OneofNestedMessage); + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); + } + + [Test] + public void Oneof_DefaultValuesNotEqual() + { + var message1 = new TestAllTypes { OneofString = "" }; + var message2 = new TestAllTypes { OneofUint32 = 0 }; + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofString, message1.OneofFieldCase); + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message2.OneofFieldCase); + Assert.AreNotEqual(message1, message2); + } + + [Test] + public void OneofSerialization_NonDefaultValue() + { + var message = new TestAllTypes(); + message.OneofString = "this would take a bit of space"; + message.OneofUint32 = 10; + var bytes = message.ToByteArray(); + Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - no string! + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message, parsedMessage => + { + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, parsedMessage.OneofFieldCase); + }); + } + + [Test] + public void OneofSerialization_DefaultValue() + { + var message = new TestAllTypes(); + message.OneofString = "this would take a bit of space"; + message.OneofUint32 = 0; // This is the default value for UInt32; normally wouldn't be serialized + var bytes = message.ToByteArray(); + Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - it's still serialized + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message, parsedMessage => + { + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, parsedMessage.OneofFieldCase); + }); + } + + [Test] + public void DiscardUnknownFields_RealDataStillRead() + { + var message = SampleMessages.CreateFullTestAllTypes(); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + var unusedFieldNumber = 23456; + Assert.IsFalse(TestAllTypes.Descriptor.Fields.InDeclarationOrder().Select(x => x.FieldNumber).Contains(unusedFieldNumber)); + output.WriteTag(unusedFieldNumber, WireFormat.WireType.LengthDelimited); + output.WriteString("ignore me"); + message.WriteTo(output); + output.Flush(); + + MessageParsingHelpers.AssertReadingMessage( + TestAllTypes.Parser, + stream.ToArray(), + parsed => + { + // TODO(jieluo): Add test back when DiscardUnknownFields API is supported. + // Assert.AreEqual(message, parsed); + }); + } + + [Test] + public void DiscardUnknownFields_AllTypes() + { + // Simple way of ensuring we can skip all kinds of fields. + var data = SampleMessages.CreateFullTestAllTypes().ToByteArray(); + var empty = Empty.Parser.ParseFrom(data); + + MessageParsingHelpers.AssertReadingMessage( + Empty.Parser, + data, + parsed => + { + // TODO(jieluo): Add test back when DiscardUnknownFields API is supported. + // Assert.AreNotEqual(new Empty(), empty); + }); + } + + // This was originally seen as a conformance test failure. + [Test] + public void TruncatedMessageFieldThrows() + { + // 130, 3 is the message tag + // 1 is the data length - but there's no data. + var data = new byte[] { 130, 3, 1 }; + MessageParsingHelpers.AssertReadingMessageThrows(TestAllTypes.Parser, data); + } + + /// + /// Demonstrates current behaviour with an extraneous end group tag - see issue 688 + /// for details; we may want to change this. + /// + [Test] + public void ExtraEndGroupThrows() + { + var message = SampleMessages.CreateFullTestAllTypes(); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + + output.WriteTag(TestAllTypes.SingleFixed32FieldNumber, WireFormat.WireType.Fixed32); + output.WriteFixed32(123); + output.WriteTag(100, WireFormat.WireType.EndGroup); + + output.Flush(); + + stream.Position = 0; + MessageParsingHelpers.AssertReadingMessageThrows(TestAllTypes.Parser, stream.ToArray()); + } + + [Test] + public void CustomDiagnosticMessage_DirectToStringCall() + { + var message = new ForeignMessage { C = 31 }; + Assert.AreEqual("{ \"c\": 31, \"@cInHex\": \"1f\" }", message.ToString()); + Assert.AreEqual("{ \"c\": 31 }", JsonFormatter.Default.Format(message)); + } + + [Test] + public void CustomDiagnosticMessage_Nested() + { + var message = new TestAllTypes { SingleForeignMessage = new ForeignMessage { C = 16 } }; + Assert.AreEqual("{ \"singleForeignMessage\": { \"c\": 16, \"@cInHex\": \"10\" } }", message.ToString()); + Assert.AreEqual("{ \"singleForeignMessage\": { \"c\": 16 } }", JsonFormatter.Default.Format(message)); + } + + [Test] + public void CustomDiagnosticMessage_DirectToTextWriterCall() + { + var message = new ForeignMessage { C = 31 }; + var writer = new StringWriter(); + JsonFormatter.Default.Format(message, writer); + Assert.AreEqual("{ \"c\": 31 }", writer.ToString()); + } + + [Test] + public void NaNComparisons() + { + var message1 = new TestAllTypes { SingleDouble = SampleNaNs.Regular }; + var message2 = new TestAllTypes { SingleDouble = SampleNaNs.PayloadFlipped }; + var message3 = new TestAllTypes { SingleDouble = SampleNaNs.Regular }; + + EqualityTester.AssertInequality(message1, message2); + EqualityTester.AssertEquality(message1, message3); + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index cbdc13faea48aeab558515d9802179ef0ae02590..1a7953d6b7868ca0f165947a00159a8aa4b5420d 100644 --- a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -1,27 +1,27 @@ - + - net462;net6.0 + net451;netcoreapp2.1 ../../keys/Google.Protobuf.snk true + true False - True - + - - - + + + - + - + diff --git a/csharp/src/Google.Protobuf.Test/IssuesTest.cs b/csharp/src/Google.Protobuf.Test/IssuesTest.cs index fa31bea0def0e3fdd4eb6d62bddec90b399dd769..2904c461df301fbe1d8d4690540cd5a15c61d964 100644 --- a/csharp/src/Google.Protobuf.Test/IssuesTest.cs +++ b/csharp/src/Google.Protobuf.Test/IssuesTest.cs @@ -1,109 +1,116 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.Reflection; -using UnitTest.Issues.TestProtos; -using NUnit.Framework; -using System.IO; -using static UnitTest.Issues.TestProtos.OneofMerging.Types; - -namespace Google.Protobuf -{ - /// - /// Tests for issues which aren't easily compartmentalized into other unit tests. - /// - public class IssuesTest - { - // Issue 45 - [Test] - public void FieldCalledItem() - { - ItemField message = new ItemField { Item = 3 }; - FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item"); - Assert.NotNull(field); - Assert.AreEqual(3, (int)field.Accessor.GetValue(message)); - } - - [Test] - public void ReservedNames() - { - var message = new ReservedNames { Types_ = 10, Descriptor_ = 20 }; - // Underscores aren't reflected in the JSON. - Assert.AreEqual("{ \"types\": 10, \"descriptor\": 20 }", message.ToString()); - } - - [Test] - public void JsonNameParseTest() - { - var settings = new JsonParser.Settings(10, TypeRegistry.FromFiles(UnittestIssuesReflection.Descriptor)); - var parser = new JsonParser(settings); - - // It is safe to use either original field name or explicitly specified json_name - Assert.AreEqual(new TestJsonName { Name = "test", Description = "test2", Guid = "test3" }, - parser.Parse("{ \"name\": \"test\", \"desc\": \"test2\", \"guid\": \"test3\" }")); - } - - [Test] - public void JsonNameFormatTest() - { - var message = new TestJsonName { Name = "test", Description = "test2", Guid = "test3" }; - Assert.AreEqual("{ \"name\": \"test\", \"desc\": \"test2\", \"exid\": \"test3\" }", - JsonFormatter.Default.Format(message)); - } - - [Test] - public void OneofMerging() - { - var message1 = new OneofMerging { Nested = new Nested { X = 10 } }; - var message2 = new OneofMerging { Nested = new Nested { Y = 20 } }; - var expected = new OneofMerging { Nested = new Nested { X = 10, Y = 20 } }; - - var merged = message1.Clone(); - merged.MergeFrom(message2); - Assert.AreEqual(expected, merged); - } - - // Check that a tag immediately followed by end of limit can still be read. - [Test] - public void CodedInputStream_LimitReachedRightAfterTag() - { - MemoryStream ms = new MemoryStream(); - var cos = new CodedOutputStream(ms); - cos.WriteTag(11, WireFormat.WireType.Varint); - Assert.AreEqual(1, cos.Position); - cos.WriteString("some extra padding"); // ensure is currentLimit distinct from the end of the buffer. - cos.Flush(); - - var cis = new CodedInputStream(ms.ToArray()); - cis.PushLimit(1); // make sure we reach the limit right after reading the tag. - - // we still must read the tag correctly, even though the tag is at the very end of our limited input - // (which is a corner case and will most likely result in an error when trying to read value of the field - // described by this tag, but it would be a logical error not to read the tag that's actually present). - // See https://github.com/protocolbuffers/protobuf/pull/7289 - cis.AssertNextTag(WireFormat.MakeTag(11, WireFormat.WireType.Varint)); - } - - [Test] - public void NoneFieldInOneof() - { - var message = new OneofWithNoneField(); - var emptyHashCode = message.GetHashCode(); - Assert.AreEqual(OneofWithNoneField.TestOneofCase.None, message.TestCase); - message.None = "test"; - Assert.AreEqual(OneofWithNoneField.TestOneofCase.None_, message.TestCase); - Assert.AreNotEqual(emptyHashCode, message.GetHashCode()); - - var bytes = message.ToByteArray(); - var parsed = OneofWithNoneField.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); - Assert.AreEqual("test", parsed.None); - } - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Google.Protobuf.Reflection; +using UnitTest.Issues.TestProtos; +using NUnit.Framework; +using System.IO; +using static UnitTest.Issues.TestProtos.OneofMerging.Types; + +namespace Google.Protobuf +{ + /// + /// Tests for issues which aren't easily compartmentalized into other unit tests. + /// + public class IssuesTest + { + // Issue 45 + [Test] + public void FieldCalledItem() + { + ItemField message = new ItemField { Item = 3 }; + FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item"); + Assert.NotNull(field); + Assert.AreEqual(3, (int)field.Accessor.GetValue(message)); + } + + [Test] + public void ReservedNames() + { + var message = new ReservedNames { Types_ = 10, Descriptor_ = 20 }; + // Underscores aren't reflected in the JSON. + Assert.AreEqual("{ \"types\": 10, \"descriptor\": 20 }", message.ToString()); + } + + [Test] + public void JsonNameParseTest() + { + var settings = new JsonParser.Settings(10, TypeRegistry.FromFiles(UnittestIssuesReflection.Descriptor)); + var parser = new JsonParser(settings); + + // It is safe to use either original field name or explicitly specified json_name + Assert.AreEqual(new TestJsonName { Name = "test", Description = "test2", Guid = "test3" }, + parser.Parse("{ \"name\": \"test\", \"desc\": \"test2\", \"guid\": \"test3\" }")); + } + + [Test] + public void JsonNameFormatTest() + { + var message = new TestJsonName { Name = "test", Description = "test2", Guid = "test3" }; + Assert.AreEqual("{ \"name\": \"test\", \"desc\": \"test2\", \"exid\": \"test3\" }", + JsonFormatter.Default.Format(message)); + } + + [Test] + public void OneofMerging() + { + var message1 = new OneofMerging { Nested = new Nested { X = 10 } }; + var message2 = new OneofMerging { Nested = new Nested { Y = 20 } }; + var expected = new OneofMerging { Nested = new Nested { X = 10, Y = 20 } }; + + var merged = message1.Clone(); + merged.MergeFrom(message2); + Assert.AreEqual(expected, merged); + } + + // Check that a tag immediately followed by end of limit can still be read. + [Test] + public void CodedInputStream_LimitReachedRightAfterTag() + { + MemoryStream ms = new MemoryStream(); + var cos = new CodedOutputStream(ms); + cos.WriteTag(11, WireFormat.WireType.Varint); + Assert.AreEqual(1, cos.Position); + cos.WriteString("some extra padding"); // ensure is currentLimit distinct from the end of the buffer. + cos.Flush(); + + var cis = new CodedInputStream(ms.ToArray()); + cis.PushLimit(1); // make sure we reach the limit right after reading the tag. + + // we still must read the tag correctly, even though the tag is at the very end of our limited input + // (which is a corner case and will most likely result in an error when trying to read value of the field + // described by this tag, but it would be a logical error not to read the tag that's actually present). + // See https://github.com/protocolbuffers/protobuf/pull/7289 + cis.AssertNextTag(WireFormat.MakeTag(11, WireFormat.WireType.Varint)); + } + } +} diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterSettingsTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterSettingsTest.cs deleted file mode 100644 index f6ec3fa0caa014c3e1eb531c765d5b9ca1643941..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterSettingsTest.cs +++ /dev/null @@ -1,88 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -#endregion - -using Google.Protobuf.Reflection; -using NUnit.Framework; - -// For WrapInQuotes - -namespace Google.Protobuf -{ - public class JsonFormatterSettingsTest - { - [Test] - public void WithIndentation() - { - var settings = JsonFormatter.Settings.Default.WithIndentation("\t"); - Assert.AreEqual("\t", settings.Indentation); - } - - [Test] - public void WithTypeRegistry() - { - var typeRegistry = TypeRegistry.Empty; - var settings = JsonFormatter.Settings.Default.WithTypeRegistry(typeRegistry); - Assert.AreEqual(typeRegistry, settings.TypeRegistry); - } - - [Test] - public void WithFormatDefaultValues() - { - var settingsWith = JsonFormatter.Settings.Default.WithFormatDefaultValues(true); - Assert.AreEqual(true, settingsWith.FormatDefaultValues); - - var settingsWithout = JsonFormatter.Settings.Default.WithFormatDefaultValues(false); - Assert.AreEqual(false, settingsWithout.FormatDefaultValues); - } - - [Test] - public void WithFormatEnumsAsIntegers() - { - var settingsWith = JsonFormatter.Settings.Default.WithFormatEnumsAsIntegers(true); - Assert.AreEqual(true, settingsWith.FormatEnumsAsIntegers); - - var settingsWithout = JsonFormatter.Settings.Default.WithFormatEnumsAsIntegers(false); - Assert.AreEqual(false, settingsWithout.FormatEnumsAsIntegers); - } - - [Test] - public void WithMethodsPreserveExistingSettings() - { - var typeRegistry = TypeRegistry.Empty; - var baseSettings = JsonFormatter.Settings.Default - .WithIndentation("\t") - .WithFormatDefaultValues(true) - .WithFormatEnumsAsIntegers(true) - .WithTypeRegistry(typeRegistry) - .WithPreserveProtoFieldNames(true); - - var settings1 = baseSettings.WithIndentation("\t"); - var settings2 = baseSettings.WithFormatDefaultValues(true); - var settings3 = baseSettings.WithFormatEnumsAsIntegers(true); - var settings4 = baseSettings.WithTypeRegistry(typeRegistry); - var settings5 = baseSettings.WithPreserveProtoFieldNames(true); - - AssertAreEqual(baseSettings, settings1); - AssertAreEqual(baseSettings, settings2); - AssertAreEqual(baseSettings, settings3); - AssertAreEqual(baseSettings, settings4); - AssertAreEqual(baseSettings, settings5); - } - - private static void AssertAreEqual(JsonFormatter.Settings settings, JsonFormatter.Settings other) - { - Assert.AreEqual(settings.Indentation, other.Indentation); - Assert.AreEqual(settings.FormatDefaultValues, other.FormatDefaultValues); - Assert.AreEqual(settings.FormatEnumsAsIntegers, other.FormatEnumsAsIntegers); - Assert.AreEqual(settings.TypeRegistry, other.TypeRegistry); - } - } -} diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index 2e06753beccc0a3be019fa7d27df722b3f707aa7..1a650933efd434ef50d397e61296eed33c56cbfa 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -1,10 +1,33 @@ -#region Copyright notice and license +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -145,7 +168,8 @@ namespace Google.Protobuf [Test] public void WithFormatDefaultValues_DoesNotAffectProto3OptionalFields() { - var message = new TestProto3Optional { OptionalInt32 = 0 }; + var message = new TestProto3Optional(); + message.OptionalInt32 = 0; var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); var json = formatter.Format(message); // The non-optional proto3 fields are formatted, as is the optional-but-specified field. @@ -155,7 +179,8 @@ namespace Google.Protobuf [Test] public void WithFormatDefaultValues_DoesNotAffectProto2Fields() { - var message = new TestProtos.Proto2.ForeignMessage { C = 0 }; + var message = new TestProtos.Proto2.ForeignMessage(); + message.C = 0; var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); var json = formatter.Format(message); // The specified field is formatted, but the non-specified field (d) is not. @@ -607,18 +632,6 @@ namespace Google.Protobuf Assert.AreEqual(expectedJson, JsonFormatter.Default.Format(populated)); } - // See See https://github.com/protocolbuffers/protobuf/issues/11987 - [Test] - public void JsonNamePriority() - { - // This tests both the formatter and the parser, but the issue was when parsing. - var original = new Issue11987Message { A = 10, B = 20, C = 30 }; - var json = JsonFormatter.Default.Format(original); - AssertJson("{ 'b': 10, 'a': 20, 'd': 30 }", json); - var parsed = Issue11987Message.Parser.ParseJson(json); - Assert.AreEqual(original, parsed); - } - // Sanity tests for WriteValue. Not particularly comprehensive, as it's all covered above already, // as FormatMessage uses WriteValue. @@ -649,13 +662,6 @@ namespace Google.Protobuf AssertWriteValue(value, "{ 'singleInt32': 100, 'singleInt64': '3210987654321' }"); } - [Test] - public void WriteValue_Message_PreserveNames() - { - var value = new TestAllTypes { SingleInt32 = 100, SingleInt64 = 3210987654321L }; - AssertWriteValue(value, "{ 'single_int32': 100, 'single_int64': '3210987654321' }", JsonFormatter.Settings.Default.WithPreserveProtoFieldNames(true)); - } - [Test] public void WriteValue_List() { @@ -663,200 +669,6 @@ namespace Google.Protobuf AssertWriteValue(value, "[ 1, 2, 3 ]"); } - [Test] - public void WriteValueWithIndentation_EmptyMessage() - { - var value = new TestEmptyMessage(); - - AssertWriteValue(value, "{}", JsonFormatter.Settings.Default.WithIndentation()); - } - - [Test] - public void WriteValueWithIndentation_NestedTestAllTypes() - { - var value = new NestedTestAllTypes - { - Payload = new TestAllTypes - { - SingleBool = true, - SingleInt32 = 100, - SingleString = "multiple fields", - RepeatedString = { "string1", "string2" }, - }, - Child = new NestedTestAllTypes - { - Payload = new TestAllTypes - { - SingleString = "single field", - }, - }, - RepeatedChild = - { - new NestedTestAllTypes { Payload = new TestAllTypes { SingleString = "child 1", RepeatedString = { "string" } } }, - new NestedTestAllTypes { Payload = new TestAllTypes { SingleString = "child 2" } }, - }, - }; - - const string expectedJson = @" -{ - 'child': { - 'payload': { - 'singleString': 'single field' - } - }, - 'payload': { - 'singleInt32': 100, - 'singleBool': true, - 'singleString': 'multiple fields', - 'repeatedString': [ - 'string1', - 'string2' - ] - }, - 'repeatedChild': [ - { - 'payload': { - 'singleString': 'child 1', - 'repeatedString': [ - 'string' - ] - } - }, - { - 'payload': { - 'singleString': 'child 2' - } - } - ] -}"; - AssertWriteValue(value, expectedJson, JsonFormatter.Settings.Default.WithIndentation()); - } - - [Test] - public void WriteValueWithIndentation_WellKnownTypes() - { - var value = new TestWellKnownTypes - { - StructField = new Struct - { - Fields = - { - { "string", Value.ForString("foo") }, - { "numbers", Value.ForList(Value.ForNumber(1), Value.ForNumber(2), Value.ForNumber(3)) }, - { "emptyList", Value.ForList() }, - { "emptyStruct", Value.ForStruct(new Struct()) }, - }, - }, - }; - - const string expectedJson = @" -{ - 'structField': { - 'string': 'foo', - 'numbers': [ - 1, - 2, - 3 - ], - 'emptyList': [], - 'emptyStruct': {} - } -}"; - AssertWriteValue(value, expectedJson, JsonFormatter.Settings.Default.WithIndentation()); - } - - [Test] - public void WriteValueWithIndentation_StructSingleField() - { - var value = new Struct { Fields = { { "structField1", Value.ForString("structFieldValue1") } } }; - - const string expectedJson = @" -{ - 'structField1': 'structFieldValue1' -}"; - AssertWriteValue(value, expectedJson, JsonFormatter.Settings.Default.WithIndentation()); - } - - [Test] - public void WriteValueWithIndentation_StructMultipleFields() - { - var value = new Struct - { - Fields = - { - { "structField1", Value.ForString("structFieldValue1") }, - { "structField2", Value.ForString("structFieldValue2") }, - { "structField3", Value.ForString("structFieldValue3") }, - }, - }; - - const string expectedJson = @" -{ - 'structField1': 'structFieldValue1', - 'structField2': 'structFieldValue2', - 'structField3': 'structFieldValue3' -}"; - AssertWriteValue(value, expectedJson, JsonFormatter.Settings.Default.WithIndentation()); - } - - [Test] - public void FormatWithIndentation_EmbeddedMessage() - { - var value = new TestAllTypes { SingleInt32 = 100, SingleInt64 = 3210987654321L }; - var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithIndentation()); - var valueJson = formatter.Format(value, indentationLevel: 1); - - var actualJson = $@" -{{ - ""data"": {valueJson} -}}"; - const string expectedJson = @" -{ - 'data': { - 'singleInt32': 100, - 'singleInt64': '3210987654321' - } -}"; - AssertJson(expectedJson, actualJson.Trim()); - } - - [Test] - public void WriteValueWithIndentation_Map() - { - var value = new TestMap - { - MapStringString = - { - { "key1", "value1" }, - { "key2", "value2" }, - }, - }; - - const string expectedJson = @" -{ - 'mapStringString': { - 'key1': 'value1', - 'key2': 'value2' - } -}"; - - AssertWriteValue(value, expectedJson, JsonFormatter.Settings.Default.WithIndentation()); - } - - [Test] - public void WriteValueWithIndentation_List() - { - var value = new RepeatedField { 1, 2, 3 }; - AssertWriteValue(value, "[\n 1,\n 2,\n 3\n]", JsonFormatter.Settings.Default.WithIndentation()); - } - - [Test] - public void WriteValueWithIndentation_CustomIndentation() - { - var value = new RepeatedField { 1, 2, 3 }; - AssertWriteValue(value, "[\n\t1,\n\t2,\n\t3\n]", JsonFormatter.Settings.Default.WithIndentation("\t")); - } - [Test] public void Proto2_DefaultValuesWritten() { @@ -864,27 +676,23 @@ namespace Google.Protobuf AssertWriteValue(value, "{ 'FieldName13': 0 }"); } - private static void AssertWriteValue(object value, string expectedJson, JsonFormatter.Settings settings = null) + private static void AssertWriteValue(object value, string expectedJson) { - var writer = new StringWriter { NewLine = "\n" }; - new JsonFormatter(settings ?? JsonFormatter.Settings.Default).WriteValue(writer, value); + var writer = new StringWriter(); + JsonFormatter.Default.WriteValue(writer, value); string actual = writer.ToString(); AssertJson(expectedJson, actual); } /// /// Checks that the actual JSON is the same as the expected JSON - but after replacing - /// all apostrophes in the expected JSON with double quotes, trimming leading whitespace and normalizing new lines. - /// This basically makes the tests easier to read. + /// all apostrophes in the expected JSON with double quotes. This basically makes the tests easier + /// to read. /// - /// - /// Line endings are normalized because indented JSON strings are generated with system-specific line endings, - /// while line endings in the test cases are hard-coded, but may be converted during source checkout, depending - /// on git settings, causing unpredictability in the test results otherwise. private static void AssertJson(string expectedJsonWithApostrophes, string actualJson) { - var expectedJson = expectedJsonWithApostrophes.Replace("'", "\"").Replace("\r\n", "\n").TrimStart(); - Assert.AreEqual(expectedJson, actualJson.Replace("\r\n", "\n")); + var expectedJson = expectedJsonWithApostrophes.Replace("'", "\""); + Assert.AreEqual(expectedJson, actualJson); } } } diff --git a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs index 5c4b42c7aac31d82689af14a1eb0733d209653f4..e170fcc5a09cd20751ba1fb04600e92244a45c8c 100644 --- a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Reflection; @@ -12,7 +35,6 @@ using Google.Protobuf.TestProtos; using Google.Protobuf.WellKnownTypes; using NUnit.Framework; using ProtobufTestMessages.Proto2; -using ProtobufTestMessages.Proto3; using System; using UnitTest.Issues.TestProtos; @@ -553,10 +575,6 @@ namespace Google.Protobuf [TestCase("-3.402823e38", -3.402823e38f)] [TestCase("1.5e1", 15f)] [TestCase("15e-1", 1.5f)] - [TestCase("3.4028235e38", float.MaxValue)] - [TestCase("-3.4028235e38", float.MinValue)] - [TestCase("3.4028235e+38", float.MaxValue)] - [TestCase("-3.4028235e+38", float.MinValue)] public void NumberToFloat_Valid(string jsonValue, float expectedParsedValue) { string json = "{ \"singleFloat\": " + jsonValue + "}"; @@ -565,10 +583,8 @@ namespace Google.Protobuf } [Test] - [TestCase("3.4028236e38", typeof(InvalidProtocolBufferException))] - [TestCase("-3.4028236e38", typeof(InvalidProtocolBufferException))] - [TestCase("3.4028236e+38", typeof(InvalidProtocolBufferException))] - [TestCase("-3.4028236e+38", typeof(InvalidProtocolBufferException))] + [TestCase("3.402824e38", typeof(InvalidProtocolBufferException))] + [TestCase("-3.402824e38", typeof(InvalidProtocolBufferException))] [TestCase("1,0", typeof(InvalidJsonException))] [TestCase("1.0.0", typeof(InvalidJsonException))] [TestCase("+1", typeof(InvalidJsonException))] @@ -624,7 +640,7 @@ namespace Google.Protobuf [TestCase("9999-12-31T23:59:59.999999999Z", null)] public void Timestamp_Valid(string jsonValue, string expectedFormatted) { - expectedFormatted ??= jsonValue; + expectedFormatted = expectedFormatted ?? jsonValue; string json = WrapInQuotes(jsonValue); var parsed = Timestamp.Parser.ParseJson(json); Assert.AreEqual(WrapInQuotes(expectedFormatted), parsed.ToString()); @@ -741,7 +757,7 @@ namespace Google.Protobuf [TestCase("-315576000000s", null)] public void Duration_Valid(string jsonValue, string expectedFormatted) { - expectedFormatted ??= jsonValue; + expectedFormatted = expectedFormatted ?? jsonValue; string json = WrapInQuotes(jsonValue); var parsed = Duration.Parser.ParseJson(json); Assert.AreEqual(WrapInQuotes(expectedFormatted), parsed.ToString()); @@ -902,10 +918,10 @@ namespace Google.Protobuf } [Test] - [TestCase("\"FOREIGN_BAR\"", TestProtos.ForeignEnum.ForeignBar)] - [TestCase("5", TestProtos.ForeignEnum.ForeignBar)] - [TestCase("100", (TestProtos.ForeignEnum)100)] - public void EnumValid(string value, TestProtos.ForeignEnum expectedValue) + [TestCase("\"FOREIGN_BAR\"", ForeignEnum.ForeignBar)] + [TestCase("5", ForeignEnum.ForeignBar)] + [TestCase("100", (ForeignEnum)100)] + public void EnumValid(string value, ForeignEnum expectedValue) { string json = "{ \"singleForeignEnum\": " + value + " }"; var parsed = TestAllTypes.Parser.ParseJson(json); @@ -1005,129 +1021,5 @@ namespace Google.Protobuf { return '"' + text + '"'; } - - [Test] - public void ParseAllNullValues() - { - string json = @"{ - ""optionalInt32"": null, - ""optionalInt64"": null, - ""optionalUint32"": null, - ""optionalUint64"": null, - ""optionalSint32"": null, - ""optionalSint64"": null, - ""optionalFixed32"": null, - ""optionalFixed64"": null, - ""optionalSfixed32"": null, - ""optionalSfixed64"": null, - ""optionalFloat"": null, - ""optionalDouble"": null, - ""optionalBool"": null, - ""optionalString"": null, - ""optionalBytes"": null, - ""optionalNestedEnum"": null, - ""optionalNestedMessage"": null, - ""repeatedInt32"": null, - ""repeatedInt64"": null, - ""repeatedUint32"": null, - ""repeatedUint64"": null, - ""repeatedSint32"": null, - ""repeatedSint64"": null, - ""repeatedFixed32"": null, - ""repeatedFixed64"": null, - ""repeatedSfixed32"": null, - ""repeatedSfixed64"": null, - ""repeatedFloat"": null, - ""repeatedDouble"": null, - ""repeatedBool"": null, - ""repeatedString"": null, - ""repeatedBytes"": null, - ""repeatedNestedEnum"": null, - ""repeatedNestedMessage"": null, - ""mapInt32Int32"": null, - ""mapBoolBool"": null, - ""mapStringNestedMessage"": null -}"; - - var message = new TestAllTypesProto3 - { - OptionalInt32 = 1, - OptionalInt64 = 1, - OptionalUint32 = 1, - OptionalUint64 = 1, - OptionalSint32 = 1, - OptionalSint64 = 1, - OptionalFixed32 = 1, - OptionalFixed64 = 1, - OptionalSfixed32 = 1, - OptionalSfixed64 = 1, - OptionalFloat = 1, - OptionalDouble = 1, - OptionalBool = true, - OptionalString = "1", - OptionalBytes = ByteString.CopyFrom(new byte[] { 1 }), - OptionalNestedEnum = TestAllTypesProto3.Types.NestedEnum.Bar, - OptionalNestedMessage = new TestAllTypesProto3.Types.NestedMessage() - }; - message.RepeatedInt32.Add(1); - message.RepeatedInt64.Add(1); - message.RepeatedUint32.Add(1); - message.RepeatedUint64.Add(1); - message.RepeatedSint32.Add(1); - message.RepeatedSint64.Add(1); - message.RepeatedFixed32.Add(1); - message.RepeatedFixed64.Add(1); - message.RepeatedSfixed32.Add(1); - message.RepeatedSfixed64.Add(1); - message.RepeatedFloat.Add(1); - message.RepeatedDouble.Add(1); - message.RepeatedBool.Add(true); - message.RepeatedString.Add("1"); - message.RepeatedBytes.Add(ByteString.CopyFrom(new byte[] { 1 })); - message.RepeatedNestedEnum.Add(TestAllTypesProto3.Types.NestedEnum.Bar); - message.RepeatedNestedMessage.Add(new TestAllTypesProto3.Types.NestedMessage()); - message.MapInt32Int32.Add(1, 1); - message.MapBoolBool.Add(true, true); - message.MapStringNestedMessage.Add(" ", new TestAllTypesProto3.Types.NestedMessage()); - - JsonParser.Default.Merge(message, json); - - Assert.AreEqual(0, message.OptionalInt32); - Assert.AreEqual(0, message.OptionalInt64); - Assert.AreEqual(0, message.OptionalUint32); - Assert.AreEqual(0, message.OptionalUint64); - Assert.AreEqual(0, message.OptionalSint32); - Assert.AreEqual(0, message.OptionalSint64); - Assert.AreEqual(0, message.OptionalFixed32); - Assert.AreEqual(0, message.OptionalFixed64); - Assert.AreEqual(0, message.OptionalSfixed32); - Assert.AreEqual(0, message.OptionalSfixed64); - Assert.AreEqual(0, message.OptionalFloat); - Assert.AreEqual(0, message.OptionalDouble); - Assert.AreEqual(false, message.OptionalBool); - Assert.AreEqual("", message.OptionalString); - Assert.AreEqual(ByteString.Empty, message.OptionalBytes); - Assert.AreEqual(TestAllTypesProto3.Types.NestedEnum.Foo, message.OptionalNestedEnum); - Assert.AreEqual(null, message.OptionalNestedMessage); - Assert.AreEqual(0, message.RepeatedInt32.Count); - Assert.AreEqual(0, message.RepeatedInt64.Count); - Assert.AreEqual(0, message.RepeatedUint32.Count); - Assert.AreEqual(0, message.RepeatedUint64.Count); - Assert.AreEqual(0, message.RepeatedSint32.Count); - Assert.AreEqual(0, message.RepeatedSint64.Count); - Assert.AreEqual(0, message.RepeatedFixed32.Count); - Assert.AreEqual(0, message.RepeatedFixed64.Count); - Assert.AreEqual(0, message.RepeatedSfixed32.Count); - Assert.AreEqual(0, message.RepeatedFloat.Count); - Assert.AreEqual(0, message.RepeatedDouble.Count); - Assert.AreEqual(0, message.RepeatedBool.Count); - Assert.AreEqual(0, message.RepeatedString.Count); - Assert.AreEqual(0, message.RepeatedBytes.Count); - Assert.AreEqual(0, message.RepeatedNestedEnum.Count); - Assert.AreEqual(0, message.RepeatedNestedMessage.Count); - Assert.AreEqual(0, message.MapInt32Int32.Count); - Assert.AreEqual(0, message.MapBoolBool.Count); - Assert.AreEqual(0, message.MapStringNestedMessage.Count); - } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs b/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs index 0b7f90eaab2e820a63706899d49843b6415784a1..df43effd4ff0fee8c20eb8410042bbc498b7c2a8 100644 --- a/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs @@ -1,12 +1,34 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion - using NUnit.Framework; using System; using System.IO; @@ -104,7 +126,7 @@ namespace Google.Protobuf tokenizer.PushBack(token); Assert.AreEqual(0, tokenizer.ObjectDepth); // Read the same token again, and get back to depth 1 - _ = tokenizer.Next(); + token = tokenizer.Next(); Assert.AreEqual(1, tokenizer.ObjectDepth); // Now the same in reverse, with EndObject diff --git a/csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs b/csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs index 0e41eca2d7cf588b0a07b05e91d3055e58567eb9..da7b4a8c077a4c66d639b49f7c4c047dc7ef11e0 100644 --- a/csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs +++ b/csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs @@ -1,17 +1,42 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion - +using Google.Protobuf; +using Google.Protobuf.Reflection; using System.Buffers; -using pb = Google.Protobuf; -using pbr = Google.Protobuf.Reflection; +using pb = global::Google.Protobuf; +using pbr = global::Google.Protobuf.Reflection; using NUnit.Framework; using System.IO; +using System; using Google.Protobuf.Buffers; namespace Google.Protobuf @@ -116,7 +141,7 @@ namespace Google.Protobuf }; var exception = Assert.Throws(() => { - WriteContext.Initialize(new TestArrayBufferWriter(), out WriteContext writeCtx); + WriteContext.Initialize(new ArrayBufferWriter(), out WriteContext writeCtx); ((IBufferMessage)message).InternalWriteTo(ref writeCtx); }); Assert.AreEqual($"Message {typeof(LegacyGeneratedCodeMessageA).Name} doesn't provide the generated method that enables WriteContext-based serialization. You might need to regenerate the generated protobuf code.", exception.Message); diff --git a/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs b/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs index 41b6de5a43d0afa9d952de1fb390eff4ad8b7037..36a2f022294616ef2838aa62209faf177ba72df6 100644 --- a/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs +++ b/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; @@ -18,38 +41,32 @@ namespace Google.Protobuf { public static void AssertReadingMessage(MessageParser parser, byte[] bytes, Action assert) where T : IMessage { - var parsedMsg = parser.ParseFrom(bytes); - assert(parsedMsg); + var parsedStream = parser.ParseFrom(bytes); // Load content as single segment - parsedMsg = parser.ParseFrom(new ReadOnlySequence(bytes)); - assert(parsedMsg); + var parsedBuffer = parser.ParseFrom(new ReadOnlySequence(bytes)); + assert(parsedBuffer); // Load content as multiple segments - parsedMsg = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); - assert(parsedMsg); + parsedBuffer = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); + assert(parsedBuffer); - // Load content as ReadOnlySpan - parsedMsg = parser.ParseFrom(new ReadOnlySpan(bytes)); - assert(parsedMsg); + assert(parsedStream); } public static void AssertReadingMessage(MessageParser parser, byte[] bytes, Action assert) { - var parsedMsg = parser.ParseFrom(bytes); - assert(parsedMsg); + var parsedStream = parser.ParseFrom(bytes); // Load content as single segment - parsedMsg = parser.ParseFrom(new ReadOnlySequence(bytes)); - assert(parsedMsg); + var parsedBuffer = parser.ParseFrom(new ReadOnlySequence(bytes)); + assert(parsedBuffer); // Load content as multiple segments - parsedMsg = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); - assert(parsedMsg); + parsedBuffer = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); + assert(parsedBuffer); - // Load content as ReadOnlySpan - parsedMsg = parser.ParseFrom(new ReadOnlySpan(bytes)); - assert(parsedMsg); + assert(parsedStream); } public static void AssertReadingMessageThrows(MessageParser parser, byte[] bytes) @@ -59,8 +76,6 @@ namespace Google.Protobuf Assert.Throws(() => parser.ParseFrom(bytes)); Assert.Throws(() => parser.ParseFrom(new ReadOnlySequence(bytes))); - - Assert.Throws(() => parser.ParseFrom(new ReadOnlySpan(bytes))); } public static void AssertRoundtrip(MessageParser parser, T message, Action additionalAssert = null) where T : IMessage @@ -68,28 +83,24 @@ namespace Google.Protobuf var bytes = message.ToByteArray(); // also serialize using IBufferWriter and check it leads to the same data - var bufferWriter = new TestArrayBufferWriter(); + var bufferWriter = new ArrayBufferWriter(); message.WriteTo(bufferWriter); Assert.AreEqual(bytes, bufferWriter.WrittenSpan.ToArray(), "Both serialization approaches need to result in the same data."); - var parsedMsg = parser.ParseFrom(bytes); - Assert.AreEqual(message, parsedMsg); - additionalAssert?.Invoke(parsedMsg); - // Load content as single segment - parsedMsg = parser.ParseFrom(new ReadOnlySequence(bytes)); - Assert.AreEqual(message, parsedMsg); - additionalAssert?.Invoke(parsedMsg); + var parsedBuffer = parser.ParseFrom(new ReadOnlySequence(bytes)); + Assert.AreEqual(message, parsedBuffer); + additionalAssert?.Invoke(parsedBuffer); // Load content as multiple segments - parsedMsg = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); - Assert.AreEqual(message, parsedMsg); - additionalAssert?.Invoke(parsedMsg); - - // Load content as ReadOnlySpan - parsedMsg = parser.ParseFrom(new ReadOnlySpan(bytes)); - Assert.AreEqual(message, parsedMsg); - additionalAssert?.Invoke(parsedMsg); + parsedBuffer = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); + Assert.AreEqual(message, parsedBuffer); + additionalAssert?.Invoke(parsedBuffer); + + var parsedStream = parser.ParseFrom(bytes); + + Assert.AreEqual(message, parsedStream); + additionalAssert?.Invoke(parsedStream); } public static void AssertWritingMessage(IMessage message) @@ -101,7 +112,7 @@ namespace Google.Protobuf Assert.AreEqual(message.CalculateSize(), bytes.Length); // serialize using IBufferWriter and check it leads to the same output - var bufferWriter = new TestArrayBufferWriter(); + var bufferWriter = new ArrayBufferWriter(); message.WriteTo(bufferWriter); Assert.AreEqual(bytes, bufferWriter.WrittenSpan.ToArray()); @@ -113,7 +124,8 @@ namespace Google.Protobuf // test for different IBufferWriter.GetSpan() segment sizes for (int blockSize = 1; blockSize < 256; blockSize *= 2) { - var segmentedBufferWriter = new TestArrayBufferWriter { MaxGrowBy = blockSize }; + var segmentedBufferWriter = new ArrayBufferWriter(); + segmentedBufferWriter.MaxGrowBy = blockSize; message.WriteTo(segmentedBufferWriter); Assert.AreEqual(bytes, segmentedBufferWriter.WrittenSpan.ToArray()); } diff --git a/csharp/src/Google.Protobuf.Test/ParsingPrimitivesTest.cs b/csharp/src/Google.Protobuf.Test/ParsingPrimitivesTest.cs deleted file mode 100644 index c1ca6b58f6a1aad53acaf4c7c47c055172bfc383..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf.Test/ParsingPrimitivesTest.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2022 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using NUnit.Framework; -using System; -using System.Linq; - -namespace Google.Protobuf.Test; - -internal class ParsingPrimitivesTest -{ - // Note: test cases use integers rather than bytes as they're easier - // to specify in attributes. - - [Test] - [TestCase("\ufffd", 255)] - [TestCase("A\ufffd", 65, 255)] - [TestCase("A\ufffd\ufffdB", 65, 255, 255, 66)] - // Overlong form of "space" - [TestCase("\ufffd\ufffd", 0xc0, 0xa0)] - public void ReadRawString_NonUtf8(string expectedText, params int[] bytes) - { - var context = CreateContext(bytes); - string text = ParsingPrimitives.ReadRawString(ref context.buffer, ref context.state, bytes.Length); - Assert.AreEqual(expectedText, text); - } - - private static ParseContext CreateContext(int[] bytes) - { - byte[] actualBytes = bytes.Select(b => (byte) b).ToArray(); - ParseContext.Initialize(actualBytes.AsSpan(), out var context); - return context; - } -} diff --git a/csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs b/csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs index 393de179c55e5c9c595d27dcbbaf1286b7775552..46a8c57a78ab3199e1335e2807ca4a7a6d4d48ae 100644 --- a/csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs +++ b/csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; @@ -15,7 +38,7 @@ using UnitTest.Issues.TestProtos; namespace Google.Protobuf.Test { - public class Proto3OptionalTest + class Proto3OptionalTest { [Test] public void OptionalInt32FieldLifecycle() diff --git a/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs b/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs index 27d9cc6753ac4560b6ddab6b43c2c03d102f1f81..f0248ac3c34f8caa4ed9964c0de3114bcf308ada 100644 --- a/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs +++ b/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs @@ -1,15 +1,41 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Buffers; using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Google.Protobuf { @@ -24,7 +50,7 @@ namespace Google.Protobuf if (addEmptySegmentDelimiters) { - segments.Add(Array.Empty()); + segments.Add(new byte[0]); } var currentIndex = 0; @@ -39,7 +65,7 @@ namespace Google.Protobuf if (addEmptySegmentDelimiters) { - segments.Add(Array.Empty()); + segments.Add(new byte[0]); } } diff --git a/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs b/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs index f15da618473f675f3c80515e6adc75210d1d0364..f2d9a2d4e2e40ad897761dce6914c614d899f59e 100644 --- a/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs +++ b/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; @@ -37,17 +60,14 @@ namespace Google.Protobuf var currentAssemblyDir = Path.GetDirectoryName(typeof(RefStructCompatibilityTest).GetTypeInfo().Assembly.Location); var testProtosProjectDir = Path.GetFullPath(Path.Combine(currentAssemblyDir, "..", "..", "..", "..", "Google.Protobuf.Test.TestProtos")); - var testProtosOutputDir = (currentAssemblyDir.Contains("bin/Debug/") || currentAssemblyDir.Contains("bin\\Debug\\")) ? "bin\\Debug\\net462" : "bin\\Release\\net462"; + var testProtosOutputDir = (currentAssemblyDir.Contains("bin/Debug/") || currentAssemblyDir.Contains("bin\\Debug\\")) ? "bin\\Debug\\net45" : "bin\\Release\\net45"; // If "ref struct" types are used in the generated code, compilation with an old compiler will fail with the following error: // "XYZ is obsolete: 'Types with embedded references are not supported in this version of your compiler.'" // We build the code with GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE to avoid the use of ref struct in the generated code. var compatibilityFlag = "-define:GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE"; var sources = "*.cs"; // the generated sources from the TestProtos project - // We suppress CS1691, which flags a warning for the generated line of - // #pragma warning disable 1591, 0612, 3021, 8981 - // because CS8981 is unknown to this version of the compiler. - var args = $"-langversion:3 -nologo -nowarn:1691 -target:library {compatibilityFlag} -reference:{testProtosOutputDir}\\Google.Protobuf.dll -out:{testProtosOutputDir}\\TestProtos.RefStructCompatibilityTest.OldCompiler.dll {sources}"; + var args = $"-langversion:3 -target:library {compatibilityFlag} -reference:{testProtosOutputDir}\\Google.Protobuf.dll -out:{testProtosOutputDir}\\TestProtos.RefStructCompatibilityTest.OldCompiler.dll {sources}"; RunOldCsharpCompilerAndCheckSuccess(args, testProtosProjectDir); } @@ -57,42 +77,43 @@ namespace Google.Protobuf /// /// private void RunOldCsharpCompilerAndCheckSuccess(string args, string workingDirectory) - { - using var process = new Process(); - - // Get the path to the old C# 5 compiler from .NET framework. This approach is not 100% reliable, but works on most machines. - // Alternative way of getting the framework path is System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() - // but it only works with the net45 target. - var oldCsharpCompilerPath = Path.Combine(Environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v4.0.30319", "csc.exe"); - process.StartInfo.FileName = oldCsharpCompilerPath; - process.StartInfo.RedirectStandardOutput = true; - process.StartInfo.RedirectStandardError = true; - process.StartInfo.UseShellExecute = false; - process.StartInfo.Arguments = args; - process.StartInfo.WorkingDirectory = workingDirectory; - - process.OutputDataReceived += (sender, e) => + { + using (var process = new Process()) { - if (e.Data != null) + // Get the path to the old C# 5 compiler from .NET framework. This approach is not 100% reliable, but works on most machines. + // Alternative way of getting the framework path is System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + // but it only works with the net45 target. + var oldCsharpCompilerPath = Path.Combine(Environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v4.0.30319", "csc.exe"); + process.StartInfo.FileName = oldCsharpCompilerPath; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardError = true; + process.StartInfo.UseShellExecute = false; + process.StartInfo.Arguments = args; + process.StartInfo.WorkingDirectory = workingDirectory; + + process.OutputDataReceived += (sender, e) => { - Console.WriteLine(e.Data); - } - }; - process.ErrorDataReceived += (sender, e) => - { - if (e.Data != null) + if (e.Data != null) + { + Console.WriteLine(e.Data); + } + }; + process.ErrorDataReceived += (sender, e) => { - Console.WriteLine(e.Data); - } - }; + if (e.Data != null) + { + Console.WriteLine(e.Data); + } + }; - process.Start(); + process.Start(); - process.BeginErrorReadLine(); - process.BeginOutputReadLine(); + process.BeginErrorReadLine(); + process.BeginOutputReadLine(); - process.WaitForExit(); - Assert.AreEqual(0, process.ExitCode); + process.WaitForExit(); + Assert.AreEqual(0, process.ExitCode); + } } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs index 8ba51c79287fadd85f38b7444f232488ef065a24..68b9bd35074fc56676bd80b7c5fe660823a6741d 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs @@ -1,17 +1,43 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Reflection; +using Google.Protobuf.WellKnownTypes; using NUnit.Framework; using System; +using System.IO; using System.Linq; using UnitTest.Issues.TestProtos; +using static Google.Protobuf.WireFormat; using static UnitTest.Issues.TestProtos.ComplexOptionType2.Types; using static UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Extensions; using static UnitTest.Issues.TestProtos.DummyMessageContainingEnum.Types; @@ -39,7 +65,7 @@ namespace Google.Protobuf.Test.Reflection } else { - v = default; + v = default(E); return false; } }; diff --git a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs index 65a573ae70fb5f05067ccef812ffc3d7b07456b2..d9d56672458cd7a4badb2894f1ef1aed2ec28b20 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs @@ -1,10 +1,33 @@ -#region Copyright notice and license +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2018 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Reflection; @@ -57,19 +80,17 @@ namespace Google.Protobuf.Test.Reflection message.Declaration.LeadingDetachedComments); } + // Note: this test is somewhat brittle; a change earlier in the proto will break it. [Test] public void MessageLocations() { var message = unitTestProto3Descriptor.FindTypeByName("CommentMessage"); Assert.NotNull(message.Declaration); + Assert.AreEqual(389, message.Declaration.StartLine); Assert.AreEqual(1, message.Declaration.StartColumn); + Assert.AreEqual(404, message.Declaration.EndLine); Assert.AreEqual(2, message.Declaration.EndColumn); - - // This is slightly brittle, but allows a reasonable amount of change. - var diff = message.Declaration.EndLine - message.Declaration.StartLine; - Assert.That(diff, Is.GreaterThanOrEqualTo(10)); - Assert.That(diff, Is.LessThanOrEqualTo(50)); } [Test] @@ -148,7 +169,7 @@ namespace Google.Protobuf.Test.Reflection } var byteStrings = descriptorSet.File.Select(f => f.ToByteString()).ToList(); var descriptors = FileDescriptor.BuildFromByteStrings(byteStrings); - return descriptors.Single(d => d.Name == "csharp/protos/unittest_proto3.proto"); + return descriptors.Single(d => d.Name == "unittest_proto3.proto"); } } } diff --git a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs index ba31634524ae978eb1804cb350f12593561de6da..ebb8394d2355680f0d4aa3cf3fe35ca84ee2502d 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.TestProtos; @@ -13,7 +36,6 @@ using ProtobufUnittest; using System; using System.Collections.Generic; using System.Linq; -using UnitTest.Issues.TestProtos; namespace Google.Protobuf.Reflection { @@ -48,31 +70,13 @@ namespace Google.Protobuf.Reflection TestFileDescriptor(converted[2], converted[1], converted[0]); } - [Test] - public void FileDescriptor_BuildFromByteStrings_WithExtensionRegistry() - { - var extension = UnittestCustomOptionsProto3Extensions.MessageOpt1; - - var byteStrings = new[] - { - DescriptorReflection.Descriptor.Proto.ToByteString(), - UnittestCustomOptionsProto3Reflection.Descriptor.Proto.ToByteString() - }; - var registry = new ExtensionRegistry { extension }; - - var descriptor = FileDescriptor.BuildFromByteStrings(byteStrings, registry).Last(); - var message = descriptor.MessageTypes.Single(t => t.Name == nameof(TestMessageWithCustomOptions)); - var extensionValue = message.GetOptions().GetExtension(extension); - Assert.AreEqual(-56, extensionValue); - } - private void TestFileDescriptor(FileDescriptor file, FileDescriptor importedFile, FileDescriptor importedPublicFile) { - Assert.AreEqual("csharp/protos/unittest_proto3.proto", file.Name); + Assert.AreEqual("unittest_proto3.proto", file.Name); Assert.AreEqual("protobuf_unittest3", file.Package); Assert.AreEqual("UnittestProto", file.Proto.Options.JavaOuterClassname); - Assert.AreEqual("csharp/protos/unittest_proto3.proto", file.Proto.Name); + Assert.AreEqual("unittest_proto3.proto", file.Proto.Name); // unittest_proto3.proto doesn't have any public imports, but unittest_import_proto3.proto does. Assert.AreEqual(0, file.PublicDependencies.Count); @@ -100,7 +104,16 @@ namespace Google.Protobuf.Reflection } Assert.AreEqual(10, file.SerializedData[0]); - TestDescriptorToProto(file.ToProto, file.Proto); + } + + [Test] + public void FileDescriptor_NonRootPath() + { + // unittest_proto3.proto used to be in google/protobuf. Now it's in the C#-specific location, + // let's test something that's still in a directory. + FileDescriptor file = UnittestWellKnownTypesReflection.Descriptor; + Assert.AreEqual("google/protobuf/unittest_well_known_types.proto", file.Name); + Assert.AreEqual("protobuf_unittest", file.Package); } [Test] @@ -198,7 +211,6 @@ namespace Google.Protobuf.Reflection { Assert.AreEqual(i, messageType.EnumTypes[i].Index); } - TestDescriptorToProto(messageType.ToProto, messageType.Proto); } [Test] @@ -262,11 +274,6 @@ namespace Google.Protobuf.Reflection // For a field in a regular onoef, ContainingOneof and RealContainingOneof should be the same. Assert.AreEqual("oneof_field", fieldInOneof.ContainingOneof.Name); Assert.AreSame(fieldInOneof.ContainingOneof, fieldInOneof.RealContainingOneof); - - TestDescriptorToProto(primitiveField.ToProto, primitiveField.Proto); - TestDescriptorToProto(enumField.ToProto, enumField.Proto); - TestDescriptorToProto(foreignMessageField.ToProto, foreignMessageField.Proto); - TestDescriptorToProto(fieldInOneof.ToProto, fieldInOneof.Proto); } [Test] @@ -311,8 +318,6 @@ namespace Google.Protobuf.Reflection { Assert.AreEqual(i, enumType.Values[i].Index); } - TestDescriptorToProto(enumType.ToProto, enumType.Proto); - TestDescriptorToProto(nestedType.ToProto, nestedType.Proto); } [Test] @@ -336,7 +341,6 @@ namespace Google.Protobuf.Reflection } CollectionAssert.AreEquivalent(expectedFields, descriptor.Fields); - TestDescriptorToProto(descriptor.ToProto, descriptor.Proto); } [Test] @@ -346,7 +350,6 @@ namespace Google.Protobuf.Reflection Assert.IsNull(descriptor.Parser); Assert.IsNull(descriptor.ClrType); Assert.IsNull(descriptor.Fields[1].Accessor); - TestDescriptorToProto(descriptor.ToProto, descriptor.Proto); } // From TestFieldOrdering: @@ -368,17 +371,11 @@ namespace Google.Protobuf.Reflection { var descriptor = Google.Protobuf.Reflection.FileDescriptor.DescriptorProtoFileDescriptor; Assert.AreEqual("google/protobuf/descriptor.proto", descriptor.Name); - TestDescriptorToProto(descriptor.ToProto, descriptor.Proto); } [Test] public void DescriptorImportingExtensionsFromOldCodeGen() { - if (MethodOptions.Descriptor.FullName != "google.protobuf.MethodOptions") - { - Assert.Ignore("Embedded descriptor for OldExtensions expects google.protobuf reflection package."); - } - // The extension collection includes a null extension. There's not a lot we can do about that // in itself, as the old generator didn't provide us the extension information. var extensions = TestProtos.OldGenerator.OldExtensions2Reflection.Descriptor.Extensions; @@ -417,12 +414,10 @@ namespace Google.Protobuf.Reflection } // Expect no oneof in the original proto3 unit test file to be synthetic. - // (This excludes oneofs with "lazy" in the name, due to internal differences.) foreach (var descriptor in ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes) { - var nonLazyOneofs = descriptor.Oneofs.Where(d => !d.Name.Contains("lazy")).ToList(); - Assert.AreEqual(nonLazyOneofs.Count, descriptor.RealOneofCount); - foreach (var oneof in nonLazyOneofs) + Assert.AreEqual(descriptor.Oneofs.Count, descriptor.RealOneofCount); + foreach (var oneof in descriptor.Oneofs) { Assert.False(oneof.IsSynthetic); } @@ -438,32 +433,5 @@ namespace Google.Protobuf.Reflection } } } - - [Test] - public void OptionRetention() - { - var proto = UnittestRetentionReflection.Descriptor.Proto; - Assert.AreEqual(1, proto.Options.GetExtension( - UnittestRetentionExtensions.PlainOption)); - Assert.AreEqual(2, proto.Options.GetExtension( - UnittestRetentionExtensions.RuntimeRetentionOption)); - // This option has a value of 3 in the .proto file, but we expect it - // to be zeroed out in the generated descriptor since it has source - // retention. - Assert.AreEqual(0, proto.Options.GetExtension( - UnittestRetentionExtensions.SourceRetentionOption)); - } - - private static void TestDescriptorToProto(Func toProtoFunction, IMessage expectedProto) - { - var clone1 = toProtoFunction(); - var clone2 = toProtoFunction(); - Assert.AreNotSame(clone1, clone2); - Assert.AreNotSame(clone1, expectedProto); - Assert.AreNotSame(clone2, expectedProto); - - Assert.AreEqual(clone1, clone2); - Assert.AreEqual(clone1, expectedProto); - } } } diff --git a/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs index 9bc4fc40105d9dde694f332843eaba26c43e64c9..b4dcdabdc75144a882eda47b78bbdd39a2fc463a 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.TestProtos; diff --git a/csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs index 5739cf8a746e0bd4073dbdf0ef642ad7c1b1b01b..5be7ca236117004437786ccba59af190bc663d6d 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.TestProtos; diff --git a/csharp/src/Google.Protobuf.Test/SampleEnum.cs b/csharp/src/Google.Protobuf.Test/SampleEnum.cs index d7bfee175416ad870cab2ff35482b6bb83e5539b..44f232a53ef6d3ddce8f479a332fe63f7b7937e9 100644 --- a/csharp/src/Google.Protobuf.Test/SampleEnum.cs +++ b/csharp/src/Google.Protobuf.Test/SampleEnum.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf diff --git a/csharp/src/Google.Protobuf.Test/SampleMessages.cs b/csharp/src/Google.Protobuf.Test/SampleMessages.cs index 0334664977545d4a90fe13e42a3e5737e1cbb384..03a20d6685a2fd5410dbd2e245180a0aee8e232d 100644 --- a/csharp/src/Google.Protobuf.Test/SampleMessages.cs +++ b/csharp/src/Google.Protobuf.Test/SampleMessages.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf.Test/SampleNaNs.cs b/csharp/src/Google.Protobuf.Test/SampleNaNs.cs index bd87a8f6232a3f26c6ce472c435203a05d8ca02c..34019ac1d2a211d8b66ef440a1b9e0980faf600d 100644 --- a/csharp/src/Google.Protobuf.Test/SampleNaNs.cs +++ b/csharp/src/Google.Protobuf.Test/SampleNaNs.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf.Test/TestCornerCases.cs b/csharp/src/Google.Protobuf.Test/TestCornerCases.cs index 5bab71cd9d345e38d50928615125047e86a0dd82..248f5fa913f2ead57fbd63e7e614cd6881ee0a8e 100644 --- a/csharp/src/Google.Protobuf.Test/TestCornerCases.cs +++ b/csharp/src/Google.Protobuf.Test/TestCornerCases.cs @@ -1,39 +1,62 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using UnitTest.Issues.TestProtos; -using NUnit.Framework; - -namespace Google.Protobuf -{ - public class TestCornerCases - { - [Test] - public void TestRoundTripNegativeEnums() - { - NegativeEnumMessage msg = new NegativeEnumMessage - { - Value = NegativeEnum.MinusOne, - Values = { NegativeEnum.Zero, NegativeEnum.MinusOne, NegativeEnum.FiveBelow }, - PackedValues = { NegativeEnum.Zero, NegativeEnum.MinusOne, NegativeEnum.FiveBelow } - }; - - Assert.AreEqual(58, msg.CalculateSize()); - - byte[] bytes = new byte[58]; - CodedOutputStream output = new CodedOutputStream(bytes); - - msg.WriteTo(output); - Assert.AreEqual(0, output.SpaceLeft); - - NegativeEnumMessage copy = NegativeEnumMessage.Parser.ParseFrom(bytes); - Assert.AreEqual(msg, copy); - } - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using UnitTest.Issues.TestProtos; +using NUnit.Framework; + +namespace Google.Protobuf +{ + public class TestCornerCases + { + [Test] + public void TestRoundTripNegativeEnums() + { + NegativeEnumMessage msg = new NegativeEnumMessage + { + Value = NegativeEnum.MinusOne, + Values = { NegativeEnum.Zero, NegativeEnum.MinusOne, NegativeEnum.FiveBelow }, + PackedValues = { NegativeEnum.Zero, NegativeEnum.MinusOne, NegativeEnum.FiveBelow } + }; + + Assert.AreEqual(58, msg.CalculateSize()); + + byte[] bytes = new byte[58]; + CodedOutputStream output = new CodedOutputStream(bytes); + + msg.WriteTo(output); + Assert.AreEqual(0, output.SpaceLeft); + + NegativeEnumMessage copy = NegativeEnumMessage.Parser.ParseFrom(bytes); + Assert.AreEqual(msg, copy); + } + } +} diff --git a/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs b/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs index f10ebbb66ce37322d517f5f1c28950a7aa691d1a..15debc1b6c8e493ce8804e91a92829d928dfd8cd 100644 --- a/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs +++ b/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs @@ -1,14 +1,39 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; using System.IO; using Google.Protobuf.TestProtos; +using Proto2 = Google.Protobuf.TestProtos.Proto2; using NUnit.Framework; namespace Google.Protobuf @@ -102,7 +127,8 @@ namespace Google.Protobuf public void TestClone(IMessage message) { var emptyMessage = new TestEmptyMessage(); - TestEmptyMessage otherEmptyMessage = emptyMessage.Clone(); + var otherEmptyMessage = new TestEmptyMessage(); + otherEmptyMessage = emptyMessage.Clone(); Assert.AreEqual(emptyMessage.CalculateSize(), otherEmptyMessage.CalculateSize()); Assert.AreEqual(emptyMessage.ToByteArray(), otherEmptyMessage.ToByteArray()); @@ -112,29 +138,6 @@ namespace Google.Protobuf Assert.AreEqual(message.ToByteArray(), otherEmptyMessage.ToByteArray()); } - [Test] - public void TestClone_LengthDelimited() - { - var unknownVarintField = new UnknownField(); - unknownVarintField.AddVarint(99); - - var unknownLengthDelimitedField1 = new UnknownField(); - unknownLengthDelimitedField1.AddLengthDelimited(ByteString.CopyFromUtf8("some data")); - - var unknownLengthDelimitedField2 = new UnknownField(); - unknownLengthDelimitedField2.AddLengthDelimited(ByteString.CopyFromUtf8("some more data")); - - var destUnknownFieldSet = new UnknownFieldSet(); - destUnknownFieldSet.AddOrReplaceField(997, unknownVarintField); - destUnknownFieldSet.AddOrReplaceField(999, unknownLengthDelimitedField1); - destUnknownFieldSet.AddOrReplaceField(999, unknownLengthDelimitedField2); - - var clone = UnknownFieldSet.Clone(destUnknownFieldSet); - - Assert.IsTrue(clone.HasField(997)); - Assert.IsTrue(clone.HasField(999)); - } - [Test] [TestCaseSource(typeof(Data), "Messages")] public void TestDiscardUnknownFields(IMessage message) @@ -143,13 +146,13 @@ namespace Google.Protobuf byte[] data = message.ToByteArray(); int fullSize = message.CalculateSize(); - void AssertEmpty(IMessage msg) + Action assertEmpty = msg => { Assert.AreEqual(0, msg.CalculateSize()); Assert.AreEqual(goldenEmptyMessage, msg); - } + }; - void AssertFull(IMessage msg) => Assert.AreEqual(fullSize, msg.CalculateSize()); + Action assertFull = msg => Assert.AreEqual(fullSize, msg.CalculateSize()); // Test the behavior of the parsers with and without discarding, both generic and non-generic. MessageParser retainingParser1 = TestEmptyMessage.Parser; @@ -158,28 +161,28 @@ namespace Google.Protobuf MessageParser discardingParser2 = retainingParser2.WithDiscardUnknownFields(true); // Test parse from byte[] - MessageParsingHelpers.AssertReadingMessage(retainingParser1, data, m => AssertFull(m)); - MessageParsingHelpers.AssertReadingMessage(retainingParser2, data, m => AssertFull(m)); - MessageParsingHelpers.AssertReadingMessage(discardingParser1, data, m => AssertEmpty(m)); - MessageParsingHelpers.AssertReadingMessage(discardingParser2, data, m => AssertEmpty(m)); + MessageParsingHelpers.AssertReadingMessage(retainingParser1, data, m => assertFull(m)); + MessageParsingHelpers.AssertReadingMessage(retainingParser2, data, m => assertFull(m)); + MessageParsingHelpers.AssertReadingMessage(discardingParser1, data, m => assertEmpty(m)); + MessageParsingHelpers.AssertReadingMessage(discardingParser2, data, m => assertEmpty(m)); // Test parse from byte[] with offset - AssertFull(retainingParser1.ParseFrom(data, 0, data.Length)); - AssertFull(retainingParser2.ParseFrom(data, 0, data.Length)); - AssertEmpty(discardingParser1.ParseFrom(data, 0, data.Length)); - AssertEmpty(discardingParser2.ParseFrom(data, 0, data.Length)); + assertFull(retainingParser1.ParseFrom(data, 0, data.Length)); + assertFull(retainingParser2.ParseFrom(data, 0, data.Length)); + assertEmpty(discardingParser1.ParseFrom(data, 0, data.Length)); + assertEmpty(discardingParser2.ParseFrom(data, 0, data.Length)); // Test parse from CodedInputStream - AssertFull(retainingParser1.ParseFrom(new CodedInputStream(data))); - AssertFull(retainingParser2.ParseFrom(new CodedInputStream(data))); - AssertEmpty(discardingParser1.ParseFrom(new CodedInputStream(data))); - AssertEmpty(discardingParser2.ParseFrom(new CodedInputStream(data))); + assertFull(retainingParser1.ParseFrom(new CodedInputStream(data))); + assertFull(retainingParser2.ParseFrom(new CodedInputStream(data))); + assertEmpty(discardingParser1.ParseFrom(new CodedInputStream(data))); + assertEmpty(discardingParser2.ParseFrom(new CodedInputStream(data))); // Test parse from Stream - AssertFull(retainingParser1.ParseFrom(new MemoryStream(data))); - AssertFull(retainingParser2.ParseFrom(new MemoryStream(data))); - AssertEmpty(discardingParser1.ParseFrom(new MemoryStream(data))); - AssertEmpty(discardingParser2.ParseFrom(new MemoryStream(data))); + assertFull(retainingParser1.ParseFrom(new MemoryStream(data))); + assertFull(retainingParser2.ParseFrom(new MemoryStream(data))); + assertEmpty(discardingParser1.ParseFrom(new MemoryStream(data))); + assertEmpty(discardingParser2.ParseFrom(new MemoryStream(data))); } [Test] diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs index f09045c73ecb057b69a31df229e881134f850dd5..4b9a56939540dcecf2fbef8bee7a7c80f37a5ad4 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs @@ -1,17 +1,37 @@ -#region Copyright notice and license +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion -using Google.Protobuf.Reflection; using Google.Protobuf.TestProtos; using NUnit.Framework; -using System.Linq; -using UnitTest.Issues.TestProtos; namespace Google.Protobuf.WellKnownTypes { @@ -103,6 +123,7 @@ namespace Google.Protobuf.WellKnownTypes [TestCase("foobar", "")] public void GetTypeName(string typeUrl, string expectedTypeName) { + var any = new Any { TypeUrl = typeUrl }; Assert.AreEqual(expectedTypeName, Any.GetTypeName(typeUrl)); } @@ -121,40 +142,16 @@ namespace Google.Protobuf.WellKnownTypes } [Test] - public void IsWrongType() - { - var any = Any.Pack(SampleMessages.CreateFullTestAllTypes()); - Assert.False(any.Is(TestOneof.Descriptor)); - } - - [Test] - public void IsRightType() - { - var any = Any.Pack(SampleMessages.CreateFullTestAllTypes()); - Assert.True(any.Is(TestAllTypes.Descriptor)); + public void IsWrongType() + { + var any = Any.Pack(SampleMessages.CreateFullTestAllTypes()); + Assert.False(any.Is(TestOneof.Descriptor)); } - [Test] - public void Unpack_TypeRegistry() - { - var messages = new IMessage[] - { - SampleMessages.CreateFullTestAllTypes(), - new TestWellKnownTypes { BoolField = true }, - new MoreString { Data = { "x" } }, - new MoreBytes { Data = ByteString.CopyFromUtf8("xyz") }, - new ReservedNames { Descriptor_ = 10 } - }; - var anyMessages = messages.Select(Any.Pack); - - // The type registry handles the first four of the packed messages, but not the final one. - var registry = TypeRegistry.FromFiles( - UnittestWellKnownTypesReflection.Descriptor, - UnittestProto3Reflection.Descriptor); - var unpacked = anyMessages.Select(any => any.Unpack(registry)).ToList(); - var expected = (IMessage[]) messages.Clone(); - expected[4] = null; - Assert.AreEqual(expected, unpacked); + public void IsRightType() + { + var any = Any.Pack(SampleMessages.CreateFullTestAllTypes()); + Assert.True(any.Is(TestAllTypes.Descriptor)); } } } diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs index 13e5a3f217c9a5d19af5cf4ff6258cd01dc96895..141faf80e0960c3a1bd6187bb60a69d6b400b57d 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; @@ -105,38 +128,5 @@ namespace Google.Protobuf.WellKnownTypes var duration = new Duration { Seconds = 1, Nanos = -1 }; Assert.AreEqual("{ \"@warning\": \"Invalid Duration\", \"seconds\": \"1\", \"nanos\": -1 }", duration.ToString()); } - - [Test] - public void Comparability() - { - Duration[] durationsInExpectedSortOrder = - { - null, - new Duration { Seconds = -10, Nanos = -10 }, - new Duration { Seconds = -10, Nanos = -1 }, - new Duration { Seconds = -1, Nanos = -10 }, - new Duration { Seconds = -1, Nanos = -1 }, - new Duration(), - new Duration { Seconds = 1, Nanos = 1 }, - new Duration { Seconds = 1, Nanos = 10 }, - new Duration { Seconds = 10, Nanos = 1 }, - new Duration { Seconds = 10, Nanos = 10 } - }; - - for (int i = 0; i < durationsInExpectedSortOrder.Length; i++) - { - var target = durationsInExpectedSortOrder[i]; - if (target is null) - { - continue; - } - for (int j = 0; j < durationsInExpectedSortOrder.Length; j++) - { - var expectedResult = Math.Sign(i - j); - var actualResult = target.CompareTo(durationsInExpectedSortOrder[j]); - Assert.AreEqual(expectedResult, actualResult); - } - } - } } } diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs index fb3fee451cf866cf8bb767880fbda4fdedbf62f8..5dc5035703eb03322b35357ec1cd9751b29776d7 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2016 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs index 258452dd6924db225d11c445505bf4a09e73bc8c..ffc60419242d70bfd4e0c70bc8b5e2621d9ff621 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using NUnit.Framework; diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs index 5876a3eb8adbbf3c62b444cb86000acb44987089..5b0e5e8fc1cb247fb1fa837e5525237e70c23711 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf.Test/WritingPrimitivesTest.cs b/csharp/src/Google.Protobuf.Test/WritingPrimitivesTest.cs deleted file mode 100644 index 5f31447964f09237727e774de1e14c3d78931742..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf.Test/WritingPrimitivesTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2022 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Google.Protobuf.Test; - -internal class WritingPrimitivesTest -{ - [Test] - public void WriteRawString_IllFormedUnicodeString() - { - // See https://codeblog.jonskeet.uk/2014/11/07/when-is-a-string-not-a-string/ - char c1 = '\u0058'; - char c2 = '\ud800'; - char c3 = '\u0059'; - string text = new string(new[] { c1, c2, c3 }); - Span buffer = new byte[10]; - WriteContext.Initialize(ref buffer, out var context); - WritingPrimitives.WriteString(ref context.buffer, ref context.state, text); - - // The high surrogate is written out in a "raw" form, surrounded by the ASCII - // characters. - byte[] expectedBytes = { 0x5, 0x58, 0xef, 0xbf, 0xbd, 0x59 }; - Assert.AreEqual(expectedBytes, buffer.Slice(0, context.state.position).ToArray()); - } -} diff --git a/csharp/src/Google.Protobuf.Test/testprotos.pb b/csharp/src/Google.Protobuf.Test/testprotos.pb index 9527755cf1fddb69d7583bcd5e67859c490a0419..1569c1e8c81ab6054c606aa85d9f972c433614d1 100644 Binary files a/csharp/src/Google.Protobuf.Test/testprotos.pb and b/csharp/src/Google.Protobuf.Test/testprotos.pb differ diff --git a/csharp/src/Google.Protobuf.sln b/csharp/src/Google.Protobuf.sln index e5f38a64e7d2786cc6b59fbc4bb76f9ad0ad9f7a..b571e53c12eb1b3d74b2ac70db34704f5dbf1df9 100644 --- a/csharp/src/Google.Protobuf.sln +++ b/csharp/src/Google.Protobuf.sln @@ -1,54 +1,60 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26114.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AddressBook", "AddressBook\AddressBook.csproj", "{AFB63919-1E05-43B4-802A-8FB8C9B2F463}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf", "Google.Protobuf\Google.Protobuf.csproj", "{9B576380-726D-4142-8238-60A43AB0E35A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf.Test", "Google.Protobuf.Test\Google.Protobuf.Test.csproj", "{580EB013-D3C7-4578-B845-015F4A3B0591}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf.Conformance", "Google.Protobuf.Conformance\Google.Protobuf.Conformance.csproj", "{DDDC055B-E185-4181-BAB0-072F0F984569}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf.JsonDump", "Google.Protobuf.JsonDump\Google.Protobuf.JsonDump.csproj", "{9695E08F-9829-497D-B95C-B38F28D48690}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Protobuf.Test.TestProtos", "Google.Protobuf.Test.TestProtos\Google.Protobuf.Test.TestProtos.csproj", "{ADF24BEB-A318-4530-8448-356B72B820EA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Release|Any CPU.Build.0 = Release|Any CPU - {9B576380-726D-4142-8238-60A43AB0E35A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B576380-726D-4142-8238-60A43AB0E35A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B576380-726D-4142-8238-60A43AB0E35A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B576380-726D-4142-8238-60A43AB0E35A}.Release|Any CPU.Build.0 = Release|Any CPU - {580EB013-D3C7-4578-B845-015F4A3B0591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {580EB013-D3C7-4578-B845-015F4A3B0591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {580EB013-D3C7-4578-B845-015F4A3B0591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {580EB013-D3C7-4578-B845-015F4A3B0591}.Release|Any CPU.Build.0 = Release|Any CPU - {DDDC055B-E185-4181-BAB0-072F0F984569}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DDDC055B-E185-4181-BAB0-072F0F984569}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DDDC055B-E185-4181-BAB0-072F0F984569}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DDDC055B-E185-4181-BAB0-072F0F984569}.Release|Any CPU.Build.0 = Release|Any CPU - {9695E08F-9829-497D-B95C-B38F28D48690}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9695E08F-9829-497D-B95C-B38F28D48690}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9695E08F-9829-497D-B95C-B38F28D48690}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9695E08F-9829-497D-B95C-B38F28D48690}.Release|Any CPU.Build.0 = Release|Any CPU - {ADF24BEB-A318-4530-8448-356B72B820EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADF24BEB-A318-4530-8448-356B72B820EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADF24BEB-A318-4530-8448-356B72B820EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADF24BEB-A318-4530-8448-356B72B820EA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7B06C87B-83E1-4F5F-A0DD-6E9AFAC03DAC} - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26114.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AddressBook", "AddressBook\AddressBook.csproj", "{AFB63919-1E05-43B4-802A-8FB8C9B2F463}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf", "Google.Protobuf\Google.Protobuf.csproj", "{9B576380-726D-4142-8238-60A43AB0E35A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf.Test", "Google.Protobuf.Test\Google.Protobuf.Test.csproj", "{580EB013-D3C7-4578-B845-015F4A3B0591}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf.Conformance", "Google.Protobuf.Conformance\Google.Protobuf.Conformance.csproj", "{DDDC055B-E185-4181-BAB0-072F0F984569}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Protobuf.JsonDump", "Google.Protobuf.JsonDump\Google.Protobuf.JsonDump.csproj", "{9695E08F-9829-497D-B95C-B38F28D48690}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Protobuf.Benchmarks", "Google.Protobuf.Benchmarks\Google.Protobuf.Benchmarks.csproj", "{D25E4804-4DEA-45AB-9F8C-BA4DBD8E5A07}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Protobuf.Test.TestProtos", "Google.Protobuf.Test.TestProtos\Google.Protobuf.Test.TestProtos.csproj", "{ADF24BEB-A318-4530-8448-356B72B820EA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AFB63919-1E05-43B4-802A-8FB8C9B2F463}.Release|Any CPU.Build.0 = Release|Any CPU + {9B576380-726D-4142-8238-60A43AB0E35A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B576380-726D-4142-8238-60A43AB0E35A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B576380-726D-4142-8238-60A43AB0E35A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B576380-726D-4142-8238-60A43AB0E35A}.Release|Any CPU.Build.0 = Release|Any CPU + {580EB013-D3C7-4578-B845-015F4A3B0591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {580EB013-D3C7-4578-B845-015F4A3B0591}.Debug|Any CPU.Build.0 = Debug|Any CPU + {580EB013-D3C7-4578-B845-015F4A3B0591}.Release|Any CPU.ActiveCfg = Release|Any CPU + {580EB013-D3C7-4578-B845-015F4A3B0591}.Release|Any CPU.Build.0 = Release|Any CPU + {DDDC055B-E185-4181-BAB0-072F0F984569}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DDDC055B-E185-4181-BAB0-072F0F984569}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DDDC055B-E185-4181-BAB0-072F0F984569}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DDDC055B-E185-4181-BAB0-072F0F984569}.Release|Any CPU.Build.0 = Release|Any CPU + {9695E08F-9829-497D-B95C-B38F28D48690}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9695E08F-9829-497D-B95C-B38F28D48690}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9695E08F-9829-497D-B95C-B38F28D48690}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9695E08F-9829-497D-B95C-B38F28D48690}.Release|Any CPU.Build.0 = Release|Any CPU + {D25E4804-4DEA-45AB-9F8C-BA4DBD8E5A07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D25E4804-4DEA-45AB-9F8C-BA4DBD8E5A07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D25E4804-4DEA-45AB-9F8C-BA4DBD8E5A07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D25E4804-4DEA-45AB-9F8C-BA4DBD8E5A07}.Release|Any CPU.Build.0 = Release|Any CPU + {ADF24BEB-A318-4530-8448-356B72B820EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ADF24BEB-A318-4530-8448-356B72B820EA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADF24BEB-A318-4530-8448-356B72B820EA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ADF24BEB-A318-4530-8448-356B72B820EA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7B06C87B-83E1-4F5F-A0DD-6E9AFAC03DAC} + EndGlobalSection +EndGlobal diff --git a/csharp/src/Google.Protobuf/ByteArray.cs b/csharp/src/Google.Protobuf/ByteArray.cs index c8adaf7dfca321d8a2cd8a0c388a2e8ce8fd46cf..69b6ef8d634a12b1b5c5e56ebeeaf16cedcd820c 100644 --- a/csharp/src/Google.Protobuf/ByteArray.cs +++ b/csharp/src/Google.Protobuf/ByteArray.cs @@ -1,56 +1,79 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; - -namespace Google.Protobuf -{ - /// - /// Provides a utility routine to copy small arrays much more quickly than Buffer.BlockCopy - /// - internal static class ByteArray - { - /// - /// The threshold above which you should use Buffer.BlockCopy rather than ByteArray.Copy - /// - private const int CopyThreshold = 12; - - /// - /// Determines which copy routine to use based on the number of bytes to be copied. - /// - internal static void Copy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count) - { - if (count > CopyThreshold) - { - Buffer.BlockCopy(src, srcOffset, dst, dstOffset, count); - } - else - { - int stop = srcOffset + count; - for (int i = srcOffset; i < stop; i++) - { - dst[dstOffset++] = src[i]; - } - } - } - - /// - /// Reverses the order of bytes in the array - /// - internal static void Reverse(byte[] bytes) - { - for (int first = 0, last = bytes.Length - 1; first < last; first++, last--) - { - byte temp = bytes[first]; - bytes[first] = bytes[last]; - bytes[last] = temp; - } - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; + +namespace Google.Protobuf +{ + /// + /// Provides a utility routine to copy small arrays much more quickly than Buffer.BlockCopy + /// + internal static class ByteArray + { + /// + /// The threshold above which you should use Buffer.BlockCopy rather than ByteArray.Copy + /// + private const int CopyThreshold = 12; + + /// + /// Determines which copy routine to use based on the number of bytes to be copied. + /// + internal static void Copy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count) + { + if (count > CopyThreshold) + { + Buffer.BlockCopy(src, srcOffset, dst, dstOffset, count); + } + else + { + int stop = srcOffset + count; + for (int i = srcOffset; i < stop; i++) + { + dst[dstOffset++] = src[i]; + } + } + } + + /// + /// Reverses the order of bytes in the array + /// + internal static void Reverse(byte[] bytes) + { + for (int first = 0, last = bytes.Length - 1; first < last; first++, last--) + { + byte temp = bytes[first]; + bytes[first] = bytes[last]; + bytes[last] = temp; + } + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/ByteString.cs b/csharp/src/Google.Protobuf/ByteString.cs index fc5d925fa7be2f46a5170a1f6c01b1aff4cff143..d893602095fb4000001fba23d07bc59e1ff01b1b 100644 --- a/csharp/src/Google.Protobuf/ByteString.cs +++ b/csharp/src/Google.Protobuf/ByteString.cs @@ -1,420 +1,434 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Security; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace Google.Protobuf -{ - /// - /// Immutable array of bytes. - /// - [SecuritySafeCritical] - [DebuggerDisplay("Length = {Length}")] - [DebuggerTypeProxy(typeof(ByteStringDebugView))] - public sealed class ByteString : IEnumerable, IEquatable - { - private static readonly ByteString empty = new ByteString(new byte[0]); - - private readonly ReadOnlyMemory bytes; - - /// - /// Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. - /// - internal static ByteString AttachBytes(ReadOnlyMemory bytes) - { - return new ByteString(bytes); - } - - /// - /// Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. - /// This method encapsulates converting array to memory. Reduces need for SecuritySafeCritical - /// in .NET Framework. - /// - internal static ByteString AttachBytes(byte[] bytes) - { - return AttachBytes(bytes.AsMemory()); - } - - /// - /// Constructs a new ByteString from the given memory. The memory is - /// *not* copied, and must not be modified after this constructor is called. - /// - private ByteString(ReadOnlyMemory bytes) - { - this.bytes = bytes; - } - - /// - /// Returns an empty ByteString. - /// - public static ByteString Empty - { - get { return empty; } - } - - /// - /// Returns the length of this ByteString in bytes. - /// - public int Length - { - get { return bytes.Length; } - } - - /// - /// Returns true if this byte string is empty, false otherwise. - /// - public bool IsEmpty - { - get { return Length == 0; } - } - - /// - /// Provides read-only access to the data of this . - /// No data is copied so this is the most efficient way of accessing. - /// - public ReadOnlySpan Span - { - get { return bytes.Span; } - } - - /// - /// Provides read-only access to the data of this . - /// No data is copied so this is the most efficient way of accessing. - /// - public ReadOnlyMemory Memory - { - get { return bytes; } - } - - /// - /// Converts this into a byte array. - /// - /// The data is copied - changes to the returned array will not be reflected in this ByteString. - /// A byte array with the same data as this ByteString. - public byte[] ToByteArray() - { - return bytes.ToArray(); - } - - /// - /// Converts this into a standard base64 representation. - /// - /// A base64 representation of this ByteString. - public string ToBase64() - { - if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment)) - { - // Fast path. ByteString was created with an array, so pass the underlying array. - return Convert.ToBase64String(segment.Array, segment.Offset, segment.Count); - } - else - { - // Slow path. BytesString is not an array. Convert memory and pass result to ToBase64String. - return Convert.ToBase64String(bytes.ToArray()); - } - } - - /// - /// Constructs a from the Base64 Encoded String. - /// - public static ByteString FromBase64(string bytes) - { - // By handling the empty string explicitly, we not only optimize but we fix a - // problem on CF 2.0. See issue 61 for details. - return bytes == "" ? Empty : new ByteString(Convert.FromBase64String(bytes)); - } - - /// - /// Constructs a from data in the given stream, synchronously. - /// - /// If successful, will be read completely, from the position - /// at the start of the call. - /// The stream to copy into a ByteString. - /// A ByteString with content read from the given stream. - public static ByteString FromStream(Stream stream) - { - ProtoPreconditions.CheckNotNull(stream, nameof(stream)); - int capacity = stream.CanSeek ? checked((int) (stream.Length - stream.Position)) : 0; - var memoryStream = new MemoryStream(capacity); - stream.CopyTo(memoryStream); -#if NETSTANDARD1_1 || NETSTANDARD2_0 - byte[] bytes = memoryStream.ToArray(); -#else - // Avoid an extra copy if we can. - byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray(); -#endif - return AttachBytes(bytes); - } - - /// - /// Constructs a from data in the given stream, asynchronously. - /// - /// If successful, will be read completely, from the position - /// at the start of the call. - /// The stream to copy into a ByteString. - /// The cancellation token to use when reading from the stream, if any. - /// A ByteString with content read from the given stream. - public static Task FromStreamAsync(Stream stream, CancellationToken cancellationToken = default) - { - ProtoPreconditions.CheckNotNull(stream, nameof(stream)); - return ByteStringAsync.FromStreamAsyncCore(stream, cancellationToken); - } - - /// - /// Constructs a from the given array. The contents - /// are copied, so further modifications to the array will not - /// be reflected in the returned ByteString. - /// This method can also be invoked in ByteString.CopyFrom(0xaa, 0xbb, ...) form - /// which is primarily useful for testing. - /// - public static ByteString CopyFrom(params byte[] bytes) - { - return new ByteString((byte[]) bytes.Clone()); - } - - /// - /// Constructs a from a portion of a byte array. - /// - public static ByteString CopyFrom(byte[] bytes, int offset, int count) - { - byte[] portion = new byte[count]; - ByteArray.Copy(bytes, offset, portion, 0, count); - return new ByteString(portion); - } - - /// - /// Constructs a from a read only span. The contents - /// are copied, so further modifications to the span will not - /// be reflected in the returned . - /// - public static ByteString CopyFrom(ReadOnlySpan bytes) - { - return new ByteString(bytes.ToArray()); - } - - /// - /// Creates a new by encoding the specified text with - /// the given encoding. - /// - public static ByteString CopyFrom(string text, Encoding encoding) - { - return new ByteString(encoding.GetBytes(text)); - } - - /// - /// Creates a new by encoding the specified text in UTF-8. - /// - public static ByteString CopyFromUtf8(string text) - { - return CopyFrom(text, Encoding.UTF8); - } - - /// - /// Returns the byte at the given index. - /// - public byte this[int index] - { - get { return bytes.Span[index]; } - } - - /// - /// Converts this into a string by applying the given encoding. - /// - /// - /// This method should only be used to convert binary data which was the result of encoding - /// text with the given encoding. - /// - /// The encoding to use to decode the binary data into text. - /// The result of decoding the binary data with the given decoding. - public string ToString(Encoding encoding) - { - if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment)) - { - // Fast path. ByteString was created with an array. - return encoding.GetString(segment.Array, segment.Offset, segment.Count); - } - else - { - // Slow path. BytesString is not an array. Convert memory and pass result to GetString. - // TODO: Consider using GetString overload that takes a pointer. - byte[] array = bytes.ToArray(); - return encoding.GetString(array, 0, array.Length); - } - } - - /// - /// Converts this into a string by applying the UTF-8 encoding. - /// - /// - /// This method should only be used to convert binary data which was the result of encoding - /// text with UTF-8. - /// - /// The result of decoding the binary data with the given decoding. - public string ToStringUtf8() - { - return ToString(Encoding.UTF8); - } - - /// - /// Returns an iterator over the bytes in this . - /// - /// An iterator over the bytes in this object. - [SecuritySafeCritical] - public IEnumerator GetEnumerator() - { - return MemoryMarshal.ToEnumerable(bytes).GetEnumerator(); - } - - /// - /// Returns an iterator over the bytes in this . - /// - /// An iterator over the bytes in this object. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - /// - /// Creates a CodedInputStream from this ByteString's data. - /// - public CodedInputStream CreateCodedInput() - { - // We trust CodedInputStream not to reveal the provided byte array or modify it - if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment) && segment.Count == bytes.Length) - { - // Fast path. ByteString was created with a complete array. - return new CodedInputStream(segment.Array, segment.Offset, segment.Count); - } - else - { - // Slow path. BytesString is not an array, or is a slice of an array. - // Convert memory and pass result to WriteRawBytes. - return new CodedInputStream(bytes.ToArray()); - } - } - - /// - /// Compares two byte strings for equality. - /// - /// The first byte string to compare. - /// The second byte string to compare. - /// true if the byte strings are equal; false otherwise. - public static bool operator ==(ByteString lhs, ByteString rhs) - { - if (ReferenceEquals(lhs, rhs)) - { - return true; - } - if (lhs is null || rhs is null) - { - return false; - } - - return lhs.bytes.Span.SequenceEqual(rhs.bytes.Span); - } - - /// - /// Compares two byte strings for inequality. - /// - /// The first byte string to compare. - /// The second byte string to compare. - /// false if the byte strings are equal; true otherwise. - public static bool operator !=(ByteString lhs, ByteString rhs) - { - return !(lhs == rhs); - } - - /// - /// Compares this byte string with another object. - /// - /// The object to compare this with. - /// true if refers to an equal ; false otherwise. - [SecuritySafeCritical] - public override bool Equals(object obj) - { - return this == (obj as ByteString); - } - - /// - /// Returns a hash code for this object. Two equal byte strings - /// will return the same hash code. - /// - /// A hash code for this object. - [SecuritySafeCritical] - public override int GetHashCode() - { - ReadOnlySpan b = bytes.Span; - - int ret = 23; - for (int i = 0; i < b.Length; i++) - { - ret = (ret * 31) + b[i]; - } - return ret; - } - - /// - /// Compares this byte string with another. - /// - /// The to compare this with. - /// true if refers to an equal byte string; false otherwise. - public bool Equals(ByteString other) - { - return this == other; - } - - /// - /// Copies the entire byte array to the destination array provided at the offset specified. - /// - public void CopyTo(byte[] array, int position) - { - bytes.CopyTo(array.AsMemory(position)); - } - - /// - /// Writes the entire byte array to the provided stream - /// - public void WriteTo(Stream outputStream) - { - if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment)) - { - // Fast path. ByteString was created with an array, so pass the underlying array. - outputStream.Write(segment.Array, segment.Offset, segment.Count); - } - else - { - // Slow path. BytesString is not an array. Convert memory and pass result to WriteRawBytes. - var array = bytes.ToArray(); - outputStream.Write(array, 0, array.Length); - } - } - - private sealed class ByteStringDebugView - { - private readonly ByteString data; - - public ByteStringDebugView(ByteString data) - { - this.data = data; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public byte[] Items => data.bytes.ToArray(); - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Security; +using System.Text; +#if !NET35 +using System.Threading; +using System.Threading.Tasks; +#endif +#if NET35 +using Google.Protobuf.Compatibility; +#endif + +namespace Google.Protobuf +{ + /// + /// Immutable array of bytes. + /// + public sealed class ByteString : IEnumerable, IEquatable + { + private static readonly ByteString empty = new ByteString(new byte[0]); + + private readonly byte[] bytes; + + /// + /// Unsafe operations that can cause IO Failure and/or other catastrophic side-effects. + /// + internal static class Unsafe + { + /// + /// Constructs a new ByteString from the given byte array. The array is + /// *not* copied, and must not be modified after this constructor is called. + /// + internal static ByteString FromBytes(byte[] bytes) + { + return new ByteString(bytes); + } + } + + /// + /// Internal use only. Ensure that the provided array is not mutated and belongs to this instance. + /// + internal static ByteString AttachBytes(byte[] bytes) + { + return new ByteString(bytes); + } + + /// + /// Constructs a new ByteString from the given byte array. The array is + /// *not* copied, and must not be modified after this constructor is called. + /// + private ByteString(byte[] bytes) + { + this.bytes = bytes; + } + + /// + /// Returns an empty ByteString. + /// + public static ByteString Empty + { + get { return empty; } + } + + /// + /// Returns the length of this ByteString in bytes. + /// + public int Length + { + get { return bytes.Length; } + } + + /// + /// Returns true if this byte string is empty, false otherwise. + /// + public bool IsEmpty + { + get { return Length == 0; } + } + +#if GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY + /// + /// Provides read-only access to the data of this . + /// No data is copied so this is the most efficient way of accessing. + /// + public ReadOnlySpan Span + { + [SecuritySafeCritical] + get + { + return new ReadOnlySpan(bytes); + } + } + + /// + /// Provides read-only access to the data of this . + /// No data is copied so this is the most efficient way of accessing. + /// + public ReadOnlyMemory Memory + { + [SecuritySafeCritical] + get + { + return new ReadOnlyMemory(bytes); + } + } +#endif + + /// + /// Converts this into a byte array. + /// + /// The data is copied - changes to the returned array will not be reflected in this ByteString. + /// A byte array with the same data as this ByteString. + public byte[] ToByteArray() + { + return (byte[]) bytes.Clone(); + } + + /// + /// Converts this into a standard base64 representation. + /// + /// A base64 representation of this ByteString. + public string ToBase64() + { + return Convert.ToBase64String(bytes); + } + + /// + /// Constructs a from the Base64 Encoded String. + /// + public static ByteString FromBase64(string bytes) + { + // By handling the empty string explicitly, we not only optimize but we fix a + // problem on CF 2.0. See issue 61 for details. + return bytes == "" ? Empty : new ByteString(Convert.FromBase64String(bytes)); + } + + /// + /// Constructs a from data in the given stream, synchronously. + /// + /// If successful, will be read completely, from the position + /// at the start of the call. + /// The stream to copy into a ByteString. + /// A ByteString with content read from the given stream. + public static ByteString FromStream(Stream stream) + { + ProtoPreconditions.CheckNotNull(stream, nameof(stream)); + int capacity = stream.CanSeek ? checked((int) (stream.Length - stream.Position)) : 0; + var memoryStream = new MemoryStream(capacity); + stream.CopyTo(memoryStream); +#if NETSTANDARD1_1 || NETSTANDARD2_0 + byte[] bytes = memoryStream.ToArray(); +#else + // Avoid an extra copy if we can. + byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray(); +#endif + return AttachBytes(bytes); + } + +#if !NET35 + /// + /// Constructs a from data in the given stream, asynchronously. + /// + /// If successful, will be read completely, from the position + /// at the start of the call. + /// The stream to copy into a ByteString. + /// The cancellation token to use when reading from the stream, if any. + /// A ByteString with content read from the given stream. + public async static Task FromStreamAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) + { + ProtoPreconditions.CheckNotNull(stream, nameof(stream)); + int capacity = stream.CanSeek ? checked((int) (stream.Length - stream.Position)) : 0; + var memoryStream = new MemoryStream(capacity); + // We have to specify the buffer size here, as there's no overload accepting the cancellation token + // alone. But it's documented to use 81920 by default if not specified. + await stream.CopyToAsync(memoryStream, 81920, cancellationToken); +#if NETSTANDARD1_1 || NETSTANDARD2_0 + byte[] bytes = memoryStream.ToArray(); +#else + // Avoid an extra copy if we can. + byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray(); +#endif + return AttachBytes(bytes); + } +#endif + + /// + /// Constructs a from the given array. The contents + /// are copied, so further modifications to the array will not + /// be reflected in the returned ByteString. + /// This method can also be invoked in ByteString.CopyFrom(0xaa, 0xbb, ...) form + /// which is primarily useful for testing. + /// + public static ByteString CopyFrom(params byte[] bytes) + { + return new ByteString((byte[]) bytes.Clone()); + } + + /// + /// Constructs a from a portion of a byte array. + /// + public static ByteString CopyFrom(byte[] bytes, int offset, int count) + { + byte[] portion = new byte[count]; + ByteArray.Copy(bytes, offset, portion, 0, count); + return new ByteString(portion); + } + +#if GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY + /// + /// Constructs a from a read only span. The contents + /// are copied, so further modifications to the span will not + /// be reflected in the returned . + /// + [SecuritySafeCritical] + public static ByteString CopyFrom(ReadOnlySpan bytes) + { + return new ByteString(bytes.ToArray()); + } +#endif + + /// + /// Creates a new by encoding the specified text with + /// the given encoding. + /// + public static ByteString CopyFrom(string text, Encoding encoding) + { + return new ByteString(encoding.GetBytes(text)); + } + + /// + /// Creates a new by encoding the specified text in UTF-8. + /// + public static ByteString CopyFromUtf8(string text) + { + return CopyFrom(text, Encoding.UTF8); + } + + /// + /// Returns the byte at the given index. + /// + public byte this[int index] + { + get { return bytes[index]; } + } + + /// + /// Converts this into a string by applying the given encoding. + /// + /// + /// This method should only be used to convert binary data which was the result of encoding + /// text with the given encoding. + /// + /// The encoding to use to decode the binary data into text. + /// The result of decoding the binary data with the given decoding. + public string ToString(Encoding encoding) + { + return encoding.GetString(bytes, 0, bytes.Length); + } + + /// + /// Converts this into a string by applying the UTF-8 encoding. + /// + /// + /// This method should only be used to convert binary data which was the result of encoding + /// text with UTF-8. + /// + /// The result of decoding the binary data with the given decoding. + public string ToStringUtf8() + { + return ToString(Encoding.UTF8); + } + + /// + /// Returns an iterator over the bytes in this . + /// + /// An iterator over the bytes in this object. + public IEnumerator GetEnumerator() + { + return ((IEnumerable) bytes).GetEnumerator(); + } + + /// + /// Returns an iterator over the bytes in this . + /// + /// An iterator over the bytes in this object. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Creates a CodedInputStream from this ByteString's data. + /// + public CodedInputStream CreateCodedInput() + { + // We trust CodedInputStream not to reveal the provided byte array or modify it + return new CodedInputStream(bytes); + } + + /// + /// Compares two byte strings for equality. + /// + /// The first byte string to compare. + /// The second byte string to compare. + /// true if the byte strings are equal; false otherwise. + public static bool operator ==(ByteString lhs, ByteString rhs) + { + if (ReferenceEquals(lhs, rhs)) + { + return true; + } + if (ReferenceEquals(lhs, null) || ReferenceEquals(rhs, null)) + { + return false; + } + if (lhs.bytes.Length != rhs.bytes.Length) + { + return false; + } + for (int i = 0; i < lhs.Length; i++) + { + if (rhs.bytes[i] != lhs.bytes[i]) + { + return false; + } + } + return true; + } + + /// + /// Compares two byte strings for inequality. + /// + /// The first byte string to compare. + /// The second byte string to compare. + /// false if the byte strings are equal; true otherwise. + public static bool operator !=(ByteString lhs, ByteString rhs) + { + return !(lhs == rhs); + } + + /// + /// Compares this byte string with another object. + /// + /// The object to compare this with. + /// true if refers to an equal ; false otherwise. + public override bool Equals(object obj) + { + return this == (obj as ByteString); + } + + /// + /// Returns a hash code for this object. Two equal byte strings + /// will return the same hash code. + /// + /// A hash code for this object. + public override int GetHashCode() + { + int ret = 23; + foreach (byte b in bytes) + { + ret = (ret * 31) + b; + } + return ret; + } + + /// + /// Compares this byte string with another. + /// + /// The to compare this with. + /// true if refers to an equal byte string; false otherwise. + public bool Equals(ByteString other) + { + return this == other; + } + + /// + /// Used internally by CodedOutputStream to avoid creating a copy for the write + /// + internal void WriteRawBytesTo(CodedOutputStream outputStream) + { + outputStream.WriteRawBytes(bytes, 0, bytes.Length); + } + + /// + /// Copies the entire byte array to the destination array provided at the offset specified. + /// + public void CopyTo(byte[] array, int position) + { + ByteArray.Copy(bytes, 0, array, position, bytes.Length); + } + + /// + /// Writes the entire byte array to the provided stream + /// + public void WriteTo(Stream outputStream) + { + outputStream.Write(bytes, 0, bytes.Length); + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/ByteStringAsync.cs b/csharp/src/Google.Protobuf/ByteStringAsync.cs deleted file mode 100644 index ade9b8d2492f78225987093f18f510515c378ab0..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/ByteStringAsync.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace Google.Protobuf -{ - /// - /// SecuritySafeCritical attribute can not be placed on types with async methods. - /// This class has ByteString's async methods so it can be marked with SecuritySafeCritical. - /// - internal static class ByteStringAsync - { - internal static async Task FromStreamAsyncCore(Stream stream, CancellationToken cancellationToken) - { - int capacity = stream.CanSeek ? checked((int)(stream.Length - stream.Position)) : 0; - var memoryStream = new MemoryStream(capacity); - // We have to specify the buffer size here, as there's no overload accepting the cancellation token - // alone. But it's documented to use 81920 by default if not specified. - await stream.CopyToAsync(memoryStream, 81920, cancellationToken); -#if NETSTANDARD1_1 - byte[] bytes = memoryStream.ToArray(); -#else - // Avoid an extra copy if we can. - byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray(); -#endif - return ByteString.AttachBytes(bytes); - } - } -} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/CodedInputStream.cs b/csharp/src/Google.Protobuf/CodedInputStream.cs index d15e84f44648c0d387f0d41e33a5d5f3e5c6f321..b09f96ce280b77833e555c9fa5308d98b3bbf558 100644 --- a/csharp/src/Google.Protobuf/CodedInputStream.cs +++ b/csharp/src/Google.Protobuf/CodedInputStream.cs @@ -1,657 +1,699 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.Collections; -using System; -using System.IO; -using System.Security; - -namespace Google.Protobuf -{ - /// - /// Reads and decodes protocol message fields. - /// - /// - /// - /// This class is generally used by generated code to read appropriate - /// primitives from the stream. It effectively encapsulates the lowest - /// levels of protocol buffer format. - /// - /// - /// Repeated fields and map fields are not handled by this class; use - /// and to serialize such fields. - /// - /// - [SecuritySafeCritical] - public sealed class CodedInputStream : IDisposable - { - /// - /// Whether to leave the underlying stream open when disposing of this stream. - /// This is always true when there's no stream. - /// - private readonly bool leaveOpen; - - /// - /// Buffer of data read from the stream or provided at construction time. - /// - private readonly byte[] buffer; - - /// - /// The stream to read further input from, or null if the byte array buffer was provided - /// directly on construction, with no further data available. - /// - private readonly Stream input; - - /// - /// The parser state is kept separately so that other parse implementations can reuse the same - /// parsing primitives. - /// - private ParserInternalState state; - - internal const int DefaultRecursionLimit = 100; - internal const int DefaultSizeLimit = Int32.MaxValue; - internal const int BufferSize = 4096; - - #region Construction - // Note that the checks are performed such that we don't end up checking obviously-valid things - // like non-null references for arrays we've just created. - - /// - /// Creates a new CodedInputStream reading data from the given byte array. - /// - public CodedInputStream(byte[] buffer) : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), 0, buffer.Length, true) - { - } - - /// - /// Creates a new that reads from the given byte array slice. - /// - public CodedInputStream(byte[] buffer, int offset, int length) - : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), offset, offset + length, true) - { - if (offset < 0 || offset > buffer.Length) - { - throw new ArgumentOutOfRangeException("offset", "Offset must be within the buffer"); - } - if (length < 0 || offset + length > buffer.Length) - { - throw new ArgumentOutOfRangeException("length", "Length must be non-negative and within the buffer"); - } - } - - /// - /// Creates a new reading data from the given stream, which will be disposed - /// when the returned object is disposed. - /// - /// The stream to read from. - public CodedInputStream(Stream input) : this(input, false) - { - } - - /// - /// Creates a new reading data from the given stream. - /// - /// The stream to read from. - /// true to leave open when the returned - /// is disposed; false to dispose of the given stream when the - /// returned object is disposed. - public CodedInputStream(Stream input, bool leaveOpen) - : this(ProtoPreconditions.CheckNotNull(input, "input"), new byte[BufferSize], 0, 0, leaveOpen) - { - } - - /// - /// Creates a new CodedInputStream reading data from the given - /// stream and buffer, using the default limits. - /// - internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, bool leaveOpen) - { - this.input = input; - this.buffer = buffer; - this.state.bufferPos = bufferPos; - this.state.bufferSize = bufferSize; - this.state.sizeLimit = DefaultSizeLimit; - this.state.recursionLimit = DefaultRecursionLimit; - SegmentedBufferHelper.Initialize(this, out this.state.segmentedBufferHelper); - this.leaveOpen = leaveOpen; - - this.state.currentLimit = int.MaxValue; - } - - /// - /// Creates a new CodedInputStream reading data from the given - /// stream and buffer, using the specified limits. - /// - /// - /// This chains to the version with the default limits instead of vice versa to avoid - /// having to check that the default values are valid every time. - /// - internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, int sizeLimit, int recursionLimit, bool leaveOpen) - : this(input, buffer, bufferPos, bufferSize, leaveOpen) - { - if (sizeLimit <= 0) - { - throw new ArgumentOutOfRangeException("sizeLimit", "Size limit must be positive"); - } - if (recursionLimit <= 0) - { - throw new ArgumentOutOfRangeException("recursionLimit!", "Recursion limit must be positive"); - } - this.state.sizeLimit = sizeLimit; - this.state.recursionLimit = recursionLimit; - } - #endregion - - /// - /// Creates a with the specified size and recursion limits, reading - /// from an input stream. - /// - /// - /// This method exists separately from the constructor to reduce the number of constructor overloads. - /// It is likely to be used considerably less frequently than the constructors, as the default limits - /// are suitable for most use cases. - /// - /// The input stream to read from - /// The total limit of data to read from the stream. - /// The maximum recursion depth to allow while reading. - /// A CodedInputStream reading from with the specified size - /// and recursion limits. - public static CodedInputStream CreateWithLimits(Stream input, int sizeLimit, int recursionLimit) - { - // Note: we may want an overload accepting leaveOpen - return new CodedInputStream(input, new byte[BufferSize], 0, 0, sizeLimit, recursionLimit, false); - } - - /// - /// Returns the current position in the input stream, or the position in the input buffer - /// - public long Position - { - get - { - if (input != null) - { - return input.Position - ((state.bufferSize + state.bufferSizeAfterLimit) - state.bufferPos); - } - return state.bufferPos; - } - } - - /// - /// Returns the last tag read, or 0 if no tags have been read or we've read beyond - /// the end of the stream. - /// - internal uint LastTag { get { return state.lastTag; } } - - /// - /// Returns the size limit for this stream. - /// - /// - /// This limit is applied when reading from the underlying stream, as a sanity check. It is - /// not applied when reading from a byte array data source without an underlying stream. - /// The default value is Int32.MaxValue. - /// - /// - /// The size limit. - /// - public int SizeLimit { get { return state.sizeLimit; } } - - /// - /// Returns the recursion limit for this stream. This limit is applied whilst reading messages, - /// to avoid maliciously-recursive data. - /// - /// - /// The default limit is 100. - /// - /// - /// The recursion limit for this stream. - /// - public int RecursionLimit { get { return state.recursionLimit; } } - - /// - /// Internal-only property; when set to true, unknown fields will be discarded while parsing. - /// - internal bool DiscardUnknownFields - { - get { return state.DiscardUnknownFields; } - set { state.DiscardUnknownFields = value; } - } - - /// - /// Internal-only property; provides extension identifiers to compatible messages while parsing. - /// - internal ExtensionRegistry ExtensionRegistry - { - get { return state.ExtensionRegistry; } - set { state.ExtensionRegistry = value; } - } - - internal byte[] InternalBuffer => buffer; - - internal Stream InternalInputStream => input; - - internal ref ParserInternalState InternalState => ref state; - - /// - /// Disposes of this instance, potentially closing any underlying stream. - /// - /// - /// As there is no flushing to perform here, disposing of a which - /// was constructed with the leaveOpen option parameter set to true (or one which - /// was constructed to read from a byte array) has no effect. - /// - public void Dispose() - { - if (!leaveOpen) - { - input.Dispose(); - } - } - - #region Validation - /// - /// Verifies that the last call to ReadTag() returned tag 0 - in other words, - /// we've reached the end of the stream when we expected to. - /// - /// The - /// tag read was not the one specified - internal void CheckReadEndOfStreamTag() - { - ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref state); - } - #endregion - - #region Reading of tags etc - - /// - /// Peeks at the next field tag. This is like calling , but the - /// tag is not consumed. (So a subsequent call to will return the - /// same value.) - /// - public uint PeekTag() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.PeekTag(ref span, ref state); - } - - /// - /// Reads a field tag, returning the tag of 0 for "end of stream". - /// - /// - /// If this method returns 0, it doesn't necessarily mean the end of all - /// the data in this CodedInputStream; it may be the end of the logical stream - /// for an embedded message, for example. - /// - /// The next field tag, or 0 for end of stream. (0 is never a valid tag.) - public uint ReadTag() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseTag(ref span, ref state); - } - - /// - /// Skips the data for the field with the tag we've just read. - /// This should be called directly after , when - /// the caller wishes to skip an unknown field. - /// - /// - /// This method throws if the last-read tag was an end-group tag. - /// If a caller wishes to skip a group, they should skip the whole group, by calling this method after reading the - /// start-group tag. This behavior allows callers to call this method on any field they don't understand, correctly - /// resulting in an error if an end-group tag has not been paired with an earlier start-group tag. - /// - /// The last tag was an end-group tag - /// The last read operation read to the end of the logical stream - public void SkipLastField() - { - var span = new ReadOnlySpan(buffer); - ParsingPrimitivesMessages.SkipLastField(ref span, ref state); - } - - /// - /// Skip a group. - /// - internal void SkipGroup(uint startGroupTag) - { - var span = new ReadOnlySpan(buffer); - ParsingPrimitivesMessages.SkipGroup(ref span, ref state, startGroupTag); - } - - /// - /// Reads a double field from the stream. - /// - public double ReadDouble() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseDouble(ref span, ref state); - } - - /// - /// Reads a float field from the stream. - /// - public float ReadFloat() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseFloat(ref span, ref state); - } - - /// - /// Reads a uint64 field from the stream. - /// - public ulong ReadUInt64() - { - return ReadRawVarint64(); - } - - /// - /// Reads an int64 field from the stream. - /// - public long ReadInt64() - { - return (long) ReadRawVarint64(); - } - - /// - /// Reads an int32 field from the stream. - /// - public int ReadInt32() - { - return (int) ReadRawVarint32(); - } - - /// - /// Reads a fixed64 field from the stream. - /// - public ulong ReadFixed64() - { - return ReadRawLittleEndian64(); - } - - /// - /// Reads a fixed32 field from the stream. - /// - public uint ReadFixed32() - { - return ReadRawLittleEndian32(); - } - - /// - /// Reads a bool field from the stream. - /// - public bool ReadBool() - { - return ReadRawVarint64() != 0; - } - - /// - /// Reads a string field from the stream. - /// - public string ReadString() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ReadString(ref span, ref state); - } - - /// - /// Reads an embedded message field value from the stream. - /// - public void ReadMessage(IMessage builder) - { - // TODO: if the message doesn't implement IBufferMessage (and thus does not provide the InternalMergeFrom method), - // what we're doing here works fine, but could be more efficient. - // What happens is that we first initialize a ParseContext from the current coded input stream only to parse the length of the message, at which point - // we will need to switch back again to CodedInputStream-based parsing (which involves copying and storing the state) to be able to - // invoke the legacy MergeFrom(CodedInputStream) method. - // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). - ParseContext.Initialize(buffer.AsSpan(), ref state, out ParseContext ctx); - try - { - ParsingPrimitivesMessages.ReadMessage(ref ctx, builder); - } - finally - { - ctx.CopyStateTo(this); - } - } - - /// - /// Reads an embedded group field from the stream. - /// - public void ReadGroup(IMessage builder) - { - ParseContext.Initialize(this, out ParseContext ctx); - try - { - ParsingPrimitivesMessages.ReadGroup(ref ctx, builder); - } - finally - { - ctx.CopyStateTo(this); - } - } - - /// - /// Reads a bytes field value from the stream. - /// - public ByteString ReadBytes() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ReadBytes(ref span, ref state); - } - - /// - /// Reads a uint32 field value from the stream. - /// - public uint ReadUInt32() - { - return ReadRawVarint32(); - } - - /// - /// Reads an enum field value from the stream. - /// - public int ReadEnum() - { - // Currently just a pass-through, but it's nice to separate it logically from WriteInt32. - return (int) ReadRawVarint32(); - } - - /// - /// Reads an sfixed32 field value from the stream. - /// - public int ReadSFixed32() - { - return (int) ReadRawLittleEndian32(); - } - - /// - /// Reads an sfixed64 field value from the stream. - /// - public long ReadSFixed64() - { - return (long) ReadRawLittleEndian64(); - } - - /// - /// Reads an sint32 field value from the stream. - /// - public int ReadSInt32() - { - return ParsingPrimitives.DecodeZigZag32(ReadRawVarint32()); - } - - /// - /// Reads an sint64 field value from the stream. - /// - public long ReadSInt64() - { - return ParsingPrimitives.DecodeZigZag64(ReadRawVarint64()); - } - - /// - /// Reads a length for length-delimited data. - /// - /// - /// This is internally just reading a varint, but this method exists - /// to make the calling code clearer. - /// - public int ReadLength() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseLength(ref span, ref state); - } - - /// - /// Peeks at the next tag in the stream. If it matches , - /// the tag is consumed and the method returns true; otherwise, the - /// stream is left in the original position and the method returns false. - /// - public bool MaybeConsumeTag(uint tag) - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.MaybeConsumeTag(ref span, ref state, tag); - } - -#endregion - - #region Underlying reading primitives - - /// - /// Reads a raw Varint from the stream. If larger than 32 bits, discard the upper bits. - /// This method is optimised for the case where we've got lots of data in the buffer. - /// That means we can check the size just once, then just read directly from the buffer - /// without constant rechecking of the buffer length. - /// - internal uint ReadRawVarint32() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseRawVarint32(ref span, ref state); - } - - /// - /// Reads a varint from the input one byte at a time, so that it does not - /// read any bytes after the end of the varint. If you simply wrapped the - /// stream in a CodedInputStream and used ReadRawVarint32(Stream) - /// then you would probably end up reading past the end of the varint since - /// CodedInputStream buffers its input. - /// - /// - /// - internal static uint ReadRawVarint32(Stream input) - { - return ParsingPrimitives.ReadRawVarint32(input); - } - - /// - /// Reads a raw varint from the stream. - /// - internal ulong ReadRawVarint64() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseRawVarint64(ref span, ref state); - } - - /// - /// Reads a 32-bit little-endian integer from the stream. - /// - internal uint ReadRawLittleEndian32() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseRawLittleEndian32(ref span, ref state); - } - - /// - /// Reads a 64-bit little-endian integer from the stream. - /// - internal ulong ReadRawLittleEndian64() - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ParseRawLittleEndian64(ref span, ref state); - } - #endregion - - #region Internal reading and buffer management - - /// - /// Sets currentLimit to (current position) + byteLimit. This is called - /// when descending into a length-delimited embedded message. The previous - /// limit is returned. - /// - /// The old limit. - internal int PushLimit(int byteLimit) - { - return SegmentedBufferHelper.PushLimit(ref state, byteLimit); - } - - /// - /// Discards the current limit, returning the previous limit. - /// - internal void PopLimit(int oldLimit) - { - SegmentedBufferHelper.PopLimit(ref state, oldLimit); - } - - /// - /// Returns whether or not all the data before the limit has been read. - /// - /// - internal bool ReachedLimit - { - get - { - return SegmentedBufferHelper.IsReachedLimit(ref state); - } - } - - /// - /// Returns true if the stream has reached the end of the input. This is the - /// case if either the end of the underlying input source has been reached or - /// the stream has reached a limit created using PushLimit. - /// - public bool IsAtEnd - { - get - { - var span = new ReadOnlySpan(buffer); - return SegmentedBufferHelper.IsAtEnd(ref span, ref state); - } - } - - /// - /// Reads a fixed size of bytes from the input. - /// - /// - /// the end of the stream or the current limit was reached - /// - internal byte[] ReadRawBytes(int size) - { - var span = new ReadOnlySpan(buffer); - return ParsingPrimitives.ReadRawBytes(ref span, ref state, size); - } - - /// - /// Reads a top-level message or a nested message after the limits for this message have been pushed. - /// (parser will proceed until the end of the current limit) - /// NOTE: this method needs to be public because it's invoked by the generated code - e.g. msg.MergeFrom(CodedInputStream input) method - /// - public void ReadRawMessage(IMessage message) - { - ParseContext.Initialize(this, out ParseContext ctx); - try - { - ParsingPrimitivesMessages.ReadRawMessage(ref ctx, message); - } - finally - { - ctx.CopyStateTo(this); - } - } -#endregion - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Google.Protobuf.Collections; +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +namespace Google.Protobuf +{ + /// + /// Reads and decodes protocol message fields. + /// + /// + /// + /// This class is generally used by generated code to read appropriate + /// primitives from the stream. It effectively encapsulates the lowest + /// levels of protocol buffer format. + /// + /// + /// Repeated fields and map fields are not handled by this class; use + /// and to serialize such fields. + /// + /// + [SecuritySafeCritical] + public sealed class CodedInputStream : IDisposable + { + /// + /// Whether to leave the underlying stream open when disposing of this stream. + /// This is always true when there's no stream. + /// + private readonly bool leaveOpen; + + /// + /// Buffer of data read from the stream or provided at construction time. + /// + private readonly byte[] buffer; + + /// + /// The stream to read further input from, or null if the byte array buffer was provided + /// directly on construction, with no further data available. + /// + private readonly Stream input; + + /// + /// The parser state is kept separately so that other parse implementations can reuse the same + /// parsing primitives. + /// + private ParserInternalState state; + + internal const int DefaultRecursionLimit = 100; + internal const int DefaultSizeLimit = Int32.MaxValue; + internal const int BufferSize = 4096; + + #region Construction + // Note that the checks are performed such that we don't end up checking obviously-valid things + // like non-null references for arrays we've just created. + + /// + /// Creates a new CodedInputStream reading data from the given byte array. + /// + public CodedInputStream(byte[] buffer) : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), 0, buffer.Length, true) + { + } + + /// + /// Creates a new that reads from the given byte array slice. + /// + public CodedInputStream(byte[] buffer, int offset, int length) + : this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), offset, offset + length, true) + { + if (offset < 0 || offset > buffer.Length) + { + throw new ArgumentOutOfRangeException("offset", "Offset must be within the buffer"); + } + if (length < 0 || offset + length > buffer.Length) + { + throw new ArgumentOutOfRangeException("length", "Length must be non-negative and within the buffer"); + } + } + + /// + /// Creates a new reading data from the given stream, which will be disposed + /// when the returned object is disposed. + /// + /// The stream to read from. + public CodedInputStream(Stream input) : this(input, false) + { + } + + /// + /// Creates a new reading data from the given stream. + /// + /// The stream to read from. + /// true to leave open when the returned + /// is disposed; false to dispose of the given stream when the + /// returned object is disposed. + public CodedInputStream(Stream input, bool leaveOpen) + : this(ProtoPreconditions.CheckNotNull(input, "input"), new byte[BufferSize], 0, 0, leaveOpen) + { + } + + /// + /// Creates a new CodedInputStream reading data from the given + /// stream and buffer, using the default limits. + /// + internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, bool leaveOpen) + { + this.input = input; + this.buffer = buffer; + this.state.bufferPos = bufferPos; + this.state.bufferSize = bufferSize; + this.state.sizeLimit = DefaultSizeLimit; + this.state.recursionLimit = DefaultRecursionLimit; + SegmentedBufferHelper.Initialize(this, out this.state.segmentedBufferHelper); + this.leaveOpen = leaveOpen; + + this.state.currentLimit = int.MaxValue; + } + + /// + /// Creates a new CodedInputStream reading data from the given + /// stream and buffer, using the specified limits. + /// + /// + /// This chains to the version with the default limits instead of vice versa to avoid + /// having to check that the default values are valid every time. + /// + internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, int sizeLimit, int recursionLimit, bool leaveOpen) + : this(input, buffer, bufferPos, bufferSize, leaveOpen) + { + if (sizeLimit <= 0) + { + throw new ArgumentOutOfRangeException("sizeLimit", "Size limit must be positive"); + } + if (recursionLimit <= 0) + { + throw new ArgumentOutOfRangeException("recursionLimit!", "Recursion limit must be positive"); + } + this.state.sizeLimit = sizeLimit; + this.state.recursionLimit = recursionLimit; + } + #endregion + + /// + /// Creates a with the specified size and recursion limits, reading + /// from an input stream. + /// + /// + /// This method exists separately from the constructor to reduce the number of constructor overloads. + /// It is likely to be used considerably less frequently than the constructors, as the default limits + /// are suitable for most use cases. + /// + /// The input stream to read from + /// The total limit of data to read from the stream. + /// The maximum recursion depth to allow while reading. + /// A CodedInputStream reading from with the specified size + /// and recursion limits. + public static CodedInputStream CreateWithLimits(Stream input, int sizeLimit, int recursionLimit) + { + // Note: we may want an overload accepting leaveOpen + return new CodedInputStream(input, new byte[BufferSize], 0, 0, sizeLimit, recursionLimit, false); + } + + /// + /// Returns the current position in the input stream, or the position in the input buffer + /// + public long Position + { + get + { + if (input != null) + { + return input.Position - ((state.bufferSize + state.bufferSizeAfterLimit) - state.bufferPos); + } + return state.bufferPos; + } + } + + /// + /// Returns the last tag read, or 0 if no tags have been read or we've read beyond + /// the end of the stream. + /// + internal uint LastTag { get { return state.lastTag; } } + + /// + /// Returns the size limit for this stream. + /// + /// + /// This limit is applied when reading from the underlying stream, as a sanity check. It is + /// not applied when reading from a byte array data source without an underlying stream. + /// The default value is Int32.MaxValue. + /// + /// + /// The size limit. + /// + public int SizeLimit { get { return state.sizeLimit; } } + + /// + /// Returns the recursion limit for this stream. This limit is applied whilst reading messages, + /// to avoid maliciously-recursive data. + /// + /// + /// The default limit is 100. + /// + /// + /// The recursion limit for this stream. + /// + public int RecursionLimit { get { return state.recursionLimit; } } + + /// + /// Internal-only property; when set to true, unknown fields will be discarded while parsing. + /// + internal bool DiscardUnknownFields + { + get { return state.DiscardUnknownFields; } + set { state.DiscardUnknownFields = value; } + } + + /// + /// Internal-only property; provides extension identifiers to compatible messages while parsing. + /// + internal ExtensionRegistry ExtensionRegistry + { + get { return state.ExtensionRegistry; } + set { state.ExtensionRegistry = value; } + } + + internal byte[] InternalBuffer => buffer; + + internal Stream InternalInputStream => input; + + internal ref ParserInternalState InternalState => ref state; + + /// + /// Disposes of this instance, potentially closing any underlying stream. + /// + /// + /// As there is no flushing to perform here, disposing of a which + /// was constructed with the leaveOpen option parameter set to true (or one which + /// was constructed to read from a byte array) has no effect. + /// + public void Dispose() + { + if (!leaveOpen) + { + input.Dispose(); + } + } + + #region Validation + /// + /// Verifies that the last call to ReadTag() returned tag 0 - in other words, + /// we've reached the end of the stream when we expected to. + /// + /// The + /// tag read was not the one specified + internal void CheckReadEndOfStreamTag() + { + ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref state); + } + #endregion + + #region Reading of tags etc + + /// + /// Peeks at the next field tag. This is like calling , but the + /// tag is not consumed. (So a subsequent call to will return the + /// same value.) + /// + public uint PeekTag() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.PeekTag(ref span, ref state); + } + + /// + /// Reads a field tag, returning the tag of 0 for "end of stream". + /// + /// + /// If this method returns 0, it doesn't necessarily mean the end of all + /// the data in this CodedInputStream; it may be the end of the logical stream + /// for an embedded message, for example. + /// + /// The next field tag, or 0 for end of stream. (0 is never a valid tag.) + public uint ReadTag() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseTag(ref span, ref state); + } + + /// + /// Skips the data for the field with the tag we've just read. + /// This should be called directly after , when + /// the caller wishes to skip an unknown field. + /// + /// + /// This method throws if the last-read tag was an end-group tag. + /// If a caller wishes to skip a group, they should skip the whole group, by calling this method after reading the + /// start-group tag. This behavior allows callers to call this method on any field they don't understand, correctly + /// resulting in an error if an end-group tag has not been paired with an earlier start-group tag. + /// + /// The last tag was an end-group tag + /// The last read operation read to the end of the logical stream + public void SkipLastField() + { + var span = new ReadOnlySpan(buffer); + ParsingPrimitivesMessages.SkipLastField(ref span, ref state); + } + + /// + /// Skip a group. + /// + internal void SkipGroup(uint startGroupTag) + { + var span = new ReadOnlySpan(buffer); + ParsingPrimitivesMessages.SkipGroup(ref span, ref state, startGroupTag); + } + + /// + /// Reads a double field from the stream. + /// + public double ReadDouble() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseDouble(ref span, ref state); + } + + /// + /// Reads a float field from the stream. + /// + public float ReadFloat() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseFloat(ref span, ref state); + } + + /// + /// Reads a uint64 field from the stream. + /// + public ulong ReadUInt64() + { + return ReadRawVarint64(); + } + + /// + /// Reads an int64 field from the stream. + /// + public long ReadInt64() + { + return (long) ReadRawVarint64(); + } + + /// + /// Reads an int32 field from the stream. + /// + public int ReadInt32() + { + return (int) ReadRawVarint32(); + } + + /// + /// Reads a fixed64 field from the stream. + /// + public ulong ReadFixed64() + { + return ReadRawLittleEndian64(); + } + + /// + /// Reads a fixed32 field from the stream. + /// + public uint ReadFixed32() + { + return ReadRawLittleEndian32(); + } + + /// + /// Reads a bool field from the stream. + /// + public bool ReadBool() + { + return ReadRawVarint64() != 0; + } + + /// + /// Reads a string field from the stream. + /// + public string ReadString() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ReadString(ref span, ref state); + } + + /// + /// Reads an embedded message field value from the stream. + /// + public void ReadMessage(IMessage builder) + { + // TODO(jtattermusch): if the message doesn't implement IBufferMessage (and thus does not provide the InternalMergeFrom method), + // what we're doing here works fine, but could be more efficient. + // What happends is that we first initialize a ParseContext from the current coded input stream only to parse the length of the message, at which point + // we will need to switch back again to CodedInputStream-based parsing (which involves copying and storing the state) to be able to + // invoke the legacy MergeFrom(CodedInputStream) method. + // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). + var span = new ReadOnlySpan(buffer); + ParseContext.Initialize(ref span, ref state, out ParseContext ctx); + try + { + ParsingPrimitivesMessages.ReadMessage(ref ctx, builder); + } + finally + { + ctx.CopyStateTo(this); + } + } + + /// + /// Reads an embedded group field from the stream. + /// + public void ReadGroup(IMessage builder) + { + ParseContext.Initialize(this, out ParseContext ctx); + try + { + ParsingPrimitivesMessages.ReadGroup(ref ctx, builder); + } + finally + { + ctx.CopyStateTo(this); + } + } + + /// + /// Reads a bytes field value from the stream. + /// + public ByteString ReadBytes() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ReadBytes(ref span, ref state); + } + + /// + /// Reads a uint32 field value from the stream. + /// + public uint ReadUInt32() + { + return ReadRawVarint32(); + } + + /// + /// Reads an enum field value from the stream. + /// + public int ReadEnum() + { + // Currently just a pass-through, but it's nice to separate it logically from WriteInt32. + return (int) ReadRawVarint32(); + } + + /// + /// Reads an sfixed32 field value from the stream. + /// + public int ReadSFixed32() + { + return (int) ReadRawLittleEndian32(); + } + + /// + /// Reads an sfixed64 field value from the stream. + /// + public long ReadSFixed64() + { + return (long) ReadRawLittleEndian64(); + } + + /// + /// Reads an sint32 field value from the stream. + /// + public int ReadSInt32() + { + return ParsingPrimitives.DecodeZigZag32(ReadRawVarint32()); + } + + /// + /// Reads an sint64 field value from the stream. + /// + public long ReadSInt64() + { + return ParsingPrimitives.DecodeZigZag64(ReadRawVarint64()); + } + + /// + /// Reads a length for length-delimited data. + /// + /// + /// This is internally just reading a varint, but this method exists + /// to make the calling code clearer. + /// + public int ReadLength() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseLength(ref span, ref state); + } + + /// + /// Peeks at the next tag in the stream. If it matches , + /// the tag is consumed and the method returns true; otherwise, the + /// stream is left in the original position and the method returns false. + /// + public bool MaybeConsumeTag(uint tag) + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.MaybeConsumeTag(ref span, ref state, tag); + } + +#endregion + + #region Underlying reading primitives + + /// + /// Reads a raw Varint from the stream. If larger than 32 bits, discard the upper bits. + /// This method is optimised for the case where we've got lots of data in the buffer. + /// That means we can check the size just once, then just read directly from the buffer + /// without constant rechecking of the buffer length. + /// + internal uint ReadRawVarint32() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawVarint32(ref span, ref state); + } + + /// + /// Reads a varint from the input one byte at a time, so that it does not + /// read any bytes after the end of the varint. If you simply wrapped the + /// stream in a CodedInputStream and used ReadRawVarint32(Stream) + /// then you would probably end up reading past the end of the varint since + /// CodedInputStream buffers its input. + /// + /// + /// + internal static uint ReadRawVarint32(Stream input) + { + return ParsingPrimitives.ReadRawVarint32(input); + } + + /// + /// Reads a raw varint from the stream. + /// + internal ulong ReadRawVarint64() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawVarint64(ref span, ref state); + } + + /// + /// Reads a 32-bit little-endian integer from the stream. + /// + internal uint ReadRawLittleEndian32() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawLittleEndian32(ref span, ref state); + } + + /// + /// Reads a 64-bit little-endian integer from the stream. + /// + internal ulong ReadRawLittleEndian64() + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawLittleEndian64(ref span, ref state); + } + #endregion + + #region Internal reading and buffer management + + /// + /// Sets currentLimit to (current position) + byteLimit. This is called + /// when descending into a length-delimited embedded message. The previous + /// limit is returned. + /// + /// The old limit. + internal int PushLimit(int byteLimit) + { + return SegmentedBufferHelper.PushLimit(ref state, byteLimit); + } + + /// + /// Discards the current limit, returning the previous limit. + /// + internal void PopLimit(int oldLimit) + { + SegmentedBufferHelper.PopLimit(ref state, oldLimit); + } + + /// + /// Returns whether or not all the data before the limit has been read. + /// + /// + internal bool ReachedLimit + { + get + { + return SegmentedBufferHelper.IsReachedLimit(ref state); + } + } + + /// + /// Returns true if the stream has reached the end of the input. This is the + /// case if either the end of the underlying input source has been reached or + /// the stream has reached a limit created using PushLimit. + /// + public bool IsAtEnd + { + get + { + var span = new ReadOnlySpan(buffer); + return SegmentedBufferHelper.IsAtEnd(ref span, ref state); + } + } + + /// + /// Called when buffer is empty to read more bytes from the + /// input. If is true, RefillBuffer() guarantees that + /// either there will be at least one byte in the buffer when it returns + /// or it will throw an exception. If is false, + /// RefillBuffer() returns false if no more bytes were available. + /// + /// + /// + private bool RefillBuffer(bool mustSucceed) + { + var span = new ReadOnlySpan(buffer); + return state.segmentedBufferHelper.RefillBuffer(ref span, ref state, mustSucceed); + } + + /// + /// Reads a fixed size of bytes from the input. + /// + /// + /// the end of the stream or the current limit was reached + /// + internal byte[] ReadRawBytes(int size) + { + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ReadRawBytes(ref span, ref state, size); + } + + /// + /// Reads a top-level message or a nested message after the limits for this message have been pushed. + /// (parser will proceed until the end of the current limit) + /// NOTE: this method needs to be public because it's invoked by the generated code - e.g. msg.MergeFrom(CodedInputStream input) method + /// + public void ReadRawMessage(IMessage message) + { + ParseContext.Initialize(this, out ParseContext ctx); + try + { + ParsingPrimitivesMessages.ReadRawMessage(ref ctx, message); + } + finally + { + ctx.CopyStateTo(this); + } + } +#endregion + } +} diff --git a/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs b/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs index 68ec1362e1f761b7f300f113344a1f196f437aa0..cb923549d42eb59262612d8f31e02b736669c76b 100644 --- a/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs +++ b/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs @@ -1,285 +1,308 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; - -namespace Google.Protobuf -{ - // This part of CodedOutputStream provides all the static entry points that are used - // by generated code and internally to compute the size of messages prior to being - // written to an instance of CodedOutputStream. - public sealed partial class CodedOutputStream - { - private const int LittleEndian64Size = 8; - private const int LittleEndian32Size = 4; - - internal const int DoubleSize = LittleEndian64Size; - internal const int FloatSize = LittleEndian32Size; - internal const int BoolSize = 1; - - /// - /// Computes the number of bytes that would be needed to encode a - /// double field, including the tag. - /// - public static int ComputeDoubleSize(double value) - { - return DoubleSize; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// float field, including the tag. - /// - public static int ComputeFloatSize(float value) - { - return FloatSize; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// uint64 field, including the tag. - /// - public static int ComputeUInt64Size(ulong value) - { - return ComputeRawVarint64Size(value); - } - - /// - /// Computes the number of bytes that would be needed to encode an - /// int64 field, including the tag. - /// - public static int ComputeInt64Size(long value) - { - return ComputeRawVarint64Size((ulong) value); - } - - /// - /// Computes the number of bytes that would be needed to encode an - /// int32 field, including the tag. - /// - public static int ComputeInt32Size(int value) - { - if (value >= 0) - { - return ComputeRawVarint32Size((uint) value); - } - else - { - // Must sign-extend. - return 10; - } - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// fixed64 field, including the tag. - /// - public static int ComputeFixed64Size(ulong value) - { - return LittleEndian64Size; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// fixed32 field, including the tag. - /// - public static int ComputeFixed32Size(uint value) - { - return LittleEndian32Size; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// bool field, including the tag. - /// - public static int ComputeBoolSize(bool value) - { - return BoolSize; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// string field, including the tag. - /// - public static int ComputeStringSize(String value) - { - int byteArraySize = WritingPrimitives.Utf8Encoding.GetByteCount(value); - return ComputeLengthSize(byteArraySize) + byteArraySize; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// group field, including the tag. - /// - public static int ComputeGroupSize(IMessage value) - { - return value.CalculateSize(); - } - - /// - /// Computes the number of bytes that would be needed to encode an - /// embedded message field, including the tag. - /// - public static int ComputeMessageSize(IMessage value) - { - int size = value.CalculateSize(); - return ComputeLengthSize(size) + size; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// bytes field, including the tag. - /// - public static int ComputeBytesSize(ByteString value) - { - return ComputeLengthSize(value.Length) + value.Length; - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// uint32 field, including the tag. - /// - public static int ComputeUInt32Size(uint value) - { - return ComputeRawVarint32Size(value); - } - - /// - /// Computes the number of bytes that would be needed to encode a - /// enum field, including the tag. The caller is responsible for - /// converting the enum value to its numeric value. - /// - public static int ComputeEnumSize(int value) - { - // Currently just a pass-through, but it's nice to separate it logically. - return ComputeInt32Size(value); - } - - /// - /// Computes the number of bytes that would be needed to encode an - /// sfixed32 field, including the tag. - /// - public static int ComputeSFixed32Size(int value) - { - return LittleEndian32Size; - } - - /// - /// Computes the number of bytes that would be needed to encode an - /// sfixed64 field, including the tag. - /// - public static int ComputeSFixed64Size(long value) - { - return LittleEndian64Size; - } - - /// - /// Computes the number of bytes that would be needed to encode an - /// sint32 field, including the tag. - /// - public static int ComputeSInt32Size(int value) - { - return ComputeRawVarint32Size(WritingPrimitives.EncodeZigZag32(value)); - } - - /// - /// Computes the number of bytes that would be needed to encode an - /// sint64 field, including the tag. - /// - public static int ComputeSInt64Size(long value) - { - return ComputeRawVarint64Size(WritingPrimitives.EncodeZigZag64(value)); - } - - /// - /// Computes the number of bytes that would be needed to encode a length, - /// as written by . - /// - public static int ComputeLengthSize(int length) - { - return ComputeRawVarint32Size((uint) length); - } - - /// - /// Computes the number of bytes that would be needed to encode a varint. - /// - public static int ComputeRawVarint32Size(uint value) - { - if ((value & (0xffffffff << 7)) == 0) - { - return 1; - } - if ((value & (0xffffffff << 14)) == 0) - { - return 2; - } - if ((value & (0xffffffff << 21)) == 0) - { - return 3; - } - if ((value & (0xffffffff << 28)) == 0) - { - return 4; - } - return 5; - } - - /// - /// Computes the number of bytes that would be needed to encode a varint. - /// - public static int ComputeRawVarint64Size(ulong value) - { - if ((value & (0xffffffffffffffffL << 7)) == 0) - { - return 1; - } - if ((value & (0xffffffffffffffffL << 14)) == 0) - { - return 2; - } - if ((value & (0xffffffffffffffffL << 21)) == 0) - { - return 3; - } - if ((value & (0xffffffffffffffffL << 28)) == 0) - { - return 4; - } - if ((value & (0xffffffffffffffffL << 35)) == 0) - { - return 5; - } - if ((value & (0xffffffffffffffffL << 42)) == 0) - { - return 6; - } - if ((value & (0xffffffffffffffffL << 49)) == 0) - { - return 7; - } - if ((value & (0xffffffffffffffffL << 56)) == 0) - { - return 8; - } - if ((value & (0xffffffffffffffffL << 63)) == 0) - { - return 9; - } - return 10; - } - - /// - /// Computes the number of bytes that would be needed to encode a tag. - /// - public static int ComputeTagSize(int fieldNumber) - { - return ComputeRawVarint32Size(WireFormat.MakeTag(fieldNumber, 0)); - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; + +namespace Google.Protobuf +{ + // This part of CodedOutputStream provides all the static entry points that are used + // by generated code and internally to compute the size of messages prior to being + // written to an instance of CodedOutputStream. + public sealed partial class CodedOutputStream + { + private const int LittleEndian64Size = 8; + private const int LittleEndian32Size = 4; + + internal const int DoubleSize = LittleEndian64Size; + internal const int FloatSize = LittleEndian32Size; + internal const int BoolSize = 1; + + /// + /// Computes the number of bytes that would be needed to encode a + /// double field, including the tag. + /// + public static int ComputeDoubleSize(double value) + { + return DoubleSize; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// float field, including the tag. + /// + public static int ComputeFloatSize(float value) + { + return FloatSize; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// uint64 field, including the tag. + /// + public static int ComputeUInt64Size(ulong value) + { + return ComputeRawVarint64Size(value); + } + + /// + /// Computes the number of bytes that would be needed to encode an + /// int64 field, including the tag. + /// + public static int ComputeInt64Size(long value) + { + return ComputeRawVarint64Size((ulong) value); + } + + /// + /// Computes the number of bytes that would be needed to encode an + /// int32 field, including the tag. + /// + public static int ComputeInt32Size(int value) + { + if (value >= 0) + { + return ComputeRawVarint32Size((uint) value); + } + else + { + // Must sign-extend. + return 10; + } + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// fixed64 field, including the tag. + /// + public static int ComputeFixed64Size(ulong value) + { + return LittleEndian64Size; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// fixed32 field, including the tag. + /// + public static int ComputeFixed32Size(uint value) + { + return LittleEndian32Size; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// bool field, including the tag. + /// + public static int ComputeBoolSize(bool value) + { + return BoolSize; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// string field, including the tag. + /// + public static int ComputeStringSize(String value) + { + int byteArraySize = WritingPrimitives.Utf8Encoding.GetByteCount(value); + return ComputeLengthSize(byteArraySize) + byteArraySize; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// group field, including the tag. + /// + public static int ComputeGroupSize(IMessage value) + { + return value.CalculateSize(); + } + + /// + /// Computes the number of bytes that would be needed to encode an + /// embedded message field, including the tag. + /// + public static int ComputeMessageSize(IMessage value) + { + int size = value.CalculateSize(); + return ComputeLengthSize(size) + size; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// bytes field, including the tag. + /// + public static int ComputeBytesSize(ByteString value) + { + return ComputeLengthSize(value.Length) + value.Length; + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// uint32 field, including the tag. + /// + public static int ComputeUInt32Size(uint value) + { + return ComputeRawVarint32Size(value); + } + + /// + /// Computes the number of bytes that would be needed to encode a + /// enum field, including the tag. The caller is responsible for + /// converting the enum value to its numeric value. + /// + public static int ComputeEnumSize(int value) + { + // Currently just a pass-through, but it's nice to separate it logically. + return ComputeInt32Size(value); + } + + /// + /// Computes the number of bytes that would be needed to encode an + /// sfixed32 field, including the tag. + /// + public static int ComputeSFixed32Size(int value) + { + return LittleEndian32Size; + } + + /// + /// Computes the number of bytes that would be needed to encode an + /// sfixed64 field, including the tag. + /// + public static int ComputeSFixed64Size(long value) + { + return LittleEndian64Size; + } + + /// + /// Computes the number of bytes that would be needed to encode an + /// sint32 field, including the tag. + /// + public static int ComputeSInt32Size(int value) + { + return ComputeRawVarint32Size(WritingPrimitives.EncodeZigZag32(value)); + } + + /// + /// Computes the number of bytes that would be needed to encode an + /// sint64 field, including the tag. + /// + public static int ComputeSInt64Size(long value) + { + return ComputeRawVarint64Size(WritingPrimitives.EncodeZigZag64(value)); + } + + /// + /// Computes the number of bytes that would be needed to encode a length, + /// as written by . + /// + public static int ComputeLengthSize(int length) + { + return ComputeRawVarint32Size((uint) length); + } + + /// + /// Computes the number of bytes that would be needed to encode a varint. + /// + public static int ComputeRawVarint32Size(uint value) + { + if ((value & (0xffffffff << 7)) == 0) + { + return 1; + } + if ((value & (0xffffffff << 14)) == 0) + { + return 2; + } + if ((value & (0xffffffff << 21)) == 0) + { + return 3; + } + if ((value & (0xffffffff << 28)) == 0) + { + return 4; + } + return 5; + } + + /// + /// Computes the number of bytes that would be needed to encode a varint. + /// + public static int ComputeRawVarint64Size(ulong value) + { + if ((value & (0xffffffffffffffffL << 7)) == 0) + { + return 1; + } + if ((value & (0xffffffffffffffffL << 14)) == 0) + { + return 2; + } + if ((value & (0xffffffffffffffffL << 21)) == 0) + { + return 3; + } + if ((value & (0xffffffffffffffffL << 28)) == 0) + { + return 4; + } + if ((value & (0xffffffffffffffffL << 35)) == 0) + { + return 5; + } + if ((value & (0xffffffffffffffffL << 42)) == 0) + { + return 6; + } + if ((value & (0xffffffffffffffffL << 49)) == 0) + { + return 7; + } + if ((value & (0xffffffffffffffffL << 56)) == 0) + { + return 8; + } + if ((value & (0xffffffffffffffffL << 63)) == 0) + { + return 9; + } + return 10; + } + + /// + /// Computes the number of bytes that would be needed to encode a tag. + /// + public static int ComputeTagSize(int fieldNumber) + { + return ComputeRawVarint32Size(WireFormat.MakeTag(fieldNumber, 0)); + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/CodedOutputStream.cs b/csharp/src/Google.Protobuf/CodedOutputStream.cs index 85586d237418d3c6f5c0c1df1a0ea90a7241bd62..20d88ea7dc9b81cc080ae00445f50a9784b09f54 100644 --- a/csharp/src/Google.Protobuf/CodedOutputStream.cs +++ b/csharp/src/Google.Protobuf/CodedOutputStream.cs @@ -1,609 +1,607 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; -using System.Security; - -namespace Google.Protobuf -{ - /// - /// Encodes and writes protocol message fields. - /// - /// - /// - /// This class is generally used by generated code to write appropriate - /// primitives to the stream. It effectively encapsulates the lowest - /// levels of protocol buffer format. Unlike some other implementations, - /// this does not include combined "write tag and value" methods. Generated - /// code knows the exact byte representations of the tags they're going to write, - /// so there's no need to re-encode them each time. Manually-written code calling - /// this class should just call one of the WriteTag overloads before each value. - /// - /// - /// Repeated fields and map fields are not handled by this class; use RepeatedField<T> - /// and MapField<TKey, TValue> to serialize such fields. - /// - /// - [SecuritySafeCritical] - public sealed partial class CodedOutputStream : IDisposable - { - /// - /// The buffer size used by CreateInstance(Stream). - /// - public static readonly int DefaultBufferSize = 4096; - - private readonly bool leaveOpen; - private readonly byte[] buffer; - private WriterInternalState state; - - private readonly Stream output; - - #region Construction - /// - /// Creates a new CodedOutputStream that writes directly to the given - /// byte array. If more bytes are written than fit in the array, - /// OutOfSpaceException will be thrown. - /// - public CodedOutputStream(byte[] flatArray) : this(flatArray, 0, flatArray.Length) - { - } - - /// - /// Creates a new CodedOutputStream that writes directly to the given - /// byte array slice. If more bytes are written than fit in the array, - /// OutOfSpaceException will be thrown. - /// - private CodedOutputStream(byte[] buffer, int offset, int length) - { - this.output = null; - this.buffer = ProtoPreconditions.CheckNotNull(buffer, nameof(buffer)); - this.state.position = offset; - this.state.limit = offset + length; - WriteBufferHelper.Initialize(this, out this.state.writeBufferHelper); - leaveOpen = true; // Simple way of avoiding trying to dispose of a null reference - } - - private CodedOutputStream(Stream output, byte[] buffer, bool leaveOpen) - { - this.output = ProtoPreconditions.CheckNotNull(output, nameof(output)); - this.buffer = buffer; - this.state.position = 0; - this.state.limit = buffer.Length; - WriteBufferHelper.Initialize(this, out this.state.writeBufferHelper); - this.leaveOpen = leaveOpen; - } - - /// - /// Creates a new which write to the given stream, and disposes of that - /// stream when the returned CodedOutputStream is disposed. - /// - /// The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. - public CodedOutputStream(Stream output) : this(output, DefaultBufferSize, false) - { - } - - /// - /// Creates a new CodedOutputStream which write to the given stream and uses - /// the specified buffer size. - /// - /// The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. - /// The size of buffer to use internally. - public CodedOutputStream(Stream output, int bufferSize) : this(output, new byte[bufferSize], false) - { - } - - /// - /// Creates a new CodedOutputStream which write to the given stream. - /// - /// The stream to write to. - /// If true, is left open when the returned CodedOutputStream is disposed; - /// if false, the provided stream is disposed as well. - public CodedOutputStream(Stream output, bool leaveOpen) : this(output, DefaultBufferSize, leaveOpen) - { - } - - /// - /// Creates a new CodedOutputStream which write to the given stream and uses - /// the specified buffer size. - /// - /// The stream to write to. - /// The size of buffer to use internally. - /// If true, is left open when the returned CodedOutputStream is disposed; - /// if false, the provided stream is disposed as well. - public CodedOutputStream(Stream output, int bufferSize, bool leaveOpen) : this(output, new byte[bufferSize], leaveOpen) - { - } - #endregion - - /// - /// Returns the current position in the stream, or the position in the output buffer - /// - public long Position - { - get - { - if (output != null) - { - return output.Position + state.position; - } - return state.position; - } - } - - /// - /// Configures whether or not serialization is deterministic. - /// - /// - /// Deterministic serialization guarantees that for a given binary, equal messages (defined by the - /// equals methods in protos) will always be serialized to the same bytes. This implies: - /// - /// Repeated serialization of a message will return the same bytes. - /// Different processes of the same binary (which may be executing on different machines) - /// will serialize equal messages to the same bytes. - /// - /// Note the deterministic serialization is NOT canonical across languages; it is also unstable - /// across different builds with schema changes due to unknown fields. Users who need canonical - /// serialization, e.g. persistent storage in a canonical form, fingerprinting, etc, should define - /// their own canonicalization specification and implement the serializer using reflection APIs - /// rather than relying on this API. - /// Once set, the serializer will: (Note this is an implementation detail and may subject to - /// change in the future) - /// - /// Sort map entries by keys in lexicographical order or numerical order. Note: For string - /// keys, the order is based on comparing the UTF-16 code unit value of each character in the strings. - /// The order may be different from the deterministic serialization in other languages where - /// maps are sorted on the lexicographical order of the UTF8 encoded keys. - /// - /// - public bool Deterministic { get; set; } - - #region Writing of values (not including tags) - - /// - /// Writes a double field value, without a tag, to the stream. - /// - /// The value to write - public void WriteDouble(double value) - { - var span = new Span(buffer); - WritingPrimitives.WriteDouble(ref span, ref state, value); - } - - /// - /// Writes a float field value, without a tag, to the stream. - /// - /// The value to write - public void WriteFloat(float value) - { - var span = new Span(buffer); - WritingPrimitives.WriteFloat(ref span, ref state, value); - } - - /// - /// Writes a uint64 field value, without a tag, to the stream. - /// - /// The value to write - public void WriteUInt64(ulong value) - { - var span = new Span(buffer); - WritingPrimitives.WriteUInt64(ref span, ref state, value); - } - - /// - /// Writes an int64 field value, without a tag, to the stream. - /// - /// The value to write - public void WriteInt64(long value) - { - var span = new Span(buffer); - WritingPrimitives.WriteInt64(ref span, ref state, value); - } - - /// - /// Writes an int32 field value, without a tag, to the stream. - /// - /// The value to write - public void WriteInt32(int value) - { - var span = new Span(buffer); - WritingPrimitives.WriteInt32(ref span, ref state, value); - } - - /// - /// Writes a fixed64 field value, without a tag, to the stream. - /// - /// The value to write - public void WriteFixed64(ulong value) - { - var span = new Span(buffer); - WritingPrimitives.WriteFixed64(ref span, ref state, value); - } - - /// - /// Writes a fixed32 field value, without a tag, to the stream. - /// - /// The value to write - public void WriteFixed32(uint value) - { - var span = new Span(buffer); - WritingPrimitives.WriteFixed32(ref span, ref state, value); - } - - /// - /// Writes a bool field value, without a tag, to the stream. - /// - /// The value to write - public void WriteBool(bool value) - { - var span = new Span(buffer); - WritingPrimitives.WriteBool(ref span, ref state, value); - } - - /// - /// Writes a string field value, without a tag, to the stream. - /// The data is length-prefixed. - /// - /// The value to write - public void WriteString(string value) - { - var span = new Span(buffer); - WritingPrimitives.WriteString(ref span, ref state, value); - } - - /// - /// Writes a message, without a tag, to the stream. - /// The data is length-prefixed. - /// - /// The value to write - public void WriteMessage(IMessage value) - { - // TODO: if the message doesn't implement IBufferMessage (and thus does not provide the InternalWriteTo method), - // what we're doing here works fine, but could be more efficient. - // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). - var span = new Span(buffer); - WriteContext.Initialize(ref span, ref state, out WriteContext ctx); - try - { - WritingPrimitivesMessages.WriteMessage(ref ctx, value); - } - finally - { - ctx.CopyStateTo(this); - } - } - - /// - /// Writes a message, without a tag, to the stream. - /// Only the message data is written, without a length-delimiter. - /// - /// The value to write - public void WriteRawMessage(IMessage value) - { - // TODO: if the message doesn't implement IBufferMessage (and thus does not provide the InternalWriteTo method), - // what we're doing here works fine, but could be more efficient. - // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). - var span = new Span(buffer); - WriteContext.Initialize(ref span, ref state, out WriteContext ctx); - try - { - WritingPrimitivesMessages.WriteRawMessage(ref ctx, value); - } - finally - { - ctx.CopyStateTo(this); - } - } - - /// - /// Writes a group, without a tag, to the stream. - /// - /// The value to write - public void WriteGroup(IMessage value) - { - var span = new Span(buffer); - WriteContext.Initialize(ref span, ref state, out WriteContext ctx); - try - { - WritingPrimitivesMessages.WriteGroup(ref ctx, value); - } - finally - { - ctx.CopyStateTo(this); - } - } - - /// - /// Write a byte string, without a tag, to the stream. - /// The data is length-prefixed. - /// - /// The value to write - public void WriteBytes(ByteString value) - { - var span = new Span(buffer); - WritingPrimitives.WriteBytes(ref span, ref state, value); - } - - /// - /// Writes a uint32 value, without a tag, to the stream. - /// - /// The value to write - public void WriteUInt32(uint value) - { - var span = new Span(buffer); - WritingPrimitives.WriteUInt32(ref span, ref state, value); - } - - /// - /// Writes an enum value, without a tag, to the stream. - /// - /// The value to write - public void WriteEnum(int value) - { - var span = new Span(buffer); - WritingPrimitives.WriteEnum(ref span, ref state, value); - } - - /// - /// Writes an sfixed32 value, without a tag, to the stream. - /// - /// The value to write. - public void WriteSFixed32(int value) - { - var span = new Span(buffer); - WritingPrimitives.WriteSFixed32(ref span, ref state, value); - } - - /// - /// Writes an sfixed64 value, without a tag, to the stream. - /// - /// The value to write - public void WriteSFixed64(long value) - { - var span = new Span(buffer); - WritingPrimitives.WriteSFixed64(ref span, ref state, value); - } - - /// - /// Writes an sint32 value, without a tag, to the stream. - /// - /// The value to write - public void WriteSInt32(int value) - { - var span = new Span(buffer); - WritingPrimitives.WriteSInt32(ref span, ref state, value); - } - - /// - /// Writes an sint64 value, without a tag, to the stream. - /// - /// The value to write - public void WriteSInt64(long value) - { - var span = new Span(buffer); - WritingPrimitives.WriteSInt64(ref span, ref state, value); - } - - /// - /// Writes a length (in bytes) for length-delimited data. - /// - /// - /// This method simply writes a rawint, but exists for clarity in calling code. - /// - /// Length value, in bytes. - public void WriteLength(int length) - { - var span = new Span(buffer); - WritingPrimitives.WriteLength(ref span, ref state, length); - } - - #endregion - - #region Raw tag writing - /// - /// Encodes and writes a tag. - /// - /// The number of the field to write the tag for - /// The wire format type of the tag to write - public void WriteTag(int fieldNumber, WireFormat.WireType type) - { - var span = new Span(buffer); - WritingPrimitives.WriteTag(ref span, ref state, fieldNumber, type); - } - - /// - /// Writes an already-encoded tag. - /// - /// The encoded tag - public void WriteTag(uint tag) - { - var span = new Span(buffer); - WritingPrimitives.WriteTag(ref span, ref state, tag); - } - - /// - /// Writes the given single-byte tag directly to the stream. - /// - /// The encoded tag - public void WriteRawTag(byte b1) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawTag(ref span, ref state, b1); - } - - /// - /// Writes the given two-byte tag directly to the stream. - /// - /// The first byte of the encoded tag - /// The second byte of the encoded tag - public void WriteRawTag(byte b1, byte b2) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2); - } - - /// - /// Writes the given three-byte tag directly to the stream. - /// - /// The first byte of the encoded tag - /// The second byte of the encoded tag - /// The third byte of the encoded tag - public void WriteRawTag(byte b1, byte b2, byte b3) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3); - } - - /// - /// Writes the given four-byte tag directly to the stream. - /// - /// The first byte of the encoded tag - /// The second byte of the encoded tag - /// The third byte of the encoded tag - /// The fourth byte of the encoded tag - public void WriteRawTag(byte b1, byte b2, byte b3, byte b4) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4); - } - - /// - /// Writes the given five-byte tag directly to the stream. - /// - /// The first byte of the encoded tag - /// The second byte of the encoded tag - /// The third byte of the encoded tag - /// The fourth byte of the encoded tag - /// The fifth byte of the encoded tag - public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4, b5); - } - #endregion - - #region Underlying writing primitives - - /// - /// Writes a 32 bit value as a varint. The fast route is taken when - /// there's enough buffer space left to whizz through without checking - /// for each byte; otherwise, we resort to calling WriteRawByte each time. - /// - internal void WriteRawVarint32(uint value) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawVarint32(ref span, ref state, value); - } - - internal void WriteRawVarint64(ulong value) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawVarint64(ref span, ref state, value); - } - - internal void WriteRawLittleEndian32(uint value) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawLittleEndian32(ref span, ref state, value); - } - - internal void WriteRawLittleEndian64(ulong value) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawLittleEndian64(ref span, ref state, value); - } - - /// - /// Writes out an array of bytes. - /// - internal void WriteRawBytes(byte[] value) - { - WriteRawBytes(value, 0, value.Length); - } - - /// - /// Writes out part of an array of bytes. - /// - internal void WriteRawBytes(byte[] value, int offset, int length) - { - var span = new Span(buffer); - WritingPrimitives.WriteRawBytes(ref span, ref state, value, offset, length); - } - - #endregion - - /// - /// Indicates that a CodedOutputStream wrapping a flat byte array - /// ran out of space. - /// - public sealed class OutOfSpaceException : IOException - { - internal OutOfSpaceException() - : base("CodedOutputStream was writing to a flat byte array and ran out of space.") - { - } - } - - /// - /// Flushes any buffered data and optionally closes the underlying stream, if any. - /// - /// - /// - /// By default, any underlying stream is closed by this method. To configure this behaviour, - /// use a constructor overload with a leaveOpen parameter. If this instance does not - /// have an underlying stream, this method does nothing. - /// - /// - /// For the sake of efficiency, calling this method does not prevent future write calls - but - /// if a later write ends up writing to a stream which has been disposed, that is likely to - /// fail. It is recommend that you not call any other methods after this. - /// - /// - public void Dispose() - { - Flush(); - if (!leaveOpen) - { - output.Dispose(); - } - } - - /// - /// Flushes any buffered data to the underlying stream (if there is one). - /// - public void Flush() - { - var span = new Span(buffer); - WriteBufferHelper.Flush(ref span, ref state); - } - - /// - /// Verifies that SpaceLeft returns zero. It's common to create a byte array - /// that is exactly big enough to hold a message, then write to it with - /// a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that - /// the message was actually as big as expected, which can help finding bugs. - /// - public void CheckNoSpaceLeft() - { - WriteBufferHelper.CheckNoSpaceLeft(ref state); - } - - /// - /// If writing to a flat array, returns the space left in the array. Otherwise, - /// throws an InvalidOperationException. - /// - public int SpaceLeft => WriteBufferHelper.GetSpaceLeft(ref state); - - internal byte[] InternalBuffer => buffer; - - internal Stream InternalOutputStream => output; - - internal ref WriterInternalState InternalState => ref state; - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Google.Protobuf.Collections; +using System; +using System.IO; +using System.Security; +using System.Text; + +namespace Google.Protobuf +{ + /// + /// Encodes and writes protocol message fields. + /// + /// + /// + /// This class is generally used by generated code to write appropriate + /// primitives to the stream. It effectively encapsulates the lowest + /// levels of protocol buffer format. Unlike some other implementations, + /// this does not include combined "write tag and value" methods. Generated + /// code knows the exact byte representations of the tags they're going to write, + /// so there's no need to re-encode them each time. Manually-written code calling + /// this class should just call one of the WriteTag overloads before each value. + /// + /// + /// Repeated fields and map fields are not handled by this class; use RepeatedField<T> + /// and MapField<TKey, TValue> to serialize such fields. + /// + /// + [SecuritySafeCritical] + public sealed partial class CodedOutputStream : IDisposable + { + /// + /// The buffer size used by CreateInstance(Stream). + /// + public static readonly int DefaultBufferSize = 4096; + + private readonly bool leaveOpen; + private readonly byte[] buffer; + private WriterInternalState state; + + private readonly Stream output; + + #region Construction + /// + /// Creates a new CodedOutputStream that writes directly to the given + /// byte array. If more bytes are written than fit in the array, + /// OutOfSpaceException will be thrown. + /// + public CodedOutputStream(byte[] flatArray) : this(flatArray, 0, flatArray.Length) + { + } + + /// + /// Creates a new CodedOutputStream that writes directly to the given + /// byte array slice. If more bytes are written than fit in the array, + /// OutOfSpaceException will be thrown. + /// + private CodedOutputStream(byte[] buffer, int offset, int length) + { + this.output = null; + this.buffer = ProtoPreconditions.CheckNotNull(buffer, nameof(buffer)); + this.state.position = offset; + this.state.limit = offset + length; + WriteBufferHelper.Initialize(this, out this.state.writeBufferHelper); + leaveOpen = true; // Simple way of avoiding trying to dispose of a null reference + } + + private CodedOutputStream(Stream output, byte[] buffer, bool leaveOpen) + { + this.output = ProtoPreconditions.CheckNotNull(output, nameof(output)); + this.buffer = buffer; + this.state.position = 0; + this.state.limit = buffer.Length; + WriteBufferHelper.Initialize(this, out this.state.writeBufferHelper); + this.leaveOpen = leaveOpen; + } + + /// + /// Creates a new which write to the given stream, and disposes of that + /// stream when the returned CodedOutputStream is disposed. + /// + /// The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. + public CodedOutputStream(Stream output) : this(output, DefaultBufferSize, false) + { + } + + /// + /// Creates a new CodedOutputStream which write to the given stream and uses + /// the specified buffer size. + /// + /// The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. + /// The size of buffer to use internally. + public CodedOutputStream(Stream output, int bufferSize) : this(output, new byte[bufferSize], false) + { + } + + /// + /// Creates a new CodedOutputStream which write to the given stream. + /// + /// The stream to write to. + /// If true, is left open when the returned CodedOutputStream is disposed; + /// if false, the provided stream is disposed as well. + public CodedOutputStream(Stream output, bool leaveOpen) : this(output, DefaultBufferSize, leaveOpen) + { + } + + /// + /// Creates a new CodedOutputStream which write to the given stream and uses + /// the specified buffer size. + /// + /// The stream to write to. + /// The size of buffer to use internally. + /// If true, is left open when the returned CodedOutputStream is disposed; + /// if false, the provided stream is disposed as well. + public CodedOutputStream(Stream output, int bufferSize, bool leaveOpen) : this(output, new byte[bufferSize], leaveOpen) + { + } + #endregion + + /// + /// Returns the current position in the stream, or the position in the output buffer + /// + public long Position + { + get + { + if (output != null) + { + return output.Position + state.position; + } + return state.position; + } + } + + #region Writing of values (not including tags) + + /// + /// Writes a double field value, without a tag, to the stream. + /// + /// The value to write + public void WriteDouble(double value) + { + var span = new Span(buffer); + WritingPrimitives.WriteDouble(ref span, ref state, value); + } + + /// + /// Writes a float field value, without a tag, to the stream. + /// + /// The value to write + public void WriteFloat(float value) + { + var span = new Span(buffer); + WritingPrimitives.WriteFloat(ref span, ref state, value); + } + + /// + /// Writes a uint64 field value, without a tag, to the stream. + /// + /// The value to write + public void WriteUInt64(ulong value) + { + var span = new Span(buffer); + WritingPrimitives.WriteUInt64(ref span, ref state, value); + } + + /// + /// Writes an int64 field value, without a tag, to the stream. + /// + /// The value to write + public void WriteInt64(long value) + { + var span = new Span(buffer); + WritingPrimitives.WriteInt64(ref span, ref state, value); + } + + /// + /// Writes an int32 field value, without a tag, to the stream. + /// + /// The value to write + public void WriteInt32(int value) + { + var span = new Span(buffer); + WritingPrimitives.WriteInt32(ref span, ref state, value); + } + + /// + /// Writes a fixed64 field value, without a tag, to the stream. + /// + /// The value to write + public void WriteFixed64(ulong value) + { + var span = new Span(buffer); + WritingPrimitives.WriteFixed64(ref span, ref state, value); + } + + /// + /// Writes a fixed32 field value, without a tag, to the stream. + /// + /// The value to write + public void WriteFixed32(uint value) + { + var span = new Span(buffer); + WritingPrimitives.WriteFixed32(ref span, ref state, value); + } + + /// + /// Writes a bool field value, without a tag, to the stream. + /// + /// The value to write + public void WriteBool(bool value) + { + var span = new Span(buffer); + WritingPrimitives.WriteBool(ref span, ref state, value); + } + + /// + /// Writes a string field value, without a tag, to the stream. + /// The data is length-prefixed. + /// + /// The value to write + public void WriteString(string value) + { + var span = new Span(buffer); + WritingPrimitives.WriteString(ref span, ref state, value); + } + + /// + /// Writes a message, without a tag, to the stream. + /// The data is length-prefixed. + /// + /// The value to write + public void WriteMessage(IMessage value) + { + // TODO(jtattermusch): if the message doesn't implement IBufferMessage (and thus does not provide the InternalWriteTo method), + // what we're doing here works fine, but could be more efficient. + // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). + var span = new Span(buffer); + WriteContext.Initialize(ref span, ref state, out WriteContext ctx); + try + { + WritingPrimitivesMessages.WriteMessage(ref ctx, value); + } + finally + { + ctx.CopyStateTo(this); + } + } + + /// + /// Writes a message, without a tag, to the stream. + /// Only the message data is written, without a length-delimiter. + /// + /// The value to write + public void WriteRawMessage(IMessage value) + { + // TODO(jtattermusch): if the message doesn't implement IBufferMessage (and thus does not provide the InternalWriteTo method), + // what we're doing here works fine, but could be more efficient. + // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). + var span = new Span(buffer); + WriteContext.Initialize(ref span, ref state, out WriteContext ctx); + try + { + WritingPrimitivesMessages.WriteRawMessage(ref ctx, value); + } + finally + { + ctx.CopyStateTo(this); + } + } + + /// + /// Writes a group, without a tag, to the stream. + /// + /// The value to write + public void WriteGroup(IMessage value) + { + var span = new Span(buffer); + WriteContext.Initialize(ref span, ref state, out WriteContext ctx); + try + { + WritingPrimitivesMessages.WriteGroup(ref ctx, value); + } + finally + { + ctx.CopyStateTo(this); + } + } + + /// + /// Write a byte string, without a tag, to the stream. + /// The data is length-prefixed. + /// + /// The value to write + public void WriteBytes(ByteString value) + { + var span = new Span(buffer); + WritingPrimitives.WriteBytes(ref span, ref state, value); + } + + /// + /// Writes a uint32 value, without a tag, to the stream. + /// + /// The value to write + public void WriteUInt32(uint value) + { + var span = new Span(buffer); + WritingPrimitives.WriteUInt32(ref span, ref state, value); + } + + /// + /// Writes an enum value, without a tag, to the stream. + /// + /// The value to write + public void WriteEnum(int value) + { + var span = new Span(buffer); + WritingPrimitives.WriteEnum(ref span, ref state, value); + } + + /// + /// Writes an sfixed32 value, without a tag, to the stream. + /// + /// The value to write. + public void WriteSFixed32(int value) + { + var span = new Span(buffer); + WritingPrimitives.WriteSFixed32(ref span, ref state, value); + } + + /// + /// Writes an sfixed64 value, without a tag, to the stream. + /// + /// The value to write + public void WriteSFixed64(long value) + { + var span = new Span(buffer); + WritingPrimitives.WriteSFixed64(ref span, ref state, value); + } + + /// + /// Writes an sint32 value, without a tag, to the stream. + /// + /// The value to write + public void WriteSInt32(int value) + { + var span = new Span(buffer); + WritingPrimitives.WriteSInt32(ref span, ref state, value); + } + + /// + /// Writes an sint64 value, without a tag, to the stream. + /// + /// The value to write + public void WriteSInt64(long value) + { + var span = new Span(buffer); + WritingPrimitives.WriteSInt64(ref span, ref state, value); + } + + /// + /// Writes a length (in bytes) for length-delimited data. + /// + /// + /// This method simply writes a rawint, but exists for clarity in calling code. + /// + /// Length value, in bytes. + public void WriteLength(int length) + { + var span = new Span(buffer); + WritingPrimitives.WriteLength(ref span, ref state, length); + } + + #endregion + + #region Raw tag writing + /// + /// Encodes and writes a tag. + /// + /// The number of the field to write the tag for + /// The wire format type of the tag to write + public void WriteTag(int fieldNumber, WireFormat.WireType type) + { + var span = new Span(buffer); + WritingPrimitives.WriteTag(ref span, ref state, fieldNumber, type); + } + + /// + /// Writes an already-encoded tag. + /// + /// The encoded tag + public void WriteTag(uint tag) + { + var span = new Span(buffer); + WritingPrimitives.WriteTag(ref span, ref state, tag); + } + + /// + /// Writes the given single-byte tag directly to the stream. + /// + /// The encoded tag + public void WriteRawTag(byte b1) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1); + } + + /// + /// Writes the given two-byte tag directly to the stream. + /// + /// The first byte of the encoded tag + /// The second byte of the encoded tag + public void WriteRawTag(byte b1, byte b2) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2); + } + + /// + /// Writes the given three-byte tag directly to the stream. + /// + /// The first byte of the encoded tag + /// The second byte of the encoded tag + /// The third byte of the encoded tag + public void WriteRawTag(byte b1, byte b2, byte b3) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3); + } + + /// + /// Writes the given four-byte tag directly to the stream. + /// + /// The first byte of the encoded tag + /// The second byte of the encoded tag + /// The third byte of the encoded tag + /// The fourth byte of the encoded tag + public void WriteRawTag(byte b1, byte b2, byte b3, byte b4) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4); + } + + /// + /// Writes the given five-byte tag directly to the stream. + /// + /// The first byte of the encoded tag + /// The second byte of the encoded tag + /// The third byte of the encoded tag + /// The fourth byte of the encoded tag + /// The fifth byte of the encoded tag + public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4, b5); + } + #endregion + + #region Underlying writing primitives + + /// + /// Writes a 32 bit value as a varint. The fast route is taken when + /// there's enough buffer space left to whizz through without checking + /// for each byte; otherwise, we resort to calling WriteRawByte each time. + /// + internal void WriteRawVarint32(uint value) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawVarint32(ref span, ref state, value); + } + + internal void WriteRawVarint64(ulong value) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawVarint64(ref span, ref state, value); + } + + internal void WriteRawLittleEndian32(uint value) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawLittleEndian32(ref span, ref state, value); + } + + internal void WriteRawLittleEndian64(ulong value) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawLittleEndian64(ref span, ref state, value); + } + + /// + /// Writes out an array of bytes. + /// + internal void WriteRawBytes(byte[] value) + { + WriteRawBytes(value, 0, value.Length); + } + + /// + /// Writes out part of an array of bytes. + /// + internal void WriteRawBytes(byte[] value, int offset, int length) + { + var span = new Span(buffer); + WritingPrimitives.WriteRawBytes(ref span, ref state, value, offset, length); + } + + #endregion + + /// + /// Indicates that a CodedOutputStream wrapping a flat byte array + /// ran out of space. + /// + public sealed class OutOfSpaceException : IOException + { + internal OutOfSpaceException() + : base("CodedOutputStream was writing to a flat byte array and ran out of space.") + { + } + } + + /// + /// Flushes any buffered data and optionally closes the underlying stream, if any. + /// + /// + /// + /// By default, any underlying stream is closed by this method. To configure this behaviour, + /// use a constructor overload with a leaveOpen parameter. If this instance does not + /// have an underlying stream, this method does nothing. + /// + /// + /// For the sake of efficiency, calling this method does not prevent future write calls - but + /// if a later write ends up writing to a stream which has been disposed, that is likely to + /// fail. It is recommend that you not call any other methods after this. + /// + /// + public void Dispose() + { + Flush(); + if (!leaveOpen) + { + output.Dispose(); + } + } + + /// + /// Flushes any buffered data to the underlying stream (if there is one). + /// + public void Flush() + { + var span = new Span(buffer); + WriteBufferHelper.Flush(ref span, ref state); + } + + /// + /// Verifies that SpaceLeft returns zero. It's common to create a byte array + /// that is exactly big enough to hold a message, then write to it with + /// a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that + /// the message was actually as big as expected, which can help finding bugs. + /// + public void CheckNoSpaceLeft() + { + WriteBufferHelper.CheckNoSpaceLeft(ref state); + } + + /// + /// If writing to a flat array, returns the space left in the array. Otherwise, + /// throws an InvalidOperationException. + /// + public int SpaceLeft => WriteBufferHelper.GetSpaceLeft(ref state); + + internal byte[] InternalBuffer => buffer; + + internal Stream InternalOutputStream => output; + + internal ref WriterInternalState InternalState => ref state; + } +} diff --git a/csharp/src/Google.Protobuf/Collections/Lists.cs b/csharp/src/Google.Protobuf/Collections/Lists.cs index 149aeac75c6573c5a3dfb8c3024ffb1366be2cd6..860795ceeff8b658d0ea7e50e426aee73d141298 100644 --- a/csharp/src/Google.Protobuf/Collections/Lists.cs +++ b/csharp/src/Google.Protobuf/Collections/Lists.cs @@ -1,13 +1,37 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.Collections.Generic; +using System.Collections.ObjectModel; namespace Google.Protobuf.Collections { diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index 722cc92322ef98d93032b2389a7eb2eb94ed5c41..d60ebc5a8a581c64a6ceb94429f1e8e5489ff189 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -1,737 +1,841 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.Compatibility; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Security; - -namespace Google.Protobuf.Collections -{ - /// - /// Representation of a map field in a Protocol Buffer message. - /// - /// Key type in the map. Must be a type supported by Protocol Buffer map keys. - /// Value type in the map. Must be a type supported by Protocol Buffers. - /// - /// - /// For string keys, the equality comparison is provided by . - /// - /// - /// Null values are not permitted in the map, either for wrapper types or regular messages. - /// If a map is deserialized from a data stream and the value is missing from an entry, a default value - /// is created instead. For primitive types, that is the regular default value (0, the empty string and so - /// on); for message types, an empty instance of the message is created, as if the map entry contained a 0-length - /// encoded value for the field. - /// - /// - /// This implementation does not generally prohibit the use of key/value types which are not - /// supported by Protocol Buffers (e.g. using a key type of byte) but nor does it guarantee - /// that all operations will work in such cases. - /// - /// - /// The order in which entries are returned when iterating over this object is undefined, and may change - /// in future versions. - /// - /// - [DebuggerDisplay("Count = {Count}")] - [DebuggerTypeProxy(typeof(MapField<,>.MapFieldDebugView))] - public sealed class MapField : IDeepCloneable>, IDictionary, IEquatable>, IDictionary, IReadOnlyDictionary - { - private static readonly EqualityComparer ValueEqualityComparer = ProtobufEqualityComparers.GetEqualityComparer(); - private static readonly EqualityComparer KeyEqualityComparer = ProtobufEqualityComparers.GetEqualityComparer(); - - // TODO: Don't create the map/list until we have an entry. (Assume many maps will be empty.) - private readonly Dictionary>> map = new(KeyEqualityComparer); - private readonly LinkedList> list = new(); - - /// - /// Creates a deep clone of this object. - /// - /// - /// A deep clone of this object. - /// - public MapField Clone() - { - var clone = new MapField(); - // Keys are never cloneable. Values might be. - if (typeof(IDeepCloneable).IsAssignableFrom(typeof(TValue))) - { - foreach (var pair in list) - { - clone.Add(pair.Key, ((IDeepCloneable)pair.Value).Clone()); - } - } - else - { - // Nothing is cloneable, so we don't need to worry. - clone.Add(this); - } - return clone; - } - - /// - /// Adds the specified key/value pair to the map. - /// - /// - /// This operation fails if the key already exists in the map. To replace an existing entry, use the indexer. - /// - /// The key to add - /// The value to add. - /// The given key already exists in map. - public void Add(TKey key, TValue value) - { - // Validation of arguments happens in ContainsKey and the indexer - if (ContainsKey(key)) - { - throw new ArgumentException("Key already exists in map", nameof(key)); - } - this[key] = value; - } - - /// - /// Determines whether the specified key is present in the map. - /// - /// The key to check. - /// true if the map contains the given key; false otherwise. - public bool ContainsKey(TKey key) - { - ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); - return map.ContainsKey(key); - } - - private bool ContainsValue(TValue value) => - list.Any(pair => ValueEqualityComparer.Equals(pair.Value, value)); - - /// - /// Removes the entry identified by the given key from the map. - /// - /// The key indicating the entry to remove from the map. - /// true if the map contained the given key before the entry was removed; false otherwise. - public bool Remove(TKey key) - { - ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); - if (map.TryGetValue(key, out LinkedListNode> node)) - { - map.Remove(key); - node.List.Remove(node); - return true; - } - else - { - return false; - } - } - - /// - /// Gets the value associated with the specified key. - /// - /// The key whose value to get. - /// When this method returns, the value associated with the specified key, if the key is found; - /// otherwise, the default value for the type of the parameter. - /// This parameter is passed uninitialized. - /// true if the map contains an element with the specified key; otherwise, false. - public bool TryGetValue(TKey key, out TValue value) - { - if (map.TryGetValue(key, out LinkedListNode> node)) - { - value = node.Value.Value; - return true; - } - else - { - value = default; - return false; - } - } - - /// - /// Gets or sets the value associated with the specified key. - /// - /// The key of the value to get or set. - /// The property is retrieved and key does not exist in the collection. - /// The value associated with the specified key. If the specified key is not found, - /// a get operation throws a , and a set operation creates a new element with the specified key. - public TValue this[TKey key] - { - get - { - ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); - if (TryGetValue(key, out TValue value)) - { - return value; - } - throw new KeyNotFoundException(); - } - set - { - ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); - // value == null check here is redundant, but avoids boxing. - if (value == null) - { - ProtoPreconditions.CheckNotNullUnconstrained(value, nameof(value)); - } - var pair = new KeyValuePair(key, value); - if (map.TryGetValue(key, out LinkedListNode> node)) - { - node.Value = pair; - } - else - { - node = list.AddLast(pair); - map[key] = node; - } - } - } - - /// - /// Gets a collection containing the keys in the map. - /// - public ICollection Keys => new MapView(this, pair => pair.Key, ContainsKey); - - /// - /// Gets a collection containing the values in the map. - /// - public ICollection Values => new MapView(this, pair => pair.Value, ContainsValue); - - /// - /// Adds the specified entries to the map. The keys and values are not automatically cloned. - /// - /// The entries to add to the map. - public void Add(IDictionary entries) - { - ProtoPreconditions.CheckNotNull(entries, nameof(entries)); - foreach (var pair in entries) - { - Add(pair.Key, pair.Value); - } - } - - /// - /// Adds the specified entries to the map, replacing any existing entries with the same keys. - /// The keys and values are not automatically cloned. - /// - /// This method primarily exists to be called from MergeFrom methods in generated classes for messages. - /// The entries to add to the map. - public void MergeFrom(IDictionary entries) - { - ProtoPreconditions.CheckNotNull(entries, nameof(entries)); - foreach (var pair in entries) - { - this[pair.Key] = pair.Value; - } - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// - /// An enumerator that can be used to iterate through the collection. - /// - public IEnumerator> GetEnumerator() => list.GetEnumerator(); - - /// - /// Returns an enumerator that iterates through a collection. - /// - /// - /// An object that can be used to iterate through the collection. - /// - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - - /// - /// Adds the specified item to the map. - /// - /// The item to add to the map. - void ICollection>.Add(KeyValuePair item) => Add(item.Key, item.Value); - - /// - /// Removes all items from the map. - /// - public void Clear() - { - list.Clear(); - map.Clear(); - } - - /// - /// Determines whether map contains an entry equivalent to the given key/value pair. - /// - /// The key/value pair to find. - /// - bool ICollection>.Contains(KeyValuePair item) => - TryGetValue(item.Key, out TValue value) && ValueEqualityComparer.Equals(item.Value, value); - - /// - /// Copies the key/value pairs in this map to an array. - /// - /// The array to copy the entries into. - /// The index of the array at which to start copying values. - void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => - list.CopyTo(array, arrayIndex); - - /// - /// Removes the specified key/value pair from the map. - /// - /// Both the key and the value must be found for the entry to be removed. - /// The key/value pair to remove. - /// true if the key/value pair was found and removed; false otherwise. - bool ICollection>.Remove(KeyValuePair item) - { - if (item.Key == null) - { - throw new ArgumentException("Key is null", nameof(item)); - } - if (map.TryGetValue(item.Key, out LinkedListNode> node) && - EqualityComparer.Default.Equals(item.Value, node.Value.Value)) - { - map.Remove(item.Key); - node.List.Remove(node); - return true; - } - else - { - return false; - } - } - - /// - /// Gets the number of elements contained in the map. - /// - public int Count => list.Count; - - /// - /// Gets a value indicating whether the map is read-only. - /// - public bool IsReadOnly => false; - - /// - /// Determines whether the specified , is equal to this instance. - /// - /// The to compare with this instance. - /// - /// true if the specified is equal to this instance; otherwise, false. - /// - public override bool Equals(object other) => Equals(other as MapField); - - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() - { - var keyComparer = KeyEqualityComparer; - var valueComparer = ValueEqualityComparer; - int hash = 0; - foreach (var pair in list) - { - hash ^= keyComparer.GetHashCode(pair.Key) * 31 + valueComparer.GetHashCode(pair.Value); - } - return hash; - } - - /// - /// Compares this map with another for equality. - /// - /// - /// The order of the key/value pairs in the maps is not deemed significant in this comparison. - /// - /// The map to compare this with. - /// true if refers to an equal map; false otherwise. - public bool Equals(MapField other) - { - if (other == null) - { - return false; - } - if (other == this) - { - return true; - } - if (other.Count != this.Count) - { - return false; - } - var valueComparer = ValueEqualityComparer; - foreach (var pair in this) - { - if (!other.TryGetValue(pair.Key, out TValue value)) - { - return false; - } - if (!valueComparer.Equals(value, pair.Value)) - { - return false; - } - } - return true; - } - - /// - /// Adds entries to the map from the given stream. - /// - /// - /// It is assumed that the stream is initially positioned after the tag specified by the codec. - /// This method will continue reading entries from the stream until the end is reached, or - /// a different tag is encountered. - /// - /// Stream to read from - /// Codec describing how the key/value pairs are encoded - public void AddEntriesFrom(CodedInputStream input, Codec codec) - { - ParseContext.Initialize(input, out ParseContext ctx); - try - { - AddEntriesFrom(ref ctx, codec); - } - finally - { - ctx.CopyStateTo(input); - } - } - - /// - /// Adds entries to the map from the given parse context. - /// - /// - /// It is assumed that the input is initially positioned after the tag specified by the codec. - /// This method will continue reading entries from the input until the end is reached, or - /// a different tag is encountered. - /// - /// Input to read from - /// Codec describing how the key/value pairs are encoded - [SecuritySafeCritical] - public void AddEntriesFrom(ref ParseContext ctx, Codec codec) - { - do - { - KeyValuePair entry = ParsingPrimitivesMessages.ReadMapEntry(ref ctx, codec); - this[entry.Key] = entry.Value; - } while (ParsingPrimitives.MaybeConsumeTag(ref ctx.buffer, ref ctx.state, codec.MapTag)); - } - - /// - /// Writes the contents of this map to the given coded output stream, using the specified codec - /// to encode each entry. - /// - /// The output stream to write to. - /// The codec to use for each entry. - public void WriteTo(CodedOutputStream output, Codec codec) - { - WriteContext.Initialize(output, out WriteContext ctx); - try - { - IEnumerable> listToWrite = list; - - if (output.Deterministic) - { - listToWrite = GetSortedListCopy(list); - } - WriteTo(ref ctx, codec, listToWrite); - } - finally - { - ctx.CopyStateTo(output); - } - } - - internal IEnumerable> GetSortedListCopy(IEnumerable> listToSort) - { - // We can't sort the list in place, as that would invalidate the linked list. - // Instead, we create a new list, sort that, and then write it out. - var listToWrite = new List>(listToSort); - listToWrite.Sort((pair1, pair2) => - { - if (typeof(TKey) == typeof(string)) - { - // Use Ordinal, otherwise Comparer.Default uses StringComparer.CurrentCulture - return StringComparer.Ordinal.Compare(pair1.Key.ToString(), pair2.Key.ToString()); - } - return Comparer.Default.Compare(pair1.Key, pair2.Key); - }); - return listToWrite; - } - - /// - /// Writes the contents of this map to the given write context, using the specified codec - /// to encode each entry. - /// - /// The write context to write to. - /// The codec to use for each entry. - [SecuritySafeCritical] - public void WriteTo(ref WriteContext ctx, Codec codec) - { - IEnumerable> listToWrite = list; - if (ctx.state.CodedOutputStream?.Deterministic ?? false) - { - listToWrite = GetSortedListCopy(list); - } - WriteTo(ref ctx, codec, listToWrite); - } - - [SecuritySafeCritical] - private void WriteTo(ref WriteContext ctx, Codec codec, IEnumerable> listKvp) - { - foreach (var entry in listKvp) - { - ctx.WriteTag(codec.MapTag); - - WritingPrimitives.WriteLength(ref ctx.buffer, ref ctx.state, CalculateEntrySize(codec, entry)); - codec.KeyCodec.WriteTagAndValue(ref ctx, entry.Key); - codec.ValueCodec.WriteTagAndValue(ref ctx, entry.Value); - } - } - - /// - /// Calculates the size of this map based on the given entry codec. - /// - /// The codec to use to encode each entry. - /// - public int CalculateSize(Codec codec) - { - if (Count == 0) - { - return 0; - } - int size = 0; - foreach (var entry in list) - { - int entrySize = CalculateEntrySize(codec, entry); - - size += CodedOutputStream.ComputeRawVarint32Size(codec.MapTag); - size += CodedOutputStream.ComputeLengthSize(entrySize) + entrySize; - } - return size; - } - - private static int CalculateEntrySize(Codec codec, KeyValuePair entry) - { - return codec.KeyCodec.CalculateSizeWithTag(entry.Key) + codec.ValueCodec.CalculateSizeWithTag(entry.Value); - } - - /// - /// Returns a string representation of this repeated field, in the same - /// way as it would be represented by the default JSON formatter. - /// - public override string ToString() - { - var writer = new StringWriter(); - JsonFormatter.Default.WriteDictionary(writer, this); - return writer.ToString(); - } - - #region IDictionary explicit interface implementation - - void IDictionary.Add(object key, object value) => Add((TKey)key, (TValue)value); - - bool IDictionary.Contains(object key) => key is TKey k && ContainsKey(k); - - IDictionaryEnumerator IDictionary.GetEnumerator() => new DictionaryEnumerator(GetEnumerator()); - - void IDictionary.Remove(object key) - { - ProtoPreconditions.CheckNotNull(key, nameof(key)); - if (key is TKey k) - { - Remove(k); - } - } - - void ICollection.CopyTo(Array array, int index) - { - // This is ugly and slow as heck, but with any luck it will never be used anyway. - ICollection temp = this.Select(pair => new DictionaryEntry(pair.Key, pair.Value)).ToList(); - temp.CopyTo(array, index); - } - - bool IDictionary.IsFixedSize => false; - - ICollection IDictionary.Keys => (ICollection)Keys; - - ICollection IDictionary.Values => (ICollection)Values; - - bool ICollection.IsSynchronized => false; - - object ICollection.SyncRoot => this; - - object IDictionary.this[object key] - { - get - { - ProtoPreconditions.CheckNotNull(key, nameof(key)); - if (key is TKey k) - { - TryGetValue(k, out TValue value); - return value; - } - return null; - } - - set - { - this[(TKey)key] = (TValue)value; - } - } - #endregion - - #region IReadOnlyDictionary explicit interface implementation - IEnumerable IReadOnlyDictionary.Keys => Keys; - IEnumerable IReadOnlyDictionary.Values => Values; - #endregion - - private class DictionaryEnumerator : IDictionaryEnumerator - { - private readonly IEnumerator> enumerator; - - internal DictionaryEnumerator(IEnumerator> enumerator) - { - this.enumerator = enumerator; - } - - public bool MoveNext() => enumerator.MoveNext(); - - public void Reset() => enumerator.Reset(); - - public object Current => Entry; - public DictionaryEntry Entry => new DictionaryEntry(Key, Value); - public object Key => enumerator.Current.Key; - public object Value => enumerator.Current.Value; - } - - /// - /// A codec for a specific map field. This contains all the information required to encode and - /// decode the nested messages. - /// - public sealed class Codec - { - private readonly FieldCodec keyCodec; - private readonly FieldCodec valueCodec; - private readonly uint mapTag; - - /// - /// Creates a new entry codec based on a separate key codec and value codec, - /// and the tag to use for each map entry. - /// - /// The key codec. - /// The value codec. - /// The map tag to use to introduce each map entry. - public Codec(FieldCodec keyCodec, FieldCodec valueCodec, uint mapTag) - { - this.keyCodec = keyCodec; - this.valueCodec = valueCodec; - this.mapTag = mapTag; - } - - /// - /// The key codec. - /// - internal FieldCodec KeyCodec => keyCodec; - - /// - /// The value codec. - /// - internal FieldCodec ValueCodec => valueCodec; - - /// - /// The tag used in the enclosing message to indicate map entries. - /// - internal uint MapTag => mapTag; - } - - private class MapView : ICollection, ICollection - { - private readonly MapField parent; - private readonly Func, T> projection; - private readonly Func containsCheck; - - internal MapView( - MapField parent, - Func, T> projection, - Func containsCheck) - { - this.parent = parent; - this.projection = projection; - this.containsCheck = containsCheck; - } - - public int Count => parent.Count; - - public bool IsReadOnly => true; - - public bool IsSynchronized => false; - - public object SyncRoot => parent; - - public void Add(T item) => throw new NotSupportedException(); - - public void Clear() => throw new NotSupportedException(); - - public bool Contains(T item) => containsCheck(item); - - public void CopyTo(T[] array, int arrayIndex) - { - if (arrayIndex < 0) - { - throw new ArgumentOutOfRangeException(nameof(arrayIndex)); - } - if (arrayIndex + Count > array.Length) - { - throw new ArgumentException("Not enough space in the array", nameof(array)); - } - foreach (var item in this) - { - array[arrayIndex++] = item; - } - } - - public IEnumerator GetEnumerator() - { - return parent.list.Select(projection).GetEnumerator(); - } - - public bool Remove(T item) => throw new NotSupportedException(); - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - - public void CopyTo(Array array, int index) - { - if (index < 0) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - if (index + Count > array.Length) - { - throw new ArgumentException("Not enough space in the array", nameof(array)); - } - foreach (var item in this) - { - array.SetValue(item, index++); - } - } - } - - private sealed class MapFieldDebugView - { - private readonly MapField map; - - public MapFieldDebugView(MapField map) - { - this.map = map; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public KeyValuePair[] Items => map.list.ToArray(); - } - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Google.Protobuf.Compatibility; +using Google.Protobuf.Reflection; +using System; +using System.Buffers; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Security; + +namespace Google.Protobuf.Collections +{ + /// + /// Representation of a map field in a Protocol Buffer message. + /// + /// Key type in the map. Must be a type supported by Protocol Buffer map keys. + /// Value type in the map. Must be a type supported by Protocol Buffers. + /// + /// + /// For string keys, the equality comparison is provided by . + /// + /// + /// Null values are not permitted in the map, either for wrapper types or regular messages. + /// If a map is deserialized from a data stream and the value is missing from an entry, a default value + /// is created instead. For primitive types, that is the regular default value (0, the empty string and so + /// on); for message types, an empty instance of the message is created, as if the map entry contained a 0-length + /// encoded value for the field. + /// + /// + /// This implementation does not generally prohibit the use of key/value types which are not + /// supported by Protocol Buffers (e.g. using a key type of byte) but nor does it guarantee + /// that all operations will work in such cases. + /// + /// + /// The order in which entries are returned when iterating over this object is undefined, and may change + /// in future versions. + /// + /// + public sealed class MapField : IDeepCloneable>, IDictionary, IEquatable>, IDictionary +#if !NET35 + , IReadOnlyDictionary +#endif + { + private static readonly EqualityComparer ValueEqualityComparer = ProtobufEqualityComparers.GetEqualityComparer(); + private static readonly EqualityComparer KeyEqualityComparer = ProtobufEqualityComparers.GetEqualityComparer(); + + // TODO: Don't create the map/list until we have an entry. (Assume many maps will be empty.) + private readonly Dictionary>> map = + new Dictionary>>(KeyEqualityComparer); + private readonly LinkedList> list = new LinkedList>(); + + /// + /// Creates a deep clone of this object. + /// + /// + /// A deep clone of this object. + /// + public MapField Clone() + { + var clone = new MapField(); + // Keys are never cloneable. Values might be. + if (typeof(IDeepCloneable).IsAssignableFrom(typeof(TValue))) + { + foreach (var pair in list) + { + clone.Add(pair.Key, ((IDeepCloneable)pair.Value).Clone()); + } + } + else + { + // Nothing is cloneable, so we don't need to worry. + clone.Add(this); + } + return clone; + } + + /// + /// Adds the specified key/value pair to the map. + /// + /// + /// This operation fails if the key already exists in the map. To replace an existing entry, use the indexer. + /// + /// The key to add + /// The value to add. + /// The given key already exists in map. + public void Add(TKey key, TValue value) + { + // Validation of arguments happens in ContainsKey and the indexer + if (ContainsKey(key)) + { + throw new ArgumentException("Key already exists in map", nameof(key)); + } + this[key] = value; + } + + /// + /// Determines whether the specified key is present in the map. + /// + /// The key to check. + /// true if the map contains the given key; false otherwise. + public bool ContainsKey(TKey key) + { + ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); + return map.ContainsKey(key); + } + + private bool ContainsValue(TValue value) => + list.Any(pair => ValueEqualityComparer.Equals(pair.Value, value)); + + /// + /// Removes the entry identified by the given key from the map. + /// + /// The key indicating the entry to remove from the map. + /// true if the map contained the given key before the entry was removed; false otherwise. + public bool Remove(TKey key) + { + ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); + LinkedListNode> node; + if (map.TryGetValue(key, out node)) + { + map.Remove(key); + node.List.Remove(node); + return true; + } + else + { + return false; + } + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the key is found; + /// otherwise, the default value for the type of the parameter. + /// This parameter is passed uninitialized. + /// true if the map contains an element with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out TValue value) + { + LinkedListNode> node; + if (map.TryGetValue(key, out node)) + { + value = node.Value.Value; + return true; + } + else + { + value = default(TValue); + return false; + } + } + + /// + /// Gets or sets the value associated with the specified key. + /// + /// The key of the value to get or set. + /// The property is retrieved and key does not exist in the collection. + /// The value associated with the specified key. If the specified key is not found, + /// a get operation throws a , and a set operation creates a new element with the specified key. + public TValue this[TKey key] + { + get + { + ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); + TValue value; + if (TryGetValue(key, out value)) + { + return value; + } + throw new KeyNotFoundException(); + } + set + { + ProtoPreconditions.CheckNotNullUnconstrained(key, nameof(key)); + // value == null check here is redundant, but avoids boxing. + if (value == null) + { + ProtoPreconditions.CheckNotNullUnconstrained(value, nameof(value)); + } + LinkedListNode> node; + var pair = new KeyValuePair(key, value); + if (map.TryGetValue(key, out node)) + { + node.Value = pair; + } + else + { + node = list.AddLast(pair); + map[key] = node; + } + } + } + + /// + /// Gets a collection containing the keys in the map. + /// + public ICollection Keys { get { return new MapView(this, pair => pair.Key, ContainsKey); } } + + /// + /// Gets a collection containing the values in the map. + /// + public ICollection Values { get { return new MapView(this, pair => pair.Value, ContainsValue); } } + + /// + /// Adds the specified entries to the map. The keys and values are not automatically cloned. + /// + /// The entries to add to the map. + public void Add(IDictionary entries) + { + ProtoPreconditions.CheckNotNull(entries, nameof(entries)); + foreach (var pair in entries) + { + Add(pair.Key, pair.Value); + } + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// + /// An enumerator that can be used to iterate through the collection. + /// + public IEnumerator> GetEnumerator() + { + return list.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through a collection. + /// + /// + /// An object that can be used to iterate through the collection. + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Adds the specified item to the map. + /// + /// The item to add to the map. + void ICollection>.Add(KeyValuePair item) + { + Add(item.Key, item.Value); + } + + /// + /// Removes all items from the map. + /// + public void Clear() + { + list.Clear(); + map.Clear(); + } + + /// + /// Determines whether map contains an entry equivalent to the given key/value pair. + /// + /// The key/value pair to find. + /// + bool ICollection>.Contains(KeyValuePair item) + { + TValue value; + return TryGetValue(item.Key, out value) && ValueEqualityComparer.Equals(item.Value, value); + } + + /// + /// Copies the key/value pairs in this map to an array. + /// + /// The array to copy the entries into. + /// The index of the array at which to start copying values. + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) + { + list.CopyTo(array, arrayIndex); + } + + /// + /// Removes the specified key/value pair from the map. + /// + /// Both the key and the value must be found for the entry to be removed. + /// The key/value pair to remove. + /// true if the key/value pair was found and removed; false otherwise. + bool ICollection>.Remove(KeyValuePair item) + { + if (item.Key == null) + { + throw new ArgumentException("Key is null", nameof(item)); + } + LinkedListNode> node; + if (map.TryGetValue(item.Key, out node) && + EqualityComparer.Default.Equals(item.Value, node.Value.Value)) + { + map.Remove(item.Key); + node.List.Remove(node); + return true; + } + else + { + return false; + } + } + + /// + /// Gets the number of elements contained in the map. + /// + public int Count { get { return list.Count; } } + + /// + /// Gets a value indicating whether the map is read-only. + /// + public bool IsReadOnly { get { return false; } } + + /// + /// Determines whether the specified , is equal to this instance. + /// + /// The to compare with this instance. + /// + /// true if the specified is equal to this instance; otherwise, false. + /// + public override bool Equals(object other) + { + return Equals(other as MapField); + } + + /// + /// Returns a hash code for this instance. + /// + /// + /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + /// + public override int GetHashCode() + { + var keyComparer = KeyEqualityComparer; + var valueComparer = ValueEqualityComparer; + int hash = 0; + foreach (var pair in list) + { + hash ^= keyComparer.GetHashCode(pair.Key) * 31 + valueComparer.GetHashCode(pair.Value); + } + return hash; + } + + /// + /// Compares this map with another for equality. + /// + /// + /// The order of the key/value pairs in the maps is not deemed significant in this comparison. + /// + /// The map to compare this with. + /// true if refers to an equal map; false otherwise. + public bool Equals(MapField other) + { + if (other == null) + { + return false; + } + if (other == this) + { + return true; + } + if (other.Count != this.Count) + { + return false; + } + var valueComparer = ValueEqualityComparer; + foreach (var pair in this) + { + TValue value; + if (!other.TryGetValue(pair.Key, out value)) + { + return false; + } + if (!valueComparer.Equals(value, pair.Value)) + { + return false; + } + } + return true; + } + + /// + /// Adds entries to the map from the given stream. + /// + /// + /// It is assumed that the stream is initially positioned after the tag specified by the codec. + /// This method will continue reading entries from the stream until the end is reached, or + /// a different tag is encountered. + /// + /// Stream to read from + /// Codec describing how the key/value pairs are encoded + public void AddEntriesFrom(CodedInputStream input, Codec codec) + { + ParseContext.Initialize(input, out ParseContext ctx); + try + { + AddEntriesFrom(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(input); + } + } + + /// + /// Adds entries to the map from the given parse context. + /// + /// + /// It is assumed that the input is initially positioned after the tag specified by the codec. + /// This method will continue reading entries from the input until the end is reached, or + /// a different tag is encountered. + /// + /// Input to read from + /// Codec describing how the key/value pairs are encoded + [SecuritySafeCritical] + public void AddEntriesFrom(ref ParseContext ctx, Codec codec) + { + var adapter = new Codec.MessageAdapter(codec); + do + { + adapter.Reset(); + ctx.ReadMessage(adapter); + this[adapter.Key] = adapter.Value; + } while (ParsingPrimitives.MaybeConsumeTag(ref ctx.buffer, ref ctx.state, codec.MapTag)); + } + + /// + /// Writes the contents of this map to the given coded output stream, using the specified codec + /// to encode each entry. + /// + /// The output stream to write to. + /// The codec to use for each entry. + public void WriteTo(CodedOutputStream output, Codec codec) + { + WriteContext.Initialize(output, out WriteContext ctx); + try + { + WriteTo(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(output); + } + } + + /// + /// Writes the contents of this map to the given write context, using the specified codec + /// to encode each entry. + /// + /// The write context to write to. + /// The codec to use for each entry. + [SecuritySafeCritical] + public void WriteTo(ref WriteContext ctx, Codec codec) + { + var message = new Codec.MessageAdapter(codec); + foreach (var entry in list) + { + message.Key = entry.Key; + message.Value = entry.Value; + ctx.WriteTag(codec.MapTag); + ctx.WriteMessage(message); + } + } + + /// + /// Calculates the size of this map based on the given entry codec. + /// + /// The codec to use to encode each entry. + /// + public int CalculateSize(Codec codec) + { + if (Count == 0) + { + return 0; + } + var message = new Codec.MessageAdapter(codec); + int size = 0; + foreach (var entry in list) + { + message.Key = entry.Key; + message.Value = entry.Value; + size += CodedOutputStream.ComputeRawVarint32Size(codec.MapTag); + size += CodedOutputStream.ComputeMessageSize(message); + } + return size; + } + + /// + /// Returns a string representation of this repeated field, in the same + /// way as it would be represented by the default JSON formatter. + /// + public override string ToString() + { + var writer = new StringWriter(); + JsonFormatter.Default.WriteDictionary(writer, this); + return writer.ToString(); + } + + #region IDictionary explicit interface implementation + void IDictionary.Add(object key, object value) + { + Add((TKey)key, (TValue)value); + } + + bool IDictionary.Contains(object key) + { + if (!(key is TKey)) + { + return false; + } + return ContainsKey((TKey)key); + } + + IDictionaryEnumerator IDictionary.GetEnumerator() + { + return new DictionaryEnumerator(GetEnumerator()); + } + + void IDictionary.Remove(object key) + { + ProtoPreconditions.CheckNotNull(key, nameof(key)); + if (!(key is TKey)) + { + return; + } + Remove((TKey)key); + } + + void ICollection.CopyTo(Array array, int index) + { + // This is ugly and slow as heck, but with any luck it will never be used anyway. + ICollection temp = this.Select(pair => new DictionaryEntry(pair.Key, pair.Value)).ToList(); + temp.CopyTo(array, index); + } + + bool IDictionary.IsFixedSize { get { return false; } } + + ICollection IDictionary.Keys { get { return (ICollection)Keys; } } + + ICollection IDictionary.Values { get { return (ICollection)Values; } } + + bool ICollection.IsSynchronized { get { return false; } } + + object ICollection.SyncRoot { get { return this; } } + + object IDictionary.this[object key] + { + get + { + ProtoPreconditions.CheckNotNull(key, nameof(key)); + if (!(key is TKey)) + { + return null; + } + TValue value; + TryGetValue((TKey)key, out value); + return value; + } + + set + { + this[(TKey)key] = (TValue)value; + } + } + #endregion + + #region IReadOnlyDictionary explicit interface implementation +#if !NET35 + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; +#endif + #endregion + + private class DictionaryEnumerator : IDictionaryEnumerator + { + private readonly IEnumerator> enumerator; + + internal DictionaryEnumerator(IEnumerator> enumerator) + { + this.enumerator = enumerator; + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + + public object Current { get { return Entry; } } + public DictionaryEntry Entry { get { return new DictionaryEntry(Key, Value); } } + public object Key { get { return enumerator.Current.Key; } } + public object Value { get { return enumerator.Current.Value; } } + } + + /// + /// A codec for a specific map field. This contains all the information required to encode and + /// decode the nested messages. + /// + public sealed class Codec + { + private readonly FieldCodec keyCodec; + private readonly FieldCodec valueCodec; + private readonly uint mapTag; + + /// + /// Creates a new entry codec based on a separate key codec and value codec, + /// and the tag to use for each map entry. + /// + /// The key codec. + /// The value codec. + /// The map tag to use to introduce each map entry. + public Codec(FieldCodec keyCodec, FieldCodec valueCodec, uint mapTag) + { + this.keyCodec = keyCodec; + this.valueCodec = valueCodec; + this.mapTag = mapTag; + } + + /// + /// The tag used in the enclosing message to indicate map entries. + /// + internal uint MapTag { get { return mapTag; } } + + /// + /// A mutable message class, used for parsing and serializing. This + /// delegates the work to a codec, but implements the interface + /// for interop with and . + /// This is nested inside Codec as it's tightly coupled to the associated codec, + /// and it's simpler if it has direct access to all its fields. + /// + internal class MessageAdapter : IMessage, IBufferMessage + { + private static readonly byte[] ZeroLengthMessageStreamData = new byte[] { 0 }; + + private readonly Codec codec; + internal TKey Key { get; set; } + internal TValue Value { get; set; } + + internal MessageAdapter(Codec codec) + { + this.codec = codec; + } + + internal void Reset() + { + Key = codec.keyCodec.DefaultValue; + Value = codec.valueCodec.DefaultValue; + } + + public void MergeFrom(CodedInputStream input) + { + // Message adapter is an internal class and we know that all the parsing will happen via InternalMergeFrom. + throw new NotImplementedException(); + } + + [SecuritySafeCritical] + public void InternalMergeFrom(ref ParseContext ctx) + { + uint tag; + while ((tag = ctx.ReadTag()) != 0) + { + if (tag == codec.keyCodec.Tag) + { + Key = codec.keyCodec.Read(ref ctx); + } + else if (tag == codec.valueCodec.Tag) + { + Value = codec.valueCodec.Read(ref ctx); + } + else + { + ParsingPrimitivesMessages.SkipLastField(ref ctx.buffer, ref ctx.state); + } + } + + // Corner case: a map entry with a key but no value, where the value type is a message. + // Read it as if we'd seen input with no data (i.e. create a "default" message). + if (Value == null) + { + if (ctx.state.CodedInputStream != null) + { + // the decoded message might not support parsing from ParseContext, so + // we need to allow fallback to the legacy MergeFrom(CodedInputStream) parsing. + Value = codec.valueCodec.Read(new CodedInputStream(ZeroLengthMessageStreamData)); + } + else + { + ParseContext.Initialize(new ReadOnlySequence(ZeroLengthMessageStreamData), out ParseContext zeroLengthCtx); + Value = codec.valueCodec.Read(ref zeroLengthCtx); + } + } + } + + public void WriteTo(CodedOutputStream output) + { + // Message adapter is an internal class and we know that all the writing will happen via InternalWriteTo. + throw new NotImplementedException(); + } + + [SecuritySafeCritical] + public void InternalWriteTo(ref WriteContext ctx) + { + codec.keyCodec.WriteTagAndValue(ref ctx, Key); + codec.valueCodec.WriteTagAndValue(ref ctx, Value); + } + + public int CalculateSize() + { + return codec.keyCodec.CalculateSizeWithTag(Key) + codec.valueCodec.CalculateSizeWithTag(Value); + } + + MessageDescriptor IMessage.Descriptor { get { return null; } } + } + } + + private class MapView : ICollection, ICollection + { + private readonly MapField parent; + private readonly Func, T> projection; + private readonly Func containsCheck; + + internal MapView( + MapField parent, + Func, T> projection, + Func containsCheck) + { + this.parent = parent; + this.projection = projection; + this.containsCheck = containsCheck; + } + + public int Count { get { return parent.Count; } } + + public bool IsReadOnly { get { return true; } } + + public bool IsSynchronized { get { return false; } } + + public object SyncRoot { get { return parent; } } + + public void Add(T item) + { + throw new NotSupportedException(); + } + + public void Clear() + { + throw new NotSupportedException(); + } + + public bool Contains(T item) + { + return containsCheck(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (arrayIndex < 0) + { + throw new ArgumentOutOfRangeException(nameof(arrayIndex)); + } + if (arrayIndex + Count > array.Length) + { + throw new ArgumentException("Not enough space in the array", nameof(array)); + } + foreach (var item in this) + { + array[arrayIndex++] = item; + } + } + + public IEnumerator GetEnumerator() + { + return parent.list.Select(projection).GetEnumerator(); + } + + public bool Remove(T item) + { + throw new NotSupportedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void CopyTo(Array array, int index) + { + if (index < 0) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + if (index + Count > array.Length) + { + throw new ArgumentException("Not enough space in the array", nameof(array)); + } + foreach (var item in this) + { + array.SetValue(item, index++); + } + } + } + } +} diff --git a/csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs b/csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs index 5b851b22e49e692dc8e8b1051fa9ddb60f9243c0..13ef60fca56e0d59964ed10be45bf5ab4b2c2edb 100644 --- a/csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs +++ b/csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs index 8bf410aa85c7c048c8029a6b2d669dfff0c118f7..19114caa2475b914438bf44b77eb3fa0da8e8671 100644 --- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs +++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs @@ -1,663 +1,698 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Security; - -namespace Google.Protobuf.Collections -{ - /// - /// The contents of a repeated field: essentially, a collection with some extra - /// restrictions (no null values) and capabilities (deep cloning). - /// - /// - /// This implementation does not generally prohibit the use of types which are not - /// supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases. - /// - /// The element type of the repeated field. - [DebuggerDisplay("Count = {Count}")] - [DebuggerTypeProxy(typeof(RepeatedField<>.RepeatedFieldDebugView))] - public sealed class RepeatedField : IList, IList, IDeepCloneable>, IEquatable>, IReadOnlyList - { - private static readonly EqualityComparer EqualityComparer = ProtobufEqualityComparers.GetEqualityComparer(); - private static readonly T[] EmptyArray = new T[0]; - private const int MinArraySize = 8; - - private T[] array = EmptyArray; - private int count = 0; - - /// - /// Creates a deep clone of this repeated field. - /// - /// - /// If the field type is - /// a message type, each element is also cloned; otherwise, it is - /// assumed that the field type is primitive (including string and - /// bytes, both of which are immutable) and so a simple copy is - /// equivalent to a deep clone. - /// - /// A deep clone of this repeated field. - public RepeatedField Clone() - { - RepeatedField clone = new RepeatedField(); - if (array != EmptyArray) - { - clone.array = (T[])array.Clone(); - if (clone.array is IDeepCloneable[] cloneableArray) - { - for (int i = 0; i < count; i++) - { - clone.array[i] = cloneableArray[i].Clone(); - } - } - } - clone.count = count; - return clone; - } - - /// - /// Adds the entries from the given input stream, decoding them with the specified codec. - /// - /// The input stream to read from. - /// The codec to use in order to read each entry. - public void AddEntriesFrom(CodedInputStream input, FieldCodec codec) - { - ParseContext.Initialize(input, out ParseContext ctx); - try - { - AddEntriesFrom(ref ctx, codec); - } - finally - { - ctx.CopyStateTo(input); - } - } - - /// - /// Adds the entries from the given parse context, decoding them with the specified codec. - /// - /// The input to read from. - /// The codec to use in order to read each entry. - [SecuritySafeCritical] - public void AddEntriesFrom(ref ParseContext ctx, FieldCodec codec) - { - // TODO: Inline some of the Add code, so we can avoid checking the size on every - // iteration. - uint tag = ctx.state.lastTag; - var reader = codec.ValueReader; - // Non-nullable value types can be packed or not. - if (FieldCodec.IsPackedRepeatedField(tag)) - { - int length = ctx.ReadLength(); - if (length > 0) - { - int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); - - // If the content is fixed size then we can calculate the length - // of the repeated field and pre-initialize the underlying collection. - // - // Check that the supplied length doesn't exceed the underlying buffer. - // That prevents a malicious length from initializing a very large collection. - if (codec.FixedSize > 0 && length % codec.FixedSize == 0 && ParsingPrimitives.IsDataAvailable(ref ctx.state, length)) - { - EnsureSize(count + (length / codec.FixedSize)); - - while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) - { - // Only FieldCodecs with a fixed size can reach here, and they are all known - // types that don't allow the user to specify a custom reader action. - // reader action will never return null. - array[count++] = reader(ref ctx); - } - } - else - { - // Content is variable size so add until we reach the limit. - while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) - { - Add(reader(ref ctx)); - } - } - SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); - } - // Empty packed field. Odd, but valid - just ignore. - } - else - { - // Not packed... (possibly not packable) - do - { - Add(reader(ref ctx)); - } while (ParsingPrimitives.MaybeConsumeTag(ref ctx.buffer, ref ctx.state, tag)); - } - } - - /// - /// Calculates the size of this collection based on the given codec. - /// - /// The codec to use when encoding each field. - /// The number of bytes that would be written to an output by one of the WriteTo methods, - /// using the same codec. - public int CalculateSize(FieldCodec codec) - { - if (count == 0) - { - return 0; - } - uint tag = codec.Tag; - if (codec.PackedRepeatedField) - { - int dataSize = CalculatePackedDataSize(codec); - return CodedOutputStream.ComputeRawVarint32Size(tag) + - CodedOutputStream.ComputeLengthSize(dataSize) + - dataSize; - } - else - { - var sizeCalculator = codec.ValueSizeCalculator; - int size = count * CodedOutputStream.ComputeRawVarint32Size(tag); - if (codec.EndTag != 0) - { - size += count * CodedOutputStream.ComputeRawVarint32Size(codec.EndTag); - } - for (int i = 0; i < count; i++) - { - size += sizeCalculator(array[i]); - } - return size; - } - } - - private int CalculatePackedDataSize(FieldCodec codec) - { - int fixedSize = codec.FixedSize; - if (fixedSize == 0) - { - var calculator = codec.ValueSizeCalculator; - int tmp = 0; - for (int i = 0; i < count; i++) - { - tmp += calculator(array[i]); - } - return tmp; - } - else - { - return fixedSize * Count; - } - } - - /// - /// Writes the contents of this collection to the given , - /// encoding each value using the specified codec. - /// - /// The output stream to write to. - /// The codec to use when encoding each value. - public void WriteTo(CodedOutputStream output, FieldCodec codec) - { - WriteContext.Initialize(output, out WriteContext ctx); - try - { - WriteTo(ref ctx, codec); - } - finally - { - ctx.CopyStateTo(output); - } - } - - /// - /// Writes the contents of this collection to the given write context, - /// encoding each value using the specified codec. - /// - /// The write context to write to. - /// The codec to use when encoding each value. - [SecuritySafeCritical] - public void WriteTo(ref WriteContext ctx, FieldCodec codec) - { - if (count == 0) - { - return; - } - var writer = codec.ValueWriter; - var tag = codec.Tag; - if (codec.PackedRepeatedField) - { - // Packed primitive type - int size = CalculatePackedDataSize(codec); - ctx.WriteTag(tag); - ctx.WriteLength(size); - for (int i = 0; i < count; i++) - { - writer(ref ctx, array[i]); - } - } - else - { - // Not packed: a simple tag/value pair for each value. - // Can't use codec.WriteTagAndValue, as that omits default values. - for (int i = 0; i < count; i++) - { - ctx.WriteTag(tag); - writer(ref ctx, array[i]); - if (codec.EndTag != 0) - { - ctx.WriteTag(codec.EndTag); - } - } - } - } - - /// - /// Gets and sets the capacity of the RepeatedField's internal array. - /// When set, the internal array is reallocated to the given capacity. - /// The new value is less than . - /// - public int Capacity - { - get { return array.Length; } - set - { - if (value < count) - { - throw new ArgumentOutOfRangeException("Capacity", value, - $"Cannot set Capacity to a value smaller than the current item count, {count}"); - } - - if (value >= 0 && value != array.Length) - { - SetSize(value); - } - } - } - - // May increase the size of the internal array, but will never shrink it. - private void EnsureSize(int size) - { - if (array.Length < size) - { - size = Math.Max(size, MinArraySize); - int newSize = Math.Max(array.Length * 2, size); - SetSize(newSize); - } - } - - // Sets the internal array to an exact size. - private void SetSize(int size) - { - if (size != array.Length) - { - var tmp = new T[size]; - Array.Copy(array, 0, tmp, 0, count); - array = tmp; - } - } - - /// - /// Adds the specified item to the collection. - /// - /// The item to add. - public void Add(T item) - { - ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item)); - EnsureSize(count + 1); - array[count++] = item; - } - - /// - /// Removes all items from the collection. - /// - public void Clear() - { - // Clear the content of the array (so that any objects it referred to can be garbage collected) - // but keep the capacity the same. This allows large repeated fields to be reused without - // array reallocation. - Array.Clear(array, 0, count); - count = 0; - } - - /// - /// Determines whether this collection contains the given item. - /// - /// The item to find. - /// true if this collection contains the given item; false otherwise. - public bool Contains(T item) => IndexOf(item) != -1; - - /// - /// Copies this collection to the given array. - /// - /// The array to copy to. - /// The first index of the array to copy to. - public void CopyTo(T[] array, int arrayIndex) - { - Array.Copy(this.array, 0, array, arrayIndex, count); - } - - /// - /// Removes the specified item from the collection - /// - /// The item to remove. - /// true if the item was found and removed; false otherwise. - public bool Remove(T item) - { - int index = IndexOf(item); - if (index == -1) - { - return false; - } - Array.Copy(array, index + 1, array, index, count - index - 1); - count--; - array[count] = default; - return true; - } - - /// - /// Gets the number of elements contained in the collection. - /// - public int Count => count; - - /// - /// Gets a value indicating whether the collection is read-only. - /// - public bool IsReadOnly => false; - - /// - /// Adds all of the specified values into this collection. - /// - /// The values to add to this collection. - public void AddRange(IEnumerable values) - { - ProtoPreconditions.CheckNotNull(values, nameof(values)); - - // Optimization 1: If the collection we're adding is already a RepeatedField, - // we know the values are valid. - if (values is RepeatedField otherRepeatedField) - { - EnsureSize(count + otherRepeatedField.count); - Array.Copy(otherRepeatedField.array, 0, array, count, otherRepeatedField.count); - count += otherRepeatedField.count; - return; - } - - // Optimization 2: The collection is an ICollection, so we can expand - // just once and ask the collection to copy itself into the array. - if (values is ICollection collection) - { - var extraCount = collection.Count; - // For reference types and nullable value types, we need to check that there are no nulls - // present. (This isn't a thread-safe approach, but we don't advertise this is thread-safe.) - // We expect the JITter to optimize this test to true/false, so it's effectively conditional - // specialization. - if (default(T) == null) - { - // TODO: Measure whether iterating once to check and then letting the collection copy - // itself is faster or slower than iterating and adding as we go. For large - // collections this will not be great in terms of cache usage... but the optimized - // copy may be significantly faster than doing it one at a time. - foreach (var item in collection) - { - if (item == null) - { - throw new ArgumentException("Sequence contained null element", nameof(values)); - } - } - } - EnsureSize(count + extraCount); - collection.CopyTo(array, count); - count += extraCount; - return; - } - - // We *could* check for ICollection as well, but very very few collections implement - // ICollection but not ICollection. (HashSet does, for one...) - - // Fall back to a slower path of adding items one at a time. - foreach (T item in values) - { - Add(item); - } - } - - /// - /// Adds all of the specified values into this collection. This method is present to - /// allow repeated fields to be constructed from queries within collection initializers. - /// Within non-collection-initializer code, consider using the equivalent - /// method instead for clarity. - /// - /// The values to add to this collection. - public void Add(IEnumerable values) - { - AddRange(values); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// - /// An enumerator that can be used to iterate through the collection. - /// - public IEnumerator GetEnumerator() - { - for (int i = 0; i < count; i++) - { - yield return array[i]; - } - } - - /// - /// Determines whether the specified , is equal to this instance. - /// - /// The to compare with this instance. - /// - /// true if the specified is equal to this instance; otherwise, false. - /// - public override bool Equals(object obj) => Equals(obj as RepeatedField); - - /// - /// Returns an enumerator that iterates through a collection. - /// - /// - /// An object that can be used to iterate through the collection. - /// - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - - /// - /// Returns a hash code for this instance. - /// - /// - /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - /// - public override int GetHashCode() - { - int hash = 0; - for (int i = 0; i < count; i++) - { - hash = hash * 31 + array[i].GetHashCode(); - } - return hash; - } - - /// - /// Compares this repeated field with another for equality. - /// - /// The repeated field to compare this with. - /// true if refers to an equal repeated field; false otherwise. - public bool Equals(RepeatedField other) - { - if (other is null) - { - return false; - } - if (ReferenceEquals(other, this)) - { - return true; - } - if (other.Count != this.Count) - { - return false; - } - EqualityComparer comparer = EqualityComparer; - for (int i = 0; i < count; i++) - { - if (!comparer.Equals(array[i], other.array[i])) - { - return false; - } - } - return true; - } - - /// - /// Returns the index of the given item within the collection, or -1 if the item is not - /// present. - /// - /// The item to find in the collection. - /// The zero-based index of the item, or -1 if it is not found. - public int IndexOf(T item) - { - ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item)); - EqualityComparer comparer = EqualityComparer; - for (int i = 0; i < count; i++) - { - if (comparer.Equals(array[i], item)) - { - return i; - } - } - return -1; - } - - /// - /// Inserts the given item at the specified index. - /// - /// The index at which to insert the item. - /// The item to insert. - public void Insert(int index, T item) - { - ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item)); - if (index < 0 || index > count) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - EnsureSize(count + 1); - Array.Copy(array, index, array, index + 1, count - index); - array[index] = item; - count++; - } - - /// - /// Removes the item at the given index. - /// - /// The zero-based index of the item to remove. - public void RemoveAt(int index) - { - if (index < 0 || index >= count) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - Array.Copy(array, index + 1, array, index, count - index - 1); - count--; - array[count] = default; - } - - /// - /// Returns a string representation of this repeated field, in the same - /// way as it would be represented by the default JSON formatter. - /// - public override string ToString() - { - var writer = new StringWriter(); - JsonFormatter.Default.WriteList(writer, this); - return writer.ToString(); - } - - /// - /// Gets or sets the item at the specified index. - /// - /// - /// The element at the specified index. - /// - /// The zero-based index of the element to get or set. - /// The item at the specified index. - public T this[int index] - { - get - { - if (index < 0 || index >= count) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - return array[index]; - } - set - { - if (index < 0 || index >= count) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - ProtoPreconditions.CheckNotNullUnconstrained(value, nameof(value)); - array[index] = value; - } - } - - #region Explicit interface implementation for IList and ICollection. - bool IList.IsFixedSize => false; - - void ICollection.CopyTo(Array array, int index) => Array.Copy(this.array, 0, array, index, count); - - bool ICollection.IsSynchronized => false; - - object ICollection.SyncRoot => this; - - object IList.this[int index] - { - get => this[index]; - set => this[index] = (T)value; - } - - int IList.Add(object value) - { - Add((T) value); - return count - 1; - } - - bool IList.Contains(object value) => (value is T t && Contains(t)); - - int IList.IndexOf(object value) => (value is T t) ? IndexOf(t) : -1; - - void IList.Insert(int index, object value) => Insert(index, (T) value); - - void IList.Remove(object value) - { - if (value is T t) - { - Remove(t); - } - } - #endregion - - private sealed class RepeatedFieldDebugView - { - private readonly RepeatedField list; - - public RepeatedFieldDebugView(RepeatedField list) - { - this.list = list; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public T[] Items => list.ToArray(); - } - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Security; +using System.Threading; + +namespace Google.Protobuf.Collections +{ + /// + /// The contents of a repeated field: essentially, a collection with some extra + /// restrictions (no null values) and capabilities (deep cloning). + /// + /// + /// This implementation does not generally prohibit the use of types which are not + /// supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases. + /// + /// The element type of the repeated field. + public sealed class RepeatedField : IList, IList, IDeepCloneable>, IEquatable> +#if !NET35 + , IReadOnlyList +#endif + { + private static readonly EqualityComparer EqualityComparer = ProtobufEqualityComparers.GetEqualityComparer(); + private static readonly T[] EmptyArray = new T[0]; + private const int MinArraySize = 8; + + private T[] array = EmptyArray; + private int count = 0; + + /// + /// Creates a deep clone of this repeated field. + /// + /// + /// If the field type is + /// a message type, each element is also cloned; otherwise, it is + /// assumed that the field type is primitive (including string and + /// bytes, both of which are immutable) and so a simple copy is + /// equivalent to a deep clone. + /// + /// A deep clone of this repeated field. + public RepeatedField Clone() + { + RepeatedField clone = new RepeatedField(); + if (array != EmptyArray) + { + clone.array = (T[])array.Clone(); + IDeepCloneable[] cloneableArray = clone.array as IDeepCloneable[]; + if (cloneableArray != null) + { + for (int i = 0; i < count; i++) + { + clone.array[i] = cloneableArray[i].Clone(); + } + } + } + clone.count = count; + return clone; + } + + /// + /// Adds the entries from the given input stream, decoding them with the specified codec. + /// + /// The input stream to read from. + /// The codec to use in order to read each entry. + public void AddEntriesFrom(CodedInputStream input, FieldCodec codec) + { + ParseContext.Initialize(input, out ParseContext ctx); + try + { + AddEntriesFrom(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(input); + } + } + + /// + /// Adds the entries from the given parse context, decoding them with the specified codec. + /// + /// The input to read from. + /// The codec to use in order to read each entry. + [SecuritySafeCritical] + public void AddEntriesFrom(ref ParseContext ctx, FieldCodec codec) + { + // TODO: Inline some of the Add code, so we can avoid checking the size on every + // iteration. + uint tag = ctx.state.lastTag; + var reader = codec.ValueReader; + // Non-nullable value types can be packed or not. + if (FieldCodec.IsPackedRepeatedField(tag)) + { + int length = ctx.ReadLength(); + if (length > 0) + { + int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); + + // If the content is fixed size then we can calculate the length + // of the repeated field and pre-initialize the underlying collection. + // + // Check that the supplied length doesn't exceed the underlying buffer. + // That prevents a malicious length from initializing a very large collection. + if (codec.FixedSize > 0 && length % codec.FixedSize == 0 && ParsingPrimitives.IsDataAvailable(ref ctx.state, length)) + { + EnsureSize(count + (length / codec.FixedSize)); + + while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + // Only FieldCodecs with a fixed size can reach here, and they are all known + // types that don't allow the user to specify a custom reader action. + // reader action will never return null. + array[count++] = reader(ref ctx); + } + } + else + { + // Content is variable size so add until we reach the limit. + while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + Add(reader(ref ctx)); + } + } + SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); + } + // Empty packed field. Odd, but valid - just ignore. + } + else + { + // Not packed... (possibly not packable) + do + { + Add(reader(ref ctx)); + } while (ParsingPrimitives.MaybeConsumeTag(ref ctx.buffer, ref ctx.state, tag)); + } + } + + /// + /// Calculates the size of this collection based on the given codec. + /// + /// The codec to use when encoding each field. + /// The number of bytes that would be written to an output by one of the WriteTo methods, + /// using the same codec. + public int CalculateSize(FieldCodec codec) + { + if (count == 0) + { + return 0; + } + uint tag = codec.Tag; + if (codec.PackedRepeatedField) + { + int dataSize = CalculatePackedDataSize(codec); + return CodedOutputStream.ComputeRawVarint32Size(tag) + + CodedOutputStream.ComputeLengthSize(dataSize) + + dataSize; + } + else + { + var sizeCalculator = codec.ValueSizeCalculator; + int size = count * CodedOutputStream.ComputeRawVarint32Size(tag); + if (codec.EndTag != 0) + { + size += count * CodedOutputStream.ComputeRawVarint32Size(codec.EndTag); + } + for (int i = 0; i < count; i++) + { + size += sizeCalculator(array[i]); + } + return size; + } + } + + private int CalculatePackedDataSize(FieldCodec codec) + { + int fixedSize = codec.FixedSize; + if (fixedSize == 0) + { + var calculator = codec.ValueSizeCalculator; + int tmp = 0; + for (int i = 0; i < count; i++) + { + tmp += calculator(array[i]); + } + return tmp; + } + else + { + return fixedSize * Count; + } + } + + /// + /// Writes the contents of this collection to the given , + /// encoding each value using the specified codec. + /// + /// The output stream to write to. + /// The codec to use when encoding each value. + public void WriteTo(CodedOutputStream output, FieldCodec codec) + { + WriteContext.Initialize(output, out WriteContext ctx); + try + { + WriteTo(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(output); + } + } + + /// + /// Writes the contents of this collection to the given write context, + /// encoding each value using the specified codec. + /// + /// The write context to write to. + /// The codec to use when encoding each value. + [SecuritySafeCritical] + public void WriteTo(ref WriteContext ctx, FieldCodec codec) + { + if (count == 0) + { + return; + } + var writer = codec.ValueWriter; + var tag = codec.Tag; + if (codec.PackedRepeatedField) + { + // Packed primitive type + int size = CalculatePackedDataSize(codec); + ctx.WriteTag(tag); + ctx.WriteLength(size); + for (int i = 0; i < count; i++) + { + writer(ref ctx, array[i]); + } + } + else + { + // Not packed: a simple tag/value pair for each value. + // Can't use codec.WriteTagAndValue, as that omits default values. + for (int i = 0; i < count; i++) + { + ctx.WriteTag(tag); + writer(ref ctx, array[i]); + if (codec.EndTag != 0) + { + ctx.WriteTag(codec.EndTag); + } + } + } + } + + /// + /// Gets and sets the capacity of the RepeatedField's internal array. WHen set, the internal array is reallocated to the given capacity. + /// The new value is less than Count -or- when Count is less than 0. + /// + public int Capacity + { + get { return array.Length; } + set + { + if (value < count) + { + throw new ArgumentOutOfRangeException("Capacity", value, + $"Cannot set Capacity to a value smaller than the current item count, {count}"); + } + + if (value >= 0 && value != array.Length) + { + SetSize(value); + } + } + } + + // May increase the size of the internal array, but will never shrink it. + private void EnsureSize(int size) + { + if (array.Length < size) + { + size = Math.Max(size, MinArraySize); + int newSize = Math.Max(array.Length * 2, size); + SetSize(newSize); + } + } + + // Sets the internal array to an exact size. + private void SetSize(int size) + { + if (size != array.Length) + { + var tmp = new T[size]; + Array.Copy(array, 0, tmp, 0, count); + array = tmp; + } + } + + /// + /// Adds the specified item to the collection. + /// + /// The item to add. + public void Add(T item) + { + ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item)); + EnsureSize(count + 1); + array[count++] = item; + } + + /// + /// Removes all items from the collection. + /// + public void Clear() + { + array = EmptyArray; + count = 0; + } + + /// + /// Determines whether this collection contains the given item. + /// + /// The item to find. + /// true if this collection contains the given item; false otherwise. + public bool Contains(T item) + { + return IndexOf(item) != -1; + } + + /// + /// Copies this collection to the given array. + /// + /// The array to copy to. + /// The first index of the array to copy to. + public void CopyTo(T[] array, int arrayIndex) + { + Array.Copy(this.array, 0, array, arrayIndex, count); + } + + /// + /// Removes the specified item from the collection + /// + /// The item to remove. + /// true if the item was found and removed; false otherwise. + public bool Remove(T item) + { + int index = IndexOf(item); + if (index == -1) + { + return false; + } + Array.Copy(array, index + 1, array, index, count - index - 1); + count--; + array[count] = default(T); + return true; + } + + /// + /// Gets the number of elements contained in the collection. + /// + public int Count => count; + + /// + /// Gets a value indicating whether the collection is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds all of the specified values into this collection. + /// + /// The values to add to this collection. + public void AddRange(IEnumerable values) + { + ProtoPreconditions.CheckNotNull(values, nameof(values)); + + // Optimization 1: If the collection we're adding is already a RepeatedField, + // we know the values are valid. + var otherRepeatedField = values as RepeatedField; + if (otherRepeatedField != null) + { + EnsureSize(count + otherRepeatedField.count); + Array.Copy(otherRepeatedField.array, 0, array, count, otherRepeatedField.count); + count += otherRepeatedField.count; + return; + } + + // Optimization 2: The collection is an ICollection, so we can expand + // just once and ask the collection to copy itself into the array. + var collection = values as ICollection; + if (collection != null) + { + var extraCount = collection.Count; + // For reference types and nullable value types, we need to check that there are no nulls + // present. (This isn't a thread-safe approach, but we don't advertise this is thread-safe.) + // We expect the JITter to optimize this test to true/false, so it's effectively conditional + // specialization. + if (default(T) == null) + { + // TODO: Measure whether iterating once to check and then letting the collection copy + // itself is faster or slower than iterating and adding as we go. For large + // collections this will not be great in terms of cache usage... but the optimized + // copy may be significantly faster than doing it one at a time. + foreach (var item in collection) + { + if (item == null) + { + throw new ArgumentException("Sequence contained null element", nameof(values)); + } + } + } + EnsureSize(count + extraCount); + collection.CopyTo(array, count); + count += extraCount; + return; + } + + // We *could* check for ICollection as well, but very very few collections implement + // ICollection but not ICollection. (HashSet does, for one...) + + // Fall back to a slower path of adding items one at a time. + foreach (T item in values) + { + Add(item); + } + } + + /// + /// Adds all of the specified values into this collection. This method is present to + /// allow repeated fields to be constructed from queries within collection initializers. + /// Within non-collection-initializer code, consider using the equivalent + /// method instead for clarity. + /// + /// The values to add to this collection. + public void Add(IEnumerable values) + { + AddRange(values); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// + /// An enumerator that can be used to iterate through the collection. + /// + public IEnumerator GetEnumerator() + { + for (int i = 0; i < count; i++) + { + yield return array[i]; + } + } + + /// + /// Determines whether the specified , is equal to this instance. + /// + /// The to compare with this instance. + /// + /// true if the specified is equal to this instance; otherwise, false. + /// + public override bool Equals(object obj) + { + return Equals(obj as RepeatedField); + } + + /// + /// Returns an enumerator that iterates through a collection. + /// + /// + /// An object that can be used to iterate through the collection. + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Returns a hash code for this instance. + /// + /// + /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + /// + public override int GetHashCode() + { + int hash = 0; + for (int i = 0; i < count; i++) + { + hash = hash * 31 + array[i].GetHashCode(); + } + return hash; + } + + /// + /// Compares this repeated field with another for equality. + /// + /// The repeated field to compare this with. + /// true if refers to an equal repeated field; false otherwise. + public bool Equals(RepeatedField other) + { + if (ReferenceEquals(other, null)) + { + return false; + } + if (ReferenceEquals(other, this)) + { + return true; + } + if (other.Count != this.Count) + { + return false; + } + EqualityComparer comparer = EqualityComparer; + for (int i = 0; i < count; i++) + { + if (!comparer.Equals(array[i], other.array[i])) + { + return false; + } + } + return true; + } + + /// + /// Returns the index of the given item within the collection, or -1 if the item is not + /// present. + /// + /// The item to find in the collection. + /// The zero-based index of the item, or -1 if it is not found. + public int IndexOf(T item) + { + ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item)); + EqualityComparer comparer = EqualityComparer; + for (int i = 0; i < count; i++) + { + if (comparer.Equals(array[i], item)) + { + return i; + } + } + return -1; + } + + /// + /// Inserts the given item at the specified index. + /// + /// The index at which to insert the item. + /// The item to insert. + public void Insert(int index, T item) + { + ProtoPreconditions.CheckNotNullUnconstrained(item, nameof(item)); + if (index < 0 || index > count) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureSize(count + 1); + Array.Copy(array, index, array, index + 1, count - index); + array[index] = item; + count++; + } + + /// + /// Removes the item at the given index. + /// + /// The zero-based index of the item to remove. + public void RemoveAt(int index) + { + if (index < 0 || index >= count) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + Array.Copy(array, index + 1, array, index, count - index - 1); + count--; + array[count] = default(T); + } + + /// + /// Returns a string representation of this repeated field, in the same + /// way as it would be represented by the default JSON formatter. + /// + public override string ToString() + { + var writer = new StringWriter(); + JsonFormatter.Default.WriteList(writer, this); + return writer.ToString(); + } + + /// + /// Gets or sets the item at the specified index. + /// + /// + /// The element at the specified index. + /// + /// The zero-based index of the element to get or set. + /// The item at the specified index. + public T this[int index] + { + get + { + if (index < 0 || index >= count) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return array[index]; + } + set + { + if (index < 0 || index >= count) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + ProtoPreconditions.CheckNotNullUnconstrained(value, nameof(value)); + array[index] = value; + } + } + + #region Explicit interface implementation for IList and ICollection. + bool IList.IsFixedSize => false; + + void ICollection.CopyTo(Array array, int index) + { + Array.Copy(this.array, 0, array, index, count); + } + + bool ICollection.IsSynchronized => false; + + object ICollection.SyncRoot => this; + + object IList.this[int index] + { + get { return this[index]; } + set { this[index] = (T)value; } + } + + int IList.Add(object value) + { + Add((T) value); + return count - 1; + } + + bool IList.Contains(object value) + { + return (value is T && Contains((T)value)); + } + + int IList.IndexOf(object value) + { + if (!(value is T)) + { + return -1; + } + return IndexOf((T)value); + } + + void IList.Insert(int index, object value) + { + Insert(index, (T) value); + } + + void IList.Remove(object value) + { + if (!(value is T)) + { + return; + } + Remove((T)value); + } + #endregion + } +} diff --git a/csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMemberTypes.cs b/csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMemberTypes.cs deleted file mode 100644 index 62fdf70a9e819aa76a93a6cf12f0803475c37ce5..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMemberTypes.cs +++ /dev/null @@ -1,104 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -#if !NET5_0_OR_GREATER -// Copied with permission from https://github.com/dotnet/runtime/tree/8fbf206d0e518b45ca855832e8bfb391afa85972/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis -namespace System.Diagnostics.CodeAnalysis -{ - /// - /// Specifies the types of members that are dynamically accessed. - /// - /// This enumeration has a attribute that allows a - /// bitwise combination of its member values. - /// - [Flags] - internal enum DynamicallyAccessedMemberTypes - { - /// - /// Specifies no members. - /// - None = 0, - - /// - /// Specifies the default, parameterless public constructor. - /// - PublicParameterlessConstructor = 0x0001, - - /// - /// Specifies all public constructors. - /// - PublicConstructors = 0x0002 | PublicParameterlessConstructor, - - /// - /// Specifies all non-public constructors. - /// - NonPublicConstructors = 0x0004, - - /// - /// Specifies all public methods. - /// - PublicMethods = 0x0008, - - /// - /// Specifies all non-public methods. - /// - NonPublicMethods = 0x0010, - - /// - /// Specifies all public fields. - /// - PublicFields = 0x0020, - - /// - /// Specifies all non-public fields. - /// - NonPublicFields = 0x0040, - - /// - /// Specifies all public nested types. - /// - PublicNestedTypes = 0x0080, - - /// - /// Specifies all non-public nested types. - /// - NonPublicNestedTypes = 0x0100, - - /// - /// Specifies all public properties. - /// - PublicProperties = 0x0200, - - /// - /// Specifies all non-public properties. - /// - NonPublicProperties = 0x0400, - - /// - /// Specifies all public events. - /// - PublicEvents = 0x0800, - - /// - /// Specifies all non-public events. - /// - NonPublicEvents = 0x1000, - - /// - /// Specifies all interfaces implemented by the type. - /// - Interfaces = 0x2000, - - /// - /// Specifies all members. - /// - All = ~None - } -} -#endif diff --git a/csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMembersAttribute.cs b/csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMembersAttribute.cs deleted file mode 100644 index 81f3dffa9191068ff0da123b11f8fae26d9a2dba..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMembersAttribute.cs +++ /dev/null @@ -1,60 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -#if !NET5_0_OR_GREATER -// Copied with permission from https://github.com/dotnet/runtime/tree/8fbf206d0e518b45ca855832e8bfb391afa85972/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis -namespace System.Diagnostics.CodeAnalysis -{ - /// - /// Indicates that certain members on a specified are accessed dynamically, - /// for example through . - /// - /// - /// This allows tools to understand which members are being accessed during the execution - /// of a program. - /// - /// This attribute is valid on members whose type is or . - /// - /// When this attribute is applied to a location of type , the assumption is - /// that the string represents a fully qualified type name. - /// - /// When this attribute is applied to a class, interface, or struct, the members specified - /// can be accessed dynamically on instances returned from calling - /// on instances of that class, interface, or struct. - /// - /// If the attribute is applied to a method it's treated as a special case and it implies - /// the attribute should be applied to the "this" parameter of the method. As such the attribute - /// should only be used on instance methods of types assignable to System.Type (or string, but no methods - /// will use it there). - /// - [AttributeUsage( - AttributeTargets.Field | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | - AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Method | - AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct, - Inherited = false)] - internal sealed class DynamicallyAccessedMembersAttribute : Attribute - { - /// - /// Initializes a new instance of the class - /// with the specified member types. - /// - /// The types of members dynamically accessed. - public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes) - { - MemberTypes = memberTypes; - } - - /// - /// Gets the which specifies the type - /// of members dynamically accessed. - /// - public DynamicallyAccessedMemberTypes MemberTypes { get; } - } -} -#endif diff --git a/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs index fcbcc740152731bfbaf43ba1cb2b9279e96e30c7..95a02c727f7ed3c88e86eda82480630d6b36cdad 100644 --- a/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs +++ b/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.Reflection; @@ -24,7 +47,11 @@ namespace Google.Protobuf.Compatibility /// internal static MethodInfo GetGetMethod(this PropertyInfo target) { +#if NET35 + var method = target.GetGetMethod(); +#else var method = target.GetMethod; +#endif return method != null && method.IsPublic ? method : null; } @@ -34,7 +61,11 @@ namespace Google.Protobuf.Compatibility /// internal static MethodInfo GetSetMethod(this PropertyInfo target) { +#if NET35 + var method = target.GetSetMethod(); +#else var method = target.SetMethod; +#endif return method != null && method.IsPublic ? method : null; } } diff --git a/csharp/src/Google.Protobuf/Compatibility/RequiresUnreferencedCodeAttribute.cs b/csharp/src/Google.Protobuf/Compatibility/RequiresUnreferencedCodeAttribute.cs deleted file mode 100644 index 6a262591db13224f4444990d0fda09a31b55f0ad..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/Compatibility/RequiresUnreferencedCodeAttribute.cs +++ /dev/null @@ -1,49 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -#if !NET5_0_OR_GREATER -// Copied with permission from https://github.com/dotnet/runtime/tree/8fbf206d0e518b45ca855832e8bfb391afa85972/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis -namespace System.Diagnostics.CodeAnalysis -{ - /// - /// Indicates that the specified method requires dynamic access to code that is not referenced - /// statically, for example through . - /// - /// - /// This allows tools to understand which methods are unsafe to call when removing unreferenced - /// code from an application. - /// - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)] - internal sealed class RequiresUnreferencedCodeAttribute : Attribute - { - /// - /// Initializes a new instance of the class - /// with the specified message. - /// - /// - /// A message that contains information about the usage of unreferenced code. - /// - public RequiresUnreferencedCodeAttribute(string message) - { - Message = message; - } - - /// - /// Gets a message that contains information about the usage of unreferenced code. - /// - public string Message { get; } - - /// - /// Gets or sets an optional URL that contains more information about the method, - /// why it requires unreferenced code, and what options a consumer has to deal with it. - /// - public string Url { get; set; } - } -} -#endif diff --git a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs index 98de34016603f49b5340a8c2b67ecbd379250486..2f23713819f6a482d5a84d22930a6215806f1fd3 100644 --- a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs +++ b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs @@ -1,16 +1,39 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; -using System.Diagnostics.CodeAnalysis; using System.Reflection; +#if !NET35 namespace Google.Protobuf.Compatibility { /// @@ -36,11 +59,7 @@ namespace Google.Protobuf.Compatibility /// including inherited properties or null if there is no such public property. /// Here, "public property" means a property where either the getter, or the setter, or both, is public. /// - [UnconditionalSuppressMessage("Trimming", "IL2072", - Justification = "The BaseType of the target will have all properties because of the annotation.")] - internal static PropertyInfo GetProperty( - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] - this Type target, string name) + internal static PropertyInfo GetProperty(this Type target, string name) { // GetDeclaredProperty only returns properties declared in the given type, so we need to recurse. while (target != null) @@ -67,11 +86,7 @@ namespace Google.Protobuf.Compatibility /// class Child : Base declares public void Foo(long)). /// /// One type in the hierarchy declared more than one method with the same name - [UnconditionalSuppressMessage("Trimming", "IL2072", - Justification = "The BaseType of the target will have all properties because of the annotation.")] - internal static MethodInfo GetMethod( - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] - this Type target, string name) + internal static MethodInfo GetMethod(this Type target, string name) { // GetDeclaredMethod only returns methods declared in the given type, so we need to recurse. while (target != null) @@ -88,3 +103,4 @@ namespace Google.Protobuf.Compatibility } } } +#endif diff --git a/csharp/src/Google.Protobuf/Compatibility/UnconditionalSuppressMessageAttribute.cs b/csharp/src/Google.Protobuf/Compatibility/UnconditionalSuppressMessageAttribute.cs deleted file mode 100644 index 3f58e27f205f6950a08a872f4ad2483e5fd65115..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/Compatibility/UnconditionalSuppressMessageAttribute.cs +++ /dev/null @@ -1,94 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -#if !NET5_0_OR_GREATER -// Copied with permission from https://github.com/dotnet/runtime/tree/8fbf206d0e518b45ca855832e8bfb391afa85972/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis -namespace System.Diagnostics.CodeAnalysis -{ - /// - /// Suppresses reporting of a specific rule violation, allowing multiple suppressions on a - /// single code artifact. - /// - /// - /// is different than - /// in that it doesn't have a - /// . So it is always preserved in the compiled assembly. - /// - [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)] - internal sealed class UnconditionalSuppressMessageAttribute : Attribute - { - /// - /// Initializes a new instance of the - /// class, specifying the category of the tool and the identifier for an analysis rule. - /// - /// The category for the attribute. - /// The identifier of the analysis rule the attribute applies to. - public UnconditionalSuppressMessageAttribute(string category, string checkId) - { - Category = category; - CheckId = checkId; - } - - /// - /// Gets the category identifying the classification of the attribute. - /// - /// - /// The property describes the tool or tool analysis category - /// for which a message suppression attribute applies. - /// - public string Category { get; } - - /// - /// Gets the identifier of the analysis tool rule to be suppressed. - /// - /// - /// Concatenated together, the and - /// properties form a unique check identifier. - /// - public string CheckId { get; } - - /// - /// Gets or sets the scope of the code that is relevant for the attribute. - /// - /// - /// The Scope property is an optional argument that specifies the metadata scope for which - /// the attribute is relevant. - /// - public string Scope { get; set; } - - /// - /// Gets or sets a fully qualified path that represents the target of the attribute. - /// - /// - /// The property is an optional argument identifying the analysis target - /// of the attribute. An example value is "System.IO.Stream.ctor():System.Void". - /// Because it is fully qualified, it can be long, particularly for targets such as parameters. - /// The analysis tool user interface should be capable of automatically formatting the parameter. - /// - public string Target { get; set; } - - /// - /// Gets or sets an optional argument expanding on exclusion criteria. - /// - /// - /// The property is an optional argument that specifies additional - /// exclusion where the literal metadata target is not sufficiently precise. For example, - /// the cannot be applied within a method, - /// and it may be desirable to suppress a violation against a statement in the method that will - /// give a rule violation, but not against all statements in the method. - /// - public string MessageId { get; set; } - - /// - /// Gets or sets the justification for suppressing the code analysis message. - /// - public string Justification { get; set; } - } -} -#endif diff --git a/csharp/src/Google.Protobuf/Compiler/Plugin.pb.cs b/csharp/src/Google.Protobuf/Compiler/Plugin.pb.cs deleted file mode 100644 index 82c9f82a234b1b1e2cfc63622639a0de4d68a3db..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/Compiler/Plugin.pb.cs +++ /dev/null @@ -1,1534 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/compiler/plugin.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.Compiler { - - /// Holder for reflection information generated from google/protobuf/compiler/plugin.proto - public static partial class PluginReflection { - - #region Descriptor - /// File descriptor for google/protobuf/compiler/plugin.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static PluginReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVnb29nbGUvcHJvdG9idWYvY29tcGlsZXIvcGx1Z2luLnByb3RvEhhnb29n", - "bGUucHJvdG9idWYuY29tcGlsZXIaIGdvb2dsZS9wcm90b2J1Zi9kZXNjcmlw", - "dG9yLnByb3RvIkYKB1ZlcnNpb24SDQoFbWFqb3IYASABKAUSDQoFbWlub3IY", - "AiABKAUSDQoFcGF0Y2gYAyABKAUSDgoGc3VmZml4GAQgASgJIoECChRDb2Rl", - "R2VuZXJhdG9yUmVxdWVzdBIYChBmaWxlX3RvX2dlbmVyYXRlGAEgAygJEhEK", - "CXBhcmFtZXRlchgCIAEoCRI4Cgpwcm90b19maWxlGA8gAygLMiQuZ29vZ2xl", - "LnByb3RvYnVmLkZpbGVEZXNjcmlwdG9yUHJvdG8SRQoXc291cmNlX2ZpbGVf", - "ZGVzY3JpcHRvcnMYESADKAsyJC5nb29nbGUucHJvdG9idWYuRmlsZURlc2Ny", - "aXB0b3JQcm90bxI7ChBjb21waWxlcl92ZXJzaW9uGAMgASgLMiEuZ29vZ2xl", - "LnByb3RvYnVmLmNvbXBpbGVyLlZlcnNpb24i4AIKFUNvZGVHZW5lcmF0b3JS", - "ZXNwb25zZRINCgVlcnJvchgBIAEoCRIaChJzdXBwb3J0ZWRfZmVhdHVyZXMY", - "AiABKAQSQgoEZmlsZRgPIAMoCzI0Lmdvb2dsZS5wcm90b2J1Zi5jb21waWxl", - "ci5Db2RlR2VuZXJhdG9yUmVzcG9uc2UuRmlsZRp/CgRGaWxlEgwKBG5hbWUY", - "ASABKAkSFwoPaW5zZXJ0aW9uX3BvaW50GAIgASgJEg8KB2NvbnRlbnQYDyAB", - "KAkSPwoTZ2VuZXJhdGVkX2NvZGVfaW5mbxgQIAEoCzIiLmdvb2dsZS5wcm90", - "b2J1Zi5HZW5lcmF0ZWRDb2RlSW5mbyJXCgdGZWF0dXJlEhAKDEZFQVRVUkVf", - "Tk9ORRAAEhsKF0ZFQVRVUkVfUFJPVE8zX09QVElPTkFMEAESHQoZRkVBVFVS", - "RV9TVVBQT1JUU19FRElUSU9OUxACQnIKHGNvbS5nb29nbGUucHJvdG9idWYu", - "Y29tcGlsZXJCDFBsdWdpblByb3Rvc1opZ29vZ2xlLmdvbGFuZy5vcmcvcHJv", - "dG9idWYvdHlwZXMvcGx1Z2lucGKqAhhHb29nbGUuUHJvdG9idWYuQ29tcGls", - "ZXI=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Compiler.Version), global::Google.Protobuf.Compiler.Version.Parser, new[]{ "Major", "Minor", "Patch", "Suffix" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Compiler.CodeGeneratorRequest), global::Google.Protobuf.Compiler.CodeGeneratorRequest.Parser, new[]{ "FileToGenerate", "Parameter", "ProtoFile", "SourceFileDescriptors", "CompilerVersion" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Compiler.CodeGeneratorResponse), global::Google.Protobuf.Compiler.CodeGeneratorResponse.Parser, new[]{ "Error", "SupportedFeatures", "File" }, null, new[]{ typeof(global::Google.Protobuf.Compiler.CodeGeneratorResponse.Types.Feature) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Compiler.CodeGeneratorResponse.Types.File), global::Google.Protobuf.Compiler.CodeGeneratorResponse.Types.File.Parser, new[]{ "Name", "InsertionPoint", "Content", "GeneratedCodeInfo" }, null, null, null, null)}) - })); - } - #endregion - - } - #region Messages - /// - /// The version number of protocol compiler. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Version : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Version()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Compiler.PluginReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Version() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Version(Version other) : this() { - _hasBits0 = other._hasBits0; - major_ = other.major_; - minor_ = other.minor_; - patch_ = other.patch_; - suffix_ = other.suffix_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Version Clone() { - return new Version(this); - } - - /// Field number for the "major" field. - public const int MajorFieldNumber = 1; - private readonly static int MajorDefaultValue = 0; - - private int major_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Major { - get { if ((_hasBits0 & 1) != 0) { return major_; } else { return MajorDefaultValue; } } - set { - _hasBits0 |= 1; - major_ = value; - } - } - /// Gets whether the "major" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasMajor { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "major" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMajor() { - _hasBits0 &= ~1; - } - - /// Field number for the "minor" field. - public const int MinorFieldNumber = 2; - private readonly static int MinorDefaultValue = 0; - - private int minor_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Minor { - get { if ((_hasBits0 & 2) != 0) { return minor_; } else { return MinorDefaultValue; } } - set { - _hasBits0 |= 2; - minor_ = value; - } - } - /// Gets whether the "minor" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasMinor { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "minor" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMinor() { - _hasBits0 &= ~2; - } - - /// Field number for the "patch" field. - public const int PatchFieldNumber = 3; - private readonly static int PatchDefaultValue = 0; - - private int patch_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Patch { - get { if ((_hasBits0 & 4) != 0) { return patch_; } else { return PatchDefaultValue; } } - set { - _hasBits0 |= 4; - patch_ = value; - } - } - /// Gets whether the "patch" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPatch { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "patch" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPatch() { - _hasBits0 &= ~4; - } - - /// Field number for the "suffix" field. - public const int SuffixFieldNumber = 4; - private readonly static string SuffixDefaultValue = ""; - - private string suffix_; - /// - /// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - /// be empty for mainline stable releases. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Suffix { - get { return suffix_ ?? SuffixDefaultValue; } - set { - suffix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "suffix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSuffix { - get { return suffix_ != null; } - } - /// Clears the value of the "suffix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSuffix() { - suffix_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Version); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Version other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Major != other.Major) return false; - if (Minor != other.Minor) return false; - if (Patch != other.Patch) return false; - if (Suffix != other.Suffix) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasMajor) hash ^= Major.GetHashCode(); - if (HasMinor) hash ^= Minor.GetHashCode(); - if (HasPatch) hash ^= Patch.GetHashCode(); - if (HasSuffix) hash ^= Suffix.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasMajor) { - output.WriteRawTag(8); - output.WriteInt32(Major); - } - if (HasMinor) { - output.WriteRawTag(16); - output.WriteInt32(Minor); - } - if (HasPatch) { - output.WriteRawTag(24); - output.WriteInt32(Patch); - } - if (HasSuffix) { - output.WriteRawTag(34); - output.WriteString(Suffix); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasMajor) { - output.WriteRawTag(8); - output.WriteInt32(Major); - } - if (HasMinor) { - output.WriteRawTag(16); - output.WriteInt32(Minor); - } - if (HasPatch) { - output.WriteRawTag(24); - output.WriteInt32(Patch); - } - if (HasSuffix) { - output.WriteRawTag(34); - output.WriteString(Suffix); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasMajor) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Major); - } - if (HasMinor) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Minor); - } - if (HasPatch) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Patch); - } - if (HasSuffix) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Suffix); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Version other) { - if (other == null) { - return; - } - if (other.HasMajor) { - Major = other.Major; - } - if (other.HasMinor) { - Minor = other.Minor; - } - if (other.HasPatch) { - Patch = other.Patch; - } - if (other.HasSuffix) { - Suffix = other.Suffix; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Major = input.ReadInt32(); - break; - } - case 16: { - Minor = input.ReadInt32(); - break; - } - case 24: { - Patch = input.ReadInt32(); - break; - } - case 34: { - Suffix = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Major = input.ReadInt32(); - break; - } - case 16: { - Minor = input.ReadInt32(); - break; - } - case 24: { - Patch = input.ReadInt32(); - break; - } - case 34: { - Suffix = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// An encoded CodeGeneratorRequest is written to the plugin's stdin. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class CodeGeneratorRequest : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CodeGeneratorRequest()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Compiler.PluginReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CodeGeneratorRequest() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CodeGeneratorRequest(CodeGeneratorRequest other) : this() { - fileToGenerate_ = other.fileToGenerate_.Clone(); - parameter_ = other.parameter_; - protoFile_ = other.protoFile_.Clone(); - sourceFileDescriptors_ = other.sourceFileDescriptors_.Clone(); - compilerVersion_ = other.compilerVersion_ != null ? other.compilerVersion_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CodeGeneratorRequest Clone() { - return new CodeGeneratorRequest(this); - } - - /// Field number for the "file_to_generate" field. - public const int FileToGenerateFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_fileToGenerate_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField fileToGenerate_ = new pbc::RepeatedField(); - /// - /// The .proto files that were explicitly listed on the command-line. The - /// code generator should generate code only for these files. Each file's - /// descriptor will be included in proto_file, below. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField FileToGenerate { - get { return fileToGenerate_; } - } - - /// Field number for the "parameter" field. - public const int ParameterFieldNumber = 2; - private readonly static string ParameterDefaultValue = ""; - - private string parameter_; - /// - /// The generator parameter passed on the command-line. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Parameter { - get { return parameter_ ?? ParameterDefaultValue; } - set { - parameter_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "parameter" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasParameter { - get { return parameter_ != null; } - } - /// Clears the value of the "parameter" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearParameter() { - parameter_ = null; - } - - /// Field number for the "proto_file" field. - public const int ProtoFileFieldNumber = 15; - private static readonly pb::FieldCodec _repeated_protoFile_codec - = pb::FieldCodec.ForMessage(122, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); - private readonly pbc::RepeatedField protoFile_ = new pbc::RepeatedField(); - /// - /// FileDescriptorProtos for all files in files_to_generate and everything - /// they import. The files will appear in topological order, so each file - /// appears before any file that imports it. - /// - /// Note: the files listed in files_to_generate will include runtime-retention - /// options only, but all other files will include source-retention options. - /// The source_file_descriptors field below is available in case you need - /// source-retention options for files_to_generate. - /// - /// protoc guarantees that all proto_files will be written after - /// the fields above, even though this is not technically guaranteed by the - /// protobuf wire format. This theoretically could allow a plugin to stream - /// in the FileDescriptorProtos and handle them one by one rather than read - /// the entire set into memory at once. However, as of this writing, this - /// is not similarly optimized on protoc's end -- it will store all fields in - /// memory at once before sending them to the plugin. - /// - /// Type names of fields and extensions in the FileDescriptorProto are always - /// fully qualified. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField ProtoFile { - get { return protoFile_; } - } - - /// Field number for the "source_file_descriptors" field. - public const int SourceFileDescriptorsFieldNumber = 17; - private static readonly pb::FieldCodec _repeated_sourceFileDescriptors_codec - = pb::FieldCodec.ForMessage(138, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); - private readonly pbc::RepeatedField sourceFileDescriptors_ = new pbc::RepeatedField(); - /// - /// File descriptors with all options, including source-retention options. - /// These descriptors are only provided for the files listed in - /// files_to_generate. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField SourceFileDescriptors { - get { return sourceFileDescriptors_; } - } - - /// Field number for the "compiler_version" field. - public const int CompilerVersionFieldNumber = 3; - private global::Google.Protobuf.Compiler.Version compilerVersion_; - /// - /// The version number of protocol compiler. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Compiler.Version CompilerVersion { - get { return compilerVersion_; } - set { - compilerVersion_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as CodeGeneratorRequest); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(CodeGeneratorRequest other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!fileToGenerate_.Equals(other.fileToGenerate_)) return false; - if (Parameter != other.Parameter) return false; - if(!protoFile_.Equals(other.protoFile_)) return false; - if(!sourceFileDescriptors_.Equals(other.sourceFileDescriptors_)) return false; - if (!object.Equals(CompilerVersion, other.CompilerVersion)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= fileToGenerate_.GetHashCode(); - if (HasParameter) hash ^= Parameter.GetHashCode(); - hash ^= protoFile_.GetHashCode(); - hash ^= sourceFileDescriptors_.GetHashCode(); - if (compilerVersion_ != null) hash ^= CompilerVersion.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - fileToGenerate_.WriteTo(output, _repeated_fileToGenerate_codec); - if (HasParameter) { - output.WriteRawTag(18); - output.WriteString(Parameter); - } - if (compilerVersion_ != null) { - output.WriteRawTag(26); - output.WriteMessage(CompilerVersion); - } - protoFile_.WriteTo(output, _repeated_protoFile_codec); - sourceFileDescriptors_.WriteTo(output, _repeated_sourceFileDescriptors_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - fileToGenerate_.WriteTo(ref output, _repeated_fileToGenerate_codec); - if (HasParameter) { - output.WriteRawTag(18); - output.WriteString(Parameter); - } - if (compilerVersion_ != null) { - output.WriteRawTag(26); - output.WriteMessage(CompilerVersion); - } - protoFile_.WriteTo(ref output, _repeated_protoFile_codec); - sourceFileDescriptors_.WriteTo(ref output, _repeated_sourceFileDescriptors_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += fileToGenerate_.CalculateSize(_repeated_fileToGenerate_codec); - if (HasParameter) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Parameter); - } - size += protoFile_.CalculateSize(_repeated_protoFile_codec); - size += sourceFileDescriptors_.CalculateSize(_repeated_sourceFileDescriptors_codec); - if (compilerVersion_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CompilerVersion); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(CodeGeneratorRequest other) { - if (other == null) { - return; - } - fileToGenerate_.Add(other.fileToGenerate_); - if (other.HasParameter) { - Parameter = other.Parameter; - } - protoFile_.Add(other.protoFile_); - sourceFileDescriptors_.Add(other.sourceFileDescriptors_); - if (other.compilerVersion_ != null) { - if (compilerVersion_ == null) { - CompilerVersion = new global::Google.Protobuf.Compiler.Version(); - } - CompilerVersion.MergeFrom(other.CompilerVersion); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - fileToGenerate_.AddEntriesFrom(input, _repeated_fileToGenerate_codec); - break; - } - case 18: { - Parameter = input.ReadString(); - break; - } - case 26: { - if (compilerVersion_ == null) { - CompilerVersion = new global::Google.Protobuf.Compiler.Version(); - } - input.ReadMessage(CompilerVersion); - break; - } - case 122: { - protoFile_.AddEntriesFrom(input, _repeated_protoFile_codec); - break; - } - case 138: { - sourceFileDescriptors_.AddEntriesFrom(input, _repeated_sourceFileDescriptors_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - fileToGenerate_.AddEntriesFrom(ref input, _repeated_fileToGenerate_codec); - break; - } - case 18: { - Parameter = input.ReadString(); - break; - } - case 26: { - if (compilerVersion_ == null) { - CompilerVersion = new global::Google.Protobuf.Compiler.Version(); - } - input.ReadMessage(CompilerVersion); - break; - } - case 122: { - protoFile_.AddEntriesFrom(ref input, _repeated_protoFile_codec); - break; - } - case 138: { - sourceFileDescriptors_.AddEntriesFrom(ref input, _repeated_sourceFileDescriptors_codec); - break; - } - } - } - } - #endif - - } - - /// - /// The plugin writes an encoded CodeGeneratorResponse to stdout. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class CodeGeneratorResponse : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CodeGeneratorResponse()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Compiler.PluginReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CodeGeneratorResponse() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CodeGeneratorResponse(CodeGeneratorResponse other) : this() { - _hasBits0 = other._hasBits0; - error_ = other.error_; - supportedFeatures_ = other.supportedFeatures_; - file_ = other.file_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CodeGeneratorResponse Clone() { - return new CodeGeneratorResponse(this); - } - - /// Field number for the "error" field. - public const int ErrorFieldNumber = 1; - private readonly static string ErrorDefaultValue = ""; - - private string error_; - /// - /// Error message. If non-empty, code generation failed. The plugin process - /// should exit with status code zero even if it reports an error in this way. - /// - /// This should be used to indicate errors in .proto files which prevent the - /// code generator from generating correct code. Errors which indicate a - /// problem in protoc itself -- such as the input CodeGeneratorRequest being - /// unparseable -- should be reported by writing a message to stderr and - /// exiting with a non-zero status code. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Error { - get { return error_ ?? ErrorDefaultValue; } - set { - error_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "error" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasError { - get { return error_ != null; } - } - /// Clears the value of the "error" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearError() { - error_ = null; - } - - /// Field number for the "supported_features" field. - public const int SupportedFeaturesFieldNumber = 2; - private readonly static ulong SupportedFeaturesDefaultValue = 0UL; - - private ulong supportedFeatures_; - /// - /// A bitmask of supported features that the code generator supports. - /// This is a bitwise "or" of values from the Feature enum. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong SupportedFeatures { - get { if ((_hasBits0 & 1) != 0) { return supportedFeatures_; } else { return SupportedFeaturesDefaultValue; } } - set { - _hasBits0 |= 1; - supportedFeatures_ = value; - } - } - /// Gets whether the "supported_features" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSupportedFeatures { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "supported_features" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSupportedFeatures() { - _hasBits0 &= ~1; - } - - /// Field number for the "file" field. - public const int FileFieldNumber = 15; - private static readonly pb::FieldCodec _repeated_file_codec - = pb::FieldCodec.ForMessage(122, global::Google.Protobuf.Compiler.CodeGeneratorResponse.Types.File.Parser); - private readonly pbc::RepeatedField file_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField File { - get { return file_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as CodeGeneratorResponse); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(CodeGeneratorResponse other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Error != other.Error) return false; - if (SupportedFeatures != other.SupportedFeatures) return false; - if(!file_.Equals(other.file_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasError) hash ^= Error.GetHashCode(); - if (HasSupportedFeatures) hash ^= SupportedFeatures.GetHashCode(); - hash ^= file_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasError) { - output.WriteRawTag(10); - output.WriteString(Error); - } - if (HasSupportedFeatures) { - output.WriteRawTag(16); - output.WriteUInt64(SupportedFeatures); - } - file_.WriteTo(output, _repeated_file_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasError) { - output.WriteRawTag(10); - output.WriteString(Error); - } - if (HasSupportedFeatures) { - output.WriteRawTag(16); - output.WriteUInt64(SupportedFeatures); - } - file_.WriteTo(ref output, _repeated_file_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasError) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Error); - } - if (HasSupportedFeatures) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(SupportedFeatures); - } - size += file_.CalculateSize(_repeated_file_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(CodeGeneratorResponse other) { - if (other == null) { - return; - } - if (other.HasError) { - Error = other.Error; - } - if (other.HasSupportedFeatures) { - SupportedFeatures = other.SupportedFeatures; - } - file_.Add(other.file_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Error = input.ReadString(); - break; - } - case 16: { - SupportedFeatures = input.ReadUInt64(); - break; - } - case 122: { - file_.AddEntriesFrom(input, _repeated_file_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Error = input.ReadString(); - break; - } - case 16: { - SupportedFeatures = input.ReadUInt64(); - break; - } - case 122: { - file_.AddEntriesFrom(ref input, _repeated_file_codec); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the CodeGeneratorResponse message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// Sync with code_generator.h. - /// - public enum Feature { - [pbr::OriginalName("FEATURE_NONE")] None = 0, - [pbr::OriginalName("FEATURE_PROTO3_OPTIONAL")] Proto3Optional = 1, - [pbr::OriginalName("FEATURE_SUPPORTS_EDITIONS")] SupportsEditions = 2, - } - - /// - /// Represents a single generated file. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class File : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new File()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Compiler.CodeGeneratorResponse.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public File() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public File(File other) : this() { - name_ = other.name_; - insertionPoint_ = other.insertionPoint_; - content_ = other.content_; - generatedCodeInfo_ = other.generatedCodeInfo_ != null ? other.generatedCodeInfo_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public File Clone() { - return new File(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - /// - /// The file name, relative to the output directory. The name must not - /// contain "." or ".." components and must be relative, not be absolute (so, - /// the file cannot lie outside the output directory). "/" must be used as - /// the path separator, not "\". - /// - /// If the name is omitted, the content will be appended to the previous - /// file. This allows the generator to break large files into small chunks, - /// and allows the generated text to be streamed back to protoc so that large - /// files need not reside completely in memory at one time. Note that as of - /// this writing protoc does not optimize for this -- it will read the entire - /// CodeGeneratorResponse before writing files to disk. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "insertion_point" field. - public const int InsertionPointFieldNumber = 2; - private readonly static string InsertionPointDefaultValue = ""; - - private string insertionPoint_; - /// - /// If non-empty, indicates that the named file should already exist, and the - /// content here is to be inserted into that file at a defined insertion - /// point. This feature allows a code generator to extend the output - /// produced by another code generator. The original generator may provide - /// insertion points by placing special annotations in the file that look - /// like: - /// @@protoc_insertion_point(NAME) - /// The annotation can have arbitrary text before and after it on the line, - /// which allows it to be placed in a comment. NAME should be replaced with - /// an identifier naming the point -- this is what other generators will use - /// as the insertion_point. Code inserted at this point will be placed - /// immediately above the line containing the insertion point (thus multiple - /// insertions to the same point will come out in the order they were added). - /// The double-@ is intended to make it unlikely that the generated code - /// could contain things that look like insertion points by accident. - /// - /// For example, the C++ code generator places the following line in the - /// .pb.h files that it generates: - /// // @@protoc_insertion_point(namespace_scope) - /// This line appears within the scope of the file's package namespace, but - /// outside of any particular class. Another plugin can then specify the - /// insertion_point "namespace_scope" to generate additional classes or - /// other declarations that should be placed in this scope. - /// - /// Note that if the line containing the insertion point begins with - /// whitespace, the same whitespace will be added to every line of the - /// inserted text. This is useful for languages like Python, where - /// indentation matters. In these languages, the insertion point comment - /// should be indented the same amount as any inserted code will need to be - /// in order to work correctly in that context. - /// - /// The code generator that generates the initial file and the one which - /// inserts into it must both run as part of a single invocation of protoc. - /// Code generators are executed in the order in which they appear on the - /// command line. - /// - /// If |insertion_point| is present, |name| must also be present. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string InsertionPoint { - get { return insertionPoint_ ?? InsertionPointDefaultValue; } - set { - insertionPoint_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "insertion_point" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasInsertionPoint { - get { return insertionPoint_ != null; } - } - /// Clears the value of the "insertion_point" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearInsertionPoint() { - insertionPoint_ = null; - } - - /// Field number for the "content" field. - public const int ContentFieldNumber = 15; - private readonly static string ContentDefaultValue = ""; - - private string content_; - /// - /// The file contents. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Content { - get { return content_ ?? ContentDefaultValue; } - set { - content_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "content" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasContent { - get { return content_ != null; } - } - /// Clears the value of the "content" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearContent() { - content_ = null; - } - - /// Field number for the "generated_code_info" field. - public const int GeneratedCodeInfoFieldNumber = 16; - private global::Google.Protobuf.Reflection.GeneratedCodeInfo generatedCodeInfo_; - /// - /// Information describing the file content being inserted. If an insertion - /// point is used, this information will be appropriately offset and inserted - /// into the code generation metadata for the generated files. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.GeneratedCodeInfo GeneratedCodeInfo { - get { return generatedCodeInfo_; } - set { - generatedCodeInfo_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as File); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(File other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (InsertionPoint != other.InsertionPoint) return false; - if (Content != other.Content) return false; - if (!object.Equals(GeneratedCodeInfo, other.GeneratedCodeInfo)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - if (HasInsertionPoint) hash ^= InsertionPoint.GetHashCode(); - if (HasContent) hash ^= Content.GetHashCode(); - if (generatedCodeInfo_ != null) hash ^= GeneratedCodeInfo.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasInsertionPoint) { - output.WriteRawTag(18); - output.WriteString(InsertionPoint); - } - if (HasContent) { - output.WriteRawTag(122); - output.WriteString(Content); - } - if (generatedCodeInfo_ != null) { - output.WriteRawTag(130, 1); - output.WriteMessage(GeneratedCodeInfo); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasInsertionPoint) { - output.WriteRawTag(18); - output.WriteString(InsertionPoint); - } - if (HasContent) { - output.WriteRawTag(122); - output.WriteString(Content); - } - if (generatedCodeInfo_ != null) { - output.WriteRawTag(130, 1); - output.WriteMessage(GeneratedCodeInfo); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (HasInsertionPoint) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(InsertionPoint); - } - if (HasContent) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Content); - } - if (generatedCodeInfo_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(GeneratedCodeInfo); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(File other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - if (other.HasInsertionPoint) { - InsertionPoint = other.InsertionPoint; - } - if (other.HasContent) { - Content = other.Content; - } - if (other.generatedCodeInfo_ != null) { - if (generatedCodeInfo_ == null) { - GeneratedCodeInfo = new global::Google.Protobuf.Reflection.GeneratedCodeInfo(); - } - GeneratedCodeInfo.MergeFrom(other.GeneratedCodeInfo); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - InsertionPoint = input.ReadString(); - break; - } - case 122: { - Content = input.ReadString(); - break; - } - case 130: { - if (generatedCodeInfo_ == null) { - GeneratedCodeInfo = new global::Google.Protobuf.Reflection.GeneratedCodeInfo(); - } - input.ReadMessage(GeneratedCodeInfo); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - InsertionPoint = input.ReadString(); - break; - } - case 122: { - Content = input.ReadString(); - break; - } - case 130: { - if (generatedCodeInfo_ == null) { - GeneratedCodeInfo = new global::Google.Protobuf.Reflection.GeneratedCodeInfo(); - } - input.ReadMessage(GeneratedCodeInfo); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/Extension.cs b/csharp/src/Google.Protobuf/Extension.cs index 31522a935140e8e0ee0665dda659fdbd66905af0..6dd1ceaa8ee131597999c2fe10d5ca2be7f6ffbf 100644 --- a/csharp/src/Google.Protobuf/Extension.cs +++ b/csharp/src/Google.Protobuf/Extension.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -54,7 +77,7 @@ namespace Google.Protobuf this.codec = codec; } - internal TValue DefaultValue => codec != null ? codec.DefaultValue : default; + internal TValue DefaultValue => codec.DefaultValue; internal override Type TargetType => typeof(TTarget); diff --git a/csharp/src/Google.Protobuf/ExtensionRegistry.cs b/csharp/src/Google.Protobuf/ExtensionRegistry.cs index 9c02c2e3beef4e66699904e01859589300d32440..e72314b22c29934104a65d89a8b83e7a45fd4b04 100644 --- a/csharp/src/Google.Protobuf/ExtensionRegistry.cs +++ b/csharp/src/Google.Protobuf/ExtensionRegistry.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -32,7 +55,7 @@ namespace Google.Protobuf internal static ExtensionComparer Instance = new ExtensionComparer(); } - private readonly IDictionary, Extension> extensions; + private IDictionary, Extension> extensions; /// /// Creates a new empty extension registry diff --git a/csharp/src/Google.Protobuf/ExtensionSet.cs b/csharp/src/Google.Protobuf/ExtensionSet.cs index aaae121f7786b4168002a3f02ad3bbf512a578db..895b9ae6ea4a826d6e4db5211c465e83988abd19 100644 --- a/csharp/src/Google.Protobuf/ExtensionSet.cs +++ b/csharp/src/Google.Protobuf/ExtensionSet.cs @@ -1,398 +1,377 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using Google.Protobuf.Collections; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Security; - -namespace Google.Protobuf -{ - /// - /// Methods for managing s with null checking. - /// - /// Most users will not use this class directly and its API is experimental and subject to change. - /// - public static class ExtensionSet - { - private static bool TryGetValue(ref ExtensionSet set, Extension extension, out IExtensionValue value) where TTarget : IExtendableMessage - { - if (set == null) - { - value = null; - return false; - } - return set.ValuesByNumber.TryGetValue(extension.FieldNumber, out value); - } - - /// - /// Gets the value of the specified extension - /// - public static TValue Get(ref ExtensionSet set, Extension extension) where TTarget : IExtendableMessage - { - if (TryGetValue(ref set, extension, out IExtensionValue value)) - { - // The stored ExtensionValue can be a different type to what is being requested. - // This happens when the same extension proto is compiled in different assemblies. - // To allow consuming assemblies to still get the value when the TValue type is - // different, this get method: - // 1. Attempts to cast the value to the expected ExtensionValue. - // This is the usual case. It is used first because it avoids possibly boxing the value. - // 2. Fallback to get the value as object from IExtensionValue then casting. - // This allows for someone to specify a TValue of object. They can then convert - // the values to bytes and reparse using expected value. - // 3. If neither of these work, throw a user friendly error that the types aren't compatible. - if (value is ExtensionValue extensionValue) - { - return extensionValue.GetValue(); - } - else if (value.GetValue() is TValue underlyingValue) - { - return underlyingValue; - } - else - { - var valueType = value.GetType().GetTypeInfo(); - if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(ExtensionValue<>)) - { - var storedType = valueType.GenericTypeArguments[0]; - throw new InvalidOperationException( - "The stored extension value has a type of '" + storedType.AssemblyQualifiedName + "'. " + - "This a different from the requested type of '" + typeof(TValue).AssemblyQualifiedName + "'."); - } - else - { - throw new InvalidOperationException("Unexpected extension value type: " + valueType.AssemblyQualifiedName); - } - } - } - else - { - return extension.DefaultValue; - } - } - - /// - /// Gets the value of the specified repeated extension or null if it doesn't exist in this set - /// - public static RepeatedField Get(ref ExtensionSet set, RepeatedExtension extension) where TTarget : IExtendableMessage - { - if (TryGetValue(ref set, extension, out IExtensionValue value)) - { - if (value is RepeatedExtensionValue extensionValue) - { - return extensionValue.GetValue(); - } - else - { - var valueType = value.GetType().GetTypeInfo(); - if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(RepeatedExtensionValue<>)) - { - var storedType = valueType.GenericTypeArguments[0]; - throw new InvalidOperationException( - "The stored extension value has a type of '" + storedType.AssemblyQualifiedName + "'. " + - "This a different from the requested type of '" + typeof(TValue).AssemblyQualifiedName + "'."); - } - else - { - throw new InvalidOperationException("Unexpected extension value type: " + valueType.AssemblyQualifiedName); - } - } - } - else - { - return null; - } - } - - /// - /// Gets the value of the specified repeated extension, registering it if it doesn't exist - /// - public static RepeatedField GetOrInitialize(ref ExtensionSet set, RepeatedExtension extension) where TTarget : IExtendableMessage - { - IExtensionValue value; - if (set == null) - { - value = extension.CreateValue(); - set = new ExtensionSet(); - set.ValuesByNumber.Add(extension.FieldNumber, value); - } - else - { - if (!set.ValuesByNumber.TryGetValue(extension.FieldNumber, out value)) - { - value = extension.CreateValue(); - set.ValuesByNumber.Add(extension.FieldNumber, value); - } - } - - return ((RepeatedExtensionValue)value).GetValue(); - } - - /// - /// Sets the value of the specified extension. This will make a new instance of ExtensionSet if the set is null. - /// - public static void Set(ref ExtensionSet set, Extension extension, TValue value) where TTarget : IExtendableMessage - { - ProtoPreconditions.CheckNotNullUnconstrained(value, nameof(value)); - - IExtensionValue extensionValue; - if (set == null) - { - extensionValue = extension.CreateValue(); - set = new ExtensionSet(); - set.ValuesByNumber.Add(extension.FieldNumber, extensionValue); - } - else - { - if (!set.ValuesByNumber.TryGetValue(extension.FieldNumber, out extensionValue)) - { - extensionValue = extension.CreateValue(); - set.ValuesByNumber.Add(extension.FieldNumber, extensionValue); - } - } - - ((ExtensionValue)extensionValue).SetValue(value); - } - - /// - /// Gets whether the value of the specified extension is set - /// - public static bool Has(ref ExtensionSet set, Extension extension) where TTarget : IExtendableMessage - { - return TryGetValue(ref set, extension, out IExtensionValue _); - } - - /// - /// Clears the value of the specified extension - /// - public static void Clear(ref ExtensionSet set, Extension extension) where TTarget : IExtendableMessage - { - if (set == null) - { - return; - } - set.ValuesByNumber.Remove(extension.FieldNumber); - if (set.ValuesByNumber.Count == 0) - { - set = null; - } - } - - /// - /// Clears the value of the specified extension - /// - public static void Clear(ref ExtensionSet set, RepeatedExtension extension) where TTarget : IExtendableMessage - { - if (set == null) - { - return; - } - set.ValuesByNumber.Remove(extension.FieldNumber); - if (set.ValuesByNumber.Count == 0) - { - set = null; - } - } - - /// - /// Tries to merge a field from the coded input, returning true if the field was merged. - /// If the set is null or the field was not otherwise merged, this returns false. - /// - public static bool TryMergeFieldFrom(ref ExtensionSet set, CodedInputStream stream) where TTarget : IExtendableMessage - { - ParseContext.Initialize(stream, out ParseContext ctx); - try - { - return TryMergeFieldFrom(ref set, ref ctx); - } - finally - { - ctx.CopyStateTo(stream); - } - } - - /// - /// Tries to merge a field from the coded input, returning true if the field was merged. - /// If the set is null or the field was not otherwise merged, this returns false. - /// - public static bool TryMergeFieldFrom(ref ExtensionSet set, ref ParseContext ctx) where TTarget : IExtendableMessage - { - int lastFieldNumber = WireFormat.GetTagFieldNumber(ctx.LastTag); - - if (set != null && set.ValuesByNumber.TryGetValue(lastFieldNumber, out IExtensionValue extensionValue)) - { - extensionValue.MergeFrom(ref ctx); - return true; - } - else if (ctx.ExtensionRegistry != null && ctx.ExtensionRegistry.ContainsInputField(ctx.LastTag, typeof(TTarget), out Extension extension)) - { - IExtensionValue value = extension.CreateValue(); - value.MergeFrom(ref ctx); - set ??= new ExtensionSet(); - set.ValuesByNumber.Add(extension.FieldNumber, value); - return true; - } - else - { - return false; - } - } - - /// - /// Merges the second set into the first set, creating a new instance if first is null - /// - public static void MergeFrom(ref ExtensionSet first, ExtensionSet second) where TTarget : IExtendableMessage - { - if (second == null) - { - return; - } - if (first == null) - { - first = new ExtensionSet(); - } - foreach (var pair in second.ValuesByNumber) - { - if (first.ValuesByNumber.TryGetValue(pair.Key, out IExtensionValue value)) - { - value.MergeFrom(pair.Value); - } - else - { - var cloned = pair.Value.Clone(); - first.ValuesByNumber[pair.Key] = cloned; - } - } - } - - /// - /// Clones the set into a new set. If the set is null, this returns null - /// - public static ExtensionSet Clone(ExtensionSet set) where TTarget : IExtendableMessage - { - if (set == null) - { - return null; - } - - var newSet = new ExtensionSet(); - foreach (var pair in set.ValuesByNumber) - { - var cloned = pair.Value.Clone(); - newSet.ValuesByNumber[pair.Key] = cloned; - } - return newSet; - } - } - - /// - /// Used for keeping track of extensions in messages. - /// methods route to this set. - /// - /// Most users will not need to use this class directly - /// - /// The message type that extensions in this set target - public sealed class ExtensionSet where TTarget : IExtendableMessage - { - internal Dictionary ValuesByNumber { get; } = new Dictionary(); - - /// - /// Gets a hash code of the set - /// - public override int GetHashCode() - { - int ret = typeof(TTarget).GetHashCode(); - foreach (KeyValuePair field in ValuesByNumber) - { - // Use ^ here to make the field order irrelevant. - int hash = field.Key.GetHashCode() ^ field.Value.GetHashCode(); - ret ^= hash; - } - return ret; - } - - /// - /// Returns whether this set is equal to the other object - /// - public override bool Equals(object other) - { - if (ReferenceEquals(this, other)) - { - return true; - } - ExtensionSet otherSet = other as ExtensionSet; - if (ValuesByNumber.Count != otherSet.ValuesByNumber.Count) - { - return false; - } - foreach (var pair in ValuesByNumber) - { - if (!otherSet.ValuesByNumber.TryGetValue(pair.Key, out IExtensionValue secondValue)) - { - return false; - } - if (!pair.Value.Equals(secondValue)) - { - return false; - } - } - return true; - } - - /// - /// Calculates the size of this extension set - /// - public int CalculateSize() - { - int size = 0; - foreach (var value in ValuesByNumber.Values) - { - size += value.CalculateSize(); - } - return size; - } - - /// - /// Writes the extension values in this set to the output stream - /// - public void WriteTo(CodedOutputStream stream) - { - - WriteContext.Initialize(stream, out WriteContext ctx); - try - { - WriteTo(ref ctx); - } - finally - { - ctx.CopyStateTo(stream); - } - } - - /// - /// Writes the extension values in this set to the write context - /// - [SecuritySafeCritical] - public void WriteTo(ref WriteContext ctx) - { - foreach (var value in ValuesByNumber.Values) - { - value.WriteTo(ref ctx); - } - } - - internal bool IsInitialized() - { - return ValuesByNumber.Values.All(v => v.IsInitialized()); - } - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Google.Protobuf.Collections; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security; + +namespace Google.Protobuf +{ + /// + /// Methods for managing s with null checking. + /// + /// Most users will not use this class directly and its API is experimental and subject to change. + /// + public static class ExtensionSet + { + private static bool TryGetValue(ref ExtensionSet set, Extension extension, out IExtensionValue value) where TTarget : IExtendableMessage + { + if (set == null) + { + value = null; + return false; + } + return set.ValuesByNumber.TryGetValue(extension.FieldNumber, out value); + } + + /// + /// Gets the value of the specified extension + /// + public static TValue Get(ref ExtensionSet set, Extension extension) where TTarget : IExtendableMessage + { + IExtensionValue value; + if (TryGetValue(ref set, extension, out value)) + { + return ((ExtensionValue)value).GetValue(); + } + else + { + return extension.DefaultValue; + } + } + + /// + /// Gets the value of the specified repeated extension or null if it doesn't exist in this set + /// + public static RepeatedField Get(ref ExtensionSet set, RepeatedExtension extension) where TTarget : IExtendableMessage + { + IExtensionValue value; + if (TryGetValue(ref set, extension, out value)) + { + return ((RepeatedExtensionValue)value).GetValue(); + } + else + { + return null; + } + } + + /// + /// Gets the value of the specified repeated extension, registering it if it doesn't exist + /// + public static RepeatedField GetOrInitialize(ref ExtensionSet set, RepeatedExtension extension) where TTarget : IExtendableMessage + { + IExtensionValue value; + if (set == null) + { + value = extension.CreateValue(); + set = new ExtensionSet(); + set.ValuesByNumber.Add(extension.FieldNumber, value); + } + else + { + if (!set.ValuesByNumber.TryGetValue(extension.FieldNumber, out value)) + { + value = extension.CreateValue(); + set.ValuesByNumber.Add(extension.FieldNumber, value); + } + } + + return ((RepeatedExtensionValue)value).GetValue(); + } + + /// + /// Sets the value of the specified extension. This will make a new instance of ExtensionSet if the set is null. + /// + public static void Set(ref ExtensionSet set, Extension extension, TValue value) where TTarget : IExtendableMessage + { + ProtoPreconditions.CheckNotNullUnconstrained(value, nameof(value)); + + IExtensionValue extensionValue; + if (set == null) + { + extensionValue = extension.CreateValue(); + set = new ExtensionSet(); + set.ValuesByNumber.Add(extension.FieldNumber, extensionValue); + } + else + { + if (!set.ValuesByNumber.TryGetValue(extension.FieldNumber, out extensionValue)) + { + extensionValue = extension.CreateValue(); + set.ValuesByNumber.Add(extension.FieldNumber, extensionValue); + } + } + + ((ExtensionValue)extensionValue).SetValue(value); + } + + /// + /// Gets whether the value of the specified extension is set + /// + public static bool Has(ref ExtensionSet set, Extension extension) where TTarget : IExtendableMessage + { + IExtensionValue value; + return TryGetValue(ref set, extension, out value); + } + + /// + /// Clears the value of the specified extension + /// + public static void Clear(ref ExtensionSet set, Extension extension) where TTarget : IExtendableMessage + { + if (set == null) + { + return; + } + set.ValuesByNumber.Remove(extension.FieldNumber); + if (set.ValuesByNumber.Count == 0) + { + set = null; + } + } + + /// + /// Clears the value of the specified extension + /// + public static void Clear(ref ExtensionSet set, RepeatedExtension extension) where TTarget : IExtendableMessage + { + if (set == null) + { + return; + } + set.ValuesByNumber.Remove(extension.FieldNumber); + if (set.ValuesByNumber.Count == 0) + { + set = null; + } + } + + /// + /// Tries to merge a field from the coded input, returning true if the field was merged. + /// If the set is null or the field was not otherwise merged, this returns false. + /// + public static bool TryMergeFieldFrom(ref ExtensionSet set, CodedInputStream stream) where TTarget : IExtendableMessage + { + ParseContext.Initialize(stream, out ParseContext ctx); + try + { + return TryMergeFieldFrom(ref set, ref ctx); + } + finally + { + ctx.CopyStateTo(stream); + } + } + + /// + /// Tries to merge a field from the coded input, returning true if the field was merged. + /// If the set is null or the field was not otherwise merged, this returns false. + /// + public static bool TryMergeFieldFrom(ref ExtensionSet set, ref ParseContext ctx) where TTarget : IExtendableMessage + { + Extension extension; + int lastFieldNumber = WireFormat.GetTagFieldNumber(ctx.LastTag); + + IExtensionValue extensionValue; + if (set != null && set.ValuesByNumber.TryGetValue(lastFieldNumber, out extensionValue)) + { + extensionValue.MergeFrom(ref ctx); + return true; + } + else if (ctx.ExtensionRegistry != null && ctx.ExtensionRegistry.ContainsInputField(ctx.LastTag, typeof(TTarget), out extension)) + { + IExtensionValue value = extension.CreateValue(); + value.MergeFrom(ref ctx); + set = (set ?? new ExtensionSet()); + set.ValuesByNumber.Add(extension.FieldNumber, value); + return true; + } + else + { + return false; + } + } + + /// + /// Merges the second set into the first set, creating a new instance if first is null + /// + public static void MergeFrom(ref ExtensionSet first, ExtensionSet second) where TTarget : IExtendableMessage + { + if (second == null) + { + return; + } + if (first == null) + { + first = new ExtensionSet(); + } + foreach (var pair in second.ValuesByNumber) + { + IExtensionValue value; + if (first.ValuesByNumber.TryGetValue(pair.Key, out value)) + { + value.MergeFrom(pair.Value); + } + else + { + var cloned = pair.Value.Clone(); + first.ValuesByNumber[pair.Key] = cloned; + } + } + } + + /// + /// Clones the set into a new set. If the set is null, this returns null + /// + public static ExtensionSet Clone(ExtensionSet set) where TTarget : IExtendableMessage + { + if (set == null) + { + return null; + } + + var newSet = new ExtensionSet(); + foreach (var pair in set.ValuesByNumber) + { + var cloned = pair.Value.Clone(); + newSet.ValuesByNumber[pair.Key] = cloned; + } + return newSet; + } + } + + /// + /// Used for keeping track of extensions in messages. + /// methods route to this set. + /// + /// Most users will not need to use this class directly + /// + /// The message type that extensions in this set target + public sealed class ExtensionSet where TTarget : IExtendableMessage + { + internal Dictionary ValuesByNumber { get; } = new Dictionary(); + + /// + /// Gets a hash code of the set + /// + public override int GetHashCode() + { + int ret = typeof(TTarget).GetHashCode(); + foreach (KeyValuePair field in ValuesByNumber) + { + // Use ^ here to make the field order irrelevant. + int hash = field.Key.GetHashCode() ^ field.Value.GetHashCode(); + ret ^= hash; + } + return ret; + } + + /// + /// Returns whether this set is equal to the other object + /// + public override bool Equals(object other) + { + if (ReferenceEquals(this, other)) + { + return true; + } + ExtensionSet otherSet = other as ExtensionSet; + if (ValuesByNumber.Count != otherSet.ValuesByNumber.Count) + { + return false; + } + foreach (var pair in ValuesByNumber) + { + IExtensionValue secondValue; + if (!otherSet.ValuesByNumber.TryGetValue(pair.Key, out secondValue)) + { + return false; + } + if (!pair.Value.Equals(secondValue)) + { + return false; + } + } + return true; + } + + /// + /// Calculates the size of this extension set + /// + public int CalculateSize() + { + int size = 0; + foreach (var value in ValuesByNumber.Values) + { + size += value.CalculateSize(); + } + return size; + } + + /// + /// Writes the extension values in this set to the output stream + /// + public void WriteTo(CodedOutputStream stream) + { + + WriteContext.Initialize(stream, out WriteContext ctx); + try + { + WriteTo(ref ctx); + } + finally + { + ctx.CopyStateTo(stream); + } + } + + /// + /// Writes the extension values in this set to the write context + /// + [SecuritySafeCritical] + public void WriteTo(ref WriteContext ctx) + { + foreach (var value in ValuesByNumber.Values) + { + value.WriteTo(ref ctx); + } + } + + internal bool IsInitialized() + { + return ValuesByNumber.Values.All(v => v.IsInitialized()); + } + } +} diff --git a/csharp/src/Google.Protobuf/ExtensionValue.cs b/csharp/src/Google.Protobuf/ExtensionValue.cs index 8e39747b20fd0e3950da0805d19129786ab61152..ada5d79c80837969410bc4d4e1518009ed8ac784 100644 --- a/csharp/src/Google.Protobuf/ExtensionValue.cs +++ b/csharp/src/Google.Protobuf/ExtensionValue.cs @@ -1,14 +1,38 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; using System; +using System.Linq; namespace Google.Protobuf { @@ -20,13 +44,12 @@ namespace Google.Protobuf void WriteTo(ref WriteContext ctx); int CalculateSize(); bool IsInitialized(); - object GetValue(); } internal sealed class ExtensionValue : IExtensionValue { private T field; - private readonly FieldCodec codec; + private FieldCodec codec; internal ExtensionValue(FieldCodec codec) { @@ -36,7 +59,7 @@ namespace Google.Protobuf public int CalculateSize() { - return codec.CalculateUnconditionalSizeWithTag(field); + return codec.CalculateSizeWithTag(field); } public IExtensionValue Clone() @@ -95,8 +118,6 @@ namespace Google.Protobuf public T GetValue() => field; - object IExtensionValue.GetValue() => field; - public void SetValue(T value) { field = value; @@ -180,8 +201,6 @@ namespace Google.Protobuf public RepeatedField GetValue() => field; - object IExtensionValue.GetValue() => field; - public bool IsInitialized() { for (int i = 0; i < field.Count; i++) diff --git a/csharp/src/Google.Protobuf/FieldCodec.cs b/csharp/src/Google.Protobuf/FieldCodec.cs index 165734df99a74e6ba1f9a987b43475ac9ede8b0b..158739d50ae2444dd21edb32a57483ac5d900405 100644 --- a/csharp/src/Google.Protobuf/FieldCodec.cs +++ b/csharp/src/Google.Protobuf/FieldCodec.cs @@ -1,13 +1,37 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; +using Google.Protobuf.Compatibility; using Google.Protobuf.WellKnownTypes; using System; using System.Collections.Generic; @@ -27,105 +51,150 @@ namespace Google.Protobuf /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForString(uint tag) => ForString(tag, ""); + public static FieldCodec ForString(uint tag) + { + return FieldCodec.ForString(tag, ""); + } /// /// Retrieves a codec suitable for a bytes field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForBytes(uint tag) => ForBytes(tag, ByteString.Empty); + public static FieldCodec ForBytes(uint tag) + { + return FieldCodec.ForBytes(tag, ByteString.Empty); + } /// /// Retrieves a codec suitable for a bool field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForBool(uint tag) => ForBool(tag, false); + public static FieldCodec ForBool(uint tag) + { + return FieldCodec.ForBool(tag, false); + } /// /// Retrieves a codec suitable for an int32 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForInt32(uint tag) => ForInt32(tag, 0); + public static FieldCodec ForInt32(uint tag) + { + return FieldCodec.ForInt32(tag, 0); + } /// /// Retrieves a codec suitable for an sint32 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForSInt32(uint tag) => ForSInt32(tag, 0); + public static FieldCodec ForSInt32(uint tag) + { + return FieldCodec.ForSInt32(tag, 0); + } /// /// Retrieves a codec suitable for a fixed32 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForFixed32(uint tag) => ForFixed32(tag, 0); + public static FieldCodec ForFixed32(uint tag) + { + return FieldCodec.ForFixed32(tag, 0); + } /// /// Retrieves a codec suitable for an sfixed32 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForSFixed32(uint tag) => ForSFixed32(tag, 0); + public static FieldCodec ForSFixed32(uint tag) + { + return FieldCodec.ForSFixed32(tag, 0); + } /// /// Retrieves a codec suitable for a uint32 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForUInt32(uint tag) => ForUInt32(tag, 0); + public static FieldCodec ForUInt32(uint tag) + { + return FieldCodec.ForUInt32(tag, 0); + } /// /// Retrieves a codec suitable for an int64 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForInt64(uint tag) => ForInt64(tag, 0); + public static FieldCodec ForInt64(uint tag) + { + return FieldCodec.ForInt64(tag, 0); + } /// /// Retrieves a codec suitable for an sint64 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForSInt64(uint tag) => ForSInt64(tag, 0); + public static FieldCodec ForSInt64(uint tag) + { + return FieldCodec.ForSInt64(tag, 0); + } /// /// Retrieves a codec suitable for a fixed64 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForFixed64(uint tag) => ForFixed64(tag, 0); + public static FieldCodec ForFixed64(uint tag) + { + return FieldCodec.ForFixed64(tag, 0); + } /// /// Retrieves a codec suitable for an sfixed64 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForSFixed64(uint tag) => ForSFixed64(tag, 0); + public static FieldCodec ForSFixed64(uint tag) + { + return FieldCodec.ForSFixed64(tag, 0); + } /// /// Retrieves a codec suitable for a uint64 field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForUInt64(uint tag) => ForUInt64(tag, 0); + public static FieldCodec ForUInt64(uint tag) + { + return FieldCodec.ForUInt64(tag, 0); + } /// /// Retrieves a codec suitable for a float field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForFloat(uint tag) => ForFloat(tag, 0); + public static FieldCodec ForFloat(uint tag) + { + return FieldCodec.ForFloat(tag, 0); + } /// /// Retrieves a codec suitable for a double field with the given tag. /// /// The tag. /// A codec for the given tag. - public static FieldCodec ForDouble(uint tag) => ForDouble(tag, 0); + public static FieldCodec ForDouble(uint tag) + { + return FieldCodec.ForDouble(tag, 0); + } // Enums are tricky. We can probably use expression trees to build these delegates automatically, // but it's easy to generate the code for it. @@ -137,8 +206,10 @@ namespace Google.Protobuf /// A conversion function from to the enum type. /// A conversion function from the enum type to . /// A codec for the given tag. - public static FieldCodec ForEnum(uint tag, Func toInt32, Func fromInt32) => - ForEnum(tag, toInt32, fromInt32, default); + public static FieldCodec ForEnum(uint tag, Func toInt32, Func fromInt32) + { + return FieldCodec.ForEnum(tag, toInt32, fromInt32, default(T)); + } /// /// Retrieves a codec suitable for a string field with the given tag. @@ -494,7 +565,8 @@ namespace Google.Protobuf /// internal static FieldCodec GetCodec() { - if (!Codecs.TryGetValue(typeof(T), out object value)) + object value; + if (!Codecs.TryGetValue(typeof(T), out value)) { throw new InvalidOperationException("Invalid type argument requested for wrapper codec: " + typeof(T)); } @@ -503,7 +575,8 @@ namespace Google.Protobuf internal static ValueReader GetReader() where T : struct { - if (!Readers.TryGetValue(typeof(T), out object value)) + object value; + if (!Readers.TryGetValue(typeof(T), out value)) { throw new InvalidOperationException("Invalid type argument requested for wrapper reader: " + typeof(T)); } @@ -803,12 +876,6 @@ namespace Google.Protobuf /// public int CalculateSizeWithTag(T value) => IsDefault(value) ? 0 : ValueSizeCalculator(value) + tagSize; - /// - /// Calculates the size required to write the given value, with a tag, even - /// if the value is the default. - /// - internal int CalculateUnconditionalSizeWithTag(T value) => ValueSizeCalculator(value) + tagSize; - private bool IsDefault(T value) => EqualityComparer.Equals(value, DefaultValue); } } diff --git a/csharp/src/Google.Protobuf/FieldMaskTree.cs b/csharp/src/Google.Protobuf/FieldMaskTree.cs index aaa780ba92042279d0ecc81fdeabb523a3e91312..2297e7a119d57fd5d2b240bf48450273ac3b7aa8 100644 --- a/csharp/src/Google.Protobuf/FieldMaskTree.cs +++ b/csharp/src/Google.Protobuf/FieldMaskTree.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.Collections; @@ -97,7 +120,8 @@ namespace Google.Protobuf return this; } - if (!node.Children.TryGetValue(part, out Node childNode)) + Node childNode; + if (!node.Children.TryGetValue(part, out childNode)) { createNewBranch = true; childNode = new Node(); @@ -309,24 +333,15 @@ namespace Google.Protobuf { if (sourceField != null) { - // Well-known wrapper types are represented as nullable primitive types, so we do not "merge" them. - // Instead, any non-null value just overwrites the previous value directly. - if (field.MessageType.IsWrapperType) + var sourceByteString = ((IMessage)sourceField).ToByteString(); + var destinationValue = (IMessage)field.Accessor.GetValue(destination); + if (destinationValue != null) { - field.Accessor.SetValue(destination, sourceField); + destinationValue.MergeFrom(sourceByteString); } else { - var sourceByteString = ((IMessage)sourceField).ToByteString(); - var destinationValue = (IMessage)field.Accessor.GetValue(destination); - if (destinationValue != null) - { - destinationValue.MergeFrom(sourceByteString); - } - else - { - field.Accessor.SetValue(destination, field.MessageType.Parser.ParseFrom(sourceByteString)); - } + field.Accessor.SetValue(destination, field.MessageType.Parser.ParseFrom(sourceByteString)); } } } diff --git a/csharp/src/Google.Protobuf/FrameworkPortability.cs b/csharp/src/Google.Protobuf/FrameworkPortability.cs index edcfd89aa17f4382636e52f312a9a3914bd01066..9498dbe4ccc2736670e8f288dfff2f8357c3e95a 100644 --- a/csharp/src/Google.Protobuf/FrameworkPortability.cs +++ b/csharp/src/Google.Protobuf/FrameworkPortability.cs @@ -1,26 +1,49 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Text.RegularExpressions; - -namespace Google.Protobuf -{ - /// - /// Class containing helpful workarounds for various platform compatibility - /// - internal static class FrameworkPortability - { - // The value of RegexOptions.Compiled is 8. We can test for the presence at - // execution time using Enum.IsDefined, so a single build will do the right thing - // on each platform. (RegexOptions.Compiled isn't supported by PCLs.) - internal static readonly RegexOptions CompiledRegexWhereAvailable = - Enum.IsDefined(typeof(RegexOptions), 8) ? (RegexOptions)8 : RegexOptions.None; - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Text.RegularExpressions; + +namespace Google.Protobuf +{ + /// + /// Class containing helpful workarounds for various platform compatibility + /// + internal static class FrameworkPortability + { + // The value of RegexOptions.Compiled is 8. We can test for the presence at + // execution time using Enum.IsDefined, so a single build will do the right thing + // on each platform. (RegexOptions.Compiled isn't supported by PCLs.) + internal static readonly RegexOptions CompiledRegexWhereAvailable = + Enum.IsDefined(typeof(RegexOptions), 8) ? (RegexOptions)8 : RegexOptions.None; + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index 3924aa568b256e09cd651bc76ba47888ea28531a..224f1ca883fe1477c0767ffb63ed8c7625398708 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -1,51 +1,43 @@ - C# runtime library for Protocol Buffers - Google's data interchange format. Copyright 2015, Google Inc. Google Protocol Buffers - 3.25.2 - 10.0 + 3.14.0 + + 7.2 Google Inc. - netstandard1.1;netstandard2.0;net45;net50 + netstandard1.1;netstandard2.0;net45 true ../../keys/Google.Protobuf.snk true + true Protocol;Buffers;Binary;Serialization;Format;Google;proto;proto3 C# proto3 support https://github.com/protocolbuffers/protobuf - BSD-3-Clause + https://github.com/protocolbuffers/protobuf/blob/master/LICENSE git https://github.com/protocolbuffers/protobuf.git - true - true + $(DefineConstants);GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY + True $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - true $(DefineConstants);GOOGLE_PROTOBUF_SUPPORT_FAST_STRING - - $(DefineConstants);GOOGLE_PROTOBUF_SUPPORT_FAST_STRING;GOOGLE_PROTOBUF_SIMD - - + - - - - + - - diff --git a/csharp/src/Google.Protobuf/IBufferMessage.cs b/csharp/src/Google.Protobuf/IBufferMessage.cs index 65e7128b92512ae3cb796dd29d5f594b3bcaa268..c99a7d79fc02b984469b8e1d8b1335e1c83bc90e 100644 --- a/csharp/src/Google.Protobuf/IBufferMessage.cs +++ b/csharp/src/Google.Protobuf/IBufferMessage.cs @@ -1,14 +1,38 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf { +#if GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY /// /// Interface for a Protocol Buffers message, supporting /// parsing from and writing to . @@ -27,4 +51,5 @@ namespace Google.Protobuf /// void InternalWriteTo(ref WriteContext ctx); } +#endif } diff --git a/csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs b/csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs index ec395303e51f9f7a2984cb7130493d6e4830c1d1..a0090569f1d6f5c365d06306c276caeeb0b78749 100644 --- a/csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs +++ b/csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2016 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf diff --git a/csharp/src/Google.Protobuf/IDeepCloneable.cs b/csharp/src/Google.Protobuf/IDeepCloneable.cs index d8cfbedceae6f8eea524ba5a077cb0429c425365..c9c71bbe2c013465f3375cbc26f2c301bf67824d 100644 --- a/csharp/src/Google.Protobuf/IDeepCloneable.cs +++ b/csharp/src/Google.Protobuf/IDeepCloneable.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf diff --git a/csharp/src/Google.Protobuf/IExtendableMessage.cs b/csharp/src/Google.Protobuf/IExtendableMessage.cs index 2b199f61517ff9061a15825c82c6446a56c89557..8fca2b427b8b00496c271e4cb4cbb0ad58ef06f3 100644 --- a/csharp/src/Google.Protobuf/IExtendableMessage.cs +++ b/csharp/src/Google.Protobuf/IExtendableMessage.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; diff --git a/csharp/src/Google.Protobuf/IMessage.cs b/csharp/src/Google.Protobuf/IMessage.cs index 2fe0d55ff80702cef0c26728bfc1e2c4b217f28e..d089f9463985a8e5ecb7c29df93d5823b39a9c8e 100644 --- a/csharp/src/Google.Protobuf/IMessage.cs +++ b/csharp/src/Google.Protobuf/IMessage.cs @@ -1,64 +1,87 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using Google.Protobuf.Reflection; - -namespace Google.Protobuf -{ - /// - /// Interface for a Protocol Buffers message, supporting - /// basic operations required for serialization. - /// - public interface IMessage - { - /// - /// Merges the data from the specified coded input stream with the current message. - /// - /// See the user guide for precise merge semantics. - /// - void MergeFrom(CodedInputStream input); - - /// - /// Writes the data to the given coded output stream. - /// - /// Coded output stream to write the data to. Must not be null. - void WriteTo(CodedOutputStream output); - - /// - /// Calculates the size of this message in Protocol Buffer wire format, in bytes. - /// - /// The number of bytes required to write this message - /// to a coded output stream. - int CalculateSize(); - - /// - /// Descriptor for this message. All instances are expected to return the same descriptor, - /// and for generated types this will be an explicitly-implemented member, returning the - /// same value as the static property declared on the type. - /// - MessageDescriptor Descriptor { get; } - } - - /// - /// Generic interface for a Protocol Buffers message, - /// where the type parameter is expected to be the same type as - /// the implementation class. - /// - /// The message type. - public interface IMessage : IMessage, IEquatable, IDeepCloneable where T : IMessage - { - /// - /// Merges the given message into this one. - /// - /// See the user guide for precise merge semantics. - /// The message to merge with this one. Must not be null. - void MergeFrom(T message); - } -} +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using Google.Protobuf.Reflection; + +namespace Google.Protobuf +{ + /// + /// Interface for a Protocol Buffers message, supporting + /// basic operations required for serialization. + /// + public interface IMessage + { + /// + /// Merges the data from the specified coded input stream with the current message. + /// + /// See the user guide for precise merge semantics. + /// + void MergeFrom(CodedInputStream input); + + /// + /// Writes the data to the given coded output stream. + /// + /// Coded output stream to write the data to. Must not be null. + void WriteTo(CodedOutputStream output); + + /// + /// Calculates the size of this message in Protocol Buffer wire format, in bytes. + /// + /// The number of bytes required to write this message + /// to a coded output stream. + int CalculateSize(); + + /// + /// Descriptor for this message. All instances are expected to return the same descriptor, + /// and for generated types this will be an explicitly-implemented member, returning the + /// same value as the static property declared on the type. + /// + MessageDescriptor Descriptor { get; } + } + + /// + /// Generic interface for a Protocol Buffers message, + /// where the type parameter is expected to be the same type as + /// the implementation class. + /// + /// The message type. + public interface IMessage : IMessage, IEquatable, IDeepCloneable where T : IMessage + { + /// + /// Merges the given message into this one. + /// + /// See the user guide for precise merge semantics. + /// The message to merge with this one. Must not be null. + void MergeFrom(T message); + } +} diff --git a/csharp/src/Google.Protobuf/InvalidJsonException.cs b/csharp/src/Google.Protobuf/InvalidJsonException.cs index 3b895c05f9fde713b5887fcb710eb54396a07a04..b54342014215e5f85c014da617b39978f37fd8d9 100644 --- a/csharp/src/Google.Protobuf/InvalidJsonException.cs +++ b/csharp/src/Google.Protobuf/InvalidJsonException.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.IO; diff --git a/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs b/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs index b023d8a15c41b6346a1890f3e8aa8132e9b5f51d..c5ffe9bbf83d44f36f47ccf53d477a1790d54988 100644 --- a/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs +++ b/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs @@ -1,117 +1,140 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.IO; - -namespace Google.Protobuf -{ - /// - /// Thrown when a protocol message being parsed is invalid in some way, - /// e.g. it contains a malformed varint or a negative byte length. - /// - public sealed class InvalidProtocolBufferException : IOException - { - internal InvalidProtocolBufferException(string message) - : base(message) - { - } - - internal InvalidProtocolBufferException(string message, Exception innerException) - : base(message, innerException) - { - } - - internal static InvalidProtocolBufferException MoreDataAvailable() - { - return new InvalidProtocolBufferException( - "Completed reading a message while more data was available in the stream."); - } - - internal static InvalidProtocolBufferException TruncatedMessage() - { - return new InvalidProtocolBufferException( - "While parsing a protocol message, the input ended unexpectedly " + - "in the middle of a field. This could mean either that the " + - "input has been truncated or that an embedded message " + - "misreported its own length."); - } - - internal static InvalidProtocolBufferException NegativeSize() - { - return new InvalidProtocolBufferException( - "CodedInputStream encountered an embedded string or message " + - "which claimed to have negative size."); - } - - internal static InvalidProtocolBufferException MalformedVarint() - { - return new InvalidProtocolBufferException( - "CodedInputStream encountered a malformed varint."); - } - - /// - /// Creates an exception for an error condition of an invalid tag being encountered. - /// - internal static InvalidProtocolBufferException InvalidTag() - { - return new InvalidProtocolBufferException( - "Protocol message contained an invalid tag (zero)."); - } - - internal static InvalidProtocolBufferException InvalidWireType() - { - return new InvalidProtocolBufferException( - "Protocol message contained a tag with an invalid wire type."); - } - - internal static InvalidProtocolBufferException InvalidBase64(Exception innerException) - { - return new InvalidProtocolBufferException("Invalid base64 data", innerException); - } - - internal static InvalidProtocolBufferException InvalidEndTag() - { - return new InvalidProtocolBufferException( - "Protocol message end-group tag did not match expected tag."); - } - - internal static InvalidProtocolBufferException RecursionLimitExceeded() - { - return new InvalidProtocolBufferException( - "Protocol message had too many levels of nesting. May be malicious. " + - "Use CodedInputStream.SetRecursionLimit() to increase the depth limit."); - } - - internal static InvalidProtocolBufferException JsonRecursionLimitExceeded() - { - return new InvalidProtocolBufferException( - "Protocol message had too many levels of nesting. May be malicious. " + - "Use JsonParser.Settings to increase the depth limit."); - } - - internal static InvalidProtocolBufferException SizeLimitExceeded() - { - return new InvalidProtocolBufferException( - "Protocol message was too large. May be malicious. " + - "Use CodedInputStream.SetSizeLimit() to increase the size limit."); - } - - internal static InvalidProtocolBufferException InvalidMessageStreamTag() - { - return new InvalidProtocolBufferException( - "Stream of protocol messages had invalid tag. Expected tag is length-delimited field 1."); - } - - internal static InvalidProtocolBufferException MissingFields() - { - return new InvalidProtocolBufferException("Message was missing required fields"); - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; + +namespace Google.Protobuf +{ + /// + /// Thrown when a protocol message being parsed is invalid in some way, + /// e.g. it contains a malformed varint or a negative byte length. + /// + public sealed class InvalidProtocolBufferException : IOException + { + internal InvalidProtocolBufferException(string message) + : base(message) + { + } + + internal InvalidProtocolBufferException(string message, Exception innerException) + : base(message, innerException) + { + } + + internal static InvalidProtocolBufferException MoreDataAvailable() + { + return new InvalidProtocolBufferException( + "Completed reading a message while more data was available in the stream."); + } + + internal static InvalidProtocolBufferException TruncatedMessage() + { + return new InvalidProtocolBufferException( + "While parsing a protocol message, the input ended unexpectedly " + + "in the middle of a field. This could mean either that the " + + "input has been truncated or that an embedded message " + + "misreported its own length."); + } + + internal static InvalidProtocolBufferException NegativeSize() + { + return new InvalidProtocolBufferException( + "CodedInputStream encountered an embedded string or message " + + "which claimed to have negative size."); + } + + internal static InvalidProtocolBufferException MalformedVarint() + { + return new InvalidProtocolBufferException( + "CodedInputStream encountered a malformed varint."); + } + + /// + /// Creates an exception for an error condition of an invalid tag being encountered. + /// + internal static InvalidProtocolBufferException InvalidTag() + { + return new InvalidProtocolBufferException( + "Protocol message contained an invalid tag (zero)."); + } + + internal static InvalidProtocolBufferException InvalidWireType() + { + return new InvalidProtocolBufferException( + "Protocol message contained a tag with an invalid wire type."); + } + + internal static InvalidProtocolBufferException InvalidBase64(Exception innerException) + { + return new InvalidProtocolBufferException("Invalid base64 data", innerException); + } + + internal static InvalidProtocolBufferException InvalidEndTag() + { + return new InvalidProtocolBufferException( + "Protocol message end-group tag did not match expected tag."); + } + + internal static InvalidProtocolBufferException RecursionLimitExceeded() + { + return new InvalidProtocolBufferException( + "Protocol message had too many levels of nesting. May be malicious. " + + "Use CodedInputStream.SetRecursionLimit() to increase the depth limit."); + } + + internal static InvalidProtocolBufferException JsonRecursionLimitExceeded() + { + return new InvalidProtocolBufferException( + "Protocol message had too many levels of nesting. May be malicious. " + + "Use JsonParser.Settings to increase the depth limit."); + } + + internal static InvalidProtocolBufferException SizeLimitExceeded() + { + return new InvalidProtocolBufferException( + "Protocol message was too large. May be malicious. " + + "Use CodedInputStream.SetSizeLimit() to increase the size limit."); + } + + internal static InvalidProtocolBufferException InvalidMessageStreamTag() + { + return new InvalidProtocolBufferException( + "Stream of protocol messages had invalid tag. Expected tag is length-delimited field 1."); + } + + internal static InvalidProtocolBufferException MissingFields() + { + return new InvalidProtocolBufferException("Message was missing required fields"); + } +} } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs index 48d3ab4c3d2c58c58d3cbc786b883dedcf62cce0..4bffd58c1f40659849ea321cbebe8ff7ec0731ee 100644 --- a/csharp/src/Google.Protobuf/JsonFormatter.cs +++ b/csharp/src/Google.Protobuf/JsonFormatter.cs @@ -1,24 +1,45 @@ -#region Copyright notice and license +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Collections; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; using System.Text; using Google.Protobuf.Reflection; using Google.Protobuf.WellKnownTypes; +using System.IO; +using System.Linq; +using System.Collections.Generic; +using System.Reflection; namespace Google.Protobuf { @@ -40,13 +61,9 @@ namespace Google.Protobuf internal const string AnyTypeUrlField = "@type"; internal const string AnyDiagnosticValueField = "@value"; internal const string AnyWellKnownTypeValueField = "value"; + private const string TypeUrlPrefix = "type.googleapis.com"; private const string NameValueSeparator = ": "; - private const string ValueSeparator = ", "; - private const string MultilineValueSeparator = ","; - private const char ObjectOpenBracket = '{'; - private const char ObjectCloseBracket = '}'; - private const char ListBracketOpen = '['; - private const char ListBracketClose = ']'; + private const string PropertySeparator = ", "; /// /// Returns a formatter using the default settings. @@ -123,26 +140,11 @@ namespace Google.Protobuf /// Formats the specified message as JSON. /// /// The message to format. - /// This method delegates to Format(IMessage, int) with indentationLevel = 0. - /// The formatted message. - public string Format(IMessage message) => Format(message, indentationLevel: 0); - - /// - /// Formats the specified message as JSON. - /// - /// The message to format. - /// Indentation level to start at. - /// To keep consistent indentation when embedding a message inside another JSON string, set . E.g: - /// - /// var response = $@"{{ - /// ""data"": { Format(message, indentationLevel: 1) } - /// }}" - /// /// The formatted message. - public string Format(IMessage message, int indentationLevel) + public string Format(IMessage message) { var writer = new StringWriter(); - Format(message, writer, indentationLevel); + Format(message, writer); return writer.ToString(); } @@ -151,29 +153,19 @@ namespace Google.Protobuf /// /// The message to format. /// The TextWriter to write the formatted message to. - /// This method delegates to Format(IMessage, TextWriter, int) with indentationLevel = 0. /// The formatted message. - public void Format(IMessage message, TextWriter writer) => Format(message, writer, indentationLevel: 0); - - /// - /// Formats the specified message as JSON. When is not null, start indenting at the specified . - /// - /// The message to format. - /// The TextWriter to write the formatted message to. - /// Indentation level to start at. - /// To keep consistent indentation when embedding a message inside another JSON string, set . - public void Format(IMessage message, TextWriter writer, int indentationLevel) + public void Format(IMessage message, TextWriter writer) { ProtoPreconditions.CheckNotNull(message, nameof(message)); ProtoPreconditions.CheckNotNull(writer, nameof(writer)); if (message.Descriptor.IsWellKnownType) { - WriteWellKnownTypeValue(writer, message.Descriptor, message, indentationLevel); + WriteWellKnownTypeValue(writer, message.Descriptor, message); } else { - WriteMessage(writer, message, indentationLevel); + WriteMessage(writer, message); } } @@ -200,7 +192,7 @@ namespace Google.Protobuf return diagnosticFormatter.Format(message); } - private void WriteMessage(TextWriter writer, IMessage message, int indentationLevel) + private void WriteMessage(TextWriter writer, IMessage message) { if (message == null) { @@ -209,19 +201,19 @@ namespace Google.Protobuf } if (DiagnosticOnly) { - if (message is ICustomDiagnosticMessage customDiagnosticMessage) + ICustomDiagnosticMessage customDiagnosticMessage = message as ICustomDiagnosticMessage; + if (customDiagnosticMessage != null) { writer.Write(customDiagnosticMessage.ToDiagnosticString()); return; } } - - WriteBracketOpen(writer, ObjectOpenBracket); - bool writtenFields = WriteMessageFields(writer, message, false, indentationLevel + 1); - WriteBracketClose(writer, ObjectCloseBracket, writtenFields, indentationLevel); + writer.Write("{ "); + bool writtenFields = WriteMessageFields(writer, message, false); + writer.Write(writtenFields ? " }" : "}"); } - private bool WriteMessageFields(TextWriter writer, IMessage message, bool assumeFirstFieldWritten, int indentationLevel) + private bool WriteMessageFields(TextWriter writer, IMessage message, bool assumeFirstFieldWritten) { var fields = message.Descriptor.Fields; bool first = !assumeFirstFieldWritten; @@ -235,35 +227,20 @@ namespace Google.Protobuf continue; } - MaybeWriteValueSeparator(writer, first); - MaybeWriteValueWhitespace(writer, indentationLevel); - - if (settings.PreserveProtoFieldNames) - { - WriteString(writer, accessor.Descriptor.Name); - } - else + if (!first) { - WriteString(writer, accessor.Descriptor.JsonName); + writer.Write(PropertySeparator); } + + WriteString(writer, accessor.Descriptor.JsonName); writer.Write(NameValueSeparator); - WriteValue(writer, value, indentationLevel); + WriteValue(writer, value); first = false; } return !first; } - private void MaybeWriteValueSeparator(TextWriter writer, bool first) - { - if (first) - { - return; - } - - writer.Write(settings.Indentation == null ? ValueSeparator : MultilineValueSeparator); - } - /// /// Determines whether or not a field value should be serialized according to the field, /// its value in the message, and the settings of this formatter. @@ -335,20 +312,39 @@ namespace Google.Protobuf IList list = (IList) value; return list.Count == 0; } - return descriptor.FieldType switch - { - FieldType.Bool => (bool) value == false, - FieldType.Bytes => (ByteString) value == ByteString.Empty, - FieldType.String => (string) value == "", - FieldType.Double => (double) value == 0.0, - FieldType.SInt32 or FieldType.Int32 or FieldType.SFixed32 or FieldType.Enum => (int) value == 0, - FieldType.Fixed32 or FieldType.UInt32 => (uint) value == 0, - FieldType.Fixed64 or FieldType.UInt64 => (ulong) value == 0, - FieldType.SFixed64 or FieldType.Int64 or FieldType.SInt64 => (long) value == 0, - FieldType.Float => (float) value == 0f, - FieldType.Message or FieldType.Group => value == null, - _ => throw new ArgumentException("Invalid field type"), - }; + switch (descriptor.FieldType) + { + case FieldType.Bool: + return (bool) value == false; + case FieldType.Bytes: + return (ByteString) value == ByteString.Empty; + case FieldType.String: + return (string) value == ""; + case FieldType.Double: + return (double) value == 0.0; + case FieldType.SInt32: + case FieldType.Int32: + case FieldType.SFixed32: + case FieldType.Enum: + return (int) value == 0; + case FieldType.Fixed32: + case FieldType.UInt32: + return (uint) value == 0; + case FieldType.Fixed64: + case FieldType.UInt64: + return (ulong) value == 0; + case FieldType.SFixed64: + case FieldType.Int64: + case FieldType.SInt64: + return (long) value == 0; + case FieldType.Float: + return (float) value == 0f; + case FieldType.Message: + case FieldType.Group: // Never expect to get this, but... + return value == null; + default: + throw new ArgumentException("Invalid field type"); + } } /// @@ -359,46 +355,34 @@ namespace Google.Protobuf /// /// The writer to write the value to. Must not be null. /// The value to write. May be null. - /// Delegates to WriteValue(TextWriter, object, int) with indentationLevel = 0. - public void WriteValue(TextWriter writer, object value) => WriteValue(writer, value, 0); - - /// - /// Writes a single value to the given writer as JSON. Only types understood by - /// Protocol Buffers can be written in this way. This method is only exposed for - /// advanced use cases; most users should be using - /// or . - /// - /// The writer to write the value to. Must not be null. - /// The value to write. May be null. - /// The current indentationLevel. Not used when is null. - public void WriteValue(TextWriter writer, object value, int indentationLevel) + public void WriteValue(TextWriter writer, object value) { if (value == null || value is NullValue) { WriteNull(writer); } - else if (value is bool b) + else if (value is bool) { - writer.Write(b ? "true" : "false"); + writer.Write((bool)value ? "true" : "false"); } - else if (value is ByteString byteString) + else if (value is ByteString) { // Nothing in Base64 needs escaping writer.Write('"'); - writer.Write(byteString.ToBase64()); + writer.Write(((ByteString)value).ToBase64()); writer.Write('"'); } - else if (value is string str) + else if (value is string) { - WriteString(writer, str); + WriteString(writer, (string)value); } - else if (value is IDictionary dictionary) + else if (value is IDictionary) { - WriteDictionary(writer, dictionary, indentationLevel); + WriteDictionary(writer, (IDictionary)value); } - else if (value is IList list) + else if (value is IList) { - WriteList(writer, list, indentationLevel); + WriteList(writer, (IList)value); } else if (value is int || value is uint) { @@ -445,9 +429,9 @@ namespace Google.Protobuf writer.Write(text); } } - else if (value is IMessage message) + else if (value is IMessage) { - Format(message, writer, indentationLevel); + Format((IMessage)value, writer); } else { @@ -461,7 +445,7 @@ namespace Google.Protobuf /// values are using the embedded well-known types, in order to allow for dynamic messages /// in the future. /// - private void WriteWellKnownTypeValue(TextWriter writer, MessageDescriptor descriptor, object value, int indentationLevel) + private void WriteWellKnownTypeValue(TextWriter writer, MessageDescriptor descriptor, object value) { // Currently, we can never actually get here, because null values are always handled by the caller. But if we *could*, // this would do the right thing. @@ -477,8 +461,9 @@ namespace Google.Protobuf // WriteValue will do the right thing.) if (descriptor.IsWrapperType) { - if (value is IMessage message) + if (value is IMessage) { + var message = (IMessage) value; value = message.Descriptor.Fields[WrappersReflection.WrapperValueFieldNumber].Accessor.GetValue(message); } WriteValue(writer, value); @@ -501,26 +486,26 @@ namespace Google.Protobuf } if (descriptor.FullName == Struct.Descriptor.FullName) { - WriteStruct(writer, (IMessage)value, indentationLevel); + WriteStruct(writer, (IMessage)value); return; } if (descriptor.FullName == ListValue.Descriptor.FullName) { var fieldAccessor = descriptor.Fields[ListValue.ValuesFieldNumber].Accessor; - WriteList(writer, (IList)fieldAccessor.GetValue((IMessage)value), indentationLevel); + WriteList(writer, (IList)fieldAccessor.GetValue((IMessage)value)); return; } if (descriptor.FullName == Value.Descriptor.FullName) { - WriteStructFieldValue(writer, (IMessage)value, indentationLevel); + WriteStructFieldValue(writer, (IMessage)value); return; } if (descriptor.FullName == Any.Descriptor.FullName) { - WriteAny(writer, (IMessage)value, indentationLevel); + WriteAny(writer, (IMessage)value); return; } - WriteMessage(writer, (IMessage)value, indentationLevel); + WriteMessage(writer, (IMessage)value); } private void WriteTimestamp(TextWriter writer, IMessage value) @@ -548,7 +533,7 @@ namespace Google.Protobuf writer.Write(FieldMask.ToJson(paths, DiagnosticOnly)); } - private void WriteAny(TextWriter writer, IMessage value, int indentationLevel) + private void WriteAny(TextWriter writer, IMessage value) { if (DiagnosticOnly) { @@ -565,23 +550,23 @@ namespace Google.Protobuf throw new InvalidOperationException($"Type registry has no descriptor for type name '{typeName}'"); } IMessage message = descriptor.Parser.ParseFrom(data); - WriteBracketOpen(writer, ObjectOpenBracket); + writer.Write("{ "); WriteString(writer, AnyTypeUrlField); writer.Write(NameValueSeparator); WriteString(writer, typeUrl); if (descriptor.IsWellKnownType) { - writer.Write(ValueSeparator); + writer.Write(PropertySeparator); WriteString(writer, AnyWellKnownTypeValueField); writer.Write(NameValueSeparator); - WriteWellKnownTypeValue(writer, descriptor, message, indentationLevel); + WriteWellKnownTypeValue(writer, descriptor, message); } else { - WriteMessageFields(writer, message, true, indentationLevel); + WriteMessageFields(writer, message, true); } - WriteBracketClose(writer, ObjectCloseBracket, true, indentationLevel); + writer.Write(" }"); } private void WriteDiagnosticOnlyAny(TextWriter writer, IMessage value) @@ -592,7 +577,7 @@ namespace Google.Protobuf WriteString(writer, AnyTypeUrlField); writer.Write(NameValueSeparator); WriteString(writer, typeUrl); - writer.Write(ValueSeparator); + writer.Write(PropertySeparator); WriteString(writer, AnyDiagnosticValueField); writer.Write(NameValueSeparator); writer.Write('"'); @@ -601,9 +586,9 @@ namespace Google.Protobuf writer.Write(" }"); } - private void WriteStruct(TextWriter writer, IMessage message, int indentationLevel) + private void WriteStruct(TextWriter writer, IMessage message) { - WriteBracketOpen(writer, ObjectOpenBracket); + writer.Write("{ "); IDictionary fields = (IDictionary) message.Descriptor.Fields[Struct.FieldsFieldNumber].Accessor.GetValue(message); bool first = true; foreach (DictionaryEntry entry in fields) @@ -615,17 +600,19 @@ namespace Google.Protobuf throw new InvalidOperationException("Struct fields cannot have an empty key or a null value."); } - MaybeWriteValueSeparator(writer, first); - MaybeWriteValueWhitespace(writer, indentationLevel + 1); + if (!first) + { + writer.Write(PropertySeparator); + } WriteString(writer, key); writer.Write(NameValueSeparator); - WriteStructFieldValue(writer, value, indentationLevel + 1); + WriteStructFieldValue(writer, value); first = false; } - WriteBracketClose(writer, ObjectCloseBracket, !first, indentationLevel); + writer.Write(first ? "}" : " }"); } - private void WriteStructFieldValue(TextWriter writer, IMessage message, int indentationLevel) + private void WriteStructFieldValue(TextWriter writer, IMessage message) { var specifiedField = message.Descriptor.Oneofs[0].Accessor.GetCaseFieldDescriptor(message); if (specifiedField == null) @@ -646,7 +633,7 @@ namespace Google.Protobuf case Value.ListValueFieldNumber: // Structs and ListValues are nested messages, and already well-known types. var nestedMessage = (IMessage) specifiedField.Accessor.GetValue(message); - WriteWellKnownTypeValue(writer, nestedMessage.Descriptor, nestedMessage, indentationLevel); + WriteWellKnownTypeValue(writer, nestedMessage.Descriptor, nestedMessage); return; case Value.NullValueFieldNumber: WriteNull(writer); @@ -656,40 +643,43 @@ namespace Google.Protobuf } } - internal void WriteList(TextWriter writer, IList list, int indentationLevel = 0) + internal void WriteList(TextWriter writer, IList list) { - WriteBracketOpen(writer, ListBracketOpen); - + writer.Write("[ "); bool first = true; foreach (var value in list) { - MaybeWriteValueSeparator(writer, first); - MaybeWriteValueWhitespace(writer, indentationLevel + 1); - WriteValue(writer, value, indentationLevel + 1); + if (!first) + { + writer.Write(PropertySeparator); + } + WriteValue(writer, value); first = false; } - - WriteBracketClose(writer, ListBracketClose, !first, indentationLevel); + writer.Write(first ? "]" : " ]"); } - internal void WriteDictionary(TextWriter writer, IDictionary dictionary, int indentationLevel = 0) + internal void WriteDictionary(TextWriter writer, IDictionary dictionary) { - WriteBracketOpen(writer, ObjectOpenBracket); - + writer.Write("{ "); bool first = true; // This will box each pair. Could use IDictionaryEnumerator, but that's ugly in terms of disposal. foreach (DictionaryEntry pair in dictionary) { + if (!first) + { + writer.Write(PropertySeparator); + } string keyText; - if (pair.Key is string s) + if (pair.Key is string) { - keyText = s; + keyText = (string) pair.Key; } - else if (pair.Key is bool b) + else if (pair.Key is bool) { - keyText = b ? "true" : "false"; + keyText = (bool) pair.Key ? "true" : "false"; } - else if (pair.Key is int || pair.Key is uint || pair.Key is long || pair.Key is ulong) + else if (pair.Key is int || pair.Key is uint | pair.Key is long || pair.Key is ulong) { keyText = ((IFormattable) pair.Key).ToString("d", CultureInfo.InvariantCulture); } @@ -701,16 +691,12 @@ namespace Google.Protobuf } throw new ArgumentException("Unhandled dictionary key type: " + pair.Key.GetType()); } - - MaybeWriteValueSeparator(writer, first); - MaybeWriteValueWhitespace(writer, indentationLevel + 1); WriteString(writer, keyText); writer.Write(NameValueSeparator); WriteValue(writer, pair.Value); first = false; } - - WriteBracketClose(writer, ObjectCloseBracket, !first, indentationLevel); + writer.Write(first ? "}" : " }"); } /// @@ -794,49 +780,6 @@ namespace Google.Protobuf writer.Write(Hex[(c >> 0) & 0xf]); } - private void WriteBracketOpen(TextWriter writer, char openChar) - { - writer.Write(openChar); - if (settings.Indentation == null) - { - writer.Write(' '); - } - } - - private void WriteBracketClose(TextWriter writer, char closeChar, bool hasFields, int indentationLevel) - { - if (hasFields) - { - if (settings.Indentation != null) - { - writer.WriteLine(); - WriteIndentation(writer, indentationLevel); - } - else - { - writer.Write(" "); - } - } - - writer.Write(closeChar); - } - - private void MaybeWriteValueWhitespace(TextWriter writer, int indentationLevel) - { - if (settings.Indentation != null) { - writer.WriteLine(); - WriteIndentation(writer, indentationLevel); - } - } - - private void WriteIndentation(TextWriter writer, int indentationLevel) - { - for (int i = 0; i < indentationLevel; i++) - { - writer.Write(settings.Indentation); - } - } - /// /// Settings controlling JSON formatting. /// @@ -872,15 +815,6 @@ namespace Google.Protobuf /// public bool FormatEnumsAsIntegers { get; } - /// - /// Whether to use the original proto field names as defined in the .proto file. Defaults to false. - /// - public bool PreserveProtoFieldNames { get; } - - /// - /// Indentation string, used for formatting. Setting null disables indentation. - /// - public string Indentation { get; } /// /// Creates a new object with the specified formatting of default values @@ -897,7 +831,7 @@ namespace Google.Protobuf /// /// true if default values (0, empty strings etc) should be formatted; false otherwise. /// The to use when formatting messages. - public Settings(bool formatDefaultValues, TypeRegistry typeRegistry) : this(formatDefaultValues, typeRegistry, false, false) + public Settings(bool formatDefaultValues, TypeRegistry typeRegistry) : this(formatDefaultValues, typeRegistry, false) { } @@ -907,55 +841,32 @@ namespace Google.Protobuf /// true if default values (0, empty strings etc) should be formatted; false otherwise. /// The to use when formatting messages. TypeRegistry.Empty will be used if it is null. /// true to format the enums as integers; false to format enums as enum names. - /// true to preserve proto field names; false to convert them to lowerCamelCase. - /// The indentation string to use for multi-line formatting. null to disable multi-line format. private Settings(bool formatDefaultValues, TypeRegistry typeRegistry, - bool formatEnumsAsIntegers, - bool preserveProtoFieldNames, - string indentation = null) + bool formatEnumsAsIntegers) { FormatDefaultValues = formatDefaultValues; TypeRegistry = typeRegistry ?? TypeRegistry.Empty; FormatEnumsAsIntegers = formatEnumsAsIntegers; - PreserveProtoFieldNames = preserveProtoFieldNames; - Indentation = indentation; } /// /// Creates a new object with the specified formatting of default values and the current settings. /// /// true if default values (0, empty strings etc) should be formatted; false otherwise. - public Settings WithFormatDefaultValues(bool formatDefaultValues) => new Settings(formatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, PreserveProtoFieldNames, Indentation); + public Settings WithFormatDefaultValues(bool formatDefaultValues) => new Settings(formatDefaultValues, TypeRegistry, FormatEnumsAsIntegers); /// /// Creates a new object with the specified type registry and the current settings. /// /// The to use when formatting messages. - public Settings WithTypeRegistry(TypeRegistry typeRegistry) => new Settings(FormatDefaultValues, typeRegistry, FormatEnumsAsIntegers, PreserveProtoFieldNames, Indentation); + public Settings WithTypeRegistry(TypeRegistry typeRegistry) => new Settings(FormatDefaultValues, typeRegistry, FormatEnumsAsIntegers); /// /// Creates a new object with the specified enums formatting option and the current settings. /// /// true to format the enums as integers; false to format enums as enum names. - public Settings WithFormatEnumsAsIntegers(bool formatEnumsAsIntegers) => new Settings(FormatDefaultValues, TypeRegistry, formatEnumsAsIntegers, PreserveProtoFieldNames, Indentation); - - /// - /// Creates a new object with the specified field name formatting option and the current settings. - /// - /// true to preserve proto field names; false to convert them to lowerCamelCase. - public Settings WithPreserveProtoFieldNames(bool preserveProtoFieldNames) => new Settings(FormatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, preserveProtoFieldNames, Indentation); - - /// - /// Creates a new object with the specified indentation and the current settings. - /// - /// The string to output for each level of indentation (nesting). The default is two spaces per level. Use null to disable indentation entirely. - /// A non-null value for will insert additional line-breaks to the JSON output. - /// Each line will contain either a single value, or braces. The default line-break is determined by , - /// which is "\n" on Unix platforms, and "\r\n" on Windows. If seems to produce empty lines, - /// you need to pass a that uses a "\n" newline. See . - /// - public Settings WithIndentation(string indentation = " ") => new Settings(FormatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, PreserveProtoFieldNames, indentation); + public Settings WithFormatEnumsAsIntegers(bool formatEnumsAsIntegers) => new Settings(FormatDefaultValues, TypeRegistry, formatEnumsAsIntegers); } // Effectively a cache of mapping from enum values to the original name as specified in the proto file, @@ -963,27 +874,45 @@ namespace Google.Protobuf // The need for this is unfortunate, as is its unbounded size, but realistically it shouldn't cause issues. private static class OriginalEnumValueHelper { - private static readonly ConcurrentDictionary> dictionaries - = new ConcurrentDictionary>(); + // TODO: In the future we might want to use ConcurrentDictionary, at the point where all + // the platforms we target have it. + private static readonly Dictionary> dictionaries + = new Dictionary>(); - [UnconditionalSuppressMessage("Trimming", "IL2072", - Justification = "The field for the value must still be present. It will be returned by reflection, will be in this collection, and its name can be resolved.")] internal static string GetOriginalName(object value) { - Dictionary nameMapping = dictionaries.GetOrAdd(value.GetType(), static t => GetNameMapping(t)); + var enumType = value.GetType(); + Dictionary nameMapping; + lock (dictionaries) + { + if (!dictionaries.TryGetValue(enumType, out nameMapping)) + { + nameMapping = GetNameMapping(enumType); + dictionaries[enumType] = nameMapping; + } + } + string originalName; // If this returns false, originalName will be null, which is what we want. - nameMapping.TryGetValue(value, out string originalName); + nameMapping.TryGetValue(value, out originalName); return originalName; } - private static Dictionary GetNameMapping( - [DynamicallyAccessedMembers( - DynamicallyAccessedMemberTypes.PublicFields | - DynamicallyAccessedMemberTypes.NonPublicFields)] - System.Type enumType) - { - return enumType.GetTypeInfo().DeclaredFields +#if NET35 + // TODO: Consider adding functionality to TypeExtensions to avoid this difference. + private static Dictionary GetNameMapping(System.Type enumType) => + enumType.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static) + .Where(f => (f.GetCustomAttributes(typeof(OriginalNameAttribute), false) + .FirstOrDefault() as OriginalNameAttribute) + ?.PreferredAlias ?? true) + .ToDictionary(f => f.GetValue(null), + f => (f.GetCustomAttributes(typeof(OriginalNameAttribute), false) + .FirstOrDefault() as OriginalNameAttribute) + // If the attribute hasn't been applied, fall back to the name of the field. + ?.Name ?? f.Name); +#else + private static Dictionary GetNameMapping(System.Type enumType) => + enumType.GetTypeInfo().DeclaredFields .Where(f => f.IsStatic) .Where(f => f.GetCustomAttributes() .FirstOrDefault()?.PreferredAlias ?? true) @@ -992,7 +921,7 @@ namespace Google.Protobuf .FirstOrDefault() // If the attribute hasn't been applied, fall back to the name of the field. ?.Name ?? f.Name); - } +#endif } } } diff --git a/csharp/src/Google.Protobuf/JsonParser.cs b/csharp/src/Google.Protobuf/JsonParser.cs index d73d0832ba5e18dc9b39763871fe52515dde010d..cb5f5a8f21a765a2bccc8754faaf4d8c826122d3 100644 --- a/csharp/src/Google.Protobuf/JsonParser.cs +++ b/csharp/src/Google.Protobuf/JsonParser.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Reflection; @@ -47,7 +70,8 @@ namespace Google.Protobuf // TODO: Consider introducing a class containing parse state of the parser, tokenizer and depth. That would simplify these handlers // and the signatures of various methods. - private static readonly Dictionary> WellKnownTypeHandlers = new() + private static readonly Dictionary> + WellKnownTypeHandlers = new Dictionary> { { Timestamp.Descriptor.FullName, (parser, message, tokenizer) => MergeTimestamp(message, tokenizer.Next()) }, { Duration.Descriptor.FullName, (parser, message, tokenizer) => MergeDuration(message, tokenizer.Next()) }, @@ -132,7 +156,8 @@ namespace Google.Protobuf } if (message.Descriptor.IsWellKnownType) { - if (WellKnownTypeHandlers.TryGetValue(message.Descriptor.FullName, out Action handler)) + Action handler; + if (WellKnownTypeHandlers.TryGetValue(message.Descriptor.FullName, out handler)) { handler(this, message, tokenizer); return; @@ -162,7 +187,8 @@ namespace Google.Protobuf throw new InvalidOperationException("Unexpected token type " + token.Type); } string name = token.StringValue; - if (jsonFieldMap.TryGetValue(name, out FieldDescriptor field)) + FieldDescriptor field; + if (jsonFieldMap.TryGetValue(name, out field)) { if (field.ContainingOneof != null) { @@ -277,7 +303,11 @@ namespace Google.Protobuf } object key = ParseMapKey(keyField, token.StringValue); object value = ParseSingleValue(valueField, tokenizer); - dictionary[key] = value ?? throw new InvalidProtocolBufferException("Map values must not be null"); + if (value == null) + { + throw new InvalidProtocolBufferException("Map values must not be null"); + } + dictionary[key] = value; } } @@ -619,15 +649,19 @@ namespace Google.Protobuf { return float.NaN; } - float converted = (float) value; - // If the value is out of range of float, the cast representation will be infinite. - // If the original value was infinite as well, that's fine - we'll return the 32-bit - // version (with the correct sign). - if (float.IsInfinity(converted) && !double.IsInfinity(value)) + if (value > float.MaxValue || value < float.MinValue) { + if (double.IsPositiveInfinity(value)) + { + return float.PositiveInfinity; + } + if (double.IsNegativeInfinity(value)) + { + return float.NegativeInfinity; + } throw new InvalidProtocolBufferException($"Value out of range: {value}"); } - return converted; + return (float) value; case FieldType.Enum: CheckInteger(value); // Just return it as an int, and let the CLR convert it. @@ -819,7 +853,7 @@ namespace Google.Protobuf if (secondsToAdd < 0 && nanosToAdd > 0) { secondsToAdd++; - nanosToAdd -= Duration.NanosecondsPerSecond; + nanosToAdd = nanosToAdd - Duration.NanosecondsPerSecond; } if (secondsToAdd != 0 || nanosToAdd != 0) { @@ -1015,20 +1049,23 @@ namespace Google.Protobuf /// when unknown fields are encountered. /// /// true if unknown fields should be ignored when parsing; false to throw an exception. - public Settings WithIgnoreUnknownFields(bool ignoreUnknownFields) => new(RecursionLimit, TypeRegistry, ignoreUnknownFields); + public Settings WithIgnoreUnknownFields(bool ignoreUnknownFields) => + new Settings(RecursionLimit, TypeRegistry, ignoreUnknownFields); /// /// Creates a new object based on this one, but with the specified recursion limit. /// /// The new recursion limit. - public Settings WithRecursionLimit(int recursionLimit) => new(recursionLimit, TypeRegistry, IgnoreUnknownFields); + public Settings WithRecursionLimit(int recursionLimit) => + new Settings(recursionLimit, TypeRegistry, IgnoreUnknownFields); /// /// Creates a new object based on this one, but with the specified type registry. /// /// The new type registry. Must not be null. public Settings WithTypeRegistry(TypeRegistry typeRegistry) => - new(RecursionLimit, + new Settings( + RecursionLimit, ProtoPreconditions.CheckNotNull(typeRegistry, nameof(typeRegistry)), IgnoreUnknownFields); } diff --git a/csharp/src/Google.Protobuf/JsonToken.cs b/csharp/src/Google.Protobuf/JsonToken.cs index 31238e83a05a31773e2e2df21bfcabddd1b7d3ab..6c0138ccb6a0ae810a0d0753b2fac442c2e6c1b5 100644 --- a/csharp/src/Google.Protobuf/JsonToken.cs +++ b/csharp/src/Google.Protobuf/JsonToken.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -13,14 +36,24 @@ namespace Google.Protobuf { internal sealed class JsonToken : IEquatable { - internal static JsonToken Null { get; } = new JsonToken(TokenType.Null); - internal static JsonToken False { get; } = new JsonToken(TokenType.False); - internal static JsonToken True { get; } = new JsonToken(TokenType.True); - internal static JsonToken StartObject { get; } = new JsonToken(TokenType.StartObject); - internal static JsonToken EndObject { get; } = new JsonToken(TokenType.EndObject); - internal static JsonToken StartArray { get; } = new JsonToken(TokenType.StartArray); - internal static JsonToken EndArray { get; } = new JsonToken(TokenType.EndArray); - internal static JsonToken EndDocument { get; } = new JsonToken(TokenType.EndDocument); + // Tokens with no value can be reused. + private static readonly JsonToken _true = new JsonToken(TokenType.True); + private static readonly JsonToken _false = new JsonToken(TokenType.False); + private static readonly JsonToken _null = new JsonToken(TokenType.Null); + private static readonly JsonToken startObject = new JsonToken(TokenType.StartObject); + private static readonly JsonToken endObject = new JsonToken(TokenType.EndObject); + private static readonly JsonToken startArray = new JsonToken(TokenType.StartArray); + private static readonly JsonToken endArray = new JsonToken(TokenType.EndArray); + private static readonly JsonToken endDocument = new JsonToken(TokenType.EndDocument); + + internal static JsonToken Null { get { return _null; } } + internal static JsonToken False { get { return _false; } } + internal static JsonToken True { get { return _true; } } + internal static JsonToken StartObject{ get { return startObject; } } + internal static JsonToken EndObject { get { return endObject; } } + internal static JsonToken StartArray { get { return startArray; } } + internal static JsonToken EndArray { get { return endArray; } } + internal static JsonToken EndDocument { get { return endDocument; } } internal static JsonToken Name(string name) { @@ -61,9 +94,9 @@ namespace Google.Protobuf private readonly string stringValue; private readonly double numberValue; - internal TokenType Type => type; - internal string StringValue => stringValue; - internal double NumberValue => numberValue; + internal TokenType Type { get { return type; } } + internal string StringValue { get { return stringValue; } } + internal double NumberValue { get { return numberValue; } } private JsonToken(TokenType type, string stringValue = null, double numberValue = 0) { @@ -72,7 +105,10 @@ namespace Google.Protobuf this.numberValue = numberValue; } - public override bool Equals(object obj) => Equals(obj as JsonToken); + public override bool Equals(object obj) + { + return Equals(obj as JsonToken); + } public override int GetHashCode() { @@ -88,26 +124,38 @@ namespace Google.Protobuf public override string ToString() { - return type switch + switch (type) { - TokenType.Null => "null", - TokenType.True => "true", - TokenType.False => "false", - TokenType.Name => $"name ({stringValue})", - TokenType.StringValue => $"value ({stringValue})", - TokenType.Number => $"number ({numberValue})", - TokenType.StartObject => "start-object", - TokenType.EndObject => "end-object", - TokenType.StartArray => "start-array", - TokenType.EndArray => "end-array", - TokenType.EndDocument => "end-document", - _ => throw new InvalidOperationException($"Token is of unknown type {type}"), - }; + case TokenType.Null: + return "null"; + case TokenType.True: + return "true"; + case TokenType.False: + return "false"; + case TokenType.Name: + return "name (" + stringValue + ")"; + case TokenType.StringValue: + return "value (" + stringValue + ")"; + case TokenType.Number: + return "number (" + numberValue + ")"; + case TokenType.StartObject: + return "start-object"; + case TokenType.EndObject: + return "end-object"; + case TokenType.StartArray: + return "start-array"; + case TokenType.EndArray: + return "end-array"; + case TokenType.EndDocument: + return "end-document"; + default: + throw new InvalidOperationException("Token is of unknown type " + type); + } } public bool Equals(JsonToken other) { - if (other is null) + if (ReferenceEquals(other, null)) { return false; } diff --git a/csharp/src/Google.Protobuf/JsonTokenizer.cs b/csharp/src/Google.Protobuf/JsonTokenizer.cs index 16daa5626da660467f097d2ce183b820cce9cce9..4725e7cc5119753e921b6ed556a1db4305cc223c 100644 --- a/csharp/src/Google.Protobuf/JsonTokenizer.cs +++ b/csharp/src/Google.Protobuf/JsonTokenizer.cs @@ -1,12 +1,34 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion - using System; using System.Collections.Generic; using System.Globalization; @@ -340,19 +362,29 @@ namespace Google.Protobuf private char ReadEscapedCharacter() { char c = reader.ReadOrFail("Unexpected end of text while reading character escape sequence"); - return c switch + switch (c) { - 'n' => '\n', - '\\' => '\\', - 'b' => '\b', - 'f' => '\f', - 'r' => '\r', - 't' => '\t', - '"' => '"', - '/' => '/', - 'u' => ReadUnicodeEscape(), - _ => throw reader.CreateException(string.Format(CultureInfo.InvariantCulture, "Invalid character in character escape sequence: U+{0:x4}", (int)c)), - }; + case 'n': + return '\n'; + case '\\': + return '\\'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'r': + return '\r'; + case 't': + return '\t'; + case '"': + return '"'; + case '/': + return '/'; + case 'u': + return ReadUnicodeEscape(); + default: + throw reader.CreateException(string.Format(CultureInfo.InvariantCulture, "Invalid character in character escape sequence: U+{0:x4}", (int) c)); + } } /// @@ -439,18 +471,9 @@ namespace Google.Protobuf // TODO: What exception should we throw if the value can't be represented as a double? try { - double result = double.Parse(builder.ToString(), + return double.Parse(builder.ToString(), NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent, CultureInfo.InvariantCulture); - - // .NET Core 3.0 and later returns infinity if the number is too large or small to be represented. - // For compatibility with other Protobuf implementations the tokenizer should still throw. - if (double.IsInfinity(result)) - { - throw reader.CreateException("Numeric value out of range: " + builder); - } - - return result; } catch (OverflowException) { @@ -466,7 +489,8 @@ namespace Google.Protobuf throw reader.CreateException("Invalid numeric literal"); } builder.Append(first); - char? next = ConsumeDigits(builder, out int digitCount); + int digitCount; + char? next = ConsumeDigits(builder, out digitCount); if (first == '0' && digitCount != 0) { throw reader.CreateException("Invalid numeric literal: leading 0 for non-zero value."); @@ -477,7 +501,8 @@ namespace Google.Protobuf private char? ReadFrac(StringBuilder builder) { builder.Append('.'); // Already consumed this - char? next = ConsumeDigits(builder, out int digitCount); + int digitCount; + char? next = ConsumeDigits(builder, out digitCount); if (digitCount == 0) { throw reader.CreateException("Invalid numeric literal: fraction with no trailing digits"); @@ -501,7 +526,8 @@ namespace Google.Protobuf { reader.PushBack(next.Value); } - next = ConsumeDigits(builder, out int digitCount); + int digitCount; + next = ConsumeDigits(builder, out digitCount); if (digitCount == 0) { throw reader.CreateException("Invalid numeric literal: exponent without value"); @@ -556,13 +582,20 @@ namespace Google.Protobuf { containerStack.Pop(); var parent = containerStack.Peek(); - state = parent switch + switch (parent) { - ContainerType.Object => State.ObjectAfterProperty, - ContainerType.Array => State.ArrayAfterValue, - ContainerType.Document => State.ExpectedEndOfDocument, - _ => throw new InvalidOperationException("Unexpected container type: " + parent), - }; + case ContainerType.Object: + state = State.ObjectAfterProperty; + break; + case ContainerType.Array: + state = State.ArrayAfterValue; + break; + case ContainerType.Document: + state = State.ExpectedEndOfDocument; + break; + default: + throw new InvalidOperationException("Unexpected container type: " + parent); + } } private enum ContainerType diff --git a/csharp/src/Google.Protobuf/LimitedInputStream.cs b/csharp/src/Google.Protobuf/LimitedInputStream.cs index 3e42aeba171020236ac7a191b454636d702bbf88..50ead9c9929e5fe61c93e683f32ad02453508443 100644 --- a/csharp/src/Google.Protobuf/LimitedInputStream.cs +++ b/csharp/src/Google.Protobuf/LimitedInputStream.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -28,20 +51,34 @@ namespace Google.Protobuf bytesLeft = size; } - public override bool CanRead => true; - public override bool CanSeek => false; - public override bool CanWrite => false; + public override bool CanRead + { + get { return true; } + } + + public override bool CanSeek + { + get { return false; } + } + + public override bool CanWrite + { + get { return false; } + } public override void Flush() { } - public override long Length => throw new NotSupportedException(); + public override long Length + { + get { throw new NotSupportedException(); } + } public override long Position { - get => throw new NotSupportedException(); - set => throw new NotSupportedException(); + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } } public override int Read(byte[] buffer, int offset, int count) @@ -55,10 +92,19 @@ namespace Google.Protobuf return 0; } - public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException(); + } - public override void SetLength(long value) => throw new NotSupportedException(); + public override void SetLength(long value) + { + throw new NotSupportedException(); + } - public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException(); + } } } diff --git a/csharp/src/Google.Protobuf/MessageExtensions.cs b/csharp/src/Google.Protobuf/MessageExtensions.cs index 00d57567f2748f984ba85211dcaf59402800969b..36a9df7286ed1fa19d6dbba7a61fca9fa0f8be42 100644 --- a/csharp/src/Google.Protobuf/MessageExtensions.cs +++ b/csharp/src/Google.Protobuf/MessageExtensions.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Reflection; @@ -56,24 +79,6 @@ namespace Google.Protobuf public static void MergeFrom(this IMessage message, Stream input) => MergeFrom(message, input, false, null); - /// - /// Merges data from the given span into an existing message. - /// - /// The message to merge the data into. - /// Span containing the data to merge, which must be protobuf-encoded binary data. - [SecuritySafeCritical] - public static void MergeFrom(this IMessage message, ReadOnlySpan span) => - MergeFrom(message, span, false, null); - - /// - /// Merges data from the given sequence into an existing message. - /// - /// The message to merge the data into. - /// Sequence from the specified data to merge, which must be protobuf-encoded binary data. - [SecuritySafeCritical] - public static void MergeFrom(this IMessage message, ReadOnlySequence sequence) => - MergeFrom(message, sequence, false, null); - /// /// Merges length-delimited data from the given stream into an existing message. /// @@ -93,7 +98,7 @@ namespace Google.Protobuf /// The message data as a byte array. public static byte[] ToByteArray(this IMessage message) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); + ProtoPreconditions.CheckNotNull(message, "message"); byte[] result = new byte[message.CalculateSize()]; CodedOutputStream output = new CodedOutputStream(result); message.WriteTo(output); @@ -108,8 +113,8 @@ namespace Google.Protobuf /// The stream to write to. public static void WriteTo(this IMessage message, Stream output) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); - ProtoPreconditions.CheckNotNull(output, nameof(output)); + ProtoPreconditions.CheckNotNull(message, "message"); + ProtoPreconditions.CheckNotNull(output, "output"); CodedOutputStream codedOutput = new CodedOutputStream(output); message.WriteTo(codedOutput); codedOutput.Flush(); @@ -122,8 +127,8 @@ namespace Google.Protobuf /// The output stream to write to. public static void WriteDelimitedTo(this IMessage message, Stream output) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); - ProtoPreconditions.CheckNotNull(output, nameof(output)); + ProtoPreconditions.CheckNotNull(message, "message"); + ProtoPreconditions.CheckNotNull(output, "output"); CodedOutputStream codedOutput = new CodedOutputStream(output); codedOutput.WriteLength(message.CalculateSize()); message.WriteTo(codedOutput); @@ -137,7 +142,7 @@ namespace Google.Protobuf /// The message data as a byte string. public static ByteString ToByteString(this IMessage message) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); + ProtoPreconditions.CheckNotNull(message, "message"); return ByteString.AttachBytes(message.ToByteArray()); } @@ -237,34 +242,30 @@ namespace Google.Protobuf // Implementations allowing unknown fields to be discarded. internal static void MergeFrom(this IMessage message, byte[] data, bool discardUnknownFields, ExtensionRegistry registry) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); - ProtoPreconditions.CheckNotNull(data, nameof(data)); - CodedInputStream input = new CodedInputStream(data) - { - DiscardUnknownFields = discardUnknownFields, - ExtensionRegistry = registry - }; + ProtoPreconditions.CheckNotNull(message, "message"); + ProtoPreconditions.CheckNotNull(data, "data"); + CodedInputStream input = new CodedInputStream(data); + input.DiscardUnknownFields = discardUnknownFields; + input.ExtensionRegistry = registry; message.MergeFrom(input); input.CheckReadEndOfStreamTag(); } internal static void MergeFrom(this IMessage message, byte[] data, int offset, int length, bool discardUnknownFields, ExtensionRegistry registry) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); - ProtoPreconditions.CheckNotNull(data, nameof(data)); - CodedInputStream input = new CodedInputStream(data, offset, length) - { - DiscardUnknownFields = discardUnknownFields, - ExtensionRegistry = registry - }; + ProtoPreconditions.CheckNotNull(message, "message"); + ProtoPreconditions.CheckNotNull(data, "data"); + CodedInputStream input = new CodedInputStream(data, offset, length); + input.DiscardUnknownFields = discardUnknownFields; + input.ExtensionRegistry = registry; message.MergeFrom(input); input.CheckReadEndOfStreamTag(); } internal static void MergeFrom(this IMessage message, ByteString data, bool discardUnknownFields, ExtensionRegistry registry) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); - ProtoPreconditions.CheckNotNull(data, nameof(data)); + ProtoPreconditions.CheckNotNull(message, "message"); + ProtoPreconditions.CheckNotNull(data, "data"); CodedInputStream input = data.CreateCodedInput(); input.DiscardUnknownFields = discardUnknownFields; input.ExtensionRegistry = registry; @@ -274,13 +275,11 @@ namespace Google.Protobuf internal static void MergeFrom(this IMessage message, Stream input, bool discardUnknownFields, ExtensionRegistry registry) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); - ProtoPreconditions.CheckNotNull(input, nameof(input)); - CodedInputStream codedInput = new CodedInputStream(input) - { - DiscardUnknownFields = discardUnknownFields, - ExtensionRegistry = registry - }; + ProtoPreconditions.CheckNotNull(message, "message"); + ProtoPreconditions.CheckNotNull(input, "input"); + CodedInputStream codedInput = new CodedInputStream(input); + codedInput.DiscardUnknownFields = discardUnknownFields; + codedInput.ExtensionRegistry = registry; message.MergeFrom(codedInput); codedInput.CheckReadEndOfStreamTag(); } @@ -295,20 +294,10 @@ namespace Google.Protobuf ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref ctx.state); } - [SecuritySafeCritical] - internal static void MergeFrom(this IMessage message, ReadOnlySpan data, bool discardUnknownFields, ExtensionRegistry registry) - { - ParseContext.Initialize(data, out ParseContext ctx); - ctx.DiscardUnknownFields = discardUnknownFields; - ctx.ExtensionRegistry = registry; - ParsingPrimitivesMessages.ReadRawMessage(ref ctx, message); - ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref ctx.state); - } - internal static void MergeDelimitedFrom(this IMessage message, Stream input, bool discardUnknownFields, ExtensionRegistry registry) { - ProtoPreconditions.CheckNotNull(message, nameof(message)); - ProtoPreconditions.CheckNotNull(input, nameof(input)); + ProtoPreconditions.CheckNotNull(message, "message"); + ProtoPreconditions.CheckNotNull(input, "input"); int size = (int) CodedInputStream.ReadRawVarint32(input); Stream limitedStream = new LimitedInputStream(input, size); MergeFrom(message, limitedStream, discardUnknownFields, registry); diff --git a/csharp/src/Google.Protobuf/MessageParser.cs b/csharp/src/Google.Protobuf/MessageParser.cs index 86ef16dc2c8ca5612e770b56ff5f96427dcb3a62..f8b26c2348ede2b3bfcd88a2303bb8a80078f9d2 100644 --- a/csharp/src/Google.Protobuf/MessageParser.cs +++ b/csharp/src/Google.Protobuf/MessageParser.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -20,8 +43,9 @@ namespace Google.Protobuf /// public class MessageParser { - private readonly Func factory; - private protected bool DiscardUnknownFields { get; } + private Func factory; + // TODO: When we use a C# 7.1 compiler, make this private protected. + internal bool DiscardUnknownFields { get; } internal ExtensionRegistry Extensions { get; } @@ -104,19 +128,6 @@ namespace Google.Protobuf return message; } - /// - /// Parses a message from the given span. - /// - /// The data to parse. - /// The parsed message. - [SecuritySafeCritical] - public IMessage ParseFrom(ReadOnlySpan data) - { - IMessage message = factory(); - message.MergeFrom(data, DiscardUnknownFields, Extensions); - return message; - } - /// /// Parses a length-delimited message from the given stream. /// @@ -148,10 +159,6 @@ namespace Google.Protobuf /// /// Parses a message from the given JSON. /// - /// This method always uses the default JSON parser; it is not affected by . - /// To ignore unknown fields when parsing JSON, create a using a - /// with set to true and call directly. - /// /// The JSON to parse. /// The parsed message. /// The JSON does not comply with RFC 7159 @@ -167,26 +174,20 @@ namespace Google.Protobuf internal void MergeFrom(IMessage message, CodedInputStream codedInput) { bool originalDiscard = codedInput.DiscardUnknownFields; - ExtensionRegistry originalRegistry = codedInput.ExtensionRegistry; try { codedInput.DiscardUnknownFields = DiscardUnknownFields; - codedInput.ExtensionRegistry = Extensions; message.MergeFrom(codedInput); } finally { codedInput.DiscardUnknownFields = originalDiscard; - codedInput.ExtensionRegistry = originalRegistry; } } /// /// Creates a new message parser which optionally discards unknown fields when parsing. /// - /// Note that this does not affect the behavior of - /// at all. To ignore unknown fields when parsing JSON, create a using a - /// with set to true and call directly. /// Whether or not to discard unknown fields when parsing. /// A newly configured message parser. public MessageParser WithDiscardUnknownFields(bool discardUnknownFields) => @@ -314,19 +315,6 @@ namespace Google.Protobuf return message; } - /// - /// Parses a message from the given span. - /// - /// The data to parse. - /// The parsed message. - [SecuritySafeCritical] - public new T ParseFrom(ReadOnlySpan data) - { - T message = factory(); - message.MergeFrom(data, DiscardUnknownFields, Extensions); - return message; - } - /// /// Parses a length-delimited message from the given stream. /// diff --git a/csharp/src/Google.Protobuf/ObjectIntPair.cs b/csharp/src/Google.Protobuf/ObjectIntPair.cs index b2c6a67bd0c52548fbcd68bf67409175c73c6471..b98d93a517c49b94696270e86b911a0a853d0f7d 100644 --- a/csharp/src/Google.Protobuf/ObjectIntPair.cs +++ b/csharp/src/Google.Protobuf/ObjectIntPair.cs @@ -1,42 +1,40 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; - -namespace Google.Protobuf -{ +using System; + +namespace Google.Protobuf +{ /// /// Struct used to hold the keys for the fieldByNumber table in DescriptorPool and the keys for the /// extensionByNumber table in ExtensionRegistry. - /// - internal struct ObjectIntPair : IEquatable> where T : class - { - private readonly int number; - private readonly T obj; - - internal ObjectIntPair(T obj, int number) - { - this.number = number; - this.obj = obj; - } - - public bool Equals(ObjectIntPair other) - { - return obj == other.obj - && number == other.number; - } - - public override bool Equals(object obj) => obj is ObjectIntPair pair && Equals(pair); - - public override int GetHashCode() - { - return obj.GetHashCode() * ((1 << 16) - 1) + number; - } - } -} + /// + internal struct ObjectIntPair : IEquatable> where T : class + { + private readonly int number; + private readonly T obj; + + internal ObjectIntPair(T obj, int number) + { + this.number = number; + this.obj = obj; + } + + public bool Equals(ObjectIntPair other) + { + return obj == other.obj + && number == other.number; + } + + public override bool Equals(object obj) + { + if (obj is ObjectIntPair) + { + return Equals((ObjectIntPair)obj); + } + return false; + } + + public override int GetHashCode() + { + return obj.GetHashCode() * ((1 << 16) - 1) + number; + } + } +} diff --git a/csharp/src/Google.Protobuf/ParseContext.cs b/csharp/src/Google.Protobuf/ParseContext.cs index 79a4758c18f43f5a39e00c979aad54808500fcae..bf462365652567b6cc9c79e5d005fe2be1b6b12f 100644 --- a/csharp/src/Google.Protobuf/ParseContext.cs +++ b/csharp/src/Google.Protobuf/ParseContext.cs @@ -1,16 +1,45 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using System.Security; +using System.Text; +using Google.Protobuf.Collections; namespace Google.Protobuf { @@ -24,35 +53,14 @@ namespace Google.Protobuf public ref struct ParseContext { internal const int DefaultRecursionLimit = 100; - internal const int DefaultSizeLimit = int.MaxValue; + internal const int DefaultSizeLimit = Int32.MaxValue; internal ReadOnlySpan buffer; internal ParserInternalState state; - /// - /// Initialize a , building all from defaults and - /// the given . - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void Initialize(ReadOnlySpan buffer, out ParseContext ctx) - { - ParserInternalState state = default; - state.sizeLimit = DefaultSizeLimit; - state.recursionLimit = DefaultRecursionLimit; - state.currentLimit = int.MaxValue; - state.bufferSize = buffer.Length; - // Equivalent to Initialize(buffer, ref state, out ctx); - ctx.buffer = buffer; - ctx.state = state; - } - - /// - /// Initialize a using existing , e.g. from . - /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void Initialize(ReadOnlySpan buffer, ref ParserInternalState state, out ParseContext ctx) + internal static void Initialize(ref ReadOnlySpan buffer, ref ParserInternalState state, out ParseContext ctx) { - // Note: if this code ever changes, also change the initialization above. ctx.buffer = buffer; ctx.state = state; } @@ -100,15 +108,14 @@ namespace Google.Protobuf /// Returns the last tag read, or 0 if no tags have been read or we've read beyond /// the end of the input. /// - internal uint LastTag => state.lastTag; + internal uint LastTag { get { return state.lastTag; } } /// /// Internal-only property; when set to true, unknown fields will be discarded while parsing. /// - internal bool DiscardUnknownFields - { - get => state.DiscardUnknownFields; - set => state.DiscardUnknownFields = value; + internal bool DiscardUnknownFields { + get { return state.DiscardUnknownFields; } + set { state.DiscardUnknownFields = value; } } /// @@ -116,8 +123,8 @@ namespace Google.Protobuf /// internal ExtensionRegistry ExtensionRegistry { - get => state.ExtensionRegistry; - set => state.ExtensionRegistry = value; + get { return state.ExtensionRegistry; } + set { state.ExtensionRegistry = value; } } /// @@ -130,85 +137,125 @@ namespace Google.Protobuf /// /// The next field tag, or 0 for end of input. (0 is never a valid tag.) [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint ReadTag() => ParsingPrimitives.ParseTag(ref buffer, ref state); + public uint ReadTag() + { + return ParsingPrimitives.ParseTag(ref buffer, ref state); + } /// /// Reads a double field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public double ReadDouble() => ParsingPrimitives.ParseDouble(ref buffer, ref state); + public double ReadDouble() + { + return ParsingPrimitives.ParseDouble(ref buffer, ref state); + } /// /// Reads a float field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public float ReadFloat() => ParsingPrimitives.ParseFloat(ref buffer, ref state); + public float ReadFloat() + { + return ParsingPrimitives.ParseFloat(ref buffer, ref state); + } /// /// Reads a uint64 field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ulong ReadUInt64() => ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + public ulong ReadUInt64() + { + return ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + } /// /// Reads an int64 field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public long ReadInt64() => (long)ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + public long ReadInt64() + { + return (long)ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + } /// /// Reads an int32 field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int ReadInt32() => (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + public int ReadInt32() + { + return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } /// /// Reads a fixed64 field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ulong ReadFixed64() => ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state); + public ulong ReadFixed64() + { + return ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state); + } /// /// Reads a fixed32 field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint ReadFixed32() => ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state); + public uint ReadFixed32() + { + return ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state); + } /// /// Reads a bool field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool ReadBool() => ParsingPrimitives.ParseRawVarint64(ref buffer, ref state) != 0; - + public bool ReadBool() + { + return ParsingPrimitives.ParseRawVarint64(ref buffer, ref state) != 0; + } /// /// Reads a string field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public string ReadString() => ParsingPrimitives.ReadString(ref buffer, ref state); + public string ReadString() + { + return ParsingPrimitives.ReadString(ref buffer, ref state); + } /// /// Reads an embedded message field value from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadMessage(IMessage message) => ParsingPrimitivesMessages.ReadMessage(ref this, message); + public void ReadMessage(IMessage message) + { + ParsingPrimitivesMessages.ReadMessage(ref this, message); + } /// /// Reads an embedded group field from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadGroup(IMessage message) => ParsingPrimitivesMessages.ReadGroup(ref this, message); + public void ReadGroup(IMessage message) + { + ParsingPrimitivesMessages.ReadGroup(ref this, message); + } /// /// Reads a bytes field value from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ByteString ReadBytes() => ParsingPrimitives.ReadBytes(ref buffer, ref state); - + public ByteString ReadBytes() + { + return ParsingPrimitives.ReadBytes(ref buffer, ref state); + } /// /// Reads a uint32 field value from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint ReadUInt32() => ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + public uint ReadUInt32() + { + return ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } /// /// Reads an enum field value from the input. @@ -224,25 +271,37 @@ namespace Google.Protobuf /// Reads an sfixed32 field value from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int ReadSFixed32() => (int)ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state); + public int ReadSFixed32() + { + return (int)ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state); + } /// /// Reads an sfixed64 field value from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public long ReadSFixed64() => (long)ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state); + public long ReadSFixed64() + { + return (long)ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state); + } /// /// Reads an sint32 field value from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int ReadSInt32() => ParsingPrimitives.DecodeZigZag32(ParsingPrimitives.ParseRawVarint32(ref buffer, ref state)); + public int ReadSInt32() + { + return ParsingPrimitives.DecodeZigZag32(ParsingPrimitives.ParseRawVarint32(ref buffer, ref state)); + } /// /// Reads an sint64 field value from the input. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public long ReadSInt64() => ParsingPrimitives.DecodeZigZag64(ParsingPrimitives.ParseRawVarint64(ref buffer, ref state)); + public long ReadSInt64() + { + return ParsingPrimitives.DecodeZigZag64(ParsingPrimitives.ParseRawVarint64(ref buffer, ref state)); + } /// /// Reads a length for length-delimited data. @@ -252,7 +311,10 @@ namespace Google.Protobuf /// to make the calling code clearer. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int ReadLength() => (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + public int ReadLength() + { + return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } internal void CopyStateTo(CodedInputStream input) { diff --git a/csharp/src/Google.Protobuf/ParserInternalState.cs b/csharp/src/Google.Protobuf/ParserInternalState.cs index 0c20446e032786e0a0869aad495946c83c0063d6..cb4f47143cd80eb438ddbdbbba87bbd060d9d2d5 100644 --- a/csharp/src/Google.Protobuf/ParserInternalState.cs +++ b/csharp/src/Google.Protobuf/ParserInternalState.cs @@ -1,14 +1,49 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using Google.Protobuf.Collections; + namespace Google.Protobuf { + // warning: this is a mutable struct, so it needs to be only passed as a ref! internal struct ParserInternalState { diff --git a/csharp/src/Google.Protobuf/ParsingPrimitives.cs b/csharp/src/Google.Protobuf/ParsingPrimitives.cs index 0c3420492f82fd0ecc01cbb829e18bb5c1b0a2c4..e270ed8aa1f4d737429d5ea79d8f8da85d9a075c 100644 --- a/csharp/src/Google.Protobuf/ParsingPrimitives.cs +++ b/csharp/src/Google.Protobuf/ParsingPrimitives.cs @@ -1,20 +1,46 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Buffers; using System.Buffers.Binary; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; +using System.Text; +using Google.Protobuf.Collections; namespace Google.Protobuf { @@ -47,7 +73,7 @@ namespace Google.Protobuf { // The "nextTag" logic is there only as an optimization for reading non-packed repeated / map // fields and is strictly speaking not necessary. - // TODO: look into simplifying the ParseTag logic. + // TODO(jtattermusch): look into simplifying the ParseTag logic. if (state.hasNextTag) { state.lastTag = state.nextTag; diff --git a/csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs b/csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs index d06ea7308849fac92030836f767b65a0b92999f9..b7097a2ad04f9357498b3b899cc93c7799071494 100644 --- a/csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs +++ b/csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs @@ -1,17 +1,40 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Buffers; -using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; using System.Security; -using Google.Protobuf.Collections; namespace Google.Protobuf { @@ -21,8 +44,6 @@ namespace Google.Protobuf [SecuritySafeCritical] internal static class ParsingPrimitivesMessages { - private static readonly byte[] ZeroLengthMessageStreamData = new byte[] { 0 }; - public static void SkipLastField(ref ReadOnlySpan buffer, ref ParserInternalState state) { if (state.lastTag == 0) @@ -113,65 +134,6 @@ namespace Google.Protobuf SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); } - public static KeyValuePair ReadMapEntry(ref ParseContext ctx, MapField.Codec codec) - { - int length = ParsingPrimitives.ParseLength(ref ctx.buffer, ref ctx.state); - if (ctx.state.recursionDepth >= ctx.state.recursionLimit) - { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); - } - int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); - ++ctx.state.recursionDepth; - - TKey key = codec.KeyCodec.DefaultValue; - TValue value = codec.ValueCodec.DefaultValue; - - uint tag; - while ((tag = ctx.ReadTag()) != 0) - { - if (tag == codec.KeyCodec.Tag) - { - key = codec.KeyCodec.Read(ref ctx); - } - else if (tag == codec.ValueCodec.Tag) - { - value = codec.ValueCodec.Read(ref ctx); - } - else - { - SkipLastField(ref ctx.buffer, ref ctx.state); - } - } - - // Corner case: a map entry with a key but no value, where the value type is a message. - // Read it as if we'd seen input with no data (i.e. create a "default" message). - if (value == null) - { - if (ctx.state.CodedInputStream != null) - { - // the decoded message might not support parsing from ParseContext, so - // we need to allow fallback to the legacy MergeFrom(CodedInputStream) parsing. - value = codec.ValueCodec.Read(new CodedInputStream(ZeroLengthMessageStreamData)); - } - else - { - ParseContext.Initialize(new ReadOnlySequence(ZeroLengthMessageStreamData), out ParseContext zeroLengthCtx); - value = codec.ValueCodec.Read(ref zeroLengthCtx); - } - } - - CheckReadEndOfStreamTag(ref ctx.state); - // Check that we've read exactly as much data as expected. - if (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - --ctx.state.recursionDepth; - SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); - - return new KeyValuePair(key, value); - } - public static void ReadGroup(ref ParseContext ctx, IMessage message) { if (ctx.state.recursionDepth >= ctx.state.recursionLimit) diff --git a/csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs b/csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs index 78305acf4d594d3b1d9ed5960af12d2e1b511c36..629ec32bd81e91ca086e689161bbdd62ab909efe 100644 --- a/csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs +++ b/csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs @@ -1,14 +1,45 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using System.Security; +using System.Text; +using Google.Protobuf.Collections; namespace Google.Protobuf { diff --git a/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs b/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs index 33aa59ee3823476e92f1b3a39d51da47e14f9743..130bcf00041d1272a2e7c3b7cee397615adaec0b 100644 --- a/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs +++ b/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs @@ -1,30 +1,56 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System.Runtime.CompilerServices; -using System.Security; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -#if !NCRUNCH -[assembly: AllowPartiallyTrustedCallers] -#endif - -#if SIGNING_DISABLED -[assembly: InternalsVisibleTo("Google.Protobuf.Test")] -#else -[assembly: InternalsVisibleTo("Google.Protobuf.Test, PublicKey=" + - "002400000480000094000000060200000024000052534131000400000100010025800fbcfc63a1" + - "7c66b303aae80b03a6beaa176bb6bef883be436f2a1579edd80ce23edf151a1f4ced97af83abcd" + - "981207041fd5b2da3b498346fcfcd94910d52f25537c4a43ce3fbe17dc7d43e6cbdb4d8f1242dc" + - "b6bd9b5906be74da8daa7d7280f97130f318a16c07baf118839b156299a48522f9fae2371c9665" + - "c5ae9cb6")] -#endif \ No newline at end of file +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System.Runtime.CompilerServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +#if !NCRUNCH +[assembly: AllowPartiallyTrustedCallers] +#endif + +[assembly: InternalsVisibleTo("Google.Protobuf.Test, PublicKey=" + + "002400000480000094000000060200000024000052534131000400000100010025800fbcfc63a1" + + "7c66b303aae80b03a6beaa176bb6bef883be436f2a1579edd80ce23edf151a1f4ced97af83abcd" + + "981207041fd5b2da3b498346fcfcd94910d52f25537c4a43ce3fbe17dc7d43e6cbdb4d8f1242dc" + + "b6bd9b5906be74da8daa7d7280f97130f318a16c07baf118839b156299a48522f9fae2371c9665" + + "c5ae9cb6")] + +[assembly: InternalsVisibleTo("Google.Protobuf.Benchmarks, PublicKey=" + + "002400000480000094000000060200000024000052534131000400000100010025800fbcfc63a1" + + "7c66b303aae80b03a6beaa176bb6bef883be436f2a1579edd80ce23edf151a1f4ced97af83abcd" + + "981207041fd5b2da3b498346fcfcd94910d52f25537c4a43ce3fbe17dc7d43e6cbdb4d8f1242dc" + + "b6bd9b5906be74da8daa7d7280f97130f318a16c07baf118839b156299a48522f9fae2371c9665" + + "c5ae9cb6")] diff --git a/csharp/src/Google.Protobuf/ProtoPreconditions.cs b/csharp/src/Google.Protobuf/ProtoPreconditions.cs index 5991f826202419fae317b1d214c097c6481874ac..590a3bb20fc9e37ebff734b557cdc0c58c5c3e48 100644 --- a/csharp/src/Google.Protobuf/ProtoPreconditions.cs +++ b/csharp/src/Google.Protobuf/ProtoPreconditions.cs @@ -1,56 +1,79 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; - -namespace Google.Protobuf -{ - /// - /// Helper methods for throwing exceptions when preconditions are not met. - /// - /// - /// This class is used internally and by generated code; it is not particularly - /// expected to be used from application code, although nothing prevents it - /// from being used that way. - /// - public static class ProtoPreconditions - { - /// - /// Throws an ArgumentNullException if the given value is null, otherwise - /// return the value to the caller. - /// - public static T CheckNotNull(T value, string name) where T : class - { - if (value == null) - { - throw new ArgumentNullException(name); - } - return value; - } - - /// - /// Throws an ArgumentNullException if the given value is null, otherwise - /// return the value to the caller. - /// - /// - /// This is equivalent to but without the type parameter - /// constraint. In most cases, the constraint is useful to prevent you from calling CheckNotNull - /// with a value type - but it gets in the way if either you want to use it with a nullable - /// value type, or you want to use it with an unconstrained type parameter. - /// - internal static T CheckNotNullUnconstrained(T value, string name) - { - if (value == null) - { - throw new ArgumentNullException(name); - } - return value; - } - } +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; + +namespace Google.Protobuf +{ + /// + /// Helper methods for throwing exceptions when preconditions are not met. + /// + /// + /// This class is used internally and by generated code; it is not particularly + /// expected to be used from application code, although nothing prevents it + /// from being used that way. + /// + public static class ProtoPreconditions + { + /// + /// Throws an ArgumentNullException if the given value is null, otherwise + /// return the value to the caller. + /// + public static T CheckNotNull(T value, string name) where T : class + { + if (value == null) + { + throw new ArgumentNullException(name); + } + return value; + } + + /// + /// Throws an ArgumentNullException if the given value is null, otherwise + /// return the value to the caller. + /// + /// + /// This is equivalent to but without the type parameter + /// constraint. In most cases, the constraint is useful to prevent you from calling CheckNotNull + /// with a value type - but it gets in the way if either you want to use it with a nullable + /// value type, or you want to use it with an unconstrained type parameter. + /// + internal static T CheckNotNullUnconstrained(T value, string name) + { + if (value == null) + { + throw new ArgumentNullException(name); + } + return value; + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/CustomOptions.cs b/csharp/src/Google.Protobuf/Reflection/CustomOptions.cs index 43b5a4c5abe91000d70cf6eb3a890cba00093221..9fc3766889b806efff8dc23618ace9f4a257f0aa 100644 --- a/csharp/src/Google.Protobuf/Reflection/CustomOptions.cs +++ b/csharp/src/Google.Protobuf/Reflection/CustomOptions.cs @@ -1,18 +1,39 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; @@ -40,12 +61,8 @@ namespace Google.Protobuf.Reflection /// all the set values are merged together. /// /// - [DebuggerDisplay("Count = {DebugCount}")] - [DebuggerTypeProxy(typeof(CustomOptionsDebugView))] public sealed class CustomOptions { - private const string UnreferencedCodeMessage = "CustomOptions is incompatible with trimming."; - private static readonly object[] EmptyParameters = new object[0]; private readonly IDictionary values; @@ -60,7 +77,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetBool(int field, out bool value) => TryGetPrimitiveValue(field, out value); /// @@ -69,7 +85,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetInt32(int field, out int value) => TryGetPrimitiveValue(field, out value); /// @@ -78,7 +93,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetInt64(int field, out long value) => TryGetPrimitiveValue(field, out value); /// @@ -88,7 +102,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetFixed32(int field, out uint value) => TryGetUInt32(field, out value); /// @@ -98,7 +111,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetFixed64(int field, out ulong value) => TryGetUInt64(field, out value); /// @@ -108,7 +120,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetSFixed32(int field, out int value) => TryGetInt32(field, out value); /// @@ -118,7 +129,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetSFixed64(int field, out long value) => TryGetInt64(field, out value); /// @@ -128,7 +138,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetSInt32(int field, out int value) => TryGetPrimitiveValue(field, out value); /// @@ -138,7 +147,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetSInt64(int field, out long value) => TryGetPrimitiveValue(field, out value); /// @@ -147,7 +155,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetUInt32(int field, out uint value) => TryGetPrimitiveValue(field, out value); /// @@ -156,7 +163,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetUInt64(int field, out ulong value) => TryGetPrimitiveValue(field, out value); /// @@ -165,7 +171,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetFloat(int field, out float value) => TryGetPrimitiveValue(field, out value); /// @@ -174,7 +179,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetDouble(int field, out double value) => TryGetPrimitiveValue(field, out value); /// @@ -183,7 +187,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetString(int field, out string value) => TryGetPrimitiveValue(field, out value); /// @@ -192,7 +195,6 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetBytes(int field, out ByteString value) => TryGetPrimitiveValue(field, out value); /// @@ -201,26 +203,28 @@ namespace Google.Protobuf.Reflection /// The field to fetch the value for. /// The output variable to populate. /// true if a suitable value for the field was found; false otherwise. - [RequiresUnreferencedCode(UnreferencedCodeMessage)] public bool TryGetMessage(int field, out T value) where T : class, IMessage, new() { if (values == null) { - value = default; + value = default(T); return false; } - if (values.TryGetValue(field, out IExtensionValue extensionValue)) + IExtensionValue extensionValue; + if (values.TryGetValue(field, out extensionValue)) { - if (extensionValue is ExtensionValue single) + if (extensionValue is ExtensionValue) { + ExtensionValue single = extensionValue as ExtensionValue; ByteString bytes = single.GetValue().ToByteString(); value = new T(); value.MergeFrom(bytes); return true; } - else if (extensionValue is RepeatedExtensionValue repeated) + else if (extensionValue is RepeatedExtensionValue) { + RepeatedExtensionValue repeated = extensionValue as RepeatedExtensionValue; value = repeated.GetValue() .Select(v => v.ToByteString()) .Aggregate(new T(), (t, b) => @@ -236,24 +240,26 @@ namespace Google.Protobuf.Reflection return false; } - [RequiresUnreferencedCode(UnreferencedCodeMessage)] private bool TryGetPrimitiveValue(int field, out T value) { if (values == null) { - value = default; + value = default(T); return false; } - if (values.TryGetValue(field, out IExtensionValue extensionValue)) + IExtensionValue extensionValue; + if (values.TryGetValue(field, out extensionValue)) { - if (extensionValue is ExtensionValue single) + if (extensionValue is ExtensionValue) { + ExtensionValue single = extensionValue as ExtensionValue; value = single.GetValue(); return true; } - else if (extensionValue is RepeatedExtensionValue repeated) + else if (extensionValue is RepeatedExtensionValue) { + RepeatedExtensionValue repeated = extensionValue as RepeatedExtensionValue; if (repeated.GetValue().Count != 0) { RepeatedField repeatedField = repeated.GetValue(); @@ -291,23 +297,8 @@ namespace Google.Protobuf.Reflection } } - value = default; + value = default(T); return false; } - - private int DebugCount => values?.Count ?? 0; - - private sealed class CustomOptionsDebugView - { - private readonly CustomOptions customOptions; - - public CustomOptionsDebugView(CustomOptions customOptions) - { - this.customOptions = customOptions; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public KeyValuePair[] Items => customOptions.values?.ToArray() ?? new KeyValuePair[0]; - } } } diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs index df9222862a8d50f44aa60363394e8d37daf8fb33..0a1f4a74408a3ae400e7f28a1e48722d9dd5d56e 100644 --- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs @@ -155,10 +155,9 @@ namespace Google.Protobuf.Reflection { "dGF0aW9uGAEgAygLMi0uZ29vZ2xlLnByb3RvYnVmLkdlbmVyYXRlZENvZGVJ", "bmZvLkFubm90YXRpb24aTwoKQW5ub3RhdGlvbhIQCgRwYXRoGAEgAygFQgIQ", "ARITCgtzb3VyY2VfZmlsZRgCIAEoCRINCgViZWdpbhgDIAEoBRILCgNlbmQY", - "BCABKAVCjwEKE2NvbS5nb29nbGUucHJvdG9idWZCEERlc2NyaXB0b3JQcm90", - "b3NIAVo+Z2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHJvdG9jLWdlbi1n", - "by9kZXNjcmlwdG9yO2Rlc2NyaXB0b3L4AQGiAgNHUEKqAhpHb29nbGUuUHJv", - "dG9idWYuUmVmbGVjdGlvbg==")); + "BCABKAVCfgoTY29tLmdvb2dsZS5wcm90b2J1ZkIQRGVzY3JpcHRvclByb3Rv", + "c0gBWi1nb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9kZXNjcmlw", + "dG9ycGL4AQGiAgNHUEKqAhpHb29nbGUuUHJvdG9idWYuUmVmbGVjdGlvbg==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.pb.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.pb.cs deleted file mode 100644 index 2421d98c050a7a552be1836918c6e57f2412913e..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/Reflection/Descriptor.pb.cs +++ /dev/null @@ -1,14133 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/descriptor.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.Reflection { - - /// Holder for reflection information generated from google/protobuf/descriptor.proto - public static partial class DescriptorReflection { - - #region Descriptor - /// File descriptor for google/protobuf/descriptor.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static DescriptorReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIkcKEUZpbGVEZXNjcmlwdG9yU2V0EjIKBGZpbGUYASADKAsyJC5n", - "b29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90byKGBAoTRmlsZURl", - "c2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg8KB3BhY2thZ2UYAiABKAkS", - "EgoKZGVwZW5kZW5jeRgDIAMoCRIZChFwdWJsaWNfZGVwZW5kZW5jeRgKIAMo", - "BRIXCg93ZWFrX2RlcGVuZGVuY3kYCyADKAUSNgoMbWVzc2FnZV90eXBlGAQg", - "AygLMiAuZ29vZ2xlLnByb3RvYnVmLkRlc2NyaXB0b3JQcm90bxI3CgllbnVt", - "X3R5cGUYBSADKAsyJC5nb29nbGUucHJvdG9idWYuRW51bURlc2NyaXB0b3JQ", - "cm90bxI4CgdzZXJ2aWNlGAYgAygLMicuZ29vZ2xlLnByb3RvYnVmLlNlcnZp", - "Y2VEZXNjcmlwdG9yUHJvdG8SOAoJZXh0ZW5zaW9uGAcgAygLMiUuZ29vZ2xl", - "LnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvEi0KB29wdGlvbnMYCCAB", - "KAsyHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMSOQoQc291cmNlX2Nv", - "ZGVfaW5mbxgJIAEoCzIfLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb2RlSW5m", - "bxIOCgZzeW50YXgYDCABKAkSKQoHZWRpdGlvbhgOIAEoDjIYLmdvb2dsZS5w", - "cm90b2J1Zi5FZGl0aW9uIqkFCg9EZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgB", - "IAEoCRI0CgVmaWVsZBgCIAMoCzIlLmdvb2dsZS5wcm90b2J1Zi5GaWVsZERl", - "c2NyaXB0b3JQcm90bxI4CglleHRlbnNpb24YBiADKAsyJS5nb29nbGUucHJv", - "dG9idWYuRmllbGREZXNjcmlwdG9yUHJvdG8SNQoLbmVzdGVkX3R5cGUYAyAD", - "KAsyIC5nb29nbGUucHJvdG9idWYuRGVzY3JpcHRvclByb3RvEjcKCWVudW1f", - "dHlwZRgEIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5FbnVtRGVzY3JpcHRvclBy", - "b3RvEkgKD2V4dGVuc2lvbl9yYW5nZRgFIAMoCzIvLmdvb2dsZS5wcm90b2J1", - "Zi5EZXNjcmlwdG9yUHJvdG8uRXh0ZW5zaW9uUmFuZ2USOQoKb25lb2ZfZGVj", - "bBgIIAMoCzIlLmdvb2dsZS5wcm90b2J1Zi5PbmVvZkRlc2NyaXB0b3JQcm90", - "bxIwCgdvcHRpb25zGAcgASgLMh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VP", - "cHRpb25zEkYKDnJlc2VydmVkX3JhbmdlGAkgAygLMi4uZ29vZ2xlLnByb3Rv", - "YnVmLkRlc2NyaXB0b3JQcm90by5SZXNlcnZlZFJhbmdlEhUKDXJlc2VydmVk", - "X25hbWUYCiADKAkaZQoORXh0ZW5zaW9uUmFuZ2USDQoFc3RhcnQYASABKAUS", - "CwoDZW5kGAIgASgFEjcKB29wdGlvbnMYAyABKAsyJi5nb29nbGUucHJvdG9i", - "dWYuRXh0ZW5zaW9uUmFuZ2VPcHRpb25zGisKDVJlc2VydmVkUmFuZ2USDQoF", - "c3RhcnQYASABKAUSCwoDZW5kGAIgASgFIuADChVFeHRlbnNpb25SYW5nZU9w", - "dGlvbnMSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xl", - "LnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24STAoLZGVjbGFyYXRpb24Y", - "AiADKAsyMi5nb29nbGUucHJvdG9idWYuRXh0ZW5zaW9uUmFuZ2VPcHRpb25z", - "LkRlY2xhcmF0aW9uQgOIAQISLQoIZmVhdHVyZXMYMiABKAsyGy5nb29nbGUu", - "cHJvdG9idWYuRmVhdHVyZVNldBJaCgx2ZXJpZmljYXRpb24YAyABKA4yOC5n", - "b29nbGUucHJvdG9idWYuRXh0ZW5zaW9uUmFuZ2VPcHRpb25zLlZlcmlmaWNh", - "dGlvblN0YXRlOgpVTlZFUklGSUVEGmgKC0RlY2xhcmF0aW9uEg4KBm51bWJl", - "chgBIAEoBRIRCglmdWxsX25hbWUYAiABKAkSDAoEdHlwZRgDIAEoCRIQCghy", - "ZXNlcnZlZBgFIAEoCBIQCghyZXBlYXRlZBgGIAEoCEoECAQQBSI0ChFWZXJp", - "ZmljYXRpb25TdGF0ZRIPCgtERUNMQVJBVElPThAAEg4KClVOVkVSSUZJRUQQ", - "ASoJCOgHEICAgIACItUFChRGaWVsZERlc2NyaXB0b3JQcm90bxIMCgRuYW1l", - "GAEgASgJEg4KBm51bWJlchgDIAEoBRI6CgVsYWJlbBgEIAEoDjIrLmdvb2ds", - "ZS5wcm90b2J1Zi5GaWVsZERlc2NyaXB0b3JQcm90by5MYWJlbBI4CgR0eXBl", - "GAUgASgOMiouZ29vZ2xlLnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3Rv", - "LlR5cGUSEQoJdHlwZV9uYW1lGAYgASgJEhAKCGV4dGVuZGVlGAIgASgJEhUK", - "DWRlZmF1bHRfdmFsdWUYByABKAkSEwoLb25lb2ZfaW5kZXgYCSABKAUSEQoJ", - "anNvbl9uYW1lGAogASgJEi4KB29wdGlvbnMYCCABKAsyHS5nb29nbGUucHJv", - "dG9idWYuRmllbGRPcHRpb25zEhcKD3Byb3RvM19vcHRpb25hbBgRIAEoCCK2", - "AgoEVHlwZRIPCgtUWVBFX0RPVUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpU", - "WVBFX0lOVDY0EAMSDwoLVFlQRV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUS", - "EAoMVFlQRV9GSVhFRDY0EAYSEAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9C", - "T09MEAgSDwoLVFlQRV9TVFJJTkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQ", - "RV9NRVNTQUdFEAsSDgoKVFlQRV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0S", - "DQoJVFlQRV9FTlVNEA4SEQoNVFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJ", - "WEVENjQQEBIPCgtUWVBFX1NJTlQzMhAREg8KC1RZUEVfU0lOVDY0EBIiQwoF", - "TGFiZWwSEgoOTEFCRUxfT1BUSU9OQUwQARISCg5MQUJFTF9SRVBFQVRFRBAD", - "EhIKDkxBQkVMX1JFUVVJUkVEEAIiVAoUT25lb2ZEZXNjcmlwdG9yUHJvdG8S", - "DAoEbmFtZRgBIAEoCRIuCgdvcHRpb25zGAIgASgLMh0uZ29vZ2xlLnByb3Rv", - "YnVmLk9uZW9mT3B0aW9ucyKkAgoTRW51bURlc2NyaXB0b3JQcm90bxIMCgRu", - "YW1lGAEgASgJEjgKBXZhbHVlGAIgAygLMikuZ29vZ2xlLnByb3RvYnVmLkVu", - "dW1WYWx1ZURlc2NyaXB0b3JQcm90bxItCgdvcHRpb25zGAMgASgLMhwuZ29v", - "Z2xlLnByb3RvYnVmLkVudW1PcHRpb25zEk4KDnJlc2VydmVkX3JhbmdlGAQg", - "AygLMjYuZ29vZ2xlLnByb3RvYnVmLkVudW1EZXNjcmlwdG9yUHJvdG8uRW51", - "bVJlc2VydmVkUmFuZ2USFQoNcmVzZXJ2ZWRfbmFtZRgFIAMoCRovChFFbnVt", - "UmVzZXJ2ZWRSYW5nZRINCgVzdGFydBgBIAEoBRILCgNlbmQYAiABKAUibAoY", - "RW51bVZhbHVlRGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkSDgoGbnVt", - "YmVyGAIgASgFEjIKB29wdGlvbnMYAyABKAsyIS5nb29nbGUucHJvdG9idWYu", - "RW51bVZhbHVlT3B0aW9ucyKQAQoWU2VydmljZURlc2NyaXB0b3JQcm90bxIM", - "CgRuYW1lGAEgASgJEjYKBm1ldGhvZBgCIAMoCzImLmdvb2dsZS5wcm90b2J1", - "Zi5NZXRob2REZXNjcmlwdG9yUHJvdG8SMAoHb3B0aW9ucxgDIAEoCzIfLmdv", - "b2dsZS5wcm90b2J1Zi5TZXJ2aWNlT3B0aW9ucyLBAQoVTWV0aG9kRGVzY3Jp", - "cHRvclByb3RvEgwKBG5hbWUYASABKAkSEgoKaW5wdXRfdHlwZRgCIAEoCRIT", - "CgtvdXRwdXRfdHlwZRgDIAEoCRIvCgdvcHRpb25zGAQgASgLMh4uZ29vZ2xl", - "LnByb3RvYnVmLk1ldGhvZE9wdGlvbnMSHwoQY2xpZW50X3N0cmVhbWluZxgF", - "IAEoCDoFZmFsc2USHwoQc2VydmVyX3N0cmVhbWluZxgGIAEoCDoFZmFsc2Ui", - "1AYKC0ZpbGVPcHRpb25zEhQKDGphdmFfcGFja2FnZRgBIAEoCRIcChRqYXZh", - "X291dGVyX2NsYXNzbmFtZRgIIAEoCRIiChNqYXZhX211bHRpcGxlX2ZpbGVz", - "GAogASgIOgVmYWxzZRIpCh1qYXZhX2dlbmVyYXRlX2VxdWFsc19hbmRfaGFz", - "aBgUIAEoCEICGAESJQoWamF2YV9zdHJpbmdfY2hlY2tfdXRmOBgbIAEoCDoF", - "ZmFsc2USRgoMb3B0aW1pemVfZm9yGAkgASgOMikuZ29vZ2xlLnByb3RvYnVm", - "LkZpbGVPcHRpb25zLk9wdGltaXplTW9kZToFU1BFRUQSEgoKZ29fcGFja2Fn", - "ZRgLIAEoCRIiChNjY19nZW5lcmljX3NlcnZpY2VzGBAgASgIOgVmYWxzZRIk", - "ChVqYXZhX2dlbmVyaWNfc2VydmljZXMYESABKAg6BWZhbHNlEiIKE3B5X2dl", - "bmVyaWNfc2VydmljZXMYEiABKAg6BWZhbHNlEiMKFHBocF9nZW5lcmljX3Nl", - "cnZpY2VzGCogASgIOgVmYWxzZRIZCgpkZXByZWNhdGVkGBcgASgIOgVmYWxz", - "ZRIeChBjY19lbmFibGVfYXJlbmFzGB8gASgIOgR0cnVlEhkKEW9iamNfY2xh", - "c3NfcHJlZml4GCQgASgJEhgKEGNzaGFycF9uYW1lc3BhY2UYJSABKAkSFAoM", - "c3dpZnRfcHJlZml4GCcgASgJEhgKEHBocF9jbGFzc19wcmVmaXgYKCABKAkS", - "FQoNcGhwX25hbWVzcGFjZRgpIAEoCRIeChZwaHBfbWV0YWRhdGFfbmFtZXNw", - "YWNlGCwgASgJEhQKDHJ1YnlfcGFja2FnZRgtIAEoCRItCghmZWF0dXJlcxgy", - "IAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5GZWF0dXJlU2V0EkMKFHVuaW50ZXJw", - "cmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVy", - "cHJldGVkT3B0aW9uIjoKDE9wdGltaXplTW9kZRIJCgVTUEVFRBABEg0KCUNP", - "REVfU0laRRACEhAKDExJVEVfUlVOVElNRRADKgkI6AcQgICAgAJKBAgmECci", - "5wIKDk1lc3NhZ2VPcHRpb25zEiYKF21lc3NhZ2Vfc2V0X3dpcmVfZm9ybWF0", - "GAEgASgIOgVmYWxzZRIuCh9ub19zdGFuZGFyZF9kZXNjcmlwdG9yX2FjY2Vz", - "c29yGAIgASgIOgVmYWxzZRIZCgpkZXByZWNhdGVkGAMgASgIOgVmYWxzZRIR", - "CgltYXBfZW50cnkYByABKAgSMgomZGVwcmVjYXRlZF9sZWdhY3lfanNvbl9m", - "aWVsZF9jb25mbGljdHMYCyABKAhCAhgBEi0KCGZlYXR1cmVzGAwgASgLMhsu", - "Z29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQSQwoUdW5pbnRlcnByZXRlZF9v", - "cHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRP", - "cHRpb24qCQjoBxCAgICAAkoECAQQBUoECAUQBkoECAYQB0oECAgQCUoECAkQ", - "CiKNCQoMRmllbGRPcHRpb25zEjoKBWN0eXBlGAEgASgOMiMuZ29vZ2xlLnBy", - "b3RvYnVmLkZpZWxkT3B0aW9ucy5DVHlwZToGU1RSSU5HEg4KBnBhY2tlZBgC", - "IAEoCBI/CgZqc3R5cGUYBiABKA4yJC5nb29nbGUucHJvdG9idWYuRmllbGRP", - "cHRpb25zLkpTVHlwZToJSlNfTk9STUFMEhMKBGxhenkYBSABKAg6BWZhbHNl", - "Eh4KD3VudmVyaWZpZWRfbGF6eRgPIAEoCDoFZmFsc2USGQoKZGVwcmVjYXRl", - "ZBgDIAEoCDoFZmFsc2USEwoEd2VhaxgKIAEoCDoFZmFsc2USGwoMZGVidWdf", - "cmVkYWN0GBAgASgIOgVmYWxzZRJACglyZXRlbnRpb24YESABKA4yLS5nb29n", - "bGUucHJvdG9idWYuRmllbGRPcHRpb25zLk9wdGlvblJldGVudGlvbhI/Cgd0", - "YXJnZXRzGBMgAygOMi4uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucy5P", - "cHRpb25UYXJnZXRUeXBlEkYKEGVkaXRpb25fZGVmYXVsdHMYFCADKAsyLC5n", - "b29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zLkVkaXRpb25EZWZhdWx0Ei0K", - "CGZlYXR1cmVzGBUgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQS", - "QwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3Rv", - "YnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24aSgoORWRpdGlvbkRlZmF1bHQSKQoH", - "ZWRpdGlvbhgDIAEoDjIYLmdvb2dsZS5wcm90b2J1Zi5FZGl0aW9uEg0KBXZh", - "bHVlGAIgASgJIi8KBUNUeXBlEgoKBlNUUklORxAAEggKBENPUkQQARIQCgxT", - "VFJJTkdfUElFQ0UQAiI1CgZKU1R5cGUSDQoJSlNfTk9STUFMEAASDQoJSlNf", - "U1RSSU5HEAESDQoJSlNfTlVNQkVSEAIiVQoPT3B0aW9uUmV0ZW50aW9uEhUK", - "EVJFVEVOVElPTl9VTktOT1dOEAASFQoRUkVURU5USU9OX1JVTlRJTUUQARIU", - "ChBSRVRFTlRJT05fU09VUkNFEAIijAIKEE9wdGlvblRhcmdldFR5cGUSFwoT", - "VEFSR0VUX1RZUEVfVU5LTk9XThAAEhQKEFRBUkdFVF9UWVBFX0ZJTEUQARIf", - "ChtUQVJHRVRfVFlQRV9FWFRFTlNJT05fUkFOR0UQAhIXChNUQVJHRVRfVFlQ", - "RV9NRVNTQUdFEAMSFQoRVEFSR0VUX1RZUEVfRklFTEQQBBIVChFUQVJHRVRf", - "VFlQRV9PTkVPRhAFEhQKEFRBUkdFVF9UWVBFX0VOVU0QBhIaChZUQVJHRVRf", - "VFlQRV9FTlVNX0VOVFJZEAcSFwoTVEFSR0VUX1RZUEVfU0VSVklDRRAIEhYK", - "ElRBUkdFVF9UWVBFX01FVEhPRBAJKgkI6AcQgICAgAJKBAgEEAVKBAgSEBMi", - "jQEKDE9uZW9mT3B0aW9ucxItCghmZWF0dXJlcxgBIAEoCzIbLmdvb2dsZS5w", - "cm90b2J1Zi5GZWF0dXJlU2V0EkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcH", - "IAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI", - "6AcQgICAgAIi9gEKC0VudW1PcHRpb25zEhMKC2FsbG93X2FsaWFzGAIgASgI", - "EhkKCmRlcHJlY2F0ZWQYAyABKAg6BWZhbHNlEjIKJmRlcHJlY2F0ZWRfbGVn", - "YWN5X2pzb25fZmllbGRfY29uZmxpY3RzGAYgASgIQgIYARItCghmZWF0dXJl", - "cxgHIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5GZWF0dXJlU2V0EkMKFHVuaW50", - "ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5Vbmlu", - "dGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAJKBAgFEAYiyQEKEEVudW1WYWx1", - "ZU9wdGlvbnMSGQoKZGVwcmVjYXRlZBgBIAEoCDoFZmFsc2USLQoIZmVhdHVy", - "ZXMYAiABKAsyGy5nb29nbGUucHJvdG9idWYuRmVhdHVyZVNldBIbCgxkZWJ1", - "Z19yZWRhY3QYAyABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9u", - "GOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9u", - "KgkI6AcQgICAgAIiqgEKDlNlcnZpY2VPcHRpb25zEi0KCGZlYXR1cmVzGCIg", - "ASgLMhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQSGQoKZGVwcmVjYXRl", - "ZBghIAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygL", - "MiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCA", - "gICAAiLcAgoNTWV0aG9kT3B0aW9ucxIZCgpkZXByZWNhdGVkGCEgASgIOgVm", - "YWxzZRJfChFpZGVtcG90ZW5jeV9sZXZlbBgiIAEoDjIvLmdvb2dsZS5wcm90", - "b2J1Zi5NZXRob2RPcHRpb25zLklkZW1wb3RlbmN5TGV2ZWw6E0lERU1QT1RF", - "TkNZX1VOS05PV04SLQoIZmVhdHVyZXMYIyABKAsyGy5nb29nbGUucHJvdG9i", - "dWYuRmVhdHVyZVNldBJDChR1bmludGVycHJldGVkX29wdGlvbhjnByADKAsy", - "JC5nb29nbGUucHJvdG9idWYuVW5pbnRlcnByZXRlZE9wdGlvbiJQChBJZGVt", - "cG90ZW5jeUxldmVsEhcKE0lERU1QT1RFTkNZX1VOS05PV04QABITCg9OT19T", - "SURFX0VGRkVDVFMQARIOCgpJREVNUE9URU5UEAIqCQjoBxCAgICAAiKeAgoT", - "VW5pbnRlcnByZXRlZE9wdGlvbhI7CgRuYW1lGAIgAygLMi0uZ29vZ2xlLnBy", - "b3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24uTmFtZVBhcnQSGAoQaWRlbnRp", - "Zmllcl92YWx1ZRgDIAEoCRIaChJwb3NpdGl2ZV9pbnRfdmFsdWUYBCABKAQS", - "GgoSbmVnYXRpdmVfaW50X3ZhbHVlGAUgASgDEhQKDGRvdWJsZV92YWx1ZRgG", - "IAEoARIUCgxzdHJpbmdfdmFsdWUYByABKAwSFwoPYWdncmVnYXRlX3ZhbHVl", - "GAggASgJGjMKCE5hbWVQYXJ0EhEKCW5hbWVfcGFydBgBIAIoCRIUCgxpc19l", - "eHRlbnNpb24YAiACKAginQkKCkZlYXR1cmVTZXQSfAoOZmllbGRfcHJlc2Vu", - "Y2UYASABKA4yKS5nb29nbGUucHJvdG9idWYuRmVhdHVyZVNldC5GaWVsZFBy", - "ZXNlbmNlQjmIAQGYAQSYAQGiAQ0SCEVYUExJQ0lUGOYHogENEghJTVBMSUNJ", - "VBjnB6IBDRIIRVhQTElDSVQY6AcSXAoJZW51bV90eXBlGAIgASgOMiQuZ29v", - "Z2xlLnByb3RvYnVmLkZlYXR1cmVTZXQuRW51bVR5cGVCI4gBAZgBBpgBAaIB", - "CxIGQ0xPU0VEGOYHogEJEgRPUEVOGOcHEnsKF3JlcGVhdGVkX2ZpZWxkX2Vu", - "Y29kaW5nGAMgASgOMjEuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQuUmVw", - "ZWF0ZWRGaWVsZEVuY29kaW5nQieIAQGYAQSYAQGiAQ0SCEVYUEFOREVEGOYH", - "ogELEgZQQUNLRUQY5wcSaAoPdXRmOF92YWxpZGF0aW9uGAQgASgOMiouZ29v", - "Z2xlLnByb3RvYnVmLkZlYXR1cmVTZXQuVXRmOFZhbGlkYXRpb25CI4gBAZgB", - "BJgBAaIBCRIETk9ORRjmB6IBCxIGVkVSSUZZGOcHEmcKEG1lc3NhZ2VfZW5j", - "b2RpbmcYBSABKA4yKy5nb29nbGUucHJvdG9idWYuRmVhdHVyZVNldC5NZXNz", - "YWdlRW5jb2RpbmdCIIgBAZgBBJgBAaIBFBIPTEVOR1RIX1BSRUZJWEVEGOYH", - "EnAKC2pzb25fZm9ybWF0GAYgASgOMiYuZ29vZ2xlLnByb3RvYnVmLkZlYXR1", - "cmVTZXQuSnNvbkZvcm1hdEIziAEBmAEDmAEGmAEBogEXEhJMRUdBQ1lfQkVT", - "VF9FRkZPUlQY5geiAQoSBUFMTE9XGOcHIlwKDUZpZWxkUHJlc2VuY2USGgoW", - "RklFTERfUFJFU0VOQ0VfVU5LTk9XThAAEgwKCEVYUExJQ0lUEAESDAoISU1Q", - "TElDSVQQAhITCg9MRUdBQ1lfUkVRVUlSRUQQAyI3CghFbnVtVHlwZRIVChFF", - "TlVNX1RZUEVfVU5LTk9XThAAEggKBE9QRU4QARIKCgZDTE9TRUQQAiJWChVS", - "ZXBlYXRlZEZpZWxkRW5jb2RpbmcSIwofUkVQRUFURURfRklFTERfRU5DT0RJ", - "TkdfVU5LTk9XThAAEgoKBlBBQ0tFRBABEgwKCEVYUEFOREVEEAIiQwoOVXRm", - "OFZhbGlkYXRpb24SGwoXVVRGOF9WQUxJREFUSU9OX1VOS05PV04QABIICgRO", - "T05FEAESCgoGVkVSSUZZEAIiUwoPTWVzc2FnZUVuY29kaW5nEhwKGE1FU1NB", - "R0VfRU5DT0RJTkdfVU5LTk9XThAAEhMKD0xFTkdUSF9QUkVGSVhFRBABEg0K", - "CURFTElNSVRFRBACIkgKCkpzb25Gb3JtYXQSFwoTSlNPTl9GT1JNQVRfVU5L", - "Tk9XThAAEgkKBUFMTE9XEAESFgoSTEVHQUNZX0JFU1RfRUZGT1JUEAIqBgjo", - "BxDpByoGCOkHEOoHKgYIi04QkE5KBgjnBxDoByLAAgoSRmVhdHVyZVNldERl", - "ZmF1bHRzEk4KCGRlZmF1bHRzGAEgAygLMjwuZ29vZ2xlLnByb3RvYnVmLkZl", - "YXR1cmVTZXREZWZhdWx0cy5GZWF0dXJlU2V0RWRpdGlvbkRlZmF1bHQSMQoP", - "bWluaW11bV9lZGl0aW9uGAQgASgOMhguZ29vZ2xlLnByb3RvYnVmLkVkaXRp", - "b24SMQoPbWF4aW11bV9lZGl0aW9uGAUgASgOMhguZ29vZ2xlLnByb3RvYnVm", - "LkVkaXRpb24adAoYRmVhdHVyZVNldEVkaXRpb25EZWZhdWx0EikKB2VkaXRp", - "b24YAyABKA4yGC5nb29nbGUucHJvdG9idWYuRWRpdGlvbhItCghmZWF0dXJl", - "cxgCIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5GZWF0dXJlU2V0ItUBCg5Tb3Vy", - "Y2VDb2RlSW5mbxI6Cghsb2NhdGlvbhgBIAMoCzIoLmdvb2dsZS5wcm90b2J1", - "Zi5Tb3VyY2VDb2RlSW5mby5Mb2NhdGlvbhqGAQoITG9jYXRpb24SEAoEcGF0", - "aBgBIAMoBUICEAESEAoEc3BhbhgCIAMoBUICEAESGAoQbGVhZGluZ19jb21t", - "ZW50cxgDIAEoCRIZChF0cmFpbGluZ19jb21tZW50cxgEIAEoCRIhChlsZWFk", - "aW5nX2RldGFjaGVkX2NvbW1lbnRzGAYgAygJIpwCChFHZW5lcmF0ZWRDb2Rl", - "SW5mbxJBCgphbm5vdGF0aW9uGAEgAygLMi0uZ29vZ2xlLnByb3RvYnVmLkdl", - "bmVyYXRlZENvZGVJbmZvLkFubm90YXRpb24awwEKCkFubm90YXRpb24SEAoE", - "cGF0aBgBIAMoBUICEAESEwoLc291cmNlX2ZpbGUYAiABKAkSDQoFYmVnaW4Y", - "AyABKAUSCwoDZW5kGAQgASgFEkgKCHNlbWFudGljGAUgASgOMjYuZ29vZ2xl", - "LnByb3RvYnVmLkdlbmVyYXRlZENvZGVJbmZvLkFubm90YXRpb24uU2VtYW50", - "aWMiKAoIU2VtYW50aWMSCAoETk9ORRAAEgcKA1NFVBABEgkKBUFMSUFTEAIq", - "6gEKB0VkaXRpb24SEwoPRURJVElPTl9VTktOT1dOEAASEwoORURJVElPTl9Q", - "Uk9UTzIQ5gcSEwoORURJVElPTl9QUk9UTzMQ5wcSEQoMRURJVElPTl8yMDIz", - "EOgHEhcKE0VESVRJT05fMV9URVNUX09OTFkQARIXChNFRElUSU9OXzJfVEVT", - "VF9PTkxZEAISHQoXRURJVElPTl85OTk5N19URVNUX09OTFkQnY0GEh0KF0VE", - "SVRJT05fOTk5OThfVEVTVF9PTkxZEJ6NBhIdChdFRElUSU9OXzk5OTk5X1RF", - "U1RfT05MWRCfjQZCfgoTY29tLmdvb2dsZS5wcm90b2J1ZkIQRGVzY3JpcHRv", - "clByb3Rvc0gBWi1nb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9k", - "ZXNjcmlwdG9ycGL4AQGiAgNHUEKqAhpHb29nbGUuUHJvdG9idWYuUmVmbGVj", - "dGlvbg==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.Reflection.Edition), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FileDescriptorSet), global::Google.Protobuf.Reflection.FileDescriptorSet.Parser, new[]{ "File" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FileDescriptorProto), global::Google.Protobuf.Reflection.FileDescriptorProto.Parser, new[]{ "Name", "Package", "Dependency", "PublicDependency", "WeakDependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", "Syntax", "Edition" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto), global::Google.Protobuf.Reflection.DescriptorProto.Parser, new[]{ "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "OneofDecl", "Options", "ReservedRange", "ReservedName" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange), global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser, new[]{ "Start", "End", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange), global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser, new[]{ "Start", "End" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.ExtensionRangeOptions), global::Google.Protobuf.Reflection.ExtensionRangeOptions.Parser, new[]{ "UninterpretedOption", "Declaration", "Features", "Verification" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.VerificationState) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.Declaration), global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.Declaration.Parser, new[]{ "Number", "FullName", "Type", "Reserved", "Repeated" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto), global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser, new[]{ "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "JsonName", "Options", "Proto3Optional" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.OneofDescriptorProto), global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser, new[]{ "Name", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser, new[]{ "Name", "Value", "Options", "ReservedRange", "ReservedName" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange), global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange.Parser, new[]{ "Start", "End" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumValueDescriptorProto), global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser, new[]{ "Name", "Number", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.ServiceDescriptorProto), global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser, new[]{ "Name", "Method", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.MethodDescriptorProto), global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser, new[]{ "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FileOptions), global::Google.Protobuf.Reflection.FileOptions.Parser, new[]{ "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "JavaStringCheckUtf8", "OptimizeFor", "GoPackage", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "PhpGenericServices", "Deprecated", "CcEnableArenas", "ObjcClassPrefix", "CsharpNamespace", "SwiftPrefix", "PhpClassPrefix", "PhpNamespace", "PhpMetadataNamespace", "RubyPackage", "Features", "UninterpretedOption" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.MessageOptions), global::Google.Protobuf.Reflection.MessageOptions.Parser, new[]{ "MessageSetWireFormat", "NoStandardDescriptorAccessor", "Deprecated", "MapEntry", "DeprecatedLegacyJsonFieldConflicts", "Features", "UninterpretedOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FieldOptions), global::Google.Protobuf.Reflection.FieldOptions.Parser, new[]{ "Ctype", "Packed", "Jstype", "Lazy", "UnverifiedLazy", "Deprecated", "Weak", "DebugRedact", "Retention", "Targets", "EditionDefaults", "Features", "UninterpretedOption" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.CType), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.JSType), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.OptionRetention), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.OptionTargetType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.EditionDefault), global::Google.Protobuf.Reflection.FieldOptions.Types.EditionDefault.Parser, new[]{ "Edition", "Value" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.OneofOptions), global::Google.Protobuf.Reflection.OneofOptions.Parser, new[]{ "Features", "UninterpretedOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumOptions), global::Google.Protobuf.Reflection.EnumOptions.Parser, new[]{ "AllowAlias", "Deprecated", "DeprecatedLegacyJsonFieldConflicts", "Features", "UninterpretedOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumValueOptions), global::Google.Protobuf.Reflection.EnumValueOptions.Parser, new[]{ "Deprecated", "Features", "DebugRedact", "UninterpretedOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.ServiceOptions), global::Google.Protobuf.Reflection.ServiceOptions.Parser, new[]{ "Features", "Deprecated", "UninterpretedOption" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.MethodOptions), global::Google.Protobuf.Reflection.MethodOptions.Parser, new[]{ "Deprecated", "IdempotencyLevel", "Features", "UninterpretedOption" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.UninterpretedOption), global::Google.Protobuf.Reflection.UninterpretedOption.Parser, new[]{ "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart), global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser, new[]{ "NamePart_", "IsExtension" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FeatureSet), global::Google.Protobuf.Reflection.FeatureSet.Parser, new[]{ "FieldPresence", "EnumType", "RepeatedFieldEncoding", "Utf8Validation", "MessageEncoding", "JsonFormat" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FeatureSet.Types.FieldPresence), typeof(global::Google.Protobuf.Reflection.FeatureSet.Types.EnumType), typeof(global::Google.Protobuf.Reflection.FeatureSet.Types.RepeatedFieldEncoding), typeof(global::Google.Protobuf.Reflection.FeatureSet.Types.Utf8Validation), typeof(global::Google.Protobuf.Reflection.FeatureSet.Types.MessageEncoding), typeof(global::Google.Protobuf.Reflection.FeatureSet.Types.JsonFormat) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FeatureSetDefaults), global::Google.Protobuf.Reflection.FeatureSetDefaults.Parser, new[]{ "Defaults", "MinimumEdition", "MaximumEdition" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FeatureSetDefaults.Types.FeatureSetEditionDefault), global::Google.Protobuf.Reflection.FeatureSetDefaults.Types.FeatureSetEditionDefault.Parser, new[]{ "Edition", "Features" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo), global::Google.Protobuf.Reflection.SourceCodeInfo.Parser, new[]{ "Location" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location), global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location.Parser, new[]{ "Path", "Span", "LeadingComments", "TrailingComments", "LeadingDetachedComments" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.GeneratedCodeInfo), global::Google.Protobuf.Reflection.GeneratedCodeInfo.Parser, new[]{ "Annotation" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation), global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Parser, new[]{ "Path", "SourceFile", "Begin", "End", "Semantic" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Types.Semantic) }, null, null)}) - })); - } - #endregion - - } - #region Enums - /// - /// The full set of known editions. - /// - public enum Edition { - /// - /// A placeholder for an unknown edition value. - /// - [pbr::OriginalName("EDITION_UNKNOWN")] Unknown = 0, - /// - /// Legacy syntax "editions". These pre-date editions, but behave much like - /// distinct editions. These can't be used to specify the edition of proto - /// files, but feature definitions must supply proto2/proto3 defaults for - /// backwards compatibility. - /// - [pbr::OriginalName("EDITION_PROTO2")] Proto2 = 998, - [pbr::OriginalName("EDITION_PROTO3")] Proto3 = 999, - /// - /// Editions that have been released. The specific values are arbitrary and - /// should not be depended on, but they will always be time-ordered for easy - /// comparison. - /// - [pbr::OriginalName("EDITION_2023")] _2023 = 1000, - /// - /// Placeholder editions for testing feature resolution. These should not be - /// used or relyed on outside of tests. - /// - [pbr::OriginalName("EDITION_1_TEST_ONLY")] _1TestOnly = 1, - [pbr::OriginalName("EDITION_2_TEST_ONLY")] _2TestOnly = 2, - [pbr::OriginalName("EDITION_99997_TEST_ONLY")] _99997TestOnly = 99997, - [pbr::OriginalName("EDITION_99998_TEST_ONLY")] _99998TestOnly = 99998, - [pbr::OriginalName("EDITION_99999_TEST_ONLY")] _99999TestOnly = 99999, - } - - #endregion - - #region Messages - /// - /// The protocol compiler can output a FileDescriptorSet containing the .proto - /// files it parses. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FileDescriptorSet : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorSet()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileDescriptorSet() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileDescriptorSet(FileDescriptorSet other) : this() { - file_ = other.file_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileDescriptorSet Clone() { - return new FileDescriptorSet(this); - } - - /// Field number for the "file" field. - public const int FileFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_file_codec - = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); - private readonly pbc::RepeatedField file_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField File { - get { return file_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FileDescriptorSet); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FileDescriptorSet other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!file_.Equals(other.file_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= file_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - file_.WriteTo(output, _repeated_file_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - file_.WriteTo(ref output, _repeated_file_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += file_.CalculateSize(_repeated_file_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FileDescriptorSet other) { - if (other == null) { - return; - } - file_.Add(other.file_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - file_.AddEntriesFrom(input, _repeated_file_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - file_.AddEntriesFrom(ref input, _repeated_file_codec); - break; - } - } - } - } - #endif - - } - - /// - /// Describes a complete .proto file. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FileDescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileDescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileDescriptorProto(FileDescriptorProto other) : this() { - _hasBits0 = other._hasBits0; - name_ = other.name_; - package_ = other.package_; - dependency_ = other.dependency_.Clone(); - publicDependency_ = other.publicDependency_.Clone(); - weakDependency_ = other.weakDependency_.Clone(); - messageType_ = other.messageType_.Clone(); - enumType_ = other.enumType_.Clone(); - service_ = other.service_.Clone(); - extension_ = other.extension_.Clone(); - options_ = other.options_ != null ? other.options_.Clone() : null; - sourceCodeInfo_ = other.sourceCodeInfo_ != null ? other.sourceCodeInfo_.Clone() : null; - syntax_ = other.syntax_; - edition_ = other.edition_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileDescriptorProto Clone() { - return new FileDescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - /// - /// file name, relative to root of source tree - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "package" field. - public const int PackageFieldNumber = 2; - private readonly static string PackageDefaultValue = ""; - - private string package_; - /// - /// e.g. "foo", "foo.bar", etc. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Package { - get { return package_ ?? PackageDefaultValue; } - set { - package_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "package" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPackage { - get { return package_ != null; } - } - /// Clears the value of the "package" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPackage() { - package_ = null; - } - - /// Field number for the "dependency" field. - public const int DependencyFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_dependency_codec - = pb::FieldCodec.ForString(26); - private readonly pbc::RepeatedField dependency_ = new pbc::RepeatedField(); - /// - /// Names of files imported by this file. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Dependency { - get { return dependency_; } - } - - /// Field number for the "public_dependency" field. - public const int PublicDependencyFieldNumber = 10; - private static readonly pb::FieldCodec _repeated_publicDependency_codec - = pb::FieldCodec.ForInt32(80); - private readonly pbc::RepeatedField publicDependency_ = new pbc::RepeatedField(); - /// - /// Indexes of the public imported files in the dependency list above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField PublicDependency { - get { return publicDependency_; } - } - - /// Field number for the "weak_dependency" field. - public const int WeakDependencyFieldNumber = 11; - private static readonly pb::FieldCodec _repeated_weakDependency_codec - = pb::FieldCodec.ForInt32(88); - private readonly pbc::RepeatedField weakDependency_ = new pbc::RepeatedField(); - /// - /// Indexes of the weak imported files in the dependency list. - /// For Google-internal migration only. Do not use. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField WeakDependency { - get { return weakDependency_; } - } - - /// Field number for the "message_type" field. - public const int MessageTypeFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_messageType_codec - = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.DescriptorProto.Parser); - private readonly pbc::RepeatedField messageType_ = new pbc::RepeatedField(); - /// - /// All top-level definitions in this file. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField MessageType { - get { return messageType_; } - } - - /// Field number for the "enum_type" field. - public const int EnumTypeFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_enumType_codec - = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); - private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField EnumType { - get { return enumType_; } - } - - /// Field number for the "service" field. - public const int ServiceFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_service_codec - = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser); - private readonly pbc::RepeatedField service_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Service { - get { return service_; } - } - - /// Field number for the "extension" field. - public const int ExtensionFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_extension_codec - = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); - private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Extension { - get { return extension_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 8; - private global::Google.Protobuf.Reflection.FileOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FileOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - /// Field number for the "source_code_info" field. - public const int SourceCodeInfoFieldNumber = 9; - private global::Google.Protobuf.Reflection.SourceCodeInfo sourceCodeInfo_; - /// - /// This field contains optional information about the original source code. - /// You may safely remove this entire field without harming runtime - /// functionality of the descriptors -- the information is needed only by - /// development tools. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.SourceCodeInfo SourceCodeInfo { - get { return sourceCodeInfo_; } - set { - sourceCodeInfo_ = value; - } - } - - /// Field number for the "syntax" field. - public const int SyntaxFieldNumber = 12; - private readonly static string SyntaxDefaultValue = ""; - - private string syntax_; - /// - /// The syntax of the proto file. - /// The supported values are "proto2", "proto3", and "editions". - /// - /// If `edition` is present, this value must be "editions". - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Syntax { - get { return syntax_ ?? SyntaxDefaultValue; } - set { - syntax_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "syntax" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSyntax { - get { return syntax_ != null; } - } - /// Clears the value of the "syntax" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSyntax() { - syntax_ = null; - } - - /// Field number for the "edition" field. - public const int EditionFieldNumber = 14; - private readonly static global::Google.Protobuf.Reflection.Edition EditionDefaultValue = global::Google.Protobuf.Reflection.Edition.Unknown; - - private global::Google.Protobuf.Reflection.Edition edition_; - /// - /// The edition of the proto file. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.Edition Edition { - get { if ((_hasBits0 & 1) != 0) { return edition_; } else { return EditionDefaultValue; } } - set { - _hasBits0 |= 1; - edition_ = value; - } - } - /// Gets whether the "edition" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEdition { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "edition" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEdition() { - _hasBits0 &= ~1; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FileDescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FileDescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (Package != other.Package) return false; - if(!dependency_.Equals(other.dependency_)) return false; - if(!publicDependency_.Equals(other.publicDependency_)) return false; - if(!weakDependency_.Equals(other.weakDependency_)) return false; - if(!messageType_.Equals(other.messageType_)) return false; - if(!enumType_.Equals(other.enumType_)) return false; - if(!service_.Equals(other.service_)) return false; - if(!extension_.Equals(other.extension_)) return false; - if (!object.Equals(Options, other.Options)) return false; - if (!object.Equals(SourceCodeInfo, other.SourceCodeInfo)) return false; - if (Syntax != other.Syntax) return false; - if (Edition != other.Edition) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - if (HasPackage) hash ^= Package.GetHashCode(); - hash ^= dependency_.GetHashCode(); - hash ^= publicDependency_.GetHashCode(); - hash ^= weakDependency_.GetHashCode(); - hash ^= messageType_.GetHashCode(); - hash ^= enumType_.GetHashCode(); - hash ^= service_.GetHashCode(); - hash ^= extension_.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (sourceCodeInfo_ != null) hash ^= SourceCodeInfo.GetHashCode(); - if (HasSyntax) hash ^= Syntax.GetHashCode(); - if (HasEdition) hash ^= Edition.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasPackage) { - output.WriteRawTag(18); - output.WriteString(Package); - } - dependency_.WriteTo(output, _repeated_dependency_codec); - messageType_.WriteTo(output, _repeated_messageType_codec); - enumType_.WriteTo(output, _repeated_enumType_codec); - service_.WriteTo(output, _repeated_service_codec); - extension_.WriteTo(output, _repeated_extension_codec); - if (options_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Options); - } - if (sourceCodeInfo_ != null) { - output.WriteRawTag(74); - output.WriteMessage(SourceCodeInfo); - } - publicDependency_.WriteTo(output, _repeated_publicDependency_codec); - weakDependency_.WriteTo(output, _repeated_weakDependency_codec); - if (HasSyntax) { - output.WriteRawTag(98); - output.WriteString(Syntax); - } - if (HasEdition) { - output.WriteRawTag(112); - output.WriteEnum((int) Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasPackage) { - output.WriteRawTag(18); - output.WriteString(Package); - } - dependency_.WriteTo(ref output, _repeated_dependency_codec); - messageType_.WriteTo(ref output, _repeated_messageType_codec); - enumType_.WriteTo(ref output, _repeated_enumType_codec); - service_.WriteTo(ref output, _repeated_service_codec); - extension_.WriteTo(ref output, _repeated_extension_codec); - if (options_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Options); - } - if (sourceCodeInfo_ != null) { - output.WriteRawTag(74); - output.WriteMessage(SourceCodeInfo); - } - publicDependency_.WriteTo(ref output, _repeated_publicDependency_codec); - weakDependency_.WriteTo(ref output, _repeated_weakDependency_codec); - if (HasSyntax) { - output.WriteRawTag(98); - output.WriteString(Syntax); - } - if (HasEdition) { - output.WriteRawTag(112); - output.WriteEnum((int) Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (HasPackage) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Package); - } - size += dependency_.CalculateSize(_repeated_dependency_codec); - size += publicDependency_.CalculateSize(_repeated_publicDependency_codec); - size += weakDependency_.CalculateSize(_repeated_weakDependency_codec); - size += messageType_.CalculateSize(_repeated_messageType_codec); - size += enumType_.CalculateSize(_repeated_enumType_codec); - size += service_.CalculateSize(_repeated_service_codec); - size += extension_.CalculateSize(_repeated_extension_codec); - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (sourceCodeInfo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceCodeInfo); - } - if (HasSyntax) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Syntax); - } - if (HasEdition) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Edition); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FileDescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - if (other.HasPackage) { - Package = other.Package; - } - dependency_.Add(other.dependency_); - publicDependency_.Add(other.publicDependency_); - weakDependency_.Add(other.weakDependency_); - messageType_.Add(other.messageType_); - enumType_.Add(other.enumType_); - service_.Add(other.service_); - extension_.Add(other.extension_); - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.FileOptions(); - } - Options.MergeFrom(other.Options); - } - if (other.sourceCodeInfo_ != null) { - if (sourceCodeInfo_ == null) { - SourceCodeInfo = new global::Google.Protobuf.Reflection.SourceCodeInfo(); - } - SourceCodeInfo.MergeFrom(other.SourceCodeInfo); - } - if (other.HasSyntax) { - Syntax = other.Syntax; - } - if (other.HasEdition) { - Edition = other.Edition; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Package = input.ReadString(); - break; - } - case 26: { - dependency_.AddEntriesFrom(input, _repeated_dependency_codec); - break; - } - case 34: { - messageType_.AddEntriesFrom(input, _repeated_messageType_codec); - break; - } - case 42: { - enumType_.AddEntriesFrom(input, _repeated_enumType_codec); - break; - } - case 50: { - service_.AddEntriesFrom(input, _repeated_service_codec); - break; - } - case 58: { - extension_.AddEntriesFrom(input, _repeated_extension_codec); - break; - } - case 66: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.FileOptions(); - } - input.ReadMessage(Options); - break; - } - case 74: { - if (sourceCodeInfo_ == null) { - SourceCodeInfo = new global::Google.Protobuf.Reflection.SourceCodeInfo(); - } - input.ReadMessage(SourceCodeInfo); - break; - } - case 82: - case 80: { - publicDependency_.AddEntriesFrom(input, _repeated_publicDependency_codec); - break; - } - case 90: - case 88: { - weakDependency_.AddEntriesFrom(input, _repeated_weakDependency_codec); - break; - } - case 98: { - Syntax = input.ReadString(); - break; - } - case 112: { - Edition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Package = input.ReadString(); - break; - } - case 26: { - dependency_.AddEntriesFrom(ref input, _repeated_dependency_codec); - break; - } - case 34: { - messageType_.AddEntriesFrom(ref input, _repeated_messageType_codec); - break; - } - case 42: { - enumType_.AddEntriesFrom(ref input, _repeated_enumType_codec); - break; - } - case 50: { - service_.AddEntriesFrom(ref input, _repeated_service_codec); - break; - } - case 58: { - extension_.AddEntriesFrom(ref input, _repeated_extension_codec); - break; - } - case 66: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.FileOptions(); - } - input.ReadMessage(Options); - break; - } - case 74: { - if (sourceCodeInfo_ == null) { - SourceCodeInfo = new global::Google.Protobuf.Reflection.SourceCodeInfo(); - } - input.ReadMessage(SourceCodeInfo); - break; - } - case 82: - case 80: { - publicDependency_.AddEntriesFrom(ref input, _repeated_publicDependency_codec); - break; - } - case 90: - case 88: { - weakDependency_.AddEntriesFrom(ref input, _repeated_weakDependency_codec); - break; - } - case 98: { - Syntax = input.ReadString(); - break; - } - case 112: { - Edition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - /// - /// Describes a message type. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class DescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DescriptorProto(DescriptorProto other) : this() { - name_ = other.name_; - field_ = other.field_.Clone(); - extension_ = other.extension_.Clone(); - nestedType_ = other.nestedType_.Clone(); - enumType_ = other.enumType_.Clone(); - extensionRange_ = other.extensionRange_.Clone(); - oneofDecl_ = other.oneofDecl_.Clone(); - options_ = other.options_ != null ? other.options_.Clone() : null; - reservedRange_ = other.reservedRange_.Clone(); - reservedName_ = other.reservedName_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DescriptorProto Clone() { - return new DescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "field" field. - public const int FieldFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_field_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); - private readonly pbc::RepeatedField field_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Field { - get { return field_; } - } - - /// Field number for the "extension" field. - public const int ExtensionFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_extension_codec - = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); - private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Extension { - get { return extension_; } - } - - /// Field number for the "nested_type" field. - public const int NestedTypeFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_nestedType_codec - = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.Reflection.DescriptorProto.Parser); - private readonly pbc::RepeatedField nestedType_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField NestedType { - get { return nestedType_; } - } - - /// Field number for the "enum_type" field. - public const int EnumTypeFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_enumType_codec - = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); - private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField EnumType { - get { return enumType_; } - } - - /// Field number for the "extension_range" field. - public const int ExtensionRangeFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_extensionRange_codec - = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser); - private readonly pbc::RepeatedField extensionRange_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField ExtensionRange { - get { return extensionRange_; } - } - - /// Field number for the "oneof_decl" field. - public const int OneofDeclFieldNumber = 8; - private static readonly pb::FieldCodec _repeated_oneofDecl_codec - = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser); - private readonly pbc::RepeatedField oneofDecl_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField OneofDecl { - get { return oneofDecl_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 7; - private global::Google.Protobuf.Reflection.MessageOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.MessageOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - /// Field number for the "reserved_range" field. - public const int ReservedRangeFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_reservedRange_codec - = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser); - private readonly pbc::RepeatedField reservedRange_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField ReservedRange { - get { return reservedRange_; } - } - - /// Field number for the "reserved_name" field. - public const int ReservedNameFieldNumber = 10; - private static readonly pb::FieldCodec _repeated_reservedName_codec - = pb::FieldCodec.ForString(82); - private readonly pbc::RepeatedField reservedName_ = new pbc::RepeatedField(); - /// - /// Reserved field names, which may not be used by fields in the same message. - /// A given name may only be reserved once. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField ReservedName { - get { return reservedName_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as DescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(DescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if(!field_.Equals(other.field_)) return false; - if(!extension_.Equals(other.extension_)) return false; - if(!nestedType_.Equals(other.nestedType_)) return false; - if(!enumType_.Equals(other.enumType_)) return false; - if(!extensionRange_.Equals(other.extensionRange_)) return false; - if(!oneofDecl_.Equals(other.oneofDecl_)) return false; - if (!object.Equals(Options, other.Options)) return false; - if(!reservedRange_.Equals(other.reservedRange_)) return false; - if(!reservedName_.Equals(other.reservedName_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - hash ^= field_.GetHashCode(); - hash ^= extension_.GetHashCode(); - hash ^= nestedType_.GetHashCode(); - hash ^= enumType_.GetHashCode(); - hash ^= extensionRange_.GetHashCode(); - hash ^= oneofDecl_.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - hash ^= reservedRange_.GetHashCode(); - hash ^= reservedName_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - field_.WriteTo(output, _repeated_field_codec); - nestedType_.WriteTo(output, _repeated_nestedType_codec); - enumType_.WriteTo(output, _repeated_enumType_codec); - extensionRange_.WriteTo(output, _repeated_extensionRange_codec); - extension_.WriteTo(output, _repeated_extension_codec); - if (options_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Options); - } - oneofDecl_.WriteTo(output, _repeated_oneofDecl_codec); - reservedRange_.WriteTo(output, _repeated_reservedRange_codec); - reservedName_.WriteTo(output, _repeated_reservedName_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - field_.WriteTo(ref output, _repeated_field_codec); - nestedType_.WriteTo(ref output, _repeated_nestedType_codec); - enumType_.WriteTo(ref output, _repeated_enumType_codec); - extensionRange_.WriteTo(ref output, _repeated_extensionRange_codec); - extension_.WriteTo(ref output, _repeated_extension_codec); - if (options_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Options); - } - oneofDecl_.WriteTo(ref output, _repeated_oneofDecl_codec); - reservedRange_.WriteTo(ref output, _repeated_reservedRange_codec); - reservedName_.WriteTo(ref output, _repeated_reservedName_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - size += field_.CalculateSize(_repeated_field_codec); - size += extension_.CalculateSize(_repeated_extension_codec); - size += nestedType_.CalculateSize(_repeated_nestedType_codec); - size += enumType_.CalculateSize(_repeated_enumType_codec); - size += extensionRange_.CalculateSize(_repeated_extensionRange_codec); - size += oneofDecl_.CalculateSize(_repeated_oneofDecl_codec); - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - size += reservedRange_.CalculateSize(_repeated_reservedRange_codec); - size += reservedName_.CalculateSize(_repeated_reservedName_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(DescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - field_.Add(other.field_); - extension_.Add(other.extension_); - nestedType_.Add(other.nestedType_); - enumType_.Add(other.enumType_); - extensionRange_.Add(other.extensionRange_); - oneofDecl_.Add(other.oneofDecl_); - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.MessageOptions(); - } - Options.MergeFrom(other.Options); - } - reservedRange_.Add(other.reservedRange_); - reservedName_.Add(other.reservedName_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - field_.AddEntriesFrom(input, _repeated_field_codec); - break; - } - case 26: { - nestedType_.AddEntriesFrom(input, _repeated_nestedType_codec); - break; - } - case 34: { - enumType_.AddEntriesFrom(input, _repeated_enumType_codec); - break; - } - case 42: { - extensionRange_.AddEntriesFrom(input, _repeated_extensionRange_codec); - break; - } - case 50: { - extension_.AddEntriesFrom(input, _repeated_extension_codec); - break; - } - case 58: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.MessageOptions(); - } - input.ReadMessage(Options); - break; - } - case 66: { - oneofDecl_.AddEntriesFrom(input, _repeated_oneofDecl_codec); - break; - } - case 74: { - reservedRange_.AddEntriesFrom(input, _repeated_reservedRange_codec); - break; - } - case 82: { - reservedName_.AddEntriesFrom(input, _repeated_reservedName_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - field_.AddEntriesFrom(ref input, _repeated_field_codec); - break; - } - case 26: { - nestedType_.AddEntriesFrom(ref input, _repeated_nestedType_codec); - break; - } - case 34: { - enumType_.AddEntriesFrom(ref input, _repeated_enumType_codec); - break; - } - case 42: { - extensionRange_.AddEntriesFrom(ref input, _repeated_extensionRange_codec); - break; - } - case 50: { - extension_.AddEntriesFrom(ref input, _repeated_extension_codec); - break; - } - case 58: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.MessageOptions(); - } - input.ReadMessage(Options); - break; - } - case 66: { - oneofDecl_.AddEntriesFrom(ref input, _repeated_oneofDecl_codec); - break; - } - case 74: { - reservedRange_.AddEntriesFrom(ref input, _repeated_reservedRange_codec); - break; - } - case 82: { - reservedName_.AddEntriesFrom(ref input, _repeated_reservedName_codec); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the DescriptorProto message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ExtensionRange : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRange()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ExtensionRange() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ExtensionRange(ExtensionRange other) : this() { - _hasBits0 = other._hasBits0; - start_ = other.start_; - end_ = other.end_; - options_ = other.options_ != null ? other.options_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ExtensionRange Clone() { - return new ExtensionRange(this); - } - - /// Field number for the "start" field. - public const int StartFieldNumber = 1; - private readonly static int StartDefaultValue = 0; - - private int start_; - /// - /// Inclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Start { - get { if ((_hasBits0 & 1) != 0) { return start_; } else { return StartDefaultValue; } } - set { - _hasBits0 |= 1; - start_ = value; - } - } - /// Gets whether the "start" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasStart { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "start" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearStart() { - _hasBits0 &= ~1; - } - - /// Field number for the "end" field. - public const int EndFieldNumber = 2; - private readonly static int EndDefaultValue = 0; - - private int end_; - /// - /// Exclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int End { - get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } - set { - _hasBits0 |= 2; - end_ = value; - } - } - /// Gets whether the "end" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEnd { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "end" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEnd() { - _hasBits0 &= ~2; - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 3; - private global::Google.Protobuf.Reflection.ExtensionRangeOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.ExtensionRangeOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ExtensionRange); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ExtensionRange other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Start != other.Start) return false; - if (End != other.End) return false; - if (!object.Equals(Options, other.Options)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasStart) hash ^= Start.GetHashCode(); - if (HasEnd) hash ^= End.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasStart) { - output.WriteRawTag(8); - output.WriteInt32(Start); - } - if (HasEnd) { - output.WriteRawTag(16); - output.WriteInt32(End); - } - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasStart) { - output.WriteRawTag(8); - output.WriteInt32(Start); - } - if (HasEnd) { - output.WriteRawTag(16); - output.WriteInt32(End); - } - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasStart) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Start); - } - if (HasEnd) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(End); - } - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ExtensionRange other) { - if (other == null) { - return; - } - if (other.HasStart) { - Start = other.Start; - } - if (other.HasEnd) { - End = other.End; - } - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.ExtensionRangeOptions(); - } - Options.MergeFrom(other.Options); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Start = input.ReadInt32(); - break; - } - case 16: { - End = input.ReadInt32(); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.ExtensionRangeOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Start = input.ReadInt32(); - break; - } - case 16: { - End = input.ReadInt32(); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.ExtensionRangeOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - } - #endif - - } - - /// - /// Range of reserved tag numbers. Reserved tag numbers may not be used by - /// fields or extension ranges in the same message. Reserved ranges may - /// not overlap. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ReservedRange : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedRange()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReservedRange() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReservedRange(ReservedRange other) : this() { - _hasBits0 = other._hasBits0; - start_ = other.start_; - end_ = other.end_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ReservedRange Clone() { - return new ReservedRange(this); - } - - /// Field number for the "start" field. - public const int StartFieldNumber = 1; - private readonly static int StartDefaultValue = 0; - - private int start_; - /// - /// Inclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Start { - get { if ((_hasBits0 & 1) != 0) { return start_; } else { return StartDefaultValue; } } - set { - _hasBits0 |= 1; - start_ = value; - } - } - /// Gets whether the "start" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasStart { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "start" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearStart() { - _hasBits0 &= ~1; - } - - /// Field number for the "end" field. - public const int EndFieldNumber = 2; - private readonly static int EndDefaultValue = 0; - - private int end_; - /// - /// Exclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int End { - get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } - set { - _hasBits0 |= 2; - end_ = value; - } - } - /// Gets whether the "end" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEnd { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "end" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEnd() { - _hasBits0 &= ~2; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ReservedRange); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ReservedRange other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Start != other.Start) return false; - if (End != other.End) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasStart) hash ^= Start.GetHashCode(); - if (HasEnd) hash ^= End.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasStart) { - output.WriteRawTag(8); - output.WriteInt32(Start); - } - if (HasEnd) { - output.WriteRawTag(16); - output.WriteInt32(End); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasStart) { - output.WriteRawTag(8); - output.WriteInt32(Start); - } - if (HasEnd) { - output.WriteRawTag(16); - output.WriteInt32(End); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasStart) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Start); - } - if (HasEnd) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(End); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ReservedRange other) { - if (other == null) { - return; - } - if (other.HasStart) { - Start = other.Start; - } - if (other.HasEnd) { - End = other.End; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Start = input.ReadInt32(); - break; - } - case 16: { - End = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Start = input.ReadInt32(); - break; - } - case 16: { - End = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ExtensionRangeOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRangeOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ExtensionRangeOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ExtensionRangeOptions(ExtensionRangeOptions other) : this() { - _hasBits0 = other._hasBits0; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - declaration_ = other.declaration_.Clone(); - features_ = other.features_ != null ? other.features_.Clone() : null; - verification_ = other.verification_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ExtensionRangeOptions Clone() { - return new ExtensionRangeOptions(this); - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - /// Field number for the "declaration" field. - public const int DeclarationFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_declaration_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.Declaration.Parser); - private readonly pbc::RepeatedField declaration_ = new pbc::RepeatedField(); - /// - /// For external users: DO NOT USE. We are in the process of open sourcing - /// extension declaration and executing internal cleanups before it can be - /// used externally. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Declaration { - get { return declaration_; } - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 50; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "verification" field. - public const int VerificationFieldNumber = 3; - private readonly static global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.VerificationState VerificationDefaultValue = global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.VerificationState.Unverified; - - private global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.VerificationState verification_; - /// - /// The verification state of the range. - /// TODO: flip the default to DECLARATION once all empty ranges - /// are marked as UNVERIFIED. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.VerificationState Verification { - get { if ((_hasBits0 & 1) != 0) { return verification_; } else { return VerificationDefaultValue; } } - set { - _hasBits0 |= 1; - verification_ = value; - } - } - /// Gets whether the "verification" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasVerification { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "verification" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearVerification() { - _hasBits0 &= ~1; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ExtensionRangeOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ExtensionRangeOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if(!declaration_.Equals(other.declaration_)) return false; - if (!object.Equals(Features, other.Features)) return false; - if (Verification != other.Verification) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= uninterpretedOption_.GetHashCode(); - hash ^= declaration_.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - if (HasVerification) hash ^= Verification.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - declaration_.WriteTo(output, _repeated_declaration_codec); - if (HasVerification) { - output.WriteRawTag(24); - output.WriteEnum((int) Verification); - } - if (features_ != null) { - output.WriteRawTag(146, 3); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - declaration_.WriteTo(ref output, _repeated_declaration_codec); - if (HasVerification) { - output.WriteRawTag(24); - output.WriteEnum((int) Verification); - } - if (features_ != null) { - output.WriteRawTag(146, 3); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - size += declaration_.CalculateSize(_repeated_declaration_codec); - if (features_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - if (HasVerification) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Verification); - } - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ExtensionRangeOptions other) { - if (other == null) { - return; - } - uninterpretedOption_.Add(other.uninterpretedOption_); - declaration_.Add(other.declaration_); - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - if (other.HasVerification) { - Verification = other.Verification; - } - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 18: { - declaration_.AddEntriesFrom(input, _repeated_declaration_codec); - break; - } - case 24: { - Verification = (global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.VerificationState) input.ReadEnum(); - break; - } - case 402: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 18: { - declaration_.AddEntriesFrom(ref input, _repeated_declaration_codec); - break; - } - case 24: { - Verification = (global::Google.Protobuf.Reflection.ExtensionRangeOptions.Types.VerificationState) input.ReadEnum(); - break; - } - case 402: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - #region Nested types - /// Container for nested types declared in the ExtensionRangeOptions message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// The verification state of the extension range. - /// - public enum VerificationState { - /// - /// All the extensions of the range must be declared. - /// - [pbr::OriginalName("DECLARATION")] Declaration = 0, - [pbr::OriginalName("UNVERIFIED")] Unverified = 1, - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Declaration : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Declaration()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.ExtensionRangeOptions.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Declaration() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Declaration(Declaration other) : this() { - _hasBits0 = other._hasBits0; - number_ = other.number_; - fullName_ = other.fullName_; - type_ = other.type_; - reserved_ = other.reserved_; - repeated_ = other.repeated_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Declaration Clone() { - return new Declaration(this); - } - - /// Field number for the "number" field. - public const int NumberFieldNumber = 1; - private readonly static int NumberDefaultValue = 0; - - private int number_; - /// - /// The extension number declared within the extension range. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Number { - get { if ((_hasBits0 & 1) != 0) { return number_; } else { return NumberDefaultValue; } } - set { - _hasBits0 |= 1; - number_ = value; - } - } - /// Gets whether the "number" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNumber { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "number" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNumber() { - _hasBits0 &= ~1; - } - - /// Field number for the "full_name" field. - public const int FullNameFieldNumber = 2; - private readonly static string FullNameDefaultValue = ""; - - private string fullName_; - /// - /// The fully-qualified name of the extension field. There must be a leading - /// dot in front of the full name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string FullName { - get { return fullName_ ?? FullNameDefaultValue; } - set { - fullName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "full_name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasFullName { - get { return fullName_ != null; } - } - /// Clears the value of the "full_name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearFullName() { - fullName_ = null; - } - - /// Field number for the "type" field. - public const int TypeFieldNumber = 3; - private readonly static string TypeDefaultValue = ""; - - private string type_; - /// - /// The fully-qualified type name of the extension field. Unlike - /// Metadata.type, Declaration.type must have a leading dot for messages - /// and enums. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Type { - get { return type_ ?? TypeDefaultValue; } - set { - type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "type" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasType { - get { return type_ != null; } - } - /// Clears the value of the "type" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearType() { - type_ = null; - } - - /// Field number for the "reserved" field. - public const int ReservedFieldNumber = 5; - private readonly static bool ReservedDefaultValue = false; - - private bool reserved_; - /// - /// If true, indicates that the number is reserved in the extension range, - /// and any extension field with the number will fail to compile. Set this - /// when a declared extension field is deleted. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Reserved { - get { if ((_hasBits0 & 2) != 0) { return reserved_; } else { return ReservedDefaultValue; } } - set { - _hasBits0 |= 2; - reserved_ = value; - } - } - /// Gets whether the "reserved" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasReserved { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "reserved" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearReserved() { - _hasBits0 &= ~2; - } - - /// Field number for the "repeated" field. - public const int RepeatedFieldNumber = 6; - private readonly static bool RepeatedDefaultValue = false; - - private bool repeated_; - /// - /// If true, indicates that the extension must be defined as repeated. - /// Otherwise the extension must be defined as optional. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Repeated { - get { if ((_hasBits0 & 4) != 0) { return repeated_; } else { return RepeatedDefaultValue; } } - set { - _hasBits0 |= 4; - repeated_ = value; - } - } - /// Gets whether the "repeated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRepeated { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "repeated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRepeated() { - _hasBits0 &= ~4; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Declaration); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Declaration other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Number != other.Number) return false; - if (FullName != other.FullName) return false; - if (Type != other.Type) return false; - if (Reserved != other.Reserved) return false; - if (Repeated != other.Repeated) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasNumber) hash ^= Number.GetHashCode(); - if (HasFullName) hash ^= FullName.GetHashCode(); - if (HasType) hash ^= Type.GetHashCode(); - if (HasReserved) hash ^= Reserved.GetHashCode(); - if (HasRepeated) hash ^= Repeated.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasNumber) { - output.WriteRawTag(8); - output.WriteInt32(Number); - } - if (HasFullName) { - output.WriteRawTag(18); - output.WriteString(FullName); - } - if (HasType) { - output.WriteRawTag(26); - output.WriteString(Type); - } - if (HasReserved) { - output.WriteRawTag(40); - output.WriteBool(Reserved); - } - if (HasRepeated) { - output.WriteRawTag(48); - output.WriteBool(Repeated); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasNumber) { - output.WriteRawTag(8); - output.WriteInt32(Number); - } - if (HasFullName) { - output.WriteRawTag(18); - output.WriteString(FullName); - } - if (HasType) { - output.WriteRawTag(26); - output.WriteString(Type); - } - if (HasReserved) { - output.WriteRawTag(40); - output.WriteBool(Reserved); - } - if (HasRepeated) { - output.WriteRawTag(48); - output.WriteBool(Repeated); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasNumber) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number); - } - if (HasFullName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(FullName); - } - if (HasType) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Type); - } - if (HasReserved) { - size += 1 + 1; - } - if (HasRepeated) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Declaration other) { - if (other == null) { - return; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasFullName) { - FullName = other.FullName; - } - if (other.HasType) { - Type = other.Type; - } - if (other.HasReserved) { - Reserved = other.Reserved; - } - if (other.HasRepeated) { - Repeated = other.Repeated; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Number = input.ReadInt32(); - break; - } - case 18: { - FullName = input.ReadString(); - break; - } - case 26: { - Type = input.ReadString(); - break; - } - case 40: { - Reserved = input.ReadBool(); - break; - } - case 48: { - Repeated = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Number = input.ReadInt32(); - break; - } - case 18: { - FullName = input.ReadString(); - break; - } - case 26: { - Type = input.ReadString(); - break; - } - case 40: { - Reserved = input.ReadBool(); - break; - } - case 48: { - Repeated = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - /// - /// Describes a field within a message. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FieldDescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldDescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldDescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldDescriptorProto(FieldDescriptorProto other) : this() { - _hasBits0 = other._hasBits0; - name_ = other.name_; - number_ = other.number_; - label_ = other.label_; - type_ = other.type_; - typeName_ = other.typeName_; - extendee_ = other.extendee_; - defaultValue_ = other.defaultValue_; - oneofIndex_ = other.oneofIndex_; - jsonName_ = other.jsonName_; - options_ = other.options_ != null ? other.options_.Clone() : null; - proto3Optional_ = other.proto3Optional_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldDescriptorProto Clone() { - return new FieldDescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "number" field. - public const int NumberFieldNumber = 3; - private readonly static int NumberDefaultValue = 0; - - private int number_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Number { - get { if ((_hasBits0 & 1) != 0) { return number_; } else { return NumberDefaultValue; } } - set { - _hasBits0 |= 1; - number_ = value; - } - } - /// Gets whether the "number" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNumber { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "number" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNumber() { - _hasBits0 &= ~1; - } - - /// Field number for the "label" field. - public const int LabelFieldNumber = 4; - private readonly static global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label LabelDefaultValue = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.Optional; - - private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label label_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label Label { - get { if ((_hasBits0 & 2) != 0) { return label_; } else { return LabelDefaultValue; } } - set { - _hasBits0 |= 2; - label_ = value; - } - } - /// Gets whether the "label" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasLabel { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "label" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearLabel() { - _hasBits0 &= ~2; - } - - /// Field number for the "type" field. - public const int TypeFieldNumber = 5; - private readonly static global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type TypeDefaultValue = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.Double; - - private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type type_; - /// - /// If type_name is set, this need not be set. If both this and type_name - /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type Type { - get { if ((_hasBits0 & 4) != 0) { return type_; } else { return TypeDefaultValue; } } - set { - _hasBits0 |= 4; - type_ = value; - } - } - /// Gets whether the "type" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasType { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "type" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearType() { - _hasBits0 &= ~4; - } - - /// Field number for the "type_name" field. - public const int TypeNameFieldNumber = 6; - private readonly static string TypeNameDefaultValue = ""; - - private string typeName_; - /// - /// For message and enum types, this is the name of the type. If the name - /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - /// rules are used to find the type (i.e. first the nested types within this - /// message are searched, then within the parent, on up to the root - /// namespace). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string TypeName { - get { return typeName_ ?? TypeNameDefaultValue; } - set { - typeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "type_name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasTypeName { - get { return typeName_ != null; } - } - /// Clears the value of the "type_name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearTypeName() { - typeName_ = null; - } - - /// Field number for the "extendee" field. - public const int ExtendeeFieldNumber = 2; - private readonly static string ExtendeeDefaultValue = ""; - - private string extendee_; - /// - /// For extensions, this is the name of the type being extended. It is - /// resolved in the same manner as type_name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Extendee { - get { return extendee_ ?? ExtendeeDefaultValue; } - set { - extendee_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "extendee" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasExtendee { - get { return extendee_ != null; } - } - /// Clears the value of the "extendee" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearExtendee() { - extendee_ = null; - } - - /// Field number for the "default_value" field. - public const int DefaultValueFieldNumber = 7; - private readonly static string DefaultValueDefaultValue = ""; - - private string defaultValue_; - /// - /// For numeric types, contains the original text representation of the value. - /// For booleans, "true" or "false". - /// For strings, contains the default text contents (not escaped in any way). - /// For bytes, contains the C escaped value. All bytes >= 128 are escaped. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string DefaultValue { - get { return defaultValue_ ?? DefaultValueDefaultValue; } - set { - defaultValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "default_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDefaultValue { - get { return defaultValue_ != null; } - } - /// Clears the value of the "default_value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDefaultValue() { - defaultValue_ = null; - } - - /// Field number for the "oneof_index" field. - public const int OneofIndexFieldNumber = 9; - private readonly static int OneofIndexDefaultValue = 0; - - private int oneofIndex_; - /// - /// If set, gives the index of a oneof in the containing type's oneof_decl - /// list. This field is a member of that oneof. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int OneofIndex { - get { if ((_hasBits0 & 8) != 0) { return oneofIndex_; } else { return OneofIndexDefaultValue; } } - set { - _hasBits0 |= 8; - oneofIndex_ = value; - } - } - /// Gets whether the "oneof_index" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOneofIndex { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "oneof_index" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOneofIndex() { - _hasBits0 &= ~8; - } - - /// Field number for the "json_name" field. - public const int JsonNameFieldNumber = 10; - private readonly static string JsonNameDefaultValue = ""; - - private string jsonName_; - /// - /// JSON name of this field. The value is set by protocol compiler. If the - /// user has set a "json_name" option on this field, that option's value - /// will be used. Otherwise, it's deduced from the field's name by converting - /// it to camelCase. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JsonName { - get { return jsonName_ ?? JsonNameDefaultValue; } - set { - jsonName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "json_name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJsonName { - get { return jsonName_ != null; } - } - /// Clears the value of the "json_name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJsonName() { - jsonName_ = null; - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 8; - private global::Google.Protobuf.Reflection.FieldOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FieldOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - /// Field number for the "proto3_optional" field. - public const int Proto3OptionalFieldNumber = 17; - private readonly static bool Proto3OptionalDefaultValue = false; - - private bool proto3Optional_; - /// - /// If true, this is a proto3 "optional". When a proto3 field is optional, it - /// tracks presence regardless of field type. - /// - /// When proto3_optional is true, this field must be belong to a oneof to - /// signal to old proto3 clients that presence is tracked for this field. This - /// oneof is known as a "synthetic" oneof, and this field must be its sole - /// member (each proto3 optional field gets its own synthetic oneof). Synthetic - /// oneofs exist in the descriptor only, and do not generate any API. Synthetic - /// oneofs must be ordered after all "real" oneofs. - /// - /// For message fields, proto3_optional doesn't create any semantic change, - /// since non-repeated message fields always track presence. However it still - /// indicates the semantic detail of whether the user wrote "optional" or not. - /// This can be useful for round-tripping the .proto file. For consistency we - /// give message fields a synthetic oneof also, even though it is not required - /// to track presence. This is especially important because the parser can't - /// tell if a field is a message or an enum, so it must always create a - /// synthetic oneof. - /// - /// Proto2 optional fields do not set this flag, because they already indicate - /// optional with `LABEL_OPTIONAL`. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Proto3Optional { - get { if ((_hasBits0 & 16) != 0) { return proto3Optional_; } else { return Proto3OptionalDefaultValue; } } - set { - _hasBits0 |= 16; - proto3Optional_ = value; - } - } - /// Gets whether the "proto3_optional" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasProto3Optional { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "proto3_optional" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearProto3Optional() { - _hasBits0 &= ~16; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FieldDescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FieldDescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (Number != other.Number) return false; - if (Label != other.Label) return false; - if (Type != other.Type) return false; - if (TypeName != other.TypeName) return false; - if (Extendee != other.Extendee) return false; - if (DefaultValue != other.DefaultValue) return false; - if (OneofIndex != other.OneofIndex) return false; - if (JsonName != other.JsonName) return false; - if (!object.Equals(Options, other.Options)) return false; - if (Proto3Optional != other.Proto3Optional) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - if (HasNumber) hash ^= Number.GetHashCode(); - if (HasLabel) hash ^= Label.GetHashCode(); - if (HasType) hash ^= Type.GetHashCode(); - if (HasTypeName) hash ^= TypeName.GetHashCode(); - if (HasExtendee) hash ^= Extendee.GetHashCode(); - if (HasDefaultValue) hash ^= DefaultValue.GetHashCode(); - if (HasOneofIndex) hash ^= OneofIndex.GetHashCode(); - if (HasJsonName) hash ^= JsonName.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (HasProto3Optional) hash ^= Proto3Optional.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasExtendee) { - output.WriteRawTag(18); - output.WriteString(Extendee); - } - if (HasNumber) { - output.WriteRawTag(24); - output.WriteInt32(Number); - } - if (HasLabel) { - output.WriteRawTag(32); - output.WriteEnum((int) Label); - } - if (HasType) { - output.WriteRawTag(40); - output.WriteEnum((int) Type); - } - if (HasTypeName) { - output.WriteRawTag(50); - output.WriteString(TypeName); - } - if (HasDefaultValue) { - output.WriteRawTag(58); - output.WriteString(DefaultValue); - } - if (options_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Options); - } - if (HasOneofIndex) { - output.WriteRawTag(72); - output.WriteInt32(OneofIndex); - } - if (HasJsonName) { - output.WriteRawTag(82); - output.WriteString(JsonName); - } - if (HasProto3Optional) { - output.WriteRawTag(136, 1); - output.WriteBool(Proto3Optional); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasExtendee) { - output.WriteRawTag(18); - output.WriteString(Extendee); - } - if (HasNumber) { - output.WriteRawTag(24); - output.WriteInt32(Number); - } - if (HasLabel) { - output.WriteRawTag(32); - output.WriteEnum((int) Label); - } - if (HasType) { - output.WriteRawTag(40); - output.WriteEnum((int) Type); - } - if (HasTypeName) { - output.WriteRawTag(50); - output.WriteString(TypeName); - } - if (HasDefaultValue) { - output.WriteRawTag(58); - output.WriteString(DefaultValue); - } - if (options_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Options); - } - if (HasOneofIndex) { - output.WriteRawTag(72); - output.WriteInt32(OneofIndex); - } - if (HasJsonName) { - output.WriteRawTag(82); - output.WriteString(JsonName); - } - if (HasProto3Optional) { - output.WriteRawTag(136, 1); - output.WriteBool(Proto3Optional); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (HasNumber) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number); - } - if (HasLabel) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Label); - } - if (HasType) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); - } - if (HasTypeName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeName); - } - if (HasExtendee) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Extendee); - } - if (HasDefaultValue) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(DefaultValue); - } - if (HasOneofIndex) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(OneofIndex); - } - if (HasJsonName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName); - } - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (HasProto3Optional) { - size += 2 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FieldDescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasLabel) { - Label = other.Label; - } - if (other.HasType) { - Type = other.Type; - } - if (other.HasTypeName) { - TypeName = other.TypeName; - } - if (other.HasExtendee) { - Extendee = other.Extendee; - } - if (other.HasDefaultValue) { - DefaultValue = other.DefaultValue; - } - if (other.HasOneofIndex) { - OneofIndex = other.OneofIndex; - } - if (other.HasJsonName) { - JsonName = other.JsonName; - } - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.FieldOptions(); - } - Options.MergeFrom(other.Options); - } - if (other.HasProto3Optional) { - Proto3Optional = other.Proto3Optional; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Extendee = input.ReadString(); - break; - } - case 24: { - Number = input.ReadInt32(); - break; - } - case 32: { - Label = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) input.ReadEnum(); - break; - } - case 40: { - Type = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type) input.ReadEnum(); - break; - } - case 50: { - TypeName = input.ReadString(); - break; - } - case 58: { - DefaultValue = input.ReadString(); - break; - } - case 66: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.FieldOptions(); - } - input.ReadMessage(Options); - break; - } - case 72: { - OneofIndex = input.ReadInt32(); - break; - } - case 82: { - JsonName = input.ReadString(); - break; - } - case 136: { - Proto3Optional = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Extendee = input.ReadString(); - break; - } - case 24: { - Number = input.ReadInt32(); - break; - } - case 32: { - Label = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) input.ReadEnum(); - break; - } - case 40: { - Type = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type) input.ReadEnum(); - break; - } - case 50: { - TypeName = input.ReadString(); - break; - } - case 58: { - DefaultValue = input.ReadString(); - break; - } - case 66: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.FieldOptions(); - } - input.ReadMessage(Options); - break; - } - case 72: { - OneofIndex = input.ReadInt32(); - break; - } - case 82: { - JsonName = input.ReadString(); - break; - } - case 136: { - Proto3Optional = input.ReadBool(); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the FieldDescriptorProto message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum Type { - /// - /// 0 is reserved for errors. - /// Order is weird for historical reasons. - /// - [pbr::OriginalName("TYPE_DOUBLE")] Double = 1, - [pbr::OriginalName("TYPE_FLOAT")] Float = 2, - /// - /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - /// negative values are likely. - /// - [pbr::OriginalName("TYPE_INT64")] Int64 = 3, - [pbr::OriginalName("TYPE_UINT64")] Uint64 = 4, - /// - /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - /// negative values are likely. - /// - [pbr::OriginalName("TYPE_INT32")] Int32 = 5, - [pbr::OriginalName("TYPE_FIXED64")] Fixed64 = 6, - [pbr::OriginalName("TYPE_FIXED32")] Fixed32 = 7, - [pbr::OriginalName("TYPE_BOOL")] Bool = 8, - [pbr::OriginalName("TYPE_STRING")] String = 9, - /// - /// Tag-delimited aggregate. - /// Group type is deprecated and not supported after google.protobuf. However, Proto3 - /// implementations should still be able to parse the group wire format and - /// treat group fields as unknown fields. In Editions, the group wire format - /// can be enabled via the `message_encoding` feature. - /// - [pbr::OriginalName("TYPE_GROUP")] Group = 10, - /// - /// Length-delimited aggregate. - /// - [pbr::OriginalName("TYPE_MESSAGE")] Message = 11, - /// - /// New in version 2. - /// - [pbr::OriginalName("TYPE_BYTES")] Bytes = 12, - [pbr::OriginalName("TYPE_UINT32")] Uint32 = 13, - [pbr::OriginalName("TYPE_ENUM")] Enum = 14, - [pbr::OriginalName("TYPE_SFIXED32")] Sfixed32 = 15, - [pbr::OriginalName("TYPE_SFIXED64")] Sfixed64 = 16, - /// - /// Uses ZigZag encoding. - /// - [pbr::OriginalName("TYPE_SINT32")] Sint32 = 17, - /// - /// Uses ZigZag encoding. - /// - [pbr::OriginalName("TYPE_SINT64")] Sint64 = 18, - } - - public enum Label { - /// - /// 0 is reserved for errors - /// - [pbr::OriginalName("LABEL_OPTIONAL")] Optional = 1, - [pbr::OriginalName("LABEL_REPEATED")] Repeated = 3, - /// - /// The required label is only allowed in google.protobuf. In proto3 and Editions - /// it's explicitly prohibited. In Editions, the `field_presence` feature - /// can be used to get this behavior. - /// - [pbr::OriginalName("LABEL_REQUIRED")] Required = 2, - } - - } - #endregion - - } - - /// - /// Describes a oneof. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class OneofDescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofDescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofDescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofDescriptorProto(OneofDescriptorProto other) : this() { - name_ = other.name_; - options_ = other.options_ != null ? other.options_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofDescriptorProto Clone() { - return new OneofDescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 2; - private global::Google.Protobuf.Reflection.OneofOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.OneofOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OneofDescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OneofDescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (!object.Equals(Options, other.Options)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (options_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (options_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OneofDescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.OneofOptions(); - } - Options.MergeFrom(other.Options); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.OneofOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.OneofOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - } - #endif - - } - - /// - /// Describes an enum type. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumDescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumDescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumDescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumDescriptorProto(EnumDescriptorProto other) : this() { - name_ = other.name_; - value_ = other.value_.Clone(); - options_ = other.options_ != null ? other.options_.Clone() : null; - reservedRange_ = other.reservedRange_.Clone(); - reservedName_ = other.reservedName_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumDescriptorProto Clone() { - return new EnumDescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_value_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser); - private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Value { - get { return value_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 3; - private global::Google.Protobuf.Reflection.EnumOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.EnumOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - /// Field number for the "reserved_range" field. - public const int ReservedRangeFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_reservedRange_codec - = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange.Parser); - private readonly pbc::RepeatedField reservedRange_ = new pbc::RepeatedField(); - /// - /// Range of reserved numeric values. Reserved numeric values may not be used - /// by enum values in the same enum declaration. Reserved ranges may not - /// overlap. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField ReservedRange { - get { return reservedRange_; } - } - - /// Field number for the "reserved_name" field. - public const int ReservedNameFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_reservedName_codec - = pb::FieldCodec.ForString(42); - private readonly pbc::RepeatedField reservedName_ = new pbc::RepeatedField(); - /// - /// Reserved enum value names, which may not be reused. A given name may only - /// be reserved once. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField ReservedName { - get { return reservedName_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumDescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumDescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if(!value_.Equals(other.value_)) return false; - if (!object.Equals(Options, other.Options)) return false; - if(!reservedRange_.Equals(other.reservedRange_)) return false; - if(!reservedName_.Equals(other.reservedName_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - hash ^= value_.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - hash ^= reservedRange_.GetHashCode(); - hash ^= reservedName_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - value_.WriteTo(output, _repeated_value_codec); - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - reservedRange_.WriteTo(output, _repeated_reservedRange_codec); - reservedName_.WriteTo(output, _repeated_reservedName_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - value_.WriteTo(ref output, _repeated_value_codec); - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - reservedRange_.WriteTo(ref output, _repeated_reservedRange_codec); - reservedName_.WriteTo(ref output, _repeated_reservedName_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - size += value_.CalculateSize(_repeated_value_codec); - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - size += reservedRange_.CalculateSize(_repeated_reservedRange_codec); - size += reservedName_.CalculateSize(_repeated_reservedName_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumDescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - value_.Add(other.value_); - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.EnumOptions(); - } - Options.MergeFrom(other.Options); - } - reservedRange_.Add(other.reservedRange_); - reservedName_.Add(other.reservedName_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - value_.AddEntriesFrom(input, _repeated_value_codec); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.EnumOptions(); - } - input.ReadMessage(Options); - break; - } - case 34: { - reservedRange_.AddEntriesFrom(input, _repeated_reservedRange_codec); - break; - } - case 42: { - reservedName_.AddEntriesFrom(input, _repeated_reservedName_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - value_.AddEntriesFrom(ref input, _repeated_value_codec); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.EnumOptions(); - } - input.ReadMessage(Options); - break; - } - case 34: { - reservedRange_.AddEntriesFrom(ref input, _repeated_reservedRange_codec); - break; - } - case 42: { - reservedName_.AddEntriesFrom(ref input, _repeated_reservedName_codec); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the EnumDescriptorProto message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// Range of reserved numeric values. Reserved values may not be used by - /// entries in the same enum. Reserved ranges may not overlap. - /// - /// Note that this is distinct from DescriptorProto.ReservedRange in that it - /// is inclusive such that it can appropriately represent the entire int32 - /// domain. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumReservedRange : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumReservedRange()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.EnumDescriptorProto.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumReservedRange() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumReservedRange(EnumReservedRange other) : this() { - _hasBits0 = other._hasBits0; - start_ = other.start_; - end_ = other.end_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumReservedRange Clone() { - return new EnumReservedRange(this); - } - - /// Field number for the "start" field. - public const int StartFieldNumber = 1; - private readonly static int StartDefaultValue = 0; - - private int start_; - /// - /// Inclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Start { - get { if ((_hasBits0 & 1) != 0) { return start_; } else { return StartDefaultValue; } } - set { - _hasBits0 |= 1; - start_ = value; - } - } - /// Gets whether the "start" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasStart { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "start" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearStart() { - _hasBits0 &= ~1; - } - - /// Field number for the "end" field. - public const int EndFieldNumber = 2; - private readonly static int EndDefaultValue = 0; - - private int end_; - /// - /// Inclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int End { - get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } - set { - _hasBits0 |= 2; - end_ = value; - } - } - /// Gets whether the "end" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEnd { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "end" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEnd() { - _hasBits0 &= ~2; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumReservedRange); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumReservedRange other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Start != other.Start) return false; - if (End != other.End) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasStart) hash ^= Start.GetHashCode(); - if (HasEnd) hash ^= End.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasStart) { - output.WriteRawTag(8); - output.WriteInt32(Start); - } - if (HasEnd) { - output.WriteRawTag(16); - output.WriteInt32(End); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasStart) { - output.WriteRawTag(8); - output.WriteInt32(Start); - } - if (HasEnd) { - output.WriteRawTag(16); - output.WriteInt32(End); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasStart) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Start); - } - if (HasEnd) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(End); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumReservedRange other) { - if (other == null) { - return; - } - if (other.HasStart) { - Start = other.Start; - } - if (other.HasEnd) { - End = other.End; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Start = input.ReadInt32(); - break; - } - case 16: { - End = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Start = input.ReadInt32(); - break; - } - case 16: { - End = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - /// - /// Describes a value within an enum. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumValueDescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueDescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValueDescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValueDescriptorProto(EnumValueDescriptorProto other) : this() { - _hasBits0 = other._hasBits0; - name_ = other.name_; - number_ = other.number_; - options_ = other.options_ != null ? other.options_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValueDescriptorProto Clone() { - return new EnumValueDescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "number" field. - public const int NumberFieldNumber = 2; - private readonly static int NumberDefaultValue = 0; - - private int number_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Number { - get { if ((_hasBits0 & 1) != 0) { return number_; } else { return NumberDefaultValue; } } - set { - _hasBits0 |= 1; - number_ = value; - } - } - /// Gets whether the "number" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNumber { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "number" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNumber() { - _hasBits0 &= ~1; - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 3; - private global::Google.Protobuf.Reflection.EnumValueOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.EnumValueOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumValueDescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumValueDescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (Number != other.Number) return false; - if (!object.Equals(Options, other.Options)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - if (HasNumber) hash ^= Number.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasNumber) { - output.WriteRawTag(16); - output.WriteInt32(Number); - } - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasNumber) { - output.WriteRawTag(16); - output.WriteInt32(Number); - } - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (HasNumber) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number); - } - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumValueDescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.EnumValueOptions(); - } - Options.MergeFrom(other.Options); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Number = input.ReadInt32(); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.EnumValueOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Number = input.ReadInt32(); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.EnumValueOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - } - #endif - - } - - /// - /// Describes a service. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ServiceDescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceDescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServiceDescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServiceDescriptorProto(ServiceDescriptorProto other) : this() { - name_ = other.name_; - method_ = other.method_.Clone(); - options_ = other.options_ != null ? other.options_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServiceDescriptorProto Clone() { - return new ServiceDescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "method" field. - public const int MethodFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_method_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser); - private readonly pbc::RepeatedField method_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Method { - get { return method_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 3; - private global::Google.Protobuf.Reflection.ServiceOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.ServiceOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ServiceDescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ServiceDescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if(!method_.Equals(other.method_)) return false; - if (!object.Equals(Options, other.Options)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - hash ^= method_.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - method_.WriteTo(output, _repeated_method_codec); - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - method_.WriteTo(ref output, _repeated_method_codec); - if (options_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Options); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - size += method_.CalculateSize(_repeated_method_codec); - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ServiceDescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - method_.Add(other.method_); - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.ServiceOptions(); - } - Options.MergeFrom(other.Options); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - method_.AddEntriesFrom(input, _repeated_method_codec); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.ServiceOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - method_.AddEntriesFrom(ref input, _repeated_method_codec); - break; - } - case 26: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.ServiceOptions(); - } - input.ReadMessage(Options); - break; - } - } - } - } - #endif - - } - - /// - /// Describes a method of a service. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MethodDescriptorProto : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodDescriptorProto()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MethodDescriptorProto() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MethodDescriptorProto(MethodDescriptorProto other) : this() { - _hasBits0 = other._hasBits0; - name_ = other.name_; - inputType_ = other.inputType_; - outputType_ = other.outputType_; - options_ = other.options_ != null ? other.options_.Clone() : null; - clientStreaming_ = other.clientStreaming_; - serverStreaming_ = other.serverStreaming_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MethodDescriptorProto Clone() { - return new MethodDescriptorProto(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private readonly static string NameDefaultValue = ""; - - private string name_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_ ?? NameDefaultValue; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasName { - get { return name_ != null; } - } - /// Clears the value of the "name" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearName() { - name_ = null; - } - - /// Field number for the "input_type" field. - public const int InputTypeFieldNumber = 2; - private readonly static string InputTypeDefaultValue = ""; - - private string inputType_; - /// - /// Input and output type names. These are resolved in the same way as - /// FieldDescriptorProto.type_name, but must refer to a message type. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string InputType { - get { return inputType_ ?? InputTypeDefaultValue; } - set { - inputType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "input_type" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasInputType { - get { return inputType_ != null; } - } - /// Clears the value of the "input_type" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearInputType() { - inputType_ = null; - } - - /// Field number for the "output_type" field. - public const int OutputTypeFieldNumber = 3; - private readonly static string OutputTypeDefaultValue = ""; - - private string outputType_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string OutputType { - get { return outputType_ ?? OutputTypeDefaultValue; } - set { - outputType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "output_type" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOutputType { - get { return outputType_ != null; } - } - /// Clears the value of the "output_type" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOutputType() { - outputType_ = null; - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 4; - private global::Google.Protobuf.Reflection.MethodOptions options_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.MethodOptions Options { - get { return options_; } - set { - options_ = value; - } - } - - /// Field number for the "client_streaming" field. - public const int ClientStreamingFieldNumber = 5; - private readonly static bool ClientStreamingDefaultValue = false; - - private bool clientStreaming_; - /// - /// Identifies if client streams multiple client messages - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool ClientStreaming { - get { if ((_hasBits0 & 1) != 0) { return clientStreaming_; } else { return ClientStreamingDefaultValue; } } - set { - _hasBits0 |= 1; - clientStreaming_ = value; - } - } - /// Gets whether the "client_streaming" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasClientStreaming { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "client_streaming" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearClientStreaming() { - _hasBits0 &= ~1; - } - - /// Field number for the "server_streaming" field. - public const int ServerStreamingFieldNumber = 6; - private readonly static bool ServerStreamingDefaultValue = false; - - private bool serverStreaming_; - /// - /// Identifies if server streams multiple server messages - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool ServerStreaming { - get { if ((_hasBits0 & 2) != 0) { return serverStreaming_; } else { return ServerStreamingDefaultValue; } } - set { - _hasBits0 |= 2; - serverStreaming_ = value; - } - } - /// Gets whether the "server_streaming" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasServerStreaming { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "server_streaming" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearServerStreaming() { - _hasBits0 &= ~2; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MethodDescriptorProto); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MethodDescriptorProto other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (InputType != other.InputType) return false; - if (OutputType != other.OutputType) return false; - if (!object.Equals(Options, other.Options)) return false; - if (ClientStreaming != other.ClientStreaming) return false; - if (ServerStreaming != other.ServerStreaming) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasName) hash ^= Name.GetHashCode(); - if (HasInputType) hash ^= InputType.GetHashCode(); - if (HasOutputType) hash ^= OutputType.GetHashCode(); - if (options_ != null) hash ^= Options.GetHashCode(); - if (HasClientStreaming) hash ^= ClientStreaming.GetHashCode(); - if (HasServerStreaming) hash ^= ServerStreaming.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasInputType) { - output.WriteRawTag(18); - output.WriteString(InputType); - } - if (HasOutputType) { - output.WriteRawTag(26); - output.WriteString(OutputType); - } - if (options_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Options); - } - if (HasClientStreaming) { - output.WriteRawTag(40); - output.WriteBool(ClientStreaming); - } - if (HasServerStreaming) { - output.WriteRawTag(48); - output.WriteBool(ServerStreaming); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasName) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (HasInputType) { - output.WriteRawTag(18); - output.WriteString(InputType); - } - if (HasOutputType) { - output.WriteRawTag(26); - output.WriteString(OutputType); - } - if (options_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Options); - } - if (HasClientStreaming) { - output.WriteRawTag(40); - output.WriteBool(ClientStreaming); - } - if (HasServerStreaming) { - output.WriteRawTag(48); - output.WriteBool(ServerStreaming); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (HasInputType) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(InputType); - } - if (HasOutputType) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(OutputType); - } - if (options_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); - } - if (HasClientStreaming) { - size += 1 + 1; - } - if (HasServerStreaming) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MethodDescriptorProto other) { - if (other == null) { - return; - } - if (other.HasName) { - Name = other.Name; - } - if (other.HasInputType) { - InputType = other.InputType; - } - if (other.HasOutputType) { - OutputType = other.OutputType; - } - if (other.options_ != null) { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.MethodOptions(); - } - Options.MergeFrom(other.Options); - } - if (other.HasClientStreaming) { - ClientStreaming = other.ClientStreaming; - } - if (other.HasServerStreaming) { - ServerStreaming = other.ServerStreaming; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - InputType = input.ReadString(); - break; - } - case 26: { - OutputType = input.ReadString(); - break; - } - case 34: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.MethodOptions(); - } - input.ReadMessage(Options); - break; - } - case 40: { - ClientStreaming = input.ReadBool(); - break; - } - case 48: { - ServerStreaming = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - InputType = input.ReadString(); - break; - } - case 26: { - OutputType = input.ReadString(); - break; - } - case 34: { - if (options_ == null) { - Options = new global::Google.Protobuf.Reflection.MethodOptions(); - } - input.ReadMessage(Options); - break; - } - case 40: { - ClientStreaming = input.ReadBool(); - break; - } - case 48: { - ServerStreaming = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FileOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileOptions(FileOptions other) : this() { - _hasBits0 = other._hasBits0; - javaPackage_ = other.javaPackage_; - javaOuterClassname_ = other.javaOuterClassname_; - javaMultipleFiles_ = other.javaMultipleFiles_; - javaGenerateEqualsAndHash_ = other.javaGenerateEqualsAndHash_; - javaStringCheckUtf8_ = other.javaStringCheckUtf8_; - optimizeFor_ = other.optimizeFor_; - goPackage_ = other.goPackage_; - ccGenericServices_ = other.ccGenericServices_; - javaGenericServices_ = other.javaGenericServices_; - pyGenericServices_ = other.pyGenericServices_; - phpGenericServices_ = other.phpGenericServices_; - deprecated_ = other.deprecated_; - ccEnableArenas_ = other.ccEnableArenas_; - objcClassPrefix_ = other.objcClassPrefix_; - csharpNamespace_ = other.csharpNamespace_; - swiftPrefix_ = other.swiftPrefix_; - phpClassPrefix_ = other.phpClassPrefix_; - phpNamespace_ = other.phpNamespace_; - phpMetadataNamespace_ = other.phpMetadataNamespace_; - rubyPackage_ = other.rubyPackage_; - features_ = other.features_ != null ? other.features_.Clone() : null; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FileOptions Clone() { - return new FileOptions(this); - } - - /// Field number for the "java_package" field. - public const int JavaPackageFieldNumber = 1; - private readonly static string JavaPackageDefaultValue = ""; - - private string javaPackage_; - /// - /// Sets the Java package where classes generated from this .proto will be - /// placed. By default, the proto package is used, but this is often - /// inappropriate because proto packages do not normally start with backwards - /// domain names. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JavaPackage { - get { return javaPackage_ ?? JavaPackageDefaultValue; } - set { - javaPackage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "java_package" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJavaPackage { - get { return javaPackage_ != null; } - } - /// Clears the value of the "java_package" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJavaPackage() { - javaPackage_ = null; - } - - /// Field number for the "java_outer_classname" field. - public const int JavaOuterClassnameFieldNumber = 8; - private readonly static string JavaOuterClassnameDefaultValue = ""; - - private string javaOuterClassname_; - /// - /// Controls the name of the wrapper Java class generated for the .proto file. - /// That class will always contain the .proto file's getDescriptor() method as - /// well as any top-level extensions defined in the .proto file. - /// If java_multiple_files is disabled, then all the other classes from the - /// .proto file will be nested inside the single wrapper outer class. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JavaOuterClassname { - get { return javaOuterClassname_ ?? JavaOuterClassnameDefaultValue; } - set { - javaOuterClassname_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "java_outer_classname" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJavaOuterClassname { - get { return javaOuterClassname_ != null; } - } - /// Clears the value of the "java_outer_classname" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJavaOuterClassname() { - javaOuterClassname_ = null; - } - - /// Field number for the "java_multiple_files" field. - public const int JavaMultipleFilesFieldNumber = 10; - private readonly static bool JavaMultipleFilesDefaultValue = false; - - private bool javaMultipleFiles_; - /// - /// If enabled, then the Java code generator will generate a separate .java - /// file for each top-level message, enum, and service defined in the .proto - /// file. Thus, these types will *not* be nested inside the wrapper class - /// named by java_outer_classname. However, the wrapper class will still be - /// generated to contain the file's getDescriptor() method as well as any - /// top-level extensions defined in the file. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool JavaMultipleFiles { - get { if ((_hasBits0 & 2) != 0) { return javaMultipleFiles_; } else { return JavaMultipleFilesDefaultValue; } } - set { - _hasBits0 |= 2; - javaMultipleFiles_ = value; - } - } - /// Gets whether the "java_multiple_files" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJavaMultipleFiles { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "java_multiple_files" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJavaMultipleFiles() { - _hasBits0 &= ~2; - } - - /// Field number for the "java_generate_equals_and_hash" field. - public const int JavaGenerateEqualsAndHashFieldNumber = 20; - private readonly static bool JavaGenerateEqualsAndHashDefaultValue = false; - - private bool javaGenerateEqualsAndHash_; - /// - /// This option does nothing. - /// - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool JavaGenerateEqualsAndHash { - get { if ((_hasBits0 & 32) != 0) { return javaGenerateEqualsAndHash_; } else { return JavaGenerateEqualsAndHashDefaultValue; } } - set { - _hasBits0 |= 32; - javaGenerateEqualsAndHash_ = value; - } - } - /// Gets whether the "java_generate_equals_and_hash" field is set - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJavaGenerateEqualsAndHash { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "java_generate_equals_and_hash" field - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJavaGenerateEqualsAndHash() { - _hasBits0 &= ~32; - } - - /// Field number for the "java_string_check_utf8" field. - public const int JavaStringCheckUtf8FieldNumber = 27; - private readonly static bool JavaStringCheckUtf8DefaultValue = false; - - private bool javaStringCheckUtf8_; - /// - /// If set true, then the Java2 code generator will generate code that - /// throws an exception whenever an attempt is made to assign a non-UTF-8 - /// byte sequence to a string field. - /// Message reflection will do the same. - /// However, an extension field still accepts non-UTF-8 byte sequences. - /// This option has no effect on when used with the lite runtime. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool JavaStringCheckUtf8 { - get { if ((_hasBits0 & 128) != 0) { return javaStringCheckUtf8_; } else { return JavaStringCheckUtf8DefaultValue; } } - set { - _hasBits0 |= 128; - javaStringCheckUtf8_ = value; - } - } - /// Gets whether the "java_string_check_utf8" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJavaStringCheckUtf8 { - get { return (_hasBits0 & 128) != 0; } - } - /// Clears the value of the "java_string_check_utf8" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJavaStringCheckUtf8() { - _hasBits0 &= ~128; - } - - /// Field number for the "optimize_for" field. - public const int OptimizeForFieldNumber = 9; - private readonly static global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeForDefaultValue = global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.Speed; - - private global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode optimizeFor_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeFor { - get { if ((_hasBits0 & 1) != 0) { return optimizeFor_; } else { return OptimizeForDefaultValue; } } - set { - _hasBits0 |= 1; - optimizeFor_ = value; - } - } - /// Gets whether the "optimize_for" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasOptimizeFor { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "optimize_for" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearOptimizeFor() { - _hasBits0 &= ~1; - } - - /// Field number for the "go_package" field. - public const int GoPackageFieldNumber = 11; - private readonly static string GoPackageDefaultValue = ""; - - private string goPackage_; - /// - /// Sets the Go package where structs generated from this .proto will be - /// placed. If omitted, the Go package will be derived from the following: - /// - The basename of the package import path, if provided. - /// - Otherwise, the package statement in the .proto file, if present. - /// - Otherwise, the basename of the .proto file, without extension. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string GoPackage { - get { return goPackage_ ?? GoPackageDefaultValue; } - set { - goPackage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "go_package" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasGoPackage { - get { return goPackage_ != null; } - } - /// Clears the value of the "go_package" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearGoPackage() { - goPackage_ = null; - } - - /// Field number for the "cc_generic_services" field. - public const int CcGenericServicesFieldNumber = 16; - private readonly static bool CcGenericServicesDefaultValue = false; - - private bool ccGenericServices_; - /// - /// Should generic services be generated in each language? "Generic" services - /// are not specific to any particular RPC system. They are generated by the - /// main code generators in each language (without additional plugins). - /// Generic services were the only kind of service generation supported by - /// early versions of google.protobuf. - /// - /// Generic services are now considered deprecated in favor of using plugins - /// that generate code specific to your particular RPC system. Therefore, - /// these default to false. Old code which depends on generic services should - /// explicitly set them to true. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool CcGenericServices { - get { if ((_hasBits0 & 4) != 0) { return ccGenericServices_; } else { return CcGenericServicesDefaultValue; } } - set { - _hasBits0 |= 4; - ccGenericServices_ = value; - } - } - /// Gets whether the "cc_generic_services" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasCcGenericServices { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "cc_generic_services" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearCcGenericServices() { - _hasBits0 &= ~4; - } - - /// Field number for the "java_generic_services" field. - public const int JavaGenericServicesFieldNumber = 17; - private readonly static bool JavaGenericServicesDefaultValue = false; - - private bool javaGenericServices_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool JavaGenericServices { - get { if ((_hasBits0 & 8) != 0) { return javaGenericServices_; } else { return JavaGenericServicesDefaultValue; } } - set { - _hasBits0 |= 8; - javaGenericServices_ = value; - } - } - /// Gets whether the "java_generic_services" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJavaGenericServices { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "java_generic_services" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJavaGenericServices() { - _hasBits0 &= ~8; - } - - /// Field number for the "py_generic_services" field. - public const int PyGenericServicesFieldNumber = 18; - private readonly static bool PyGenericServicesDefaultValue = false; - - private bool pyGenericServices_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool PyGenericServices { - get { if ((_hasBits0 & 16) != 0) { return pyGenericServices_; } else { return PyGenericServicesDefaultValue; } } - set { - _hasBits0 |= 16; - pyGenericServices_ = value; - } - } - /// Gets whether the "py_generic_services" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPyGenericServices { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "py_generic_services" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPyGenericServices() { - _hasBits0 &= ~16; - } - - /// Field number for the "php_generic_services" field. - public const int PhpGenericServicesFieldNumber = 42; - private readonly static bool PhpGenericServicesDefaultValue = false; - - private bool phpGenericServices_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool PhpGenericServices { - get { if ((_hasBits0 & 512) != 0) { return phpGenericServices_; } else { return PhpGenericServicesDefaultValue; } } - set { - _hasBits0 |= 512; - phpGenericServices_ = value; - } - } - /// Gets whether the "php_generic_services" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPhpGenericServices { - get { return (_hasBits0 & 512) != 0; } - } - /// Clears the value of the "php_generic_services" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPhpGenericServices() { - _hasBits0 &= ~512; - } - - /// Field number for the "deprecated" field. - public const int DeprecatedFieldNumber = 23; - private readonly static bool DeprecatedDefaultValue = false; - - private bool deprecated_; - /// - /// Is this file deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for everything in the file, or it will be completely ignored; in the very - /// least, this is a formalization for deprecating files. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deprecated { - get { if ((_hasBits0 & 64) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } - set { - _hasBits0 |= 64; - deprecated_ = value; - } - } - /// Gets whether the "deprecated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecated { - get { return (_hasBits0 & 64) != 0; } - } - /// Clears the value of the "deprecated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecated() { - _hasBits0 &= ~64; - } - - /// Field number for the "cc_enable_arenas" field. - public const int CcEnableArenasFieldNumber = 31; - private readonly static bool CcEnableArenasDefaultValue = true; - - private bool ccEnableArenas_; - /// - /// Enables the use of arenas for the proto messages in this file. This applies - /// only to generated classes for C++. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool CcEnableArenas { - get { if ((_hasBits0 & 256) != 0) { return ccEnableArenas_; } else { return CcEnableArenasDefaultValue; } } - set { - _hasBits0 |= 256; - ccEnableArenas_ = value; - } - } - /// Gets whether the "cc_enable_arenas" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasCcEnableArenas { - get { return (_hasBits0 & 256) != 0; } - } - /// Clears the value of the "cc_enable_arenas" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearCcEnableArenas() { - _hasBits0 &= ~256; - } - - /// Field number for the "objc_class_prefix" field. - public const int ObjcClassPrefixFieldNumber = 36; - private readonly static string ObjcClassPrefixDefaultValue = ""; - - private string objcClassPrefix_; - /// - /// Sets the objective c class prefix which is prepended to all objective c - /// generated classes from this .proto. There is no default. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ObjcClassPrefix { - get { return objcClassPrefix_ ?? ObjcClassPrefixDefaultValue; } - set { - objcClassPrefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "objc_class_prefix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasObjcClassPrefix { - get { return objcClassPrefix_ != null; } - } - /// Clears the value of the "objc_class_prefix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearObjcClassPrefix() { - objcClassPrefix_ = null; - } - - /// Field number for the "csharp_namespace" field. - public const int CsharpNamespaceFieldNumber = 37; - private readonly static string CsharpNamespaceDefaultValue = ""; - - private string csharpNamespace_; - /// - /// Namespace for generated classes; defaults to the package. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string CsharpNamespace { - get { return csharpNamespace_ ?? CsharpNamespaceDefaultValue; } - set { - csharpNamespace_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "csharp_namespace" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasCsharpNamespace { - get { return csharpNamespace_ != null; } - } - /// Clears the value of the "csharp_namespace" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearCsharpNamespace() { - csharpNamespace_ = null; - } - - /// Field number for the "swift_prefix" field. - public const int SwiftPrefixFieldNumber = 39; - private readonly static string SwiftPrefixDefaultValue = ""; - - private string swiftPrefix_; - /// - /// By default Swift generators will take the proto package and CamelCase it - /// replacing '.' with underscore and use that to prefix the types/symbols - /// defined. When this options is provided, they will use this value instead - /// to prefix the types/symbols defined. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string SwiftPrefix { - get { return swiftPrefix_ ?? SwiftPrefixDefaultValue; } - set { - swiftPrefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "swift_prefix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSwiftPrefix { - get { return swiftPrefix_ != null; } - } - /// Clears the value of the "swift_prefix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSwiftPrefix() { - swiftPrefix_ = null; - } - - /// Field number for the "php_class_prefix" field. - public const int PhpClassPrefixFieldNumber = 40; - private readonly static string PhpClassPrefixDefaultValue = ""; - - private string phpClassPrefix_; - /// - /// Sets the php class prefix which is prepended to all php generated classes - /// from this .proto. Default is empty. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string PhpClassPrefix { - get { return phpClassPrefix_ ?? PhpClassPrefixDefaultValue; } - set { - phpClassPrefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "php_class_prefix" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPhpClassPrefix { - get { return phpClassPrefix_ != null; } - } - /// Clears the value of the "php_class_prefix" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPhpClassPrefix() { - phpClassPrefix_ = null; - } - - /// Field number for the "php_namespace" field. - public const int PhpNamespaceFieldNumber = 41; - private readonly static string PhpNamespaceDefaultValue = ""; - - private string phpNamespace_; - /// - /// Use this option to change the namespace of php generated classes. Default - /// is empty. When this option is empty, the package name will be used for - /// determining the namespace. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string PhpNamespace { - get { return phpNamespace_ ?? PhpNamespaceDefaultValue; } - set { - phpNamespace_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "php_namespace" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPhpNamespace { - get { return phpNamespace_ != null; } - } - /// Clears the value of the "php_namespace" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPhpNamespace() { - phpNamespace_ = null; - } - - /// Field number for the "php_metadata_namespace" field. - public const int PhpMetadataNamespaceFieldNumber = 44; - private readonly static string PhpMetadataNamespaceDefaultValue = ""; - - private string phpMetadataNamespace_; - /// - /// Use this option to change the namespace of php generated metadata classes. - /// Default is empty. When this option is empty, the proto file name will be - /// used for determining the namespace. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string PhpMetadataNamespace { - get { return phpMetadataNamespace_ ?? PhpMetadataNamespaceDefaultValue; } - set { - phpMetadataNamespace_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "php_metadata_namespace" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPhpMetadataNamespace { - get { return phpMetadataNamespace_ != null; } - } - /// Clears the value of the "php_metadata_namespace" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPhpMetadataNamespace() { - phpMetadataNamespace_ = null; - } - - /// Field number for the "ruby_package" field. - public const int RubyPackageFieldNumber = 45; - private readonly static string RubyPackageDefaultValue = ""; - - private string rubyPackage_; - /// - /// Use this option to change the package of ruby generated classes. Default - /// is empty. When this option is not set, the package name will be used for - /// determining the ruby package. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string RubyPackage { - get { return rubyPackage_ ?? RubyPackageDefaultValue; } - set { - rubyPackage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "ruby_package" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRubyPackage { - get { return rubyPackage_ != null; } - } - /// Clears the value of the "ruby_package" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRubyPackage() { - rubyPackage_ = null; - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 50; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. - /// See the documentation for the "Options" section above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FileOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FileOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (JavaPackage != other.JavaPackage) return false; - if (JavaOuterClassname != other.JavaOuterClassname) return false; - if (JavaMultipleFiles != other.JavaMultipleFiles) return false; - if (JavaGenerateEqualsAndHash != other.JavaGenerateEqualsAndHash) return false; - if (JavaStringCheckUtf8 != other.JavaStringCheckUtf8) return false; - if (OptimizeFor != other.OptimizeFor) return false; - if (GoPackage != other.GoPackage) return false; - if (CcGenericServices != other.CcGenericServices) return false; - if (JavaGenericServices != other.JavaGenericServices) return false; - if (PyGenericServices != other.PyGenericServices) return false; - if (PhpGenericServices != other.PhpGenericServices) return false; - if (Deprecated != other.Deprecated) return false; - if (CcEnableArenas != other.CcEnableArenas) return false; - if (ObjcClassPrefix != other.ObjcClassPrefix) return false; - if (CsharpNamespace != other.CsharpNamespace) return false; - if (SwiftPrefix != other.SwiftPrefix) return false; - if (PhpClassPrefix != other.PhpClassPrefix) return false; - if (PhpNamespace != other.PhpNamespace) return false; - if (PhpMetadataNamespace != other.PhpMetadataNamespace) return false; - if (RubyPackage != other.RubyPackage) return false; - if (!object.Equals(Features, other.Features)) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasJavaPackage) hash ^= JavaPackage.GetHashCode(); - if (HasJavaOuterClassname) hash ^= JavaOuterClassname.GetHashCode(); - if (HasJavaMultipleFiles) hash ^= JavaMultipleFiles.GetHashCode(); - if (HasJavaGenerateEqualsAndHash) hash ^= JavaGenerateEqualsAndHash.GetHashCode(); - if (HasJavaStringCheckUtf8) hash ^= JavaStringCheckUtf8.GetHashCode(); - if (HasOptimizeFor) hash ^= OptimizeFor.GetHashCode(); - if (HasGoPackage) hash ^= GoPackage.GetHashCode(); - if (HasCcGenericServices) hash ^= CcGenericServices.GetHashCode(); - if (HasJavaGenericServices) hash ^= JavaGenericServices.GetHashCode(); - if (HasPyGenericServices) hash ^= PyGenericServices.GetHashCode(); - if (HasPhpGenericServices) hash ^= PhpGenericServices.GetHashCode(); - if (HasDeprecated) hash ^= Deprecated.GetHashCode(); - if (HasCcEnableArenas) hash ^= CcEnableArenas.GetHashCode(); - if (HasObjcClassPrefix) hash ^= ObjcClassPrefix.GetHashCode(); - if (HasCsharpNamespace) hash ^= CsharpNamespace.GetHashCode(); - if (HasSwiftPrefix) hash ^= SwiftPrefix.GetHashCode(); - if (HasPhpClassPrefix) hash ^= PhpClassPrefix.GetHashCode(); - if (HasPhpNamespace) hash ^= PhpNamespace.GetHashCode(); - if (HasPhpMetadataNamespace) hash ^= PhpMetadataNamespace.GetHashCode(); - if (HasRubyPackage) hash ^= RubyPackage.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasJavaPackage) { - output.WriteRawTag(10); - output.WriteString(JavaPackage); - } - if (HasJavaOuterClassname) { - output.WriteRawTag(66); - output.WriteString(JavaOuterClassname); - } - if (HasOptimizeFor) { - output.WriteRawTag(72); - output.WriteEnum((int) OptimizeFor); - } - if (HasJavaMultipleFiles) { - output.WriteRawTag(80); - output.WriteBool(JavaMultipleFiles); - } - if (HasGoPackage) { - output.WriteRawTag(90); - output.WriteString(GoPackage); - } - if (HasCcGenericServices) { - output.WriteRawTag(128, 1); - output.WriteBool(CcGenericServices); - } - if (HasJavaGenericServices) { - output.WriteRawTag(136, 1); - output.WriteBool(JavaGenericServices); - } - if (HasPyGenericServices) { - output.WriteRawTag(144, 1); - output.WriteBool(PyGenericServices); - } - if (HasJavaGenerateEqualsAndHash) { - output.WriteRawTag(160, 1); - output.WriteBool(JavaGenerateEqualsAndHash); - } - if (HasDeprecated) { - output.WriteRawTag(184, 1); - output.WriteBool(Deprecated); - } - if (HasJavaStringCheckUtf8) { - output.WriteRawTag(216, 1); - output.WriteBool(JavaStringCheckUtf8); - } - if (HasCcEnableArenas) { - output.WriteRawTag(248, 1); - output.WriteBool(CcEnableArenas); - } - if (HasObjcClassPrefix) { - output.WriteRawTag(162, 2); - output.WriteString(ObjcClassPrefix); - } - if (HasCsharpNamespace) { - output.WriteRawTag(170, 2); - output.WriteString(CsharpNamespace); - } - if (HasSwiftPrefix) { - output.WriteRawTag(186, 2); - output.WriteString(SwiftPrefix); - } - if (HasPhpClassPrefix) { - output.WriteRawTag(194, 2); - output.WriteString(PhpClassPrefix); - } - if (HasPhpNamespace) { - output.WriteRawTag(202, 2); - output.WriteString(PhpNamespace); - } - if (HasPhpGenericServices) { - output.WriteRawTag(208, 2); - output.WriteBool(PhpGenericServices); - } - if (HasPhpMetadataNamespace) { - output.WriteRawTag(226, 2); - output.WriteString(PhpMetadataNamespace); - } - if (HasRubyPackage) { - output.WriteRawTag(234, 2); - output.WriteString(RubyPackage); - } - if (features_ != null) { - output.WriteRawTag(146, 3); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasJavaPackage) { - output.WriteRawTag(10); - output.WriteString(JavaPackage); - } - if (HasJavaOuterClassname) { - output.WriteRawTag(66); - output.WriteString(JavaOuterClassname); - } - if (HasOptimizeFor) { - output.WriteRawTag(72); - output.WriteEnum((int) OptimizeFor); - } - if (HasJavaMultipleFiles) { - output.WriteRawTag(80); - output.WriteBool(JavaMultipleFiles); - } - if (HasGoPackage) { - output.WriteRawTag(90); - output.WriteString(GoPackage); - } - if (HasCcGenericServices) { - output.WriteRawTag(128, 1); - output.WriteBool(CcGenericServices); - } - if (HasJavaGenericServices) { - output.WriteRawTag(136, 1); - output.WriteBool(JavaGenericServices); - } - if (HasPyGenericServices) { - output.WriteRawTag(144, 1); - output.WriteBool(PyGenericServices); - } - if (HasJavaGenerateEqualsAndHash) { - output.WriteRawTag(160, 1); - output.WriteBool(JavaGenerateEqualsAndHash); - } - if (HasDeprecated) { - output.WriteRawTag(184, 1); - output.WriteBool(Deprecated); - } - if (HasJavaStringCheckUtf8) { - output.WriteRawTag(216, 1); - output.WriteBool(JavaStringCheckUtf8); - } - if (HasCcEnableArenas) { - output.WriteRawTag(248, 1); - output.WriteBool(CcEnableArenas); - } - if (HasObjcClassPrefix) { - output.WriteRawTag(162, 2); - output.WriteString(ObjcClassPrefix); - } - if (HasCsharpNamespace) { - output.WriteRawTag(170, 2); - output.WriteString(CsharpNamespace); - } - if (HasSwiftPrefix) { - output.WriteRawTag(186, 2); - output.WriteString(SwiftPrefix); - } - if (HasPhpClassPrefix) { - output.WriteRawTag(194, 2); - output.WriteString(PhpClassPrefix); - } - if (HasPhpNamespace) { - output.WriteRawTag(202, 2); - output.WriteString(PhpNamespace); - } - if (HasPhpGenericServices) { - output.WriteRawTag(208, 2); - output.WriteBool(PhpGenericServices); - } - if (HasPhpMetadataNamespace) { - output.WriteRawTag(226, 2); - output.WriteString(PhpMetadataNamespace); - } - if (HasRubyPackage) { - output.WriteRawTag(234, 2); - output.WriteString(RubyPackage); - } - if (features_ != null) { - output.WriteRawTag(146, 3); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasJavaPackage) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JavaPackage); - } - if (HasJavaOuterClassname) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JavaOuterClassname); - } - if (HasJavaMultipleFiles) { - size += 1 + 1; - } - if (HasJavaGenerateEqualsAndHash) { - size += 2 + 1; - } - if (HasJavaStringCheckUtf8) { - size += 2 + 1; - } - if (HasOptimizeFor) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OptimizeFor); - } - if (HasGoPackage) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(GoPackage); - } - if (HasCcGenericServices) { - size += 2 + 1; - } - if (HasJavaGenericServices) { - size += 2 + 1; - } - if (HasPyGenericServices) { - size += 2 + 1; - } - if (HasPhpGenericServices) { - size += 2 + 1; - } - if (HasDeprecated) { - size += 2 + 1; - } - if (HasCcEnableArenas) { - size += 2 + 1; - } - if (HasObjcClassPrefix) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(ObjcClassPrefix); - } - if (HasCsharpNamespace) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(CsharpNamespace); - } - if (HasSwiftPrefix) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(SwiftPrefix); - } - if (HasPhpClassPrefix) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(PhpClassPrefix); - } - if (HasPhpNamespace) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(PhpNamespace); - } - if (HasPhpMetadataNamespace) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(PhpMetadataNamespace); - } - if (HasRubyPackage) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(RubyPackage); - } - if (features_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FileOptions other) { - if (other == null) { - return; - } - if (other.HasJavaPackage) { - JavaPackage = other.JavaPackage; - } - if (other.HasJavaOuterClassname) { - JavaOuterClassname = other.JavaOuterClassname; - } - if (other.HasJavaMultipleFiles) { - JavaMultipleFiles = other.JavaMultipleFiles; - } - if (other.HasJavaGenerateEqualsAndHash) { - JavaGenerateEqualsAndHash = other.JavaGenerateEqualsAndHash; - } - if (other.HasJavaStringCheckUtf8) { - JavaStringCheckUtf8 = other.JavaStringCheckUtf8; - } - if (other.HasOptimizeFor) { - OptimizeFor = other.OptimizeFor; - } - if (other.HasGoPackage) { - GoPackage = other.GoPackage; - } - if (other.HasCcGenericServices) { - CcGenericServices = other.CcGenericServices; - } - if (other.HasJavaGenericServices) { - JavaGenericServices = other.JavaGenericServices; - } - if (other.HasPyGenericServices) { - PyGenericServices = other.PyGenericServices; - } - if (other.HasPhpGenericServices) { - PhpGenericServices = other.PhpGenericServices; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasCcEnableArenas) { - CcEnableArenas = other.CcEnableArenas; - } - if (other.HasObjcClassPrefix) { - ObjcClassPrefix = other.ObjcClassPrefix; - } - if (other.HasCsharpNamespace) { - CsharpNamespace = other.CsharpNamespace; - } - if (other.HasSwiftPrefix) { - SwiftPrefix = other.SwiftPrefix; - } - if (other.HasPhpClassPrefix) { - PhpClassPrefix = other.PhpClassPrefix; - } - if (other.HasPhpNamespace) { - PhpNamespace = other.PhpNamespace; - } - if (other.HasPhpMetadataNamespace) { - PhpMetadataNamespace = other.PhpMetadataNamespace; - } - if (other.HasRubyPackage) { - RubyPackage = other.RubyPackage; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 10: { - JavaPackage = input.ReadString(); - break; - } - case 66: { - JavaOuterClassname = input.ReadString(); - break; - } - case 72: { - OptimizeFor = (global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) input.ReadEnum(); - break; - } - case 80: { - JavaMultipleFiles = input.ReadBool(); - break; - } - case 90: { - GoPackage = input.ReadString(); - break; - } - case 128: { - CcGenericServices = input.ReadBool(); - break; - } - case 136: { - JavaGenericServices = input.ReadBool(); - break; - } - case 144: { - PyGenericServices = input.ReadBool(); - break; - } - case 160: { - JavaGenerateEqualsAndHash = input.ReadBool(); - break; - } - case 184: { - Deprecated = input.ReadBool(); - break; - } - case 216: { - JavaStringCheckUtf8 = input.ReadBool(); - break; - } - case 248: { - CcEnableArenas = input.ReadBool(); - break; - } - case 290: { - ObjcClassPrefix = input.ReadString(); - break; - } - case 298: { - CsharpNamespace = input.ReadString(); - break; - } - case 314: { - SwiftPrefix = input.ReadString(); - break; - } - case 322: { - PhpClassPrefix = input.ReadString(); - break; - } - case 330: { - PhpNamespace = input.ReadString(); - break; - } - case 336: { - PhpGenericServices = input.ReadBool(); - break; - } - case 354: { - PhpMetadataNamespace = input.ReadString(); - break; - } - case 362: { - RubyPackage = input.ReadString(); - break; - } - case 402: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 10: { - JavaPackage = input.ReadString(); - break; - } - case 66: { - JavaOuterClassname = input.ReadString(); - break; - } - case 72: { - OptimizeFor = (global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) input.ReadEnum(); - break; - } - case 80: { - JavaMultipleFiles = input.ReadBool(); - break; - } - case 90: { - GoPackage = input.ReadString(); - break; - } - case 128: { - CcGenericServices = input.ReadBool(); - break; - } - case 136: { - JavaGenericServices = input.ReadBool(); - break; - } - case 144: { - PyGenericServices = input.ReadBool(); - break; - } - case 160: { - JavaGenerateEqualsAndHash = input.ReadBool(); - break; - } - case 184: { - Deprecated = input.ReadBool(); - break; - } - case 216: { - JavaStringCheckUtf8 = input.ReadBool(); - break; - } - case 248: { - CcEnableArenas = input.ReadBool(); - break; - } - case 290: { - ObjcClassPrefix = input.ReadString(); - break; - } - case 298: { - CsharpNamespace = input.ReadString(); - break; - } - case 314: { - SwiftPrefix = input.ReadString(); - break; - } - case 322: { - PhpClassPrefix = input.ReadString(); - break; - } - case 330: { - PhpNamespace = input.ReadString(); - break; - } - case 336: { - PhpGenericServices = input.ReadBool(); - break; - } - case 354: { - PhpMetadataNamespace = input.ReadString(); - break; - } - case 362: { - RubyPackage = input.ReadString(); - break; - } - case 402: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - #region Nested types - /// Container for nested types declared in the FileOptions message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// Generated classes can be optimized for speed or code size. - /// - public enum OptimizeMode { - /// - /// Generate complete code for parsing, serialization, - /// - [pbr::OriginalName("SPEED")] Speed = 1, - /// - /// etc. - /// - [pbr::OriginalName("CODE_SIZE")] CodeSize = 2, - /// - /// Generate code using MessageLite and the lite runtime. - /// - [pbr::OriginalName("LITE_RUNTIME")] LiteRuntime = 3, - } - - } - #endregion - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MessageOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageOptions(MessageOptions other) : this() { - _hasBits0 = other._hasBits0; - messageSetWireFormat_ = other.messageSetWireFormat_; - noStandardDescriptorAccessor_ = other.noStandardDescriptorAccessor_; - deprecated_ = other.deprecated_; - mapEntry_ = other.mapEntry_; - deprecatedLegacyJsonFieldConflicts_ = other.deprecatedLegacyJsonFieldConflicts_; - features_ = other.features_ != null ? other.features_.Clone() : null; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MessageOptions Clone() { - return new MessageOptions(this); - } - - /// Field number for the "message_set_wire_format" field. - public const int MessageSetWireFormatFieldNumber = 1; - private readonly static bool MessageSetWireFormatDefaultValue = false; - - private bool messageSetWireFormat_; - /// - /// Set true to use the old proto1 MessageSet wire format for extensions. - /// This is provided for backwards-compatibility with the MessageSet wire - /// format. You should not use this for any other reason: It's less - /// efficient, has fewer features, and is more complicated. - /// - /// The message must be defined exactly as follows: - /// message Foo { - /// option message_set_wire_format = true; - /// extensions 4 to max; - /// } - /// Note that the message cannot have any defined fields; MessageSets only - /// have extensions. - /// - /// All extensions of your type must be singular messages; e.g. they cannot - /// be int32s, enums, or repeated messages. - /// - /// Because this is an option, the above two restrictions are not enforced by - /// the protocol compiler. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool MessageSetWireFormat { - get { if ((_hasBits0 & 1) != 0) { return messageSetWireFormat_; } else { return MessageSetWireFormatDefaultValue; } } - set { - _hasBits0 |= 1; - messageSetWireFormat_ = value; - } - } - /// Gets whether the "message_set_wire_format" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasMessageSetWireFormat { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "message_set_wire_format" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMessageSetWireFormat() { - _hasBits0 &= ~1; - } - - /// Field number for the "no_standard_descriptor_accessor" field. - public const int NoStandardDescriptorAccessorFieldNumber = 2; - private readonly static bool NoStandardDescriptorAccessorDefaultValue = false; - - private bool noStandardDescriptorAccessor_; - /// - /// Disables the generation of the standard "descriptor()" accessor, which can - /// conflict with a field of the same name. This is meant to make migration - /// from proto1 easier; new code should avoid fields named "descriptor". - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool NoStandardDescriptorAccessor { - get { if ((_hasBits0 & 2) != 0) { return noStandardDescriptorAccessor_; } else { return NoStandardDescriptorAccessorDefaultValue; } } - set { - _hasBits0 |= 2; - noStandardDescriptorAccessor_ = value; - } - } - /// Gets whether the "no_standard_descriptor_accessor" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNoStandardDescriptorAccessor { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "no_standard_descriptor_accessor" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNoStandardDescriptorAccessor() { - _hasBits0 &= ~2; - } - - /// Field number for the "deprecated" field. - public const int DeprecatedFieldNumber = 3; - private readonly static bool DeprecatedDefaultValue = false; - - private bool deprecated_; - /// - /// Is this message deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the message, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating messages. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deprecated { - get { if ((_hasBits0 & 4) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } - set { - _hasBits0 |= 4; - deprecated_ = value; - } - } - /// Gets whether the "deprecated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecated { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "deprecated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecated() { - _hasBits0 &= ~4; - } - - /// Field number for the "map_entry" field. - public const int MapEntryFieldNumber = 7; - private readonly static bool MapEntryDefaultValue = false; - - private bool mapEntry_; - /// - /// NOTE: Do not set the option in .proto files. Always use the maps syntax - /// instead. The option should only be implicitly set by the proto compiler - /// parser. - /// - /// Whether the message is an automatically generated map entry type for the - /// maps field. - /// - /// For maps fields: - /// map<KeyType, ValueType> map_field = 1; - /// The parsed descriptor looks like: - /// message MapFieldEntry { - /// option map_entry = true; - /// optional KeyType key = 1; - /// optional ValueType value = 2; - /// } - /// repeated MapFieldEntry map_field = 1; - /// - /// Implementations may choose not to generate the map_entry=true message, but - /// use a native map in the target language to hold the keys and values. - /// The reflection APIs in such implementations still need to work as - /// if the field is a repeated message field. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool MapEntry { - get { if ((_hasBits0 & 8) != 0) { return mapEntry_; } else { return MapEntryDefaultValue; } } - set { - _hasBits0 |= 8; - mapEntry_ = value; - } - } - /// Gets whether the "map_entry" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasMapEntry { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "map_entry" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMapEntry() { - _hasBits0 &= ~8; - } - - /// Field number for the "deprecated_legacy_json_field_conflicts" field. - public const int DeprecatedLegacyJsonFieldConflictsFieldNumber = 11; - private readonly static bool DeprecatedLegacyJsonFieldConflictsDefaultValue = false; - - private bool deprecatedLegacyJsonFieldConflicts_; - /// - /// Enable the legacy handling of JSON field name conflicts. This lowercases - /// and strips underscored from the fields before comparison in proto3 only. - /// The new behavior takes `json_name` into account and applies to proto2 as - /// well. - /// - /// This should only be used as a temporary measure against broken builds due - /// to the change in behavior for JSON field name conflicts. - /// - /// TODO This is legacy behavior we plan to remove once downstream - /// teams have had time to migrate. - /// - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool DeprecatedLegacyJsonFieldConflicts { - get { if ((_hasBits0 & 16) != 0) { return deprecatedLegacyJsonFieldConflicts_; } else { return DeprecatedLegacyJsonFieldConflictsDefaultValue; } } - set { - _hasBits0 |= 16; - deprecatedLegacyJsonFieldConflicts_ = value; - } - } - /// Gets whether the "deprecated_legacy_json_field_conflicts" field is set - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecatedLegacyJsonFieldConflicts { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "deprecated_legacy_json_field_conflicts" field - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecatedLegacyJsonFieldConflicts() { - _hasBits0 &= ~16; - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 12; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MessageOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MessageOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MessageSetWireFormat != other.MessageSetWireFormat) return false; - if (NoStandardDescriptorAccessor != other.NoStandardDescriptorAccessor) return false; - if (Deprecated != other.Deprecated) return false; - if (MapEntry != other.MapEntry) return false; - if (DeprecatedLegacyJsonFieldConflicts != other.DeprecatedLegacyJsonFieldConflicts) return false; - if (!object.Equals(Features, other.Features)) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasMessageSetWireFormat) hash ^= MessageSetWireFormat.GetHashCode(); - if (HasNoStandardDescriptorAccessor) hash ^= NoStandardDescriptorAccessor.GetHashCode(); - if (HasDeprecated) hash ^= Deprecated.GetHashCode(); - if (HasMapEntry) hash ^= MapEntry.GetHashCode(); - if (HasDeprecatedLegacyJsonFieldConflicts) hash ^= DeprecatedLegacyJsonFieldConflicts.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasMessageSetWireFormat) { - output.WriteRawTag(8); - output.WriteBool(MessageSetWireFormat); - } - if (HasNoStandardDescriptorAccessor) { - output.WriteRawTag(16); - output.WriteBool(NoStandardDescriptorAccessor); - } - if (HasDeprecated) { - output.WriteRawTag(24); - output.WriteBool(Deprecated); - } - if (HasMapEntry) { - output.WriteRawTag(56); - output.WriteBool(MapEntry); - } - if (HasDeprecatedLegacyJsonFieldConflicts) { - output.WriteRawTag(88); - output.WriteBool(DeprecatedLegacyJsonFieldConflicts); - } - if (features_ != null) { - output.WriteRawTag(98); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasMessageSetWireFormat) { - output.WriteRawTag(8); - output.WriteBool(MessageSetWireFormat); - } - if (HasNoStandardDescriptorAccessor) { - output.WriteRawTag(16); - output.WriteBool(NoStandardDescriptorAccessor); - } - if (HasDeprecated) { - output.WriteRawTag(24); - output.WriteBool(Deprecated); - } - if (HasMapEntry) { - output.WriteRawTag(56); - output.WriteBool(MapEntry); - } - if (HasDeprecatedLegacyJsonFieldConflicts) { - output.WriteRawTag(88); - output.WriteBool(DeprecatedLegacyJsonFieldConflicts); - } - if (features_ != null) { - output.WriteRawTag(98); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasMessageSetWireFormat) { - size += 1 + 1; - } - if (HasNoStandardDescriptorAccessor) { - size += 1 + 1; - } - if (HasDeprecated) { - size += 1 + 1; - } - if (HasMapEntry) { - size += 1 + 1; - } - if (HasDeprecatedLegacyJsonFieldConflicts) { - size += 1 + 1; - } - if (features_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MessageOptions other) { - if (other == null) { - return; - } - if (other.HasMessageSetWireFormat) { - MessageSetWireFormat = other.MessageSetWireFormat; - } - if (other.HasNoStandardDescriptorAccessor) { - NoStandardDescriptorAccessor = other.NoStandardDescriptorAccessor; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasMapEntry) { - MapEntry = other.MapEntry; - } - if (other.HasDeprecatedLegacyJsonFieldConflicts) { - DeprecatedLegacyJsonFieldConflicts = other.DeprecatedLegacyJsonFieldConflicts; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 8: { - MessageSetWireFormat = input.ReadBool(); - break; - } - case 16: { - NoStandardDescriptorAccessor = input.ReadBool(); - break; - } - case 24: { - Deprecated = input.ReadBool(); - break; - } - case 56: { - MapEntry = input.ReadBool(); - break; - } - case 88: { - DeprecatedLegacyJsonFieldConflicts = input.ReadBool(); - break; - } - case 98: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 8: { - MessageSetWireFormat = input.ReadBool(); - break; - } - case 16: { - NoStandardDescriptorAccessor = input.ReadBool(); - break; - } - case 24: { - Deprecated = input.ReadBool(); - break; - } - case 56: { - MapEntry = input.ReadBool(); - break; - } - case 88: { - DeprecatedLegacyJsonFieldConflicts = input.ReadBool(); - break; - } - case 98: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FieldOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldOptions(FieldOptions other) : this() { - _hasBits0 = other._hasBits0; - ctype_ = other.ctype_; - packed_ = other.packed_; - jstype_ = other.jstype_; - lazy_ = other.lazy_; - unverifiedLazy_ = other.unverifiedLazy_; - deprecated_ = other.deprecated_; - weak_ = other.weak_; - debugRedact_ = other.debugRedact_; - retention_ = other.retention_; - targets_ = other.targets_.Clone(); - editionDefaults_ = other.editionDefaults_.Clone(); - features_ = other.features_ != null ? other.features_.Clone() : null; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldOptions Clone() { - return new FieldOptions(this); - } - - /// Field number for the "ctype" field. - public const int CtypeFieldNumber = 1; - private readonly static global::Google.Protobuf.Reflection.FieldOptions.Types.CType CtypeDefaultValue = global::Google.Protobuf.Reflection.FieldOptions.Types.CType.String; - - private global::Google.Protobuf.Reflection.FieldOptions.Types.CType ctype_; - /// - /// The ctype option instructs the C++ code generator to use a different - /// representation of the field than it normally would. See the specific - /// options below. This option is only implemented to support use of - /// [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - /// type "bytes" in the open source release -- sorry, we'll try to include - /// other types in a future version! - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FieldOptions.Types.CType Ctype { - get { if ((_hasBits0 & 1) != 0) { return ctype_; } else { return CtypeDefaultValue; } } - set { - _hasBits0 |= 1; - ctype_ = value; - } - } - /// Gets whether the "ctype" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasCtype { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "ctype" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearCtype() { - _hasBits0 &= ~1; - } - - /// Field number for the "packed" field. - public const int PackedFieldNumber = 2; - private readonly static bool PackedDefaultValue = false; - - private bool packed_; - /// - /// The packed option can be enabled for repeated primitive fields to enable - /// a more efficient representation on the wire. Rather than repeatedly - /// writing the tag and type for each element, the entire array is encoded as - /// a single length-delimited blob. In proto3, only explicit setting it to - /// false will avoid using packed encoding. This option is prohibited in - /// Editions, but the `repeated_field_encoding` feature can be used to control - /// the behavior. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Packed { - get { if ((_hasBits0 & 2) != 0) { return packed_; } else { return PackedDefaultValue; } } - set { - _hasBits0 |= 2; - packed_ = value; - } - } - /// Gets whether the "packed" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPacked { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "packed" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPacked() { - _hasBits0 &= ~2; - } - - /// Field number for the "jstype" field. - public const int JstypeFieldNumber = 6; - private readonly static global::Google.Protobuf.Reflection.FieldOptions.Types.JSType JstypeDefaultValue = global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JsNormal; - - private global::Google.Protobuf.Reflection.FieldOptions.Types.JSType jstype_; - /// - /// The jstype option determines the JavaScript type used for values of the - /// field. The option is permitted only for 64 bit integral and fixed types - /// (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - /// is represented as JavaScript string, which avoids loss of precision that - /// can happen when a large value is converted to a floating point JavaScript. - /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - /// use the JavaScript "number" type. The behavior of the default option - /// JS_NORMAL is implementation dependent. - /// - /// This option is an enum to permit additional types to be added, e.g. - /// goog.math.Integer. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FieldOptions.Types.JSType Jstype { - get { if ((_hasBits0 & 16) != 0) { return jstype_; } else { return JstypeDefaultValue; } } - set { - _hasBits0 |= 16; - jstype_ = value; - } - } - /// Gets whether the "jstype" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJstype { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "jstype" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJstype() { - _hasBits0 &= ~16; - } - - /// Field number for the "lazy" field. - public const int LazyFieldNumber = 5; - private readonly static bool LazyDefaultValue = false; - - private bool lazy_; - /// - /// Should this field be parsed lazily? Lazy applies only to message-type - /// fields. It means that when the outer message is initially parsed, the - /// inner message's contents will not be parsed but instead stored in encoded - /// form. The inner message will actually be parsed when it is first accessed. - /// - /// This is only a hint. Implementations are free to choose whether to use - /// eager or lazy parsing regardless of the value of this option. However, - /// setting this option true suggests that the protocol author believes that - /// using lazy parsing on this field is worth the additional bookkeeping - /// overhead typically needed to implement it. - /// - /// This option does not affect the public interface of any generated code; - /// all method signatures remain the same. Furthermore, thread-safety of the - /// interface is not affected by this option; const methods remain safe to - /// call from multiple threads concurrently, while non-const methods continue - /// to require exclusive access. - /// - /// Note that implementations may choose not to check required fields within - /// a lazy sub-message. That is, calling IsInitialized() on the outer message - /// may return true even if the inner message has missing required fields. - /// This is necessary because otherwise the inner message would have to be - /// parsed in order to perform the check, defeating the purpose of lazy - /// parsing. An implementation which chooses not to check required fields - /// must be consistent about it. That is, for any particular sub-message, the - /// implementation must either *always* check its required fields, or *never* - /// check its required fields, regardless of whether or not the message has - /// been parsed. - /// - /// As of May 2022, lazy verifies the contents of the byte stream during - /// parsing. An invalid byte stream will cause the overall parsing to fail. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Lazy { - get { if ((_hasBits0 & 8) != 0) { return lazy_; } else { return LazyDefaultValue; } } - set { - _hasBits0 |= 8; - lazy_ = value; - } - } - /// Gets whether the "lazy" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasLazy { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "lazy" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearLazy() { - _hasBits0 &= ~8; - } - - /// Field number for the "unverified_lazy" field. - public const int UnverifiedLazyFieldNumber = 15; - private readonly static bool UnverifiedLazyDefaultValue = false; - - private bool unverifiedLazy_; - /// - /// unverified_lazy does no correctness checks on the byte stream. This should - /// only be used where lazy with verification is prohibitive for performance - /// reasons. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool UnverifiedLazy { - get { if ((_hasBits0 & 64) != 0) { return unverifiedLazy_; } else { return UnverifiedLazyDefaultValue; } } - set { - _hasBits0 |= 64; - unverifiedLazy_ = value; - } - } - /// Gets whether the "unverified_lazy" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasUnverifiedLazy { - get { return (_hasBits0 & 64) != 0; } - } - /// Clears the value of the "unverified_lazy" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearUnverifiedLazy() { - _hasBits0 &= ~64; - } - - /// Field number for the "deprecated" field. - public const int DeprecatedFieldNumber = 3; - private readonly static bool DeprecatedDefaultValue = false; - - private bool deprecated_; - /// - /// Is this field deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for accessors, or it will be completely ignored; in the very least, this - /// is a formalization for deprecating fields. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deprecated { - get { if ((_hasBits0 & 4) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } - set { - _hasBits0 |= 4; - deprecated_ = value; - } - } - /// Gets whether the "deprecated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecated { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "deprecated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecated() { - _hasBits0 &= ~4; - } - - /// Field number for the "weak" field. - public const int WeakFieldNumber = 10; - private readonly static bool WeakDefaultValue = false; - - private bool weak_; - /// - /// For Google-internal migration only. Do not use. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Weak { - get { if ((_hasBits0 & 32) != 0) { return weak_; } else { return WeakDefaultValue; } } - set { - _hasBits0 |= 32; - weak_ = value; - } - } - /// Gets whether the "weak" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasWeak { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "weak" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearWeak() { - _hasBits0 &= ~32; - } - - /// Field number for the "debug_redact" field. - public const int DebugRedactFieldNumber = 16; - private readonly static bool DebugRedactDefaultValue = false; - - private bool debugRedact_; - /// - /// Indicate that the field value should not be printed out when using debug - /// formats, e.g. when the field contains sensitive credentials. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool DebugRedact { - get { if ((_hasBits0 & 128) != 0) { return debugRedact_; } else { return DebugRedactDefaultValue; } } - set { - _hasBits0 |= 128; - debugRedact_ = value; - } - } - /// Gets whether the "debug_redact" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDebugRedact { - get { return (_hasBits0 & 128) != 0; } - } - /// Clears the value of the "debug_redact" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDebugRedact() { - _hasBits0 &= ~128; - } - - /// Field number for the "retention" field. - public const int RetentionFieldNumber = 17; - private readonly static global::Google.Protobuf.Reflection.FieldOptions.Types.OptionRetention RetentionDefaultValue = global::Google.Protobuf.Reflection.FieldOptions.Types.OptionRetention.RetentionUnknown; - - private global::Google.Protobuf.Reflection.FieldOptions.Types.OptionRetention retention_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FieldOptions.Types.OptionRetention Retention { - get { if ((_hasBits0 & 256) != 0) { return retention_; } else { return RetentionDefaultValue; } } - set { - _hasBits0 |= 256; - retention_ = value; - } - } - /// Gets whether the "retention" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRetention { - get { return (_hasBits0 & 256) != 0; } - } - /// Clears the value of the "retention" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRetention() { - _hasBits0 &= ~256; - } - - /// Field number for the "targets" field. - public const int TargetsFieldNumber = 19; - private static readonly pb::FieldCodec _repeated_targets_codec - = pb::FieldCodec.ForEnum(152, x => (int) x, x => (global::Google.Protobuf.Reflection.FieldOptions.Types.OptionTargetType) x); - private readonly pbc::RepeatedField targets_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Targets { - get { return targets_; } - } - - /// Field number for the "edition_defaults" field. - public const int EditionDefaultsFieldNumber = 20; - private static readonly pb::FieldCodec _repeated_editionDefaults_codec - = pb::FieldCodec.ForMessage(162, global::Google.Protobuf.Reflection.FieldOptions.Types.EditionDefault.Parser); - private readonly pbc::RepeatedField editionDefaults_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField EditionDefaults { - get { return editionDefaults_; } - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 21; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FieldOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FieldOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Ctype != other.Ctype) return false; - if (Packed != other.Packed) return false; - if (Jstype != other.Jstype) return false; - if (Lazy != other.Lazy) return false; - if (UnverifiedLazy != other.UnverifiedLazy) return false; - if (Deprecated != other.Deprecated) return false; - if (Weak != other.Weak) return false; - if (DebugRedact != other.DebugRedact) return false; - if (Retention != other.Retention) return false; - if(!targets_.Equals(other.targets_)) return false; - if(!editionDefaults_.Equals(other.editionDefaults_)) return false; - if (!object.Equals(Features, other.Features)) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasCtype) hash ^= Ctype.GetHashCode(); - if (HasPacked) hash ^= Packed.GetHashCode(); - if (HasJstype) hash ^= Jstype.GetHashCode(); - if (HasLazy) hash ^= Lazy.GetHashCode(); - if (HasUnverifiedLazy) hash ^= UnverifiedLazy.GetHashCode(); - if (HasDeprecated) hash ^= Deprecated.GetHashCode(); - if (HasWeak) hash ^= Weak.GetHashCode(); - if (HasDebugRedact) hash ^= DebugRedact.GetHashCode(); - if (HasRetention) hash ^= Retention.GetHashCode(); - hash ^= targets_.GetHashCode(); - hash ^= editionDefaults_.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasCtype) { - output.WriteRawTag(8); - output.WriteEnum((int) Ctype); - } - if (HasPacked) { - output.WriteRawTag(16); - output.WriteBool(Packed); - } - if (HasDeprecated) { - output.WriteRawTag(24); - output.WriteBool(Deprecated); - } - if (HasLazy) { - output.WriteRawTag(40); - output.WriteBool(Lazy); - } - if (HasJstype) { - output.WriteRawTag(48); - output.WriteEnum((int) Jstype); - } - if (HasWeak) { - output.WriteRawTag(80); - output.WriteBool(Weak); - } - if (HasUnverifiedLazy) { - output.WriteRawTag(120); - output.WriteBool(UnverifiedLazy); - } - if (HasDebugRedact) { - output.WriteRawTag(128, 1); - output.WriteBool(DebugRedact); - } - if (HasRetention) { - output.WriteRawTag(136, 1); - output.WriteEnum((int) Retention); - } - targets_.WriteTo(output, _repeated_targets_codec); - editionDefaults_.WriteTo(output, _repeated_editionDefaults_codec); - if (features_ != null) { - output.WriteRawTag(170, 1); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasCtype) { - output.WriteRawTag(8); - output.WriteEnum((int) Ctype); - } - if (HasPacked) { - output.WriteRawTag(16); - output.WriteBool(Packed); - } - if (HasDeprecated) { - output.WriteRawTag(24); - output.WriteBool(Deprecated); - } - if (HasLazy) { - output.WriteRawTag(40); - output.WriteBool(Lazy); - } - if (HasJstype) { - output.WriteRawTag(48); - output.WriteEnum((int) Jstype); - } - if (HasWeak) { - output.WriteRawTag(80); - output.WriteBool(Weak); - } - if (HasUnverifiedLazy) { - output.WriteRawTag(120); - output.WriteBool(UnverifiedLazy); - } - if (HasDebugRedact) { - output.WriteRawTag(128, 1); - output.WriteBool(DebugRedact); - } - if (HasRetention) { - output.WriteRawTag(136, 1); - output.WriteEnum((int) Retention); - } - targets_.WriteTo(ref output, _repeated_targets_codec); - editionDefaults_.WriteTo(ref output, _repeated_editionDefaults_codec); - if (features_ != null) { - output.WriteRawTag(170, 1); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasCtype) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Ctype); - } - if (HasPacked) { - size += 1 + 1; - } - if (HasJstype) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Jstype); - } - if (HasLazy) { - size += 1 + 1; - } - if (HasUnverifiedLazy) { - size += 1 + 1; - } - if (HasDeprecated) { - size += 1 + 1; - } - if (HasWeak) { - size += 1 + 1; - } - if (HasDebugRedact) { - size += 2 + 1; - } - if (HasRetention) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) Retention); - } - size += targets_.CalculateSize(_repeated_targets_codec); - size += editionDefaults_.CalculateSize(_repeated_editionDefaults_codec); - if (features_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FieldOptions other) { - if (other == null) { - return; - } - if (other.HasCtype) { - Ctype = other.Ctype; - } - if (other.HasPacked) { - Packed = other.Packed; - } - if (other.HasJstype) { - Jstype = other.Jstype; - } - if (other.HasLazy) { - Lazy = other.Lazy; - } - if (other.HasUnverifiedLazy) { - UnverifiedLazy = other.UnverifiedLazy; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasWeak) { - Weak = other.Weak; - } - if (other.HasDebugRedact) { - DebugRedact = other.DebugRedact; - } - if (other.HasRetention) { - Retention = other.Retention; - } - targets_.Add(other.targets_); - editionDefaults_.Add(other.editionDefaults_); - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 8: { - Ctype = (global::Google.Protobuf.Reflection.FieldOptions.Types.CType) input.ReadEnum(); - break; - } - case 16: { - Packed = input.ReadBool(); - break; - } - case 24: { - Deprecated = input.ReadBool(); - break; - } - case 40: { - Lazy = input.ReadBool(); - break; - } - case 48: { - Jstype = (global::Google.Protobuf.Reflection.FieldOptions.Types.JSType) input.ReadEnum(); - break; - } - case 80: { - Weak = input.ReadBool(); - break; - } - case 120: { - UnverifiedLazy = input.ReadBool(); - break; - } - case 128: { - DebugRedact = input.ReadBool(); - break; - } - case 136: { - Retention = (global::Google.Protobuf.Reflection.FieldOptions.Types.OptionRetention) input.ReadEnum(); - break; - } - case 154: - case 152: { - targets_.AddEntriesFrom(input, _repeated_targets_codec); - break; - } - case 162: { - editionDefaults_.AddEntriesFrom(input, _repeated_editionDefaults_codec); - break; - } - case 170: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 8: { - Ctype = (global::Google.Protobuf.Reflection.FieldOptions.Types.CType) input.ReadEnum(); - break; - } - case 16: { - Packed = input.ReadBool(); - break; - } - case 24: { - Deprecated = input.ReadBool(); - break; - } - case 40: { - Lazy = input.ReadBool(); - break; - } - case 48: { - Jstype = (global::Google.Protobuf.Reflection.FieldOptions.Types.JSType) input.ReadEnum(); - break; - } - case 80: { - Weak = input.ReadBool(); - break; - } - case 120: { - UnverifiedLazy = input.ReadBool(); - break; - } - case 128: { - DebugRedact = input.ReadBool(); - break; - } - case 136: { - Retention = (global::Google.Protobuf.Reflection.FieldOptions.Types.OptionRetention) input.ReadEnum(); - break; - } - case 154: - case 152: { - targets_.AddEntriesFrom(ref input, _repeated_targets_codec); - break; - } - case 162: { - editionDefaults_.AddEntriesFrom(ref input, _repeated_editionDefaults_codec); - break; - } - case 170: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - #region Nested types - /// Container for nested types declared in the FieldOptions message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum CType { - /// - /// Default mode. - /// - [pbr::OriginalName("STRING")] String = 0, - /// - /// The option [ctype=CORD] may be applied to a non-repeated field of type - /// "bytes". It indicates that in C++, the data should be stored in a Cord - /// instead of a string. For very large strings, this may reduce memory - /// fragmentation. It may also allow better performance when parsing from a - /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then - /// alias the original buffer. - /// - [pbr::OriginalName("CORD")] Cord = 1, - [pbr::OriginalName("STRING_PIECE")] StringPiece = 2, - } - - public enum JSType { - /// - /// Use the default type. - /// - [pbr::OriginalName("JS_NORMAL")] JsNormal = 0, - /// - /// Use JavaScript strings. - /// - [pbr::OriginalName("JS_STRING")] JsString = 1, - /// - /// Use JavaScript numbers. - /// - [pbr::OriginalName("JS_NUMBER")] JsNumber = 2, - } - - /// - /// If set to RETENTION_SOURCE, the option will be omitted from the binary. - /// Note: as of January 2023, support for this is in progress and does not yet - /// have an effect (b/264593489). - /// - public enum OptionRetention { - [pbr::OriginalName("RETENTION_UNKNOWN")] RetentionUnknown = 0, - [pbr::OriginalName("RETENTION_RUNTIME")] RetentionRuntime = 1, - [pbr::OriginalName("RETENTION_SOURCE")] RetentionSource = 2, - } - - /// - /// This indicates the types of entities that the field may apply to when used - /// as an option. If it is unset, then the field may be freely used as an - /// option on any kind of entity. Note: as of January 2023, support for this is - /// in progress and does not yet have an effect (b/264593489). - /// - public enum OptionTargetType { - [pbr::OriginalName("TARGET_TYPE_UNKNOWN")] TargetTypeUnknown = 0, - [pbr::OriginalName("TARGET_TYPE_FILE")] TargetTypeFile = 1, - [pbr::OriginalName("TARGET_TYPE_EXTENSION_RANGE")] TargetTypeExtensionRange = 2, - [pbr::OriginalName("TARGET_TYPE_MESSAGE")] TargetTypeMessage = 3, - [pbr::OriginalName("TARGET_TYPE_FIELD")] TargetTypeField = 4, - [pbr::OriginalName("TARGET_TYPE_ONEOF")] TargetTypeOneof = 5, - [pbr::OriginalName("TARGET_TYPE_ENUM")] TargetTypeEnum = 6, - [pbr::OriginalName("TARGET_TYPE_ENUM_ENTRY")] TargetTypeEnumEntry = 7, - [pbr::OriginalName("TARGET_TYPE_SERVICE")] TargetTypeService = 8, - [pbr::OriginalName("TARGET_TYPE_METHOD")] TargetTypeMethod = 9, - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EditionDefault : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EditionDefault()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.FieldOptions.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EditionDefault() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EditionDefault(EditionDefault other) : this() { - _hasBits0 = other._hasBits0; - edition_ = other.edition_; - value_ = other.value_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EditionDefault Clone() { - return new EditionDefault(this); - } - - /// Field number for the "edition" field. - public const int EditionFieldNumber = 3; - private readonly static global::Google.Protobuf.Reflection.Edition EditionDefaultValue = global::Google.Protobuf.Reflection.Edition.Unknown; - - private global::Google.Protobuf.Reflection.Edition edition_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.Edition Edition { - get { if ((_hasBits0 & 1) != 0) { return edition_; } else { return EditionDefaultValue; } } - set { - _hasBits0 |= 1; - edition_ = value; - } - } - /// Gets whether the "edition" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEdition { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "edition" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEdition() { - _hasBits0 &= ~1; - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 2; - private readonly static string ValueDefaultValue = ""; - - private string value_; - /// - /// Textproto value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Value { - get { return value_ ?? ValueDefaultValue; } - set { - value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasValue { - get { return value_ != null; } - } - /// Clears the value of the "value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearValue() { - value_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EditionDefault); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EditionDefault other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Edition != other.Edition) return false; - if (Value != other.Value) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasEdition) hash ^= Edition.GetHashCode(); - if (HasValue) hash ^= Value.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasValue) { - output.WriteRawTag(18); - output.WriteString(Value); - } - if (HasEdition) { - output.WriteRawTag(24); - output.WriteEnum((int) Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasValue) { - output.WriteRawTag(18); - output.WriteString(Value); - } - if (HasEdition) { - output.WriteRawTag(24); - output.WriteEnum((int) Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasEdition) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Edition); - } - if (HasValue) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EditionDefault other) { - if (other == null) { - return; - } - if (other.HasEdition) { - Edition = other.Edition; - } - if (other.HasValue) { - Value = other.Value; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 18: { - Value = input.ReadString(); - break; - } - case 24: { - Edition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 18: { - Value = input.ReadString(); - break; - } - case 24: { - Edition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class OneofOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[13]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofOptions(OneofOptions other) : this() { - features_ = other.features_ != null ? other.features_.Clone() : null; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public OneofOptions Clone() { - return new OneofOptions(this); - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 1; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as OneofOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(OneofOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Features, other.Features)) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (features_ != null) hash ^= Features.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (features_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (features_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (features_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(OneofOptions other) { - if (other == null) { - return; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 10: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 10: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[14]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOptions(EnumOptions other) : this() { - _hasBits0 = other._hasBits0; - allowAlias_ = other.allowAlias_; - deprecated_ = other.deprecated_; - deprecatedLegacyJsonFieldConflicts_ = other.deprecatedLegacyJsonFieldConflicts_; - features_ = other.features_ != null ? other.features_.Clone() : null; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumOptions Clone() { - return new EnumOptions(this); - } - - /// Field number for the "allow_alias" field. - public const int AllowAliasFieldNumber = 2; - private readonly static bool AllowAliasDefaultValue = false; - - private bool allowAlias_; - /// - /// Set this option to true to allow mapping different tag names to the same - /// value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool AllowAlias { - get { if ((_hasBits0 & 1) != 0) { return allowAlias_; } else { return AllowAliasDefaultValue; } } - set { - _hasBits0 |= 1; - allowAlias_ = value; - } - } - /// Gets whether the "allow_alias" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasAllowAlias { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "allow_alias" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearAllowAlias() { - _hasBits0 &= ~1; - } - - /// Field number for the "deprecated" field. - public const int DeprecatedFieldNumber = 3; - private readonly static bool DeprecatedDefaultValue = false; - - private bool deprecated_; - /// - /// Is this enum deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the enum, or it will be completely ignored; in the very least, this - /// is a formalization for deprecating enums. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deprecated { - get { if ((_hasBits0 & 2) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } - set { - _hasBits0 |= 2; - deprecated_ = value; - } - } - /// Gets whether the "deprecated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecated { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "deprecated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecated() { - _hasBits0 &= ~2; - } - - /// Field number for the "deprecated_legacy_json_field_conflicts" field. - public const int DeprecatedLegacyJsonFieldConflictsFieldNumber = 6; - private readonly static bool DeprecatedLegacyJsonFieldConflictsDefaultValue = false; - - private bool deprecatedLegacyJsonFieldConflicts_; - /// - /// Enable the legacy handling of JSON field name conflicts. This lowercases - /// and strips underscored from the fields before comparison in proto3 only. - /// The new behavior takes `json_name` into account and applies to proto2 as - /// well. - /// TODO Remove this legacy behavior once downstream teams have - /// had time to migrate. - /// - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool DeprecatedLegacyJsonFieldConflicts { - get { if ((_hasBits0 & 4) != 0) { return deprecatedLegacyJsonFieldConflicts_; } else { return DeprecatedLegacyJsonFieldConflictsDefaultValue; } } - set { - _hasBits0 |= 4; - deprecatedLegacyJsonFieldConflicts_ = value; - } - } - /// Gets whether the "deprecated_legacy_json_field_conflicts" field is set - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecatedLegacyJsonFieldConflicts { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "deprecated_legacy_json_field_conflicts" field - [global::System.ObsoleteAttribute] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecatedLegacyJsonFieldConflicts() { - _hasBits0 &= ~4; - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 7; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (AllowAlias != other.AllowAlias) return false; - if (Deprecated != other.Deprecated) return false; - if (DeprecatedLegacyJsonFieldConflicts != other.DeprecatedLegacyJsonFieldConflicts) return false; - if (!object.Equals(Features, other.Features)) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasAllowAlias) hash ^= AllowAlias.GetHashCode(); - if (HasDeprecated) hash ^= Deprecated.GetHashCode(); - if (HasDeprecatedLegacyJsonFieldConflicts) hash ^= DeprecatedLegacyJsonFieldConflicts.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasAllowAlias) { - output.WriteRawTag(16); - output.WriteBool(AllowAlias); - } - if (HasDeprecated) { - output.WriteRawTag(24); - output.WriteBool(Deprecated); - } - if (HasDeprecatedLegacyJsonFieldConflicts) { - output.WriteRawTag(48); - output.WriteBool(DeprecatedLegacyJsonFieldConflicts); - } - if (features_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasAllowAlias) { - output.WriteRawTag(16); - output.WriteBool(AllowAlias); - } - if (HasDeprecated) { - output.WriteRawTag(24); - output.WriteBool(Deprecated); - } - if (HasDeprecatedLegacyJsonFieldConflicts) { - output.WriteRawTag(48); - output.WriteBool(DeprecatedLegacyJsonFieldConflicts); - } - if (features_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasAllowAlias) { - size += 1 + 1; - } - if (HasDeprecated) { - size += 1 + 1; - } - if (HasDeprecatedLegacyJsonFieldConflicts) { - size += 1 + 1; - } - if (features_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumOptions other) { - if (other == null) { - return; - } - if (other.HasAllowAlias) { - AllowAlias = other.AllowAlias; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasDeprecatedLegacyJsonFieldConflicts) { - DeprecatedLegacyJsonFieldConflicts = other.DeprecatedLegacyJsonFieldConflicts; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 16: { - AllowAlias = input.ReadBool(); - break; - } - case 24: { - Deprecated = input.ReadBool(); - break; - } - case 48: { - DeprecatedLegacyJsonFieldConflicts = input.ReadBool(); - break; - } - case 58: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 16: { - AllowAlias = input.ReadBool(); - break; - } - case 24: { - Deprecated = input.ReadBool(); - break; - } - case 48: { - DeprecatedLegacyJsonFieldConflicts = input.ReadBool(); - break; - } - case 58: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumValueOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[15]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValueOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValueOptions(EnumValueOptions other) : this() { - _hasBits0 = other._hasBits0; - deprecated_ = other.deprecated_; - features_ = other.features_ != null ? other.features_.Clone() : null; - debugRedact_ = other.debugRedact_; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValueOptions Clone() { - return new EnumValueOptions(this); - } - - /// Field number for the "deprecated" field. - public const int DeprecatedFieldNumber = 1; - private readonly static bool DeprecatedDefaultValue = false; - - private bool deprecated_; - /// - /// Is this enum value deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the enum value, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating enum values. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deprecated { - get { if ((_hasBits0 & 1) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } - set { - _hasBits0 |= 1; - deprecated_ = value; - } - } - /// Gets whether the "deprecated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecated { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "deprecated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecated() { - _hasBits0 &= ~1; - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 2; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "debug_redact" field. - public const int DebugRedactFieldNumber = 3; - private readonly static bool DebugRedactDefaultValue = false; - - private bool debugRedact_; - /// - /// Indicate that fields annotated with this enum value should not be printed - /// out when using debug formats, e.g. when the field contains sensitive - /// credentials. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool DebugRedact { - get { if ((_hasBits0 & 2) != 0) { return debugRedact_; } else { return DebugRedactDefaultValue; } } - set { - _hasBits0 |= 2; - debugRedact_ = value; - } - } - /// Gets whether the "debug_redact" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDebugRedact { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "debug_redact" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDebugRedact() { - _hasBits0 &= ~2; - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumValueOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumValueOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Deprecated != other.Deprecated) return false; - if (!object.Equals(Features, other.Features)) return false; - if (DebugRedact != other.DebugRedact) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasDeprecated) hash ^= Deprecated.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - if (HasDebugRedact) hash ^= DebugRedact.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasDeprecated) { - output.WriteRawTag(8); - output.WriteBool(Deprecated); - } - if (features_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Features); - } - if (HasDebugRedact) { - output.WriteRawTag(24); - output.WriteBool(DebugRedact); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasDeprecated) { - output.WriteRawTag(8); - output.WriteBool(Deprecated); - } - if (features_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Features); - } - if (HasDebugRedact) { - output.WriteRawTag(24); - output.WriteBool(DebugRedact); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasDeprecated) { - size += 1 + 1; - } - if (features_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - if (HasDebugRedact) { - size += 1 + 1; - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumValueOptions other) { - if (other == null) { - return; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - if (other.HasDebugRedact) { - DebugRedact = other.DebugRedact; - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 8: { - Deprecated = input.ReadBool(); - break; - } - case 18: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 24: { - DebugRedact = input.ReadBool(); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 8: { - Deprecated = input.ReadBool(); - break; - } - case 18: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 24: { - DebugRedact = input.ReadBool(); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ServiceOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[16]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServiceOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServiceOptions(ServiceOptions other) : this() { - _hasBits0 = other._hasBits0; - features_ = other.features_ != null ? other.features_.Clone() : null; - deprecated_ = other.deprecated_; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServiceOptions Clone() { - return new ServiceOptions(this); - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 34; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "deprecated" field. - public const int DeprecatedFieldNumber = 33; - private readonly static bool DeprecatedDefaultValue = false; - - private bool deprecated_; - /// - /// Is this service deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the service, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating services. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deprecated { - get { if ((_hasBits0 & 1) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } - set { - _hasBits0 |= 1; - deprecated_ = value; - } - } - /// Gets whether the "deprecated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecated { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "deprecated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecated() { - _hasBits0 &= ~1; - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ServiceOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ServiceOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Features, other.Features)) return false; - if (Deprecated != other.Deprecated) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (features_ != null) hash ^= Features.GetHashCode(); - if (HasDeprecated) hash ^= Deprecated.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasDeprecated) { - output.WriteRawTag(136, 2); - output.WriteBool(Deprecated); - } - if (features_ != null) { - output.WriteRawTag(146, 2); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasDeprecated) { - output.WriteRawTag(136, 2); - output.WriteBool(Deprecated); - } - if (features_ != null) { - output.WriteRawTag(146, 2); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (features_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - if (HasDeprecated) { - size += 2 + 1; - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ServiceOptions other) { - if (other == null) { - return; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 264: { - Deprecated = input.ReadBool(); - break; - } - case 274: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 264: { - Deprecated = input.ReadBool(); - break; - } - case 274: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MethodOptions : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodOptions()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[17]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MethodOptions() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MethodOptions(MethodOptions other) : this() { - _hasBits0 = other._hasBits0; - deprecated_ = other.deprecated_; - idempotencyLevel_ = other.idempotencyLevel_; - features_ = other.features_ != null ? other.features_.Clone() : null; - uninterpretedOption_ = other.uninterpretedOption_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MethodOptions Clone() { - return new MethodOptions(this); - } - - /// Field number for the "deprecated" field. - public const int DeprecatedFieldNumber = 33; - private readonly static bool DeprecatedDefaultValue = false; - - private bool deprecated_; - /// - /// Is this method deprecated? - /// Depending on the target platform, this can emit Deprecated annotations - /// for the method, or it will be completely ignored; in the very least, - /// this is a formalization for deprecating methods. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deprecated { - get { if ((_hasBits0 & 1) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } - set { - _hasBits0 |= 1; - deprecated_ = value; - } - } - /// Gets whether the "deprecated" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDeprecated { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "deprecated" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDeprecated() { - _hasBits0 &= ~1; - } - - /// Field number for the "idempotency_level" field. - public const int IdempotencyLevelFieldNumber = 34; - private readonly static global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel IdempotencyLevelDefaultValue = global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel.IdempotencyUnknown; - - private global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel idempotencyLevel_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel IdempotencyLevel { - get { if ((_hasBits0 & 2) != 0) { return idempotencyLevel_; } else { return IdempotencyLevelDefaultValue; } } - set { - _hasBits0 |= 2; - idempotencyLevel_ = value; - } - } - /// Gets whether the "idempotency_level" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasIdempotencyLevel { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "idempotency_level" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearIdempotencyLevel() { - _hasBits0 &= ~2; - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 35; - private global::Google.Protobuf.Reflection.FeatureSet features_; - /// - /// Any features defined in the specific edition. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - /// Field number for the "uninterpreted_option" field. - public const int UninterpretedOptionFieldNumber = 999; - private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec - = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); - private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - /// - /// The parser stores options it doesn't recognize here. See above. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField UninterpretedOption { - get { return uninterpretedOption_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MethodOptions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MethodOptions other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Deprecated != other.Deprecated) return false; - if (IdempotencyLevel != other.IdempotencyLevel) return false; - if (!object.Equals(Features, other.Features)) return false; - if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasDeprecated) hash ^= Deprecated.GetHashCode(); - if (HasIdempotencyLevel) hash ^= IdempotencyLevel.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - hash ^= uninterpretedOption_.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasDeprecated) { - output.WriteRawTag(136, 2); - output.WriteBool(Deprecated); - } - if (HasIdempotencyLevel) { - output.WriteRawTag(144, 2); - output.WriteEnum((int) IdempotencyLevel); - } - if (features_ != null) { - output.WriteRawTag(154, 2); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasDeprecated) { - output.WriteRawTag(136, 2); - output.WriteBool(Deprecated); - } - if (HasIdempotencyLevel) { - output.WriteRawTag(144, 2); - output.WriteEnum((int) IdempotencyLevel); - } - if (features_ != null) { - output.WriteRawTag(154, 2); - output.WriteMessage(Features); - } - uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasDeprecated) { - size += 2 + 1; - } - if (HasIdempotencyLevel) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) IdempotencyLevel); - } - if (features_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MethodOptions other) { - if (other == null) { - return; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasIdempotencyLevel) { - IdempotencyLevel = other.IdempotencyLevel; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 264: { - Deprecated = input.ReadBool(); - break; - } - case 272: { - IdempotencyLevel = (global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel) input.ReadEnum(); - break; - } - case 282: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 264: { - Deprecated = input.ReadBool(); - break; - } - case 272: { - IdempotencyLevel = (global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel) input.ReadEnum(); - break; - } - case 282: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 7994: { - uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - #region Nested types - /// Container for nested types declared in the MethodOptions message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - /// or neither? HTTP based RPC implementation may choose GET verb for safe - /// methods, and PUT verb for idempotent methods instead of the default POST. - /// - public enum IdempotencyLevel { - [pbr::OriginalName("IDEMPOTENCY_UNKNOWN")] IdempotencyUnknown = 0, - /// - /// implies idempotent - /// - [pbr::OriginalName("NO_SIDE_EFFECTS")] NoSideEffects = 1, - /// - /// idempotent, but may have side effects - /// - [pbr::OriginalName("IDEMPOTENT")] Idempotent = 2, - } - - } - #endregion - - } - - /// - /// A message representing a option the parser does not recognize. This only - /// appears in options protos created by the compiler::Parser class. - /// DescriptorPool resolves these when building Descriptor objects. Therefore, - /// options protos in descriptor objects (e.g. returned by Descriptor::options(), - /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - /// in them. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class UninterpretedOption : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UninterpretedOption()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[18]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public UninterpretedOption() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public UninterpretedOption(UninterpretedOption other) : this() { - _hasBits0 = other._hasBits0; - name_ = other.name_.Clone(); - identifierValue_ = other.identifierValue_; - positiveIntValue_ = other.positiveIntValue_; - negativeIntValue_ = other.negativeIntValue_; - doubleValue_ = other.doubleValue_; - stringValue_ = other.stringValue_; - aggregateValue_ = other.aggregateValue_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public UninterpretedOption Clone() { - return new UninterpretedOption(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_name_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser); - private readonly pbc::RepeatedField name_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Name { - get { return name_; } - } - - /// Field number for the "identifier_value" field. - public const int IdentifierValueFieldNumber = 3; - private readonly static string IdentifierValueDefaultValue = ""; - - private string identifierValue_; - /// - /// The value of the uninterpreted option, in whatever type the tokenizer - /// identified it as during parsing. Exactly one of these should be set. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string IdentifierValue { - get { return identifierValue_ ?? IdentifierValueDefaultValue; } - set { - identifierValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "identifier_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasIdentifierValue { - get { return identifierValue_ != null; } - } - /// Clears the value of the "identifier_value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearIdentifierValue() { - identifierValue_ = null; - } - - /// Field number for the "positive_int_value" field. - public const int PositiveIntValueFieldNumber = 4; - private readonly static ulong PositiveIntValueDefaultValue = 0UL; - - private ulong positiveIntValue_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong PositiveIntValue { - get { if ((_hasBits0 & 1) != 0) { return positiveIntValue_; } else { return PositiveIntValueDefaultValue; } } - set { - _hasBits0 |= 1; - positiveIntValue_ = value; - } - } - /// Gets whether the "positive_int_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasPositiveIntValue { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "positive_int_value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearPositiveIntValue() { - _hasBits0 &= ~1; - } - - /// Field number for the "negative_int_value" field. - public const int NegativeIntValueFieldNumber = 5; - private readonly static long NegativeIntValueDefaultValue = 0L; - - private long negativeIntValue_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long NegativeIntValue { - get { if ((_hasBits0 & 2) != 0) { return negativeIntValue_; } else { return NegativeIntValueDefaultValue; } } - set { - _hasBits0 |= 2; - negativeIntValue_ = value; - } - } - /// Gets whether the "negative_int_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNegativeIntValue { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "negative_int_value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNegativeIntValue() { - _hasBits0 &= ~2; - } - - /// Field number for the "double_value" field. - public const int DoubleValueFieldNumber = 6; - private readonly static double DoubleValueDefaultValue = 0D; - - private double doubleValue_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double DoubleValue { - get { if ((_hasBits0 & 4) != 0) { return doubleValue_; } else { return DoubleValueDefaultValue; } } - set { - _hasBits0 |= 4; - doubleValue_ = value; - } - } - /// Gets whether the "double_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasDoubleValue { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "double_value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearDoubleValue() { - _hasBits0 &= ~4; - } - - /// Field number for the "string_value" field. - public const int StringValueFieldNumber = 7; - private readonly static pb::ByteString StringValueDefaultValue = pb::ByteString.Empty; - - private pb::ByteString stringValue_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString StringValue { - get { return stringValue_ ?? StringValueDefaultValue; } - set { - stringValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "string_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasStringValue { - get { return stringValue_ != null; } - } - /// Clears the value of the "string_value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearStringValue() { - stringValue_ = null; - } - - /// Field number for the "aggregate_value" field. - public const int AggregateValueFieldNumber = 8; - private readonly static string AggregateValueDefaultValue = ""; - - private string aggregateValue_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string AggregateValue { - get { return aggregateValue_ ?? AggregateValueDefaultValue; } - set { - aggregateValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "aggregate_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasAggregateValue { - get { return aggregateValue_ != null; } - } - /// Clears the value of the "aggregate_value" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearAggregateValue() { - aggregateValue_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as UninterpretedOption); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(UninterpretedOption other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!name_.Equals(other.name_)) return false; - if (IdentifierValue != other.IdentifierValue) return false; - if (PositiveIntValue != other.PositiveIntValue) return false; - if (NegativeIntValue != other.NegativeIntValue) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleValue, other.DoubleValue)) return false; - if (StringValue != other.StringValue) return false; - if (AggregateValue != other.AggregateValue) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= name_.GetHashCode(); - if (HasIdentifierValue) hash ^= IdentifierValue.GetHashCode(); - if (HasPositiveIntValue) hash ^= PositiveIntValue.GetHashCode(); - if (HasNegativeIntValue) hash ^= NegativeIntValue.GetHashCode(); - if (HasDoubleValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleValue); - if (HasStringValue) hash ^= StringValue.GetHashCode(); - if (HasAggregateValue) hash ^= AggregateValue.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - name_.WriteTo(output, _repeated_name_codec); - if (HasIdentifierValue) { - output.WriteRawTag(26); - output.WriteString(IdentifierValue); - } - if (HasPositiveIntValue) { - output.WriteRawTag(32); - output.WriteUInt64(PositiveIntValue); - } - if (HasNegativeIntValue) { - output.WriteRawTag(40); - output.WriteInt64(NegativeIntValue); - } - if (HasDoubleValue) { - output.WriteRawTag(49); - output.WriteDouble(DoubleValue); - } - if (HasStringValue) { - output.WriteRawTag(58); - output.WriteBytes(StringValue); - } - if (HasAggregateValue) { - output.WriteRawTag(66); - output.WriteString(AggregateValue); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - name_.WriteTo(ref output, _repeated_name_codec); - if (HasIdentifierValue) { - output.WriteRawTag(26); - output.WriteString(IdentifierValue); - } - if (HasPositiveIntValue) { - output.WriteRawTag(32); - output.WriteUInt64(PositiveIntValue); - } - if (HasNegativeIntValue) { - output.WriteRawTag(40); - output.WriteInt64(NegativeIntValue); - } - if (HasDoubleValue) { - output.WriteRawTag(49); - output.WriteDouble(DoubleValue); - } - if (HasStringValue) { - output.WriteRawTag(58); - output.WriteBytes(StringValue); - } - if (HasAggregateValue) { - output.WriteRawTag(66); - output.WriteString(AggregateValue); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += name_.CalculateSize(_repeated_name_codec); - if (HasIdentifierValue) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(IdentifierValue); - } - if (HasPositiveIntValue) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(PositiveIntValue); - } - if (HasNegativeIntValue) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(NegativeIntValue); - } - if (HasDoubleValue) { - size += 1 + 8; - } - if (HasStringValue) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(StringValue); - } - if (HasAggregateValue) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(AggregateValue); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(UninterpretedOption other) { - if (other == null) { - return; - } - name_.Add(other.name_); - if (other.HasIdentifierValue) { - IdentifierValue = other.IdentifierValue; - } - if (other.HasPositiveIntValue) { - PositiveIntValue = other.PositiveIntValue; - } - if (other.HasNegativeIntValue) { - NegativeIntValue = other.NegativeIntValue; - } - if (other.HasDoubleValue) { - DoubleValue = other.DoubleValue; - } - if (other.HasStringValue) { - StringValue = other.StringValue; - } - if (other.HasAggregateValue) { - AggregateValue = other.AggregateValue; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 18: { - name_.AddEntriesFrom(input, _repeated_name_codec); - break; - } - case 26: { - IdentifierValue = input.ReadString(); - break; - } - case 32: { - PositiveIntValue = input.ReadUInt64(); - break; - } - case 40: { - NegativeIntValue = input.ReadInt64(); - break; - } - case 49: { - DoubleValue = input.ReadDouble(); - break; - } - case 58: { - StringValue = input.ReadBytes(); - break; - } - case 66: { - AggregateValue = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 18: { - name_.AddEntriesFrom(ref input, _repeated_name_codec); - break; - } - case 26: { - IdentifierValue = input.ReadString(); - break; - } - case 32: { - PositiveIntValue = input.ReadUInt64(); - break; - } - case 40: { - NegativeIntValue = input.ReadInt64(); - break; - } - case 49: { - DoubleValue = input.ReadDouble(); - break; - } - case 58: { - StringValue = input.ReadBytes(); - break; - } - case 66: { - AggregateValue = input.ReadString(); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the UninterpretedOption message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// The name of the uninterpreted option. Each string represents a segment in - /// a dot-separated name. is_extension is true iff a segment represents an - /// extension (denoted with parentheses in options specs in .proto files). - /// E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - /// "foo.(bar.baz).moo". - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class NamePart : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NamePart()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.UninterpretedOption.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NamePart() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NamePart(NamePart other) : this() { - _hasBits0 = other._hasBits0; - namePart_ = other.namePart_; - isExtension_ = other.isExtension_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public NamePart Clone() { - return new NamePart(this); - } - - /// Field number for the "name_part" field. - public const int NamePart_FieldNumber = 1; - private readonly static string NamePart_DefaultValue = ""; - - private string namePart_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string NamePart_ { - get { return namePart_ ?? NamePart_DefaultValue; } - set { - namePart_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "name_part" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNamePart_ { - get { return namePart_ != null; } - } - /// Clears the value of the "name_part" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNamePart_() { - namePart_ = null; - } - - /// Field number for the "is_extension" field. - public const int IsExtensionFieldNumber = 2; - private readonly static bool IsExtensionDefaultValue = false; - - private bool isExtension_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsExtension { - get { if ((_hasBits0 & 1) != 0) { return isExtension_; } else { return IsExtensionDefaultValue; } } - set { - _hasBits0 |= 1; - isExtension_ = value; - } - } - /// Gets whether the "is_extension" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasIsExtension { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "is_extension" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearIsExtension() { - _hasBits0 &= ~1; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as NamePart); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(NamePart other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (NamePart_ != other.NamePart_) return false; - if (IsExtension != other.IsExtension) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasNamePart_) hash ^= NamePart_.GetHashCode(); - if (HasIsExtension) hash ^= IsExtension.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasNamePart_) { - output.WriteRawTag(10); - output.WriteString(NamePart_); - } - if (HasIsExtension) { - output.WriteRawTag(16); - output.WriteBool(IsExtension); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasNamePart_) { - output.WriteRawTag(10); - output.WriteString(NamePart_); - } - if (HasIsExtension) { - output.WriteRawTag(16); - output.WriteBool(IsExtension); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasNamePart_) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(NamePart_); - } - if (HasIsExtension) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(NamePart other) { - if (other == null) { - return; - } - if (other.HasNamePart_) { - NamePart_ = other.NamePart_; - } - if (other.HasIsExtension) { - IsExtension = other.IsExtension; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - NamePart_ = input.ReadString(); - break; - } - case 16: { - IsExtension = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - NamePart_ = input.ReadString(); - break; - } - case 16: { - IsExtension = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - /// - /// TODO Enums in C++ gencode (and potentially other languages) are - /// not well scoped. This means that each of the feature enums below can clash - /// with each other. The short names we've chosen maximize call-site - /// readability, but leave us very open to this scenario. A future feature will - /// be designed and implemented to handle this, hopefully before we ever hit a - /// conflict here. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FeatureSet : pb::IExtendableMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FeatureSet()); - private pb::UnknownFieldSet _unknownFields; - internal pb::ExtensionSet _extensions; - private pb::ExtensionSet _Extensions { get { return _extensions; } } - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[19]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSet() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSet(FeatureSet other) : this() { - _hasBits0 = other._hasBits0; - fieldPresence_ = other.fieldPresence_; - enumType_ = other.enumType_; - repeatedFieldEncoding_ = other.repeatedFieldEncoding_; - utf8Validation_ = other.utf8Validation_; - messageEncoding_ = other.messageEncoding_; - jsonFormat_ = other.jsonFormat_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - _extensions = pb::ExtensionSet.Clone(other._extensions); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSet Clone() { - return new FeatureSet(this); - } - - /// Field number for the "field_presence" field. - public const int FieldPresenceFieldNumber = 1; - private readonly static global::Google.Protobuf.Reflection.FeatureSet.Types.FieldPresence FieldPresenceDefaultValue = global::Google.Protobuf.Reflection.FeatureSet.Types.FieldPresence.Unknown; - - private global::Google.Protobuf.Reflection.FeatureSet.Types.FieldPresence fieldPresence_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet.Types.FieldPresence FieldPresence { - get { if ((_hasBits0 & 1) != 0) { return fieldPresence_; } else { return FieldPresenceDefaultValue; } } - set { - _hasBits0 |= 1; - fieldPresence_ = value; - } - } - /// Gets whether the "field_presence" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasFieldPresence { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "field_presence" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearFieldPresence() { - _hasBits0 &= ~1; - } - - /// Field number for the "enum_type" field. - public const int EnumTypeFieldNumber = 2; - private readonly static global::Google.Protobuf.Reflection.FeatureSet.Types.EnumType EnumTypeDefaultValue = global::Google.Protobuf.Reflection.FeatureSet.Types.EnumType.Unknown; - - private global::Google.Protobuf.Reflection.FeatureSet.Types.EnumType enumType_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet.Types.EnumType EnumType { - get { if ((_hasBits0 & 2) != 0) { return enumType_; } else { return EnumTypeDefaultValue; } } - set { - _hasBits0 |= 2; - enumType_ = value; - } - } - /// Gets whether the "enum_type" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEnumType { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "enum_type" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEnumType() { - _hasBits0 &= ~2; - } - - /// Field number for the "repeated_field_encoding" field. - public const int RepeatedFieldEncodingFieldNumber = 3; - private readonly static global::Google.Protobuf.Reflection.FeatureSet.Types.RepeatedFieldEncoding RepeatedFieldEncodingDefaultValue = global::Google.Protobuf.Reflection.FeatureSet.Types.RepeatedFieldEncoding.Unknown; - - private global::Google.Protobuf.Reflection.FeatureSet.Types.RepeatedFieldEncoding repeatedFieldEncoding_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet.Types.RepeatedFieldEncoding RepeatedFieldEncoding { - get { if ((_hasBits0 & 4) != 0) { return repeatedFieldEncoding_; } else { return RepeatedFieldEncodingDefaultValue; } } - set { - _hasBits0 |= 4; - repeatedFieldEncoding_ = value; - } - } - /// Gets whether the "repeated_field_encoding" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasRepeatedFieldEncoding { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "repeated_field_encoding" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearRepeatedFieldEncoding() { - _hasBits0 &= ~4; - } - - /// Field number for the "utf8_validation" field. - public const int Utf8ValidationFieldNumber = 4; - private readonly static global::Google.Protobuf.Reflection.FeatureSet.Types.Utf8Validation Utf8ValidationDefaultValue = global::Google.Protobuf.Reflection.FeatureSet.Types.Utf8Validation.Unknown; - - private global::Google.Protobuf.Reflection.FeatureSet.Types.Utf8Validation utf8Validation_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet.Types.Utf8Validation Utf8Validation { - get { if ((_hasBits0 & 8) != 0) { return utf8Validation_; } else { return Utf8ValidationDefaultValue; } } - set { - _hasBits0 |= 8; - utf8Validation_ = value; - } - } - /// Gets whether the "utf8_validation" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasUtf8Validation { - get { return (_hasBits0 & 8) != 0; } - } - /// Clears the value of the "utf8_validation" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearUtf8Validation() { - _hasBits0 &= ~8; - } - - /// Field number for the "message_encoding" field. - public const int MessageEncodingFieldNumber = 5; - private readonly static global::Google.Protobuf.Reflection.FeatureSet.Types.MessageEncoding MessageEncodingDefaultValue = global::Google.Protobuf.Reflection.FeatureSet.Types.MessageEncoding.Unknown; - - private global::Google.Protobuf.Reflection.FeatureSet.Types.MessageEncoding messageEncoding_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet.Types.MessageEncoding MessageEncoding { - get { if ((_hasBits0 & 16) != 0) { return messageEncoding_; } else { return MessageEncodingDefaultValue; } } - set { - _hasBits0 |= 16; - messageEncoding_ = value; - } - } - /// Gets whether the "message_encoding" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasMessageEncoding { - get { return (_hasBits0 & 16) != 0; } - } - /// Clears the value of the "message_encoding" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMessageEncoding() { - _hasBits0 &= ~16; - } - - /// Field number for the "json_format" field. - public const int JsonFormatFieldNumber = 6; - private readonly static global::Google.Protobuf.Reflection.FeatureSet.Types.JsonFormat JsonFormatDefaultValue = global::Google.Protobuf.Reflection.FeatureSet.Types.JsonFormat.Unknown; - - private global::Google.Protobuf.Reflection.FeatureSet.Types.JsonFormat jsonFormat_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet.Types.JsonFormat JsonFormat { - get { if ((_hasBits0 & 32) != 0) { return jsonFormat_; } else { return JsonFormatDefaultValue; } } - set { - _hasBits0 |= 32; - jsonFormat_ = value; - } - } - /// Gets whether the "json_format" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasJsonFormat { - get { return (_hasBits0 & 32) != 0; } - } - /// Clears the value of the "json_format" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJsonFormat() { - _hasBits0 &= ~32; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FeatureSet); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FeatureSet other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (FieldPresence != other.FieldPresence) return false; - if (EnumType != other.EnumType) return false; - if (RepeatedFieldEncoding != other.RepeatedFieldEncoding) return false; - if (Utf8Validation != other.Utf8Validation) return false; - if (MessageEncoding != other.MessageEncoding) return false; - if (JsonFormat != other.JsonFormat) return false; - if (!Equals(_extensions, other._extensions)) { - return false; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasFieldPresence) hash ^= FieldPresence.GetHashCode(); - if (HasEnumType) hash ^= EnumType.GetHashCode(); - if (HasRepeatedFieldEncoding) hash ^= RepeatedFieldEncoding.GetHashCode(); - if (HasUtf8Validation) hash ^= Utf8Validation.GetHashCode(); - if (HasMessageEncoding) hash ^= MessageEncoding.GetHashCode(); - if (HasJsonFormat) hash ^= JsonFormat.GetHashCode(); - if (_extensions != null) { - hash ^= _extensions.GetHashCode(); - } - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasFieldPresence) { - output.WriteRawTag(8); - output.WriteEnum((int) FieldPresence); - } - if (HasEnumType) { - output.WriteRawTag(16); - output.WriteEnum((int) EnumType); - } - if (HasRepeatedFieldEncoding) { - output.WriteRawTag(24); - output.WriteEnum((int) RepeatedFieldEncoding); - } - if (HasUtf8Validation) { - output.WriteRawTag(32); - output.WriteEnum((int) Utf8Validation); - } - if (HasMessageEncoding) { - output.WriteRawTag(40); - output.WriteEnum((int) MessageEncoding); - } - if (HasJsonFormat) { - output.WriteRawTag(48); - output.WriteEnum((int) JsonFormat); - } - if (_extensions != null) { - _extensions.WriteTo(output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasFieldPresence) { - output.WriteRawTag(8); - output.WriteEnum((int) FieldPresence); - } - if (HasEnumType) { - output.WriteRawTag(16); - output.WriteEnum((int) EnumType); - } - if (HasRepeatedFieldEncoding) { - output.WriteRawTag(24); - output.WriteEnum((int) RepeatedFieldEncoding); - } - if (HasUtf8Validation) { - output.WriteRawTag(32); - output.WriteEnum((int) Utf8Validation); - } - if (HasMessageEncoding) { - output.WriteRawTag(40); - output.WriteEnum((int) MessageEncoding); - } - if (HasJsonFormat) { - output.WriteRawTag(48); - output.WriteEnum((int) JsonFormat); - } - if (_extensions != null) { - _extensions.WriteTo(ref output); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasFieldPresence) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) FieldPresence); - } - if (HasEnumType) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumType); - } - if (HasRepeatedFieldEncoding) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RepeatedFieldEncoding); - } - if (HasUtf8Validation) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Utf8Validation); - } - if (HasMessageEncoding) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MessageEncoding); - } - if (HasJsonFormat) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) JsonFormat); - } - if (_extensions != null) { - size += _extensions.CalculateSize(); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FeatureSet other) { - if (other == null) { - return; - } - if (other.HasFieldPresence) { - FieldPresence = other.FieldPresence; - } - if (other.HasEnumType) { - EnumType = other.EnumType; - } - if (other.HasRepeatedFieldEncoding) { - RepeatedFieldEncoding = other.RepeatedFieldEncoding; - } - if (other.HasUtf8Validation) { - Utf8Validation = other.Utf8Validation; - } - if (other.HasMessageEncoding) { - MessageEncoding = other.MessageEncoding; - } - if (other.HasJsonFormat) { - JsonFormat = other.JsonFormat; - } - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - } - break; - case 8: { - FieldPresence = (global::Google.Protobuf.Reflection.FeatureSet.Types.FieldPresence) input.ReadEnum(); - break; - } - case 16: { - EnumType = (global::Google.Protobuf.Reflection.FeatureSet.Types.EnumType) input.ReadEnum(); - break; - } - case 24: { - RepeatedFieldEncoding = (global::Google.Protobuf.Reflection.FeatureSet.Types.RepeatedFieldEncoding) input.ReadEnum(); - break; - } - case 32: { - Utf8Validation = (global::Google.Protobuf.Reflection.FeatureSet.Types.Utf8Validation) input.ReadEnum(); - break; - } - case 40: { - MessageEncoding = (global::Google.Protobuf.Reflection.FeatureSet.Types.MessageEncoding) input.ReadEnum(); - break; - } - case 48: { - JsonFormat = (global::Google.Protobuf.Reflection.FeatureSet.Types.JsonFormat) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - } - break; - case 8: { - FieldPresence = (global::Google.Protobuf.Reflection.FeatureSet.Types.FieldPresence) input.ReadEnum(); - break; - } - case 16: { - EnumType = (global::Google.Protobuf.Reflection.FeatureSet.Types.EnumType) input.ReadEnum(); - break; - } - case 24: { - RepeatedFieldEncoding = (global::Google.Protobuf.Reflection.FeatureSet.Types.RepeatedFieldEncoding) input.ReadEnum(); - break; - } - case 32: { - Utf8Validation = (global::Google.Protobuf.Reflection.FeatureSet.Types.Utf8Validation) input.ReadEnum(); - break; - } - case 40: { - MessageEncoding = (global::Google.Protobuf.Reflection.FeatureSet.Types.MessageEncoding) input.ReadEnum(); - break; - } - case 48: { - JsonFormat = (global::Google.Protobuf.Reflection.FeatureSet.Types.JsonFormat) input.ReadEnum(); - break; - } - } - } - } - #endif - - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); - } - public void SetExtension(pb::Extension extension, TValue value) { - pb::ExtensionSet.Set(ref _extensions, extension, value); - } - public bool HasExtension(pb::Extension extension) { - return pb::ExtensionSet.Has(ref _extensions, extension); - } - public void ClearExtension(pb::Extension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - public void ClearExtension(pb::RepeatedExtension extension) { - pb::ExtensionSet.Clear(ref _extensions, extension); - } - - #region Nested types - /// Container for nested types declared in the FeatureSet message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum FieldPresence { - [pbr::OriginalName("FIELD_PRESENCE_UNKNOWN")] Unknown = 0, - [pbr::OriginalName("EXPLICIT")] Explicit = 1, - [pbr::OriginalName("IMPLICIT")] Implicit = 2, - [pbr::OriginalName("LEGACY_REQUIRED")] LegacyRequired = 3, - } - - public enum EnumType { - [pbr::OriginalName("ENUM_TYPE_UNKNOWN")] Unknown = 0, - [pbr::OriginalName("OPEN")] Open = 1, - [pbr::OriginalName("CLOSED")] Closed = 2, - } - - public enum RepeatedFieldEncoding { - [pbr::OriginalName("REPEATED_FIELD_ENCODING_UNKNOWN")] Unknown = 0, - [pbr::OriginalName("PACKED")] Packed = 1, - [pbr::OriginalName("EXPANDED")] Expanded = 2, - } - - public enum Utf8Validation { - [pbr::OriginalName("UTF8_VALIDATION_UNKNOWN")] Unknown = 0, - [pbr::OriginalName("NONE")] None = 1, - [pbr::OriginalName("VERIFY")] Verify = 2, - } - - public enum MessageEncoding { - [pbr::OriginalName("MESSAGE_ENCODING_UNKNOWN")] Unknown = 0, - [pbr::OriginalName("LENGTH_PREFIXED")] LengthPrefixed = 1, - [pbr::OriginalName("DELIMITED")] Delimited = 2, - } - - public enum JsonFormat { - [pbr::OriginalName("JSON_FORMAT_UNKNOWN")] Unknown = 0, - [pbr::OriginalName("ALLOW")] Allow = 1, - [pbr::OriginalName("LEGACY_BEST_EFFORT")] LegacyBestEffort = 2, - } - - } - #endregion - - } - - /// - /// A compiled specification for the defaults of a set of features. These - /// messages are generated from FeatureSet extensions and can be used to seed - /// feature resolution. The resolution with this object becomes a simple search - /// for the closest matching edition, followed by proto merges. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FeatureSetDefaults : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FeatureSetDefaults()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[20]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSetDefaults() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSetDefaults(FeatureSetDefaults other) : this() { - _hasBits0 = other._hasBits0; - defaults_ = other.defaults_.Clone(); - minimumEdition_ = other.minimumEdition_; - maximumEdition_ = other.maximumEdition_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSetDefaults Clone() { - return new FeatureSetDefaults(this); - } - - /// Field number for the "defaults" field. - public const int DefaultsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_defaults_codec - = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FeatureSetDefaults.Types.FeatureSetEditionDefault.Parser); - private readonly pbc::RepeatedField defaults_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Defaults { - get { return defaults_; } - } - - /// Field number for the "minimum_edition" field. - public const int MinimumEditionFieldNumber = 4; - private readonly static global::Google.Protobuf.Reflection.Edition MinimumEditionDefaultValue = global::Google.Protobuf.Reflection.Edition.Unknown; - - private global::Google.Protobuf.Reflection.Edition minimumEdition_; - /// - /// The minimum supported edition (inclusive) when this was constructed. - /// Editions before this will not have defaults. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.Edition MinimumEdition { - get { if ((_hasBits0 & 1) != 0) { return minimumEdition_; } else { return MinimumEditionDefaultValue; } } - set { - _hasBits0 |= 1; - minimumEdition_ = value; - } - } - /// Gets whether the "minimum_edition" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasMinimumEdition { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "minimum_edition" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMinimumEdition() { - _hasBits0 &= ~1; - } - - /// Field number for the "maximum_edition" field. - public const int MaximumEditionFieldNumber = 5; - private readonly static global::Google.Protobuf.Reflection.Edition MaximumEditionDefaultValue = global::Google.Protobuf.Reflection.Edition.Unknown; - - private global::Google.Protobuf.Reflection.Edition maximumEdition_; - /// - /// The maximum known edition (inclusive) when this was constructed. Editions - /// after this will not have reliable defaults. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.Edition MaximumEdition { - get { if ((_hasBits0 & 2) != 0) { return maximumEdition_; } else { return MaximumEditionDefaultValue; } } - set { - _hasBits0 |= 2; - maximumEdition_ = value; - } - } - /// Gets whether the "maximum_edition" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasMaximumEdition { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "maximum_edition" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMaximumEdition() { - _hasBits0 &= ~2; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FeatureSetDefaults); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FeatureSetDefaults other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!defaults_.Equals(other.defaults_)) return false; - if (MinimumEdition != other.MinimumEdition) return false; - if (MaximumEdition != other.MaximumEdition) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= defaults_.GetHashCode(); - if (HasMinimumEdition) hash ^= MinimumEdition.GetHashCode(); - if (HasMaximumEdition) hash ^= MaximumEdition.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - defaults_.WriteTo(output, _repeated_defaults_codec); - if (HasMinimumEdition) { - output.WriteRawTag(32); - output.WriteEnum((int) MinimumEdition); - } - if (HasMaximumEdition) { - output.WriteRawTag(40); - output.WriteEnum((int) MaximumEdition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - defaults_.WriteTo(ref output, _repeated_defaults_codec); - if (HasMinimumEdition) { - output.WriteRawTag(32); - output.WriteEnum((int) MinimumEdition); - } - if (HasMaximumEdition) { - output.WriteRawTag(40); - output.WriteEnum((int) MaximumEdition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += defaults_.CalculateSize(_repeated_defaults_codec); - if (HasMinimumEdition) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MinimumEdition); - } - if (HasMaximumEdition) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MaximumEdition); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FeatureSetDefaults other) { - if (other == null) { - return; - } - defaults_.Add(other.defaults_); - if (other.HasMinimumEdition) { - MinimumEdition = other.MinimumEdition; - } - if (other.HasMaximumEdition) { - MaximumEdition = other.MaximumEdition; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - defaults_.AddEntriesFrom(input, _repeated_defaults_codec); - break; - } - case 32: { - MinimumEdition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - case 40: { - MaximumEdition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - defaults_.AddEntriesFrom(ref input, _repeated_defaults_codec); - break; - } - case 32: { - MinimumEdition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - case 40: { - MaximumEdition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the FeatureSetDefaults message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// A map from every known edition with a unique set of defaults to its - /// defaults. Not all editions may be contained here. For a given edition, - /// the defaults at the closest matching edition ordered at or before it should - /// be used. This field must be in strict ascending order by edition. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FeatureSetEditionDefault : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FeatureSetEditionDefault()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.FeatureSetDefaults.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSetEditionDefault() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSetEditionDefault(FeatureSetEditionDefault other) : this() { - _hasBits0 = other._hasBits0; - edition_ = other.edition_; - features_ = other.features_ != null ? other.features_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FeatureSetEditionDefault Clone() { - return new FeatureSetEditionDefault(this); - } - - /// Field number for the "edition" field. - public const int EditionFieldNumber = 3; - private readonly static global::Google.Protobuf.Reflection.Edition EditionDefaultValue = global::Google.Protobuf.Reflection.Edition.Unknown; - - private global::Google.Protobuf.Reflection.Edition edition_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.Edition Edition { - get { if ((_hasBits0 & 1) != 0) { return edition_; } else { return EditionDefaultValue; } } - set { - _hasBits0 |= 1; - edition_ = value; - } - } - /// Gets whether the "edition" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEdition { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "edition" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEdition() { - _hasBits0 &= ~1; - } - - /// Field number for the "features" field. - public const int FeaturesFieldNumber = 2; - private global::Google.Protobuf.Reflection.FeatureSet features_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.FeatureSet Features { - get { return features_; } - set { - features_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FeatureSetEditionDefault); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FeatureSetEditionDefault other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Edition != other.Edition) return false; - if (!object.Equals(Features, other.Features)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasEdition) hash ^= Edition.GetHashCode(); - if (features_ != null) hash ^= Features.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (features_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Features); - } - if (HasEdition) { - output.WriteRawTag(24); - output.WriteEnum((int) Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (features_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Features); - } - if (HasEdition) { - output.WriteRawTag(24); - output.WriteEnum((int) Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasEdition) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Edition); - } - if (features_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Features); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FeatureSetEditionDefault other) { - if (other == null) { - return; - } - if (other.HasEdition) { - Edition = other.Edition; - } - if (other.features_ != null) { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - Features.MergeFrom(other.Features); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 18: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 24: { - Edition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 18: { - if (features_ == null) { - Features = new global::Google.Protobuf.Reflection.FeatureSet(); - } - input.ReadMessage(Features); - break; - } - case 24: { - Edition = (global::Google.Protobuf.Reflection.Edition) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - /// - /// Encapsulates information about the original source file from which a - /// FileDescriptorProto was generated. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class SourceCodeInfo : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceCodeInfo()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[21]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SourceCodeInfo() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SourceCodeInfo(SourceCodeInfo other) : this() { - location_ = other.location_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SourceCodeInfo Clone() { - return new SourceCodeInfo(this); - } - - /// Field number for the "location" field. - public const int LocationFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_location_codec - = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location.Parser); - private readonly pbc::RepeatedField location_ = new pbc::RepeatedField(); - /// - /// A Location identifies a piece of source code in a .proto file which - /// corresponds to a particular definition. This information is intended - /// to be useful to IDEs, code indexers, documentation generators, and similar - /// tools. - /// - /// For example, say we have a file like: - /// message Foo { - /// optional string foo = 1; - /// } - /// Let's look at just the field definition: - /// optional string foo = 1; - /// ^ ^^ ^^ ^ ^^^ - /// a bc de f ghi - /// We have the following locations: - /// span path represents - /// [a,i) [ 4, 0, 2, 0 ] The whole field definition. - /// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - /// [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - /// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - /// [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - /// - /// Notes: - /// - A location may refer to a repeated field itself (i.e. not to any - /// particular index within it). This is used whenever a set of elements are - /// logically enclosed in a single code segment. For example, an entire - /// extend block (possibly containing multiple extension definitions) will - /// have an outer location whose path refers to the "extensions" repeated - /// field without an index. - /// - Multiple locations may have the same path. This happens when a single - /// logical declaration is spread out across multiple places. The most - /// obvious example is the "extend" block again -- there may be multiple - /// extend blocks in the same scope, each of which will have the same path. - /// - A location's span is not always a subset of its parent's span. For - /// example, the "extendee" of an extension declaration appears at the - /// beginning of the "extend" block and is shared by all extensions within - /// the block. - /// - Just because a location's span is a subset of some other location's span - /// does not mean that it is a descendant. For example, a "group" defines - /// both a type and a field in a single declaration. Thus, the locations - /// corresponding to the type and field and their components will overlap. - /// - Code which tries to interpret locations should probably be designed to - /// ignore those that it doesn't understand, as more types of locations could - /// be recorded in the future. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Location { - get { return location_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as SourceCodeInfo); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(SourceCodeInfo other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!location_.Equals(other.location_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= location_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - location_.WriteTo(output, _repeated_location_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - location_.WriteTo(ref output, _repeated_location_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += location_.CalculateSize(_repeated_location_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(SourceCodeInfo other) { - if (other == null) { - return; - } - location_.Add(other.location_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - location_.AddEntriesFrom(input, _repeated_location_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - location_.AddEntriesFrom(ref input, _repeated_location_codec); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the SourceCodeInfo message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Location : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Location()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.SourceCodeInfo.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Location() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Location(Location other) : this() { - path_ = other.path_.Clone(); - span_ = other.span_.Clone(); - leadingComments_ = other.leadingComments_; - trailingComments_ = other.trailingComments_; - leadingDetachedComments_ = other.leadingDetachedComments_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Location Clone() { - return new Location(this); - } - - /// Field number for the "path" field. - public const int PathFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_path_codec - = pb::FieldCodec.ForInt32(10); - private readonly pbc::RepeatedField path_ = new pbc::RepeatedField(); - /// - /// Identifies which part of the FileDescriptorProto was defined at this - /// location. - /// - /// Each element is a field number or an index. They form a path from - /// the root FileDescriptorProto to the place where the definition occurs. - /// For example, this path: - /// [ 4, 3, 2, 7, 1 ] - /// refers to: - /// file.message_type(3) // 4, 3 - /// .field(7) // 2, 7 - /// .name() // 1 - /// This is because FileDescriptorProto.message_type has field number 4: - /// repeated DescriptorProto message_type = 4; - /// and DescriptorProto.field has field number 2: - /// repeated FieldDescriptorProto field = 2; - /// and FieldDescriptorProto.name has field number 1: - /// optional string name = 1; - /// - /// Thus, the above path gives the location of a field name. If we removed - /// the last element: - /// [ 4, 3, 2, 7 ] - /// this path refers to the whole field declaration (from the beginning - /// of the label to the terminating semicolon). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Path { - get { return path_; } - } - - /// Field number for the "span" field. - public const int SpanFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_span_codec - = pb::FieldCodec.ForInt32(18); - private readonly pbc::RepeatedField span_ = new pbc::RepeatedField(); - /// - /// Always has exactly three or four elements: start line, start column, - /// end line (optional, otherwise assumed same as start line), end column. - /// These are packed into a single field for efficiency. Note that line - /// and column numbers are zero-based -- typically you will want to add - /// 1 to each before displaying to a user. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Span { - get { return span_; } - } - - /// Field number for the "leading_comments" field. - public const int LeadingCommentsFieldNumber = 3; - private readonly static string LeadingCommentsDefaultValue = ""; - - private string leadingComments_; - /// - /// If this SourceCodeInfo represents a complete declaration, these are any - /// comments appearing before and after the declaration which appear to be - /// attached to the declaration. - /// - /// A series of line comments appearing on consecutive lines, with no other - /// tokens appearing on those lines, will be treated as a single comment. - /// - /// leading_detached_comments will keep paragraphs of comments that appear - /// before (but not connected to) the current element. Each paragraph, - /// separated by empty lines, will be one comment element in the repeated - /// field. - /// - /// Only the comment content is provided; comment markers (e.g. //) are - /// stripped out. For block comments, leading whitespace and an asterisk - /// will be stripped from the beginning of each line other than the first. - /// Newlines are included in the output. - /// - /// Examples: - /// - /// optional int32 foo = 1; // Comment attached to foo. - /// // Comment attached to bar. - /// optional int32 bar = 2; - /// - /// optional string baz = 3; - /// // Comment attached to baz. - /// // Another line attached to baz. - /// - /// // Comment attached to moo. - /// // - /// // Another line attached to moo. - /// optional double moo = 4; - /// - /// // Detached comment for corge. This is not leading or trailing comments - /// // to moo or corge because there are blank lines separating it from - /// // both. - /// - /// // Detached comment for corge paragraph 2. - /// - /// optional string corge = 5; - /// /* Block comment attached - /// * to corge. Leading asterisks - /// * will be removed. */ - /// /* Block comment attached to - /// * grault. */ - /// optional int32 grault = 6; - /// - /// // ignored detached comments. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string LeadingComments { - get { return leadingComments_ ?? LeadingCommentsDefaultValue; } - set { - leadingComments_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "leading_comments" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasLeadingComments { - get { return leadingComments_ != null; } - } - /// Clears the value of the "leading_comments" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearLeadingComments() { - leadingComments_ = null; - } - - /// Field number for the "trailing_comments" field. - public const int TrailingCommentsFieldNumber = 4; - private readonly static string TrailingCommentsDefaultValue = ""; - - private string trailingComments_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string TrailingComments { - get { return trailingComments_ ?? TrailingCommentsDefaultValue; } - set { - trailingComments_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "trailing_comments" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasTrailingComments { - get { return trailingComments_ != null; } - } - /// Clears the value of the "trailing_comments" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearTrailingComments() { - trailingComments_ = null; - } - - /// Field number for the "leading_detached_comments" field. - public const int LeadingDetachedCommentsFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_leadingDetachedComments_codec - = pb::FieldCodec.ForString(50); - private readonly pbc::RepeatedField leadingDetachedComments_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField LeadingDetachedComments { - get { return leadingDetachedComments_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Location); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Location other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!path_.Equals(other.path_)) return false; - if(!span_.Equals(other.span_)) return false; - if (LeadingComments != other.LeadingComments) return false; - if (TrailingComments != other.TrailingComments) return false; - if(!leadingDetachedComments_.Equals(other.leadingDetachedComments_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= path_.GetHashCode(); - hash ^= span_.GetHashCode(); - if (HasLeadingComments) hash ^= LeadingComments.GetHashCode(); - if (HasTrailingComments) hash ^= TrailingComments.GetHashCode(); - hash ^= leadingDetachedComments_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - path_.WriteTo(output, _repeated_path_codec); - span_.WriteTo(output, _repeated_span_codec); - if (HasLeadingComments) { - output.WriteRawTag(26); - output.WriteString(LeadingComments); - } - if (HasTrailingComments) { - output.WriteRawTag(34); - output.WriteString(TrailingComments); - } - leadingDetachedComments_.WriteTo(output, _repeated_leadingDetachedComments_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - path_.WriteTo(ref output, _repeated_path_codec); - span_.WriteTo(ref output, _repeated_span_codec); - if (HasLeadingComments) { - output.WriteRawTag(26); - output.WriteString(LeadingComments); - } - if (HasTrailingComments) { - output.WriteRawTag(34); - output.WriteString(TrailingComments); - } - leadingDetachedComments_.WriteTo(ref output, _repeated_leadingDetachedComments_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += path_.CalculateSize(_repeated_path_codec); - size += span_.CalculateSize(_repeated_span_codec); - if (HasLeadingComments) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(LeadingComments); - } - if (HasTrailingComments) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TrailingComments); - } - size += leadingDetachedComments_.CalculateSize(_repeated_leadingDetachedComments_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Location other) { - if (other == null) { - return; - } - path_.Add(other.path_); - span_.Add(other.span_); - if (other.HasLeadingComments) { - LeadingComments = other.LeadingComments; - } - if (other.HasTrailingComments) { - TrailingComments = other.TrailingComments; - } - leadingDetachedComments_.Add(other.leadingDetachedComments_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: - case 8: { - path_.AddEntriesFrom(input, _repeated_path_codec); - break; - } - case 18: - case 16: { - span_.AddEntriesFrom(input, _repeated_span_codec); - break; - } - case 26: { - LeadingComments = input.ReadString(); - break; - } - case 34: { - TrailingComments = input.ReadString(); - break; - } - case 50: { - leadingDetachedComments_.AddEntriesFrom(input, _repeated_leadingDetachedComments_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: - case 8: { - path_.AddEntriesFrom(ref input, _repeated_path_codec); - break; - } - case 18: - case 16: { - span_.AddEntriesFrom(ref input, _repeated_span_codec); - break; - } - case 26: { - LeadingComments = input.ReadString(); - break; - } - case 34: { - TrailingComments = input.ReadString(); - break; - } - case 50: { - leadingDetachedComments_.AddEntriesFrom(ref input, _repeated_leadingDetachedComments_codec); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - /// - /// Describes the relationship between generated code and its original source - /// file. A GeneratedCodeInfo message is associated with only one generated - /// source file, but may contain references to different source .proto files. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class GeneratedCodeInfo : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GeneratedCodeInfo()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[22]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GeneratedCodeInfo() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GeneratedCodeInfo(GeneratedCodeInfo other) : this() { - annotation_ = other.annotation_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GeneratedCodeInfo Clone() { - return new GeneratedCodeInfo(this); - } - - /// Field number for the "annotation" field. - public const int AnnotationFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_annotation_codec - = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Parser); - private readonly pbc::RepeatedField annotation_ = new pbc::RepeatedField(); - /// - /// An Annotation connects some span of text in generated code to an element - /// of its generating .proto file. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Annotation { - get { return annotation_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as GeneratedCodeInfo); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GeneratedCodeInfo other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!annotation_.Equals(other.annotation_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= annotation_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - annotation_.WriteTo(output, _repeated_annotation_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - annotation_.WriteTo(ref output, _repeated_annotation_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += annotation_.CalculateSize(_repeated_annotation_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GeneratedCodeInfo other) { - if (other == null) { - return; - } - annotation_.Add(other.annotation_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - annotation_.AddEntriesFrom(input, _repeated_annotation_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - annotation_.AddEntriesFrom(ref input, _repeated_annotation_codec); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the GeneratedCodeInfo message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Annotation : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Annotation()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Reflection.GeneratedCodeInfo.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Annotation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Annotation(Annotation other) : this() { - _hasBits0 = other._hasBits0; - path_ = other.path_.Clone(); - sourceFile_ = other.sourceFile_; - begin_ = other.begin_; - end_ = other.end_; - semantic_ = other.semantic_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Annotation Clone() { - return new Annotation(this); - } - - /// Field number for the "path" field. - public const int PathFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_path_codec - = pb::FieldCodec.ForInt32(10); - private readonly pbc::RepeatedField path_ = new pbc::RepeatedField(); - /// - /// Identifies the element in the original source .proto file. This field - /// is formatted the same as SourceCodeInfo.Location.path. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Path { - get { return path_; } - } - - /// Field number for the "source_file" field. - public const int SourceFileFieldNumber = 2; - private readonly static string SourceFileDefaultValue = ""; - - private string sourceFile_; - /// - /// Identifies the filesystem path to the original source .proto. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string SourceFile { - get { return sourceFile_ ?? SourceFileDefaultValue; } - set { - sourceFile_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// Gets whether the "source_file" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSourceFile { - get { return sourceFile_ != null; } - } - /// Clears the value of the "source_file" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSourceFile() { - sourceFile_ = null; - } - - /// Field number for the "begin" field. - public const int BeginFieldNumber = 3; - private readonly static int BeginDefaultValue = 0; - - private int begin_; - /// - /// Identifies the starting offset in bytes in the generated code - /// that relates to the identified object. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Begin { - get { if ((_hasBits0 & 1) != 0) { return begin_; } else { return BeginDefaultValue; } } - set { - _hasBits0 |= 1; - begin_ = value; - } - } - /// Gets whether the "begin" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasBegin { - get { return (_hasBits0 & 1) != 0; } - } - /// Clears the value of the "begin" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearBegin() { - _hasBits0 &= ~1; - } - - /// Field number for the "end" field. - public const int EndFieldNumber = 4; - private readonly static int EndDefaultValue = 0; - - private int end_; - /// - /// Identifies the ending offset in bytes in the generated code that - /// relates to the identified object. The end offset should be one past - /// the last relevant byte (so the length of the text = end - begin). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int End { - get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } - set { - _hasBits0 |= 2; - end_ = value; - } - } - /// Gets whether the "end" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasEnd { - get { return (_hasBits0 & 2) != 0; } - } - /// Clears the value of the "end" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearEnd() { - _hasBits0 &= ~2; - } - - /// Field number for the "semantic" field. - public const int SemanticFieldNumber = 5; - private readonly static global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Types.Semantic SemanticDefaultValue = global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Types.Semantic.None; - - private global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Types.Semantic semantic_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Types.Semantic Semantic { - get { if ((_hasBits0 & 4) != 0) { return semantic_; } else { return SemanticDefaultValue; } } - set { - _hasBits0 |= 4; - semantic_ = value; - } - } - /// Gets whether the "semantic" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasSemantic { - get { return (_hasBits0 & 4) != 0; } - } - /// Clears the value of the "semantic" field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearSemantic() { - _hasBits0 &= ~4; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Annotation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Annotation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!path_.Equals(other.path_)) return false; - if (SourceFile != other.SourceFile) return false; - if (Begin != other.Begin) return false; - if (End != other.End) return false; - if (Semantic != other.Semantic) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= path_.GetHashCode(); - if (HasSourceFile) hash ^= SourceFile.GetHashCode(); - if (HasBegin) hash ^= Begin.GetHashCode(); - if (HasEnd) hash ^= End.GetHashCode(); - if (HasSemantic) hash ^= Semantic.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - path_.WriteTo(output, _repeated_path_codec); - if (HasSourceFile) { - output.WriteRawTag(18); - output.WriteString(SourceFile); - } - if (HasBegin) { - output.WriteRawTag(24); - output.WriteInt32(Begin); - } - if (HasEnd) { - output.WriteRawTag(32); - output.WriteInt32(End); - } - if (HasSemantic) { - output.WriteRawTag(40); - output.WriteEnum((int) Semantic); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - path_.WriteTo(ref output, _repeated_path_codec); - if (HasSourceFile) { - output.WriteRawTag(18); - output.WriteString(SourceFile); - } - if (HasBegin) { - output.WriteRawTag(24); - output.WriteInt32(Begin); - } - if (HasEnd) { - output.WriteRawTag(32); - output.WriteInt32(End); - } - if (HasSemantic) { - output.WriteRawTag(40); - output.WriteEnum((int) Semantic); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += path_.CalculateSize(_repeated_path_codec); - if (HasSourceFile) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(SourceFile); - } - if (HasBegin) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Begin); - } - if (HasEnd) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(End); - } - if (HasSemantic) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Semantic); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Annotation other) { - if (other == null) { - return; - } - path_.Add(other.path_); - if (other.HasSourceFile) { - SourceFile = other.SourceFile; - } - if (other.HasBegin) { - Begin = other.Begin; - } - if (other.HasEnd) { - End = other.End; - } - if (other.HasSemantic) { - Semantic = other.Semantic; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: - case 8: { - path_.AddEntriesFrom(input, _repeated_path_codec); - break; - } - case 18: { - SourceFile = input.ReadString(); - break; - } - case 24: { - Begin = input.ReadInt32(); - break; - } - case 32: { - End = input.ReadInt32(); - break; - } - case 40: { - Semantic = (global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Types.Semantic) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: - case 8: { - path_.AddEntriesFrom(ref input, _repeated_path_codec); - break; - } - case 18: { - SourceFile = input.ReadString(); - break; - } - case 24: { - Begin = input.ReadInt32(); - break; - } - case 32: { - End = input.ReadInt32(); - break; - } - case 40: { - Semantic = (global::Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation.Types.Semantic) input.ReadEnum(); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the Annotation message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// Represents the identified object's effect on the element in the original - /// .proto file. - /// - public enum Semantic { - /// - /// There is no effect or the effect is indescribable. - /// - [pbr::OriginalName("NONE")] None = 0, - /// - /// The element is set or otherwise mutated. - /// - [pbr::OriginalName("SET")] Set = 1, - /// - /// An alias to the element is returned. - /// - [pbr::OriginalName("ALIAS")] Alias = 2, - } - - } - #endregion - - } - - } - #endregion - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs index e70b23ad1f69f629cbdf30565b9bccdec876dc78..6befbf1c2b0efeafcbc672894eaaf5ea5ea9d500 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs @@ -1,21 +1,42 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.Collections.Generic; -using System.Diagnostics; namespace Google.Protobuf.Reflection { /// /// Base class for nearly all descriptors, providing common functionality. /// - [DebuggerDisplay("Type = {GetType().Name,nq}, FullName = {FullName}")] public abstract class DescriptorBase : IDescriptor { internal DescriptorBase(FileDescriptor file, string fullName, int index) diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs index eab8095f05cfb794dc12407da3c448dd1bc980f7..b22048f0a8cb70476c37c97405951f5b7e18e4f0 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs @@ -1,15 +1,40 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2018 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; +using System.Text; using static Google.Protobuf.Reflection.SourceCodeInfo.Types; namespace Google.Protobuf.Reflection diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs index 060843677b958c4f7f45278429fb49123f6ddacb..93f2fa9a4aef8563e23702b23cff536de04975ed 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs @@ -1,15 +1,39 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Collections.Generic; using System.Text; +using System.Text.RegularExpressions; namespace Google.Protobuf.Reflection { @@ -27,11 +51,12 @@ namespace Google.Protobuf.Reflection private readonly IDictionary, EnumValueDescriptor> enumValuesByNumber = new Dictionary, EnumValueDescriptor>(); - private readonly HashSet dependencies = new HashSet(); + private readonly HashSet dependencies; internal DescriptorPool(IEnumerable dependencyFiles) { - foreach (FileDescriptor dependencyFile in dependencyFiles) + dependencies = new HashSet(); + foreach (var dependencyFile in dependencyFiles) { dependencies.Add(dependencyFile); ImportPublicDependencies(dependencyFile); @@ -63,8 +88,10 @@ namespace Google.Protobuf.Reflection /// or null if the symbol doesn't exist or has the wrong type internal T FindSymbol(string fullName) where T : class { - descriptorsByName.TryGetValue(fullName, out IDescriptor result); - if (result is T descriptor) + IDescriptor result; + descriptorsByName.TryGetValue(fullName, out result); + T descriptor = result as T; + if (descriptor != null) { return descriptor; } @@ -104,9 +131,10 @@ namespace Google.Protobuf.Reflection name = fullName; } - if (descriptorsByName.TryGetValue(fullName, out IDescriptor old)) + IDescriptor old; + if (descriptorsByName.TryGetValue(fullName, out old)) { - if (old is not PackageDescriptor) + if (!(old is PackageDescriptor)) { throw new DescriptorValidationException(file, "\"" + name + @@ -125,9 +153,10 @@ namespace Google.Protobuf.Reflection internal void AddSymbol(IDescriptor descriptor) { ValidateSymbolName(descriptor); - string fullName = descriptor.FullName; + String fullName = descriptor.FullName; - if (descriptorsByName.TryGetValue(fullName, out IDescriptor old)) + IDescriptor old; + if (descriptorsByName.TryGetValue(fullName, out old)) { int dotPos = fullName.LastIndexOf('.'); string message; @@ -152,6 +181,9 @@ namespace Google.Protobuf.Reflection descriptorsByName[fullName] = descriptor; } + private static readonly Regex ValidationRegex = new Regex("^[_A-Za-z][_A-Za-z0-9]*$", + FrameworkPortability.CompiledRegexWhereAvailable); + /// /// Verifies that the descriptor's name is valid (i.e. it contains /// only letters, digits and underscores, and does not start with a digit). @@ -159,28 +191,15 @@ namespace Google.Protobuf.Reflection /// private static void ValidateSymbolName(IDescriptor descriptor) { - if (descriptor.Name.Length == 0) + if (descriptor.Name == "") { throw new DescriptorValidationException(descriptor, "Missing name."); } - - // Symbol name must start with a letter or underscore, and it can contain letters, - // numbers and underscores. - string name = descriptor.Name; - if (!IsAsciiLetter(name[0]) && name[0] != '_') { - ThrowInvalidSymbolNameException(descriptor); - } - for (int i = 1; i < name.Length; i++) { - if (!IsAsciiLetter(name[i]) && !IsAsciiDigit(name[i]) && name[i] != '_') { - ThrowInvalidSymbolNameException(descriptor); - } + if (!ValidationRegex.IsMatch(descriptor.Name)) + { + throw new DescriptorValidationException(descriptor, + "\"" + descriptor.Name + "\" is not a valid identifier."); } - - static bool IsAsciiLetter(char c) => (uint)((c | 0x20) - 'a') <= 'z' - 'a'; - static bool IsAsciiDigit(char c) => (uint)(c - '0') <= '9' - '0'; - static void ThrowInvalidSymbolNameException(IDescriptor descriptor) => - throw new DescriptorValidationException( - descriptor, "\"" + descriptor.Name + "\" is not a valid identifier."); } /// @@ -189,13 +208,15 @@ namespace Google.Protobuf.Reflection /// internal FieldDescriptor FindFieldByNumber(MessageDescriptor messageDescriptor, int number) { - fieldsByNumber.TryGetValue(new ObjectIntPair(messageDescriptor, number), out FieldDescriptor ret); + FieldDescriptor ret; + fieldsByNumber.TryGetValue(new ObjectIntPair(messageDescriptor, number), out ret); return ret; } internal EnumValueDescriptor FindEnumValueByNumber(EnumDescriptor enumDescriptor, int number) { - enumValuesByNumber.TryGetValue(new ObjectIntPair(enumDescriptor, number), out EnumValueDescriptor ret); + EnumValueDescriptor ret; + enumValuesByNumber.TryGetValue(new ObjectIntPair(enumDescriptor, number), out ret); return ret; } @@ -208,7 +229,8 @@ namespace Google.Protobuf.Reflection { // for extensions, we use the extended type, otherwise we use the containing type ObjectIntPair key = new ObjectIntPair(field.Proto.HasExtendee ? field.ExtendeeType : field.ContainingType, field.FieldNumber); - if (fieldsByNumber.TryGetValue(key, out FieldDescriptor old)) + FieldDescriptor old; + if (fieldsByNumber.TryGetValue(key, out old)) { throw new DescriptorValidationException(field, "Field number " + field.FieldNumber + "has already been used in \"" + diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs index 4ba9c5c98596552ac7c439e5abe5cdddd8b69083..f5570fc40a24f9e91017280b4f6389607be6e1a7 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.Collections.Generic; diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs index e55c3b8886b4dd91a7943be06a66df049f1f64a5..143671dbd44479cf5de79832c5f5e4fb377e39df 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -17,16 +40,25 @@ namespace Google.Protobuf.Reflection /// public sealed class DescriptorValidationException : Exception { + private readonly String name; + private readonly string description; + /// /// The full name of the descriptor where the error occurred. /// - public string ProblemSymbolName { get; } + public String ProblemSymbolName + { + get { return name; } + } /// /// A human-readable description of the error. (The Message property /// is made up of the descriptor's name and this description.) /// - public string Description { get; } + public string Description + { + get { return description; } + } internal DescriptorValidationException(IDescriptor problemDescriptor, string description) : base(problemDescriptor.FullName + ": " + description) @@ -34,15 +66,15 @@ namespace Google.Protobuf.Reflection // Note that problemDescriptor may be partially uninitialized, so we // don't want to expose it directly to the user. So, we only provide // the name and the original proto. - ProblemSymbolName = problemDescriptor.FullName; - Description = description; + name = problemDescriptor.FullName; + this.description = description; } internal DescriptorValidationException(IDescriptor problemDescriptor, string description, Exception cause) : base(problemDescriptor.FullName + ": " + description, cause) { - ProblemSymbolName = problemDescriptor.FullName; - Description = description; + name = problemDescriptor.FullName; + this.description = description; } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs index c13a65e5b685feaeece9b6d3965588c9ec2bb60f..f7e8b5b5f28db1ff47b9d5cee95c685966b01cdf 100644 --- a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; @@ -18,12 +41,17 @@ namespace Google.Protobuf.Reflection /// public sealed class EnumDescriptor : DescriptorBase { + private readonly EnumDescriptorProto proto; + private readonly MessageDescriptor containingType; + private readonly IList values; + private readonly Type clrType; + internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index, Type clrType) : base(file, file.ComputeFullName(parent, proto.Name), index) { - Proto = proto; - ClrType = clrType; - ContainingType = parent; + this.proto = proto; + this.clrType = clrType; + containingType = parent; if (proto.Value.Count == 0) { @@ -32,48 +60,50 @@ namespace Google.Protobuf.Reflection throw new DescriptorValidationException(this, "Enums must contain at least one value."); } - Values = DescriptorUtil.ConvertAndMakeReadOnly(proto.Value, + values = DescriptorUtil.ConvertAndMakeReadOnly(proto.Value, (value, i) => new EnumValueDescriptor(value, file, this, i)); File.DescriptorPool.AddSymbol(this); } - internal EnumDescriptorProto Proto { get; } - - /// - /// Returns a clone of the underlying describing this enum. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this enum descriptor. - public EnumDescriptorProto ToProto() => Proto.Clone(); + internal EnumDescriptorProto Proto { get { return proto; } } /// /// The brief name of the descriptor's target. /// - public override string Name => Proto.Name; + public override string Name { get { return proto.Name; } } - internal override IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) => - fieldNumber switch + internal override IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) + { + switch (fieldNumber) { - EnumDescriptorProto.ValueFieldNumber => (IReadOnlyList)Values, - _ => null, - }; + case EnumDescriptorProto.ValueFieldNumber: + return (IReadOnlyList) Values; + default: + return null; + } + } /// /// The CLR type for this enum. For generated code, this will be a CLR enum type. /// - public Type ClrType { get; } + public Type ClrType { get { return clrType; } } /// /// If this is a nested type, get the outer descriptor, otherwise null. /// - public MessageDescriptor ContainingType { get; } + public MessageDescriptor ContainingType + { + get { return containingType; } + } /// /// An unmodifiable list of defined value descriptors for this enum. /// - public IList Values { get; } + public IList Values + { + get { return values; } + } /// /// Finds an enum value by number. If multiple enum values have the diff --git a/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs index 37a40a991e8d7f91f003af165771d0e788f9cf6e..05097bd1da3d72c7ea304bb7a4cb3dab65bc3b05 100644 --- a/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; @@ -17,40 +40,35 @@ namespace Google.Protobuf.Reflection /// public sealed class EnumValueDescriptor : DescriptorBase { + private readonly EnumDescriptor enumDescriptor; + private readonly EnumValueDescriptorProto proto; + internal EnumValueDescriptor(EnumValueDescriptorProto proto, FileDescriptor file, EnumDescriptor parent, int index) : base(file, parent.FullName + "." + proto.Name, index) { - Proto = proto; - EnumDescriptor = parent; + this.proto = proto; + enumDescriptor = parent; file.DescriptorPool.AddSymbol(this); file.DescriptorPool.AddEnumValueByNumber(this); } - internal EnumValueDescriptorProto Proto { get; } - - /// - /// Returns a clone of the underlying describing this enum value. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this enum value descriptor. - public EnumValueDescriptorProto ToProto() => Proto.Clone(); + internal EnumValueDescriptorProto Proto { get { return proto; } } /// /// Returns the name of the enum value described by this object. /// - public override string Name => Proto.Name; + public override string Name { get { return proto.Name; } } /// /// Returns the number associated with this enum value. /// - public int Number => Proto.Number; + public int Number { get { return Proto.Number; } } /// /// Returns the enum descriptor that this value is part of. /// - public EnumDescriptor EnumDescriptor { get; } + public EnumDescriptor EnumDescriptor { get { return enumDescriptor; } } /// /// The (possibly empty) set of custom options for this enum value. diff --git a/csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs b/csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs index 72c36d5e18d8dff2674b80359d76bc7f6750fdf5..81d6e35f0132892d7d632fe13f4bac4becdb9bbb 100644 --- a/csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf.Reflection diff --git a/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs b/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs index 5ce2cfe50f67db5e6ce3a8459a67051227b1c05a..9664559df2490b5e543c97183345e0b390858ef3 100644 --- a/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs +++ b/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs @@ -1,15 +1,37 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Diagnostics; using System.Linq; namespace Google.Protobuf.Reflection @@ -17,8 +39,6 @@ namespace Google.Protobuf.Reflection /// /// A collection to simplify retrieving the descriptors of extensions in a descriptor for a message /// - [DebuggerDisplay("Count = {UnorderedExtensions.Count}")] - [DebuggerTypeProxy(typeof(ExtensionCollectionDebugView))] public sealed class ExtensionCollection { private IDictionary> extensionsByTypeInDeclarationOrder; @@ -73,7 +93,7 @@ namespace Google.Protobuf.Reflection /// /// Returns a readonly list of all the extensions define in this type that extend - /// the provided descriptor type in ascending field order + /// the provided descriptor type in accending field order /// public IList GetExtensionsInNumberOrder(MessageDescriptor descriptor) { @@ -87,7 +107,8 @@ namespace Google.Protobuf.Reflection { descriptor.CrossLink(); - if (!declarationOrder.TryGetValue(descriptor.ExtendeeType, out IList list)) + IList list; + if (!declarationOrder.TryGetValue(descriptor.ExtendeeType, out list)) { list = new List(); declarationOrder.Add(descriptor.ExtendeeType, list); @@ -101,18 +122,5 @@ namespace Google.Protobuf.Reflection extensionsByTypeInNumberOrder = declarationOrder .ToDictionary(kvp => kvp.Key, kvp => (IList)new ReadOnlyCollection(kvp.Value.OrderBy(field => field.FieldNumber).ToArray())); } - - private sealed class ExtensionCollectionDebugView - { - private readonly ExtensionCollection list; - - public ExtensionCollectionDebugView(ExtensionCollection list) - { - this.list = list; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public FieldDescriptor[] Items => list.UnorderedExtensions.ToArray(); - } } } diff --git a/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs b/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs index 456a8ad54070177e30bb38e9adc754687f540441..85b7d39a8337ae9fe199439183059a0d68a2e65d 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -19,14 +42,15 @@ namespace Google.Protobuf.Reflection internal abstract class FieldAccessorBase : IFieldAccessor { private readonly Func getValueDelegate; + private readonly FieldDescriptor descriptor; internal FieldAccessorBase(PropertyInfo property, FieldDescriptor descriptor) { - Descriptor = descriptor; + this.descriptor = descriptor; getValueDelegate = ReflectionUtil.CreateFuncIMessageObject(property.GetGetMethod()); } - public FieldDescriptor Descriptor { get; } + public FieldDescriptor Descriptor { get { return descriptor; } } public object GetValue(IMessage message) { diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index 56378bed99d4e840bfe63276fd21db68069cdbfc..7324e3dfc6381417897a2685ed89fc527633c5df 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; @@ -22,6 +45,7 @@ namespace Google.Protobuf.Reflection private MessageDescriptor extendeeType; private MessageDescriptor messageType; private FieldType fieldType; + private readonly string propertyName; // Annoyingly, needed in Crosslink. private IFieldAccessor accessor; /// @@ -46,11 +70,6 @@ namespace Google.Protobuf.Reflection /// public string JsonName { get; } - /// - /// The name of the property in the ContainingType.ClrType class. - /// - public string PropertyName { get; } - /// /// Indicates whether this field supports presence, either implicitly (e.g. due to it being a message /// type field) or explicitly via Has/Clear members. If this returns true, it is safe to call @@ -68,14 +87,6 @@ namespace Google.Protobuf.Reflection internal FieldDescriptorProto Proto { get; } - /// - /// Returns a clone of the underlying describing this field. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this field descriptor. - public FieldDescriptorProto ToProto() => Proto.Clone(); - /// /// An extension identifier for this field, or null if this field isn't an extension. /// @@ -112,7 +123,7 @@ namespace Google.Protobuf.Reflection // for later. // We could trust the generated code and check whether the type of the property is // a MapField, but that feels a tad nasty. - PropertyName = propertyName; + this.propertyName = propertyName; Extension = extension; JsonName = Proto.JsonName == "" ? JsonFormatter.ToJsonName(Proto.Name) : Proto.JsonName; } @@ -153,28 +164,47 @@ namespace Google.Protobuf.Reflection /// private static FieldType GetFieldTypeFromProtoType(FieldDescriptorProto.Types.Type type) { - return type switch + switch (type) { - FieldDescriptorProto.Types.Type.Double => FieldType.Double, - FieldDescriptorProto.Types.Type.Float => FieldType.Float, - FieldDescriptorProto.Types.Type.Int64 => FieldType.Int64, - FieldDescriptorProto.Types.Type.Uint64 => FieldType.UInt64, - FieldDescriptorProto.Types.Type.Int32 => FieldType.Int32, - FieldDescriptorProto.Types.Type.Fixed64 => FieldType.Fixed64, - FieldDescriptorProto.Types.Type.Fixed32 => FieldType.Fixed32, - FieldDescriptorProto.Types.Type.Bool => FieldType.Bool, - FieldDescriptorProto.Types.Type.String => FieldType.String, - FieldDescriptorProto.Types.Type.Group => FieldType.Group, - FieldDescriptorProto.Types.Type.Message => FieldType.Message, - FieldDescriptorProto.Types.Type.Bytes => FieldType.Bytes, - FieldDescriptorProto.Types.Type.Uint32 => FieldType.UInt32, - FieldDescriptorProto.Types.Type.Enum => FieldType.Enum, - FieldDescriptorProto.Types.Type.Sfixed32 => FieldType.SFixed32, - FieldDescriptorProto.Types.Type.Sfixed64 => FieldType.SFixed64, - FieldDescriptorProto.Types.Type.Sint32 => FieldType.SInt32, - FieldDescriptorProto.Types.Type.Sint64 => FieldType.SInt64, - _ => throw new ArgumentException("Invalid type specified"), - }; + case FieldDescriptorProto.Types.Type.Double: + return FieldType.Double; + case FieldDescriptorProto.Types.Type.Float: + return FieldType.Float; + case FieldDescriptorProto.Types.Type.Int64: + return FieldType.Int64; + case FieldDescriptorProto.Types.Type.Uint64: + return FieldType.UInt64; + case FieldDescriptorProto.Types.Type.Int32: + return FieldType.Int32; + case FieldDescriptorProto.Types.Type.Fixed64: + return FieldType.Fixed64; + case FieldDescriptorProto.Types.Type.Fixed32: + return FieldType.Fixed32; + case FieldDescriptorProto.Types.Type.Bool: + return FieldType.Bool; + case FieldDescriptorProto.Types.Type.String: + return FieldType.String; + case FieldDescriptorProto.Types.Type.Group: + return FieldType.Group; + case FieldDescriptorProto.Types.Type.Message: + return FieldType.Message; + case FieldDescriptorProto.Types.Type.Bytes: + return FieldType.Bytes; + case FieldDescriptorProto.Types.Type.Uint32: + return FieldType.UInt32; + case FieldDescriptorProto.Types.Type.Enum: + return FieldType.Enum; + case FieldDescriptorProto.Types.Type.Sfixed32: + return FieldType.SFixed32; + case FieldDescriptorProto.Types.Type.Sfixed64: + return FieldType.SFixed64; + case FieldDescriptorProto.Types.Type.Sint32: + return FieldType.SInt32; + case FieldDescriptorProto.Types.Type.Sint64: + return FieldType.SInt64; + default: + throw new ArgumentException("Invalid type specified"); + } } /// @@ -205,8 +235,7 @@ namespace Google.Protobuf.Reflection } else { - // Packed by default with proto3 - return Proto.Options == null || !Proto.Options.HasPacked || Proto.Options.Packed; + return !Proto.Options.HasPacked || Proto.Options.Packed; } } } @@ -349,11 +378,11 @@ namespace Google.Protobuf.Reflection if (fieldType == FieldType.Message || fieldType == FieldType.Group) { - if (typeDescriptor is not MessageDescriptor m) + if (!(typeDescriptor is MessageDescriptor)) { throw new DescriptorValidationException(this, $"\"{Proto.TypeName}\" is not a message type."); } - messageType = m; + messageType = (MessageDescriptor) typeDescriptor; if (Proto.HasDefaultValue) { @@ -362,11 +391,11 @@ namespace Google.Protobuf.Reflection } else if (fieldType == FieldType.Enum) { - if (typeDescriptor is not EnumDescriptor e) + if (!(typeDescriptor is EnumDescriptor)) { throw new DescriptorValidationException(this, $"\"{Proto.TypeName}\" is not an enum type."); } - enumType = e; + enumType = (EnumDescriptor) typeDescriptor; } else { @@ -407,19 +436,19 @@ namespace Google.Protobuf.Reflection // If we're given no property name, that's because we really don't want an accessor. // This could be because it's a map message, or it could be that we're loading a FileDescriptor dynamically. // TODO: Support dynamic messages. - if (PropertyName == null) + if (propertyName == null) { return null; } - var property = ContainingType.ClrType.GetProperty(PropertyName); + var property = ContainingType.ClrType.GetProperty(propertyName); if (property == null) { - throw new DescriptorValidationException(this, $"Property {PropertyName} not found in {ContainingType.ClrType}"); + throw new DescriptorValidationException(this, $"Property {propertyName} not found in {ContainingType.ClrType}"); } return IsMap ? new MapFieldAccessor(property, this) : IsRepeated ? new RepeatedFieldAccessor(property, this) - : (IFieldAccessor) new SingleFieldAccessor(ContainingType.ClrType, property, this); + : (IFieldAccessor) new SingleFieldAccessor(property, this); } } } diff --git a/csharp/src/Google.Protobuf/Reflection/FieldType.cs b/csharp/src/Google.Protobuf/Reflection/FieldType.cs index 623f21e62279b1f73205f0a47ba280464df655e3..37af17915ee7e2ecdd8f46d0285155f3b16712fe 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldType.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldType.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf.Reflection diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index 8f257f42ca8b34839e944c55428644c711871883..88e4a9de9621c0419f9eb304d30e57ad995bacad 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; @@ -12,6 +35,7 @@ using Google.Protobuf.WellKnownTypes; using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; using System.Linq; using System.Threading; using static Google.Protobuf.Reflection.SourceCodeInfo.Types; @@ -149,18 +173,25 @@ namespace Google.Protobuf.Reflection return list[index]; } - private IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) => - fieldNumber switch + private IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) + { + switch (fieldNumber) { - FileDescriptorProto.ServiceFieldNumber => (IReadOnlyList)Services, - FileDescriptorProto.MessageTypeFieldNumber => (IReadOnlyList)MessageTypes, - FileDescriptorProto.EnumTypeFieldNumber => (IReadOnlyList)EnumTypes, - _ => null, - }; + case FileDescriptorProto.ServiceFieldNumber: + return (IReadOnlyList) Services; + case FileDescriptorProto.MessageTypeFieldNumber: + return (IReadOnlyList) MessageTypes; + case FileDescriptorProto.EnumTypeFieldNumber: + return (IReadOnlyList) EnumTypes; + default: + return null; + } + } internal DescriptorDeclaration GetDeclaration(IDescriptor descriptor) { - declarations.Value.TryGetValue(descriptor, out DescriptorDeclaration declaration); + DescriptorDeclaration declaration; + declarations.Value.TryGetValue(descriptor, out declaration); return declaration; } @@ -196,7 +227,8 @@ namespace Google.Protobuf.Reflection throw new DescriptorValidationException(@this, "Invalid public dependency index."); } string name = proto.Dependency[index]; - if (!nameToFileMap.TryGetValue(name, out FileDescriptor file)) + FileDescriptor file; + if (!nameToFileMap.TryGetValue(name, out file)) { if (!allowUnknownDependencies) { @@ -217,14 +249,6 @@ namespace Google.Protobuf.Reflection /// internal FileDescriptorProto Proto { get; } - /// - /// Returns a clone of the underlying describing this file. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this file descriptor. - public FileDescriptorProto ToProto() => Proto.Clone(); - /// /// The syntax of the file /// @@ -300,7 +324,7 @@ namespace Google.Protobuf.Reflection /// The unqualified type name to look for. /// The type of descriptor to look for /// The type's descriptor, or null if not found. - public T FindTypeByName(string name) + public T FindTypeByName(String name) where T : class, IDescriptor { // Don't allow looking up nested types. This will make optimization @@ -457,25 +481,23 @@ namespace Google.Protobuf.Reflection /// dependencies must come before the descriptor which depends on them. (If A depends on B, and B /// depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible /// with the order in which protoc provides descriptors to plugins. - /// The extension registry to use when parsing, or null if no extensions are required. /// The file descriptors corresponding to . - public static IReadOnlyList BuildFromByteStrings(IEnumerable descriptorData, ExtensionRegistry registry) + public static IReadOnlyList BuildFromByteStrings(IEnumerable descriptorData) { ProtoPreconditions.CheckNotNull(descriptorData, nameof(descriptorData)); - var parser = FileDescriptorProto.Parser.WithExtensionRegistry(registry); - // TODO: See if we can build a single DescriptorPool instead of building lots of them. // This will all behave correctly, but it's less efficient than we'd like. var descriptors = new List(); var descriptorsByName = new Dictionary(); foreach (var data in descriptorData) { - var proto = parser.ParseFrom(data); + var proto = FileDescriptorProto.Parser.ParseFrom(data); var dependencies = new List(); foreach (var dependencyName in proto.Dependency) { - if (!descriptorsByName.TryGetValue(dependencyName, out FileDescriptor dependency)) + FileDescriptor dependency; + if (!descriptorsByName.TryGetValue(dependencyName, out dependency)) { throw new ArgumentException($"Dependency missing: {dependencyName}"); } @@ -496,18 +518,6 @@ namespace Google.Protobuf.Reflection return new ReadOnlyCollection(descriptors); } - /// - /// Converts the given descriptor binary data into FileDescriptor objects. - /// Note: reflection using the returned FileDescriptors is not currently supported. - /// - /// The binary file descriptor proto data. Must not be null, and any - /// dependencies must come before the descriptor which depends on them. (If A depends on B, and B - /// depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible - /// with the order in which protoc provides descriptors to plugins. - /// The file descriptors corresponding to . - public static IReadOnlyList BuildFromByteStrings(IEnumerable descriptorData) => - BuildFromByteStrings(descriptorData, null); - /// /// Returns a that represents this instance. /// @@ -532,7 +542,7 @@ namespace Google.Protobuf.Reflection /// /// The file descriptor for descriptor.proto. /// - public static FileDescriptor DescriptorProtoFileDescriptor => DescriptorReflection.Descriptor; + public static FileDescriptor DescriptorProtoFileDescriptor { get { return DescriptorReflection.Descriptor; } } /// /// The (possibly empty) set of custom options for this file. diff --git a/csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs b/csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs index a4748c53db0a599ca78e959101612e05826989b3..479e177130fce64d15ea72bc060ff72bd15724ae 100644 --- a/csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs +++ b/csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs @@ -1,15 +1,35 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion - using System; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; namespace Google.Protobuf.Reflection { @@ -18,26 +38,16 @@ namespace Google.Protobuf.Reflection /// These are constructed as required, and are not long-lived. Hand-written code should /// never need to use this type. /// - [DebuggerDisplay("ClrType = {ClrType}")] public sealed class GeneratedClrTypeInfo { private static readonly string[] EmptyNames = new string[0]; private static readonly GeneratedClrTypeInfo[] EmptyCodeInfo = new GeneratedClrTypeInfo[0]; private static readonly Extension[] EmptyExtensions = new Extension[0]; - internal const DynamicallyAccessedMemberTypes MessageAccessibility = - // Creating types - DynamicallyAccessedMemberTypes.PublicConstructors | - // Getting and setting properties - DynamicallyAccessedMemberTypes.PublicProperties | - DynamicallyAccessedMemberTypes.NonPublicProperties | - // Calling presence methods - DynamicallyAccessedMemberTypes.PublicMethods; /// /// Irrelevant for file descriptors; the CLR type for the message for message descriptors. /// - [DynamicallyAccessedMembers(MessageAccessibility)] - public Type ClrType { get; } + public Type ClrType { get; private set; } /// /// Irrelevant for file descriptors; the parser for message descriptors. @@ -78,11 +88,7 @@ namespace Google.Protobuf.Reflection /// Each array parameter may be null, to indicate a lack of values. /// The parameter order is designed to make it feasible to format the generated code readably. /// - public GeneratedClrTypeInfo( - // Preserve all public members on message types when trimming is enabled. - // This ensures that members used by reflection, e.g. JSON serialization, are preserved. - [DynamicallyAccessedMembers(MessageAccessibility)] - Type clrType, MessageParser parser, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, Extension[] extensions, GeneratedClrTypeInfo[] nestedTypes) + public GeneratedClrTypeInfo(Type clrType, MessageParser parser, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, Extension[] extensions, GeneratedClrTypeInfo[] nestedTypes) { NestedTypes = nestedTypes ?? EmptyCodeInfo; NestedEnums = nestedEnums ?? ReflectionUtil.EmptyTypes; @@ -98,11 +104,7 @@ namespace Google.Protobuf.Reflection /// Each array parameter may be null, to indicate a lack of values. /// The parameter order is designed to make it feasible to format the generated code readably. /// - public GeneratedClrTypeInfo( - // Preserve all public members on message types when trimming is enabled. - // This ensures that members used by reflection, e.g. JSON serialization, are preserved. - [DynamicallyAccessedMembers(MessageAccessibility)] - Type clrType, MessageParser parser, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, GeneratedClrTypeInfo[] nestedTypes) + public GeneratedClrTypeInfo(Type clrType, MessageParser parser, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, GeneratedClrTypeInfo[] nestedTypes) : this(clrType, parser, propertyNames, oneofNames, nestedEnums, null, nestedTypes) { } diff --git a/csharp/src/Google.Protobuf/Reflection/IDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/IDescriptor.cs index f9d95655ea8d5ea3013904b86cb2792ab6b0ebac..1c1ef387da03fa744bed8c0b493b7818c2ec1ddf 100644 --- a/csharp/src/Google.Protobuf/Reflection/IDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/IDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf.Reflection diff --git a/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs index b971148e69919b70d3b20a0972bcc524e5f93cd6..d73427b73b6914339915a21a492ff61d44f224cb 100644 --- a/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs index 88275e288f964d1b7c6865620218fcadc5af16a9..56e3dddc947bfce5ac5343e0c2aac0d5cf748b57 100644 --- a/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs index 37ca0f152e21b66304f32a583c066471beabb8b0..7b5ab2fb48e7895e3e122e6a6478bd715e86d580 100644 --- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs @@ -1,19 +1,44 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; +#if NET35 +// Needed for ReadOnlyDictionary, which does not exist in .NET 3.5 +using Google.Protobuf.Collections; +#endif namespace Google.Protobuf.Reflection { @@ -95,15 +120,9 @@ namespace Google.Protobuf.Reflection private static ReadOnlyDictionary CreateJsonFieldMap(IList fields) { var map = new Dictionary(); - // The ordering is important here: JsonName takes priority over Name, - // which means we need to put JsonName values in the map after *all* - // Name keys have been added. See https://github.com/protocolbuffers/protobuf/issues/11987 foreach (var field in fields) { map[field.Name] = field; - } - foreach (var field in fields) - { map[field.JsonName] = field; } return new ReadOnlyDictionary(map); @@ -114,25 +133,23 @@ namespace Google.Protobuf.Reflection /// public override string Name => Proto.Name; - internal override IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) => - fieldNumber switch + internal override IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) + { + switch (fieldNumber) { - DescriptorProto.FieldFieldNumber => (IReadOnlyList)fieldsInDeclarationOrder, - DescriptorProto.NestedTypeFieldNumber => (IReadOnlyList)NestedTypes, - DescriptorProto.EnumTypeFieldNumber => (IReadOnlyList)EnumTypes, - _ => null, - }; + case DescriptorProto.FieldFieldNumber: + return (IReadOnlyList) fieldsInDeclarationOrder; + case DescriptorProto.NestedTypeFieldNumber: + return (IReadOnlyList) NestedTypes; + case DescriptorProto.EnumTypeFieldNumber: + return (IReadOnlyList) EnumTypes; + default: + return null; + } + } internal DescriptorProto Proto { get; } - /// - /// Returns a clone of the underlying describing this message. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this message descriptor. - public DescriptorProto ToProto() => Proto.Clone(); - internal bool IsExtensionsInitialized(IMessage message) { if (Proto.ExtensionRange.Count == 0) @@ -165,7 +182,6 @@ namespace Google.Protobuf.Reflection /// a wrapper type, and handle the result appropriately. /// /// - [DynamicallyAccessedMembers(GeneratedClrTypeInfo.MessageAccessibility)] public Type ClrType { get; } /// @@ -250,7 +266,7 @@ namespace Google.Protobuf.Reflection /// /// The unqualified name of the field (e.g. "foo"). /// The field's descriptor, or null if not found. - public FieldDescriptor FindFieldByName(string name) => File.DescriptorPool.FindSymbol(FullName + "." + name); + public FieldDescriptor FindFieldByName(String name) => File.DescriptorPool.FindSymbol(FullName + "." + name); /// /// Finds a field by field number. @@ -327,8 +343,6 @@ namespace Google.Protobuf.Reflection /// /// A collection to simplify retrieving the field accessor for a particular field. /// - [DebuggerDisplay("Count = {InFieldNumberOrder().Count}")] - [DebuggerTypeProxy(typeof(FieldCollectionDebugView))] public sealed class FieldCollection { private readonly MessageDescriptor messageDescriptor; @@ -401,19 +415,6 @@ namespace Google.Protobuf.Reflection return fieldDescriptor; } } - - private sealed class FieldCollectionDebugView - { - private readonly FieldCollection collection; - - public FieldCollectionDebugView(FieldCollection collection) - { - this.collection = collection; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public FieldDescriptor[] Items => collection.InFieldNumberOrder().ToArray(); - } } } } diff --git a/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs index 42084cb933655254b940b34de2929a97c18798eb..8e1503767bd76d6641e04229546c0a2410e777ae 100644 --- a/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; @@ -17,31 +40,35 @@ namespace Google.Protobuf.Reflection /// public sealed class MethodDescriptor : DescriptorBase { + private readonly MethodDescriptorProto proto; + private readonly ServiceDescriptor service; + private MessageDescriptor inputType; + private MessageDescriptor outputType; /// /// The service this method belongs to. /// - public ServiceDescriptor Service { get; } + public ServiceDescriptor Service { get { return service; } } /// /// The method's input type. /// - public MessageDescriptor InputType { get; private set; } + public MessageDescriptor InputType { get { return inputType; } } /// /// The method's input type. /// - public MessageDescriptor OutputType { get; private set; } + public MessageDescriptor OutputType { get { return outputType; } } /// /// Indicates if client streams multiple requests. /// - public bool IsClientStreaming => Proto.ClientStreaming; + public bool IsClientStreaming { get { return proto.ClientStreaming; } } /// /// Indicates if server streams multiple responses. /// - public bool IsServerStreaming => Proto.ServerStreaming; + public bool IsServerStreaming { get { return proto.ServerStreaming; } } /// /// The (possibly empty) set of custom options for this method. @@ -64,7 +91,7 @@ namespace Google.Protobuf.Reflection public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); - return value is IDeepCloneable c ? c.Clone() : value; + return value is IDeepCloneable ? (value as IDeepCloneable).Clone() : value; } /// @@ -80,41 +107,33 @@ namespace Google.Protobuf.Reflection ServiceDescriptor parent, int index) : base(file, parent.FullName + "." + proto.Name, index) { - Proto = proto; - Service = parent; + this.proto = proto; + service = parent; file.DescriptorPool.AddSymbol(this); } - internal MethodDescriptorProto Proto { get; private set; } - - /// - /// Returns a clone of the underlying describing this method. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this method descriptor. - public MethodDescriptorProto ToProto() => Proto.Clone(); + internal MethodDescriptorProto Proto { get { return proto; } } /// /// The brief name of the descriptor's target. /// - public override string Name => Proto.Name; + public override string Name { get { return proto.Name; } } internal void CrossLink() { IDescriptor lookup = File.DescriptorPool.LookupSymbol(Proto.InputType, this); - if (lookup is not MessageDescriptor inpoutType) + if (!(lookup is MessageDescriptor)) { throw new DescriptorValidationException(this, "\"" + Proto.InputType + "\" is not a message type."); } - InputType = inpoutType; + inputType = (MessageDescriptor) lookup; lookup = File.DescriptorPool.LookupSymbol(Proto.OutputType, this); - if (lookup is not MessageDescriptor outputType) + if (!(lookup is MessageDescriptor)) { throw new DescriptorValidationException(this, "\"" + Proto.OutputType + "\" is not a message type."); } - OutputType = outputType; + outputType = (MessageDescriptor) lookup; } } } diff --git a/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs b/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs index 8545d6ab7ddde8a98b31b81640f25aea3f7b8a28..7523426dc5f5590c92f9461ae217613585daedee 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs index f1386429840407bd780c7ef7eea8cb748d791b33..b41d5205158c87e7670c5740a1d605fb4db36cad 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -22,6 +45,7 @@ namespace Google.Protobuf.Reflection /// public sealed class OneofDescriptor : DescriptorBase { + private readonly OneofDescriptorProto proto; private MessageDescriptor containingType; private IList fields; private readonly OneofAccessor accessor; @@ -29,7 +53,7 @@ namespace Google.Protobuf.Reflection internal OneofDescriptor(OneofDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index, string clrName) : base(file, file.ComputeFullName(parent, proto.Name), index) { - this.Proto = proto; + this.proto = proto; containingType = parent; file.DescriptorPool.AddSymbol(this); @@ -44,18 +68,7 @@ namespace Google.Protobuf.Reflection /// /// The brief name of the descriptor's target. /// - public override string Name => Proto.Name; - - // Visible for testing - internal OneofDescriptorProto Proto { get; } - - /// - /// Returns a clone of the underlying describing this oneof. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this oneof descriptor. - public OneofDescriptorProto ToProto() => Proto.Clone(); + public override string Name { get { return proto.Name; } } /// /// Gets the message type containing this oneof. @@ -105,7 +118,7 @@ namespace Google.Protobuf.Reflection /// The (possibly empty) set of custom options for this oneof. /// [Obsolete("CustomOptions are obsolete. Use the GetOptions method.")] - public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + public CustomOptions CustomOptions => new CustomOptions(proto.Options?._extensions?.ValuesByNumber); /// /// The OneofOptions, defined in descriptor.proto. @@ -113,7 +126,7 @@ namespace Google.Protobuf.Reflection /// Custom options can be retrieved as extensions of the returned message. /// NOTE: A defensive copy is created each time this property is retrieved. /// - public OneofOptions GetOptions() => Proto.Options?.Clone(); + public OneofOptions GetOptions() => proto.Options?.Clone(); /// /// Gets a single value oneof option for this descriptor @@ -121,7 +134,7 @@ namespace Google.Protobuf.Reflection [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { - var value = Proto.Options.GetExtension(extension); + var value = proto.Options.GetExtension(extension); return value is IDeepCloneable ? (value as IDeepCloneable).Clone() : value; } @@ -131,7 +144,7 @@ namespace Google.Protobuf.Reflection [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { - return Proto.Options.GetExtension(extension).Clone(); + return proto.Options.GetExtension(extension).Clone(); } internal void CrossLink() diff --git a/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs b/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs index 33fb7a48a518f3cb81798270d2c2691556055722..63f5228f3d624646ce387eae5d8ee8761de9f5e1 100644 --- a/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs +++ b/csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -37,5 +60,6 @@ namespace Google.Protobuf.Reflection Name = ProtoPreconditions.CheckNotNull(name, nameof(name)); PreferredAlias = true; } + } } diff --git a/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs index a68e9a7ad5a2c1b10fb108a6f3c7df5539ed914f..e547d834986de8d80703504469e9c39b3d8ae93d 100644 --- a/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion namespace Google.Protobuf.Reflection @@ -16,15 +39,30 @@ namespace Google.Protobuf.Reflection /// internal sealed class PackageDescriptor : IDescriptor { + private readonly string name; + private readonly string fullName; + private readonly FileDescriptor file; + internal PackageDescriptor(string name, string fullName, FileDescriptor file) { - File = file; - FullName = fullName; - Name = name; + this.file = file; + this.fullName = fullName; + this.name = name; + } + + public string Name + { + get { return name; } } - public string Name { get; } - public string FullName { get; } - public FileDescriptor File { get; } + public string FullName + { + get { return fullName; } + } + + public FileDescriptor File + { + get { return file; } + } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs index 387f158583ea5598dc93d47df86967382cbd371b..fd1ad4e3e08644dfd9a8066cd9eb0152e8e18c78 100644 --- a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs +++ b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs @@ -1,17 +1,38 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using Google.Protobuf.Compatibility; using System; -using System.Diagnostics.CodeAnalysis; using System.Reflection; -using System.Runtime.CompilerServices; -using Google.Protobuf.Compatibility; namespace Google.Protobuf.Reflection { @@ -94,32 +115,15 @@ namespace Google.Protobuf.Reflection internal static Func CreateFuncIMessageBool(MethodInfo method) => GetReflectionHelper(method.DeclaringType, method.ReturnType).CreateFuncIMessageBool(method); - [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Type parameter members are preserved with DynamicallyAccessedMembers on GeneratedClrTypeInfo.ctor clrType parameter.")] - [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Type definition is explicitly specified and type argument is always a message type.")] - internal static Func CreateIsInitializedCaller([DynamicallyAccessedMembers(GeneratedClrTypeInfo.MessageAccessibility)]Type msg) => + internal static Func CreateIsInitializedCaller(Type msg) => ((IExtensionSetReflector)Activator.CreateInstance(typeof(ExtensionSetReflector<>).MakeGenericType(msg))).CreateIsInitializedCaller(); /// /// Creates a delegate which will execute the given method after casting the first argument to /// the type that declares the method, and the second argument to the first parameter type of the method. /// - [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Type parameter members are preserved with DynamicallyAccessedMembers on GeneratedClrTypeInfo.ctor clrType parameter.")] - internal static IExtensionReflectionHelper CreateExtensionHelper(Extension extension) - { -#if NET5_0_OR_GREATER - if (!RuntimeFeature.IsDynamicCodeSupported) - { - // Using extensions with reflection is not supported with AOT. - // This helper is created when descriptors are populated. Delay throwing error until an app - // uses IFieldAccessor with an extension field. - return new AotExtensionReflectionHelper(); - } -#endif - - var t1 = extension.TargetType; - var t3 = extension.GetType().GenericTypeArguments[1]; - return (IExtensionReflectionHelper) Activator.CreateInstance(typeof(ExtensionReflectionHelper<,>).MakeGenericType(t1, t3), extension); - } + internal static IExtensionReflectionHelper CreateExtensionHelper(Extension extension) => + (IExtensionReflectionHelper)Activator.CreateInstance(typeof(ExtensionReflectionHelper<,>).MakeGenericType(extension.TargetType, extension.GetType().GenericTypeArguments[1]), extension); /// /// Creates a reflection helper for the given type arguments. Currently these are created on demand @@ -127,18 +131,8 @@ namespace Google.Protobuf.Reflection /// they can be garbage collected. We could cache them by type if that proves to be important, but creating /// an object is pretty cheap. /// - [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Type parameter members are preserved with DynamicallyAccessedMembers on GeneratedClrTypeInfo.ctor clrType parameter.")] - private static IReflectionHelper GetReflectionHelper(Type t1, Type t2) - { -#if NET5_0_OR_GREATER - if (!RuntimeFeature.IsDynamicCodeSupported) - { - return new AotReflectionHelper(); - } -#endif - - return (IReflectionHelper) Activator.CreateInstance(typeof(ReflectionHelper<,>).MakeGenericType(t1, t2)); - } + private static IReflectionHelper GetReflectionHelper(Type t1, Type t2) => + (IReflectionHelper) Activator.CreateInstance(typeof(ReflectionHelper<,>).MakeGenericType(t1, t2)); // Non-generic interface allowing us to use an instance of ReflectionHelper without statically // knowing the types involved. @@ -164,8 +158,9 @@ namespace Google.Protobuf.Reflection Func CreateIsInitializedCaller(); } - private sealed class ReflectionHelper : IReflectionHelper + private class ReflectionHelper : IReflectionHelper { + public Func CreateFuncIMessageInt32(MethodInfo method) { // On pleasant runtimes, we can create a Func from a method returning @@ -210,7 +205,7 @@ namespace Google.Protobuf.Reflection } } - private sealed class ExtensionReflectionHelper : IExtensionReflectionHelper + private class ExtensionReflectionHelper : IExtensionReflectionHelper where T1 : IExtendableMessage { private readonly Extension extension; @@ -222,18 +217,20 @@ namespace Google.Protobuf.Reflection public object GetExtension(IMessage message) { - if (message is not T1 extensionMessage) + if (!(message is T1)) { throw new InvalidCastException("Cannot access extension on message that isn't IExtensionMessage"); } - if (extension is Extension ext13) + T1 extensionMessage = (T1)message; + + if (extension is Extension) { - return extensionMessage.GetExtension(ext13); + return extensionMessage.GetExtension(extension as Extension); } - else if (extension is RepeatedExtension repeatedExt13) + else if (extension is RepeatedExtension) { - return extensionMessage.GetOrInitializeExtension(repeatedExt13); + return extensionMessage.GetOrInitializeExtension(extension as RepeatedExtension); } else { @@ -243,14 +240,16 @@ namespace Google.Protobuf.Reflection public bool HasExtension(IMessage message) { - if (message is not T1 extensionMessage) + if (!(message is T1)) { throw new InvalidCastException("Cannot access extension on message that isn't IExtensionMessage"); } - if (extension is Extension ext13) + T1 extensionMessage = (T1)message; + + if (extension is Extension) { - return extensionMessage.HasExtension(ext13); + return extensionMessage.HasExtension(extension as Extension); } else if (extension is RepeatedExtension) { @@ -264,14 +263,16 @@ namespace Google.Protobuf.Reflection public void SetExtension(IMessage message, object value) { - if (message is not T1 extensionMessage) + if (!(message is T1)) { throw new InvalidCastException("Cannot access extension on message that isn't IExtensionMessage"); } - if (extension is Extension ext13) + T1 extensionMessage = (T1)message; + + if (extension is Extension) { - extensionMessage.SetExtension(ext13, (T3)value); + extensionMessage.SetExtension(extension as Extension, (T3)value); } else if (extension is RepeatedExtension) { @@ -285,18 +286,20 @@ namespace Google.Protobuf.Reflection public void ClearExtension(IMessage message) { - if (message is not T1 extensionMessage) + if (!(message is T1)) { throw new InvalidCastException("Cannot access extension on message that isn't IExtensionMessage"); } - if (extension is Extension ext13) + T1 extensionMessage = (T1)message; + + if (extension is Extension) { - extensionMessage.ClearExtension(ext13); + extensionMessage.ClearExtension(extension as Extension); } - else if (extension is RepeatedExtension repeatedExt13) + else if (extension is RepeatedExtension) { - extensionMessage.GetExtension(repeatedExt13).Clear(); + extensionMessage.GetExtension(extension as RepeatedExtension).Clear(); } else { @@ -305,46 +308,16 @@ namespace Google.Protobuf.Reflection } } -#if NET5_0_OR_GREATER - /// - /// This helper is compatible with .NET Native AOT. - /// MakeGenericType doesn't work when a type argument is a value type in AOT. - /// MethodInfo.Invoke is used instead of compiled expressions because it's faster in AOT. - /// - private sealed class AotReflectionHelper : IReflectionHelper - { - private static readonly object[] EmptyObjectArray = new object[0]; - public Action CreateActionIMessage(MethodInfo method) => message => method.Invoke(message, EmptyObjectArray); - public Action CreateActionIMessageObject(MethodInfo method) => (message, arg) => method.Invoke(message, new object[] { arg }); - public Func CreateFuncIMessageBool(MethodInfo method) => message => (bool) method.Invoke(message, EmptyObjectArray); - public Func CreateFuncIMessageInt32(MethodInfo method) => message => (int) method.Invoke(message, EmptyObjectArray); - public Func CreateFuncIMessageObject(MethodInfo method) => message => method.Invoke(message, EmptyObjectArray); - } - - /// - /// Reflection with extensions isn't supported because IExtendableMessage members are used to get values. - /// Can't use reflection to invoke those methods because they have a generic argument. - /// MakeGenericMethod can't be used because it will break whenever the extension type is a value type. - /// This could be made to work if there were non-generic methods available for getting and setting extension values. - /// - private sealed class AotExtensionReflectionHelper : IExtensionReflectionHelper - { - private const string Message = "Extensions reflection is not supported with AOT."; - public object GetExtension(IMessage message) => throw new NotSupportedException(Message); - public bool HasExtension(IMessage message) => throw new NotSupportedException(Message); - public void SetExtension(IMessage message, object value) => throw new NotSupportedException(Message); - public void ClearExtension(IMessage message) => throw new NotSupportedException(Message); - } -#endif - - private sealed class ExtensionSetReflector< - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] - T1> : IExtensionSetReflector where T1 : IExtendableMessage + private class ExtensionSetReflector : IExtensionSetReflector where T1 : IExtendableMessage { public Func CreateIsInitializedCaller() { var prop = typeof(T1).GetTypeInfo().GetDeclaredProperty("_Extensions"); +#if NET35 + var getFunc = (Func>)prop.GetGetMethod(true).CreateDelegate(typeof(Func>)); +#else var getFunc = (Func>)prop.GetMethod.CreateDelegate(typeof(Func>)); +#endif var initializedFunc = (Func, bool>) typeof(ExtensionSet) .GetTypeInfo() diff --git a/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs index 3f279c64431cf7cc05e707a1ff164d28a099da8d..afb4a693fcef1444aebe6c0484842d752c960ddf 100644 --- a/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -37,5 +60,6 @@ namespace Google.Protobuf.Reflection { throw new InvalidOperationException("SetValue is not implemented for repeated fields"); } + } } diff --git a/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs index a0947e44671c8a3e2bff0d93e870cfaa81f167ea..dab348b6f8ec67bcecd65050e98be7c1e6e2dc57 100644 --- a/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs @@ -1,15 +1,39 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Collections; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; namespace Google.Protobuf.Reflection { @@ -18,11 +42,14 @@ namespace Google.Protobuf.Reflection /// public sealed class ServiceDescriptor : DescriptorBase { + private readonly ServiceDescriptorProto proto; + private readonly IList methods; + internal ServiceDescriptor(ServiceDescriptorProto proto, FileDescriptor file, int index) : base(file, file.ComputeFullName(null, proto.Name), index) { - Proto = proto; - Methods = DescriptorUtil.ConvertAndMakeReadOnly(proto.Method, + this.proto = proto; + methods = DescriptorUtil.ConvertAndMakeReadOnly(proto.Method, (method, i) => new MethodDescriptor(method, file, this, i)); file.DescriptorPool.AddSymbol(this); @@ -31,37 +58,38 @@ namespace Google.Protobuf.Reflection /// /// The brief name of the descriptor's target. /// - public override string Name => Proto.Name; + public override string Name { get { return proto.Name; } } - internal override IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) => - fieldNumber switch + internal override IReadOnlyList GetNestedDescriptorListForField(int fieldNumber) + { + switch (fieldNumber) { - ServiceDescriptorProto.MethodFieldNumber => (IReadOnlyList)Methods, - _ => null, - }; + case ServiceDescriptorProto.MethodFieldNumber: + return (IReadOnlyList) methods; + default: + return null; + } + } - internal ServiceDescriptorProto Proto { get; } - - /// - /// Returns a clone of the underlying describing this service. - /// Note that a copy is taken every time this method is called, so clients using it frequently - /// (and not modifying it) may want to cache the returned value. - /// - /// A protobuf representation of this service descriptor. - public ServiceDescriptorProto ToProto() => Proto.Clone(); + internal ServiceDescriptorProto Proto { get { return proto; } } /// /// An unmodifiable list of methods in this service. /// - public IList Methods { get; } + public IList Methods + { + get { return methods; } + } /// /// Finds a method by name. /// /// The unqualified name of the method (e.g. "Foo"). /// The method's descriptor, or null if not found. - public MethodDescriptor FindMethodByName(string name) => - File.DescriptorPool.FindSymbol(FullName + "." + name); + public MethodDescriptor FindMethodByName(String name) + { + return File.DescriptorPool.FindSymbol(FullName + "." + name); + } /// /// The (possibly empty) set of custom options for this service. @@ -98,7 +126,7 @@ namespace Google.Protobuf.Reflection internal void CrossLink() { - foreach (MethodDescriptor method in Methods) + foreach (MethodDescriptor method in methods) { method.CrossLink(); } diff --git a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs index fbf9c9fac54a06043c151d98089729cc5fc40aed..07d84d7fb914d729f5cd929d6a1b5f83a211227f 100644 --- a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs @@ -1,14 +1,36 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; -using System.Diagnostics.CodeAnalysis; using System.Reflection; using Google.Protobuf.Compatibility; @@ -28,9 +50,7 @@ namespace Google.Protobuf.Reflection private readonly Action clearDelegate; private readonly Func hasDelegate; - internal SingleFieldAccessor( - [DynamicallyAccessedMembers(GeneratedClrTypeInfo.MessageAccessibility)] - Type messageType, PropertyInfo property, FieldDescriptor descriptor) : base(property, descriptor) + internal SingleFieldAccessor(PropertyInfo property, FieldDescriptor descriptor) : base(property, descriptor) { if (!property.CanWrite) { @@ -67,13 +87,13 @@ namespace Google.Protobuf.Reflection // Primitive fields always support presence in proto2, and support presence in proto3 for optional fields. else if (descriptor.File.Syntax == Syntax.Proto2 || descriptor.Proto.Proto3Optional) { - MethodInfo hasMethod = messageType.GetRuntimeProperty("Has" + property.Name).GetMethod; + MethodInfo hasMethod = property.DeclaringType.GetRuntimeProperty("Has" + property.Name).GetMethod; if (hasMethod == null) { throw new ArgumentException("Not all required properties/methods are available"); } hasDelegate = ReflectionUtil.CreateFuncIMessageBool(hasMethod); - MethodInfo clearMethod = messageType.GetRuntimeMethod("Clear" + property.Name, ReflectionUtil.EmptyTypes); + MethodInfo clearMethod = property.DeclaringType.GetRuntimeMethod("Clear" + property.Name, ReflectionUtil.EmptyTypes); if (clearMethod == null) { throw new ArgumentException("Not all required properties/methods are available"); @@ -84,30 +104,19 @@ namespace Google.Protobuf.Reflection // Primitive proto3 fields without the optional keyword, which aren't in oneofs. else { - hasDelegate = message => throw new InvalidOperationException("Presence is not implemented for this field"); + hasDelegate = message => { throw new InvalidOperationException("Presence is not implemented for this field"); }; // While presence isn't supported, clearing still is; it's just setting to a default value. - object defaultValue = GetDefaultValue(descriptor); + var clrType = property.PropertyType; + + object defaultValue = + clrType == typeof(string) ? "" + : clrType == typeof(ByteString) ? ByteString.Empty + : Activator.CreateInstance(clrType); clearDelegate = message => SetValue(message, defaultValue); } } - private static object GetDefaultValue(FieldDescriptor descriptor) => - descriptor.FieldType switch - { - FieldType.Bool => false, - FieldType.Bytes => ByteString.Empty, - FieldType.String => "", - FieldType.Double => 0.0, - FieldType.SInt32 or FieldType.Int32 or FieldType.SFixed32 or FieldType.Enum => 0, - FieldType.Fixed32 or FieldType.UInt32 => (uint)0, - FieldType.Fixed64 or FieldType.UInt64 => 0UL, - FieldType.SFixed64 or FieldType.Int64 or FieldType.SInt64 => 0L, - FieldType.Float => 0f, - FieldType.Message or FieldType.Group => null, - _ => throw new ArgumentException("Invalid field type"), - }; - public override void Clear(IMessage message) => clearDelegate(message); public override bool HasValue(IMessage message) => hasDelegate(message); public override void SetValue(IMessage message, object value) => setValueDelegate(message, value); diff --git a/csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs b/csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs index f0ab81cbe7ed2b8d6cf329cf95707ccad22c5a43..e94e3e6c60bcea9620e4111f930d8d16e36f0a06 100644 --- a/csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs +++ b/csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs @@ -1,14 +1,35 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion - using System.Collections.Generic; -using System.Diagnostics; using System.Linq; namespace Google.Protobuf.Reflection @@ -16,8 +37,6 @@ namespace Google.Protobuf.Reflection /// /// An immutable registry of types which can be looked up by their full name. /// - [DebuggerDisplay("Count = {fullNameToMessageMap.Count}")] - [DebuggerTypeProxy(typeof(TypeRegistryDebugView))] public sealed class TypeRegistry { /// @@ -41,8 +60,9 @@ namespace Google.Protobuf.Reflection /// if there is no such message descriptor. public MessageDescriptor Find(string fullName) { + MessageDescriptor ret; // Ignore the return value as ret will end up with the right value either way. - fullNameToMessageMap.TryGetValue(fullName, out MessageDescriptor ret); + fullNameToMessageMap.TryGetValue(fullName, out ret); return ret; } @@ -159,18 +179,5 @@ namespace Google.Protobuf.Reflection return new TypeRegistry(types); } } - - private sealed class TypeRegistryDebugView - { - private readonly TypeRegistry list; - - public TypeRegistryDebugView(TypeRegistry list) - { - this.list = list; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public KeyValuePair[] Items => list.fullNameToMessageMap.ToArray(); - } } } diff --git a/csharp/src/Google.Protobuf/SegmentedBufferHelper.cs b/csharp/src/Google.Protobuf/SegmentedBufferHelper.cs index 6ec422381c13b7a95f905c75526647714ad9c95d..b5441d34211df108dd5c86a97a9a32666f6dd503 100644 --- a/csharp/src/Google.Protobuf/SegmentedBufferHelper.cs +++ b/csharp/src/Google.Protobuf/SegmentedBufferHelper.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf/UnknownField.cs b/csharp/src/Google.Protobuf/UnknownField.cs index 4def7bb042081b95035443d49c5aa8330a2824ea..4793a6419d9618a1bf38eb469fd56efe0a860b1a 100644 --- a/csharp/src/Google.Protobuf/UnknownField.cs +++ b/csharp/src/Google.Protobuf/UnknownField.cs @@ -1,13 +1,38 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using Google.Protobuf.Collections; namespace Google.Protobuf @@ -48,12 +73,13 @@ namespace Google.Protobuf { return true; } - return other is UnknownField otherField - && Lists.Equals(varintList, otherField.varintList) - && Lists.Equals(fixed32List, otherField.fixed32List) - && Lists.Equals(fixed64List, otherField.fixed64List) - && Lists.Equals(lengthDelimitedList, otherField.lengthDelimitedList) - && Lists.Equals(groupList, otherField.groupList); + UnknownField otherField = other as UnknownField; + return otherField != null + && Lists.Equals(varintList, otherField.varintList) + && Lists.Equals(fixed32List, otherField.fixed32List) + && Lists.Equals(fixed64List, otherField.fixed64List) + && Lists.Equals(lengthDelimitedList, otherField.lengthDelimitedList) + && Lists.Equals(groupList, otherField.groupList); } /// diff --git a/csharp/src/Google.Protobuf/UnknownFieldSet.cs b/csharp/src/Google.Protobuf/UnknownFieldSet.cs index d0963d257dc69a87a31be32eccf07b21932b73c1..9888dd1c3d09c6bfe6a14299c0f30e3b40ba8c65 100644 --- a/csharp/src/Google.Protobuf/UnknownFieldSet.cs +++ b/csharp/src/Google.Protobuf/UnknownFieldSet.cs @@ -1,17 +1,40 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; +using System.IO; using System.Security; +using Google.Protobuf.Reflection; namespace Google.Protobuf { @@ -24,17 +47,16 @@ namespace Google.Protobuf /// /// Most users will never need to use this class directly. /// - [DebuggerDisplay("Count = {fields.Count}")] - [DebuggerTypeProxy(typeof(UnknownFieldSetDebugView))] public sealed partial class UnknownFieldSet { - private readonly IDictionary fields = new Dictionary(); + private readonly IDictionary fields; /// /// Creates a new UnknownFieldSet. /// internal UnknownFieldSet() { + this.fields = new Dictionary(); } /// @@ -97,13 +119,14 @@ namespace Google.Protobuf } UnknownFieldSet otherSet = other as UnknownFieldSet; IDictionary otherFields = otherSet.fields; - if (fields.Count != otherFields.Count) + if (fields.Count != otherFields.Count) { return false; } foreach (KeyValuePair leftEntry in fields) { - if (!otherFields.TryGetValue(leftEntry.Key, out UnknownField rightValue)) + UnknownField rightValue; + if (!otherFields.TryGetValue(leftEntry.Key, out rightValue)) { return false; } @@ -147,7 +170,8 @@ namespace Google.Protobuf return null; } - if (fields.TryGetValue(number, out UnknownField existing)) + UnknownField existing; + if (fields.TryGetValue(number, out existing)) { return existing; } @@ -364,19 +388,6 @@ namespace Google.Protobuf unknownFields.MergeFrom(other); return unknownFields; } - - private sealed class UnknownFieldSetDebugView - { - private readonly UnknownFieldSet set; - - public UnknownFieldSetDebugView(UnknownFieldSet set) - { - this.set = set; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public KeyValuePair[] Items => set.fields.ToArray(); - } } } diff --git a/csharp/src/Google.Protobuf/UnsafeByteOperations.cs b/csharp/src/Google.Protobuf/UnsafeByteOperations.cs deleted file mode 100644 index 188b5782a7972a3029f1b00d220528cb78d6f37e..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/UnsafeByteOperations.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -using System; -using System.Security; - -namespace Google.Protobuf -{ - /// - /// Provides a number of unsafe byte operations to be used by advanced applications with high performance - /// requirements. These methods are referred to as "unsafe" due to the fact that they potentially expose - /// the backing buffer of a to the application. - /// - /// - /// - /// The methods in this class should only be called if it is guaranteed that the buffer backing the - /// will never change! Mutation of a can lead to unexpected - /// and undesirable consequences in your application, and will likely be difficult to debug. Proceed with caution! - /// - /// - /// This can have a number of significant side affects that have spooky-action-at-a-distance-like behavior. In - /// particular, if the bytes value changes out from under a Protocol Buffer: - /// - /// - /// - /// serialization may throw - /// - /// - /// serialization may succeed but the wrong bytes may be written out - /// - /// - /// objects that are normally immutable (such as ByteString) are no longer immutable - /// - /// - /// hashCode may be incorrect - /// - /// - /// - [SecuritySafeCritical] - public static class UnsafeByteOperations - { - /// - /// Constructs a new from the given bytes. The bytes are not copied, - /// and must not be modified while the is in use. - /// This API is experimental and subject to change. - /// - public static ByteString UnsafeWrap(ReadOnlyMemory bytes) - { - return ByteString.AttachBytes(bytes); - } - } -} diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index 2b33cd459b4b8f0ea35cc461added39c4aa26440..60ae03da942f4c0984bc50df12f246328eef7deb 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -25,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", - "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQm8KE2Nv", - "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaJWdpdGh1Yi5jb20vZ29s", - "YW5nL3Byb3RvYnVmL3B0eXBlcy9hbnmiAgNHUEKqAh5Hb29nbGUuUHJvdG9i", - "dWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); + "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2Nv", + "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcu", + "b3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xl", + "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -78,10 +78,13 @@ namespace Google.Protobuf.WellKnownTypes { /// Example 4: Pack and unpack a message in Go /// /// foo := &pb.Foo{...} - /// any, err := ptypes.MarshalAny(foo) + /// any, err := anypb.New(foo) + /// if err != nil { + /// ... + /// } /// ... /// foo := &pb.Foo{} - /// if err := ptypes.UnmarshalAny(any, foo); err != nil { + /// if err := any.UnmarshalTo(foo); err != nil { /// ... /// } /// diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.pb.cs deleted file mode 100644 index e30414dace3a534d1f0d9cc1e5de90aefd071ec6..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.pb.cs +++ /dev/null @@ -1,393 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/any.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/any.proto - public static partial class AnyReflection { - - #region Descriptor - /// File descriptor for google/protobuf/any.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static AnyReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", - "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2Nv", - "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcu", - "b3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xl", - "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), global::Google.Protobuf.WellKnownTypes.Any.Parser, new[]{ "TypeUrl", "Value" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// `Any` contains an arbitrary serialized protocol buffer message along with a - /// URL that describes the type of the serialized message. - /// - /// Protobuf library provides support to pack/unpack Any values in the form - /// of utility functions or additional generated methods of the Any type. - /// - /// Example 1: Pack and unpack a message in C++. - /// - /// Foo foo = ...; - /// Any any; - /// any.PackFrom(foo); - /// ... - /// if (any.UnpackTo(&foo)) { - /// ... - /// } - /// - /// Example 2: Pack and unpack a message in Java. - /// - /// Foo foo = ...; - /// Any any = Any.pack(foo); - /// ... - /// if (any.is(Foo.class)) { - /// foo = any.unpack(Foo.class); - /// } - /// // or ... - /// if (any.isSameTypeAs(Foo.getDefaultInstance())) { - /// foo = any.unpack(Foo.getDefaultInstance()); - /// } - /// - /// Example 3: Pack and unpack a message in Python. - /// - /// foo = Foo(...) - /// any = Any() - /// any.Pack(foo) - /// ... - /// if any.Is(Foo.DESCRIPTOR): - /// any.Unpack(foo) - /// ... - /// - /// Example 4: Pack and unpack a message in Go - /// - /// foo := &pb.Foo{...} - /// any, err := anypb.New(foo) - /// if err != nil { - /// ... - /// } - /// ... - /// foo := &pb.Foo{} - /// if err := any.UnmarshalTo(foo); err != nil { - /// ... - /// } - /// - /// The pack methods provided by protobuf library will by default use - /// 'type.googleapis.com/full.type.name' as the type URL and the unpack - /// methods only use the fully qualified type name after the last '/' - /// in the type URL, for example "foo.bar.com/x/y.z" will yield type - /// name "y.z". - /// - /// JSON - /// ==== - /// The JSON representation of an `Any` value uses the regular - /// representation of the deserialized, embedded message, with an - /// additional field `@type` which contains the type URL. Example: - /// - /// package google.profile; - /// message Person { - /// string first_name = 1; - /// string last_name = 2; - /// } - /// - /// { - /// "@type": "type.googleapis.com/google.profile.Person", - /// "firstName": <string>, - /// "lastName": <string> - /// } - /// - /// If the embedded message type is well-known and has a custom JSON - /// representation, that representation will be embedded adding a field - /// `value` which holds the custom JSON in addition to the `@type` - /// field. Example (for message [google.protobuf.Duration][]): - /// - /// { - /// "@type": "type.googleapis.com/google.protobuf.Duration", - /// "value": "1.212s" - /// } - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Any : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Any()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Any() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Any(Any other) : this() { - typeUrl_ = other.typeUrl_; - value_ = other.value_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Any Clone() { - return new Any(this); - } - - /// Field number for the "type_url" field. - public const int TypeUrlFieldNumber = 1; - private string typeUrl_ = ""; - /// - /// A URL/resource name that uniquely identifies the type of the serialized - /// protocol buffer message. This string must contain at least - /// one "/" character. The last segment of the URL's path must represent - /// the fully qualified name of the type (as in - /// `path/google.protobuf.Duration`). The name should be in a canonical form - /// (e.g., leading "." is not accepted). - /// - /// In practice, teams usually precompile into the binary all types that they - /// expect it to use in the context of Any. However, for URLs which use the - /// scheme `http`, `https`, or no scheme, one can optionally set up a type - /// server that maps type URLs to message definitions as follows: - /// - /// * If no scheme is provided, `https` is assumed. - /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] - /// value in binary format, or produce an error. - /// * Applications are allowed to cache lookup results based on the - /// URL, or have them precompiled into a binary to avoid any - /// lookup. Therefore, binary compatibility needs to be preserved - /// on changes to types. (Use versioned type names to manage - /// breaking changes.) - /// - /// Note: this functionality is not currently available in the official - /// protobuf release, and it is not used for type URLs beginning with - /// type.googleapis.com. As of May 2023, there are no widely used type server - /// implementations and no plans to implement one. - /// - /// Schemes other than `http`, `https` (or the empty scheme) might be - /// used with implementation specific semantics. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string TypeUrl { - get { return typeUrl_; } - set { - typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 2; - private pb::ByteString value_ = pb::ByteString.Empty; - /// - /// Must be a valid serialized protocol buffer of the above specified type. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString Value { - get { return value_; } - set { - value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Any); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Any other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TypeUrl != other.TypeUrl) return false; - if (Value != other.Value) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode(); - if (Value.Length != 0) hash ^= Value.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TypeUrl.Length != 0) { - output.WriteRawTag(10); - output.WriteString(TypeUrl); - } - if (Value.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(Value); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TypeUrl.Length != 0) { - output.WriteRawTag(10); - output.WriteString(TypeUrl); - } - if (Value.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(Value); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (TypeUrl.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl); - } - if (Value.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Value); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Any other) { - if (other == null) { - return; - } - if (other.TypeUrl.Length != 0) { - TypeUrl = other.TypeUrl; - } - if (other.Value.Length != 0) { - Value = other.Value; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - TypeUrl = input.ReadString(); - break; - } - case 18: { - Value = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - TypeUrl = input.ReadString(); - break; - } - case 18: { - Value = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs b/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs index 677f76c4bde37b07300ed86ba7d3d585bd5d8788..49f259982acbcfa4b9d20b86f8d6f98e776f3f61 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs @@ -1,10 +1,33 @@ -#region Copyright notice and license +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using Google.Protobuf.Reflection; @@ -44,15 +67,15 @@ namespace Google.Protobuf.WellKnownTypes return lastSlash == -1 ? "" : typeUrl.Substring(lastSlash + 1); } - /// - /// Returns a bool indictating whether this Any message is of the target message type - /// - /// The descriptor of the message type + /// + /// Returns a bool indictating whether this Any message is of the target message type + /// + /// The descriptor of the message type /// true if the type name matches the descriptor's full name or false otherwise - public bool Is(MessageDescriptor descriptor) - { - ProtoPreconditions.CheckNotNull(descriptor, nameof(descriptor)); - return GetTypeName(TypeUrl) == descriptor.FullName; + public bool Is(MessageDescriptor descriptor) + { + ProtoPreconditions.CheckNotNull(descriptor, nameof(descriptor)); + return GetTypeName(TypeUrl) == descriptor.FullName; } /// @@ -89,7 +112,7 @@ namespace Google.Protobuf.WellKnownTypes T target = new T(); if (GetTypeName(TypeUrl) != target.Descriptor.FullName) { - result = default; // Can't use null as there's no class constraint, but this always *will* be null in real usage. + result = default(T); // Can't use null as there's no class constraint, but this always *will* be null in real usage. return false; } target.MergeFrom(Value); @@ -97,26 +120,6 @@ namespace Google.Protobuf.WellKnownTypes return true; } - /// - /// Attempts to unpack the content of this Any message into one of the message types - /// in the given type registry, based on the type URL. - /// - /// The type registry to consult for messages. - /// The unpacked message, or null if no matching message was found. - public IMessage Unpack(TypeRegistry registry) - { - string typeName = GetTypeName(TypeUrl); - MessageDescriptor descriptor = registry.Find(typeName); - if (descriptor == null) - { - return null; - } - - var message = descriptor.Parser.CreateTemplate(); - message.MergeFrom(Value); - return message; - } - /// /// Packs the specified message into an Any message using a type URL prefix of "type.googleapis.com". /// diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index 6bc0821fa5f66c25f0fa2957dfd2c3348ff4fb77..7c65ac761d67269edc61be37d7568e43cbb9cc0c 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -37,10 +37,10 @@ namespace Google.Protobuf.WellKnownTypes { "ChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25zZV9zdHJlYW1p", "bmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5P", "cHRpb24SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRh", - "eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCdQoTY29t", - "Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAVorZ29vZ2xlLmdvbGFuZy5v", - "cmcvZ2VucHJvdG8vcHJvdG9idWYvYXBpO2FwaaICA0dQQqoCHkdvb2dsZS5Q", - "cm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z")); + "eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCdgoTY29t", + "Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAVosZ29vZ2xlLmdvbGFuZy5v", + "cmcvcHJvdG9idWYvdHlwZXMva25vd24vYXBpcGKiAgNHUEKqAh5Hb29nbGUu", + "UHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -918,7 +918,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The mixin construct implies that all methods in `AccessControl` are /// also declared with same name and request/response types in /// `Storage`. A documentation generator or annotation processor will - /// see the effective `Storage.GetAcl` method after inherting + /// see the effective `Storage.GetAcl` method after inheriting /// documentation and annotations as follows: /// /// service Storage { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.pb.cs deleted file mode 100644 index 3951ea819cffffbb3acdec1201a2799c42de35e3..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.pb.cs +++ /dev/null @@ -1,1239 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/api.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/api.proto - public static partial class ApiReflection { - - #region Descriptor - /// File descriptor for google/protobuf/api.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static ApiReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYa", - "JGdvb2dsZS9wcm90b2J1Zi9zb3VyY2VfY29udGV4dC5wcm90bxoaZ29vZ2xl", - "L3Byb3RvYnVmL3R5cGUucHJvdG8igQIKA0FwaRIMCgRuYW1lGAEgASgJEigK", - "B21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29w", - "dGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNp", - "b24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJv", - "dG9idWYuU291cmNlQ29udGV4dBImCgZtaXhpbnMYBiADKAsyFi5nb29nbGUu", - "cHJvdG9idWYuTWl4aW4SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3Rv", - "YnVmLlN5bnRheCLVAQoGTWV0aG9kEgwKBG5hbWUYASABKAkSGAoQcmVxdWVz", - "dF90eXBlX3VybBgCIAEoCRIZChFyZXF1ZXN0X3N0cmVhbWluZxgDIAEoCBIZ", - "ChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25zZV9zdHJlYW1p", - "bmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5P", - "cHRpb24SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRh", - "eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCdgoTY29t", - "Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAVosZ29vZ2xlLmdvbGFuZy5v", - "cmcvcHJvdG9idWYvdHlwZXMva25vd24vYXBpcGKiAgNHUEKqAh5Hb29nbGUu", - "UHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Api), global::Google.Protobuf.WellKnownTypes.Api.Parser, new[]{ "Name", "Methods", "Options", "Version", "SourceContext", "Mixins", "Syntax" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Method), global::Google.Protobuf.WellKnownTypes.Method.Parser, new[]{ "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options", "Syntax" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Mixin), global::Google.Protobuf.WellKnownTypes.Mixin.Parser, new[]{ "Name", "Root" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Api is a light-weight descriptor for an API Interface. - /// - /// Interfaces are also described as "protocol buffer services" in some contexts, - /// such as by the "service" keyword in a .proto file, but they are different - /// from API Services, which represent a concrete implementation of an interface - /// as opposed to simply a description of methods and bindings. They are also - /// sometimes simply referred to as "APIs" in other contexts, such as the name of - /// this message itself. See https://cloud.google.com/apis/design/glossary for - /// detailed terminology. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Api : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.ApiReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Api() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Api(Api other) : this() { - name_ = other.name_; - methods_ = other.methods_.Clone(); - options_ = other.options_.Clone(); - version_ = other.version_; - sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null; - mixins_ = other.mixins_.Clone(); - syntax_ = other.syntax_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Api Clone() { - return new Api(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// The fully qualified name of this interface, including package name - /// followed by the interface's simple name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "methods" field. - public const int MethodsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_methods_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser); - private readonly pbc::RepeatedField methods_ = new pbc::RepeatedField(); - /// - /// The methods of this interface, in unspecified order. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Methods { - get { return methods_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - /// - /// Any metadata attached to the interface. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Options { - get { return options_; } - } - - /// Field number for the "version" field. - public const int VersionFieldNumber = 4; - private string version_ = ""; - /// - /// A version string for this interface. If specified, must have the form - /// `major-version.minor-version`, as in `1.10`. If the minor version is - /// omitted, it defaults to zero. If the entire version field is empty, the - /// major version is derived from the package name, as outlined below. If the - /// field is not empty, the version in the package name will be verified to be - /// consistent with what is provided here. - /// - /// The versioning schema uses [semantic - /// versioning](http://semver.org) where the major version number - /// indicates a breaking change and the minor version an additive, - /// non-breaking change. Both version numbers are signals to users - /// what to expect from different versions, and should be carefully - /// chosen based on the product plan. - /// - /// The major version is also reflected in the package name of the - /// interface, which must end in `v<major-version>`, as in - /// `google.feature.v1`. For major versions 0 and 1, the suffix can - /// be omitted. Zero major versions must only be used for - /// experimental, non-GA interfaces. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Version { - get { return version_; } - set { - version_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "source_context" field. - public const int SourceContextFieldNumber = 5; - private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; - /// - /// Source context for the protocol buffer service represented by this - /// message. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { - get { return sourceContext_; } - set { - sourceContext_ = value; - } - } - - /// Field number for the "mixins" field. - public const int MixinsFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_mixins_codec - = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Mixin.Parser); - private readonly pbc::RepeatedField mixins_ = new pbc::RepeatedField(); - /// - /// Included interfaces. See [Mixin][]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Mixins { - get { return mixins_; } - } - - /// Field number for the "syntax" field. - public const int SyntaxFieldNumber = 7; - private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.Proto2; - /// - /// The source syntax of the service. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { - get { return syntax_; } - set { - syntax_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Api); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Api other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if(!methods_.Equals(other.methods_)) return false; - if(!options_.Equals(other.options_)) return false; - if (Version != other.Version) return false; - if (!object.Equals(SourceContext, other.SourceContext)) return false; - if(!mixins_.Equals(other.mixins_)) return false; - if (Syntax != other.Syntax) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - hash ^= methods_.GetHashCode(); - hash ^= options_.GetHashCode(); - if (Version.Length != 0) hash ^= Version.GetHashCode(); - if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); - hash ^= mixins_.GetHashCode(); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) hash ^= Syntax.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - methods_.WriteTo(output, _repeated_methods_codec); - options_.WriteTo(output, _repeated_options_codec); - if (Version.Length != 0) { - output.WriteRawTag(34); - output.WriteString(Version); - } - if (sourceContext_ != null) { - output.WriteRawTag(42); - output.WriteMessage(SourceContext); - } - mixins_.WriteTo(output, _repeated_mixins_codec); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(56); - output.WriteEnum((int) Syntax); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - methods_.WriteTo(ref output, _repeated_methods_codec); - options_.WriteTo(ref output, _repeated_options_codec); - if (Version.Length != 0) { - output.WriteRawTag(34); - output.WriteString(Version); - } - if (sourceContext_ != null) { - output.WriteRawTag(42); - output.WriteMessage(SourceContext); - } - mixins_.WriteTo(ref output, _repeated_mixins_codec); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(56); - output.WriteEnum((int) Syntax); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - size += methods_.CalculateSize(_repeated_methods_codec); - size += options_.CalculateSize(_repeated_options_codec); - if (Version.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Version); - } - if (sourceContext_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); - } - size += mixins_.CalculateSize(_repeated_mixins_codec); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Api other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - methods_.Add(other.methods_); - options_.Add(other.options_); - if (other.Version.Length != 0) { - Version = other.Version; - } - if (other.sourceContext_ != null) { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - SourceContext.MergeFrom(other.SourceContext); - } - mixins_.Add(other.mixins_); - if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - Syntax = other.Syntax; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - methods_.AddEntriesFrom(input, _repeated_methods_codec); - break; - } - case 26: { - options_.AddEntriesFrom(input, _repeated_options_codec); - break; - } - case 34: { - Version = input.ReadString(); - break; - } - case 42: { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - input.ReadMessage(SourceContext); - break; - } - case 50: { - mixins_.AddEntriesFrom(input, _repeated_mixins_codec); - break; - } - case 56: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - methods_.AddEntriesFrom(ref input, _repeated_methods_codec); - break; - } - case 26: { - options_.AddEntriesFrom(ref input, _repeated_options_codec); - break; - } - case 34: { - Version = input.ReadString(); - break; - } - case 42: { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - input.ReadMessage(SourceContext); - break; - } - case 50: { - mixins_.AddEntriesFrom(ref input, _repeated_mixins_codec); - break; - } - case 56: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - /// - /// Method represents a method of an API interface. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Method : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Method()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.ApiReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Method() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Method(Method other) : this() { - name_ = other.name_; - requestTypeUrl_ = other.requestTypeUrl_; - requestStreaming_ = other.requestStreaming_; - responseTypeUrl_ = other.responseTypeUrl_; - responseStreaming_ = other.responseStreaming_; - options_ = other.options_.Clone(); - syntax_ = other.syntax_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Method Clone() { - return new Method(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// The simple name of this method. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "request_type_url" field. - public const int RequestTypeUrlFieldNumber = 2; - private string requestTypeUrl_ = ""; - /// - /// A URL of the input message type. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string RequestTypeUrl { - get { return requestTypeUrl_; } - set { - requestTypeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "request_streaming" field. - public const int RequestStreamingFieldNumber = 3; - private bool requestStreaming_; - /// - /// If true, the request is streamed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool RequestStreaming { - get { return requestStreaming_; } - set { - requestStreaming_ = value; - } - } - - /// Field number for the "response_type_url" field. - public const int ResponseTypeUrlFieldNumber = 4; - private string responseTypeUrl_ = ""; - /// - /// The URL of the output message type. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ResponseTypeUrl { - get { return responseTypeUrl_; } - set { - responseTypeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "response_streaming" field. - public const int ResponseStreamingFieldNumber = 5; - private bool responseStreaming_; - /// - /// If true, the response is streamed. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool ResponseStreaming { - get { return responseStreaming_; } - set { - responseStreaming_ = value; - } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Option.Parser); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - /// - /// Any metadata attached to the method. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Options { - get { return options_; } - } - - /// Field number for the "syntax" field. - public const int SyntaxFieldNumber = 7; - private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.Proto2; - /// - /// The source syntax of this method. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { - get { return syntax_; } - set { - syntax_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Method); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Method other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (RequestTypeUrl != other.RequestTypeUrl) return false; - if (RequestStreaming != other.RequestStreaming) return false; - if (ResponseTypeUrl != other.ResponseTypeUrl) return false; - if (ResponseStreaming != other.ResponseStreaming) return false; - if(!options_.Equals(other.options_)) return false; - if (Syntax != other.Syntax) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (RequestTypeUrl.Length != 0) hash ^= RequestTypeUrl.GetHashCode(); - if (RequestStreaming != false) hash ^= RequestStreaming.GetHashCode(); - if (ResponseTypeUrl.Length != 0) hash ^= ResponseTypeUrl.GetHashCode(); - if (ResponseStreaming != false) hash ^= ResponseStreaming.GetHashCode(); - hash ^= options_.GetHashCode(); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) hash ^= Syntax.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (RequestTypeUrl.Length != 0) { - output.WriteRawTag(18); - output.WriteString(RequestTypeUrl); - } - if (RequestStreaming != false) { - output.WriteRawTag(24); - output.WriteBool(RequestStreaming); - } - if (ResponseTypeUrl.Length != 0) { - output.WriteRawTag(34); - output.WriteString(ResponseTypeUrl); - } - if (ResponseStreaming != false) { - output.WriteRawTag(40); - output.WriteBool(ResponseStreaming); - } - options_.WriteTo(output, _repeated_options_codec); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(56); - output.WriteEnum((int) Syntax); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (RequestTypeUrl.Length != 0) { - output.WriteRawTag(18); - output.WriteString(RequestTypeUrl); - } - if (RequestStreaming != false) { - output.WriteRawTag(24); - output.WriteBool(RequestStreaming); - } - if (ResponseTypeUrl.Length != 0) { - output.WriteRawTag(34); - output.WriteString(ResponseTypeUrl); - } - if (ResponseStreaming != false) { - output.WriteRawTag(40); - output.WriteBool(ResponseStreaming); - } - options_.WriteTo(ref output, _repeated_options_codec); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(56); - output.WriteEnum((int) Syntax); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (RequestTypeUrl.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestTypeUrl); - } - if (RequestStreaming != false) { - size += 1 + 1; - } - if (ResponseTypeUrl.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ResponseTypeUrl); - } - if (ResponseStreaming != false) { - size += 1 + 1; - } - size += options_.CalculateSize(_repeated_options_codec); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Method other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.RequestTypeUrl.Length != 0) { - RequestTypeUrl = other.RequestTypeUrl; - } - if (other.RequestStreaming != false) { - RequestStreaming = other.RequestStreaming; - } - if (other.ResponseTypeUrl.Length != 0) { - ResponseTypeUrl = other.ResponseTypeUrl; - } - if (other.ResponseStreaming != false) { - ResponseStreaming = other.ResponseStreaming; - } - options_.Add(other.options_); - if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - Syntax = other.Syntax; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - RequestTypeUrl = input.ReadString(); - break; - } - case 24: { - RequestStreaming = input.ReadBool(); - break; - } - case 34: { - ResponseTypeUrl = input.ReadString(); - break; - } - case 40: { - ResponseStreaming = input.ReadBool(); - break; - } - case 50: { - options_.AddEntriesFrom(input, _repeated_options_codec); - break; - } - case 56: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - RequestTypeUrl = input.ReadString(); - break; - } - case 24: { - RequestStreaming = input.ReadBool(); - break; - } - case 34: { - ResponseTypeUrl = input.ReadString(); - break; - } - case 40: { - ResponseStreaming = input.ReadBool(); - break; - } - case 50: { - options_.AddEntriesFrom(ref input, _repeated_options_codec); - break; - } - case 56: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - /// - /// Declares an API Interface to be included in this interface. The including - /// interface must redeclare all the methods from the included interface, but - /// documentation and options are inherited as follows: - /// - /// - If after comment and whitespace stripping, the documentation - /// string of the redeclared method is empty, it will be inherited - /// from the original method. - /// - /// - Each annotation belonging to the service config (http, - /// visibility) which is not set in the redeclared method will be - /// inherited. - /// - /// - If an http annotation is inherited, the path pattern will be - /// modified as follows. Any version prefix will be replaced by the - /// version of the including interface plus the [root][] path if - /// specified. - /// - /// Example of a simple mixin: - /// - /// package google.acl.v1; - /// service AccessControl { - /// // Get the underlying ACL object. - /// rpc GetAcl(GetAclRequest) returns (Acl) { - /// option (google.api.http).get = "/v1/{resource=**}:getAcl"; - /// } - /// } - /// - /// package google.storage.v2; - /// service Storage { - /// rpc GetAcl(GetAclRequest) returns (Acl); - /// - /// // Get a data record. - /// rpc GetData(GetDataRequest) returns (Data) { - /// option (google.api.http).get = "/v2/{resource=**}"; - /// } - /// } - /// - /// Example of a mixin configuration: - /// - /// apis: - /// - name: google.storage.v2.Storage - /// mixins: - /// - name: google.acl.v1.AccessControl - /// - /// The mixin construct implies that all methods in `AccessControl` are - /// also declared with same name and request/response types in - /// `Storage`. A documentation generator or annotation processor will - /// see the effective `Storage.GetAcl` method after inherting - /// documentation and annotations as follows: - /// - /// service Storage { - /// // Get the underlying ACL object. - /// rpc GetAcl(GetAclRequest) returns (Acl) { - /// option (google.api.http).get = "/v2/{resource=**}:getAcl"; - /// } - /// ... - /// } - /// - /// Note how the version in the path pattern changed from `v1` to `v2`. - /// - /// If the `root` field in the mixin is specified, it should be a - /// relative path under which inherited HTTP paths are placed. Example: - /// - /// apis: - /// - name: google.storage.v2.Storage - /// mixins: - /// - name: google.acl.v1.AccessControl - /// root: acls - /// - /// This implies the following inherited HTTP annotation: - /// - /// service Storage { - /// // Get the underlying ACL object. - /// rpc GetAcl(GetAclRequest) returns (Acl) { - /// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; - /// } - /// ... - /// } - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Mixin : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mixin()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.ApiReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mixin() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mixin(Mixin other) : this() { - name_ = other.name_; - root_ = other.root_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mixin Clone() { - return new Mixin(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// The fully qualified name of the interface which is included. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "root" field. - public const int RootFieldNumber = 2; - private string root_ = ""; - /// - /// If non-empty specifies a path under which inherited HTTP paths - /// are rooted. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Root { - get { return root_; } - set { - root_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Mixin); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Mixin other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (Root != other.Root) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (Root.Length != 0) hash ^= Root.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (Root.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Root); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (Root.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Root); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (Root.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Root); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Mixin other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.Root.Length != 0) { - Root = other.Root; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Root = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Root = input.ReadString(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs index 2d479badcbb53171b9aaa0c84bd470174337abfd..2a653a37547b1d7a65e3aab31f8c3af355dea39b 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs @@ -26,10 +26,10 @@ namespace Google.Protobuf.WellKnownTypes { string.Concat( "Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90", "b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg", - "ASgFQnwKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAVoq", - "Z2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHR5cGVzL2R1cmF0aW9u+AEB", - "ogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90", - "bzM=")); + "ASgFQoMBChNjb20uZ29vZ2xlLnByb3RvYnVmQg1EdXJhdGlvblByb3RvUAFa", + "MWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2R1cmF0", + "aW9ucGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlw", + "ZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.pb.cs deleted file mode 100644 index 3d51f448078e889ef2c2dacc69f91d9123e27b83..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.pb.cs +++ /dev/null @@ -1,347 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/duration.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/duration.proto - public static partial class DurationReflection { - - #region Descriptor - /// File descriptor for google/protobuf/duration.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static DurationReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90", - "b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg", - "ASgFQoMBChNjb20uZ29vZ2xlLnByb3RvYnVmQg1EdXJhdGlvblByb3RvUAFa", - "MWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2R1cmF0", - "aW9ucGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlw", - "ZXNiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Duration), global::Google.Protobuf.WellKnownTypes.Duration.Parser, new[]{ "Seconds", "Nanos" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// A Duration represents a signed, fixed-length span of time represented - /// as a count of seconds and fractions of seconds at nanosecond - /// resolution. It is independent of any calendar and concepts like "day" - /// or "month". It is related to Timestamp in that the difference between - /// two Timestamp values is a Duration and it can be added or subtracted - /// from a Timestamp. Range is approximately +-10,000 years. - /// - /// # Examples - /// - /// Example 1: Compute Duration from two Timestamps in pseudo code. - /// - /// Timestamp start = ...; - /// Timestamp end = ...; - /// Duration duration = ...; - /// - /// duration.seconds = end.seconds - start.seconds; - /// duration.nanos = end.nanos - start.nanos; - /// - /// if (duration.seconds < 0 && duration.nanos > 0) { - /// duration.seconds += 1; - /// duration.nanos -= 1000000000; - /// } else if (duration.seconds > 0 && duration.nanos < 0) { - /// duration.seconds -= 1; - /// duration.nanos += 1000000000; - /// } - /// - /// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - /// - /// Timestamp start = ...; - /// Duration duration = ...; - /// Timestamp end = ...; - /// - /// end.seconds = start.seconds + duration.seconds; - /// end.nanos = start.nanos + duration.nanos; - /// - /// if (end.nanos < 0) { - /// end.seconds -= 1; - /// end.nanos += 1000000000; - /// } else if (end.nanos >= 1000000000) { - /// end.seconds += 1; - /// end.nanos -= 1000000000; - /// } - /// - /// Example 3: Compute Duration from datetime.timedelta in Python. - /// - /// td = datetime.timedelta(days=3, minutes=10) - /// duration = Duration() - /// duration.FromTimedelta(td) - /// - /// # JSON Mapping - /// - /// In JSON format, the Duration type is encoded as a string rather than an - /// object, where the string ends in the suffix "s" (indicating seconds) and - /// is preceded by the number of seconds, with nanoseconds expressed as - /// fractional seconds. For example, 3 seconds with 0 nanoseconds should be - /// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - /// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - /// microsecond should be expressed in JSON format as "3.000001s". - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Duration : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Duration()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Duration() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Duration(Duration other) : this() { - seconds_ = other.seconds_; - nanos_ = other.nanos_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Duration Clone() { - return new Duration(this); - } - - /// Field number for the "seconds" field. - public const int SecondsFieldNumber = 1; - private long seconds_; - /// - /// Signed seconds of the span of time. Must be from -315,576,000,000 - /// to +315,576,000,000 inclusive. Note: these bounds are computed from: - /// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long Seconds { - get { return seconds_; } - set { - seconds_ = value; - } - } - - /// Field number for the "nanos" field. - public const int NanosFieldNumber = 2; - private int nanos_; - /// - /// Signed fractions of a second at nanosecond resolution of the span - /// of time. Durations less than one second are represented with a 0 - /// `seconds` field and a positive or negative `nanos` field. For durations - /// of one second or more, a non-zero value for the `nanos` field must be - /// of the same sign as the `seconds` field. Must be from -999,999,999 - /// to +999,999,999 inclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Nanos { - get { return nanos_; } - set { - nanos_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Duration); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Duration other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Seconds != other.Seconds) return false; - if (Nanos != other.Nanos) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Seconds != 0L) hash ^= Seconds.GetHashCode(); - if (Nanos != 0) hash ^= Nanos.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Seconds != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Seconds); - } - if (Nanos != 0) { - output.WriteRawTag(16); - output.WriteInt32(Nanos); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Seconds != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Seconds); - } - if (Nanos != 0) { - output.WriteRawTag(16); - output.WriteInt32(Nanos); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Seconds != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Seconds); - } - if (Nanos != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Duration other) { - if (other == null) { - return; - } - if (other.Seconds != 0L) { - Seconds = other.Seconds; - } - if (other.Nanos != 0) { - Nanos = other.Nanos; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Seconds = input.ReadInt64(); - break; - } - case 16: { - Nanos = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Seconds = input.ReadInt64(); - break; - } - case 16: { - Nanos = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs b/csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs index e1e408aa59959e13a960aa9ebcdc85498c4c45ac..9a468fc1988c43bac9a9493fd83d97e35e1da959 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -15,7 +38,7 @@ namespace Google.Protobuf.WellKnownTypes { // Manually-written partial class for the Duration well-known type, // providing a conversion to TimeSpan and convenience operators. - public partial class Duration : ICustomDiagnosticMessage, IComparable + public partial class Duration : ICustomDiagnosticMessage { /// /// The number of nanoseconds in a second. @@ -243,26 +266,5 @@ namespace Google.Protobuf.WellKnownTypes } } } - - - /// - /// Given another duration, returns 0 if the durations are equivalent, -1 if this duration is shorter than the other, and 1 otherwise. - /// - /// - /// This method expects that both durations are normalized; that is, that the values of - /// and are within the documented bounds. - /// If either value is not normalized, the results of this method are unspecified. - /// - /// The duration to compare with this object. - /// An integer indicating whether this duration is shorter or longer than . - public int CompareTo(Duration other) - { - return other == null ? 1 - : Seconds < other.Seconds ? -1 - : Seconds > other.Seconds ? 1 - : Nanos < other.Nanos ? -1 - : Nanos > other.Nanos ? 1 - : 0; - } } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs index ce820cbc91c3e13156aab510c2e57596cb4b2a08..e2e35182fd92ddb34f884dde6ebc0a38cfb2bb36 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs @@ -25,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1", - "ZiIHCgVFbXB0eUJ2ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", - "UAFaJ2dpdGh1Yi5jb20vZ29sYW5nL3Byb3RvYnVmL3B0eXBlcy9lbXB0efgB", - "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", - "dG8z")); + "ZiIHCgVFbXB0eUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", + "UAFaLmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2Vt", + "cHR5cGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlw", + "ZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.pb.cs deleted file mode 100644 index c869511c56e41b4f0c58fd80889905d7dfb3a669..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.pb.cs +++ /dev/null @@ -1,208 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/empty.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/empty.proto - public static partial class EmptyReflection { - - #region Descriptor - /// File descriptor for google/protobuf/empty.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static EmptyReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1", - "ZiIHCgVFbXB0eUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", - "UAFaLmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2Vt", - "cHR5cGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlw", - "ZXNiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Empty), global::Google.Protobuf.WellKnownTypes.Empty.Parser, null, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// A generic empty message that you can re-use to avoid defining duplicated - /// empty messages in your APIs. A typical example is to use it as the request - /// or the response type of an API method. For instance: - /// - /// service Foo { - /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - /// } - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Empty : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Empty() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Empty(Empty other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Empty Clone() { - return new Empty(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Empty); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Empty other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Empty other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs index ee53861f90470e0b88ea10979b6c49692c10e12c..d5da31441e3cb109ef7f32a46734906a158b445e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs @@ -25,11 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKMAQoTY29tLmdv", - "b2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVo5Z29vZ2xlLmdvbGFu", - "Zy5vcmcvZ2VucHJvdG8vcHJvdG9idWYvZmllbGRfbWFzaztmaWVsZF9tYXNr", - "+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZw", - "cm90bzM=")); + "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKFAQoTY29tLmdv", + "b2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVoyZ29vZ2xlLmdvbGFu", + "Zy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vZmllbGRtYXNrcGL4AQGiAgNH", + "UEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.pb.cs deleted file mode 100644 index 7faddda597f78624606aab7518a2b2a1cfea66ba..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.pb.cs +++ /dev/null @@ -1,428 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/field_mask.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/field_mask.proto - public static partial class FieldMaskReflection { - - #region Descriptor - /// File descriptor for google/protobuf/field_mask.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static FieldMaskReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKFAQoTY29tLmdv", - "b2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVoyZ29vZ2xlLmdvbGFu", - "Zy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vZmllbGRtYXNrcGL4AQGiAgNH", - "UEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.FieldMask), global::Google.Protobuf.WellKnownTypes.FieldMask.Parser, new[]{ "Paths" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// `FieldMask` represents a set of symbolic field paths, for example: - /// - /// paths: "f.a" - /// paths: "f.b.d" - /// - /// Here `f` represents a field in some root message, `a` and `b` - /// fields in the message found in `f`, and `d` a field found in the - /// message in `f.b`. - /// - /// Field masks are used to specify a subset of fields that should be - /// returned by a get operation or modified by an update operation. - /// Field masks also have a custom JSON encoding (see below). - /// - /// # Field Masks in Projections - /// - /// When used in the context of a projection, a response message or - /// sub-message is filtered by the API to only contain those fields as - /// specified in the mask. For example, if the mask in the previous - /// example is applied to a response message as follows: - /// - /// f { - /// a : 22 - /// b { - /// d : 1 - /// x : 2 - /// } - /// y : 13 - /// } - /// z: 8 - /// - /// The result will not contain specific values for fields x,y and z - /// (their value will be set to the default, and omitted in proto text - /// output): - /// - /// f { - /// a : 22 - /// b { - /// d : 1 - /// } - /// } - /// - /// A repeated field is not allowed except at the last position of a - /// paths string. - /// - /// If a FieldMask object is not present in a get operation, the - /// operation applies to all fields (as if a FieldMask of all fields - /// had been specified). - /// - /// Note that a field mask does not necessarily apply to the - /// top-level response message. In case of a REST get operation, the - /// field mask applies directly to the response, but in case of a REST - /// list operation, the mask instead applies to each individual message - /// in the returned resource list. In case of a REST custom method, - /// other definitions may be used. Where the mask applies will be - /// clearly documented together with its declaration in the API. In - /// any case, the effect on the returned resource/resources is required - /// behavior for APIs. - /// - /// # Field Masks in Update Operations - /// - /// A field mask in update operations specifies which fields of the - /// targeted resource are going to be updated. The API is required - /// to only change the values of the fields as specified in the mask - /// and leave the others untouched. If a resource is passed in to - /// describe the updated values, the API ignores the values of all - /// fields not covered by the mask. - /// - /// If a repeated field is specified for an update operation, new values will - /// be appended to the existing repeated field in the target resource. Note that - /// a repeated field is only allowed in the last position of a `paths` string. - /// - /// If a sub-message is specified in the last position of the field mask for an - /// update operation, then new value will be merged into the existing sub-message - /// in the target resource. - /// - /// For example, given the target message: - /// - /// f { - /// b { - /// d: 1 - /// x: 2 - /// } - /// c: [1] - /// } - /// - /// And an update message: - /// - /// f { - /// b { - /// d: 10 - /// } - /// c: [2] - /// } - /// - /// then if the field mask is: - /// - /// paths: ["f.b", "f.c"] - /// - /// then the result will be: - /// - /// f { - /// b { - /// d: 10 - /// x: 2 - /// } - /// c: [1, 2] - /// } - /// - /// An implementation may provide options to override this default behavior for - /// repeated and message fields. - /// - /// In order to reset a field's value to the default, the field must - /// be in the mask and set to the default value in the provided resource. - /// Hence, in order to reset all fields of a resource, provide a default - /// instance of the resource and set all fields in the mask, or do - /// not provide a mask as described below. - /// - /// If a field mask is not present on update, the operation applies to - /// all fields (as if a field mask of all fields has been specified). - /// Note that in the presence of schema evolution, this may mean that - /// fields the client does not know and has therefore not filled into - /// the request will be reset to their default. If this is unwanted - /// behavior, a specific service may require a client to always specify - /// a field mask, producing an error if not. - /// - /// As with get operations, the location of the resource which - /// describes the updated values in the request message depends on the - /// operation kind. In any case, the effect of the field mask is - /// required to be honored by the API. - /// - /// ## Considerations for HTTP REST - /// - /// The HTTP kind of an update operation which uses a field mask must - /// be set to PATCH instead of PUT in order to satisfy HTTP semantics - /// (PUT must only be used for full updates). - /// - /// # JSON Encoding of Field Masks - /// - /// In JSON, a field mask is encoded as a single string where paths are - /// separated by a comma. Fields name in each path are converted - /// to/from lower-camel naming conventions. - /// - /// As an example, consider the following message declarations: - /// - /// message Profile { - /// User user = 1; - /// Photo photo = 2; - /// } - /// message User { - /// string display_name = 1; - /// string address = 2; - /// } - /// - /// In proto a field mask for `Profile` may look as such: - /// - /// mask { - /// paths: "user.display_name" - /// paths: "photo" - /// } - /// - /// In JSON, the same mask is represented as below: - /// - /// { - /// mask: "user.displayName,photo" - /// } - /// - /// # Field Masks and Oneof Fields - /// - /// Field masks treat fields in oneofs just as regular fields. Consider the - /// following message: - /// - /// message SampleMessage { - /// oneof test_oneof { - /// string name = 4; - /// SubMessage sub_message = 9; - /// } - /// } - /// - /// The field mask can be: - /// - /// mask { - /// paths: "name" - /// } - /// - /// Or: - /// - /// mask { - /// paths: "sub_message" - /// } - /// - /// Note that oneof type names ("test_oneof" in this case) cannot be used in - /// paths. - /// - /// ## Field Mask Verification - /// - /// The implementation of any API method which has a FieldMask type field in the - /// request should verify the included field paths, and return an - /// `INVALID_ARGUMENT` error if any path is unmappable. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FieldMask : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldMask()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldMask() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldMask(FieldMask other) : this() { - paths_ = other.paths_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FieldMask Clone() { - return new FieldMask(this); - } - - /// Field number for the "paths" field. - public const int PathsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_paths_codec - = pb::FieldCodec.ForString(10); - private readonly pbc::RepeatedField paths_ = new pbc::RepeatedField(); - /// - /// The set of field mask paths. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Paths { - get { return paths_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FieldMask); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FieldMask other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!paths_.Equals(other.paths_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= paths_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - paths_.WriteTo(output, _repeated_paths_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - paths_.WriteTo(ref output, _repeated_paths_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += paths_.CalculateSize(_repeated_paths_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FieldMask other) { - if (other == null) { - return; - } - paths_.Add(other.paths_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - paths_.AddEntriesFrom(input, _repeated_paths_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - paths_.AddEntriesFrom(ref input, _repeated_paths_codec); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs index d99a6314ae77b8b9370f1ffe753ef89dea226a8d..91d2ee9094ab33e1bb81bd8edf820be9ee1ee11f 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs @@ -1,16 +1,38 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2016 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using Google.Protobuf.Reflection; @@ -40,7 +62,12 @@ namespace Google.Protobuf.WellKnownTypes if (firstInvalid == null) { var writer = new StringWriter(); +#if NET35 + var query = paths.Select(JsonFormatter.ToJsonName); + JsonFormatter.WriteString(writer, string.Join(",", query.ToArray())); +#else JsonFormatter.WriteString(writer, string.Join(",", paths.Select(JsonFormatter.ToJsonName))); +#endif return writer.ToString(); } else @@ -88,7 +115,7 @@ namespace Google.Protobuf.WellKnownTypes /// Parses from a string to a FieldMask and validates all field paths. /// /// The type to validate the field paths against. - public static FieldMask FromString<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>(string value) where T : IMessage + public static FieldMask FromString(string value) where T : IMessage { return FromStringEnumerable(new List(value.Split(FIELD_PATH_SEPARATOR))); } @@ -97,7 +124,7 @@ namespace Google.Protobuf.WellKnownTypes /// Constructs a FieldMask for a list of field paths in a certain type. /// /// The type to validate the field paths against. - public static FieldMask FromStringEnumerable<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>(IEnumerable paths) where T : IMessage + public static FieldMask FromStringEnumerable(IEnumerable paths) where T : IMessage { var mask = new FieldMask(); foreach (var path in paths) @@ -124,7 +151,7 @@ namespace Google.Protobuf.WellKnownTypes /// Constructs a FieldMask from the passed field numbers. /// /// The type to validate the field paths against. - public static FieldMask FromFieldNumbers<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>(params int[] fieldNumbers) where T : IMessage + public static FieldMask FromFieldNumbers(params int[] fieldNumbers) where T : IMessage { return FromFieldNumbers((IEnumerable)fieldNumbers); } @@ -133,7 +160,7 @@ namespace Google.Protobuf.WellKnownTypes /// Constructs a FieldMask from the passed field numbers. /// /// The type to validate the field paths against. - public static FieldMask FromFieldNumbers<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>(IEnumerable fieldNumbers) where T : IMessage + public static FieldMask FromFieldNumbers(IEnumerable fieldNumbers) where T : IMessage { var descriptor = Activator.CreateInstance().Descriptor; @@ -181,7 +208,7 @@ namespace Google.Protobuf.WellKnownTypes /// Checks whether paths in a given fields mask are valid. /// /// The type to validate the field paths against. - public static bool IsValid<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>(FieldMask fieldMask) where T : IMessage + public static bool IsValid(FieldMask fieldMask) where T : IMessage { var descriptor = Activator.CreateInstance().Descriptor; @@ -208,7 +235,7 @@ namespace Google.Protobuf.WellKnownTypes /// Checks whether a given field path is valid. /// /// The type to validate the field paths against. - public static bool IsValid<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>(string path) where T : IMessage + public static bool IsValid(string path) where T : IMessage { var descriptor = Activator.CreateInstance().Descriptor; diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs index 38240bb61531b0cb8af15eeb3bcf974c658850e6..5fe9b895364d4d56e79bb2c4e13fc00f752fa543 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs @@ -26,10 +26,10 @@ namespace Google.Protobuf.WellKnownTypes { string.Concat( "CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2ds", "ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo", - "CUKVAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3Rv", - "UAFaQWdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL3Byb3RvYnVmL3NvdXJj", - "ZV9jb250ZXh0O3NvdXJjZV9jb250ZXh0ogIDR1BCqgIeR29vZ2xlLlByb3Rv", - "YnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); + "CUKKAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3Rv", + "UAFaNmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3Nv", + "dXJjZWNvbnRleHRwYqICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25v", + "d25UeXBlc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index 42d37ca01bbf409a5133b22053fbc87ad0517dee..0bbb1fcdf9d585eb88343624e71053c619c4bd8e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -35,10 +35,10 @@ namespace Google.Protobuf.WellKnownTypes { "ABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RW", "YWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIW", "Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W", - "QUxVRRAAQoEBChNjb20uZ29vZ2xlLnByb3RvYnVmQgtTdHJ1Y3RQcm90b1AB", - "WjFnaXRodWIuY29tL2dvbGFuZy9wcm90b2J1Zi9wdHlwZXMvc3RydWN0O3N0", - "cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5", - "cGVzYgZwcm90bzM=")); + "QUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFa", + "L2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVj", + "dHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVz", + "YgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.NullValue), }, null, new pbr::GeneratedClrTypeInfo[] { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.pb.cs deleted file mode 100644 index d2a564a94458686755d09cc238362b1574391e3f..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.pb.cs +++ /dev/null @@ -1,983 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/struct.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/struct.proto - public static partial class StructReflection { - - #region Descriptor - /// File descriptor for google/protobuf/struct.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static StructReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9i", - "dWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9i", - "dWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgB", - "IAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToC", - "OAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJv", - "dG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoM", - "c3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8K", - "DHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RI", - "ABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RW", - "YWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIW", - "Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W", - "QUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFa", - "L2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVj", - "dHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVz", - "YgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.NullValue), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Struct), global::Google.Protobuf.WellKnownTypes.Struct.Parser, new[]{ "Fields" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Value), global::Google.Protobuf.WellKnownTypes.Value.Parser, new[]{ "NullValue", "NumberValue", "StringValue", "BoolValue", "StructValue", "ListValue" }, new[]{ "Kind" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.ListValue), global::Google.Protobuf.WellKnownTypes.ListValue.Parser, new[]{ "Values" }, null, null, null, null) - })); - } - #endregion - - } - #region Enums - /// - /// `NullValue` is a singleton enumeration to represent the null value for the - /// `Value` type union. - /// - /// The JSON representation for `NullValue` is JSON `null`. - /// - public enum NullValue { - /// - /// Null value. - /// - [pbr::OriginalName("NULL_VALUE")] NullValue = 0, - } - - #endregion - - #region Messages - /// - /// `Struct` represents a structured data value, consisting of fields - /// which map to dynamically typed values. In some languages, `Struct` - /// might be supported by a native representation. For example, in - /// scripting languages like JS a struct is represented as an - /// object. The details of that representation are described together - /// with the proto support for the language. - /// - /// The JSON representation for `Struct` is JSON object. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Struct : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Struct()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Struct() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Struct(Struct other) : this() { - fields_ = other.fields_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Struct Clone() { - return new Struct(this); - } - - /// Field number for the "fields" field. - public const int FieldsFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_fields_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Value.Parser), 10); - private readonly pbc::MapField fields_ = new pbc::MapField(); - /// - /// Unordered map of dynamically typed values. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField Fields { - get { return fields_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Struct); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Struct other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!Fields.Equals(other.Fields)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= Fields.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - fields_.WriteTo(output, _map_fields_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - fields_.WriteTo(ref output, _map_fields_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += fields_.CalculateSize(_map_fields_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Struct other) { - if (other == null) { - return; - } - fields_.MergeFrom(other.fields_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - fields_.AddEntriesFrom(input, _map_fields_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - fields_.AddEntriesFrom(ref input, _map_fields_codec); - break; - } - } - } - } - #endif - - } - - /// - /// `Value` represents a dynamically typed value which can be either - /// null, a number, a string, a boolean, a recursive struct value, or a - /// list of values. A producer of value is expected to set one of these - /// variants. Absence of any variant indicates an error. - /// - /// The JSON representation for `Value` is JSON value. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Value : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Value()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Value() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Value(Value other) : this() { - switch (other.KindCase) { - case KindOneofCase.NullValue: - NullValue = other.NullValue; - break; - case KindOneofCase.NumberValue: - NumberValue = other.NumberValue; - break; - case KindOneofCase.StringValue: - StringValue = other.StringValue; - break; - case KindOneofCase.BoolValue: - BoolValue = other.BoolValue; - break; - case KindOneofCase.StructValue: - StructValue = other.StructValue.Clone(); - break; - case KindOneofCase.ListValue: - ListValue = other.ListValue.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Value Clone() { - return new Value(this); - } - - /// Field number for the "null_value" field. - public const int NullValueFieldNumber = 1; - /// - /// Represents a null value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { - get { return HasNullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } - set { - kind_ = value; - kindCase_ = KindOneofCase.NullValue; - } - } - /// Gets whether the "null_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNullValue { - get { return kindCase_ == KindOneofCase.NullValue; } - } - /// Clears the value of the oneof if it's currently set to "null_value" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNullValue() { - if (HasNullValue) { - ClearKind(); - } - } - - /// Field number for the "number_value" field. - public const int NumberValueFieldNumber = 2; - /// - /// Represents a double value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double NumberValue { - get { return HasNumberValue ? (double) kind_ : 0D; } - set { - kind_ = value; - kindCase_ = KindOneofCase.NumberValue; - } - } - /// Gets whether the "number_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasNumberValue { - get { return kindCase_ == KindOneofCase.NumberValue; } - } - /// Clears the value of the oneof if it's currently set to "number_value" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearNumberValue() { - if (HasNumberValue) { - ClearKind(); - } - } - - /// Field number for the "string_value" field. - public const int StringValueFieldNumber = 3; - /// - /// Represents a string value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string StringValue { - get { return HasStringValue ? (string) kind_ : ""; } - set { - kind_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - kindCase_ = KindOneofCase.StringValue; - } - } - /// Gets whether the "string_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasStringValue { - get { return kindCase_ == KindOneofCase.StringValue; } - } - /// Clears the value of the oneof if it's currently set to "string_value" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearStringValue() { - if (HasStringValue) { - ClearKind(); - } - } - - /// Field number for the "bool_value" field. - public const int BoolValueFieldNumber = 4; - /// - /// Represents a boolean value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool BoolValue { - get { return HasBoolValue ? (bool) kind_ : false; } - set { - kind_ = value; - kindCase_ = KindOneofCase.BoolValue; - } - } - /// Gets whether the "bool_value" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasBoolValue { - get { return kindCase_ == KindOneofCase.BoolValue; } - } - /// Clears the value of the oneof if it's currently set to "bool_value" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearBoolValue() { - if (HasBoolValue) { - ClearKind(); - } - } - - /// Field number for the "struct_value" field. - public const int StructValueFieldNumber = 5; - /// - /// Represents a structured value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Struct StructValue { - get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; } - set { - kind_ = value; - kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.StructValue; - } - } - - /// Field number for the "list_value" field. - public const int ListValueFieldNumber = 6; - /// - /// Represents a repeated `Value`. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.ListValue ListValue { - get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; } - set { - kind_ = value; - kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.ListValue; - } - } - - private object kind_; - /// Enum of possible cases for the "kind" oneof. - public enum KindOneofCase { - None = 0, - NullValue = 1, - NumberValue = 2, - StringValue = 3, - BoolValue = 4, - StructValue = 5, - ListValue = 6, - } - private KindOneofCase kindCase_ = KindOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public KindOneofCase KindCase { - get { return kindCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearKind() { - kindCase_ = KindOneofCase.None; - kind_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Value); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Value other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (NullValue != other.NullValue) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(NumberValue, other.NumberValue)) return false; - if (StringValue != other.StringValue) return false; - if (BoolValue != other.BoolValue) return false; - if (!object.Equals(StructValue, other.StructValue)) return false; - if (!object.Equals(ListValue, other.ListValue)) return false; - if (KindCase != other.KindCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (HasNullValue) hash ^= NullValue.GetHashCode(); - if (HasNumberValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(NumberValue); - if (HasStringValue) hash ^= StringValue.GetHashCode(); - if (HasBoolValue) hash ^= BoolValue.GetHashCode(); - if (kindCase_ == KindOneofCase.StructValue) hash ^= StructValue.GetHashCode(); - if (kindCase_ == KindOneofCase.ListValue) hash ^= ListValue.GetHashCode(); - hash ^= (int) kindCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (HasNullValue) { - output.WriteRawTag(8); - output.WriteEnum((int) NullValue); - } - if (HasNumberValue) { - output.WriteRawTag(17); - output.WriteDouble(NumberValue); - } - if (HasStringValue) { - output.WriteRawTag(26); - output.WriteString(StringValue); - } - if (HasBoolValue) { - output.WriteRawTag(32); - output.WriteBool(BoolValue); - } - if (kindCase_ == KindOneofCase.StructValue) { - output.WriteRawTag(42); - output.WriteMessage(StructValue); - } - if (kindCase_ == KindOneofCase.ListValue) { - output.WriteRawTag(50); - output.WriteMessage(ListValue); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (HasNullValue) { - output.WriteRawTag(8); - output.WriteEnum((int) NullValue); - } - if (HasNumberValue) { - output.WriteRawTag(17); - output.WriteDouble(NumberValue); - } - if (HasStringValue) { - output.WriteRawTag(26); - output.WriteString(StringValue); - } - if (HasBoolValue) { - output.WriteRawTag(32); - output.WriteBool(BoolValue); - } - if (kindCase_ == KindOneofCase.StructValue) { - output.WriteRawTag(42); - output.WriteMessage(StructValue); - } - if (kindCase_ == KindOneofCase.ListValue) { - output.WriteRawTag(50); - output.WriteMessage(ListValue); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (HasNullValue) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NullValue); - } - if (HasNumberValue) { - size += 1 + 8; - } - if (HasStringValue) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue); - } - if (HasBoolValue) { - size += 1 + 1; - } - if (kindCase_ == KindOneofCase.StructValue) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(StructValue); - } - if (kindCase_ == KindOneofCase.ListValue) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ListValue); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Value other) { - if (other == null) { - return; - } - switch (other.KindCase) { - case KindOneofCase.NullValue: - NullValue = other.NullValue; - break; - case KindOneofCase.NumberValue: - NumberValue = other.NumberValue; - break; - case KindOneofCase.StringValue: - StringValue = other.StringValue; - break; - case KindOneofCase.BoolValue: - BoolValue = other.BoolValue; - break; - case KindOneofCase.StructValue: - if (StructValue == null) { - StructValue = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - StructValue.MergeFrom(other.StructValue); - break; - case KindOneofCase.ListValue: - if (ListValue == null) { - ListValue = new global::Google.Protobuf.WellKnownTypes.ListValue(); - } - ListValue.MergeFrom(other.ListValue); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - kind_ = input.ReadEnum(); - kindCase_ = KindOneofCase.NullValue; - break; - } - case 17: { - NumberValue = input.ReadDouble(); - break; - } - case 26: { - StringValue = input.ReadString(); - break; - } - case 32: { - BoolValue = input.ReadBool(); - break; - } - case 42: { - global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); - if (kindCase_ == KindOneofCase.StructValue) { - subBuilder.MergeFrom(StructValue); - } - input.ReadMessage(subBuilder); - StructValue = subBuilder; - break; - } - case 50: { - global::Google.Protobuf.WellKnownTypes.ListValue subBuilder = new global::Google.Protobuf.WellKnownTypes.ListValue(); - if (kindCase_ == KindOneofCase.ListValue) { - subBuilder.MergeFrom(ListValue); - } - input.ReadMessage(subBuilder); - ListValue = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - kind_ = input.ReadEnum(); - kindCase_ = KindOneofCase.NullValue; - break; - } - case 17: { - NumberValue = input.ReadDouble(); - break; - } - case 26: { - StringValue = input.ReadString(); - break; - } - case 32: { - BoolValue = input.ReadBool(); - break; - } - case 42: { - global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); - if (kindCase_ == KindOneofCase.StructValue) { - subBuilder.MergeFrom(StructValue); - } - input.ReadMessage(subBuilder); - StructValue = subBuilder; - break; - } - case 50: { - global::Google.Protobuf.WellKnownTypes.ListValue subBuilder = new global::Google.Protobuf.WellKnownTypes.ListValue(); - if (kindCase_ == KindOneofCase.ListValue) { - subBuilder.MergeFrom(ListValue); - } - input.ReadMessage(subBuilder); - ListValue = subBuilder; - break; - } - } - } - } - #endif - - } - - /// - /// `ListValue` is a wrapper around a repeated field of values. - /// - /// The JSON representation for `ListValue` is JSON array. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ListValue : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListValue()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ListValue() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ListValue(ListValue other) : this() { - values_ = other.values_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ListValue Clone() { - return new ListValue(this); - } - - /// Field number for the "values" field. - public const int ValuesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_values_codec - = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Value.Parser); - private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); - /// - /// Repeated field of dynamically typed values. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Values { - get { return values_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ListValue); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ListValue other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!values_.Equals(other.values_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= values_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - values_.WriteTo(output, _repeated_values_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - values_.WriteTo(ref output, _repeated_values_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += values_.CalculateSize(_repeated_values_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ListValue other) { - if (other == null) { - return; - } - values_.Add(other.values_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - values_.AddEntriesFrom(input, _repeated_values_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - values_.AddEntriesFrom(ref input, _repeated_values_codec); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs b/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs index b18de0e211dea725e28ade6bf17316df7225ea31..8b63d63035b176abc3938b4f36a694f4dd96ce46 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index b2f5d35335bbfca71393f7ccd73333f1ad3e0579..2fb1b4d164282b15eddc4a4485b06393f9d34cc3 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -26,10 +26,10 @@ namespace Google.Protobuf.WellKnownTypes { string.Concat( "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv", "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", - "AiABKAVCfgoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q", - "AVorZ2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHR5cGVzL3RpbWVzdGFt", - "cPgBAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", - "cHJvdG8z")); + "AiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3Rv", + "UAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3Rp", + "bWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93", + "blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -91,7 +91,15 @@ namespace Google.Protobuf.WellKnownTypes { /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) /// .setNanos((int) ((millis % 1000) * 1000000)).build(); /// - /// Example 5: Compute Timestamp from current time in Python. + /// Example 5: Compute Timestamp from Java `Instant.now()`. + /// + /// Instant now = Instant.now(); + /// + /// Timestamp timestamp = + /// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + /// .setNanos(now.getNano()).build(); + /// + /// Example 6: Compute Timestamp from current time in Python. /// /// timestamp = Timestamp() /// timestamp.GetCurrentTime() diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.pb.cs deleted file mode 100644 index 8e85fa3be61c867c299d7fe0e7ee3b0112ec2271..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.pb.cs +++ /dev/null @@ -1,376 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/timestamp.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/timestamp.proto - public static partial class TimestampReflection { - - #region Descriptor - /// File descriptor for google/protobuf/timestamp.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static TimestampReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv", - "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", - "AiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3Rv", - "UAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3Rp", - "bWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93", - "blR5cGVzYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Timestamp), global::Google.Protobuf.WellKnownTypes.Timestamp.Parser, new[]{ "Seconds", "Nanos" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// A Timestamp represents a point in time independent of any time zone or local - /// calendar, encoded as a count of seconds and fractions of seconds at - /// nanosecond resolution. The count is relative to an epoch at UTC midnight on - /// January 1, 1970, in the proleptic Gregorian calendar which extends the - /// Gregorian calendar backwards to year one. - /// - /// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - /// second table is needed for interpretation, using a [24-hour linear - /// smear](https://developers.google.com/time/smear). - /// - /// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - /// restricting to that range, we ensure that we can convert to and from [RFC - /// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - /// - /// # Examples - /// - /// Example 1: Compute Timestamp from POSIX `time()`. - /// - /// Timestamp timestamp; - /// timestamp.set_seconds(time(NULL)); - /// timestamp.set_nanos(0); - /// - /// Example 2: Compute Timestamp from POSIX `gettimeofday()`. - /// - /// struct timeval tv; - /// gettimeofday(&tv, NULL); - /// - /// Timestamp timestamp; - /// timestamp.set_seconds(tv.tv_sec); - /// timestamp.set_nanos(tv.tv_usec * 1000); - /// - /// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - /// - /// FILETIME ft; - /// GetSystemTimeAsFileTime(&ft); - /// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - /// - /// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - /// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - /// Timestamp timestamp; - /// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - /// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - /// - /// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - /// - /// long millis = System.currentTimeMillis(); - /// - /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - /// .setNanos((int) ((millis % 1000) * 1000000)).build(); - /// - /// Example 5: Compute Timestamp from Java `Instant.now()`. - /// - /// Instant now = Instant.now(); - /// - /// Timestamp timestamp = - /// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - /// .setNanos(now.getNano()).build(); - /// - /// Example 6: Compute Timestamp from current time in Python. - /// - /// timestamp = Timestamp() - /// timestamp.GetCurrentTime() - /// - /// # JSON Mapping - /// - /// In JSON format, the Timestamp type is encoded as a string in the - /// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - /// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - /// where {year} is always expressed using four digits while {month}, {day}, - /// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - /// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - /// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - /// is required. A proto3 JSON serializer should always use UTC (as indicated by - /// "Z") when printing the Timestamp type and a proto3 JSON parser should be - /// able to accept both UTC and other timezones (as indicated by an offset). - /// - /// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - /// 01:30 UTC on January 15, 2017. - /// - /// In JavaScript, one can convert a Date object to this format using the - /// standard - /// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - /// method. In Python, a standard `datetime.datetime` object can be converted - /// to this format using - /// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - /// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - /// the Joda Time's [`ISODateTimeFormat.dateTime()`]( - /// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - /// ) to obtain a formatter capable of generating timestamps in this format. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Timestamp : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Timestamp()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Timestamp() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Timestamp(Timestamp other) : this() { - seconds_ = other.seconds_; - nanos_ = other.nanos_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Timestamp Clone() { - return new Timestamp(this); - } - - /// Field number for the "seconds" field. - public const int SecondsFieldNumber = 1; - private long seconds_; - /// - /// Represents seconds of UTC time since Unix epoch - /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - /// 9999-12-31T23:59:59Z inclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public long Seconds { - get { return seconds_; } - set { - seconds_ = value; - } - } - - /// Field number for the "nanos" field. - public const int NanosFieldNumber = 2; - private int nanos_; - /// - /// Non-negative fractions of a second at nanosecond resolution. Negative - /// second values with fractions must still have non-negative nanos values - /// that count forward in time. Must be from 0 to 999,999,999 - /// inclusive. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Nanos { - get { return nanos_; } - set { - nanos_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Timestamp); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Timestamp other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Seconds != other.Seconds) return false; - if (Nanos != other.Nanos) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Seconds != 0L) hash ^= Seconds.GetHashCode(); - if (Nanos != 0) hash ^= Nanos.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Seconds != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Seconds); - } - if (Nanos != 0) { - output.WriteRawTag(16); - output.WriteInt32(Nanos); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Seconds != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Seconds); - } - if (Nanos != 0) { - output.WriteRawTag(16); - output.WriteInt32(Nanos); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Seconds != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Seconds); - } - if (Nanos != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Timestamp other) { - if (other == null) { - return; - } - if (other.Seconds != 0L) { - Seconds = other.Seconds; - } - if (other.Nanos != 0) { - Nanos = other.Nanos; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Seconds = input.ReadInt64(); - break; - } - case 16: { - Nanos = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Seconds = input.ReadInt64(); - break; - } - case 16: { - Nanos = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs b/csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs index 2aa3a1c3c87b0dae66fa6f4f3f0851493bc12399..2f5172f1ca7cb08a535c5b841a34c8c82a1d0186 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs @@ -1,10 +1,33 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; @@ -36,8 +59,8 @@ namespace Google.Protobuf.WellKnownTypes /// The difference between the two specified timestamps. public static Duration operator -(Timestamp lhs, Timestamp rhs) { - ProtoPreconditions.CheckNotNull(lhs, nameof(lhs)); - ProtoPreconditions.CheckNotNull(rhs, nameof(rhs)); + ProtoPreconditions.CheckNotNull(lhs, "lhs"); + ProtoPreconditions.CheckNotNull(rhs, "rhs"); checked { return Duration.Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); @@ -52,8 +75,8 @@ namespace Google.Protobuf.WellKnownTypes /// The result of adding the duration to the timestamp. public static Timestamp operator +(Timestamp lhs, Duration rhs) { - ProtoPreconditions.CheckNotNull(lhs, nameof(lhs)); - ProtoPreconditions.CheckNotNull(rhs, nameof(rhs)); + ProtoPreconditions.CheckNotNull(lhs, "lhs"); + ProtoPreconditions.CheckNotNull(rhs, "rhs"); checked { return Normalize(lhs.Seconds + rhs.Seconds, lhs.Nanos + rhs.Nanos); @@ -68,8 +91,8 @@ namespace Google.Protobuf.WellKnownTypes /// The result of subtracting the duration from the timestamp. public static Timestamp operator -(Timestamp lhs, Duration rhs) { - ProtoPreconditions.CheckNotNull(lhs, nameof(lhs)); - ProtoPreconditions.CheckNotNull(rhs, nameof(rhs)); + ProtoPreconditions.CheckNotNull(lhs, "lhs"); + ProtoPreconditions.CheckNotNull(rhs, "rhs"); checked { return Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos); @@ -285,7 +308,7 @@ namespace Google.Protobuf.WellKnownTypes /// true if the two timestamps refer to the same nanosecond public static bool operator ==(Timestamp a, Timestamp b) { - return ReferenceEquals(a, b) || (a is null ? (b is null) : a.Equals(b)); + return ReferenceEquals(a, b) || (ReferenceEquals(a, null) ? (ReferenceEquals(b, null) ? true : false) : a.Equals(b)); } /// diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index c62095a98721cdd4c4d719b550430021f046a20e..f5dfdb7e3e768f5aebbcd0714aeb36db9883859a 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -56,10 +56,10 @@ namespace Google.Protobuf.WellKnownTypes { "ASgFEigKB29wdGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9u", "IjsKBk9wdGlvbhIMCgRuYW1lGAEgASgJEiMKBXZhbHVlGAIgASgLMhQuZ29v", "Z2xlLnByb3RvYnVmLkFueSouCgZTeW50YXgSEQoNU1lOVEFYX1BST1RPMhAA", - "EhEKDVNZTlRBWF9QUk9UTzMQAUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQglU", - "eXBlUHJvdG9QAVovZ29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vcHJvdG9i", - "dWYvcHR5cGU7cHR5cGX4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2Vs", - "bEtub3duVHlwZXNiBnByb3RvMw==")); + "EhEKDVNZTlRBWF9QUk9UTzMQAUJ7ChNjb20uZ29vZ2xlLnByb3RvYnVmQglU", + "eXBlUHJvdG9QAVotZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMv", + "a25vd24vdHlwZXBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxL", + "bm93blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, null, new pbr::GeneratedClrTypeInfo[] { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.pb.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.pb.cs deleted file mode 100644 index 2a774b21d8af44b38a8063d02ecda3ee6ac27fed..0000000000000000000000000000000000000000 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.pb.cs +++ /dev/null @@ -1,2074 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/type.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Google.Protobuf.WellKnownTypes { - - /// Holder for reflection information generated from google/protobuf/type.proto - public static partial class TypeReflection { - - #region Descriptor - /// File descriptor for google/protobuf/type.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static TypeReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVm", - "Ghlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvGiRnb29nbGUvcHJvdG9idWYv", - "c291cmNlX2NvbnRleHQucHJvdG8i6AEKBFR5cGUSDAoEbmFtZRgBIAEoCRIm", - "CgZmaWVsZHMYAiADKAsyFi5nb29nbGUucHJvdG9idWYuRmllbGQSDgoGb25l", - "b2ZzGAMgAygJEigKB29wdGlvbnMYBCADKAsyFy5nb29nbGUucHJvdG9idWYu", - "T3B0aW9uEjYKDnNvdXJjZV9jb250ZXh0GAUgASgLMh4uZ29vZ2xlLnByb3Rv", - "YnVmLlNvdXJjZUNvbnRleHQSJwoGc3ludGF4GAYgASgOMhcuZ29vZ2xlLnBy", - "b3RvYnVmLlN5bnRheBIPCgdlZGl0aW9uGAcgASgJItUFCgVGaWVsZBIpCgRr", - "aW5kGAEgASgOMhsuZ29vZ2xlLnByb3RvYnVmLkZpZWxkLktpbmQSNwoLY2Fy", - "ZGluYWxpdHkYAiABKA4yIi5nb29nbGUucHJvdG9idWYuRmllbGQuQ2FyZGlu", - "YWxpdHkSDgoGbnVtYmVyGAMgASgFEgwKBG5hbWUYBCABKAkSEAoIdHlwZV91", - "cmwYBiABKAkSEwoLb25lb2ZfaW5kZXgYByABKAUSDgoGcGFja2VkGAggASgI", - "EigKB29wdGlvbnMYCSADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEhEK", - "CWpzb25fbmFtZRgKIAEoCRIVCg1kZWZhdWx0X3ZhbHVlGAsgASgJIsgCCgRL", - "aW5kEhAKDFRZUEVfVU5LTk9XThAAEg8KC1RZUEVfRE9VQkxFEAESDgoKVFlQ", - "RV9GTE9BVBACEg4KClRZUEVfSU5UNjQQAxIPCgtUWVBFX1VJTlQ2NBAEEg4K", - "ClRZUEVfSU5UMzIQBRIQCgxUWVBFX0ZJWEVENjQQBhIQCgxUWVBFX0ZJWEVE", - "MzIQBxINCglUWVBFX0JPT0wQCBIPCgtUWVBFX1NUUklORxAJEg4KClRZUEVf", - "R1JPVVAQChIQCgxUWVBFX01FU1NBR0UQCxIOCgpUWVBFX0JZVEVTEAwSDwoL", - "VFlQRV9VSU5UMzIQDRINCglUWVBFX0VOVU0QDhIRCg1UWVBFX1NGSVhFRDMy", - "EA8SEQoNVFlQRV9TRklYRUQ2NBAQEg8KC1RZUEVfU0lOVDMyEBESDwoLVFlQ", - "RV9TSU5UNjQQEiJ0CgtDYXJkaW5hbGl0eRIXChNDQVJESU5BTElUWV9VTktO", - "T1dOEAASGAoUQ0FSRElOQUxJVFlfT1BUSU9OQUwQARIYChRDQVJESU5BTElU", - "WV9SRVFVSVJFRBACEhgKFENBUkRJTkFMSVRZX1JFUEVBVEVEEAMi3wEKBEVu", - "dW0SDAoEbmFtZRgBIAEoCRItCgllbnVtdmFsdWUYAiADKAsyGi5nb29nbGUu", - "cHJvdG9idWYuRW51bVZhbHVlEigKB29wdGlvbnMYAyADKAsyFy5nb29nbGUu", - "cHJvdG9idWYuT3B0aW9uEjYKDnNvdXJjZV9jb250ZXh0GAQgASgLMh4uZ29v", - "Z2xlLnByb3RvYnVmLlNvdXJjZUNvbnRleHQSJwoGc3ludGF4GAUgASgOMhcu", - "Z29vZ2xlLnByb3RvYnVmLlN5bnRheBIPCgdlZGl0aW9uGAYgASgJIlMKCUVu", - "dW1WYWx1ZRIMCgRuYW1lGAEgASgJEg4KBm51bWJlchgCIAEoBRIoCgdvcHRp", - "b25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbiI7CgZPcHRpb24S", - "DAoEbmFtZRgBIAEoCRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm90b2J1", - "Zi5BbnkqQwoGU3ludGF4EhEKDVNZTlRBWF9QUk9UTzIQABIRCg1TWU5UQVhf", - "UFJPVE8zEAESEwoPU1lOVEFYX0VESVRJT05TEAJCewoTY29tLmdvb2dsZS5w", - "cm90b2J1ZkIJVHlwZVByb3RvUAFaLWdvb2dsZS5nb2xhbmcub3JnL3Byb3Rv", - "YnVmL3R5cGVzL2tub3duL3R5cGVwYvgBAaICA0dQQqoCHkdvb2dsZS5Qcm90", - "b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), global::Google.Protobuf.WellKnownTypes.Type.Parser, new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext", "Syntax", "Edition" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), global::Google.Protobuf.WellKnownTypes.Field.Parser, new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options", "JsonName", "DefaultValue" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), global::Google.Protobuf.WellKnownTypes.Enum.Parser, new[]{ "Name", "Enumvalue", "Options", "SourceContext", "Syntax", "Edition" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), global::Google.Protobuf.WellKnownTypes.EnumValue.Parser, new[]{ "Name", "Number", "Options" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Option), global::Google.Protobuf.WellKnownTypes.Option.Parser, new[]{ "Name", "Value" }, null, null, null, null) - })); - } - #endregion - - } - #region Enums - /// - /// The syntax in which a protocol buffer element is defined. - /// - public enum Syntax { - /// - /// Syntax `proto2`. - /// - [pbr::OriginalName("SYNTAX_PROTO2")] Proto2 = 0, - /// - /// Syntax `proto3`. - /// - [pbr::OriginalName("SYNTAX_PROTO3")] Proto3 = 1, - /// - /// Syntax `editions`. - /// - [pbr::OriginalName("SYNTAX_EDITIONS")] Editions = 2, - } - - #endregion - - #region Messages - /// - /// A protocol buffer message type. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Type : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Type()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Type() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Type(Type other) : this() { - name_ = other.name_; - fields_ = other.fields_.Clone(); - oneofs_ = other.oneofs_.Clone(); - options_ = other.options_.Clone(); - sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null; - syntax_ = other.syntax_; - edition_ = other.edition_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Type Clone() { - return new Type(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// The fully qualified message name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "fields" field. - public const int FieldsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_fields_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser); - private readonly pbc::RepeatedField fields_ = new pbc::RepeatedField(); - /// - /// The list of fields. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Fields { - get { return fields_; } - } - - /// Field number for the "oneofs" field. - public const int OneofsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_oneofs_codec - = pb::FieldCodec.ForString(26); - private readonly pbc::RepeatedField oneofs_ = new pbc::RepeatedField(); - /// - /// The list of types appearing in `oneof` definitions in this type. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Oneofs { - get { return oneofs_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - /// - /// The protocol buffer options. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Options { - get { return options_; } - } - - /// Field number for the "source_context" field. - public const int SourceContextFieldNumber = 5; - private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; - /// - /// The source context. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { - get { return sourceContext_; } - set { - sourceContext_ = value; - } - } - - /// Field number for the "syntax" field. - public const int SyntaxFieldNumber = 6; - private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.Proto2; - /// - /// The source syntax. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { - get { return syntax_; } - set { - syntax_ = value; - } - } - - /// Field number for the "edition" field. - public const int EditionFieldNumber = 7; - private string edition_ = ""; - /// - /// The source edition string, only valid when syntax is SYNTAX_EDITIONS. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Edition { - get { return edition_; } - set { - edition_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Type); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Type other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if(!fields_.Equals(other.fields_)) return false; - if(!oneofs_.Equals(other.oneofs_)) return false; - if(!options_.Equals(other.options_)) return false; - if (!object.Equals(SourceContext, other.SourceContext)) return false; - if (Syntax != other.Syntax) return false; - if (Edition != other.Edition) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - hash ^= fields_.GetHashCode(); - hash ^= oneofs_.GetHashCode(); - hash ^= options_.GetHashCode(); - if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) hash ^= Syntax.GetHashCode(); - if (Edition.Length != 0) hash ^= Edition.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - fields_.WriteTo(output, _repeated_fields_codec); - oneofs_.WriteTo(output, _repeated_oneofs_codec); - options_.WriteTo(output, _repeated_options_codec); - if (sourceContext_ != null) { - output.WriteRawTag(42); - output.WriteMessage(SourceContext); - } - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(48); - output.WriteEnum((int) Syntax); - } - if (Edition.Length != 0) { - output.WriteRawTag(58); - output.WriteString(Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - fields_.WriteTo(ref output, _repeated_fields_codec); - oneofs_.WriteTo(ref output, _repeated_oneofs_codec); - options_.WriteTo(ref output, _repeated_options_codec); - if (sourceContext_ != null) { - output.WriteRawTag(42); - output.WriteMessage(SourceContext); - } - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(48); - output.WriteEnum((int) Syntax); - } - if (Edition.Length != 0) { - output.WriteRawTag(58); - output.WriteString(Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - size += fields_.CalculateSize(_repeated_fields_codec); - size += oneofs_.CalculateSize(_repeated_oneofs_codec); - size += options_.CalculateSize(_repeated_options_codec); - if (sourceContext_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); - } - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); - } - if (Edition.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Edition); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Type other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - fields_.Add(other.fields_); - oneofs_.Add(other.oneofs_); - options_.Add(other.options_); - if (other.sourceContext_ != null) { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - SourceContext.MergeFrom(other.SourceContext); - } - if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - Syntax = other.Syntax; - } - if (other.Edition.Length != 0) { - Edition = other.Edition; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - fields_.AddEntriesFrom(input, _repeated_fields_codec); - break; - } - case 26: { - oneofs_.AddEntriesFrom(input, _repeated_oneofs_codec); - break; - } - case 34: { - options_.AddEntriesFrom(input, _repeated_options_codec); - break; - } - case 42: { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - input.ReadMessage(SourceContext); - break; - } - case 48: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - case 58: { - Edition = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - fields_.AddEntriesFrom(ref input, _repeated_fields_codec); - break; - } - case 26: { - oneofs_.AddEntriesFrom(ref input, _repeated_oneofs_codec); - break; - } - case 34: { - options_.AddEntriesFrom(ref input, _repeated_options_codec); - break; - } - case 42: { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - input.ReadMessage(SourceContext); - break; - } - case 48: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - case 58: { - Edition = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// A single field of a message type. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Field : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Field()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Field() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Field(Field other) : this() { - kind_ = other.kind_; - cardinality_ = other.cardinality_; - number_ = other.number_; - name_ = other.name_; - typeUrl_ = other.typeUrl_; - oneofIndex_ = other.oneofIndex_; - packed_ = other.packed_; - options_ = other.options_.Clone(); - jsonName_ = other.jsonName_; - defaultValue_ = other.defaultValue_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Field Clone() { - return new Field(this); - } - - /// Field number for the "kind" field. - public const int KindFieldNumber = 1; - private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown; - /// - /// The field type. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind { - get { return kind_; } - set { - kind_ = value; - } - } - - /// Field number for the "cardinality" field. - public const int CardinalityFieldNumber = 2; - private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.Unknown; - /// - /// The field cardinality. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality { - get { return cardinality_; } - set { - cardinality_ = value; - } - } - - /// Field number for the "number" field. - public const int NumberFieldNumber = 3; - private int number_; - /// - /// The field number. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Number { - get { return number_; } - set { - number_ = value; - } - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 4; - private string name_ = ""; - /// - /// The field name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "type_url" field. - public const int TypeUrlFieldNumber = 6; - private string typeUrl_ = ""; - /// - /// The field type URL, without the scheme, for message or enumeration - /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string TypeUrl { - get { return typeUrl_; } - set { - typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "oneof_index" field. - public const int OneofIndexFieldNumber = 7; - private int oneofIndex_; - /// - /// The index of the field type in `Type.oneofs`, for message or enumeration - /// types. The first type has index 1; zero means the type is not in the list. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int OneofIndex { - get { return oneofIndex_; } - set { - oneofIndex_ = value; - } - } - - /// Field number for the "packed" field. - public const int PackedFieldNumber = 8; - private bool packed_; - /// - /// Whether to use alternative packed wire representation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Packed { - get { return packed_; } - set { - packed_ = value; - } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - /// - /// The protocol buffer options. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Options { - get { return options_; } - } - - /// Field number for the "json_name" field. - public const int JsonNameFieldNumber = 10; - private string jsonName_ = ""; - /// - /// The field JSON name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JsonName { - get { return jsonName_; } - set { - jsonName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "default_value" field. - public const int DefaultValueFieldNumber = 11; - private string defaultValue_ = ""; - /// - /// The string value of the default value of this field. Proto2 syntax only. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string DefaultValue { - get { return defaultValue_; } - set { - defaultValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Field); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Field other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Kind != other.Kind) return false; - if (Cardinality != other.Cardinality) return false; - if (Number != other.Number) return false; - if (Name != other.Name) return false; - if (TypeUrl != other.TypeUrl) return false; - if (OneofIndex != other.OneofIndex) return false; - if (Packed != other.Packed) return false; - if(!options_.Equals(other.options_)) return false; - if (JsonName != other.JsonName) return false; - if (DefaultValue != other.DefaultValue) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) hash ^= Kind.GetHashCode(); - if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.Unknown) hash ^= Cardinality.GetHashCode(); - if (Number != 0) hash ^= Number.GetHashCode(); - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode(); - if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode(); - if (Packed != false) hash ^= Packed.GetHashCode(); - hash ^= options_.GetHashCode(); - if (JsonName.Length != 0) hash ^= JsonName.GetHashCode(); - if (DefaultValue.Length != 0) hash ^= DefaultValue.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) { - output.WriteRawTag(8); - output.WriteEnum((int) Kind); - } - if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.Unknown) { - output.WriteRawTag(16); - output.WriteEnum((int) Cardinality); - } - if (Number != 0) { - output.WriteRawTag(24); - output.WriteInt32(Number); - } - if (Name.Length != 0) { - output.WriteRawTag(34); - output.WriteString(Name); - } - if (TypeUrl.Length != 0) { - output.WriteRawTag(50); - output.WriteString(TypeUrl); - } - if (OneofIndex != 0) { - output.WriteRawTag(56); - output.WriteInt32(OneofIndex); - } - if (Packed != false) { - output.WriteRawTag(64); - output.WriteBool(Packed); - } - options_.WriteTo(output, _repeated_options_codec); - if (JsonName.Length != 0) { - output.WriteRawTag(82); - output.WriteString(JsonName); - } - if (DefaultValue.Length != 0) { - output.WriteRawTag(90); - output.WriteString(DefaultValue); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) { - output.WriteRawTag(8); - output.WriteEnum((int) Kind); - } - if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.Unknown) { - output.WriteRawTag(16); - output.WriteEnum((int) Cardinality); - } - if (Number != 0) { - output.WriteRawTag(24); - output.WriteInt32(Number); - } - if (Name.Length != 0) { - output.WriteRawTag(34); - output.WriteString(Name); - } - if (TypeUrl.Length != 0) { - output.WriteRawTag(50); - output.WriteString(TypeUrl); - } - if (OneofIndex != 0) { - output.WriteRawTag(56); - output.WriteInt32(OneofIndex); - } - if (Packed != false) { - output.WriteRawTag(64); - output.WriteBool(Packed); - } - options_.WriteTo(ref output, _repeated_options_codec); - if (JsonName.Length != 0) { - output.WriteRawTag(82); - output.WriteString(JsonName); - } - if (DefaultValue.Length != 0) { - output.WriteRawTag(90); - output.WriteString(DefaultValue); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Kind); - } - if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.Unknown) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Cardinality); - } - if (Number != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number); - } - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (TypeUrl.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl); - } - if (OneofIndex != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(OneofIndex); - } - if (Packed != false) { - size += 1 + 1; - } - size += options_.CalculateSize(_repeated_options_codec); - if (JsonName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName); - } - if (DefaultValue.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(DefaultValue); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Field other) { - if (other == null) { - return; - } - if (other.Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) { - Kind = other.Kind; - } - if (other.Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.Unknown) { - Cardinality = other.Cardinality; - } - if (other.Number != 0) { - Number = other.Number; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.TypeUrl.Length != 0) { - TypeUrl = other.TypeUrl; - } - if (other.OneofIndex != 0) { - OneofIndex = other.OneofIndex; - } - if (other.Packed != false) { - Packed = other.Packed; - } - options_.Add(other.options_); - if (other.JsonName.Length != 0) { - JsonName = other.JsonName; - } - if (other.DefaultValue.Length != 0) { - DefaultValue = other.DefaultValue; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Kind = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum(); - break; - } - case 16: { - Cardinality = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum(); - break; - } - case 24: { - Number = input.ReadInt32(); - break; - } - case 34: { - Name = input.ReadString(); - break; - } - case 50: { - TypeUrl = input.ReadString(); - break; - } - case 56: { - OneofIndex = input.ReadInt32(); - break; - } - case 64: { - Packed = input.ReadBool(); - break; - } - case 74: { - options_.AddEntriesFrom(input, _repeated_options_codec); - break; - } - case 82: { - JsonName = input.ReadString(); - break; - } - case 90: { - DefaultValue = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Kind = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum(); - break; - } - case 16: { - Cardinality = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum(); - break; - } - case 24: { - Number = input.ReadInt32(); - break; - } - case 34: { - Name = input.ReadString(); - break; - } - case 50: { - TypeUrl = input.ReadString(); - break; - } - case 56: { - OneofIndex = input.ReadInt32(); - break; - } - case 64: { - Packed = input.ReadBool(); - break; - } - case 74: { - options_.AddEntriesFrom(ref input, _repeated_options_codec); - break; - } - case 82: { - JsonName = input.ReadString(); - break; - } - case 90: { - DefaultValue = input.ReadString(); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the Field message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// Basic field types. - /// - public enum Kind { - /// - /// Field type unknown. - /// - [pbr::OriginalName("TYPE_UNKNOWN")] TypeUnknown = 0, - /// - /// Field type double. - /// - [pbr::OriginalName("TYPE_DOUBLE")] TypeDouble = 1, - /// - /// Field type float. - /// - [pbr::OriginalName("TYPE_FLOAT")] TypeFloat = 2, - /// - /// Field type int64. - /// - [pbr::OriginalName("TYPE_INT64")] TypeInt64 = 3, - /// - /// Field type uint64. - /// - [pbr::OriginalName("TYPE_UINT64")] TypeUint64 = 4, - /// - /// Field type int32. - /// - [pbr::OriginalName("TYPE_INT32")] TypeInt32 = 5, - /// - /// Field type fixed64. - /// - [pbr::OriginalName("TYPE_FIXED64")] TypeFixed64 = 6, - /// - /// Field type fixed32. - /// - [pbr::OriginalName("TYPE_FIXED32")] TypeFixed32 = 7, - /// - /// Field type bool. - /// - [pbr::OriginalName("TYPE_BOOL")] TypeBool = 8, - /// - /// Field type string. - /// - [pbr::OriginalName("TYPE_STRING")] TypeString = 9, - /// - /// Field type group. Proto2 syntax only, and deprecated. - /// - [pbr::OriginalName("TYPE_GROUP")] TypeGroup = 10, - /// - /// Field type message. - /// - [pbr::OriginalName("TYPE_MESSAGE")] TypeMessage = 11, - /// - /// Field type bytes. - /// - [pbr::OriginalName("TYPE_BYTES")] TypeBytes = 12, - /// - /// Field type uint32. - /// - [pbr::OriginalName("TYPE_UINT32")] TypeUint32 = 13, - /// - /// Field type enum. - /// - [pbr::OriginalName("TYPE_ENUM")] TypeEnum = 14, - /// - /// Field type sfixed32. - /// - [pbr::OriginalName("TYPE_SFIXED32")] TypeSfixed32 = 15, - /// - /// Field type sfixed64. - /// - [pbr::OriginalName("TYPE_SFIXED64")] TypeSfixed64 = 16, - /// - /// Field type sint32. - /// - [pbr::OriginalName("TYPE_SINT32")] TypeSint32 = 17, - /// - /// Field type sint64. - /// - [pbr::OriginalName("TYPE_SINT64")] TypeSint64 = 18, - } - - /// - /// Whether a field is optional, required, or repeated. - /// - public enum Cardinality { - /// - /// For fields with unknown cardinality. - /// - [pbr::OriginalName("CARDINALITY_UNKNOWN")] Unknown = 0, - /// - /// For optional fields. - /// - [pbr::OriginalName("CARDINALITY_OPTIONAL")] Optional = 1, - /// - /// For required fields. Proto2 syntax only. - /// - [pbr::OriginalName("CARDINALITY_REQUIRED")] Required = 2, - /// - /// For repeated fields. - /// - [pbr::OriginalName("CARDINALITY_REPEATED")] Repeated = 3, - } - - } - #endregion - - } - - /// - /// Enum type definition. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Enum : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Enum()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Enum() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Enum(Enum other) : this() { - name_ = other.name_; - enumvalue_ = other.enumvalue_.Clone(); - options_ = other.options_.Clone(); - sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null; - syntax_ = other.syntax_; - edition_ = other.edition_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Enum Clone() { - return new Enum(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// Enum type name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "enumvalue" field. - public const int EnumvalueFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_enumvalue_codec - = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser); - private readonly pbc::RepeatedField enumvalue_ = new pbc::RepeatedField(); - /// - /// Enum value definitions. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Enumvalue { - get { return enumvalue_; } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - /// - /// Protocol buffer options. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Options { - get { return options_; } - } - - /// Field number for the "source_context" field. - public const int SourceContextFieldNumber = 4; - private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; - /// - /// The source context. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { - get { return sourceContext_; } - set { - sourceContext_ = value; - } - } - - /// Field number for the "syntax" field. - public const int SyntaxFieldNumber = 5; - private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.Proto2; - /// - /// The source syntax. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { - get { return syntax_; } - set { - syntax_ = value; - } - } - - /// Field number for the "edition" field. - public const int EditionFieldNumber = 6; - private string edition_ = ""; - /// - /// The source edition string, only valid when syntax is SYNTAX_EDITIONS. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Edition { - get { return edition_; } - set { - edition_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Enum); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Enum other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if(!enumvalue_.Equals(other.enumvalue_)) return false; - if(!options_.Equals(other.options_)) return false; - if (!object.Equals(SourceContext, other.SourceContext)) return false; - if (Syntax != other.Syntax) return false; - if (Edition != other.Edition) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - hash ^= enumvalue_.GetHashCode(); - hash ^= options_.GetHashCode(); - if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) hash ^= Syntax.GetHashCode(); - if (Edition.Length != 0) hash ^= Edition.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - enumvalue_.WriteTo(output, _repeated_enumvalue_codec); - options_.WriteTo(output, _repeated_options_codec); - if (sourceContext_ != null) { - output.WriteRawTag(34); - output.WriteMessage(SourceContext); - } - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(40); - output.WriteEnum((int) Syntax); - } - if (Edition.Length != 0) { - output.WriteRawTag(50); - output.WriteString(Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - enumvalue_.WriteTo(ref output, _repeated_enumvalue_codec); - options_.WriteTo(ref output, _repeated_options_codec); - if (sourceContext_ != null) { - output.WriteRawTag(34); - output.WriteMessage(SourceContext); - } - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - output.WriteRawTag(40); - output.WriteEnum((int) Syntax); - } - if (Edition.Length != 0) { - output.WriteRawTag(50); - output.WriteString(Edition); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - size += enumvalue_.CalculateSize(_repeated_enumvalue_codec); - size += options_.CalculateSize(_repeated_options_codec); - if (sourceContext_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); - } - if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); - } - if (Edition.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Edition); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Enum other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - enumvalue_.Add(other.enumvalue_); - options_.Add(other.options_); - if (other.sourceContext_ != null) { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - SourceContext.MergeFrom(other.SourceContext); - } - if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { - Syntax = other.Syntax; - } - if (other.Edition.Length != 0) { - Edition = other.Edition; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - enumvalue_.AddEntriesFrom(input, _repeated_enumvalue_codec); - break; - } - case 26: { - options_.AddEntriesFrom(input, _repeated_options_codec); - break; - } - case 34: { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - input.ReadMessage(SourceContext); - break; - } - case 40: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - case 50: { - Edition = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - enumvalue_.AddEntriesFrom(ref input, _repeated_enumvalue_codec); - break; - } - case 26: { - options_.AddEntriesFrom(ref input, _repeated_options_codec); - break; - } - case 34: { - if (sourceContext_ == null) { - SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); - } - input.ReadMessage(SourceContext); - break; - } - case 40: { - Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); - break; - } - case 50: { - Edition = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - /// Enum value definition. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class EnumValue : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValue()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValue() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValue(EnumValue other) : this() { - name_ = other.name_; - number_ = other.number_; - options_ = other.options_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public EnumValue Clone() { - return new EnumValue(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// Enum value name. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "number" field. - public const int NumberFieldNumber = 2; - private int number_; - /// - /// Enum value number. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Number { - get { return number_; } - set { - number_ = value; - } - } - - /// Field number for the "options" field. - public const int OptionsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_options_codec - = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); - private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - /// - /// Protocol buffer options. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Options { - get { return options_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as EnumValue); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(EnumValue other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (Number != other.Number) return false; - if(!options_.Equals(other.options_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (Number != 0) hash ^= Number.GetHashCode(); - hash ^= options_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (Number != 0) { - output.WriteRawTag(16); - output.WriteInt32(Number); - } - options_.WriteTo(output, _repeated_options_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (Number != 0) { - output.WriteRawTag(16); - output.WriteInt32(Number); - } - options_.WriteTo(ref output, _repeated_options_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (Number != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number); - } - size += options_.CalculateSize(_repeated_options_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(EnumValue other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.Number != 0) { - Number = other.Number; - } - options_.Add(other.options_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Number = input.ReadInt32(); - break; - } - case 26: { - options_.AddEntriesFrom(input, _repeated_options_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Number = input.ReadInt32(); - break; - } - case 26: { - options_.AddEntriesFrom(ref input, _repeated_options_codec); - break; - } - } - } - } - #endif - - } - - /// - /// A protocol buffer option, which can be attached to a message, field, - /// enumeration, etc. - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Option : pb::IMessage /// The value to write - public void WriteDouble(double value) => WritingPrimitives.WriteDouble(ref buffer, ref state, value); + public void WriteDouble(double value) + { + WritingPrimitives.WriteDouble(ref buffer, ref state, value); + } /// /// Writes a float field value, without a tag. /// /// The value to write - public void WriteFloat(float value) => WritingPrimitives.WriteFloat(ref buffer, ref state, value); + public void WriteFloat(float value) + { + WritingPrimitives.WriteFloat(ref buffer, ref state, value); + } /// /// Writes a uint64 field value, without a tag. /// /// The value to write - public void WriteUInt64(ulong value) => WritingPrimitives.WriteUInt64(ref buffer, ref state, value); + public void WriteUInt64(ulong value) + { + WritingPrimitives.WriteUInt64(ref buffer, ref state, value); + } /// /// Writes an int64 field value, without a tag. /// /// The value to write - public void WriteInt64(long value) => WritingPrimitives.WriteInt64(ref buffer, ref state, value); + public void WriteInt64(long value) + { + WritingPrimitives.WriteInt64(ref buffer, ref state, value); + } /// /// Writes an int32 field value, without a tag. /// /// The value to write - public void WriteInt32(int value) => WritingPrimitives.WriteInt32(ref buffer, ref state, value); + public void WriteInt32(int value) + { + WritingPrimitives.WriteInt32(ref buffer, ref state, value); + } /// /// Writes a fixed64 field value, without a tag. /// /// The value to write - public void WriteFixed64(ulong value) => WritingPrimitives.WriteFixed64(ref buffer, ref state, value); + public void WriteFixed64(ulong value) + { + WritingPrimitives.WriteFixed64(ref buffer, ref state, value); + } /// /// Writes a fixed32 field value, without a tag. /// /// The value to write - public void WriteFixed32(uint value) => WritingPrimitives.WriteFixed32(ref buffer, ref state, value); + public void WriteFixed32(uint value) + { + WritingPrimitives.WriteFixed32(ref buffer, ref state, value); + } /// /// Writes a bool field value, without a tag. /// /// The value to write - public void WriteBool(bool value) => WritingPrimitives.WriteBool(ref buffer, ref state, value); + public void WriteBool(bool value) + { + WritingPrimitives.WriteBool(ref buffer, ref state, value); + } /// /// Writes a string field value, without a tag. /// The data is length-prefixed. /// /// The value to write - public void WriteString(string value) => WritingPrimitives.WriteString(ref buffer, ref state, value); + public void WriteString(string value) + { + WritingPrimitives.WriteString(ref buffer, ref state, value); + } /// /// Writes a message, without a tag. /// The data is length-prefixed. /// /// The value to write - public void WriteMessage(IMessage value) => WritingPrimitivesMessages.WriteMessage(ref this, value); + public void WriteMessage(IMessage value) + { + WritingPrimitivesMessages.WriteMessage(ref this, value); + } /// /// Writes a group, without a tag, to the stream. /// /// The value to write - public void WriteGroup(IMessage value) => WritingPrimitivesMessages.WriteGroup(ref this, value); + public void WriteGroup(IMessage value) + { + WritingPrimitivesMessages.WriteGroup(ref this, value); + } /// /// Write a byte string, without a tag, to the stream. /// The data is length-prefixed. /// /// The value to write - public void WriteBytes(ByteString value) => WritingPrimitives.WriteBytes(ref buffer, ref state, value); + public void WriteBytes(ByteString value) + { + WritingPrimitives.WriteBytes(ref buffer, ref state, value); + } /// /// Writes a uint32 value, without a tag. /// /// The value to write - public void WriteUInt32(uint value) => WritingPrimitives.WriteUInt32(ref buffer, ref state, value); + public void WriteUInt32(uint value) + { + WritingPrimitives.WriteUInt32(ref buffer, ref state, value); + } /// /// Writes an enum value, without a tag. /// /// The value to write - public void WriteEnum(int value) => WritingPrimitives.WriteEnum(ref buffer, ref state, value); + public void WriteEnum(int value) + { + WritingPrimitives.WriteEnum(ref buffer, ref state, value); + } /// /// Writes an sfixed32 value, without a tag. /// /// The value to write. - public void WriteSFixed32(int value) => WritingPrimitives.WriteSFixed32(ref buffer, ref state, value); + public void WriteSFixed32(int value) + { + WritingPrimitives.WriteSFixed32(ref buffer, ref state, value); + } /// /// Writes an sfixed64 value, without a tag. /// /// The value to write - public void WriteSFixed64(long value) => WritingPrimitives.WriteSFixed64(ref buffer, ref state, value); + public void WriteSFixed64(long value) + { + WritingPrimitives.WriteSFixed64(ref buffer, ref state, value); + } /// /// Writes an sint32 value, without a tag. /// /// The value to write - public void WriteSInt32(int value) => WritingPrimitives.WriteSInt32(ref buffer, ref state, value); + public void WriteSInt32(int value) + { + WritingPrimitives.WriteSInt32(ref buffer, ref state, value); + } /// /// Writes an sint64 value, without a tag. /// /// The value to write - public void WriteSInt64(long value) => WritingPrimitives.WriteSInt64(ref buffer, ref state, value); + public void WriteSInt64(long value) + { + WritingPrimitives.WriteSInt64(ref buffer, ref state, value); + } /// /// Writes a length (in bytes) for length-delimited data. @@ -186,33 +269,48 @@ namespace Google.Protobuf /// This method simply writes a rawint, but exists for clarity in calling code. /// /// Length value, in bytes. - public void WriteLength(int length) => WritingPrimitives.WriteLength(ref buffer, ref state, length); + public void WriteLength(int length) + { + WritingPrimitives.WriteLength(ref buffer, ref state, length); + } /// /// Encodes and writes a tag. /// /// The number of the field to write the tag for /// The wire format type of the tag to write - public void WriteTag(int fieldNumber, WireFormat.WireType type) => WritingPrimitives.WriteTag(ref buffer, ref state, fieldNumber, type); + public void WriteTag(int fieldNumber, WireFormat.WireType type) + { + WritingPrimitives.WriteTag(ref buffer, ref state, fieldNumber, type); + } /// /// Writes an already-encoded tag. /// /// The encoded tag - public void WriteTag(uint tag) => WritingPrimitives.WriteTag(ref buffer, ref state, tag); + public void WriteTag(uint tag) + { + WritingPrimitives.WriteTag(ref buffer, ref state, tag); + } /// /// Writes the given single-byte tag. /// /// The encoded tag - public void WriteRawTag(byte b1) => WritingPrimitives.WriteRawTag(ref buffer, ref state, b1); + public void WriteRawTag(byte b1) + { + WritingPrimitives.WriteRawTag(ref buffer, ref state, b1); + } /// /// Writes the given two-byte tag. /// /// The first byte of the encoded tag /// The second byte of the encoded tag - public void WriteRawTag(byte b1, byte b2) => WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2); + public void WriteRawTag(byte b1, byte b2) + { + WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2); + } /// /// Writes the given three-byte tag. @@ -220,7 +318,10 @@ namespace Google.Protobuf /// The first byte of the encoded tag /// The second byte of the encoded tag /// The third byte of the encoded tag - public void WriteRawTag(byte b1, byte b2, byte b3) => WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2, b3); + public void WriteRawTag(byte b1, byte b2, byte b3) + { + WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2, b3); + } /// /// Writes the given four-byte tag. @@ -229,7 +330,10 @@ namespace Google.Protobuf /// The second byte of the encoded tag /// The third byte of the encoded tag /// The fourth byte of the encoded tag - public void WriteRawTag(byte b1, byte b2, byte b3, byte b4) => WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2, b3, b4); + public void WriteRawTag(byte b1, byte b2, byte b3, byte b4) + { + WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2, b3, b4); + } /// /// Writes the given five-byte tag. @@ -239,11 +343,20 @@ namespace Google.Protobuf /// The third byte of the encoded tag /// The fourth byte of the encoded tag /// The fifth byte of the encoded tag - public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5) => WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2, b3, b4, b5); + public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5) + { + WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2, b3, b4, b5); + } - internal void Flush() => WriteBufferHelper.Flush(ref buffer, ref state); + internal void Flush() + { + WriteBufferHelper.Flush(ref buffer, ref state); + } - internal void CheckNoSpaceLeft() => WriteBufferHelper.CheckNoSpaceLeft(ref state); + internal void CheckNoSpaceLeft() + { + WriteBufferHelper.CheckNoSpaceLeft(ref state); + } internal void CopyStateTo(CodedOutputStream output) { diff --git a/csharp/src/Google.Protobuf/WriterInternalState.cs b/csharp/src/Google.Protobuf/WriterInternalState.cs index 37d497303920060bc505590a89739ce2eb766608..a779305bb7301bfcfd7ab7448cb10f3e942c2678 100644 --- a/csharp/src/Google.Protobuf/WriterInternalState.cs +++ b/csharp/src/Google.Protobuf/WriterInternalState.cs @@ -1,14 +1,49 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using Google.Protobuf.Collections; + namespace Google.Protobuf { + // warning: this is a mutable struct, so it needs to be only passed as a ref! internal struct WriterInternalState { diff --git a/csharp/src/Google.Protobuf/WritingPrimitives.cs b/csharp/src/Google.Protobuf/WritingPrimitives.cs index 7e77321404aa0de92c44fbd6930a55de12bc809b..846df7350260fee2c0d8525bc4cec754829d30c4 100644 --- a/csharp/src/Google.Protobuf/WritingPrimitives.cs +++ b/csharp/src/Google.Protobuf/WritingPrimitives.cs @@ -1,21 +1,39 @@ -#region Copyright notice and license +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Buffers.Binary; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -#if GOOGLE_PROTOBUF_SIMD -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.Arm; -using System.Runtime.Intrinsics.X86; -#endif using System.Security; using System.Text; @@ -27,13 +45,8 @@ namespace Google.Protobuf [SecuritySafeCritical] internal static class WritingPrimitives { -#if NET5_0_OR_GREATER - internal static Encoding Utf8Encoding => Encoding.UTF8; // allows JIT to devirtualize -#else - internal static readonly Encoding Utf8Encoding = - Encoding.UTF8; // "Local" copy of Encoding.UTF8, for efficiency. (Yes, it makes a - // difference.) -#endif + // "Local" copy of Encoding.UTF8, for efficiency. (Yes, it makes a difference.) + internal static readonly Encoding Utf8Encoding = Encoding.UTF8; #region Writing of values (not including tags) @@ -74,7 +87,7 @@ namespace Google.Protobuf { const int length = sizeof(float); - // TODO: deduplicate the code. Populating the span is the same as for the fastpath. + // TODO(jtattermusch): deduplicate the code. Populating the span is the same as for the fastpath. Span floatSpan = stackalloc byte[length]; Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(floatSpan), value); if (!BitConverter.IsLittleEndian) @@ -150,34 +163,39 @@ namespace Google.Protobuf /// public static void WriteString(ref Span buffer, ref WriterInternalState state, string value) { - const int MaxBytesPerChar = 3; - const int MaxSmallStringLength = 128 / MaxBytesPerChar; - - // The string is small enough that the length will always be a 1 byte varint. - // Also there is enough space to write length + bytes to buffer. - // Write string directly to the buffer, and then write length. - // This saves calling GetByteCount on the string. We get the string length from GetBytes. - if (value.Length <= MaxSmallStringLength && buffer.Length - state.position - 1 >= value.Length * MaxBytesPerChar) - { - int indexOfLengthDelimiter = state.position++; - buffer[indexOfLengthDelimiter] = (byte)WriteStringToBuffer(buffer, ref state, value); - return; - } - - int length = Utf8Encoding.GetByteCount(value); - WriteLength(ref buffer, ref state, length); - // Optimise the case where we have enough space to write // the string directly to the buffer, which should be common. + int length = Utf8Encoding.GetByteCount(value); + WriteLength(ref buffer, ref state, length); if (buffer.Length - state.position >= length) { if (length == value.Length) // Must be all ASCII... { - WriteAsciiStringToBuffer(buffer, ref state, value, length); + for (int i = 0; i < length; i++) + { + buffer[state.position + i] = (byte)value[i]; + } + state.position += length; } else { - WriteStringToBuffer(buffer, ref state, value); +#if NETSTANDARD1_1 + // slowpath when Encoding.GetBytes(Char*, Int32, Byte*, Int32) is not available + byte[] bytes = Utf8Encoding.GetBytes(value); + WriteRawBytes(ref buffer, ref state, bytes); +#else + ReadOnlySpan source = value.AsSpan(); + int bytesUsed; + unsafe + { + fixed (char* sourceChars = &MemoryMarshal.GetReference(source)) + fixed (byte* destinationBytes = &MemoryMarshal.GetReference(buffer.Slice(state.position))) + { + bytesUsed = Utf8Encoding.GetBytes(sourceChars, source.Length, destinationBytes, buffer.Length); + } + } + state.position += bytesUsed; +#endif } } else @@ -191,131 +209,6 @@ namespace Google.Protobuf } } - // Calling this method with non-ASCII content will break. - // Content must be verified to be all ASCII before using this method. - private static void WriteAsciiStringToBuffer(Span buffer, ref WriterInternalState state, string value, int length) - { - ref char sourceChars = ref MemoryMarshal.GetReference(value.AsSpan()); - ref byte destinationBytes = ref MemoryMarshal.GetReference(buffer.Slice(state.position)); - - int currentIndex = 0; - // If 64bit, process 4 chars at a time. - // The logic inside this check will be elided by JIT in 32bit programs. - if (IntPtr.Size == 8) - { - // Need at least 4 chars available to use this optimization. - if (length >= 4) - { - ref byte sourceBytes = ref Unsafe.As(ref sourceChars); - - // Process 4 chars at a time until there are less than 4 remaining. - // We already know all characters are ASCII so there is no need to validate the source. - int lastIndexWhereCanReadFourChars = value.Length - 4; - do - { - NarrowFourUtf16CharsToAsciiAndWriteToBuffer( - ref Unsafe.AddByteOffset(ref destinationBytes, (IntPtr)currentIndex), - Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref sourceBytes, (IntPtr)(currentIndex * 2)))); - - } while ((currentIndex += 4) <= lastIndexWhereCanReadFourChars); - } - } - - // Process any remaining, 1 char at a time. - // Avoid bounds checking with ref + Unsafe - for (; currentIndex < length; currentIndex++) - { - Unsafe.AddByteOffset(ref destinationBytes, (IntPtr)currentIndex) = (byte)Unsafe.AddByteOffset(ref sourceChars, (IntPtr)(currentIndex * 2)); - } - - state.position += length; - } - - // Copied with permission from https://github.com/dotnet/runtime/blob/1cdafd27e4afd2c916af5df949c13f8b373c4335/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIUtility.cs#L1119-L1171 - // - /// - /// Given a QWORD which represents a buffer of 4 ASCII chars in machine-endian order, - /// narrows each WORD to a BYTE, then writes the 4-byte result to the output buffer - /// also in machine-endian order. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void NarrowFourUtf16CharsToAsciiAndWriteToBuffer(ref byte outputBuffer, ulong value) - { -#if GOOGLE_PROTOBUF_SIMD - if (Sse2.X64.IsSupported) - { - // Narrows a vector of words [ w0 w1 w2 w3 ] to a vector of bytes - // [ b0 b1 b2 b3 b0 b1 b2 b3 ], then writes 4 bytes (32 bits) to the destination. - - Vector128 vecWide = Sse2.X64.ConvertScalarToVector128UInt64(value).AsInt16(); - Vector128 vecNarrow = Sse2.PackUnsignedSaturate(vecWide, vecWide).AsUInt32(); - Unsafe.WriteUnaligned(ref outputBuffer, Sse2.ConvertToUInt32(vecNarrow)); - } - else if (AdvSimd.IsSupported) - { - // Narrows a vector of words [ w0 w1 w2 w3 ] to a vector of bytes - // [ b0 b1 b2 b3 * * * * ], then writes 4 bytes (32 bits) to the destination. - - Vector128 vecWide = Vector128.CreateScalarUnsafe(value).AsInt16(); - Vector64 lower = AdvSimd.ExtractNarrowingSaturateUnsignedLower(vecWide); - Unsafe.WriteUnaligned(ref outputBuffer, lower.AsUInt32().ToScalar()); - } - else -#endif - { - // Fallback to non-SIMD approach when SIMD is not available. - // This could happen either because the APIs are not available, or hardware doesn't support it. - // Processing 4 chars at a time in this fallback is still faster than casting one char at a time. - if (BitConverter.IsLittleEndian) - { - outputBuffer = (byte)value; - value >>= 16; - Unsafe.Add(ref outputBuffer, 1) = (byte)value; - value >>= 16; - Unsafe.Add(ref outputBuffer, 2) = (byte)value; - value >>= 16; - Unsafe.Add(ref outputBuffer, 3) = (byte)value; - } - else - { - Unsafe.Add(ref outputBuffer, 3) = (byte)value; - value >>= 16; - Unsafe.Add(ref outputBuffer, 2) = (byte)value; - value >>= 16; - Unsafe.Add(ref outputBuffer, 1) = (byte)value; - value >>= 16; - outputBuffer = (byte)value; - } - } - } - - private static int WriteStringToBuffer(Span buffer, ref WriterInternalState state, string value) - { -#if NETSTANDARD1_1 - // slowpath when Encoding.GetBytes(Char*, Int32, Byte*, Int32) is not available - byte[] bytes = Utf8Encoding.GetBytes(value); - WriteRawBytes(ref buffer, ref state, bytes); - return bytes.Length; -#else - ReadOnlySpan source = value.AsSpan(); - int bytesUsed; - unsafe - { - fixed (char* sourceChars = &MemoryMarshal.GetReference(source)) - fixed (byte* destinationBytes = &MemoryMarshal.GetReference(buffer)) - { - bytesUsed = Utf8Encoding.GetBytes( - sourceChars, - source.Length, - destinationBytes + state.position, - buffer.Length - state.position); - } - } - state.position += bytesUsed; - return bytesUsed; -#endif - } - /// /// Write a byte string, without a tag, to the stream. /// The data is length-prefixed. @@ -732,4 +625,4 @@ namespace Google.Protobuf return (ulong)((n << 1) ^ (n >> 63)); } } -} +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs b/csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs index be0c64932d4b073574318dc2ed4ae7b4afaa2440..cd2d4379154e154971c78da5bbfc41b22dff7bd7 100644 --- a/csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs +++ b/csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs @@ -1,13 +1,38 @@ #region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices.ComTypes; using System.Security; namespace Google.Protobuf diff --git a/depcomp b/depcomp new file mode 100644 index 0000000000000000000000000000000000000000..6b391623c4bf023255fdbc8eceb7acf110e5fa79 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/docs/csharp/proto2.md b/docs/csharp/proto2.md deleted file mode 100644 index 0d9159de73d2fab1753adc9a38c9b0c9c8802f90..0000000000000000000000000000000000000000 --- a/docs/csharp/proto2.md +++ /dev/null @@ -1,184 +0,0 @@ -As part of the 3.10 release of Google.Protobuf, experimental proto2 support has been released. This document outlines the new changes brought about to include proto2 support. This does not break existing proto3 support and users may continue to use proto3 features without changing their current code. Again the generated code and public API associated with proto2 is experimental and subject to change in the future. APIs for proto2 may be added, removed, or adjusted as feedback is received. -Generated code for proto2 may also be modified by adding, removing, or adjusting APIs as feedback is received. - -### Enabling proto2 features - -For information about specific proto2 features, please read the [proto2 language guide](https://developers.google.com/protocol-buffers/docs/proto). - -Much like other languages, proto2 features are used with proto2 files with the syntax declaration `syntax = "proto2";`. However, please note, proto3 is still the recommended version of protobuf and proto2 support is meant for legacy system interop and advanced uses. - -# Generated code - -### Messages - -Messages in proto2 files are very similar to their proto3 counterparts. They expose the usual property for getting and setting, but they also include properties and methods to handle field presence. - -For `optional`/`required` field XYZ, a `HasXYZ` property is included for checking presence and a `ClearXYZ` method is included for clearing the value. - -```proto -message Foo { - optional Bar bar = 1; - required Baz baz = 2; -} -``` -```cs -var foo = new Foo(); -Assert.IsNull(foo.Bar); -Assert.False(foo.HasBar); -foo.Bar = new Bar(); -Assert.True(foo.HasBar); -foo.ClearBar(); -``` - -### Messages with extension ranges - -Messages which define extension ranges implement the `IExtendableMessage` interface as shown below. -See inline comments for more info. - -```cs -public interface IExtendableMessage : IMessage where T : IExtendableMessage -{ - // Gets the value of a single value extension. If the extension isn't present, this returns the default value. - TValue GetExtension(Extension extension); - // Gets the value of a repeated extension. If the extension hasn't been set, this returns null to prevent unnecessary allocations. - RepeatedField GetExtension(RepeatedExtension extension); - // Gets the value of a repeated extension. This will initialize the value of the repeated field and will never return null. - RepeatedField GetOrInitializeExtension(RepeatedExtension extension); - // Sets the value of the extension - void SetExtension(Extension extension, TValue value); - // Returns whether the extension is present in the message - bool HasExtension(Extension extension); - // Clears the value of the extension, removing it from the message - void ClearExtension(Extension extension); - // Clears the value of the repeated extension, removing it from the message. Calling GetExtension after this will always return null. - void ClearExtension(RepeatedExtension extension); -} -``` - -### Extensions - -Extensions are generated in static containers like reflection classes and type classes. -For example for a file called `foo.proto` containing extensions in the file scope, a -`FooExtensions` class is created containing the extensions defined in the file scope. -For easy access, this class can be used with `using static` to bring all extensions into scope. - -```proto -option csharp_namespace = "FooBar"; -extend Foo { - optional Baz foo_ext = 124; -} -message Baz { - extend Foo { - repeated Baz repeated_foo_ext = 125; - } -} -``` -```cs -public static partial class FooExtensions { - public static readonly Extension FooExt = /* initialization */; -} - -public partial class Baz { - public partial static class Extensions { - public static readonly RepeatedExtension RepeatedFooExt = /* initialization */; - } -} -``` -```cs -using static FooBar.FooExtensions; -using static FooBar.Baz.Extensions; - -var foo = new Foo(); -foo.SetExtension(FooExt, new Baz()); -foo.GetOrInitializeExtension(RepeatedFooExt).Add(new Baz()); -``` - -# APIs - -### Message initialization - -Initialization refers to checking the status of required fields in a proto2 message. If a message is uninitialized, not all required fields are set in either the message itself or any of its submessages. In other languages, missing required fields throw errors depending on the merge method used. This could cause unforseen errors at runtime if the incorrect method is used. -However, in this implementation, parsers and input streams don't check messages for initialization on their own and throw errors. Instead it's up to you to handle messages with missing required fields in whatever way you see fit. -Checking message initialization can be done manually via the `IsInitialized` extension method in `MessageExtensions`. - -### Extension registries - -Just like in Java, extension registries can be constructed to parse extensions when reading new messages -from input streams. The API is fairly similar to the Java API with some added bonuses with C# syntax sugars. - -```proto -message Baz { - extend Foo { - optional Baz foo_ext = 124; - } -} -``` -```cs -var registry = new ExtensionRegistry() -{ - Baz.Extensions.FooExt -}; -var foo = Foo.Factory.WithExtensionRegistry(registry).ParseFrom(input); -Assert.True(foo.HasExtension(Bas.Extensions.FooExt)); -var fooNoRegistry = Foo.Factory.ParseFrom(input); -Assert.False(foo.HasExtension(Bas.Extensions.FooExt)); -``` - -### Custom options - -Due to their limited use and lack of type safety, the original `CustomOptions` APIs are now deprecated. Using the new generated extension identifiers, you can access extensions safely through the GetOption APIs. Note that cloneable values such as -repeated fields and messages will be deep cloned. - -Example based on custom options usage example [here](https://github.com/protocolbuffers/protobuf/issues/5007#issuecomment-411604515). -```cs -foreach (var service in input.Services) -{ - Console.WriteLine($" {service.Name}"); - foreach (var method in service.Methods) - { - var rule = method.GetOption(AnnotationsExtensions.Http); - if (rule != null) - { - Console.WriteLine($" {method.Name}: {rule}"); - } - else - { - Console.WriteLine($" {method.Name}: no HTTP binding"); - } - } -} -``` - -### Reflection - -Reflection APIs have been extended to enable accessing the new proto2 portions of the library and generated code. - - * FieldDescriptor.Extension - * Gets the extension identifier behind an extension field, allowing it to be added to an ExtensionRegistry - * FieldDescriptor.IsExtension - * Returns whether a field is an extension of another type. - * FieldDescriptor.ExtendeeType - * Returns the extended type of an extension field - * IFieldAccessor.HasValue - * Returns whether a field's value is set. For proto3 fields, throws an InvalidOperationException. - * FileDescriptor.Syntax - * Gets the syntax of a file - * FileDescriptor.Extensions - * An immutable list of extensions defined in the file - * MessageDescriptor.Extensions - * An immutable list of extensions defined in the message - -```cs -var extensions = Baz.Descriptor.Extensions.GetExtensionsInDeclarationOrder(Foo.Descriptor); -var registry = new ExtensionRegistry(); -registry.AddRange(extensions.Select(f => f.Extension)); - -var baz = Foo.Descriptor.Parser.WithExtensionRegistry(registry).ParseFrom(input); -foreach (var field in extensions) -{ - if (field.Accessor.HasValue(baz)) - { - Console.WriteLine($"{field.Name}: {field.Accessor.GetValue(baz)}"); - } -} -``` diff --git a/docs/field_presence.md b/docs/field_presence.md deleted file mode 100644 index 4ce778552b0e05380b3b5fbef72a6e78c20f23ad..0000000000000000000000000000000000000000 --- a/docs/field_presence.md +++ /dev/null @@ -1,476 +0,0 @@ -# Application note: Field presence - -This application note explains the various presence tracking disciplines for protobuf fields. It also explains how to enable experimental support for explicit presence tracking for singular proto3 fields with basic types. - -## Background - -_Field presence_ is the notion of whether a protobuf field has a value. There are two different manifestations of presence for protobufs: _no presence_, where the generated message API stores field values (only), and _explicit presence_, where the API also stores whether or not a field has been set. - -Historically, proto2 has mostly followed _explicit presence_, while proto3 exposes only _no presence_ semantics. Singular proto3 fields of basic types (numeric, string, bytes, and enums) which are defined with the `optional` label have _explicit presence_, like proto2 (this is an experimental feature added as of release 3.12, and must be enabled by passing a flag to `protoc`). - -### Presence disciplines - -_Presence disciplines_ define the semantics for translating between the _API representation_ and the _serialized representation_. The _no presence_ discipline relies upon the field value itself to make decisions at (de)serialization time, while the _explicit presence_ discipline relies upon the explicit tracking state instead. - -### Presence in _tag-value stream_ (wire format) serialization - -The wire format is a stream of tagged, _self-delimiting_ values. By definition, the wire format represents a sequence of _present_ values. In other words, every value found within a serialization represents a _present_ field; furthermore, the serialization contains no information about not-present values. - -The generated API for a proto message includes (de)serialization definitions which translate between API types and a stream of definitionally _present_ (tag, value) pairs. This translation is designed to be forward- and backward-compatibile across changes to the message definition; however, this compatibility introduces some (perhaps surprising) considerations when deserializing wire-formatted messages: - -- When serializing, fields with _no presence_ are not serialized if they contain their default value. - - For numeric types, the default is 0. - - For enums, the default is the zero-valued enumerator. - - For strings, bytes, and repeated fields, the default is the zero-length value. - - For messages, the default is the language-specific null value. -- "Empty" length-delimited values (such as empty strings) can be validly represented in serialized values: the field is "present," in the sense that it appears in the wire format. However, if the generated API does not track presence, then these values may not be re-serialized; i.e., the empty field may be "not present" after a serialization round-trip. -- When deserializing, duplicate field values may be handled in different ways depending on the field definition. - - Duplicate `repeated` fields are typically appended to the field's API representation. (Note that serializing a _packed_ repeated field produces only one, length-delimited value in the tag stream.) - - Duplicate `optional` field values follow the rule that "the last one wins." -- `oneof` fields expose the API-level invariant that only one field is set at a time. However, the wire format may include multiple (tag, value) pairs which notionally belong to the `oneof`. Similar to `optional` fields, the generated API follows the "last one wins" rule. -- Out-of-range values are not returned for enum fields in generated proto2 APIs. However, out-of-range values may be stored as _unknown fields_ in the API, even though the wire-format tag was recognized. - -### Presence in _named-field mapping_ formats - -Protobufs can be represented in human-readable, textual forms. Two notable formats are TextFormat (the output format produced by generated message `DebugString` methods) and JSON. - -These formats have correctness requirements of their own, and are generally stricter than _tagged-value stream_ formats. However, TextFormat more closely mimics the semantics of the wire format, and does, in certain cases, provide similar semantics (for example, appending repeated name-value mappings to a repeated field). In particular, similar to the wire format, TextFormat only includes fields which are present. - -JSON is a much stricter format, however, and cannot validly represent some semantics of the wire format or TextFormat. - -- Notably, JSON _elements_ are semantically unordered, and each member must have a unique name. This is different from TextFormat rules for repeated fields. -- JSON may include fields that are "not present," unlike the _no presence_ discipline for other formats: - - JSON defines a `null` value, which may be used to represent a _defined but not-present field_. - - Repeated field values may be included in the formatted output, even if they are equal to the default (an empty list). -- Because JSON elements are unordered, there is no way to unambiguously interpret the "last one wins" rule. - - In most cases, this is fine: JSON elements must have unique names: repeated field values are not valid JSON, so they do not need to be resolved as they are for TextFormat. - - However, this means that it may not be possible to interpret `oneof` fields unambiguously: if multiple cases are present, they are unordered. - -In theory, JSON _can_ represent presence in a semantic-preserving fashion. In practice, however, presence correctness can vary depending upon implementation choices, especially if JSON was chosen as a means to interoperate with clients not using protobufs. - -### Presence in proto2 APIs - -This table outlines whether presence is tracked for fields in proto2 APIs (both for generated APIs and using dynamic reflection): - -Field type | Explicit Presence --------------------------------------------- | ----------------- -Singular numeric (integer or floating point) | ✔️ -Singular enum | ✔️ -Singular string or bytes | ✔️ -Singular message | ✔️ -Repeated | -Oneofs | ✔️ -Maps | - -Singular fields (of all types) track presence explicitly in the generated API. The generated message interface includes methods to query presence of fields. For example, the field `foo` has a corresponding `has_foo` method. (The specific name follows the same language-specific naming convention as the field accessors.) These methods are sometimes referred to as "hazzers" within the protobuf implementation. - -Similar to singular fields, `oneof` fields explicitly track which one of the members, if any, contains a value. For example, consider this example `oneof`: - -``` -oneof foo { - int32 a = 1; - float b = 2; -} -``` - -Depending on the target language, the generated API would generally include several methods: - -- A hazzer for the oneof: `has_foo` -- A _oneof case_ method: `foo` -- Hazzers for the members: `has_a`, `has_b` -- Getters for the members: `a`, `b` - -Repeated fields and maps do not track presence: there is no distinction between an _empty_ and a _not-present_ repeated field. - -### Presence in proto3 APIs - -This table outlines whether presence is tracked for fields in proto3 APIs (both for generated APIs and using dynamic reflection): - -Field type | `optional` | Explicit Presence --------------------------------------------- | ---------- | ----------------- -Singular numeric (integer or floating point) | No | -Singular enum | No | -Singular string or bytes | No | -Singular numeric (integer or floating point) | Yes | ✔️ -Singular enum | Yes | ✔️ -Singular string or bytes | Yes | ✔️ -Singular message | Yes | ✔️ -Singular message | No | ✔️ -Repeated | N/A | -Oneofs | N/A | ✔️ -Maps | N/A | - -Similar to proto2 APIs, proto3 does not track presence explicitly for repeated fields. Without the `optional` label, proto3 APIs do not track presence for basic types (numeric, string, bytes, and enums), either. (Note that `optional` for proto3 fields is only experimentally available as of release 3.12.) Oneof fields affirmatively expose presence, although the same set of hazzer methods may not generated as in proto2 APIs. - -Under the _no presence_ discipline, the default value is synonymous with "not present" for purposes of serialization. To notionally "clear" a field (so it won't be serialized), an API user would set it to the default value. - -The default value for enum-typed fields under _no presence_ is the corresponding 0-valued enumerator. Under proto3 syntax rules, all enum types are required to have an enumerator value which maps to 0. By convention, this is an `UNKNOWN` or similarly-named enumerator. If the zero value is notionally outside the domain of valid values for the application, this behavior can be thought of as tantamount to _explicit presence_. - -## Semantic differences - -The _no presence_ serialization discipline results in visible differences from the _explicit presence_ tracking discipline, when the default value is set. For a singular field with numeric, enum, or string type: - -- _No presence_ discipline: - - Default values are not serialized. - - Default values are _not_ merged-from. - - To "clear" a field, it is set to its default value. - - The default value may mean: - - the field was explicitly set to its default value, which is valid in the application-specific domain of values; - - the field was notionally "cleared" by setting its default; or - - the field was never set. -- _Explicit presence_ discipline: - - Explicitly set values are always serialized, including default values. - - Un-set fields are never merged-from. - - Explicitly set fields -- including default values -- _are_ merged-from. - - A generated `has_foo` method indicates whether or not the field `foo` has been set (and not cleared). - - A generated `clear_foo` method must be used to clear (i.e., un-set) the value. - -### Considerations for merging - -Under the _no presence_ rules, it is effectively impossible for a target field to merge-from its default value (using the protobuf's API merging functions). This is because default values are skipped, simliar to the _no presence_ serialization discipline. Merging only updates the target (merged-to) message using the non-skipped values from the update (merged-from) message. - -The difference in merging behavior has further implications for protocols which rely on partial "patch" updates. If field presence is not tracked, then an update patch alone cannot represent an update to the default value, because only non-default values are merged-from. - -Updating to set a default value in this case requires some external mechanism, such as `FieldMask`. However, if presence _is_ tracked, then all explicitly-set values -- even default values -- will be merged into the target. - -### Considerations for change-compatibility - -Changing a field between _explicit presence_ and _no presence_ is a binary-compatible change for serialized values in wire format. However, the serialized representation of the message may differ, depending on which version of the message definition was used for serialization. Specifically, when a "sender" explicitly sets a field to its default value: - -- The serialized value following _no presence_ discipline does not contain the default value, even though it was explicitly set. -- The serialized value following _explicit presence_ discipline contains every "present" field, even if it contains the default value. - -This change may or may not be safe, depending on the application's semantics. For example, consider two clients with different versions of a message definition. - -Client A uses this definition of the message, which follows the _explicit presence_ serialization discipline for field `foo`: - -``` -syntax = "proto3"; -message Msg { - optional int32 foo = 1; -} -``` - -Client B uses a definition of the same message, except that it follows the _no presence_ discipline: - -``` -syntax = "proto3"; -message Msg { - int32 foo = 1; -} -``` - -Now, consider a scenario where client A observes `foo`'s presence as the clients repeatedly exchange the "same" message by deserializing and reserializing: - -``` -// Client A: -Msg m_a; -m_a.set_foo(1); // non-default value -assert(m_a.has_foo()); // OK -Send(m_a.SerializeAsString()); // to client B - -// Client B: -Msg m_b; -m_b.ParseFromString(Receive()); // from client A -assert(m_b.foo() == 1); // OK -Send(m_b.SerializeAsString()); // to client A - -// Client A: -m_a.ParseFromString(Receive()); // from client B -assert(m_a.foo() == 1); // OK -assert(m_a.has_foo()); // OK -m_a.set_foo(0); // default value -Send(m_a.SerializeAsString()); // to client B - -// Client B: -Msg m_b; -m_b.ParseFromString(Receive()); // from client A -assert(m_b.foo() == 0); // OK -Send(m_b.SerializeAsString()); // to client A - -// Client A: -m_a.ParseFromString(Receive()); // from client B -assert(m_a.foo() == 0); // OK -assert(m_a.has_foo()); // FAIL -``` - -If client A depends on _explicit presence_ for `foo`, then a "round trip" through client B will be lossy from the perspective of client A. In the example, this is not a safe change: client A requires (by `assert`) that the field is present; even without any modifications through the API, that requirement fails in a value- and peer-dependent case. - -## How to enable _explicit presence_ in proto3 - -These are the general steps to use the experimental field tracking support for proto3: - -1. Add an `optional` field to a `.proto` file. -1. Run `protoc` (from release 3.12 or later) with an extra flag to recognize `optional` (i.e,. explicit presence) in proto3 files. -1. Use the generated "hazzer" methods and "clear" methods in application code, instead of comparing or setting default values. - -### `.proto` file changes - -This is an example of a proto3 message with fields which follow both _no presence_ and _explicit presence_ semantics: - -``` -syntax = "proto3"; -package example; - -message MyMessage { - // No presence: - int32 not_tracked = 1; - - // Explicit presence: - optional int32 tracked = 2; -} -``` - -### `protoc` invocation - -To enable presence tracking for proto3 messages, pass the `--experimental_allow_proto3_optional` flag to protoc. Without this flag, the `optional` label is an error in files using proto3 syntax. This flag is available in protobuf release 3.12 or later (or at HEAD, if you are reading this application note from Git). - -### Using the generated code - -The generated code for proto3 fields with _explicit presence_ (the `optional` label) will be the same as it would be in a proto2 file. - -This is the definition used in the "no presence" examples below: - -``` -syntax = "proto3"; -package example; -message Msg { - int32 foo = 1; -} -``` - -This is the definition used in the "explicit presence" examples below: - -``` -syntax = "proto3"; -package example; -message Msg { - optional int32 foo = 1; -} -``` - -In the examples, a function `GetProto` constructs and returns a message of type `Msg` with unspecified contents. - -#### C++ example - -No presence: - -``` -Msg m = GetProto(); -if (m.foo() != 0) { - // "Clear" the field: - m.set_foo(0); -} else { - // Default value: field may not have been present. - m.set_foo(1); -} -``` - -Explicit presence: - -``` -Msg m = GetProto(); -if (m.has_foo()) { - // Clear the field: - m.clear_foo(); -} else { - // Field is not present, so set it. - m.set_foo(1); -} -``` - -#### C# example - -No presence: - -``` -var m = GetProto(); -if (m.Foo != 0) { - // "Clear" the field: - m.Foo = 0; -} else { - // Default value: field may not have been present. - m.Foo = 1; -} -``` - -Explicit presence: - -``` -var m = GetProto(); -if (m.HasFoo) { - // Clear the field: - m.ClearFoo(); -} else { - // Field is not present, so set it. - m.Foo = 1; -} -``` - -#### Go example - -No presence: - -``` -m := GetProto() -if (m.GetFoo() != 0) { - // "Clear" the field: - m.Foo = 0; -} else { - // Default value: field may not have been present. - m.Foo = 1; -} -``` - -Explicit presence: - -``` -m := GetProto() -if (m.HasFoo()) { - // Clear the field: - m.Foo = nil -} else { - // Field is not present, so set it. - m.Foo = proto.Int32(1); -} -``` - -#### Java example - -These examples use a `Builder` to demonstrate clearing. Simply checking presence and getting values from a `Builder` follows the same API as the message type. - -No presence: - -``` -Msg.Builder m = GetProto().toBuilder(); -if (m.getFoo() != 0) { - // "Clear" the field: - m.setFoo(0); -} else { - // Default value: field may not have been present. - m.setFoo(1); -} -``` - -Explicit presence: - -``` -Msg.Builder m = GetProto().toBuilder(); -if (m.hasFoo()) { - // Clear the field: - m.clearFoo() -} else { - // Field is not present, so set it. - m.setFoo(1); -} -``` - -#### Python example - -No presence: - -``` -m = example.Msg() -if m.foo != 0: - // "Clear" the field: - m.foo = 0 -else: - // Default value: field may not have been present. - m.foo = 1 -``` - -Explicit presence: - -``` -m = example.Msg() -if m.HasField('foo'): - // Clear the field: - m.ClearField('foo') -else: - // Field is not present, so set it. - m.foo = 1 -``` - -#### Ruby example - -No presence: - -``` -m = Msg.new -if m.foo != 0 - // "Clear" the field: - m.foo = 0 -else - // Default value: field may not have been present. - m.foo = 1 -end -``` - -Explicit presence: - -``` -m = Msg.new -if m.has_foo? - // Clear the field: - m.clear_foo -else - // Field is not present, so set it. - m.foo = 1 -end -``` - -#### Javascript example - -No presence: - -``` -var m = new Msg(); -if (m.getFoo() != 0) { - // "Clear" the field: - m.setFoo(0); -} else { - // Default value: field may not have been present. - m.setFoo(1); -} -``` - -Explicit presence: - -``` -var m = new Msg(); -if (m.hasFoo()) { - // Clear the field: - m.clearFoo() -} else { - // Field is not present, so set it. - m.setFoo(1); -} -``` - -#### Objective C example - -No presence: - -``` -Msg *m = [[Msg alloc] init]; -if (m.foo != 0) { - // "Clear" the field: - m.foo = 0; -} else { - // Default value: field may not have been present. - m.foo = 1; -} -``` - -Explicit presence: - -``` -Msg *m = [[Msg alloc] init]; -if (m.hasFoo()) { - // Clear the field: - [m clearFoo]; -} else { - // Field is not present, so set it. - [m setFoo:1]; -} -``` diff --git a/docs/implementing_proto3_presence.md b/docs/implementing_proto3_presence.md deleted file mode 100644 index fae2eb589ab73b999d082efffa12ec95d220e066..0000000000000000000000000000000000000000 --- a/docs/implementing_proto3_presence.md +++ /dev/null @@ -1,400 +0,0 @@ -# How To Implement Field Presence for Proto3 - -Protobuf release 3.12 adds experimental support for `optional` fields in -proto3. Proto3 optional fields track presence like in proto2. For background -information about what presence tracking means, please see -[docs/field_presence](field_presence.md). - -## Document Summary - -This document is targeted at developers who own or maintain protobuf code -generators. All code generators will need to be updated to support proto3 -optional fields. First-party code generators developed by Google are being -updated already. However third-party code generators will need to be updated -independently by their authors. This includes: - -- implementations of Protocol Buffers for other languges. -- alternate implementations of Protocol Buffers that target specialized use - cases. -- RPC code generators that create generated APIs for service calls. -- code generators that implement some utility code on top of protobuf generated - classes. - -While this document speaks in terms of "code generators", these same principles -apply to implementations that dynamically generate a protocol buffer API "on the -fly", directly from a descriptor, in languages that support this kind of usage. - -## Background - -Presence tracking was added to proto3 in response to user feedback, both from -inside Google and [from open-source -users](https://github.com/protocolbuffers/protobuf/issues/1606). The [proto3 -wrapper -types](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/wrappers.proto) -were previously the only supported presence mechanism for proto3. Users have -pointed to both efficiency and usability issues with the wrapper types. - -Presence in proto3 uses exactly the same syntax and semantics as in proto2. -Proto3 Fields marked `optional` will track presence like proto2, while fields -without any label (known as "singular fields"), will continue to omit presence -information. The `optional` keyword was chosen to minimize differences with -proto2. - -Unfortunately, for the current descriptor protos and `Descriptor` API (as of -3.11.4) it is not possible to use the same representation as proto2. Proto3 -descriptors already use `LABEL_OPTIONAL` for proto3 singular fields, which do -not track presence. There is a lot of existing code that reflects over proto3 -protos and assumes that `LABEL_OPTIONAL` in proto3 means "no presence." Changing -the semantics now would be risky, since old software would likely drop proto3 -presence information, which would be a data loss bug. - -To minimize this risk we chose a descriptor representation that is semantically -compatible with existing proto3 reflection. Every proto3 optional field is -placed into a one-field `oneof`. We call this a "synthetic" oneof, as it was not -present in the source `.proto` file. - -Since oneof fields in proto3 already track presence, existing proto3 -reflection-based algorithms should correctly preserve presence for proto3 -optional fields with no code changes. For example, the JSON and TextFormat -parsers/serializers in C++ and Java did not require any changes to support -proto3 presence. This is the major benefit of synthetic oneofs. - -This design does leave some cruft in descriptors. Synthetic oneofs are a -compatibility measure that we can hopefully clean up in the future. For now -though, it is important to preserve them across different descriptor formats and -APIs. It is never safe to drop synthetic oneofs from a proto schema. Code -generators can (and should) skip synthetic oneofs when generating a user-facing -API or user-facing documentation. But for any schema representation that is -consumed programmatically, it is important to keep the synthetic oneofs around. - -In APIs it can be helpful to offer separate accessors that refer to "real" -oneofs (see [API Changes](#api-changes) below). This is a convenient way to omit -synthetic oneofs in code generators. - -## Updating a Code Generator - -When a user adds an `optional` field to proto3, this is internally rewritten as -a one-field oneof, for backward-compatibility with reflection-based algorithms: - -```protobuf -syntax = "proto3"; - -message Foo { - // Experimental feature, not generally supported yet! - optional int32 foo = 1; - - // Internally rewritten to: - // oneof _foo { - // int32 foo = 1 [proto3_optional=true]; - // } - // - // We call _foo a "synthetic" oneof, since it was not created by the user. -} -``` - -As a result, the main two goals when updating a code generator are: - -1. Give `optional` fields like `foo` normal field presence, as described in - [docs/field_presence](field_presence.md) If your implementation already - supports proto2, a proto3 `optional` field should use exactly the same API - and internal implementation as proto2 `optional`. -2. Avoid generating any oneof-based accessors for the synthetic oneof. Its only - purpose is to make reflection-based algorithms work properly if they are - not aware of proto3 presence. The synthetic oneof should not appear anywhere - in the generated API. - -### Satisfying the Experimental Check - -If you try to run `protoc` on a file with proto3 `optional` fields, you will get -an error because the feature is still experimental: - -``` -$ cat test.proto -syntax = "proto3"; - -message Foo { - // Experimental feature, not generally supported yet! - optional int32 a = 1; -} -$ protoc --cpp_out=. test.proto -test.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set. -``` - -There are two options for getting around this error: - -1. Pass `--experimental_allow_proto3_optional` to protoc. -2. Make your filename (or a directory name) contain the string - `test_proto3_optional`. This indicates that the proto file is specifically - for testing proto3 optional support, so the check is suppressed. - -These options are demonstrated below: - -``` -# One option: -$ ./src/protoc test.proto --cpp_out=. --experimental_allow_proto3_optional - -# Another option: -$ cp test.proto test_proto3_optional.proto -$ ./src/protoc test_proto3_optional.proto --cpp_out=. -$ -``` - -The experimental check will be removed in a future release, once we are ready -to make this feature generally available. Ideally this will happen for the 3.13 -release of protobuf, sometime in mid-2020, but there is not a specific date set -for this yet. Some of the timing will depend on feedback we get from the -community, so if you have questions or concerns please get in touch via a -GitHub issue. - -### Signaling That Your Code Generator Supports Proto3 Optional - -If you now try to invoke your own code generator with the test proto, you will -run into a different error: - -``` -$ ./src/protoc test_proto3_optional.proto --my_codegen_out=. -test_proto3_optional.proto: is a proto3 file that contains optional fields, but -code generator --my_codegen_out hasn't been updated to support optional fields in -proto3. Please ask the owner of this code generator to support proto3 optional. -``` - -This check exists to make sure that code generators get a chance to update -before they are used with proto3 `optional` fields. Without this check an old -code generator might emit obsolete generated APIs (like accessors for a -synthetic oneof) and users could start depending on these. That would create -a legacy migration burden once a code generator actually implements the feature. - -To signal that your code generator supports `optional` fields in proto3, you -need to tell `protoc` what features you support. The method for doing this -depends on whether you are using the C++ -`google::protobuf::compiler::CodeGenerator` -framework or not. - -If you are using the CodeGenerator framework: - -```c++ -class MyCodeGenerator : public google::protobuf::compiler::CodeGenerator { - // Add this method. - uint64_t GetSupportedFeatures() const override { - // Indicate that this code generator supports proto3 optional fields. - // (Note: don't release your code generator with this flag set until you - // have actually added and tested your proto3 support!) - return FEATURE_PROTO3_OPTIONAL; - } -} -``` - -If you are generating code using raw `CodeGeneratorRequest` and -`CodeGeneratorResponse` messages from `plugin.proto`, the change will be very -similar: - -```c++ -void GenerateResponse() { - CodeGeneratorResponse response; - response.set_supported_features(CodeGeneratorResponse::FEATURE_PROTO3_OPTIONAL); - - // Generate code... -} -``` - -Once you have added this, you should now be able to successfully use your code -generator to generate a file containing proto3 optional fields: - -``` -$ ./src/protoc test_proto3_optional.proto --my_codegen_out=. -``` - -### Updating Your Code Generator - -Now to actually add support for proto3 optional to your code generator. The goal -is to recognize proto3 optional fields as optional, and suppress any output from -synthetic oneofs. - -If your code generator does not currently support proto2, you will need to -design an API and implementation for supporting presence in scalar fields. -Generally this means: - -- allocating a bit inside the generated class to represent whether a given field - is present or not. -- exposing a `has_foo()` method for each field to return the value of this bit. -- make the parser set this bit when a value is parsed from the wire. -- make the serializer test this bit to decide whether to serialize. - -If your code generator already supports proto2, then most of your work is -already done. All you need to do is make sure that proto3 optional fields have -exactly the same API and behave in exactly the same way as proto2 optional -fields. - -From experience updating several of Google's code generators, most of the -updates that are required fall into one of several patterns. Here we will show -the patterns in terms of the C++ CodeGenerator framework. If you are using -`CodeGeneratorRequest` and `CodeGeneratorReply` directly, you can translate the -C++ examples to your own language, referencing the C++ implementation of these -methods where required. - -#### To test whether a field should have presence - -Old: - -```c++ -bool MessageHasPresence(const google::protobuf::Descriptor* message) { - return message->file()->syntax() == - google::protobuf::FileDescriptor::SYNTAX_PROTO2; -} -``` - -New: - -```c++ -// Presence is no longer a property of a message, it's a property of individual -// fields. -bool FieldHasPresence(const google::protobuf::FieldDescriptor* field) { - return field->has_presence(); - // Note, the above will return true for fields in a oneof. - // If you want to filter out oneof fields, write this instead: - // return field->has_presence && !field->real_containing_oneof() -} -``` - -#### To test whether a field is a member of a oneof - -Old: - -```c++ -bool FieldIsInOneof(const google::protobuf::FielDescriptor* field) { - return field->containing_oneof() != nullptr; -} -``` - -New: - -```c++ -bool FieldIsInOneof(const google::protobuf::FielDescriptor* field) { - // real_containing_oneof() returns nullptr for synthetic oneofs. - return field->real_containing_oneof() != nullptr; -} -``` - -#### To iterate over all oneofs - -Old: - -```c++ -bool IterateOverOneofs(const google::protobuf::Descriptor* message) { - for (int i = 0; i < message->oneof_decl_count(); i++) { - const google::protobuf::OneofDescriptor* oneof = message->oneof(i); - // ... - } -} -``` - -New: - -```c++ -bool IterateOverOneofs(const google::protobuf::Descriptor* message) { - // Real oneofs are always first, and real_oneof_decl_count() will return the - // total number of oneofs, excluding synthetic oneofs. - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - const google::protobuf::OneofDescriptor* oneof = message->oneof(i); - // ... - } -} -``` - -## Updating Reflection - -If your implementation offers reflection, there are a few other changes to make: - -### API Changes - -The API for reflecting over fields and oneofs should make the following changes. -These match the changes implemented in C++ reflection. - -1. Add a `FieldDescriptor::has_presence()` method returning `bool` - (adjusted to your language's naming convention). This should return true - for all fields that have explicit presence, as documented in - [docs/field_presence](field_presence.md). In particular, this includes - fields in a oneof, proto2 scalar fields, and proto3 `optional` fields. - This accessor will allow users to query what fields have presence without - thinking about the difference between proto2 and proto3. -2. As a corollary of (1), please do *not* expose an accessor for the - `FieldDescriptorProto.proto3_optional` field. We want to avoid having - users implement any proto2/proto3-specific logic. Users should use the - `has_presence()` function instead. -3. You may also wish to add a `FieldDescriptor::has_optional_keyword()` method - returning `bool`, which indicates whether the `optional` keyword is present. - Message fields will always return `true` for `has_presence()`, so this method - can allow a user to know whether the user wrote `optional` or not. It can - occasionally be useful to have this information, even though it does not - change the presence semantics of the field. -4. If your reflection API may be used for a code generator, you may wish to - implement methods to help users tell the difference between real and - synthetic oneofs. In particular: - - `OneofDescriptor::is_synthetic()`: returns true if this is a synthetic - oneof. - - `FieldDescriptor::real_containing_oneof()`: like `containing_oneof()`, - but returns `nullptr` if the oneof is synthetic. - - `Descriptor::real_oneof_decl_count()`: like `oneof_decl_count()`, but - returns the number of real oneofs only. - -### Implementation Changes - -Proto3 `optional` fields and synthetic oneofs must work correctly when -reflected on. Specifically: - -1. Reflection for synthetic oneofs should work properly. Even though synthetic - oneofs do not really exist in the message, you can still make reflection work - as if they did. In particular, you can make a method like - `Reflection::HasOneof()` or `Reflection::GetOneofFieldDescriptor()` look at - the hasbit to determine if the oneof is present or not. -2. Reflection for proto3 optional fields should work properly. For example, a - method like `Reflection::HasField()` should know to look for the hasbit for a - proto3 `optional` field. It should not be fooled by the synthetic oneof into - thinking that there is a `case` member for the oneof. - -Once you have updated reflection to work properly with proto3 `optional` and -synthetic oneofs, any code that *uses* your reflection interface should work -properly with no changes. This is the benefit of using synthetic oneofs. - -In particular, if you have a reflection-based implementation of protobuf text -format or JSON, it should properly support proto3 optional fields without any -changes to the code. The fields will look like they all belong to a one-field -oneof, and existing proto3 reflection code should know how to test presence for -fields in a oneof. - -So the best way to test your reflection changes is to try round-tripping a -message through text format, JSON, or some other reflection-based parser and -serializer, if you have one. - -### Validating Descriptors - -If your reflection implementation supports loading descriptors at runtime, -you must verify that all synthetic oneofs are ordered after all "real" oneofs. - -Here is the code that implements this validation step in C++, for inspiration: - -```c++ - // Validation that runs for each message. - // Synthetic oneofs must be last. - int first_synthetic = -1; - for (int i = 0; i < message->oneof_decl_count(); i++) { - const OneofDescriptor* oneof = message->oneof_decl(i); - if (oneof->is_synthetic()) { - if (first_synthetic == -1) { - first_synthetic = i; - } - } else { - if (first_synthetic != -1) { - AddError(message->full_name(), proto.oneof_decl(i), - DescriptorPool::ErrorCollector::OTHER, - "Synthetic oneofs must be after all other oneofs"); - } - } - } - - if (first_synthetic == -1) { - message->real_oneof_decl_count_ = message->oneof_decl_count_; - } else { - message->real_oneof_decl_count_ = first_synthetic; - } -``` diff --git a/docs/options.md b/docs/options.md deleted file mode 100644 index df6b88c033f78662a5b313668fd53299ad551388..0000000000000000000000000000000000000000 --- a/docs/options.md +++ /dev/null @@ -1,246 +0,0 @@ -# Protobuf Global Extension Registry - -This file contains a global registry of known extensions for descriptor.proto, -so that any developer who wishes to use multiple 3rd party projects, each with -their own extensions, can be confident that there won't be collisions in -extension numbers. - -If you need an extension number for your custom option (see [custom options]( -https://developers.google.com/protocol-buffers/docs/proto#customoptions)), -please [send us a pull request](https://github.com/protocolbuffers/protobuf/pulls) to -add an entry to this doc, or [create an issue](https://github.com/protocolbuffers/protobuf/issues) -with info about your project (name and website) so we can add an entry for you. - -## Existing Registered Extensions - -1. C# port of protocol buffers - * Website: https://github.com/jskeet/protobuf-csharp-port - * Extensions: 1000 - -1. Perl/XS port of protocol buffers - * Website: http://code.google.com/p/protobuf-perlxs - * Extensions: 1001 - -1. Objective-C port of protocol buffers - * Website: http://code.google.com/p/protobuf-objc - * Extensions: 1002 - -1. Google Wave Federation Protocol open-source release (FedOne) - * Website: http://code.google.com/p/wave-protocol - * Extensions: 1003 - -1. PHP code generator plugin - * Website: ??? - * Extensions: 1004 - -1. GWT code generator plugin (third-party!) - * Website: http://code.google.com/p/protobuf-gwt/ - * Extensions: 1005 - -1. Unix Domain RPC code generator plugin - * Website: http://go/udrpc - * Extensions: 1006 - -1. Object-C generator plugin (Plausible Labs) - * Website: http://www.plausible.coop - * Extensions: 1007 - -1. TBD (code42.com) - * Website: ??? - * Extensions: 1008 - -1. Goby Underwater Autonomy Project - * Website: https://github.com/GobySoft/goby - * Extensions: 1009 - -1. Nanopb - * Website: http://kapsi.fi/~jpa/nanopb - * Extensions: 1010 - -1. Bluefin AUV Communication Extensions - * Website: http://www.bluefinrobotics.com - * Extensions: 1011 - -1. Dynamic Compact Control Language - * Website: http://github.com/GobySoft/dccl - * Extensions: 1012 - -1. ScaleOut StateServer® Native C++ API - * Website: http://www.scaleoutsoftware.com - * Extensions: 1013 - -1. FoundationDB SQL Layer - * Website: https://github.com/FoundationDB/sql-layer - * Extensions: 1014 - -1. Fender - * Website: https://github.com/hassox/fender - * Extensions: 1015 - -1. Vortex - * Website: http://www.prismtech.com/vortex - * Extensions: 1016 - -1. tresorit - * Website: https://tresorit.com/ - * Extensions: 1017 - -1. CRIU (Checkpoint Restore In Userspace) - * Website: http://criu.org/Main_Page - * Extensions: 1018 - -1. protobuf-c - * Website: https://github.com/protobuf-c/protobuf-c - * Extensions: 1019 - -1. ScalePB - * Website: http://trueaccord.github.io/ScalaPB/ - * Extensions: 1020 - -1. protoc-gen-bq-schema - * Website: https://github.com/GoogleCloudPlatform/protoc-gen-bq-schema - * Extensions: 1021 - -1. grpc-gateway - * Website: https://github.com/gengo/grpc-gateway - * Extensions: 1022 - -1. Certificate Transparency - * Website: https://github.com/google/certificate-transparency - * Extensions: 1023 - -1. JUNOS Router Telemetry - * Website: http://www.juniper.net - * Extensions: 1024 - -1. Spine Event Engine - * Website: https://github.com/SpineEventEngine/core-java - * Extensions: 1025 - -1. Aruba cloud platform - * Website: ??? - * Extensions: 1026 -> 1030 - -1. Voltha - * Website: ??? - * Extensions: 1031 -> 1033 - -1. gator - * Website: ??? - * Extensions: 1034 - -1. protoc-gen-flowtypes - * Website: https://github.com/tmc/grpcutil/tree/master/protoc-gen-flowtypes - * Extensions: 1035 - -1. ProfaneDB - * Website: https://gitlab.com/ProfaneDB/ProfaneDB - * Extensions: 1036 - -1. protobuf-net - * Website: https://github.com/mgravell/protobuf-net - * Extensions: 1037 - -1. FICO / StreamEngine - * Website: http://www.fico.com/ - * Extensions: 1038 - -1. GopherJS - * Website: https://github.com/johanbrandhorst/protobuf - * Extensions: 1039 - -1. ygot - * Website: https://github.com/openconfig/ygot - * Extensions: 1040 - -1. go-grpcmw - * Website: https://github.com/MarquisIO/go-grpcmw - * Extensions: 1041 - -1. grpc-gateway protoc-gen-swagger - * Website: https://github.com/grpc-ecosystem/grpc-gateway - * Extensions: 1042 - -1. AN Message - * Website: TBD - * Extensions: 1043 - -1. protofire - * Website: https://github.com/ribrdb/protofire - * Extensions: 1044 - -1. Gravity - * Website: https://github.com/aphysci/gravity - * Extensions: 1045 - -1. SEMI Standards – I&C Technical Committee - * Website: http://downloads.semi.org/web/wstdsbal.nsf/9c2b317e76523cca88257641005a47f5/88a5863a580e323088256e7b00707489!OpenDocument - * Extensions: 1046 - -1. Elixir plugin - * Website: https://github.com/tony612/grpc-elixir - * Extensions: 1047 - -1. API client generators - * Website: ??? - * Extensions: 1048-1056 - -1. Netifi Proteus - * Website: https://github.com/netifi-proteus - * Extensions: 1057 - -1. CGSN Mooring Project - * Website: https://bitbucket.org/ooicgsn/cgsn-mooring - * Extensions: 1058 - -1. Container Storage Interface - * Website: https://github.com/container-storage-interface/spec - * Extensions: 1059-1069 - -1. TwirpQL Plugin - * Website: https://twirpql.dev - * Extensions: 1070 - -1. Protoc-gen-validate - * Website: https://github.com/envoyproxy/protoc-gen-validate - * Extensions: 1071 - -1. protokt - * Website: https://github.com/toasttab/protokt (Currently Private but will be open soon.) - * Extensions: 1072 - -1. Dart port of protocol buffers - * Website https://github.com/dart-lang/protobuf - * Extensions: 1073 - -1. Ocaml-protoc-plugin - * Website: https://github.com/issuu/ocaml-protoc-plugin - * Extensions: 1074 - -1. Analyze Re Graphene - * Website: https://analyzere.com - * Extensions: 1075 - -1. Wire since and until - * Website: https://square.github.io/wire/ - * Extensions: 1076, 1077 - -1. Bazel, Failure Details - * Website: https://github.com/bazelbuild/bazel - * Extensions: 1078 - -1. grpc-graphql-gateway - * Website: https://github.com/ysugimoto/grpc-graphql-gateway - * Extensions: 1079 - -1. Cloudstate - * Website: https://cloudstate.io - * Extensions: 1080-1084 - -1. SummaFT protoc-plugins - * Website: https://summaft.com/ - * Extensions: 1085 - -1. ADLINK EdgeSDK - * Website: https://www.adlinktech.com/en/Edge-SDK-IoT - * Extensions: 1086 diff --git a/docs/performance.md b/docs/performance.md deleted file mode 100644 index 8734c700c129e98f15e92c5a306fbee57ae94cb2..0000000000000000000000000000000000000000 --- a/docs/performance.md +++ /dev/null @@ -1,304 +0,0 @@ -# Protobuf Performance -The following benchmark test results were produced on a workstation utilizing an Intel® Xeon® Processor E5-2630 with 32GB of RAM. - -This table contains the results of three separate languages: - -* **C++** - For C++, there are three parsing methods: - * **new** - This is for using a new operator for creating a message instance. - * **new arena** - This is for using arena for creating a new message instance. - * **reuse** - This is for reusing the same message instance for parsing. -* **Java** - For Java, there are three parsing/serialization methods: - * **byte[]** - This is for parsing from a Byte Array. - * **ByteString** - This is for parsing from a - com.google.protobuf.ByteString. - * **InputStream** - This is for parsing from an InputStream. -* **Python** - For Python, there are three types of Python protobuf for testing: - * **C++-generated-code** - This is for using C++ generated code of the - proto file as a dynamic linked library. - * **C++-reflection** - This is for using C++ reflection, for which there's no - generated code, but still using C++ protobuf library as a dynamic linked - library. - * **pure-Python** - This is for the pure version of Python, which does not link with - any C++ protobuf library. - -## Parsing performance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C++C++ with tcmallocjavapython
newnew arenareusenewnew arenareusebyte[]ByteStringInputStreamC++-generated-codeC++-reflectionpure-Python
google_message1_proto2368.717MB/s261.847MB/s799.403MB/s645.183MB/s441.023MB/s1.122GB/s425.437MB/s425.937MB/s251.018MB/s82.8314MB/s47.6763MB/s3.76299MB/s
google_message1_proto3294.517MB/s229.116MB/s469.982MB/s434.510MB/s394.701MB/s591.931MB/s357.597MB/s378.568MB/s221.676MB/s82.0498MB/s39.9467MB/s3.77751MB/s
google_message2277.242MB/s347.611MB/s793.67MB/s503.721MB/s596.333MB/s922.533MB/s416.778MB/s419.543MB/s367.145MB/s241.46MB/s71.5723MB/s2.73538MB/s
google_message3_1213.478MB/s291.58MB/s543.398MB/s539.704MB/s717.300MB/s927.333MB/s684.241MB/s704.47MB/s648.624MB/s209.036MB/s142.356MB/s15.3324MB/s
google_message3_2672.685MB/s802.767MB/s1.21505GB/s985.790MB/s1.136GB/s1.367GB/s1.54439GB/s1.60603GB/s1.33443GB/s573.835MB/s314.33MB/s15.0169MB/s
google_message3_3207.681MB/s140.591MB/s535.181MB/s369.743MB/s262.301MB/s556.644MB/s279.385MB/s304.853MB/s107.575MB/s32.248MB/s26.1431MB/s2.63541MB/s
google_message3_47.96091GB/s7.10024GB/s9.3013GB/s8.518GB/s8.171GB/s9.917GB/s5.78006GB/s5.85198GB/s4.62609GB/s2.49631GB/s2.35442GB/s802.061MB/s
google_message3_576.0072MB/s51.6769MB/s237.856MB/s178.495MB/s111.751MB/s329.569MB/s121.038MB/s132.866MB/s36.9197MB/s10.3962MB/s8.84659MB/s1.25203MB/s
google_message4331.46MB/s404.862MB/s427.99MB/s589.887MB/s720.367MB/s705.373MB/s606.228MB/s589.13MB/s530.692MB/s305.543MB/s174.834MB/s7.86485MB/s
- -## Serialization performance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C++C++ with tcmallocjavapython
byte[]ByteStringInputStreamC++-generated-codeC++-reflectionpure-Python
google_message1_proto21.39698GB/s1.701GB/s1.12915GB/s1.13589GB/s758.609MB/s260.911MB/s58.4815MB/s5.77824MB/s
google_message1_proto3959.305MB/s939.404MB/s1.15372GB/s1.07824GB/s802.337MB/s239.4MB/s33.6336MB/s5.80524MB/s
google_message21.27429GB/s1.402GB/s1.01039GB/s1022.99MB/s798.736MB/s996.755MB/s57.9601MB/s4.09246MB/s
google_message3_11.31916GB/s2.049GB/s991.496MB/s860.332MB/s662.88MB/s1.48625GB/s421.287MB/s18.002MB/s
google_message3_22.15676GB/s2.632GB/s2.14736GB/s2.08136GB/s1.55997GB/s2.39597GB/s326.777MB/s16.0527MB/s
google_message3_3650.456MB/s1.040GB/s593.52MB/s580.667MB/s346.839MB/s123.978MB/s35.893MB/s2.32834MB/s
google_message3_48.70154GB/s9.825GB/s5.88645GB/s5.93946GB/s2.44388GB/s5.9241GB/s4.05837GB/s876.87MB/s
google_message3_5246.33MB/s443.993MB/s283.278MB/s259.167MB/s206.37MB/s37.0285MB/s12.2228MB/s1.1979MB/s
google_message41.56674GB/s2.19601GB/s776.907MB/s770.707MB/s702.931MB/s1.49623GB/s205.116MB/s8.93428MB/s
- -\* The cpp performance can be improved by using [tcmalloc](https://gperftools.github.io/gperftools/tcmalloc.html), please follow the (instruction)[https://github.com/protocolbuffers/protobuf/blob/master/benchmarks/README.md] to link with tcmalloc to get the faster result. diff --git a/docs/third_party.md b/docs/third_party.md deleted file mode 100644 index c1726a0f178c7e3d3a525f04e039cb224dfe8f70..0000000000000000000000000000000000000000 --- a/docs/third_party.md +++ /dev/null @@ -1,186 +0,0 @@ -# Third-Party Add-ons for Protocol Buffers - -This page lists code related to Protocol Buffers which is developed and maintained by third parties. You may find this code useful, but note that **these projects are not affiliated with or endorsed by Google (unless explicitly marked)**; try them at your own risk. Also note that many projects here are in the early stages of development and not production-ready. - -If you have a project that should be listed here, please [send us a pull request](https://github.com/google/protobuf/pulls) to update this page. - -## Programming Languages - -These are projects we know about implementing Protocol Buffers for other programming languages: -* Action Script: http://code.google.com/p/protobuf-actionscript3/ -* Action Script: https://code.google.com/p/protoc-gen-as3/ -* Action Script: https://github.com/matrix3d/JProtoc -* Action Script: https://github.com/zhongfq/protobuf-as3/ -* C: https://github.com/protobuf-c/protobuf-c -* C: http://koti.kapsi.fi/jpa/nanopb/ -* C: https://github.com/cloudwu/pbc/ -* C: https://github.com/haberman/upb/wiki -* C: https://github.com/squidfunk/protobluff -* C: https://github.com/eerimoq/pbtools -* C++: https://github.com/google/protobuf (Google-official implementation) -* C++: https://EmbeddedProto.com -* C/C++: http://spbc.sf.net/ -* C#: http://code.google.com/p/protobuf-csharp-port -* C#: https://silentorbit.com/protobuf/ -* C#/.NET/WCF/VB: http://code.google.com/p/protobuf-net/ -* Clojure: http://github.com/ninjudd/clojure-protobuf -* Clojure: https://github.com/clojusc/protobuf -* Clojure: https://protojure.github.io -* Common Lisp: http://github.com/ndantam/s-protobuf -* Common Lisp: http://github.com/brown/protobuf -* D: https://github.com/dcarp/protobuf-d -* D: https://github.com/msoucy/dproto -* D: https://github.com/opticron/ProtocolBuffer -* Dart: https://github.com/dart-lang/dart-protobuf (runtime) https://github.com/dart-lang/dart-protoc-plugin (code generator) -* Delphi: http://sourceforge.net/projects/protobuf-delphi/ -* Delphi: http://fundementals.sourceforge.net/dl.html -* Elixir: https://github.com/jeremyong/exprotoc -* Elixir: https://github.com/tony612/protobuf-elixir -* Elixir: https://github.com/ahamez/protox -* Elm: https://github.com/tiziano88/elm-protobuf -* Erlang: https://github.com/tomas-abrahamsson/gpb -* Erlang: http://piqi.org/ -* Erlang: https://github.com/basho/erlang_protobuffs (no longer maintained, use gpb instead) -* Hacklang/HHVM: https://github.com/y3llowcake/proto-hack -* GDScript: https://github.com/oniksan/godobuf (Godot v3 engine plugin) -* Go: https://github.com/golang/protobuf (Google-official implementation) -* Go: https://github.com/akunspy/gopbuf -* Go: https://github.com/gogo/protobuf -* GopherJS: https://github.com/johanbrandhorst/protobuf -* Haskell: http://hackage.haskell.org/package/hprotoc -* Haskell: https://github.com/google/proto-lens (Google-unofficial implementation) -* Haskell: https://github.com/awakesecurity/proto3-suite (code generator) https://github.com/awakesecurity/proto3-wire (binary serializer/deserializer) -* Haxe: https://github.com/Atry/protoc-gen-haxe -* Java: https://github.com/google/protobuf (Google-official implementation) -* Java/Android: https://github.com/square/wire -* Java: https://github.com/HebiRobotics/QuickBuffers/ -* Java ME: http://code.google.com/p/protobuf-javame/ -* Java ME: http://swingme.sourceforge.net/encode.shtml -* Java ME: http://code.google.com/p/protobuf-j2me/ -* Javascript: http://code.google.com/p/protobuf-js/ -* Javascript: http://github.com/sirikata/protojs -* Javascript: https://github.com/dcodeIO/ProtoBuf.js -* Javascript: http://code.google.com/p/protobuf-for-node/ -* Javascript: http://code.google.com/p/protostuff/ -* Julia: https://github.com/tanmaykm/ProtoBuf.jl -* Kotlin: https://github.com/marcoferrer/kroto-plus -* Kotlin: https://github.com/Kotlin/kotlinx.serialization -* Lua: http://code.google.com/p/protoc-gen-lua/ -* Lua: http://github.com/indygreg/lua-protobuf -* Lua: https://github.com/Neopallium/lua-pb -* Matlab: http://code.google.com/p/protobuf-matlab/ -* Mercury: http://code.google.com/p/protobuf-mercury/ -* Objective C: http://code.google.com/p/protobuf-objc/ -* Objective C: https://github.com/alexeyxo/protobuf-objc -* OCaml: http://piqi.org/ -* Perl: http://groups.google.com/group/protobuf-perl -* Perl: http://search.cpan.org/perldoc?Google::ProtocolBuffers -* Perl: https://metacpan.org/pod/Google::ProtocolBuffers::Dynamic -* Perl/XS: http://code.google.com/p/protobuf-perlxs/ -* PHP: http://code.google.com/p/pb4php/ -* PHP: https://github.com/allegro/php-protobuf/ -* PHP: https://github.com/chobie/php-protocolbuffers -* PHP: http://drslump.github.com/Protobuf-PHP -* Prolog: http://www.swi-prolog.org/pldoc/package/protobufs.html -* Python: https://github.com/google/protobuf (Google-official implementation) -* Python: https://github.com/eigenein/protobuf -* Python: https://github.com/danielgtaylor/python-betterproto -* R: http://cran.r-project.org/package=RProtoBuf -* Ruby: http://code.google.com/p/ruby-protobuf/ -* Ruby: http://github.com/mozy/ruby-protocol-buffers -* Ruby: https://github.com/bmizerany/beefcake/tree/master/lib/beefcake -* Ruby: https://github.com/localshred/protobuf -* Rust: https://github.com/stepancheg/rust-protobuf/ -* Scala: http://github.com/jeffplaisance/scala-protobuf -* Scala: http://code.google.com/p/protobuf-scala -* Scala: https://github.com/SandroGrzicic/ScalaBuff -* Scala: https://scalapb.github.io -* Solidity: https://github.com/celer-network/pb3-gen-sol -* Swift: https://github.com/alexeyxo/protobuf-swift -* Swift: https://github.com/apple/swift-protobuf/ -* Typescript: https://github.com/y3llowcake/protoc-gen-ts -* Vala: https://launchpad.net/protobuf-vala -* Visual Basic: http://code.google.com/p/protobuf-net/ - -## RPC Implementations - -GRPC (http://www.grpc.io/) is Google's RPC implementation for Protocol Buffers. There are other third-party RPC implementations as well. Some of these actually work with Protocol Buffers service definitions (defined using the `service` keyword in `.proto` files) while others just use Protocol Buffers message objects. - -* https://github.com/grpc/grpc (C++, Node.js, Python, Ruby, Objective-C, PHP, C#, Google-official implementation) -* https://zeroc.com/products/ice (Multiple languages) -* https://github.com/protobuf-net/protobuf-net (C#/.NET/WCF/VB) -* http://www.deltavsoft.com/doc/_external_serialization.html#Protobufs (C++) -* https://protojure.github.io (Clojure) -* https://code.google.com/p/protobuf-rpc-pro/ (Java) -* https://github.com/baidu/sofa-pbrpc (C++) -* https://github.com/madhon/protobuf-csharp-rpc (C#) -* https://github.com/madwyn/libpbrpc (C++) -* https://github.com/SeriousMa/grpc-protobuf-validation (Java) -* https://github.com/elixir-grpc/grpc (Elixir) -* https://github.com/johanbrandhorst/protobuf (GopherJS) -* https://github.com/awakesecurity/gRPC-haskell (Haskell) -* https://github.com/Yeolar/raster (C++) -* https://github.com/jnordberg/wsrpc (JavaScript Node.js/Browser) -* https://github.com/ppissias/xsrpcj (Java) - -Inactive: - -* https://launchpad.net/txprotobuf/ (Python) -* https://github.com/modeswitch/protobuf-rpc (Python) -* https://github.com/sdeo/protobuf-socket-rpc (Java, Python) -* https://code.google.com/p/proto-streamer/ (Java) -* https://code.google.com/p/server1/ (C++) -* https://code.google.com/p/protobuf-mina-rpc/ (Python client, Java server) -* https://code.google.com/p/casocklib/ (C++) -* https://code.google.com/p/cxf-protobuf/ (Java) -* https://code.google.com/p/protobuf-remote/ (C++/C#) -* https://code.google.com/p/eneter-protobuf-serializer/ (Java/.NET) -* https://github.com/robbinfan/claire/tree/master/protorpc (C++) -* https://github.com/ebencheung/arab (C++) -* https://code.google.com/p/protobuf-csharp-rpc/ (C#) -* https://github.com/thesamet/rpcz (C++/Python, based on ZeroMQ) -* https://github.com/w359405949/libmaid (C++, Python) - -## Other Utilities - -There are miscellaneous other things you may find useful as a Protocol Buffers developer. - -* [Bazel Build](https://bazel.build) - * [rules_closure](https://github.com/bazelbuild/rules_closure) `js-closure` - * [rules_go](https://github.com/bazelbuild/rules_go) `go` - * [rules_protobuf](https://github.com/pubref/rules_protobuf) `java` `c++` `c#` `go` `js-closure` `js-node` `python` `ruby` -* [NetBeans IDE plugin](http://code.google.com/p/protobuf-netbeans-plugin/) -* [Wireshark/Ethereal packet sniffer plugin](http://code.google.com/p/protobuf-wireshark/) -* [Alternate encodings (JSON, XML, HTML) for Java protobufs](http://code.google.com/p/protobuf-java-format/) -* [Another JSON encoder/decoder for Java](https://github.com/sijuv/protobuf-codec) -* [Editor for serialized protobufs](http://code.google.com/p/protobufeditor/) -* [Intellij IDEA plugin](http://github.com/nnmatveev/idea-plugin-protobuf) -* [TextMate syntax highlighting](http://github.com/michaeledgar/protobuf-tmbundle) -* [Oracle PL SQL plugin](http://code.google.com/p/protocol-buffer-plsql/) -* [Eclipse editor for protobuf (from Google)](http://code.google.com/p/protobuf-dt/) -* [C++ Builder compatible protobuf](https://github.com/saadware/protobuf-cppbuilder) -* Maven Protobuf Compiler Plugin - * By xolstice.org ([Documentation](https://www.xolstice.org/protobuf-maven-plugin/)) ([Source](https://github.com/xolstice/protobuf-maven-plugin/)) [![Maven Central](https://img.shields.io/maven-central/v/org.xolstice.maven.plugins/protobuf-maven-plugin.svg)](https://repo1.maven.org/maven2/org/xolstice/maven/plugins/protobuf-maven-plugin/) - * http://igor-petruk.github.com/protobuf-maven-plugin/ - * http://code.google.com/p/maven-protoc-plugin/ - * https://github.com/os72/protoc-jar-maven-plugin -* [Documentation generator plugin (Markdown/HTML/DocBook/...)](https://github.com/pseudomuto/protoc-gen-doc) -* [DocBook generator for .proto files](http://code.google.com/p/protoc-gen-docbook/) -* [Protobuf for nginx module](https://github.com/dbcode/protobuf-nginx/) -* [RSpec matchers and Cucumber step defs for testing Protocol Buffers](https://github.com/connamara/protobuf_spec) -* [Sbt plugin for Protocol Buffers](https://github.com/Atry/sbt-cppp) -* [Gradle Protobuf Plugin](https://github.com/aantono/gradle-plugin-protobuf) -* [Multi-platform executable JAR and Java API for protoc](https://github.com/os72/protoc-jar) -* [Python scripts to convert between Protocol Buffers and JSON](https://github.com/NextTuesday/py-pb-converters) -* [Visual Studio Language Service support for Protocol Buffers](http://visualstudiogallery.msdn.microsoft.com/4bc0f38c-b058-4e05-ae38-155e053c19c5) -* [Visual Studio Code Support for Protocol Buffers](https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3) -* [C++ library for serialization/de-serialization between Protocol Buffers and JSON.](https://github.com/yinqiwen/pbjson) -* [ProtoBuf with Java EE7 Expression Language 3.0; pure Java ProtoBuf Parser and Builder.](https://github.com/protobufel/protobuf-el) -* [Notepad++ Syntax Highlighting for .proto files](https://github.com/chai2010/notepadplus-protobuf) -* [Linter for .proto files](https://github.com/ckaznocha/protoc-gen-lint) -* [Protocol Buffers Dynamic Schema - create protobuf schemas programmatically (Java)](https://github.com/os72/protobuf-dynamic) -* [Make protoc plugins in NodeJS](https://github.com/konsumer/node-protoc-plugin) -* [ProfaneDB - A Protocol Buffers database](https://profanedb.gitlab.io) -* [Protocol Buffer property-based testing utility and example message generator (Python / Hypothesis)](https://github.com/CurataEng/hypothesis-protobuf) -* [Protolock - CLI utility to prevent backward-incompatible changes to .proto files](https://github.com/nilslice/protolock) -* [Optional GRPC - GRPC for testable microservices (Python)](https://github.com/mattpaletta/optional-grpc.git) diff --git a/editors/proto.vim b/editors/proto.vim index 7f1aeb730a172ad4e77f2de76ba0a942e1827f8b..bdc60ce7f8ee8777fce96219fd782b5f690aeb64 100644 --- a/editors/proto.vim +++ b/editors/proto.vim @@ -69,10 +69,10 @@ syn keyword pbBool true false syn match pbInt /-\?\<\d\+\>/ syn match pbInt /\<0[xX]\x+\>/ syn match pbFloat /\<-\?\d*\(\.\d*\)\?/ -syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp -syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp -syn region pbString start=/"/ skip=/\\./ end=/"/ -syn region pbString start=/'/ skip=/\\./ end=/'/ +syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp,@Spell +syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp,@Spell +syn region pbString start=/"/ skip=/\\./ end=/"/ contains=@Spell +syn region pbString start=/'/ skip=/\\./ end=/'/ contains=@Spell if version >= 508 || !exists("did_proto_syn_inits") if version < 508 diff --git a/examples/.gitignore b/examples/.gitignore deleted file mode 100644 index 229542d23ce923bfb89a39775b81f98e3b7afd1c..0000000000000000000000000000000000000000 --- a/examples/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore the bazel symlinks -/bazel-* diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..e9f9635ae81e87020eec1aa145e176206c2b68ea --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,92 @@ +# See README.txt. + +.PHONY: all cpp java python clean + +all: cpp java python + +cpp: add_person_cpp list_people_cpp +dart: add_person_dart list_people_dart +go: add_person_go list_people_go +gotest: add_person_gotest list_people_gotest +java: add_person_java list_people_java +python: add_person_python list_people_python + +clean: + rm -f add_person_cpp list_people_cpp add_person_java list_people_java add_person_python list_people_python + rm -f javac_middleman AddPerson*.class ListPeople*.class com/example/tutorial/*.class + rm -f protoc_middleman addressbook.pb.cc addressbook.pb.h addressbook_pb2.py com/example/tutorial/AddressBookProtos.java + rm -f *.pyc + rm -f protoc_middleman_go tutorial/*.pb.go add_person_go list_people_go + rm -f protoc_middleman_dart dart_tutorial/*.pb*.dart + rmdir dart_tutorial 2>/dev/null || true + rmdir tutorial 2>/dev/null || true + rmdir com/example/tutorial 2>/dev/null || true + rmdir com/example 2>/dev/null || true + rmdir com 2>/dev/null || true + +protoc_middleman: addressbook.proto + protoc $$PROTO_PATH --cpp_out=. --java_out=. --python_out=. addressbook.proto + @touch protoc_middleman + +protoc_middleman_go: addressbook.proto + mkdir -p tutorial # make directory for go package + protoc $$PROTO_PATH --go_out=tutorial addressbook.proto + @touch protoc_middleman_go + +protoc_middleman_dart: addressbook.proto + mkdir -p dart_tutorial # make directory for the dart package + protoc -I ../src/:. --dart_out=dart_tutorial addressbook.proto ../src/google/protobuf/timestamp.proto + pub get + @touch protoc_middleman_dart + +add_person_cpp: add_person.cc protoc_middleman + pkg-config --cflags protobuf # fails if protobuf is not installed + c++ -std=c++11 add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf` + +list_people_cpp: list_people.cc protoc_middleman + pkg-config --cflags protobuf # fails if protobuf is not installed + c++ -std=c++11 list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf` + +add_person_dart: add_person.dart protoc_middleman_dart + +list_people_dart: list_people.dart protoc_middleman_dart + +add_person_go: add_person.go protoc_middleman_go + go build -o add_person_go add_person.go + +add_person_gotest: add_person_test.go add_person_go + go test add_person.go add_person_test.go + +list_people_go: list_people.go protoc_middleman_go + go build -o list_people_go list_people.go + +list_people_gotest: list_people.go list_people_go + go test list_people.go list_people_test.go + +javac_middleman: AddPerson.java ListPeople.java protoc_middleman + javac -cp $$CLASSPATH AddPerson.java ListPeople.java com/example/tutorial/AddressBookProtos.java + @touch javac_middleman + +add_person_java: javac_middleman + @echo "Writing shortcut script add_person_java..." + @echo '#! /bin/sh' > add_person_java + @echo 'java -classpath .:$$CLASSPATH AddPerson "$$@"' >> add_person_java + @chmod +x add_person_java + +list_people_java: javac_middleman + @echo "Writing shortcut script list_people_java..." + @echo '#! /bin/sh' > list_people_java + @echo 'java -classpath .:$$CLASSPATH ListPeople "$$@"' >> list_people_java + @chmod +x list_people_java + +add_person_python: add_person.py protoc_middleman + @echo "Writing shortcut script add_person_python..." + @echo '#! /bin/sh' > add_person_python + @echo './add_person.py "$$@"' >> add_person_python + @chmod +x add_person_python + +list_people_python: list_people.py protoc_middleman + @echo "Writing shortcut script list_people_python..." + @echo '#! /bin/sh' > list_people_python + @echo './list_people.py "$$@"' >> list_people_python + @chmod +x list_people_python diff --git a/fix_permissions.sh b/fix_permissions.sh deleted file mode 100644 index f33c25c3067b1ad849a0ebfcbe82b5272984f7a1..0000000000000000000000000000000000000000 --- a/fix_permissions.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -for file in $(find . -type f); do - if [ "$(head -c 2 $file)" == "#!" ]; then - chmod u+x $file - else - chmod a-x $file - fi -done diff --git a/generate_changelog.py b/generate_changelog.py deleted file mode 100644 index 60803c59dccce92c2174be2235aecb55493ecb64..0000000000000000000000000000000000000000 --- a/generate_changelog.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -"""Generates a friendly list of changes per language since the last release.""" - -import sys -import os - -class Language(object): - def __init__(self, name, pathspec): - self.name = name - self.pathspec = pathspec - -languages = [ - Language("C++", [ - "':(glob)src/google/protobuf/*'", - "src/google/protobuf/compiler/cpp", - "src/google/protobuf/io", - "src/google/protobuf/util", - "src/google/protobuf/stubs", - ]), - Language("Java", [ - "java", - "src/google/protobuf/compiler/java", - ]), - Language("Python", [ - "python", - "src/google/protobuf/compiler/python", - ]), - Language("JavaScript", [ - "js", - "src/google/protobuf/compiler/js", - ]), - Language("PHP", [ - "php", - "src/google/protobuf/compiler/php", - ]), - Language("Ruby", [ - "ruby", - "src/google/protobuf/compiler/ruby", - ]), - Language("Csharp", [ - "csharp", - "src/google/protobuf/compiler/csharp", - ]), - Language("Objective C", [ - "objectivec", - "src/google/protobuf/compiler/objectivec", - ]), -] - -if len(sys.argv) < 2: - print("Usage: generate_changelog.py ") - sys.exit(1) - -previous = sys.argv[1] - -for language in languages: - print(language.name) - sys.stdout.flush() - os.system(("git log --pretty=oneline --abbrev-commit %s...HEAD %s | " + - "sed -e 's/^/ - /'") % (previous, " ".join(language.pathspec))) - print("") - -print("To view a commit on GitHub: " + - "https://github.com/protocolbuffers/protobuf/commit/") diff --git a/install-sh b/install-sh new file mode 100644 index 0000000000000000000000000000000000000000..20d8b2eaea9c7e1a9a83cbae1b770ab021fe114c --- /dev/null +++ b/install-sh @@ -0,0 +1,529 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2018-03-11.20; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/java/README.md b/java/README.md index c4e8e20de598ab2bd32b41a92dc2273e7dbdaea6..c8050893e02c30b3036995613cb8439a1135fb7a 100644 --- a/java/README.md +++ b/java/README.md @@ -45,9 +45,9 @@ protobuf-java-util package: If you are using Gradle, add the following to your `build.gradle` file's dependencies: ``` - compile 'com.google.protobuf:protobuf-java:3.11.0' + implementation 'com.google.protobuf:protobuf-java:3.11.0' ``` -Again, be sure to check that the version number maches (or is newer than) the version number of protoc that you are using. +Again, be sure to check that the version number matches (or is newer than) the version number of protoc that you are using. ### Use Java Protocol Buffers on Android @@ -68,7 +68,7 @@ how to use them. Most users should follow the instructions above to use protobuf Java runtime. If you are contributing code to protobuf or want to use a protobuf version -that hasn't been officially released yet, you can folllow the instructions +that hasn't been officially released yet, you can follow the instructions below to build protobuf from source code. ### Build from Source - With Maven diff --git a/java/bom/pom.xml b/java/bom/pom.xml index 3642783f6a8c7d4bd5c1b41255e8685ea70500a1..209a4b555b2ed0f4d087f745999bd473b3988860 100644 --- a/java/bom/pom.xml +++ b/java/bom/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-bom - 3.13.0 + 3.14.0 pom Protocol Buffers [BOM] diff --git a/java/compatibility_tests/README.md b/java/compatibility_tests/README.md deleted file mode 100644 index 72c6034c99bc9fb51d9362498a774392873be0f3..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Protobuf Java Compatibility Tests - -This directory contains tests to ensure protobuf library is compatible with -previously released versions. - -## Directory Layout - -For each released protobuf version we are testing compatibility with, there -is a sub-directory with the following layout (take v2.5.0 as an example): - - * v2.5.0 - * test.sh - * pom.xml - * protos/ - unittest protos. - * more_protos/ - unittest protos that import the ones in "protos". - * tests/ - actual Java test classes. - -The testing code is extracted from regular protobuf unittests by removing: - - * tests that access package private methods/classes. - * tests that are known to be broken by an intended behavior change (e.g., we - changed the parsing recursion limit from 64 to 100). - * all lite runtime tests. - -It's also divided into 3 submodule with tests depending on more_protos and -more_protos depending on protos. This way we can test scenarios where only part -of the dependency is upgraded to the new version. - -## How to Run The Tests - -We use a shell script to drive the test of different scenarios so the test -will only run on unix-like environments. The script expects a few command -line tools to be available on PATH: git, mvn, wget, grep, sed, java. - -Before running the tests, make sure you have already built the protoc binary -following [the C++ installation instructions](../../src/README.md). The test -scripts will use the built binary located at ${protobuf}/src/protoc. - -To start a test, simply run the test.sh script in each version directory. For -example: - - $ v2.5.0/test.sh - -For each version, the test script will test: - - * only upgrading protos to the new version - * only upgrading more_protos to the new version - -and see whether everything builds/runs fine. Both source compatibility and -binary compatibility will be tested. diff --git a/java/compatibility_tests/v2.5.0/deps/pom.xml b/java/compatibility_tests/v2.5.0/deps/pom.xml deleted file mode 100644 index 7ceb96049d72b06a79b0756da0d22769068adf17..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/deps/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - com.google.protobuf.compatibility - compatibility-test-deps - 2.5.0 - - Compatibility Test Dependencies - - - - junit - junit - 4.4 - - - org.easymock - easymock - 2.2 - - - org.easymock - easymockclassextension - 2.2.1 - - - - - - - maven-assembly-plugin - 2.6 - - - jar-with-dependencies - - - - - - diff --git a/java/compatibility_tests/v2.5.0/more_protos/pom.xml b/java/compatibility_tests/v2.5.0/more_protos/pom.xml deleted file mode 100644 index ff0c4133f0d89cf066f9ccfbdc44a3ece26cad51..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 4.0.0 - - com.google.protobuf.compatibility - compatibility-test-suite - 2.5.0 - .. - - - com.google.protobuf.compatibility - compatibility-more-protos - 2.5.0 - - More protos for Compatibility test - - - - com.google.protobuf - protobuf-java - ${more_protos.protobuf.version} - - - com.google.protobuf.compatibility - compatibility-protos - 2.5.0 - - - - - - - maven-compiler-plugin - 3.3 - - 1.6 - 1.6 - - - - maven-antrun-plugin - - - generate-sources - generate-sources - - - - - - - - - - - - target/generated-sources - - - run - - - - - - - diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/descriptor.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/descriptor.proto deleted file mode 100644 index 031433e2a9e1a42d6cb7259561d3c522a1b9409e..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/descriptor.proto +++ /dev/null @@ -1,620 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - - -package google.protobuf; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field whithout harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; - optional int32 end = 2; - } - repeated ExtensionRange extension_range = 5; - - optional MessageOptions options = 7; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; // Tag-delimited aggregate. - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - // TODO(sanjay): Should we add LABEL_MAP? - }; - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be either TYPE_ENUM or TYPE_MESSAGE. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - optional FieldOptions options = 8; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; -} - - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Object-C plugin) and your project website (if available) -- there's no need -// to explain how you intend to use them. Usually you only need one extension -// number. You can declare multiple options with only one extension number by -// putting them in a sub-message. See the Custom Options section of the docs -// for examples: -// http://code.google.com/apis/protocolbuffers/docs/proto.html#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - optional string java_outer_classname = 8; - - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; - - // If set true, then the Java code generator will generate equals() and - // hashCode() methods for all messages defined in the .proto file. This is - // purely a speed optimization, as the AbstractMessage base class includes - // reflection-based implementations of these methods. - optional bool java_generate_equals_and_hash = 20 [default=false]; - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default=SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. There is no default. - optional string go_package = 11; - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of proto2. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. - optional bool packed = 2; - - - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outher message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - optional bool lazy = 5 [default=false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; - - // EXPERIMENTAL. DO NOT USE. - // For "map" fields, the name of the field in the enclosed type that - // is the key for this map. For example, suppose we have: - // message Item { - // required string name = 1; - // required string value = 2; - // } - // message Config { - // repeated Item items = 1 [experimental_map_key="name"]; - // } - // In this situation, the map key for Item will be set to "name". - // TODO: Fully-implement this, then remove the "experimental_" prefix. - optional string experimental_map_key = 9; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to false to disallow mapping different tag names to a same - // value. - optional bool allow_alias = 2 [default=true]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - optional string leading_comments = 3; - optional string trailing_comments = 4; - } -} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest.proto deleted file mode 100644 index 6eb2d86f51f15504571d7c00bcfb773765202b2d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest.proto +++ /dev/null @@ -1,719 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file we will use for unit testing. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; // auto-added - -import "google/protobuf/unittest_import.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do "using namespace unittest = protobuf_unittest". -package protobuf_unittest; - -// Protos optimized for SPEED use a strict superset of the generated code -// of equivalent ones optimized for CODE_SIZE, so we should optimize all our -// tests for speed unless explicitly testing code size optimization. -option optimize_for = SPEED; - -option java_outer_classname = "UnittestProto"; - -// This proto includes every type of field in both singular and repeated -// forms. -message TestAllTypes { - message NestedMessage { - // The field name "b" fails to compile in proto1 because it conflicts with - // a local variable named "b" in one of the generated methods. Doh. - // This file needs to compile in proto1 to test backwards-compatibility. - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessage optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessage optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Defined in unittest_import_public.proto - optional protobuf_unittest_import.PublicImportMessage - optional_public_import_message = 26; - - optional NestedMessage optional_lazy_message = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR ]; - optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum = 83 [default = IMPORT_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message TestDeprecatedFields { - optional int32 deprecated_int32 = 1 [deprecated=true]; -} - -// Define these after TestAllTypes to make sure the compiler can handle -// that. -message ForeignMessage { - optional int32 c = 1; -} - -enum ForeignEnum { - FOREIGN_FOO = 4; - FOREIGN_BAR = 5; - FOREIGN_BAZ = 6; -} - -message TestAllExtensions { - extensions 1 to max; -} - -extend TestAllExtensions { - // Singular - optional int32 optional_int32_extension = 1; - optional int64 optional_int64_extension = 2; - optional uint32 optional_uint32_extension = 3; - optional uint64 optional_uint64_extension = 4; - optional sint32 optional_sint32_extension = 5; - optional sint64 optional_sint64_extension = 6; - optional fixed32 optional_fixed32_extension = 7; - optional fixed64 optional_fixed64_extension = 8; - optional sfixed32 optional_sfixed32_extension = 9; - optional sfixed64 optional_sfixed64_extension = 10; - optional float optional_float_extension = 11; - optional double optional_double_extension = 12; - optional bool optional_bool_extension = 13; - optional string optional_string_extension = 14; - optional bytes optional_bytes_extension = 15; - - optional group OptionalGroup_extension = 16 { - optional int32 a = 17; - } - - optional TestAllTypes.NestedMessage optional_nested_message_extension = 18; - optional ForeignMessage optional_foreign_message_extension = 19; - optional protobuf_unittest_import.ImportMessage - optional_import_message_extension = 20; - - optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21; - optional ForeignEnum optional_foreign_enum_extension = 22; - optional protobuf_unittest_import.ImportEnum - optional_import_enum_extension = 23; - - optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE]; - optional string optional_cord_extension = 25 [ctype=CORD]; - - optional protobuf_unittest_import.PublicImportMessage - optional_public_import_message_extension = 26; - - optional TestAllTypes.NestedMessage - optional_lazy_message_extension = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32_extension = 31; - repeated int64 repeated_int64_extension = 32; - repeated uint32 repeated_uint32_extension = 33; - repeated uint64 repeated_uint64_extension = 34; - repeated sint32 repeated_sint32_extension = 35; - repeated sint64 repeated_sint64_extension = 36; - repeated fixed32 repeated_fixed32_extension = 37; - repeated fixed64 repeated_fixed64_extension = 38; - repeated sfixed32 repeated_sfixed32_extension = 39; - repeated sfixed64 repeated_sfixed64_extension = 40; - repeated float repeated_float_extension = 41; - repeated double repeated_double_extension = 42; - repeated bool repeated_bool_extension = 43; - repeated string repeated_string_extension = 44; - repeated bytes repeated_bytes_extension = 45; - - repeated group RepeatedGroup_extension = 46 { - optional int32 a = 47; - } - - repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48; - repeated ForeignMessage repeated_foreign_message_extension = 49; - repeated protobuf_unittest_import.ImportMessage - repeated_import_message_extension = 50; - - repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51; - repeated ForeignEnum repeated_foreign_enum_extension = 52; - repeated protobuf_unittest_import.ImportEnum - repeated_import_enum_extension = 53; - - repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord_extension = 55 [ctype=CORD]; - - repeated TestAllTypes.NestedMessage - repeated_lazy_message_extension = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32_extension = 61 [default = 41 ]; - optional int64 default_int64_extension = 62 [default = 42 ]; - optional uint32 default_uint32_extension = 63 [default = 43 ]; - optional uint64 default_uint64_extension = 64 [default = 44 ]; - optional sint32 default_sint32_extension = 65 [default = -45 ]; - optional sint64 default_sint64_extension = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension = 70 [default = -50 ]; - optional float default_float_extension = 71 [default = 51.5 ]; - optional double default_double_extension = 72 [default = 52e3 ]; - optional bool default_bool_extension = 73 [default = true ]; - optional string default_string_extension = 74 [default = "hello"]; - optional bytes default_bytes_extension = 75 [default = "world"]; - - optional TestAllTypes.NestedEnum - default_nested_enum_extension = 81 [default = BAR]; - optional ForeignEnum - default_foreign_enum_extension = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum_extension = 83 [default = IMPORT_BAR]; - - optional string default_string_piece_extension = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension = 85 [ctype=CORD, default="123"]; -} - -message TestNestedExtension { - extend TestAllExtensions { - // Check for bug where string extensions declared in tested scope did not - // compile. - optional string test = 1002 [default="test"]; - } -} - -// We have separate messages for testing required fields because it's -// annoying to have to fill in required fields in TestProto in order to -// do anything with it. Note that we don't need to test every type of -// required filed because the code output is basically identical to -// optional fields for all types. -message TestRequired { - required int32 a = 1; - optional int32 dummy2 = 2; - required int32 b = 3; - - extend TestAllExtensions { - optional TestRequired single = 1000; - repeated TestRequired multi = 1001; - } - - // Pad the field count to 32 so that we can test that IsInitialized() - // properly checks multiple elements of has_bits_. - optional int32 dummy4 = 4; - optional int32 dummy5 = 5; - optional int32 dummy6 = 6; - optional int32 dummy7 = 7; - optional int32 dummy8 = 8; - optional int32 dummy9 = 9; - optional int32 dummy10 = 10; - optional int32 dummy11 = 11; - optional int32 dummy12 = 12; - optional int32 dummy13 = 13; - optional int32 dummy14 = 14; - optional int32 dummy15 = 15; - optional int32 dummy16 = 16; - optional int32 dummy17 = 17; - optional int32 dummy18 = 18; - optional int32 dummy19 = 19; - optional int32 dummy20 = 20; - optional int32 dummy21 = 21; - optional int32 dummy22 = 22; - optional int32 dummy23 = 23; - optional int32 dummy24 = 24; - optional int32 dummy25 = 25; - optional int32 dummy26 = 26; - optional int32 dummy27 = 27; - optional int32 dummy28 = 28; - optional int32 dummy29 = 29; - optional int32 dummy30 = 30; - optional int32 dummy31 = 31; - optional int32 dummy32 = 32; - - required int32 c = 33; -} - -message TestRequiredForeign { - optional TestRequired optional_message = 1; - repeated TestRequired repeated_message = 2; - optional int32 dummy = 3; -} - -// Test that we can use NestedMessage from outside TestAllTypes. -message TestForeignNested { - optional TestAllTypes.NestedMessage foreign_nested = 1; -} - -// TestEmptyMessage is used to test unknown field support. -message TestEmptyMessage { -} - -// Like above, but declare all field numbers as potential extensions. No -// actual extensions should ever be defined for this type. -message TestEmptyMessageWithExtensions { - extensions 1 to max; -} - -message TestMultipleExtensionRanges { - extensions 42; - extensions 4143 to 4243; - extensions 65536 to max; -} - -// Test that really large tag numbers don't break anything. -message TestReallyLargeTagNumber { - // The largest possible tag number is 2^28 - 1, since the wire format uses - // three bits to communicate wire type. - optional int32 a = 1; - optional int32 bb = 268435455; -} - -message TestRecursiveMessage { - optional TestRecursiveMessage a = 1; - optional int32 i = 2; -} - -// Test that mutual recursion works. -message TestMutualRecursionA { - optional TestMutualRecursionB bb = 1; -} - -message TestMutualRecursionB { - optional TestMutualRecursionA a = 1; - optional int32 optional_int32 = 2; -} - -// Test that groups have disjoint field numbers from their siblings and -// parents. This is NOT possible in proto1; only proto2. When attempting -// to compile with proto1, this will emit an error; so we only include it -// in protobuf_unittest_proto. -message TestDupFieldNumber { // NO_PROTO1 - optional int32 a = 1; // NO_PROTO1 - optional group Foo = 2 { optional int32 a = 1; } // NO_PROTO1 - optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1 -} // NO_PROTO1 - -// Additional messages for testing lazy fields. -message TestEagerMessage { - optional TestAllTypes sub_message = 1 [lazy=false]; -} -message TestLazyMessage { - optional TestAllTypes sub_message = 1 [lazy=true]; -} - -// Needed for a Python test. -message TestNestedMessageHasBits { - message NestedMessage { - repeated int32 nestedmessage_repeated_int32 = 1; - repeated ForeignMessage nestedmessage_repeated_foreignmessage = 2; - } - optional NestedMessage optional_nested_message = 1; -} - - -// Test an enum that has multiple values with the same number. -enum TestEnumWithDupValue { - option allow_alias = true; - FOO1 = 1; - BAR1 = 2; - BAZ = 3; - FOO2 = 1; - BAR2 = 2; -} - -// Test an enum with large, unordered values. -enum TestSparseEnum { - SPARSE_A = 123; - SPARSE_B = 62374; - SPARSE_C = 12589234; - SPARSE_D = -15; - SPARSE_E = -53452; - SPARSE_F = 0; - SPARSE_G = 2; -} - -// Test message with CamelCase field names. This violates Protocol Buffer -// standard style. -message TestCamelCaseFieldNames { - optional int32 PrimitiveField = 1; - optional string StringField = 2; - optional ForeignEnum EnumField = 3; - optional ForeignMessage MessageField = 4; - optional string StringPieceField = 5 [ctype=STRING_PIECE]; - optional string CordField = 6 [ctype=CORD]; - - repeated int32 RepeatedPrimitiveField = 7; - repeated string RepeatedStringField = 8; - repeated ForeignEnum RepeatedEnumField = 9; - repeated ForeignMessage RepeatedMessageField = 10; - repeated string RepeatedStringPieceField = 11 [ctype=STRING_PIECE]; - repeated string RepeatedCordField = 12 [ctype=CORD]; -} - - -// We list fields out of order, to ensure that we're using field number and not -// field index to determine serialization order. -message TestFieldOrderings { - optional string my_string = 11; - extensions 2 to 10; - optional int64 my_int = 1; - extensions 12 to 100; - optional float my_float = 101; -} - - -extend TestFieldOrderings { - optional string my_extension_string = 50; - optional int32 my_extension_int = 5; -} - - -message TestExtremeDefaultValues { - optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"]; - optional uint32 large_uint32 = 2 [default = 0xFFFFFFFF]; - optional uint64 large_uint64 = 3 [default = 0xFFFFFFFFFFFFFFFF]; - optional int32 small_int32 = 4 [default = -0x7FFFFFFF]; - optional int64 small_int64 = 5 [default = -0x7FFFFFFFFFFFFFFF]; - optional int32 really_small_int32 = 21 [default = -0x80000000]; - optional int64 really_small_int64 = 22 [default = -0x8000000000000000]; - - // The default value here is UTF-8 for "\u1234". (We could also just type - // the UTF-8 text directly into this text file rather than escape it, but - // lots of people use editors that would be confused by this.) - optional string utf8_string = 6 [default = "\341\210\264"]; - - // Tests for single-precision floating-point values. - optional float zero_float = 7 [default = 0]; - optional float one_float = 8 [default = 1]; - optional float small_float = 9 [default = 1.5]; - optional float negative_one_float = 10 [default = -1]; - optional float negative_float = 11 [default = -1.5]; - // Using exponents - optional float large_float = 12 [default = 2E8]; - optional float small_negative_float = 13 [default = -8e-28]; - - // Text for nonfinite floating-point values. - optional double inf_double = 14 [default = inf]; - optional double neg_inf_double = 15 [default = -inf]; - optional double nan_double = 16 [default = nan]; - optional float inf_float = 17 [default = inf]; - optional float neg_inf_float = 18 [default = -inf]; - optional float nan_float = 19 [default = nan]; - - // Tests for C++ trigraphs. - // Trigraphs should be escaped in C++ generated files, but they should not be - // escaped for other languages. - // Note that in .proto file, "\?" is a valid way to escape ? in string - // literals. - optional string cpp_trigraph = 20 [default = "? \? ?? \?? \??? ??/ ?\?-"]; - - // String defaults containing the character '\000' - optional string string_with_zero = 23 [default = "hel\000lo"]; - optional bytes bytes_with_zero = 24 [default = "wor\000ld"]; - optional string string_piece_with_zero = 25 [ctype=STRING_PIECE, - default="ab\000c"]; - optional string cord_with_zero = 26 [ctype=CORD, - default="12\0003"]; -} - -message SparseEnumMessage { - optional TestSparseEnum sparse_enum = 1; -} - -// Test String and Bytes: string is for valid UTF-8 strings -message OneString { - optional string data = 1; -} - -message MoreString { - repeated string data = 1; -} - -message OneBytes { - optional bytes data = 1; -} - -message MoreBytes { - repeated bytes data = 1; -} - - -// Test messages for packed fields - -message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; -} - -// A message with the same fields as TestPackedTypes, but without packing. Used -// to test packed <-> unpacked wire compatibility. -message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; -} - -message TestPackedExtensions { - extensions 1 to max; -} - -extend TestPackedExtensions { - repeated int32 packed_int32_extension = 90 [packed = true]; - repeated int64 packed_int64_extension = 91 [packed = true]; - repeated uint32 packed_uint32_extension = 92 [packed = true]; - repeated uint64 packed_uint64_extension = 93 [packed = true]; - repeated sint32 packed_sint32_extension = 94 [packed = true]; - repeated sint64 packed_sint64_extension = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension = 99 [packed = true]; - repeated float packed_float_extension = 100 [packed = true]; - repeated double packed_double_extension = 101 [packed = true]; - repeated bool packed_bool_extension = 102 [packed = true]; - repeated ForeignEnum packed_enum_extension = 103 [packed = true]; -} - -// Used by ExtensionSetTest/DynamicExtensions. The test actually builds -// a set of extensions to TestAllExtensions dynamically, based on the fields -// of this message type. -message TestDynamicExtensions { - enum DynamicEnumType { - DYNAMIC_FOO = 2200; - DYNAMIC_BAR = 2201; - DYNAMIC_BAZ = 2202; - } - message DynamicMessageType { - optional int32 dynamic_field = 2100; - } - - optional fixed32 scalar_extension = 2000; - optional ForeignEnum enum_extension = 2001; - optional DynamicEnumType dynamic_enum_extension = 2002; - - optional ForeignMessage message_extension = 2003; - optional DynamicMessageType dynamic_message_extension = 2004; - - repeated string repeated_extension = 2005; - repeated sint32 packed_extension = 2006 [packed = true]; -} - -message TestRepeatedScalarDifferentTagSizes { - // Parsing repeated fixed size values used to fail. This message needs to be - // used in order to get a tag of the right size; all of the repeated fields - // in TestAllTypes didn't trigger the check. - repeated fixed32 repeated_fixed32 = 12; - // Check for a varint type, just for good measure. - repeated int32 repeated_int32 = 13; - - // These have two-byte tags. - repeated fixed64 repeated_fixed64 = 2046; - repeated int64 repeated_int64 = 2047; - - // Three byte tags. - repeated float repeated_float = 262142; - repeated uint64 repeated_uint64 = 262143; -} - -// Test that if an optional or required message/group field appears multiple -// times in the input, they need to be merged. -message TestParsingMerge { - // RepeatedFieldsGenerator defines matching field types as TestParsingMerge, - // except that all fields are repeated. In the tests, we will serialize the - // RepeatedFieldsGenerator to bytes, and parse the bytes to TestParsingMerge. - // Repeated fields in RepeatedFieldsGenerator are expected to be merged into - // the corresponding required/optional fields in TestParsingMerge. - message RepeatedFieldsGenerator { - repeated TestAllTypes field1 = 1; - repeated TestAllTypes field2 = 2; - repeated TestAllTypes field3 = 3; - repeated group Group1 = 10 { - optional TestAllTypes field1 = 11; - } - repeated group Group2 = 20 { - optional TestAllTypes field1 = 21; - } - repeated TestAllTypes ext1 = 1000; - repeated TestAllTypes ext2 = 1001; - } - required TestAllTypes required_all_types = 1; - optional TestAllTypes optional_all_types = 2; - repeated TestAllTypes repeated_all_types = 3; - optional group OptionalGroup = 10 { - optional TestAllTypes optional_group_all_types = 11; - } - repeated group RepeatedGroup = 20 { - optional TestAllTypes repeated_group_all_types = 21; - } - extensions 1000 to max; - extend TestParsingMerge { - optional TestAllTypes optional_ext = 1000; - repeated TestAllTypes repeated_ext = 1001; - } -} - -message TestCommentInjectionMessage { - // */ <- This should not close the generated doc comment - optional string a = 1 [default="*/ <- Neither should this."]; -} - - -// Test that RPC services work. -message FooRequest {} -message FooResponse {} - -message FooClientMessage {} -message FooServerMessage{} - -service TestService { - rpc Foo(FooRequest) returns (FooResponse); - rpc Bar(BarRequest) returns (BarResponse); -} - - -message BarRequest {} -message BarResponse {} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_custom_options.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_custom_options.proto deleted file mode 100644 index 2f4e3fdf95c429470376a1cb4b96377a159543d0..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_custom_options.proto +++ /dev/null @@ -1,387 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: benjy@google.com (Benjy Weinberger) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file used to test the "custom options" feature of proto2. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; - -// A custom file option (defined below). -option (file_opt1) = 9876543210; - -import "google/protobuf/descriptor.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - - -// Some simple test custom options of various types. - -extend google.protobuf.FileOptions { - optional uint64 file_opt1 = 7736974; -} - -extend google.protobuf.MessageOptions { - optional int32 message_opt1 = 7739036; -} - -extend google.protobuf.FieldOptions { - optional fixed64 field_opt1 = 7740936; - // This is useful for testing that we correctly register default values for - // extension options. - optional int32 field_opt2 = 7753913 [default=42]; -} - -extend google.protobuf.EnumOptions { - optional sfixed32 enum_opt1 = 7753576; -} - -extend google.protobuf.EnumValueOptions { - optional int32 enum_value_opt1 = 1560678; -} - -extend google.protobuf.ServiceOptions { - optional sint64 service_opt1 = 7887650; -} - -enum MethodOpt1 { - METHODOPT1_VAL1 = 1; - METHODOPT1_VAL2 = 2; -} - -extend google.protobuf.MethodOptions { - optional MethodOpt1 method_opt1 = 7890860; -} - -// A test message with custom options at all possible locations (and also some -// regular options, to make sure they interact nicely). -message TestMessageWithCustomOptions { - option message_set_wire_format = false; - - option (message_opt1) = -56; - - optional string field1 = 1 [ctype=CORD, - (field_opt1)=8765432109]; - - enum AnEnum { - option (enum_opt1) = -789; - - ANENUM_VAL1 = 1; - ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; - } -} - - -// A test RPC service with custom options at all possible locations (and also -// some regular options, to make sure they interact nicely). -message CustomOptionFooRequest { -} - -message CustomOptionFooResponse { -} - -message CustomOptionFooClientMessage { -} - -message CustomOptionFooServerMessage { -} - -service TestServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - - - -// Options of every possible field type, so we can test them all exhaustively. - -message DummyMessageContainingEnum { - enum TestEnumType { - TEST_OPTION_ENUM_TYPE1 = 22; - TEST_OPTION_ENUM_TYPE2 = -23; - } -} - -message DummyMessageInvalidAsOptionType { -} - -extend google.protobuf.MessageOptions { - optional bool bool_opt = 7706090; - optional int32 int32_opt = 7705709; - optional int64 int64_opt = 7705542; - optional uint32 uint32_opt = 7704880; - optional uint64 uint64_opt = 7702367; - optional sint32 sint32_opt = 7701568; - optional sint64 sint64_opt = 7700863; - optional fixed32 fixed32_opt = 7700307; - optional fixed64 fixed64_opt = 7700194; - optional sfixed32 sfixed32_opt = 7698645; - optional sfixed64 sfixed64_opt = 7685475; - optional float float_opt = 7675390; - optional double double_opt = 7673293; - optional string string_opt = 7673285; - optional bytes bytes_opt = 7673238; - optional DummyMessageContainingEnum.TestEnumType enum_opt = 7673233; - optional DummyMessageInvalidAsOptionType message_type_opt = 7665967; -} - -message CustomOptionMinIntegerValues { - option (bool_opt) = false; - option (int32_opt) = -0x80000000; - option (int64_opt) = -0x8000000000000000; - option (uint32_opt) = 0; - option (uint64_opt) = 0; - option (sint32_opt) = -0x80000000; - option (sint64_opt) = -0x8000000000000000; - option (fixed32_opt) = 0; - option (fixed64_opt) = 0; - option (sfixed32_opt) = -0x80000000; - option (sfixed64_opt) = -0x8000000000000000; -} - -message CustomOptionMaxIntegerValues { - option (bool_opt) = true; - option (int32_opt) = 0x7FFFFFFF; - option (int64_opt) = 0x7FFFFFFFFFFFFFFF; - option (uint32_opt) = 0xFFFFFFFF; - option (uint64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sint32_opt) = 0x7FFFFFFF; - option (sint64_opt) = 0x7FFFFFFFFFFFFFFF; - option (fixed32_opt) = 0xFFFFFFFF; - option (fixed64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sfixed32_opt) = 0x7FFFFFFF; - option (sfixed64_opt) = 0x7FFFFFFFFFFFFFFF; -} - -message CustomOptionOtherValues { - option (int32_opt) = -100; // To test sign-extension. - option (float_opt) = 12.3456789; - option (double_opt) = 1.234567890123456789; - option (string_opt) = "Hello, \"World\""; - option (bytes_opt) = "Hello\0World"; - option (enum_opt) = TEST_OPTION_ENUM_TYPE2; -} - -message SettingRealsFromPositiveInts { - option (float_opt) = 12; - option (double_opt) = 154; -} - -message SettingRealsFromNegativeInts { - option (float_opt) = -12; - option (double_opt) = -154; -} - -// Options of complex message types, themselves combined and extended in -// various ways. - -message ComplexOptionType1 { - optional int32 foo = 1; - optional int32 foo2 = 2; - optional int32 foo3 = 3; - - extensions 100 to max; -} - -message ComplexOptionType2 { - optional ComplexOptionType1 bar = 1; - optional int32 baz = 2; - - message ComplexOptionType4 { - optional int32 waldo = 1; - - extend google.protobuf.MessageOptions { - optional ComplexOptionType4 complex_opt4 = 7633546; - } - } - - optional ComplexOptionType4 fred = 3; - - extensions 100 to max; -} - -message ComplexOptionType3 { - optional int32 qux = 1; - - optional group ComplexOptionType5 = 2 { - optional int32 plugh = 3; - } -} - -extend ComplexOptionType1 { - optional int32 quux = 7663707; - optional ComplexOptionType3 corge = 7663442; -} - -extend ComplexOptionType2 { - optional int32 grault = 7650927; - optional ComplexOptionType1 garply = 7649992; -} - -extend google.protobuf.MessageOptions { - optional protobuf_unittest.ComplexOptionType1 complex_opt1 = 7646756; - optional ComplexOptionType2 complex_opt2 = 7636949; - optional ComplexOptionType3 complex_opt3 = 7636463; - optional group ComplexOpt6 = 7595468 { - optional int32 xyzzy = 7593951; - } -} - -// Note that we try various different ways of naming the same extension. -message VariousComplexOptions { - option (.protobuf_unittest.complex_opt1).foo = 42; - option (protobuf_unittest.complex_opt1).(.protobuf_unittest.quux) = 324; - option (.protobuf_unittest.complex_opt1).(protobuf_unittest.corge).qux = 876; - option (complex_opt2).baz = 987; - option (complex_opt2).(grault) = 654; - option (complex_opt2).bar.foo = 743; - option (complex_opt2).bar.(quux) = 1999; - option (complex_opt2).bar.(protobuf_unittest.corge).qux = 2008; - option (complex_opt2).(garply).foo = 741; - option (complex_opt2).(garply).(.protobuf_unittest.quux) = 1998; - option (complex_opt2).(protobuf_unittest.garply).(corge).qux = 2121; - option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971; - option (complex_opt2).fred.waldo = 321; - option (protobuf_unittest.complex_opt3).qux = 9; - option (complex_opt3).complexoptiontype5.plugh = 22; - option (complexopt6).xyzzy = 24; -} - -// ------------------------------------------------------ -// Definitions for testing aggregate option parsing. -// See descriptor_unittest.cc. - -message AggregateMessageSet { - option message_set_wire_format = true; - extensions 4 to max; -} - -message AggregateMessageSetElement { - extend AggregateMessageSet { - optional AggregateMessageSetElement message_set_extension = 15447542; - } - optional string s = 1; -} - -// A helper type used to test aggregate option parsing -message Aggregate { - optional int32 i = 1; - optional string s = 2; - - // A nested object - optional Aggregate sub = 3; - - // To test the parsing of extensions inside aggregate values - optional google.protobuf.FileOptions file = 4; - extend google.protobuf.FileOptions { - optional Aggregate nested = 15476903; - } - - // An embedded message set - optional AggregateMessageSet mset = 5; -} - -// Allow Aggregate to be used as an option at all possible locations -// in the .proto grammar. -extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; } -extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; } -extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; } -extend google.protobuf.EnumOptions { optional Aggregate enumopt = 15483218; } -extend google.protobuf.EnumValueOptions { optional Aggregate enumvalopt = 15486921; } -extend google.protobuf.ServiceOptions { optional Aggregate serviceopt = 15497145; } -extend google.protobuf.MethodOptions { optional Aggregate methodopt = 15512713; } - -// Try using AggregateOption at different points in the proto grammar -option (fileopt) = { - s: 'FileAnnotation' - // Also test the handling of comments - /* of both types */ i: 100 - - sub { s: 'NestedFileAnnotation' } - - // Include a google.protobuf.FileOptions and recursively extend it with - // another fileopt. - file { - [protobuf_unittest.fileopt] { - s:'FileExtensionAnnotation' - } - } - - // A message set inside an option value - mset { - [protobuf_unittest.AggregateMessageSetElement.message_set_extension] { - s: 'EmbeddedMessageSetElement' - } - } -}; - -message AggregateMessage { - option (msgopt) = { i:101 s:'MessageAnnotation' }; - optional int32 fieldname = 1 [(fieldopt) = { s:'FieldAnnotation' }]; -} - -service AggregateService { - option (serviceopt) = { s:'ServiceAnnotation' }; - rpc Method (AggregateMessage) returns (AggregateMessage) { - option (methodopt) = { s:'MethodAnnotation' }; - } -} - -enum AggregateEnum { - option (enumopt) = { s:'EnumAnnotation' }; - VALUE = 1 [(enumvalopt) = { s:'EnumValueAnnotation' }]; -} - -// Test custom options for nested type. -message NestedOptionType { - message NestedMessage { - option (message_opt1) = 1001; - optional int32 nested_field = 1 [(field_opt1) = 1002]; - } - enum NestedEnum { - option (enum_opt1) = 1003; - NESTED_ENUM_VALUE = 1 [(enum_value_opt1) = 1004]; - } - extend google.protobuf.FileOptions { - optional int32 nested_extension = 7912573 [(field_opt2) = 1005]; - } -} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto deleted file mode 100644 index fa1762594e8960814d5ad052ded3a5b9520d4f6d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto +++ /dev/null @@ -1,50 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which imports a proto file that uses optimize_for = CODE_SIZE. - -import "google/protobuf/unittest_optimize_for.proto"; - -package protobuf_unittest; - -// We optimize for speed here, but we are importing a proto that is optimized -// for code size. -option optimize_for = SPEED; - -message TestEmbedOptimizedForSize { - // Test that embedding a message which has optimize_for = CODE_SIZE into - // one optimized for speed works. - optional TestOptimizedForSize optional_message = 1; - repeated TestOptimizedForSize repeated_message = 2; -} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_enormous_descriptor.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_enormous_descriptor.proto deleted file mode 100644 index bc0b7c16a0d4f211fc349abc729351834ca43dbd..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_enormous_descriptor.proto +++ /dev/null @@ -1,1046 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file that has an extremely large descriptor. Used to test that -// descriptors over 64k don't break the string literal length limit in Java. - - -package google.protobuf; -option java_package = "com.google.protobuf"; - -// Avoid generating insanely long methods. -option optimize_for = CODE_SIZE; - -message TestEnormousDescriptor { - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1 = 1 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_2 = 2 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_3 = 3 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_4 = 4 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_5 = 5 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_6 = 6 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_7 = 7 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_8 = 8 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_9 = 9 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_10 = 10 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_11 = 11 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_12 = 12 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_13 = 13 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_14 = 14 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_15 = 15 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_16 = 16 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_17 = 17 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_18 = 18 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_19 = 19 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_20 = 20 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_21 = 21 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_22 = 22 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_23 = 23 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_24 = 24 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_25 = 25 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_26 = 26 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_27 = 27 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_28 = 28 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_29 = 29 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_30 = 30 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_31 = 31 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_32 = 32 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_33 = 33 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_34 = 34 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_35 = 35 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_36 = 36 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_37 = 37 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_38 = 38 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_39 = 39 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_40 = 40 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_41 = 41 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_42 = 42 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_43 = 43 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_44 = 44 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_45 = 45 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_46 = 46 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_47 = 47 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_48 = 48 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_49 = 49 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_50 = 50 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_51 = 51 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_52 = 52 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_53 = 53 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_54 = 54 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_55 = 55 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_56 = 56 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_57 = 57 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_58 = 58 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_59 = 59 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_60 = 60 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_61 = 61 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_62 = 62 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_63 = 63 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_64 = 64 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_65 = 65 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_66 = 66 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_67 = 67 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_68 = 68 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_69 = 69 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_70 = 70 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_71 = 71 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_72 = 72 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_73 = 73 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_74 = 74 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_75 = 75 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_76 = 76 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_77 = 77 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_78 = 78 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_79 = 79 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_80 = 80 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_81 = 81 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_82 = 82 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_83 = 83 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_84 = 84 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_85 = 85 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_86 = 86 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_87 = 87 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_88 = 88 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_89 = 89 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_90 = 90 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_91 = 91 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_92 = 92 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_93 = 93 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_94 = 94 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_95 = 95 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_96 = 96 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_97 = 97 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_98 = 98 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_99 = 99 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_100 = 100 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_101 = 101 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_102 = 102 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_103 = 103 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_104 = 104 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_105 = 105 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_106 = 106 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_107 = 107 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_108 = 108 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_109 = 109 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_110 = 110 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_111 = 111 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_112 = 112 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_113 = 113 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_114 = 114 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_115 = 115 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_116 = 116 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_117 = 117 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_118 = 118 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_119 = 119 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_120 = 120 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_121 = 121 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_122 = 122 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_123 = 123 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_124 = 124 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_125 = 125 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_126 = 126 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_127 = 127 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_128 = 128 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_129 = 129 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_130 = 130 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_131 = 131 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_132 = 132 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_133 = 133 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_134 = 134 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_135 = 135 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_136 = 136 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_137 = 137 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_138 = 138 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_139 = 139 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_140 = 140 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_141 = 141 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_142 = 142 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_143 = 143 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_144 = 144 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_145 = 145 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_146 = 146 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_147 = 147 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_148 = 148 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_149 = 149 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_150 = 150 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_151 = 151 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_152 = 152 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_153 = 153 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_154 = 154 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_155 = 155 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_156 = 156 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_157 = 157 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_158 = 158 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_159 = 159 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_160 = 160 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_161 = 161 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_162 = 162 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_163 = 163 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_164 = 164 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_165 = 165 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_166 = 166 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_167 = 167 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_168 = 168 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_169 = 169 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_170 = 170 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_171 = 171 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_172 = 172 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_173 = 173 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_174 = 174 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_175 = 175 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_176 = 176 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_177 = 177 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_178 = 178 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_179 = 179 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_180 = 180 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_181 = 181 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_182 = 182 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_183 = 183 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_184 = 184 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_185 = 185 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_186 = 186 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_187 = 187 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_188 = 188 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_189 = 189 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_190 = 190 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_191 = 191 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_192 = 192 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_193 = 193 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_194 = 194 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_195 = 195 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_196 = 196 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_197 = 197 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_198 = 198 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_199 = 199 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_200 = 200 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_201 = 201 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_202 = 202 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_203 = 203 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_204 = 204 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_205 = 205 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_206 = 206 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_207 = 207 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_208 = 208 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_209 = 209 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_210 = 210 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_211 = 211 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_212 = 212 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_213 = 213 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_214 = 214 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_215 = 215 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_216 = 216 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_217 = 217 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_218 = 218 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_219 = 219 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_220 = 220 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_221 = 221 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_222 = 222 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_223 = 223 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_224 = 224 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_225 = 225 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_226 = 226 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_227 = 227 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_228 = 228 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_229 = 229 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_230 = 230 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_231 = 231 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_232 = 232 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_233 = 233 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_234 = 234 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_235 = 235 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_236 = 236 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_237 = 237 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_238 = 238 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_239 = 239 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_240 = 240 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_241 = 241 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_242 = 242 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_243 = 243 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_244 = 244 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_245 = 245 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_246 = 246 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_247 = 247 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_248 = 248 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_249 = 249 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_250 = 250 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_251 = 251 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_252 = 252 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_253 = 253 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_254 = 254 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_255 = 255 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_256 = 256 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_257 = 257 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_258 = 258 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_259 = 259 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_260 = 260 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_261 = 261 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_262 = 262 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_263 = 263 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_264 = 264 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_265 = 265 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_266 = 266 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_267 = 267 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_268 = 268 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_269 = 269 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_270 = 270 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_271 = 271 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_272 = 272 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_273 = 273 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_274 = 274 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_275 = 275 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_276 = 276 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_277 = 277 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_278 = 278 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_279 = 279 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_280 = 280 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_281 = 281 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_282 = 282 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_283 = 283 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_284 = 284 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_285 = 285 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_286 = 286 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_287 = 287 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_288 = 288 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_289 = 289 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_290 = 290 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_291 = 291 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_292 = 292 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_293 = 293 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_294 = 294 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_295 = 295 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_296 = 296 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_297 = 297 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_298 = 298 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_299 = 299 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_300 = 300 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_301 = 301 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_302 = 302 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_303 = 303 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_304 = 304 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_305 = 305 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_306 = 306 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_307 = 307 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_308 = 308 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_309 = 309 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_310 = 310 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_311 = 311 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_312 = 312 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_313 = 313 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_314 = 314 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_315 = 315 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_316 = 316 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_317 = 317 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_318 = 318 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_319 = 319 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_320 = 320 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_321 = 321 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_322 = 322 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_323 = 323 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_324 = 324 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_325 = 325 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_326 = 326 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_327 = 327 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_328 = 328 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_329 = 329 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_330 = 330 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_331 = 331 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_332 = 332 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_333 = 333 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_334 = 334 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_335 = 335 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_336 = 336 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_337 = 337 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_338 = 338 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_339 = 339 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_340 = 340 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_341 = 341 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_342 = 342 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_343 = 343 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_344 = 344 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_345 = 345 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_346 = 346 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_347 = 347 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_348 = 348 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_349 = 349 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_350 = 350 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_351 = 351 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_352 = 352 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_353 = 353 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_354 = 354 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_355 = 355 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_356 = 356 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_357 = 357 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_358 = 358 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_359 = 359 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_360 = 360 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_361 = 361 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_362 = 362 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_363 = 363 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_364 = 364 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_365 = 365 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_366 = 366 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_367 = 367 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_368 = 368 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_369 = 369 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_370 = 370 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_371 = 371 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_372 = 372 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_373 = 373 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_374 = 374 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_375 = 375 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_376 = 376 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_377 = 377 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_378 = 378 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_379 = 379 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_380 = 380 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_381 = 381 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_382 = 382 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_383 = 383 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_384 = 384 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_385 = 385 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_386 = 386 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_387 = 387 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_388 = 388 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_389 = 389 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_390 = 390 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_391 = 391 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_392 = 392 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_393 = 393 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_394 = 394 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_395 = 395 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_396 = 396 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_397 = 397 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_398 = 398 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_399 = 399 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_400 = 400 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_401 = 401 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_402 = 402 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_403 = 403 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_404 = 404 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_405 = 405 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_406 = 406 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_407 = 407 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_408 = 408 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_409 = 409 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_410 = 410 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_411 = 411 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_412 = 412 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_413 = 413 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_414 = 414 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_415 = 415 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_416 = 416 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_417 = 417 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_418 = 418 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_419 = 419 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_420 = 420 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_421 = 421 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_422 = 422 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_423 = 423 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_424 = 424 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_425 = 425 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_426 = 426 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_427 = 427 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_428 = 428 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_429 = 429 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_430 = 430 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_431 = 431 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_432 = 432 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_433 = 433 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_434 = 434 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_435 = 435 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_436 = 436 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_437 = 437 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_438 = 438 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_439 = 439 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_440 = 440 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_441 = 441 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_442 = 442 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_443 = 443 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_444 = 444 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_445 = 445 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_446 = 446 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_447 = 447 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_448 = 448 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_449 = 449 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_450 = 450 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_451 = 451 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_452 = 452 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_453 = 453 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_454 = 454 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_455 = 455 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_456 = 456 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_457 = 457 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_458 = 458 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_459 = 459 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_460 = 460 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_461 = 461 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_462 = 462 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_463 = 463 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_464 = 464 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_465 = 465 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_466 = 466 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_467 = 467 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_468 = 468 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_469 = 469 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_470 = 470 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_471 = 471 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_472 = 472 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_473 = 473 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_474 = 474 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_475 = 475 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_476 = 476 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_477 = 477 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_478 = 478 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_479 = 479 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_480 = 480 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_481 = 481 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_482 = 482 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_483 = 483 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_484 = 484 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_485 = 485 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_486 = 486 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_487 = 487 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_488 = 488 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_489 = 489 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_490 = 490 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_491 = 491 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_492 = 492 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_493 = 493 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_494 = 494 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_495 = 495 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_496 = 496 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_497 = 497 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_498 = 498 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_499 = 499 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_500 = 500 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_501 = 501 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_502 = 502 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_503 = 503 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_504 = 504 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_505 = 505 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_506 = 506 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_507 = 507 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_508 = 508 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_509 = 509 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_510 = 510 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_511 = 511 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_512 = 512 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_513 = 513 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_514 = 514 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_515 = 515 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_516 = 516 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_517 = 517 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_518 = 518 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_519 = 519 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_520 = 520 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_521 = 521 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_522 = 522 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_523 = 523 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_524 = 524 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_525 = 525 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_526 = 526 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_527 = 527 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_528 = 528 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_529 = 529 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_530 = 530 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_531 = 531 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_532 = 532 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_533 = 533 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_534 = 534 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_535 = 535 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_536 = 536 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_537 = 537 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_538 = 538 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_539 = 539 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_540 = 540 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_541 = 541 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_542 = 542 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_543 = 543 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_544 = 544 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_545 = 545 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_546 = 546 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_547 = 547 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_548 = 548 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_549 = 549 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_550 = 550 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_551 = 551 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_552 = 552 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_553 = 553 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_554 = 554 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_555 = 555 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_556 = 556 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_557 = 557 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_558 = 558 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_559 = 559 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_560 = 560 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_561 = 561 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_562 = 562 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_563 = 563 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_564 = 564 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_565 = 565 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_566 = 566 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_567 = 567 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_568 = 568 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_569 = 569 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_570 = 570 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_571 = 571 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_572 = 572 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_573 = 573 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_574 = 574 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_575 = 575 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_576 = 576 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_577 = 577 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_578 = 578 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_579 = 579 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_580 = 580 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_581 = 581 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_582 = 582 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_583 = 583 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_584 = 584 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_585 = 585 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_586 = 586 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_587 = 587 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_588 = 588 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_589 = 589 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_590 = 590 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_591 = 591 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_592 = 592 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_593 = 593 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_594 = 594 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_595 = 595 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_596 = 596 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_597 = 597 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_598 = 598 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_599 = 599 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_600 = 600 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_601 = 601 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_602 = 602 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_603 = 603 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_604 = 604 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_605 = 605 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_606 = 606 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_607 = 607 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_608 = 608 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_609 = 609 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_610 = 610 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_611 = 611 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_612 = 612 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_613 = 613 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_614 = 614 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_615 = 615 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_616 = 616 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_617 = 617 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_618 = 618 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_619 = 619 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_620 = 620 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_621 = 621 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_622 = 622 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_623 = 623 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_624 = 624 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_625 = 625 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_626 = 626 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_627 = 627 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_628 = 628 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_629 = 629 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_630 = 630 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_631 = 631 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_632 = 632 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_633 = 633 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_634 = 634 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_635 = 635 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_636 = 636 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_637 = 637 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_638 = 638 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_639 = 639 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_640 = 640 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_641 = 641 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_642 = 642 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_643 = 643 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_644 = 644 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_645 = 645 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_646 = 646 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_647 = 647 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_648 = 648 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_649 = 649 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_650 = 650 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_651 = 651 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_652 = 652 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_653 = 653 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_654 = 654 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_655 = 655 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_656 = 656 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_657 = 657 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_658 = 658 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_659 = 659 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_660 = 660 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_661 = 661 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_662 = 662 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_663 = 663 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_664 = 664 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_665 = 665 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_666 = 666 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_667 = 667 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_668 = 668 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_669 = 669 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_670 = 670 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_671 = 671 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_672 = 672 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_673 = 673 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_674 = 674 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_675 = 675 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_676 = 676 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_677 = 677 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_678 = 678 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_679 = 679 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_680 = 680 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_681 = 681 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_682 = 682 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_683 = 683 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_684 = 684 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_685 = 685 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_686 = 686 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_687 = 687 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_688 = 688 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_689 = 689 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_690 = 690 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_691 = 691 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_692 = 692 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_693 = 693 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_694 = 694 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_695 = 695 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_696 = 696 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_697 = 697 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_698 = 698 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_699 = 699 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_700 = 700 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_701 = 701 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_702 = 702 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_703 = 703 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_704 = 704 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_705 = 705 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_706 = 706 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_707 = 707 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_708 = 708 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_709 = 709 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_710 = 710 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_711 = 711 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_712 = 712 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_713 = 713 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_714 = 714 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_715 = 715 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_716 = 716 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_717 = 717 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_718 = 718 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_719 = 719 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_720 = 720 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_721 = 721 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_722 = 722 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_723 = 723 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_724 = 724 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_725 = 725 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_726 = 726 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_727 = 727 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_728 = 728 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_729 = 729 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_730 = 730 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_731 = 731 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_732 = 732 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_733 = 733 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_734 = 734 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_735 = 735 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_736 = 736 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_737 = 737 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_738 = 738 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_739 = 739 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_740 = 740 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_741 = 741 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_742 = 742 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_743 = 743 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_744 = 744 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_745 = 745 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_746 = 746 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_747 = 747 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_748 = 748 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_749 = 749 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_750 = 750 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_751 = 751 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_752 = 752 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_753 = 753 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_754 = 754 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_755 = 755 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_756 = 756 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_757 = 757 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_758 = 758 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_759 = 759 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_760 = 760 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_761 = 761 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_762 = 762 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_763 = 763 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_764 = 764 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_765 = 765 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_766 = 766 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_767 = 767 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_768 = 768 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_769 = 769 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_770 = 770 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_771 = 771 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_772 = 772 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_773 = 773 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_774 = 774 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_775 = 775 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_776 = 776 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_777 = 777 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_778 = 778 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_779 = 779 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_780 = 780 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_781 = 781 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_782 = 782 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_783 = 783 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_784 = 784 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_785 = 785 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_786 = 786 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_787 = 787 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_788 = 788 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_789 = 789 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_790 = 790 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_791 = 791 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_792 = 792 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_793 = 793 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_794 = 794 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_795 = 795 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_796 = 796 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_797 = 797 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_798 = 798 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_799 = 799 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_800 = 800 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_801 = 801 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_802 = 802 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_803 = 803 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_804 = 804 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_805 = 805 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_806 = 806 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_807 = 807 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_808 = 808 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_809 = 809 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_810 = 810 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_811 = 811 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_812 = 812 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_813 = 813 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_814 = 814 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_815 = 815 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_816 = 816 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_817 = 817 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_818 = 818 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_819 = 819 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_820 = 820 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_821 = 821 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_822 = 822 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_823 = 823 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_824 = 824 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_825 = 825 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_826 = 826 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_827 = 827 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_828 = 828 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_829 = 829 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_830 = 830 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_831 = 831 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_832 = 832 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_833 = 833 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_834 = 834 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_835 = 835 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_836 = 836 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_837 = 837 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_838 = 838 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_839 = 839 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_840 = 840 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_841 = 841 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_842 = 842 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_843 = 843 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_844 = 844 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_845 = 845 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_846 = 846 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_847 = 847 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_848 = 848 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_849 = 849 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_850 = 850 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_851 = 851 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_852 = 852 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_853 = 853 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_854 = 854 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_855 = 855 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_856 = 856 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_857 = 857 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_858 = 858 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_859 = 859 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_860 = 860 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_861 = 861 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_862 = 862 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_863 = 863 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_864 = 864 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_865 = 865 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_866 = 866 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_867 = 867 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_868 = 868 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_869 = 869 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_870 = 870 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_871 = 871 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_872 = 872 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_873 = 873 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_874 = 874 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_875 = 875 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_876 = 876 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_877 = 877 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_878 = 878 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_879 = 879 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_880 = 880 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_881 = 881 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_882 = 882 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_883 = 883 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_884 = 884 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_885 = 885 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_886 = 886 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_887 = 887 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_888 = 888 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_889 = 889 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_890 = 890 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_891 = 891 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_892 = 892 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_893 = 893 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_894 = 894 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_895 = 895 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_896 = 896 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_897 = 897 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_898 = 898 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_899 = 899 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_900 = 900 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_901 = 901 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_902 = 902 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_903 = 903 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_904 = 904 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_905 = 905 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_906 = 906 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_907 = 907 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_908 = 908 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_909 = 909 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_910 = 910 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_911 = 911 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_912 = 912 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_913 = 913 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_914 = 914 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_915 = 915 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_916 = 916 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_917 = 917 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_918 = 918 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_919 = 919 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_920 = 920 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_921 = 921 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_922 = 922 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_923 = 923 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_924 = 924 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_925 = 925 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_926 = 926 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_927 = 927 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_928 = 928 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_929 = 929 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_930 = 930 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_931 = 931 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_932 = 932 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_933 = 933 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_934 = 934 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_935 = 935 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_936 = 936 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_937 = 937 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_938 = 938 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_939 = 939 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_940 = 940 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_941 = 941 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_942 = 942 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_943 = 943 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_944 = 944 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_945 = 945 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_946 = 946 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_947 = 947 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_948 = 948 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_949 = 949 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_950 = 950 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_951 = 951 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_952 = 952 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_953 = 953 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_954 = 954 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_955 = 955 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_956 = 956 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_957 = 957 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_958 = 958 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_959 = 959 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_960 = 960 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_961 = 961 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_962 = 962 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_963 = 963 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_964 = 964 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_965 = 965 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_966 = 966 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_967 = 967 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_968 = 968 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_969 = 969 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_970 = 970 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_971 = 971 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_972 = 972 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_973 = 973 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_974 = 974 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_975 = 975 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_976 = 976 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_977 = 977 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_978 = 978 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_979 = 979 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_980 = 980 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_981 = 981 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_982 = 982 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_983 = 983 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_984 = 984 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_985 = 985 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_986 = 986 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_987 = 987 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_988 = 988 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_989 = 989 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_990 = 990 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_991 = 991 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_992 = 992 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_993 = 993 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_994 = 994 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_995 = 995 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_996 = 996 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_997 = 997 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_998 = 998 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_999 = 999 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000 = 1000 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; -} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_lite.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_lite.proto deleted file mode 100644 index a1764aac8dbdaca6982e8eac11794440aac3a63a..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_lite.proto +++ /dev/null @@ -1,360 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest.proto but with optimize_for = LITE_RUNTIME. - -package protobuf_unittest; - -import "google/protobuf/unittest_import_lite.proto"; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -// Same as TestAllTypes but with the lite runtime. -message TestAllTypesLite { - message NestedMessage { - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessageLite optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnumLite optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Defined in unittest_import_public.proto - optional protobuf_unittest_import.PublicImportMessageLite - optional_public_import_message = 26; - - optional NestedMessage optional_lazy_message = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessageLite repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnumLite repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR]; - optional ForeignEnumLite default_foreign_enum = 82 - [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message ForeignMessageLite { - optional int32 c = 1; -} - -enum ForeignEnumLite { - FOREIGN_LITE_FOO = 4; - FOREIGN_LITE_BAR = 5; - FOREIGN_LITE_BAZ = 6; -} - -message TestPackedTypesLite { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnumLite packed_enum = 103 [packed = true]; -} - -message TestAllExtensionsLite { - extensions 1 to max; -} - -extend TestAllExtensionsLite { - // Singular - optional int32 optional_int32_extension_lite = 1; - optional int64 optional_int64_extension_lite = 2; - optional uint32 optional_uint32_extension_lite = 3; - optional uint64 optional_uint64_extension_lite = 4; - optional sint32 optional_sint32_extension_lite = 5; - optional sint64 optional_sint64_extension_lite = 6; - optional fixed32 optional_fixed32_extension_lite = 7; - optional fixed64 optional_fixed64_extension_lite = 8; - optional sfixed32 optional_sfixed32_extension_lite = 9; - optional sfixed64 optional_sfixed64_extension_lite = 10; - optional float optional_float_extension_lite = 11; - optional double optional_double_extension_lite = 12; - optional bool optional_bool_extension_lite = 13; - optional string optional_string_extension_lite = 14; - optional bytes optional_bytes_extension_lite = 15; - - optional group OptionalGroup_extension_lite = 16 { - optional int32 a = 17; - } - - optional TestAllTypesLite.NestedMessage optional_nested_message_extension_lite - = 18; - optional ForeignMessageLite optional_foreign_message_extension_lite = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message_extension_lite = 20; - - optional TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; - optional ForeignEnumLite optional_foreign_enum_extension_lite = 22; - optional protobuf_unittest_import.ImportEnumLite - optional_import_enum_extension_lite = 23; - - optional string optional_string_piece_extension_lite = 24 - [ctype=STRING_PIECE]; - optional string optional_cord_extension_lite = 25 [ctype=CORD]; - - optional protobuf_unittest_import.PublicImportMessageLite - optional_public_import_message_extension_lite = 26; - - optional TestAllTypesLite.NestedMessage - optional_lazy_message_extension_lite = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32_extension_lite = 31; - repeated int64 repeated_int64_extension_lite = 32; - repeated uint32 repeated_uint32_extension_lite = 33; - repeated uint64 repeated_uint64_extension_lite = 34; - repeated sint32 repeated_sint32_extension_lite = 35; - repeated sint64 repeated_sint64_extension_lite = 36; - repeated fixed32 repeated_fixed32_extension_lite = 37; - repeated fixed64 repeated_fixed64_extension_lite = 38; - repeated sfixed32 repeated_sfixed32_extension_lite = 39; - repeated sfixed64 repeated_sfixed64_extension_lite = 40; - repeated float repeated_float_extension_lite = 41; - repeated double repeated_double_extension_lite = 42; - repeated bool repeated_bool_extension_lite = 43; - repeated string repeated_string_extension_lite = 44; - repeated bytes repeated_bytes_extension_lite = 45; - - repeated group RepeatedGroup_extension_lite = 46 { - optional int32 a = 47; - } - - repeated TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite - = 48; - repeated ForeignMessageLite repeated_foreign_message_extension_lite = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message_extension_lite = 50; - - repeated TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; - repeated ForeignEnumLite repeated_foreign_enum_extension_lite = 52; - repeated protobuf_unittest_import.ImportEnumLite - repeated_import_enum_extension_lite = 53; - - repeated string repeated_string_piece_extension_lite = 54 - [ctype=STRING_PIECE]; - repeated string repeated_cord_extension_lite = 55 [ctype=CORD]; - - repeated TestAllTypesLite.NestedMessage - repeated_lazy_message_extension_lite = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32_extension_lite = 61 [default = 41 ]; - optional int64 default_int64_extension_lite = 62 [default = 42 ]; - optional uint32 default_uint32_extension_lite = 63 [default = 43 ]; - optional uint64 default_uint64_extension_lite = 64 [default = 44 ]; - optional sint32 default_sint32_extension_lite = 65 [default = -45 ]; - optional sint64 default_sint64_extension_lite = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension_lite = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension_lite = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50 ]; - optional float default_float_extension_lite = 71 [default = 51.5 ]; - optional double default_double_extension_lite = 72 [default = 52e3 ]; - optional bool default_bool_extension_lite = 73 [default = true ]; - optional string default_string_extension_lite = 74 [default = "hello"]; - optional bytes default_bytes_extension_lite = 75 [default = "world"]; - - optional TestAllTypesLite.NestedEnum - default_nested_enum_extension_lite = 81 [default = BAR]; - optional ForeignEnumLite - default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece_extension_lite = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension_lite = 85 [ctype=CORD, default="123"]; -} - -message TestPackedExtensionsLite { - extensions 1 to max; -} - -extend TestPackedExtensionsLite { - repeated int32 packed_int32_extension_lite = 90 [packed = true]; - repeated int64 packed_int64_extension_lite = 91 [packed = true]; - repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; - repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; - repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; - repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; - repeated float packed_float_extension_lite = 100 [packed = true]; - repeated double packed_double_extension_lite = 101 [packed = true]; - repeated bool packed_bool_extension_lite = 102 [packed = true]; - repeated ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; -} - -message TestNestedExtensionLite { - extend TestAllExtensionsLite { - optional int32 nested_extension = 12345; - } -} - -// Test that deprecated fields work. We only verify that they compile (at one -// point this failed). -message TestDeprecatedLite { - optional int32 deprecated_field = 1 [deprecated = true]; -} - -// See the comments of the same type in unittest.proto. -message TestParsingMergeLite { - message RepeatedFieldsGenerator { - repeated TestAllTypesLite field1 = 1; - repeated TestAllTypesLite field2 = 2; - repeated TestAllTypesLite field3 = 3; - repeated group Group1 = 10 { - optional TestAllTypesLite field1 = 11; - } - repeated group Group2 = 20 { - optional TestAllTypesLite field1 = 21; - } - repeated TestAllTypesLite ext1 = 1000; - repeated TestAllTypesLite ext2 = 1001; - } - required TestAllTypesLite required_all_types = 1; - optional TestAllTypesLite optional_all_types = 2; - repeated TestAllTypesLite repeated_all_types = 3; - optional group OptionalGroup = 10 { - optional TestAllTypesLite optional_group_all_types = 11; - } - repeated group RepeatedGroup = 20 { - optional TestAllTypesLite repeated_group_all_types = 21; - } - extensions 1000 to max; - extend TestParsingMergeLite { - optional TestAllTypesLite optional_ext = 1000; - repeated TestAllTypesLite repeated_ext = 1001; - } -} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_no_generic_services.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_no_generic_services.proto deleted file mode 100644 index cffb4122c5c4f9d2e63a09d70c3784614617d88d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_no_generic_services.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -package google.protobuf.no_generic_services_test; - -// *_generic_services are false by default. - -message TestMessage { - optional int32 a = 1; - extensions 1000 to max; -} - -enum TestEnum { - FOO = 1; -} - -extend TestMessage { - optional int32 test_extension = 1000; -} - -service TestService { - rpc Foo(TestMessage) returns(TestMessage); -} diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_optimize_for.proto b/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_optimize_for.proto deleted file mode 100644 index 658c6a965222914cdf77ede6f192121a063e3ce4..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_optimize_for.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which uses optimize_for = CODE_SIZE. - -import "google/protobuf/unittest.proto"; - -package protobuf_unittest; - -option optimize_for = CODE_SIZE; - -message TestOptimizedForSize { - optional int32 i = 1; - optional ForeignMessage msg = 19; - - extensions 1000 to max; - - extend TestOptimizedForSize { - optional int32 test_extension = 1234; - optional TestRequiredOptimizedForSize test_extension2 = 1235; - } -} - -message TestRequiredOptimizedForSize { - required int32 x = 1; -} - -message TestOptionalOptimizedForSize { - optional TestRequiredOptimizedForSize o = 1; -} diff --git a/java/compatibility_tests/v2.5.0/pom.xml b/java/compatibility_tests/v2.5.0/pom.xml deleted file mode 100644 index 83a7563afd9f147ec67a38c1a5561d58a402292e..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - com.google.protobuf.compatibility - compatibility-test-suite - 2.5.0 - Protocol Buffer Java API compatibility tests - pom - - protos - more_protos - tests - - - protoc - 2.5.0 - - ${protoc.path} - ${protobuf.version} - - ${protoc.path} - ${protobuf.version} - - ${protobuf.version} - - . - - diff --git a/java/compatibility_tests/v2.5.0/protos/pom.xml b/java/compatibility_tests/v2.5.0/protos/pom.xml deleted file mode 100644 index a22e91ed1d61386ed98a978ca3afd4535df2fe0d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - 4.0.0 - - com.google.protobuf.compatibility - compatibility-test-suite - 2.5.0 - .. - - - com.google.protobuf.compatibility - compatibility-protos - 2.5.0 - - Protos for Compatibility test - - - - com.google.protobuf - protobuf-java - ${protos.protobuf.version} - - - - - - - maven-compiler-plugin - 3.6.0 - - 1.6 - 1.6 - - - - maven-antrun-plugin - - - generate-sources - generate-sources - - - - - - - - - - - - - - - - - - - target/generated-sources - - - run - - - - - - - diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/com/google/protobuf/nested_extension.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/com/google/protobuf/nested_extension.proto deleted file mode 100644 index 9fe5d560c9690fe5c2d4212c7911f97a74122b42..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/com/google/protobuf/nested_extension.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: Darick Tong (darick@google.com) -// -// A proto file with nested extensions. Note that this must be defined in -// a separate file to properly test the initialization of the outer class. - - -import "com/google/protobuf/non_nested_extension.proto"; - -package protobuf_unittest; - -message MyNestedExtension { - extend MessageToBeExtended { - optional MessageToBeExtended recursiveExtension = 2; - } -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/com/google/protobuf/nested_extension_lite.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/com/google/protobuf/nested_extension_lite.proto deleted file mode 100644 index 16ee46e57dc27602a4990668f6d5b64ec4145a6a..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/com/google/protobuf/nested_extension_lite.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: Darick Tong (darick@google.com) -// -// A proto file with nested extensions for a MessageLite messages. Note that -// this must be defined in a separate file to properly test the initialization -// of the outer class. - - -package protobuf_unittest; - -option optimize_for = LITE_RUNTIME; - -import "com/google/protobuf/non_nested_extension_lite.proto"; - -message MyNestedExtensionLite { - extend MessageLiteToBeExtended { - optional MessageLiteToBeExtended recursiveExtensionLite = 3; - } -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/descriptor.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/descriptor.proto deleted file mode 100644 index 031433e2a9e1a42d6cb7259561d3c522a1b9409e..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/descriptor.proto +++ /dev/null @@ -1,620 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - - -package google.protobuf; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field whithout harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; - optional int32 end = 2; - } - repeated ExtensionRange extension_range = 5; - - optional MessageOptions options = 7; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; // Tag-delimited aggregate. - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - // TODO(sanjay): Should we add LABEL_MAP? - }; - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be either TYPE_ENUM or TYPE_MESSAGE. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - optional FieldOptions options = 8; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; -} - - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Object-C plugin) and your project website (if available) -- there's no need -// to explain how you intend to use them. Usually you only need one extension -// number. You can declare multiple options with only one extension number by -// putting them in a sub-message. See the Custom Options section of the docs -// for examples: -// http://code.google.com/apis/protocolbuffers/docs/proto.html#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - optional string java_outer_classname = 8; - - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; - - // If set true, then the Java code generator will generate equals() and - // hashCode() methods for all messages defined in the .proto file. This is - // purely a speed optimization, as the AbstractMessage base class includes - // reflection-based implementations of these methods. - optional bool java_generate_equals_and_hash = 20 [default=false]; - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default=SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. There is no default. - optional string go_package = 11; - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of proto2. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. - optional bool packed = 2; - - - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outher message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - optional bool lazy = 5 [default=false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; - - // EXPERIMENTAL. DO NOT USE. - // For "map" fields, the name of the field in the enclosed type that - // is the key for this map. For example, suppose we have: - // message Item { - // required string name = 1; - // required string value = 2; - // } - // message Config { - // repeated Item items = 1 [experimental_map_key="name"]; - // } - // In this situation, the map key for Item will be set to "name". - // TODO: Fully-implement this, then remove the "experimental_" prefix. - optional string experimental_map_key = 9; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to false to disallow mapping different tag names to a same - // value. - optional bool allow_alias = 2 [default=true]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - optional string leading_comments = 3; - optional string trailing_comments = 4; - } -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest.proto deleted file mode 100644 index 6eb2d86f51f15504571d7c00bcfb773765202b2d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest.proto +++ /dev/null @@ -1,719 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file we will use for unit testing. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; // auto-added - -import "google/protobuf/unittest_import.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do "using namespace unittest = protobuf_unittest". -package protobuf_unittest; - -// Protos optimized for SPEED use a strict superset of the generated code -// of equivalent ones optimized for CODE_SIZE, so we should optimize all our -// tests for speed unless explicitly testing code size optimization. -option optimize_for = SPEED; - -option java_outer_classname = "UnittestProto"; - -// This proto includes every type of field in both singular and repeated -// forms. -message TestAllTypes { - message NestedMessage { - // The field name "b" fails to compile in proto1 because it conflicts with - // a local variable named "b" in one of the generated methods. Doh. - // This file needs to compile in proto1 to test backwards-compatibility. - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessage optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessage optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Defined in unittest_import_public.proto - optional protobuf_unittest_import.PublicImportMessage - optional_public_import_message = 26; - - optional NestedMessage optional_lazy_message = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR ]; - optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum = 83 [default = IMPORT_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message TestDeprecatedFields { - optional int32 deprecated_int32 = 1 [deprecated=true]; -} - -// Define these after TestAllTypes to make sure the compiler can handle -// that. -message ForeignMessage { - optional int32 c = 1; -} - -enum ForeignEnum { - FOREIGN_FOO = 4; - FOREIGN_BAR = 5; - FOREIGN_BAZ = 6; -} - -message TestAllExtensions { - extensions 1 to max; -} - -extend TestAllExtensions { - // Singular - optional int32 optional_int32_extension = 1; - optional int64 optional_int64_extension = 2; - optional uint32 optional_uint32_extension = 3; - optional uint64 optional_uint64_extension = 4; - optional sint32 optional_sint32_extension = 5; - optional sint64 optional_sint64_extension = 6; - optional fixed32 optional_fixed32_extension = 7; - optional fixed64 optional_fixed64_extension = 8; - optional sfixed32 optional_sfixed32_extension = 9; - optional sfixed64 optional_sfixed64_extension = 10; - optional float optional_float_extension = 11; - optional double optional_double_extension = 12; - optional bool optional_bool_extension = 13; - optional string optional_string_extension = 14; - optional bytes optional_bytes_extension = 15; - - optional group OptionalGroup_extension = 16 { - optional int32 a = 17; - } - - optional TestAllTypes.NestedMessage optional_nested_message_extension = 18; - optional ForeignMessage optional_foreign_message_extension = 19; - optional protobuf_unittest_import.ImportMessage - optional_import_message_extension = 20; - - optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21; - optional ForeignEnum optional_foreign_enum_extension = 22; - optional protobuf_unittest_import.ImportEnum - optional_import_enum_extension = 23; - - optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE]; - optional string optional_cord_extension = 25 [ctype=CORD]; - - optional protobuf_unittest_import.PublicImportMessage - optional_public_import_message_extension = 26; - - optional TestAllTypes.NestedMessage - optional_lazy_message_extension = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32_extension = 31; - repeated int64 repeated_int64_extension = 32; - repeated uint32 repeated_uint32_extension = 33; - repeated uint64 repeated_uint64_extension = 34; - repeated sint32 repeated_sint32_extension = 35; - repeated sint64 repeated_sint64_extension = 36; - repeated fixed32 repeated_fixed32_extension = 37; - repeated fixed64 repeated_fixed64_extension = 38; - repeated sfixed32 repeated_sfixed32_extension = 39; - repeated sfixed64 repeated_sfixed64_extension = 40; - repeated float repeated_float_extension = 41; - repeated double repeated_double_extension = 42; - repeated bool repeated_bool_extension = 43; - repeated string repeated_string_extension = 44; - repeated bytes repeated_bytes_extension = 45; - - repeated group RepeatedGroup_extension = 46 { - optional int32 a = 47; - } - - repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48; - repeated ForeignMessage repeated_foreign_message_extension = 49; - repeated protobuf_unittest_import.ImportMessage - repeated_import_message_extension = 50; - - repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51; - repeated ForeignEnum repeated_foreign_enum_extension = 52; - repeated protobuf_unittest_import.ImportEnum - repeated_import_enum_extension = 53; - - repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord_extension = 55 [ctype=CORD]; - - repeated TestAllTypes.NestedMessage - repeated_lazy_message_extension = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32_extension = 61 [default = 41 ]; - optional int64 default_int64_extension = 62 [default = 42 ]; - optional uint32 default_uint32_extension = 63 [default = 43 ]; - optional uint64 default_uint64_extension = 64 [default = 44 ]; - optional sint32 default_sint32_extension = 65 [default = -45 ]; - optional sint64 default_sint64_extension = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension = 70 [default = -50 ]; - optional float default_float_extension = 71 [default = 51.5 ]; - optional double default_double_extension = 72 [default = 52e3 ]; - optional bool default_bool_extension = 73 [default = true ]; - optional string default_string_extension = 74 [default = "hello"]; - optional bytes default_bytes_extension = 75 [default = "world"]; - - optional TestAllTypes.NestedEnum - default_nested_enum_extension = 81 [default = BAR]; - optional ForeignEnum - default_foreign_enum_extension = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum_extension = 83 [default = IMPORT_BAR]; - - optional string default_string_piece_extension = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension = 85 [ctype=CORD, default="123"]; -} - -message TestNestedExtension { - extend TestAllExtensions { - // Check for bug where string extensions declared in tested scope did not - // compile. - optional string test = 1002 [default="test"]; - } -} - -// We have separate messages for testing required fields because it's -// annoying to have to fill in required fields in TestProto in order to -// do anything with it. Note that we don't need to test every type of -// required filed because the code output is basically identical to -// optional fields for all types. -message TestRequired { - required int32 a = 1; - optional int32 dummy2 = 2; - required int32 b = 3; - - extend TestAllExtensions { - optional TestRequired single = 1000; - repeated TestRequired multi = 1001; - } - - // Pad the field count to 32 so that we can test that IsInitialized() - // properly checks multiple elements of has_bits_. - optional int32 dummy4 = 4; - optional int32 dummy5 = 5; - optional int32 dummy6 = 6; - optional int32 dummy7 = 7; - optional int32 dummy8 = 8; - optional int32 dummy9 = 9; - optional int32 dummy10 = 10; - optional int32 dummy11 = 11; - optional int32 dummy12 = 12; - optional int32 dummy13 = 13; - optional int32 dummy14 = 14; - optional int32 dummy15 = 15; - optional int32 dummy16 = 16; - optional int32 dummy17 = 17; - optional int32 dummy18 = 18; - optional int32 dummy19 = 19; - optional int32 dummy20 = 20; - optional int32 dummy21 = 21; - optional int32 dummy22 = 22; - optional int32 dummy23 = 23; - optional int32 dummy24 = 24; - optional int32 dummy25 = 25; - optional int32 dummy26 = 26; - optional int32 dummy27 = 27; - optional int32 dummy28 = 28; - optional int32 dummy29 = 29; - optional int32 dummy30 = 30; - optional int32 dummy31 = 31; - optional int32 dummy32 = 32; - - required int32 c = 33; -} - -message TestRequiredForeign { - optional TestRequired optional_message = 1; - repeated TestRequired repeated_message = 2; - optional int32 dummy = 3; -} - -// Test that we can use NestedMessage from outside TestAllTypes. -message TestForeignNested { - optional TestAllTypes.NestedMessage foreign_nested = 1; -} - -// TestEmptyMessage is used to test unknown field support. -message TestEmptyMessage { -} - -// Like above, but declare all field numbers as potential extensions. No -// actual extensions should ever be defined for this type. -message TestEmptyMessageWithExtensions { - extensions 1 to max; -} - -message TestMultipleExtensionRanges { - extensions 42; - extensions 4143 to 4243; - extensions 65536 to max; -} - -// Test that really large tag numbers don't break anything. -message TestReallyLargeTagNumber { - // The largest possible tag number is 2^28 - 1, since the wire format uses - // three bits to communicate wire type. - optional int32 a = 1; - optional int32 bb = 268435455; -} - -message TestRecursiveMessage { - optional TestRecursiveMessage a = 1; - optional int32 i = 2; -} - -// Test that mutual recursion works. -message TestMutualRecursionA { - optional TestMutualRecursionB bb = 1; -} - -message TestMutualRecursionB { - optional TestMutualRecursionA a = 1; - optional int32 optional_int32 = 2; -} - -// Test that groups have disjoint field numbers from their siblings and -// parents. This is NOT possible in proto1; only proto2. When attempting -// to compile with proto1, this will emit an error; so we only include it -// in protobuf_unittest_proto. -message TestDupFieldNumber { // NO_PROTO1 - optional int32 a = 1; // NO_PROTO1 - optional group Foo = 2 { optional int32 a = 1; } // NO_PROTO1 - optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1 -} // NO_PROTO1 - -// Additional messages for testing lazy fields. -message TestEagerMessage { - optional TestAllTypes sub_message = 1 [lazy=false]; -} -message TestLazyMessage { - optional TestAllTypes sub_message = 1 [lazy=true]; -} - -// Needed for a Python test. -message TestNestedMessageHasBits { - message NestedMessage { - repeated int32 nestedmessage_repeated_int32 = 1; - repeated ForeignMessage nestedmessage_repeated_foreignmessage = 2; - } - optional NestedMessage optional_nested_message = 1; -} - - -// Test an enum that has multiple values with the same number. -enum TestEnumWithDupValue { - option allow_alias = true; - FOO1 = 1; - BAR1 = 2; - BAZ = 3; - FOO2 = 1; - BAR2 = 2; -} - -// Test an enum with large, unordered values. -enum TestSparseEnum { - SPARSE_A = 123; - SPARSE_B = 62374; - SPARSE_C = 12589234; - SPARSE_D = -15; - SPARSE_E = -53452; - SPARSE_F = 0; - SPARSE_G = 2; -} - -// Test message with CamelCase field names. This violates Protocol Buffer -// standard style. -message TestCamelCaseFieldNames { - optional int32 PrimitiveField = 1; - optional string StringField = 2; - optional ForeignEnum EnumField = 3; - optional ForeignMessage MessageField = 4; - optional string StringPieceField = 5 [ctype=STRING_PIECE]; - optional string CordField = 6 [ctype=CORD]; - - repeated int32 RepeatedPrimitiveField = 7; - repeated string RepeatedStringField = 8; - repeated ForeignEnum RepeatedEnumField = 9; - repeated ForeignMessage RepeatedMessageField = 10; - repeated string RepeatedStringPieceField = 11 [ctype=STRING_PIECE]; - repeated string RepeatedCordField = 12 [ctype=CORD]; -} - - -// We list fields out of order, to ensure that we're using field number and not -// field index to determine serialization order. -message TestFieldOrderings { - optional string my_string = 11; - extensions 2 to 10; - optional int64 my_int = 1; - extensions 12 to 100; - optional float my_float = 101; -} - - -extend TestFieldOrderings { - optional string my_extension_string = 50; - optional int32 my_extension_int = 5; -} - - -message TestExtremeDefaultValues { - optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"]; - optional uint32 large_uint32 = 2 [default = 0xFFFFFFFF]; - optional uint64 large_uint64 = 3 [default = 0xFFFFFFFFFFFFFFFF]; - optional int32 small_int32 = 4 [default = -0x7FFFFFFF]; - optional int64 small_int64 = 5 [default = -0x7FFFFFFFFFFFFFFF]; - optional int32 really_small_int32 = 21 [default = -0x80000000]; - optional int64 really_small_int64 = 22 [default = -0x8000000000000000]; - - // The default value here is UTF-8 for "\u1234". (We could also just type - // the UTF-8 text directly into this text file rather than escape it, but - // lots of people use editors that would be confused by this.) - optional string utf8_string = 6 [default = "\341\210\264"]; - - // Tests for single-precision floating-point values. - optional float zero_float = 7 [default = 0]; - optional float one_float = 8 [default = 1]; - optional float small_float = 9 [default = 1.5]; - optional float negative_one_float = 10 [default = -1]; - optional float negative_float = 11 [default = -1.5]; - // Using exponents - optional float large_float = 12 [default = 2E8]; - optional float small_negative_float = 13 [default = -8e-28]; - - // Text for nonfinite floating-point values. - optional double inf_double = 14 [default = inf]; - optional double neg_inf_double = 15 [default = -inf]; - optional double nan_double = 16 [default = nan]; - optional float inf_float = 17 [default = inf]; - optional float neg_inf_float = 18 [default = -inf]; - optional float nan_float = 19 [default = nan]; - - // Tests for C++ trigraphs. - // Trigraphs should be escaped in C++ generated files, but they should not be - // escaped for other languages. - // Note that in .proto file, "\?" is a valid way to escape ? in string - // literals. - optional string cpp_trigraph = 20 [default = "? \? ?? \?? \??? ??/ ?\?-"]; - - // String defaults containing the character '\000' - optional string string_with_zero = 23 [default = "hel\000lo"]; - optional bytes bytes_with_zero = 24 [default = "wor\000ld"]; - optional string string_piece_with_zero = 25 [ctype=STRING_PIECE, - default="ab\000c"]; - optional string cord_with_zero = 26 [ctype=CORD, - default="12\0003"]; -} - -message SparseEnumMessage { - optional TestSparseEnum sparse_enum = 1; -} - -// Test String and Bytes: string is for valid UTF-8 strings -message OneString { - optional string data = 1; -} - -message MoreString { - repeated string data = 1; -} - -message OneBytes { - optional bytes data = 1; -} - -message MoreBytes { - repeated bytes data = 1; -} - - -// Test messages for packed fields - -message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; -} - -// A message with the same fields as TestPackedTypes, but without packing. Used -// to test packed <-> unpacked wire compatibility. -message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; -} - -message TestPackedExtensions { - extensions 1 to max; -} - -extend TestPackedExtensions { - repeated int32 packed_int32_extension = 90 [packed = true]; - repeated int64 packed_int64_extension = 91 [packed = true]; - repeated uint32 packed_uint32_extension = 92 [packed = true]; - repeated uint64 packed_uint64_extension = 93 [packed = true]; - repeated sint32 packed_sint32_extension = 94 [packed = true]; - repeated sint64 packed_sint64_extension = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension = 99 [packed = true]; - repeated float packed_float_extension = 100 [packed = true]; - repeated double packed_double_extension = 101 [packed = true]; - repeated bool packed_bool_extension = 102 [packed = true]; - repeated ForeignEnum packed_enum_extension = 103 [packed = true]; -} - -// Used by ExtensionSetTest/DynamicExtensions. The test actually builds -// a set of extensions to TestAllExtensions dynamically, based on the fields -// of this message type. -message TestDynamicExtensions { - enum DynamicEnumType { - DYNAMIC_FOO = 2200; - DYNAMIC_BAR = 2201; - DYNAMIC_BAZ = 2202; - } - message DynamicMessageType { - optional int32 dynamic_field = 2100; - } - - optional fixed32 scalar_extension = 2000; - optional ForeignEnum enum_extension = 2001; - optional DynamicEnumType dynamic_enum_extension = 2002; - - optional ForeignMessage message_extension = 2003; - optional DynamicMessageType dynamic_message_extension = 2004; - - repeated string repeated_extension = 2005; - repeated sint32 packed_extension = 2006 [packed = true]; -} - -message TestRepeatedScalarDifferentTagSizes { - // Parsing repeated fixed size values used to fail. This message needs to be - // used in order to get a tag of the right size; all of the repeated fields - // in TestAllTypes didn't trigger the check. - repeated fixed32 repeated_fixed32 = 12; - // Check for a varint type, just for good measure. - repeated int32 repeated_int32 = 13; - - // These have two-byte tags. - repeated fixed64 repeated_fixed64 = 2046; - repeated int64 repeated_int64 = 2047; - - // Three byte tags. - repeated float repeated_float = 262142; - repeated uint64 repeated_uint64 = 262143; -} - -// Test that if an optional or required message/group field appears multiple -// times in the input, they need to be merged. -message TestParsingMerge { - // RepeatedFieldsGenerator defines matching field types as TestParsingMerge, - // except that all fields are repeated. In the tests, we will serialize the - // RepeatedFieldsGenerator to bytes, and parse the bytes to TestParsingMerge. - // Repeated fields in RepeatedFieldsGenerator are expected to be merged into - // the corresponding required/optional fields in TestParsingMerge. - message RepeatedFieldsGenerator { - repeated TestAllTypes field1 = 1; - repeated TestAllTypes field2 = 2; - repeated TestAllTypes field3 = 3; - repeated group Group1 = 10 { - optional TestAllTypes field1 = 11; - } - repeated group Group2 = 20 { - optional TestAllTypes field1 = 21; - } - repeated TestAllTypes ext1 = 1000; - repeated TestAllTypes ext2 = 1001; - } - required TestAllTypes required_all_types = 1; - optional TestAllTypes optional_all_types = 2; - repeated TestAllTypes repeated_all_types = 3; - optional group OptionalGroup = 10 { - optional TestAllTypes optional_group_all_types = 11; - } - repeated group RepeatedGroup = 20 { - optional TestAllTypes repeated_group_all_types = 21; - } - extensions 1000 to max; - extend TestParsingMerge { - optional TestAllTypes optional_ext = 1000; - repeated TestAllTypes repeated_ext = 1001; - } -} - -message TestCommentInjectionMessage { - // */ <- This should not close the generated doc comment - optional string a = 1 [default="*/ <- Neither should this."]; -} - - -// Test that RPC services work. -message FooRequest {} -message FooResponse {} - -message FooClientMessage {} -message FooServerMessage{} - -service TestService { - rpc Foo(FooRequest) returns (FooResponse); - rpc Bar(BarRequest) returns (BarResponse); -} - - -message BarRequest {} -message BarResponse {} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_custom_options.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_custom_options.proto deleted file mode 100644 index 2f4e3fdf95c429470376a1cb4b96377a159543d0..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_custom_options.proto +++ /dev/null @@ -1,387 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: benjy@google.com (Benjy Weinberger) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file used to test the "custom options" feature of proto2. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; - -// A custom file option (defined below). -option (file_opt1) = 9876543210; - -import "google/protobuf/descriptor.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - - -// Some simple test custom options of various types. - -extend google.protobuf.FileOptions { - optional uint64 file_opt1 = 7736974; -} - -extend google.protobuf.MessageOptions { - optional int32 message_opt1 = 7739036; -} - -extend google.protobuf.FieldOptions { - optional fixed64 field_opt1 = 7740936; - // This is useful for testing that we correctly register default values for - // extension options. - optional int32 field_opt2 = 7753913 [default=42]; -} - -extend google.protobuf.EnumOptions { - optional sfixed32 enum_opt1 = 7753576; -} - -extend google.protobuf.EnumValueOptions { - optional int32 enum_value_opt1 = 1560678; -} - -extend google.protobuf.ServiceOptions { - optional sint64 service_opt1 = 7887650; -} - -enum MethodOpt1 { - METHODOPT1_VAL1 = 1; - METHODOPT1_VAL2 = 2; -} - -extend google.protobuf.MethodOptions { - optional MethodOpt1 method_opt1 = 7890860; -} - -// A test message with custom options at all possible locations (and also some -// regular options, to make sure they interact nicely). -message TestMessageWithCustomOptions { - option message_set_wire_format = false; - - option (message_opt1) = -56; - - optional string field1 = 1 [ctype=CORD, - (field_opt1)=8765432109]; - - enum AnEnum { - option (enum_opt1) = -789; - - ANENUM_VAL1 = 1; - ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; - } -} - - -// A test RPC service with custom options at all possible locations (and also -// some regular options, to make sure they interact nicely). -message CustomOptionFooRequest { -} - -message CustomOptionFooResponse { -} - -message CustomOptionFooClientMessage { -} - -message CustomOptionFooServerMessage { -} - -service TestServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - - - -// Options of every possible field type, so we can test them all exhaustively. - -message DummyMessageContainingEnum { - enum TestEnumType { - TEST_OPTION_ENUM_TYPE1 = 22; - TEST_OPTION_ENUM_TYPE2 = -23; - } -} - -message DummyMessageInvalidAsOptionType { -} - -extend google.protobuf.MessageOptions { - optional bool bool_opt = 7706090; - optional int32 int32_opt = 7705709; - optional int64 int64_opt = 7705542; - optional uint32 uint32_opt = 7704880; - optional uint64 uint64_opt = 7702367; - optional sint32 sint32_opt = 7701568; - optional sint64 sint64_opt = 7700863; - optional fixed32 fixed32_opt = 7700307; - optional fixed64 fixed64_opt = 7700194; - optional sfixed32 sfixed32_opt = 7698645; - optional sfixed64 sfixed64_opt = 7685475; - optional float float_opt = 7675390; - optional double double_opt = 7673293; - optional string string_opt = 7673285; - optional bytes bytes_opt = 7673238; - optional DummyMessageContainingEnum.TestEnumType enum_opt = 7673233; - optional DummyMessageInvalidAsOptionType message_type_opt = 7665967; -} - -message CustomOptionMinIntegerValues { - option (bool_opt) = false; - option (int32_opt) = -0x80000000; - option (int64_opt) = -0x8000000000000000; - option (uint32_opt) = 0; - option (uint64_opt) = 0; - option (sint32_opt) = -0x80000000; - option (sint64_opt) = -0x8000000000000000; - option (fixed32_opt) = 0; - option (fixed64_opt) = 0; - option (sfixed32_opt) = -0x80000000; - option (sfixed64_opt) = -0x8000000000000000; -} - -message CustomOptionMaxIntegerValues { - option (bool_opt) = true; - option (int32_opt) = 0x7FFFFFFF; - option (int64_opt) = 0x7FFFFFFFFFFFFFFF; - option (uint32_opt) = 0xFFFFFFFF; - option (uint64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sint32_opt) = 0x7FFFFFFF; - option (sint64_opt) = 0x7FFFFFFFFFFFFFFF; - option (fixed32_opt) = 0xFFFFFFFF; - option (fixed64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sfixed32_opt) = 0x7FFFFFFF; - option (sfixed64_opt) = 0x7FFFFFFFFFFFFFFF; -} - -message CustomOptionOtherValues { - option (int32_opt) = -100; // To test sign-extension. - option (float_opt) = 12.3456789; - option (double_opt) = 1.234567890123456789; - option (string_opt) = "Hello, \"World\""; - option (bytes_opt) = "Hello\0World"; - option (enum_opt) = TEST_OPTION_ENUM_TYPE2; -} - -message SettingRealsFromPositiveInts { - option (float_opt) = 12; - option (double_opt) = 154; -} - -message SettingRealsFromNegativeInts { - option (float_opt) = -12; - option (double_opt) = -154; -} - -// Options of complex message types, themselves combined and extended in -// various ways. - -message ComplexOptionType1 { - optional int32 foo = 1; - optional int32 foo2 = 2; - optional int32 foo3 = 3; - - extensions 100 to max; -} - -message ComplexOptionType2 { - optional ComplexOptionType1 bar = 1; - optional int32 baz = 2; - - message ComplexOptionType4 { - optional int32 waldo = 1; - - extend google.protobuf.MessageOptions { - optional ComplexOptionType4 complex_opt4 = 7633546; - } - } - - optional ComplexOptionType4 fred = 3; - - extensions 100 to max; -} - -message ComplexOptionType3 { - optional int32 qux = 1; - - optional group ComplexOptionType5 = 2 { - optional int32 plugh = 3; - } -} - -extend ComplexOptionType1 { - optional int32 quux = 7663707; - optional ComplexOptionType3 corge = 7663442; -} - -extend ComplexOptionType2 { - optional int32 grault = 7650927; - optional ComplexOptionType1 garply = 7649992; -} - -extend google.protobuf.MessageOptions { - optional protobuf_unittest.ComplexOptionType1 complex_opt1 = 7646756; - optional ComplexOptionType2 complex_opt2 = 7636949; - optional ComplexOptionType3 complex_opt3 = 7636463; - optional group ComplexOpt6 = 7595468 { - optional int32 xyzzy = 7593951; - } -} - -// Note that we try various different ways of naming the same extension. -message VariousComplexOptions { - option (.protobuf_unittest.complex_opt1).foo = 42; - option (protobuf_unittest.complex_opt1).(.protobuf_unittest.quux) = 324; - option (.protobuf_unittest.complex_opt1).(protobuf_unittest.corge).qux = 876; - option (complex_opt2).baz = 987; - option (complex_opt2).(grault) = 654; - option (complex_opt2).bar.foo = 743; - option (complex_opt2).bar.(quux) = 1999; - option (complex_opt2).bar.(protobuf_unittest.corge).qux = 2008; - option (complex_opt2).(garply).foo = 741; - option (complex_opt2).(garply).(.protobuf_unittest.quux) = 1998; - option (complex_opt2).(protobuf_unittest.garply).(corge).qux = 2121; - option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971; - option (complex_opt2).fred.waldo = 321; - option (protobuf_unittest.complex_opt3).qux = 9; - option (complex_opt3).complexoptiontype5.plugh = 22; - option (complexopt6).xyzzy = 24; -} - -// ------------------------------------------------------ -// Definitions for testing aggregate option parsing. -// See descriptor_unittest.cc. - -message AggregateMessageSet { - option message_set_wire_format = true; - extensions 4 to max; -} - -message AggregateMessageSetElement { - extend AggregateMessageSet { - optional AggregateMessageSetElement message_set_extension = 15447542; - } - optional string s = 1; -} - -// A helper type used to test aggregate option parsing -message Aggregate { - optional int32 i = 1; - optional string s = 2; - - // A nested object - optional Aggregate sub = 3; - - // To test the parsing of extensions inside aggregate values - optional google.protobuf.FileOptions file = 4; - extend google.protobuf.FileOptions { - optional Aggregate nested = 15476903; - } - - // An embedded message set - optional AggregateMessageSet mset = 5; -} - -// Allow Aggregate to be used as an option at all possible locations -// in the .proto grammar. -extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; } -extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; } -extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; } -extend google.protobuf.EnumOptions { optional Aggregate enumopt = 15483218; } -extend google.protobuf.EnumValueOptions { optional Aggregate enumvalopt = 15486921; } -extend google.protobuf.ServiceOptions { optional Aggregate serviceopt = 15497145; } -extend google.protobuf.MethodOptions { optional Aggregate methodopt = 15512713; } - -// Try using AggregateOption at different points in the proto grammar -option (fileopt) = { - s: 'FileAnnotation' - // Also test the handling of comments - /* of both types */ i: 100 - - sub { s: 'NestedFileAnnotation' } - - // Include a google.protobuf.FileOptions and recursively extend it with - // another fileopt. - file { - [protobuf_unittest.fileopt] { - s:'FileExtensionAnnotation' - } - } - - // A message set inside an option value - mset { - [protobuf_unittest.AggregateMessageSetElement.message_set_extension] { - s: 'EmbeddedMessageSetElement' - } - } -}; - -message AggregateMessage { - option (msgopt) = { i:101 s:'MessageAnnotation' }; - optional int32 fieldname = 1 [(fieldopt) = { s:'FieldAnnotation' }]; -} - -service AggregateService { - option (serviceopt) = { s:'ServiceAnnotation' }; - rpc Method (AggregateMessage) returns (AggregateMessage) { - option (methodopt) = { s:'MethodAnnotation' }; - } -} - -enum AggregateEnum { - option (enumopt) = { s:'EnumAnnotation' }; - VALUE = 1 [(enumvalopt) = { s:'EnumValueAnnotation' }]; -} - -// Test custom options for nested type. -message NestedOptionType { - message NestedMessage { - option (message_opt1) = 1001; - optional int32 nested_field = 1 [(field_opt1) = 1002]; - } - enum NestedEnum { - option (enum_opt1) = 1003; - NESTED_ENUM_VALUE = 1 [(enum_value_opt1) = 1004]; - } - extend google.protobuf.FileOptions { - optional int32 nested_extension = 7912573 [(field_opt2) = 1005]; - } -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto deleted file mode 100644 index fa1762594e8960814d5ad052ded3a5b9520d4f6d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto +++ /dev/null @@ -1,50 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which imports a proto file that uses optimize_for = CODE_SIZE. - -import "google/protobuf/unittest_optimize_for.proto"; - -package protobuf_unittest; - -// We optimize for speed here, but we are importing a proto that is optimized -// for code size. -option optimize_for = SPEED; - -message TestEmbedOptimizedForSize { - // Test that embedding a message which has optimize_for = CODE_SIZE into - // one optimized for speed works. - optional TestOptimizedForSize optional_message = 1; - repeated TestOptimizedForSize repeated_message = 2; -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_enormous_descriptor.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_enormous_descriptor.proto deleted file mode 100644 index bc0b7c16a0d4f211fc349abc729351834ca43dbd..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_enormous_descriptor.proto +++ /dev/null @@ -1,1046 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file that has an extremely large descriptor. Used to test that -// descriptors over 64k don't break the string literal length limit in Java. - - -package google.protobuf; -option java_package = "com.google.protobuf"; - -// Avoid generating insanely long methods. -option optimize_for = CODE_SIZE; - -message TestEnormousDescriptor { - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1 = 1 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_2 = 2 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_3 = 3 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_4 = 4 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_5 = 5 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_6 = 6 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_7 = 7 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_8 = 8 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_9 = 9 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_10 = 10 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_11 = 11 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_12 = 12 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_13 = 13 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_14 = 14 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_15 = 15 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_16 = 16 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_17 = 17 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_18 = 18 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_19 = 19 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_20 = 20 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_21 = 21 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_22 = 22 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_23 = 23 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_24 = 24 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_25 = 25 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_26 = 26 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_27 = 27 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_28 = 28 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_29 = 29 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_30 = 30 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_31 = 31 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_32 = 32 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_33 = 33 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_34 = 34 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_35 = 35 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_36 = 36 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_37 = 37 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_38 = 38 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_39 = 39 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_40 = 40 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_41 = 41 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_42 = 42 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_43 = 43 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_44 = 44 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_45 = 45 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_46 = 46 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_47 = 47 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_48 = 48 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_49 = 49 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_50 = 50 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_51 = 51 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_52 = 52 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_53 = 53 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_54 = 54 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_55 = 55 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_56 = 56 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_57 = 57 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_58 = 58 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_59 = 59 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_60 = 60 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_61 = 61 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_62 = 62 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_63 = 63 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_64 = 64 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_65 = 65 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_66 = 66 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_67 = 67 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_68 = 68 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_69 = 69 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_70 = 70 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_71 = 71 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_72 = 72 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_73 = 73 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_74 = 74 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_75 = 75 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_76 = 76 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_77 = 77 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_78 = 78 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_79 = 79 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_80 = 80 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_81 = 81 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_82 = 82 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_83 = 83 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_84 = 84 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_85 = 85 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_86 = 86 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_87 = 87 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_88 = 88 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_89 = 89 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_90 = 90 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_91 = 91 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_92 = 92 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_93 = 93 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_94 = 94 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_95 = 95 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_96 = 96 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_97 = 97 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_98 = 98 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_99 = 99 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_100 = 100 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_101 = 101 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_102 = 102 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_103 = 103 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_104 = 104 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_105 = 105 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_106 = 106 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_107 = 107 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_108 = 108 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_109 = 109 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_110 = 110 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_111 = 111 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_112 = 112 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_113 = 113 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_114 = 114 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_115 = 115 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_116 = 116 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_117 = 117 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_118 = 118 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_119 = 119 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_120 = 120 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_121 = 121 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_122 = 122 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_123 = 123 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_124 = 124 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_125 = 125 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_126 = 126 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_127 = 127 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_128 = 128 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_129 = 129 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_130 = 130 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_131 = 131 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_132 = 132 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_133 = 133 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_134 = 134 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_135 = 135 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_136 = 136 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_137 = 137 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_138 = 138 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_139 = 139 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_140 = 140 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_141 = 141 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_142 = 142 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_143 = 143 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_144 = 144 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_145 = 145 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_146 = 146 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_147 = 147 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_148 = 148 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_149 = 149 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_150 = 150 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_151 = 151 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_152 = 152 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_153 = 153 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_154 = 154 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_155 = 155 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_156 = 156 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_157 = 157 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_158 = 158 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_159 = 159 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_160 = 160 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_161 = 161 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_162 = 162 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_163 = 163 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_164 = 164 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_165 = 165 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_166 = 166 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_167 = 167 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_168 = 168 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_169 = 169 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_170 = 170 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_171 = 171 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_172 = 172 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_173 = 173 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_174 = 174 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_175 = 175 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_176 = 176 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_177 = 177 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_178 = 178 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_179 = 179 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_180 = 180 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_181 = 181 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_182 = 182 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_183 = 183 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_184 = 184 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_185 = 185 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_186 = 186 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_187 = 187 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_188 = 188 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_189 = 189 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_190 = 190 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_191 = 191 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_192 = 192 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_193 = 193 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_194 = 194 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_195 = 195 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_196 = 196 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_197 = 197 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_198 = 198 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_199 = 199 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_200 = 200 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_201 = 201 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_202 = 202 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_203 = 203 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_204 = 204 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_205 = 205 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_206 = 206 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_207 = 207 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_208 = 208 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_209 = 209 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_210 = 210 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_211 = 211 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_212 = 212 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_213 = 213 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_214 = 214 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_215 = 215 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_216 = 216 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_217 = 217 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_218 = 218 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_219 = 219 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_220 = 220 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_221 = 221 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_222 = 222 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_223 = 223 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_224 = 224 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_225 = 225 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_226 = 226 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_227 = 227 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_228 = 228 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_229 = 229 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_230 = 230 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_231 = 231 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_232 = 232 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_233 = 233 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_234 = 234 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_235 = 235 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_236 = 236 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_237 = 237 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_238 = 238 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_239 = 239 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_240 = 240 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_241 = 241 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_242 = 242 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_243 = 243 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_244 = 244 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_245 = 245 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_246 = 246 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_247 = 247 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_248 = 248 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_249 = 249 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_250 = 250 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_251 = 251 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_252 = 252 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_253 = 253 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_254 = 254 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_255 = 255 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_256 = 256 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_257 = 257 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_258 = 258 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_259 = 259 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_260 = 260 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_261 = 261 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_262 = 262 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_263 = 263 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_264 = 264 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_265 = 265 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_266 = 266 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_267 = 267 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_268 = 268 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_269 = 269 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_270 = 270 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_271 = 271 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_272 = 272 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_273 = 273 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_274 = 274 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_275 = 275 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_276 = 276 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_277 = 277 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_278 = 278 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_279 = 279 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_280 = 280 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_281 = 281 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_282 = 282 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_283 = 283 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_284 = 284 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_285 = 285 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_286 = 286 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_287 = 287 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_288 = 288 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_289 = 289 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_290 = 290 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_291 = 291 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_292 = 292 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_293 = 293 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_294 = 294 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_295 = 295 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_296 = 296 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_297 = 297 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_298 = 298 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_299 = 299 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_300 = 300 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_301 = 301 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_302 = 302 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_303 = 303 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_304 = 304 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_305 = 305 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_306 = 306 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_307 = 307 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_308 = 308 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_309 = 309 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_310 = 310 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_311 = 311 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_312 = 312 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_313 = 313 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_314 = 314 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_315 = 315 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_316 = 316 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_317 = 317 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_318 = 318 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_319 = 319 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_320 = 320 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_321 = 321 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_322 = 322 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_323 = 323 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_324 = 324 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_325 = 325 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_326 = 326 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_327 = 327 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_328 = 328 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_329 = 329 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_330 = 330 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_331 = 331 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_332 = 332 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_333 = 333 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_334 = 334 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_335 = 335 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_336 = 336 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_337 = 337 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_338 = 338 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_339 = 339 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_340 = 340 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_341 = 341 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_342 = 342 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_343 = 343 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_344 = 344 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_345 = 345 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_346 = 346 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_347 = 347 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_348 = 348 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_349 = 349 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_350 = 350 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_351 = 351 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_352 = 352 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_353 = 353 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_354 = 354 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_355 = 355 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_356 = 356 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_357 = 357 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_358 = 358 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_359 = 359 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_360 = 360 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_361 = 361 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_362 = 362 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_363 = 363 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_364 = 364 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_365 = 365 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_366 = 366 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_367 = 367 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_368 = 368 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_369 = 369 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_370 = 370 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_371 = 371 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_372 = 372 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_373 = 373 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_374 = 374 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_375 = 375 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_376 = 376 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_377 = 377 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_378 = 378 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_379 = 379 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_380 = 380 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_381 = 381 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_382 = 382 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_383 = 383 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_384 = 384 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_385 = 385 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_386 = 386 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_387 = 387 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_388 = 388 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_389 = 389 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_390 = 390 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_391 = 391 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_392 = 392 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_393 = 393 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_394 = 394 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_395 = 395 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_396 = 396 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_397 = 397 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_398 = 398 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_399 = 399 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_400 = 400 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_401 = 401 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_402 = 402 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_403 = 403 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_404 = 404 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_405 = 405 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_406 = 406 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_407 = 407 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_408 = 408 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_409 = 409 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_410 = 410 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_411 = 411 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_412 = 412 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_413 = 413 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_414 = 414 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_415 = 415 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_416 = 416 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_417 = 417 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_418 = 418 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_419 = 419 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_420 = 420 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_421 = 421 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_422 = 422 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_423 = 423 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_424 = 424 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_425 = 425 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_426 = 426 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_427 = 427 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_428 = 428 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_429 = 429 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_430 = 430 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_431 = 431 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_432 = 432 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_433 = 433 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_434 = 434 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_435 = 435 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_436 = 436 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_437 = 437 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_438 = 438 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_439 = 439 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_440 = 440 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_441 = 441 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_442 = 442 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_443 = 443 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_444 = 444 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_445 = 445 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_446 = 446 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_447 = 447 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_448 = 448 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_449 = 449 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_450 = 450 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_451 = 451 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_452 = 452 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_453 = 453 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_454 = 454 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_455 = 455 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_456 = 456 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_457 = 457 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_458 = 458 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_459 = 459 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_460 = 460 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_461 = 461 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_462 = 462 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_463 = 463 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_464 = 464 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_465 = 465 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_466 = 466 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_467 = 467 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_468 = 468 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_469 = 469 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_470 = 470 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_471 = 471 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_472 = 472 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_473 = 473 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_474 = 474 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_475 = 475 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_476 = 476 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_477 = 477 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_478 = 478 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_479 = 479 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_480 = 480 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_481 = 481 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_482 = 482 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_483 = 483 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_484 = 484 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_485 = 485 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_486 = 486 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_487 = 487 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_488 = 488 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_489 = 489 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_490 = 490 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_491 = 491 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_492 = 492 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_493 = 493 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_494 = 494 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_495 = 495 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_496 = 496 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_497 = 497 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_498 = 498 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_499 = 499 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_500 = 500 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_501 = 501 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_502 = 502 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_503 = 503 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_504 = 504 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_505 = 505 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_506 = 506 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_507 = 507 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_508 = 508 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_509 = 509 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_510 = 510 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_511 = 511 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_512 = 512 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_513 = 513 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_514 = 514 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_515 = 515 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_516 = 516 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_517 = 517 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_518 = 518 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_519 = 519 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_520 = 520 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_521 = 521 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_522 = 522 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_523 = 523 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_524 = 524 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_525 = 525 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_526 = 526 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_527 = 527 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_528 = 528 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_529 = 529 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_530 = 530 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_531 = 531 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_532 = 532 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_533 = 533 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_534 = 534 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_535 = 535 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_536 = 536 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_537 = 537 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_538 = 538 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_539 = 539 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_540 = 540 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_541 = 541 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_542 = 542 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_543 = 543 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_544 = 544 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_545 = 545 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_546 = 546 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_547 = 547 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_548 = 548 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_549 = 549 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_550 = 550 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_551 = 551 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_552 = 552 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_553 = 553 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_554 = 554 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_555 = 555 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_556 = 556 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_557 = 557 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_558 = 558 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_559 = 559 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_560 = 560 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_561 = 561 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_562 = 562 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_563 = 563 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_564 = 564 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_565 = 565 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_566 = 566 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_567 = 567 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_568 = 568 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_569 = 569 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_570 = 570 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_571 = 571 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_572 = 572 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_573 = 573 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_574 = 574 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_575 = 575 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_576 = 576 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_577 = 577 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_578 = 578 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_579 = 579 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_580 = 580 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_581 = 581 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_582 = 582 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_583 = 583 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_584 = 584 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_585 = 585 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_586 = 586 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_587 = 587 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_588 = 588 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_589 = 589 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_590 = 590 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_591 = 591 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_592 = 592 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_593 = 593 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_594 = 594 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_595 = 595 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_596 = 596 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_597 = 597 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_598 = 598 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_599 = 599 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_600 = 600 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_601 = 601 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_602 = 602 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_603 = 603 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_604 = 604 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_605 = 605 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_606 = 606 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_607 = 607 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_608 = 608 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_609 = 609 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_610 = 610 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_611 = 611 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_612 = 612 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_613 = 613 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_614 = 614 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_615 = 615 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_616 = 616 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_617 = 617 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_618 = 618 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_619 = 619 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_620 = 620 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_621 = 621 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_622 = 622 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_623 = 623 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_624 = 624 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_625 = 625 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_626 = 626 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_627 = 627 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_628 = 628 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_629 = 629 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_630 = 630 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_631 = 631 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_632 = 632 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_633 = 633 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_634 = 634 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_635 = 635 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_636 = 636 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_637 = 637 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_638 = 638 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_639 = 639 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_640 = 640 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_641 = 641 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_642 = 642 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_643 = 643 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_644 = 644 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_645 = 645 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_646 = 646 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_647 = 647 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_648 = 648 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_649 = 649 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_650 = 650 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_651 = 651 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_652 = 652 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_653 = 653 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_654 = 654 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_655 = 655 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_656 = 656 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_657 = 657 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_658 = 658 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_659 = 659 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_660 = 660 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_661 = 661 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_662 = 662 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_663 = 663 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_664 = 664 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_665 = 665 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_666 = 666 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_667 = 667 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_668 = 668 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_669 = 669 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_670 = 670 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_671 = 671 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_672 = 672 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_673 = 673 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_674 = 674 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_675 = 675 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_676 = 676 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_677 = 677 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_678 = 678 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_679 = 679 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_680 = 680 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_681 = 681 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_682 = 682 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_683 = 683 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_684 = 684 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_685 = 685 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_686 = 686 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_687 = 687 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_688 = 688 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_689 = 689 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_690 = 690 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_691 = 691 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_692 = 692 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_693 = 693 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_694 = 694 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_695 = 695 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_696 = 696 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_697 = 697 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_698 = 698 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_699 = 699 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_700 = 700 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_701 = 701 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_702 = 702 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_703 = 703 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_704 = 704 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_705 = 705 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_706 = 706 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_707 = 707 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_708 = 708 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_709 = 709 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_710 = 710 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_711 = 711 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_712 = 712 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_713 = 713 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_714 = 714 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_715 = 715 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_716 = 716 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_717 = 717 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_718 = 718 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_719 = 719 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_720 = 720 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_721 = 721 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_722 = 722 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_723 = 723 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_724 = 724 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_725 = 725 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_726 = 726 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_727 = 727 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_728 = 728 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_729 = 729 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_730 = 730 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_731 = 731 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_732 = 732 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_733 = 733 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_734 = 734 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_735 = 735 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_736 = 736 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_737 = 737 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_738 = 738 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_739 = 739 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_740 = 740 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_741 = 741 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_742 = 742 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_743 = 743 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_744 = 744 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_745 = 745 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_746 = 746 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_747 = 747 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_748 = 748 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_749 = 749 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_750 = 750 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_751 = 751 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_752 = 752 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_753 = 753 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_754 = 754 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_755 = 755 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_756 = 756 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_757 = 757 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_758 = 758 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_759 = 759 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_760 = 760 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_761 = 761 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_762 = 762 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_763 = 763 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_764 = 764 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_765 = 765 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_766 = 766 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_767 = 767 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_768 = 768 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_769 = 769 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_770 = 770 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_771 = 771 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_772 = 772 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_773 = 773 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_774 = 774 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_775 = 775 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_776 = 776 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_777 = 777 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_778 = 778 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_779 = 779 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_780 = 780 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_781 = 781 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_782 = 782 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_783 = 783 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_784 = 784 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_785 = 785 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_786 = 786 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_787 = 787 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_788 = 788 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_789 = 789 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_790 = 790 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_791 = 791 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_792 = 792 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_793 = 793 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_794 = 794 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_795 = 795 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_796 = 796 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_797 = 797 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_798 = 798 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_799 = 799 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_800 = 800 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_801 = 801 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_802 = 802 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_803 = 803 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_804 = 804 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_805 = 805 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_806 = 806 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_807 = 807 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_808 = 808 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_809 = 809 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_810 = 810 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_811 = 811 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_812 = 812 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_813 = 813 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_814 = 814 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_815 = 815 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_816 = 816 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_817 = 817 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_818 = 818 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_819 = 819 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_820 = 820 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_821 = 821 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_822 = 822 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_823 = 823 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_824 = 824 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_825 = 825 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_826 = 826 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_827 = 827 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_828 = 828 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_829 = 829 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_830 = 830 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_831 = 831 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_832 = 832 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_833 = 833 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_834 = 834 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_835 = 835 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_836 = 836 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_837 = 837 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_838 = 838 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_839 = 839 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_840 = 840 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_841 = 841 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_842 = 842 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_843 = 843 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_844 = 844 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_845 = 845 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_846 = 846 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_847 = 847 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_848 = 848 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_849 = 849 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_850 = 850 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_851 = 851 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_852 = 852 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_853 = 853 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_854 = 854 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_855 = 855 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_856 = 856 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_857 = 857 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_858 = 858 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_859 = 859 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_860 = 860 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_861 = 861 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_862 = 862 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_863 = 863 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_864 = 864 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_865 = 865 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_866 = 866 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_867 = 867 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_868 = 868 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_869 = 869 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_870 = 870 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_871 = 871 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_872 = 872 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_873 = 873 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_874 = 874 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_875 = 875 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_876 = 876 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_877 = 877 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_878 = 878 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_879 = 879 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_880 = 880 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_881 = 881 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_882 = 882 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_883 = 883 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_884 = 884 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_885 = 885 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_886 = 886 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_887 = 887 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_888 = 888 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_889 = 889 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_890 = 890 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_891 = 891 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_892 = 892 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_893 = 893 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_894 = 894 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_895 = 895 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_896 = 896 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_897 = 897 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_898 = 898 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_899 = 899 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_900 = 900 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_901 = 901 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_902 = 902 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_903 = 903 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_904 = 904 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_905 = 905 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_906 = 906 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_907 = 907 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_908 = 908 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_909 = 909 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_910 = 910 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_911 = 911 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_912 = 912 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_913 = 913 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_914 = 914 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_915 = 915 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_916 = 916 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_917 = 917 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_918 = 918 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_919 = 919 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_920 = 920 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_921 = 921 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_922 = 922 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_923 = 923 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_924 = 924 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_925 = 925 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_926 = 926 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_927 = 927 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_928 = 928 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_929 = 929 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_930 = 930 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_931 = 931 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_932 = 932 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_933 = 933 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_934 = 934 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_935 = 935 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_936 = 936 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_937 = 937 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_938 = 938 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_939 = 939 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_940 = 940 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_941 = 941 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_942 = 942 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_943 = 943 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_944 = 944 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_945 = 945 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_946 = 946 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_947 = 947 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_948 = 948 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_949 = 949 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_950 = 950 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_951 = 951 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_952 = 952 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_953 = 953 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_954 = 954 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_955 = 955 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_956 = 956 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_957 = 957 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_958 = 958 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_959 = 959 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_960 = 960 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_961 = 961 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_962 = 962 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_963 = 963 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_964 = 964 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_965 = 965 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_966 = 966 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_967 = 967 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_968 = 968 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_969 = 969 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_970 = 970 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_971 = 971 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_972 = 972 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_973 = 973 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_974 = 974 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_975 = 975 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_976 = 976 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_977 = 977 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_978 = 978 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_979 = 979 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_980 = 980 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_981 = 981 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_982 = 982 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_983 = 983 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_984 = 984 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_985 = 985 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_986 = 986 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_987 = 987 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_988 = 988 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_989 = 989 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_990 = 990 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_991 = 991 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_992 = 992 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_993 = 993 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_994 = 994 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_995 = 995 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_996 = 996 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_997 = 997 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_998 = 998 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_999 = 999 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000 = 1000 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_import_lite.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_import_lite.proto deleted file mode 100644 index 81b117fe8489ecc4cba5410dbf876b4ca473657b..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_import_lite.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. - -package protobuf_unittest_import; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -import public "google/protobuf/unittest_import_public_lite.proto"; - -message ImportMessageLite { - optional int32 d = 1; -} - -enum ImportEnumLite { - IMPORT_LITE_FOO = 7; - IMPORT_LITE_BAR = 8; - IMPORT_LITE_BAZ = 9; -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_lite.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_lite.proto deleted file mode 100644 index a1764aac8dbdaca6982e8eac11794440aac3a63a..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_lite.proto +++ /dev/null @@ -1,360 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest.proto but with optimize_for = LITE_RUNTIME. - -package protobuf_unittest; - -import "google/protobuf/unittest_import_lite.proto"; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -// Same as TestAllTypes but with the lite runtime. -message TestAllTypesLite { - message NestedMessage { - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessageLite optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnumLite optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Defined in unittest_import_public.proto - optional protobuf_unittest_import.PublicImportMessageLite - optional_public_import_message = 26; - - optional NestedMessage optional_lazy_message = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessageLite repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnumLite repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR]; - optional ForeignEnumLite default_foreign_enum = 82 - [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message ForeignMessageLite { - optional int32 c = 1; -} - -enum ForeignEnumLite { - FOREIGN_LITE_FOO = 4; - FOREIGN_LITE_BAR = 5; - FOREIGN_LITE_BAZ = 6; -} - -message TestPackedTypesLite { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnumLite packed_enum = 103 [packed = true]; -} - -message TestAllExtensionsLite { - extensions 1 to max; -} - -extend TestAllExtensionsLite { - // Singular - optional int32 optional_int32_extension_lite = 1; - optional int64 optional_int64_extension_lite = 2; - optional uint32 optional_uint32_extension_lite = 3; - optional uint64 optional_uint64_extension_lite = 4; - optional sint32 optional_sint32_extension_lite = 5; - optional sint64 optional_sint64_extension_lite = 6; - optional fixed32 optional_fixed32_extension_lite = 7; - optional fixed64 optional_fixed64_extension_lite = 8; - optional sfixed32 optional_sfixed32_extension_lite = 9; - optional sfixed64 optional_sfixed64_extension_lite = 10; - optional float optional_float_extension_lite = 11; - optional double optional_double_extension_lite = 12; - optional bool optional_bool_extension_lite = 13; - optional string optional_string_extension_lite = 14; - optional bytes optional_bytes_extension_lite = 15; - - optional group OptionalGroup_extension_lite = 16 { - optional int32 a = 17; - } - - optional TestAllTypesLite.NestedMessage optional_nested_message_extension_lite - = 18; - optional ForeignMessageLite optional_foreign_message_extension_lite = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message_extension_lite = 20; - - optional TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; - optional ForeignEnumLite optional_foreign_enum_extension_lite = 22; - optional protobuf_unittest_import.ImportEnumLite - optional_import_enum_extension_lite = 23; - - optional string optional_string_piece_extension_lite = 24 - [ctype=STRING_PIECE]; - optional string optional_cord_extension_lite = 25 [ctype=CORD]; - - optional protobuf_unittest_import.PublicImportMessageLite - optional_public_import_message_extension_lite = 26; - - optional TestAllTypesLite.NestedMessage - optional_lazy_message_extension_lite = 27 [lazy=true]; - - // Repeated - repeated int32 repeated_int32_extension_lite = 31; - repeated int64 repeated_int64_extension_lite = 32; - repeated uint32 repeated_uint32_extension_lite = 33; - repeated uint64 repeated_uint64_extension_lite = 34; - repeated sint32 repeated_sint32_extension_lite = 35; - repeated sint64 repeated_sint64_extension_lite = 36; - repeated fixed32 repeated_fixed32_extension_lite = 37; - repeated fixed64 repeated_fixed64_extension_lite = 38; - repeated sfixed32 repeated_sfixed32_extension_lite = 39; - repeated sfixed64 repeated_sfixed64_extension_lite = 40; - repeated float repeated_float_extension_lite = 41; - repeated double repeated_double_extension_lite = 42; - repeated bool repeated_bool_extension_lite = 43; - repeated string repeated_string_extension_lite = 44; - repeated bytes repeated_bytes_extension_lite = 45; - - repeated group RepeatedGroup_extension_lite = 46 { - optional int32 a = 47; - } - - repeated TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite - = 48; - repeated ForeignMessageLite repeated_foreign_message_extension_lite = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message_extension_lite = 50; - - repeated TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; - repeated ForeignEnumLite repeated_foreign_enum_extension_lite = 52; - repeated protobuf_unittest_import.ImportEnumLite - repeated_import_enum_extension_lite = 53; - - repeated string repeated_string_piece_extension_lite = 54 - [ctype=STRING_PIECE]; - repeated string repeated_cord_extension_lite = 55 [ctype=CORD]; - - repeated TestAllTypesLite.NestedMessage - repeated_lazy_message_extension_lite = 57 [lazy=true]; - - // Singular with defaults - optional int32 default_int32_extension_lite = 61 [default = 41 ]; - optional int64 default_int64_extension_lite = 62 [default = 42 ]; - optional uint32 default_uint32_extension_lite = 63 [default = 43 ]; - optional uint64 default_uint64_extension_lite = 64 [default = 44 ]; - optional sint32 default_sint32_extension_lite = 65 [default = -45 ]; - optional sint64 default_sint64_extension_lite = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension_lite = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension_lite = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50 ]; - optional float default_float_extension_lite = 71 [default = 51.5 ]; - optional double default_double_extension_lite = 72 [default = 52e3 ]; - optional bool default_bool_extension_lite = 73 [default = true ]; - optional string default_string_extension_lite = 74 [default = "hello"]; - optional bytes default_bytes_extension_lite = 75 [default = "world"]; - - optional TestAllTypesLite.NestedEnum - default_nested_enum_extension_lite = 81 [default = BAR]; - optional ForeignEnumLite - default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece_extension_lite = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension_lite = 85 [ctype=CORD, default="123"]; -} - -message TestPackedExtensionsLite { - extensions 1 to max; -} - -extend TestPackedExtensionsLite { - repeated int32 packed_int32_extension_lite = 90 [packed = true]; - repeated int64 packed_int64_extension_lite = 91 [packed = true]; - repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; - repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; - repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; - repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; - repeated float packed_float_extension_lite = 100 [packed = true]; - repeated double packed_double_extension_lite = 101 [packed = true]; - repeated bool packed_bool_extension_lite = 102 [packed = true]; - repeated ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; -} - -message TestNestedExtensionLite { - extend TestAllExtensionsLite { - optional int32 nested_extension = 12345; - } -} - -// Test that deprecated fields work. We only verify that they compile (at one -// point this failed). -message TestDeprecatedLite { - optional int32 deprecated_field = 1 [deprecated = true]; -} - -// See the comments of the same type in unittest.proto. -message TestParsingMergeLite { - message RepeatedFieldsGenerator { - repeated TestAllTypesLite field1 = 1; - repeated TestAllTypesLite field2 = 2; - repeated TestAllTypesLite field3 = 3; - repeated group Group1 = 10 { - optional TestAllTypesLite field1 = 11; - } - repeated group Group2 = 20 { - optional TestAllTypesLite field1 = 21; - } - repeated TestAllTypesLite ext1 = 1000; - repeated TestAllTypesLite ext2 = 1001; - } - required TestAllTypesLite required_all_types = 1; - optional TestAllTypesLite optional_all_types = 2; - repeated TestAllTypesLite repeated_all_types = 3; - optional group OptionalGroup = 10 { - optional TestAllTypesLite optional_group_all_types = 11; - } - repeated group RepeatedGroup = 20 { - optional TestAllTypesLite repeated_group_all_types = 21; - } - extensions 1000 to max; - extend TestParsingMergeLite { - optional TestAllTypesLite optional_ext = 1000; - repeated TestAllTypesLite repeated_ext = 1001; - } -} diff --git a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_lite_imports_nonlite.proto b/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_lite_imports_nonlite.proto deleted file mode 100644 index d52cb8cc36d8924a3454f9170f6b338f14a59c5c..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_lite_imports_nonlite.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// Tests that a "lite" message can import a regular message. - -package protobuf_unittest; - -import "google/protobuf/unittest.proto"; - -option optimize_for = LITE_RUNTIME; - -message TestLiteImportsNonlite { - optional TestAllTypes message = 1; -} diff --git a/java/compatibility_tests/v2.5.0/test.sh b/java/compatibility_tests/v2.5.0/test.sh deleted file mode 100644 index 65ea960ca28efbce9d843ce0916f3916cd7aa61c..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/test.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash - -set -ex - -# Change to the script's directory. -cd $(dirname $0) - -MAVEN_LOCAL_REPOSITORY=/var/maven_local_repository -MVN="mvn --batch-mode -e -X -Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$MAVEN_LOCAL_REPOSITORY" - -# Version of the tests (i.e., the version of protobuf from where we extracted -# these tests). -TEST_VERSION=`grep "^ .*" pom.xml | sed "s| \(.*\)|\1|"` - -# The old version of protobuf that we are testing compatibility against. This -# is usually the same as TEST_VERSION (i.e., we use the tests extracted from -# that version to test compatibility of the newest runtime against it), but it -# is also possible to use this same test set to test the compatibility of the -# latest version against other versions. -OLD_VERSION=$1 -OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe - -# Extract the latest protobuf version number. -VERSION_NUMBER=`grep "^ .*" ../../pom.xml | sed "s| \(.*\)|\1|"` - -echo "Running compatibility tests between current $VERSION_NUMBER and released $OLD_VERSION" - -# Check protoc -[ -f ../../../src/protoc ] || { - echo "[ERROR]: Please build protoc first." - exit 1 -} - -# Build and install protobuf-java-$VERSION_NUMBER.jar -[ -f ../../core/target/protobuf-java-$VERSION_NUMBER.jar ] || { - pushd ../.. - $MVN install -Dmaven.test.skip=true - popd -} - -# Download old version source for the compatibility test -[ -d protobuf ] || { - git clone https://github.com/protocolbuffers/protobuf.git - cd protobuf - git reset --hard v$TEST_VERSION - cd .. -} - -# Download old version protoc compiler (for linux) -wget $OLD_VERSION_PROTOC -O protoc -chmod +x protoc - -# Test source compatibility. In these tests we recompile everything against -# the new runtime (including old version generated code). - -# Test A.1: -# protos: use new version -# more_protos: use old version -$MVN clean test \ - -Dprotobuf.test.source.path=$(pwd)/protobuf \ - -Dprotoc.path=$(pwd)/protoc \ - -Dprotos.protoc.path=$(pwd)/../../../src/protoc \ - -Dprotobuf.version=$VERSION_NUMBER - -# Test A.2: -# protos: use old version -# more_protos: use new version -$MVN clean test \ - -Dprotobuf.test.source.path=$(pwd)/protobuf \ - -Dprotoc.path=$(pwd)/protoc \ - -Dmore_protos.protoc.path=$(pwd)/../../../src/protoc \ - -Dprotobuf.version=$VERSION_NUMBER - -# Test binary compatibility. In these tests we run the old version compiled -# jar against the new runtime directly without recompile. - -# Collect all test dependencies in a single jar file (except for protobuf) to -# make it easier to run binary compatibility test (where we will need to run -# the jar files directly). -cd deps -$MVN assembly:single -cd .. -cp -f deps/target/compatibility-test-deps-${TEST_VERSION}-jar-with-dependencies.jar deps.jar - -# Build the old version of all 3 artifacts. -$MVN clean install -Dmaven.test.skip=true -Dprotoc.path=$(pwd)/protoc -Dprotobuf.version=$OLD_VERSION -cp -f protos/target/compatibility-protos-${TEST_VERSION}.jar protos.jar -cp -f more_protos/target/compatibility-more-protos-${TEST_VERSION}.jar more_protos.jar -cp -f tests/target/compatibility-tests-${TEST_VERSION}.jar tests.jar - -# Collect the list of tests we need to run. -TESTS=`find tests -name "*Test.java" | sed "s|/|.|g;s/.java$//g;s/tests.src.main.java.//g"` - -# Test B.1: run all the old artifacts against the new runtime. Note that we -# must run the test in the protobuf source tree because some of the tests need -# to read golden test data files. -cd protobuf -java -cp ../../../core/target/protobuf-java-$VERSION_NUMBER.jar:../protos.jar:../more_protos.jar:../tests.jar:../deps.jar org.junit.runner.JUnitCore $TESTS -cd .. - -# Test B.2: update protos.jar only. -cd protos -$MVN clean package -Dmaven.test.skip=true -Dprotoc.path=$(pwd)/../../../../src/protoc -Dprotobuf.version=$VERSION_NUMBER -cd .. -cd protobuf -java -cp ../../../core/target/protobuf-java-$VERSION_NUMBER.jar:../protos/target/compatibility-protos-${TEST_VERSION}.jar:../more_protos.jar:../tests.jar:../deps.jar org.junit.runner.JUnitCore $TESTS -cd .. - -# Test B.3: update more_protos.jar only. -cd more_protos -$MVN clean package -Dmaven.test.skip=true -Dprotoc.path=$(pwd)/../../../../src/protoc -Dprotobuf.version=$VERSION_NUMBER -cd .. -cd protobuf -java -cp ../../../core/target/protobuf-java-$VERSION_NUMBER.jar:../protos.jar:../more_protos/target/compatibility-more-protos-${TEST_VERSION}.jar:../tests.jar:../deps.jar org.junit.runner.JUnitCore $TESTS -cd .. diff --git a/java/compatibility_tests/v2.5.0/tests/pom.xml b/java/compatibility_tests/v2.5.0/tests/pom.xml deleted file mode 100644 index f1ce46e7ab2d4e1a81fbbf00f6d87034558453d0..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - 4.0.0 - - com.google.protobuf.compatibility - compatibility-test-suite - 2.5.0 - .. - - - com.google.protobuf.compatibility - compatibility-tests - 2.5.0 - - Compatibility Tests - - - - junit - junit - 4.4 - - - org.easymock - easymock - 2.2 - - - org.easymock - easymockclassextension - 2.2.1 - - - com.google.protobuf - protobuf-java - ${tests.protobuf.version} - - - com.google.protobuf.compatibility - compatibility-protos - 2.5.0 - - - com.google.protobuf.compatibility - compatibility-more-protos - 2.5.0 - - - - - - maven-compiler-plugin - - 1.6 - 1.6 - - - - maven-surefire-plugin - - ${basedir}/src/main/java/ - ${project.build.directory}/classes/ - - **/*Test.java - - ${protobuf.test.source.path} - - - - - diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/AbstractMessageTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/AbstractMessageTest.java deleted file mode 100644 index 6789550c49c247cb14258b5d82b98a633f3598c3..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/AbstractMessageTest.java +++ /dev/null @@ -1,510 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import com.google.protobuf.Descriptors.FieldDescriptor; -import protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize; -import protobuf_unittest.UnittestProto; -import protobuf_unittest.UnittestProto.ForeignMessage; -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestPackedTypes; -import protobuf_unittest.UnittestProto.TestRequired; -import protobuf_unittest.UnittestProto.TestRequiredForeign; -import protobuf_unittest.UnittestProto.TestUnpackedTypes; - -import junit.framework.TestCase; - -import java.util.Map; - -/** - * Unit test for {@link AbstractMessage}. - * - * @author kenton@google.com Kenton Varda - */ -public class AbstractMessageTest extends TestCase { - /** - * Extends AbstractMessage and wraps some other message object. The methods - * of the Message interface which aren't explicitly implemented by - * AbstractMessage are forwarded to the wrapped object. This allows us to - * test that AbstractMessage's implementations work even if the wrapped - * object does not use them. - */ - private static class AbstractMessageWrapper extends AbstractMessage { - private final Message wrappedMessage; - - public AbstractMessageWrapper(Message wrappedMessage) { - this.wrappedMessage = wrappedMessage; - } - - public Descriptors.Descriptor getDescriptorForType() { - return wrappedMessage.getDescriptorForType(); - } - public AbstractMessageWrapper getDefaultInstanceForType() { - return new AbstractMessageWrapper( - wrappedMessage.getDefaultInstanceForType()); - } - public Map getAllFields() { - return wrappedMessage.getAllFields(); - } - public boolean hasField(Descriptors.FieldDescriptor field) { - return wrappedMessage.hasField(field); - } - public Object getField(Descriptors.FieldDescriptor field) { - return wrappedMessage.getField(field); - } - public int getRepeatedFieldCount(Descriptors.FieldDescriptor field) { - return wrappedMessage.getRepeatedFieldCount(field); - } - public Object getRepeatedField( - Descriptors.FieldDescriptor field, int index) { - return wrappedMessage.getRepeatedField(field, index); - } - public UnknownFieldSet getUnknownFields() { - return wrappedMessage.getUnknownFields(); - } - public Builder newBuilderForType() { - return new Builder(wrappedMessage.newBuilderForType()); - } - public Builder toBuilder() { - return new Builder(wrappedMessage.toBuilder()); - } - - static class Builder extends AbstractMessage.Builder { - private final Message.Builder wrappedBuilder; - - public Builder(Message.Builder wrappedBuilder) { - this.wrappedBuilder = wrappedBuilder; - } - - public AbstractMessageWrapper build() { - return new AbstractMessageWrapper(wrappedBuilder.build()); - } - public AbstractMessageWrapper buildPartial() { - return new AbstractMessageWrapper(wrappedBuilder.buildPartial()); - } - public Builder clone() { - return new Builder(wrappedBuilder.clone()); - } - public boolean isInitialized() { - return clone().buildPartial().isInitialized(); - } - public Descriptors.Descriptor getDescriptorForType() { - return wrappedBuilder.getDescriptorForType(); - } - public AbstractMessageWrapper getDefaultInstanceForType() { - return new AbstractMessageWrapper( - wrappedBuilder.getDefaultInstanceForType()); - } - public Map getAllFields() { - return wrappedBuilder.getAllFields(); - } - public Builder newBuilderForField(Descriptors.FieldDescriptor field) { - return new Builder(wrappedBuilder.newBuilderForField(field)); - } - public boolean hasField(Descriptors.FieldDescriptor field) { - return wrappedBuilder.hasField(field); - } - public Object getField(Descriptors.FieldDescriptor field) { - return wrappedBuilder.getField(field); - } - public Builder setField(Descriptors.FieldDescriptor field, Object value) { - wrappedBuilder.setField(field, value); - return this; - } - public Builder clearField(Descriptors.FieldDescriptor field) { - wrappedBuilder.clearField(field); - return this; - } - public int getRepeatedFieldCount(Descriptors.FieldDescriptor field) { - return wrappedBuilder.getRepeatedFieldCount(field); - } - public Object getRepeatedField( - Descriptors.FieldDescriptor field, int index) { - return wrappedBuilder.getRepeatedField(field, index); - } - public Builder setRepeatedField(Descriptors.FieldDescriptor field, - int index, Object value) { - wrappedBuilder.setRepeatedField(field, index, value); - return this; - } - public Builder addRepeatedField( - Descriptors.FieldDescriptor field, Object value) { - wrappedBuilder.addRepeatedField(field, value); - return this; - } - public UnknownFieldSet getUnknownFields() { - return wrappedBuilder.getUnknownFields(); - } - public Builder setUnknownFields(UnknownFieldSet unknownFields) { - wrappedBuilder.setUnknownFields(unknownFields); - return this; - } - @Override - public Message.Builder getFieldBuilder(FieldDescriptor field) { - return wrappedBuilder.getFieldBuilder(field); - } - } - public Parser getParserForType() { - return wrappedMessage.getParserForType(); - } - } - - // ================================================================= - - TestUtil.ReflectionTester reflectionTester = - new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null); - - TestUtil.ReflectionTester extensionsReflectionTester = - new TestUtil.ReflectionTester(TestAllExtensions.getDescriptor(), - TestUtil.getExtensionRegistry()); - - public void testClear() throws Exception { - AbstractMessageWrapper message = - new AbstractMessageWrapper.Builder( - TestAllTypes.newBuilder(TestUtil.getAllSet())) - .clear().build(); - TestUtil.assertClear((TestAllTypes) message.wrappedMessage); - } - - public void testCopy() throws Exception { - AbstractMessageWrapper message = - new AbstractMessageWrapper.Builder(TestAllTypes.newBuilder()) - .mergeFrom(TestUtil.getAllSet()).build(); - TestUtil.assertAllFieldsSet((TestAllTypes) message.wrappedMessage); - } - - public void testSerializedSize() throws Exception { - TestAllTypes message = TestUtil.getAllSet(); - Message abstractMessage = new AbstractMessageWrapper(TestUtil.getAllSet()); - - assertEquals(message.getSerializedSize(), - abstractMessage.getSerializedSize()); - } - - public void testSerialization() throws Exception { - Message abstractMessage = new AbstractMessageWrapper(TestUtil.getAllSet()); - - TestUtil.assertAllFieldsSet( - TestAllTypes.parseFrom(abstractMessage.toByteString())); - - assertEquals(TestUtil.getAllSet().toByteString(), - abstractMessage.toByteString()); - } - - public void testParsing() throws Exception { - AbstractMessageWrapper.Builder builder = - new AbstractMessageWrapper.Builder(TestAllTypes.newBuilder()); - AbstractMessageWrapper message = - builder.mergeFrom(TestUtil.getAllSet().toByteString()).build(); - TestUtil.assertAllFieldsSet((TestAllTypes) message.wrappedMessage); - } - - public void testParsingUninitialized() throws Exception { - TestRequiredForeign.Builder builder = TestRequiredForeign.newBuilder(); - builder.getOptionalMessageBuilder().setDummy2(10); - ByteString bytes = builder.buildPartial().toByteString(); - Message.Builder abstractMessageBuilder = - new AbstractMessageWrapper.Builder(TestRequiredForeign.newBuilder()); - // mergeFrom() should not throw initialization error. - abstractMessageBuilder.mergeFrom(bytes).buildPartial(); - try { - abstractMessageBuilder.mergeFrom(bytes).build(); - fail(); - } catch (UninitializedMessageException ex) { - // pass - } - - // test DynamicMessage directly. - Message.Builder dynamicMessageBuilder = DynamicMessage.newBuilder( - TestRequiredForeign.getDescriptor()); - // mergeFrom() should not throw initialization error. - dynamicMessageBuilder.mergeFrom(bytes).buildPartial(); - try { - dynamicMessageBuilder.mergeFrom(bytes).build(); - fail(); - } catch (UninitializedMessageException ex) { - // pass - } - } - - public void testPackedSerialization() throws Exception { - Message abstractMessage = - new AbstractMessageWrapper(TestUtil.getPackedSet()); - - TestUtil.assertPackedFieldsSet( - TestPackedTypes.parseFrom(abstractMessage.toByteString())); - - assertEquals(TestUtil.getPackedSet().toByteString(), - abstractMessage.toByteString()); - } - - public void testPackedParsing() throws Exception { - AbstractMessageWrapper.Builder builder = - new AbstractMessageWrapper.Builder(TestPackedTypes.newBuilder()); - AbstractMessageWrapper message = - builder.mergeFrom(TestUtil.getPackedSet().toByteString()).build(); - TestUtil.assertPackedFieldsSet((TestPackedTypes) message.wrappedMessage); - } - - public void testUnpackedSerialization() throws Exception { - Message abstractMessage = - new AbstractMessageWrapper(TestUtil.getUnpackedSet()); - - TestUtil.assertUnpackedFieldsSet( - TestUnpackedTypes.parseFrom(abstractMessage.toByteString())); - - assertEquals(TestUtil.getUnpackedSet().toByteString(), - abstractMessage.toByteString()); - } - - public void testParsePackedToUnpacked() throws Exception { - AbstractMessageWrapper.Builder builder = - new AbstractMessageWrapper.Builder(TestUnpackedTypes.newBuilder()); - AbstractMessageWrapper message = - builder.mergeFrom(TestUtil.getPackedSet().toByteString()).build(); - TestUtil.assertUnpackedFieldsSet( - (TestUnpackedTypes) message.wrappedMessage); - } - - public void testParseUnpackedToPacked() throws Exception { - AbstractMessageWrapper.Builder builder = - new AbstractMessageWrapper.Builder(TestPackedTypes.newBuilder()); - AbstractMessageWrapper message = - builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build(); - TestUtil.assertPackedFieldsSet((TestPackedTypes) message.wrappedMessage); - } - - public void testUnpackedParsing() throws Exception { - AbstractMessageWrapper.Builder builder = - new AbstractMessageWrapper.Builder(TestUnpackedTypes.newBuilder()); - AbstractMessageWrapper message = - builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build(); - TestUtil.assertUnpackedFieldsSet( - (TestUnpackedTypes) message.wrappedMessage); - } - - public void testOptimizedForSize() throws Exception { - // We're mostly only checking that this class was compiled successfully. - TestOptimizedForSize message = - TestOptimizedForSize.newBuilder().setI(1).build(); - message = TestOptimizedForSize.parseFrom(message.toByteString()); - assertEquals(2, message.getSerializedSize()); - } - - // ----------------------------------------------------------------- - // Tests for isInitialized(). - - private static final TestRequired TEST_REQUIRED_UNINITIALIZED = - TestRequired.getDefaultInstance(); - private static final TestRequired TEST_REQUIRED_INITIALIZED = - TestRequired.newBuilder().setA(1).setB(2).setC(3).build(); - - public void testIsInitialized() throws Exception { - TestRequired.Builder builder = TestRequired.newBuilder(); - AbstractMessageWrapper.Builder abstractBuilder = - new AbstractMessageWrapper.Builder(builder); - - assertFalse(abstractBuilder.isInitialized()); - assertEquals("a, b, c", abstractBuilder.getInitializationErrorString()); - builder.setA(1); - assertFalse(abstractBuilder.isInitialized()); - assertEquals("b, c", abstractBuilder.getInitializationErrorString()); - builder.setB(1); - assertFalse(abstractBuilder.isInitialized()); - assertEquals("c", abstractBuilder.getInitializationErrorString()); - builder.setC(1); - assertTrue(abstractBuilder.isInitialized()); - assertEquals("", abstractBuilder.getInitializationErrorString()); - } - - public void testForeignIsInitialized() throws Exception { - TestRequiredForeign.Builder builder = TestRequiredForeign.newBuilder(); - AbstractMessageWrapper.Builder abstractBuilder = - new AbstractMessageWrapper.Builder(builder); - - assertTrue(abstractBuilder.isInitialized()); - assertEquals("", abstractBuilder.getInitializationErrorString()); - - builder.setOptionalMessage(TEST_REQUIRED_UNINITIALIZED); - assertFalse(abstractBuilder.isInitialized()); - assertEquals( - "optional_message.a, optional_message.b, optional_message.c", - abstractBuilder.getInitializationErrorString()); - - builder.setOptionalMessage(TEST_REQUIRED_INITIALIZED); - assertTrue(abstractBuilder.isInitialized()); - assertEquals("", abstractBuilder.getInitializationErrorString()); - - builder.addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED); - assertFalse(abstractBuilder.isInitialized()); - assertEquals( - "repeated_message[0].a, repeated_message[0].b, repeated_message[0].c", - abstractBuilder.getInitializationErrorString()); - - builder.setRepeatedMessage(0, TEST_REQUIRED_INITIALIZED); - assertTrue(abstractBuilder.isInitialized()); - assertEquals("", abstractBuilder.getInitializationErrorString()); - } - - // ----------------------------------------------------------------- - // Tests for mergeFrom - - static final TestAllTypes MERGE_SOURCE = - TestAllTypes.newBuilder() - .setOptionalInt32(1) - .setOptionalString("foo") - .setOptionalForeignMessage(ForeignMessage.getDefaultInstance()) - .addRepeatedString("bar") - .build(); - - static final TestAllTypes MERGE_DEST = - TestAllTypes.newBuilder() - .setOptionalInt64(2) - .setOptionalString("baz") - .setOptionalForeignMessage(ForeignMessage.newBuilder().setC(3).build()) - .addRepeatedString("qux") - .build(); - - static final String MERGE_RESULT_TEXT = - "optional_int32: 1\n" + - "optional_int64: 2\n" + - "optional_string: \"foo\"\n" + - "optional_foreign_message {\n" + - " c: 3\n" + - "}\n" + - "repeated_string: \"qux\"\n" + - "repeated_string: \"bar\"\n"; - - public void testMergeFrom() throws Exception { - AbstractMessageWrapper result = - new AbstractMessageWrapper.Builder( - TestAllTypes.newBuilder(MERGE_DEST)) - .mergeFrom(MERGE_SOURCE).build(); - - assertEquals(MERGE_RESULT_TEXT, result.toString()); - } - - // ----------------------------------------------------------------- - // Tests for equals and hashCode - - public void testEqualsAndHashCode() throws Exception { - TestAllTypes a = TestUtil.getAllSet(); - TestAllTypes b = TestAllTypes.newBuilder().build(); - TestAllTypes c = TestAllTypes.newBuilder(b).addRepeatedString("x").build(); - TestAllTypes d = TestAllTypes.newBuilder(c).addRepeatedString("y").build(); - TestAllExtensions e = TestUtil.getAllExtensionsSet(); - TestAllExtensions f = TestAllExtensions.newBuilder(e) - .addExtension(UnittestProto.repeatedInt32Extension, 999).build(); - - checkEqualsIsConsistent(a); - checkEqualsIsConsistent(b); - checkEqualsIsConsistent(c); - checkEqualsIsConsistent(d); - checkEqualsIsConsistent(e); - checkEqualsIsConsistent(f); - - checkNotEqual(a, b); - checkNotEqual(a, c); - checkNotEqual(a, d); - checkNotEqual(a, e); - checkNotEqual(a, f); - - checkNotEqual(b, c); - checkNotEqual(b, d); - checkNotEqual(b, e); - checkNotEqual(b, f); - - checkNotEqual(c, d); - checkNotEqual(c, e); - checkNotEqual(c, f); - - checkNotEqual(d, e); - checkNotEqual(d, f); - - checkNotEqual(e, f); - - // Deserializing into the TestEmptyMessage such that every field - // is an {@link UnknownFieldSet.Field}. - UnittestProto.TestEmptyMessage eUnknownFields = - UnittestProto.TestEmptyMessage.parseFrom(e.toByteArray()); - UnittestProto.TestEmptyMessage fUnknownFields = - UnittestProto.TestEmptyMessage.parseFrom(f.toByteArray()); - checkNotEqual(eUnknownFields, fUnknownFields); - checkEqualsIsConsistent(eUnknownFields); - checkEqualsIsConsistent(fUnknownFields); - - // Subsequent reconstitutions should be identical - UnittestProto.TestEmptyMessage eUnknownFields2 = - UnittestProto.TestEmptyMessage.parseFrom(e.toByteArray()); - checkEqualsIsConsistent(eUnknownFields, eUnknownFields2); - } - - - /** - * Asserts that the given proto has symmetric equals and hashCode methods. - */ - private void checkEqualsIsConsistent(Message message) { - // Object should be equal to itself. - assertEquals(message, message); - - // Object should be equal to a dynamic copy of itself. - DynamicMessage dynamic = DynamicMessage.newBuilder(message).build(); - checkEqualsIsConsistent(message, dynamic); - } - - /** - * Asserts that the given protos are equal and have the same hash code. - */ - private void checkEqualsIsConsistent(Message message1, Message message2) { - assertEquals(message1, message2); - assertEquals(message2, message1); - assertEquals(message2.hashCode(), message1.hashCode()); - } - - /** - * Asserts that the given protos are not equal and have different hash codes. - * - * @warning It's valid for non-equal objects to have the same hash code, so - * this test is stricter than it needs to be. However, this should happen - * relatively rarely. - */ - private void checkNotEqual(Message m1, Message m2) { - String equalsError = String.format("%s should not be equal to %s", m1, m2); - assertFalse(equalsError, m1.equals(m2)); - assertFalse(equalsError, m2.equals(m1)); - - assertFalse( - String.format("%s should have a different hash code from %s", m1, m2), - m1.hashCode() == m2.hashCode()); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/BoundedByteStringTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/BoundedByteStringTest.java deleted file mode 100644 index c838274369484391e6e76aa97252696b5e5bed0e..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/BoundedByteStringTest.java +++ /dev/null @@ -1,56 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import java.io.UnsupportedEncodingException; - -/** - * This class tests {@link BoundedByteString}, which extends {@link LiteralByteString}, - * by inheriting the tests from {@link LiteralByteStringTest}. The only method which - * is strange enough that it needs to be overridden here is {@link #testToString()}. - * - * @author carlanton@google.com (Carl Haverl) - */ -public class BoundedByteStringTest extends LiteralByteStringTest { - - @Override - protected void setUp() throws Exception { - classUnderTest = "BoundedByteString"; - byte[] sourceBytes = ByteStringTest.getTestBytes(2341, 11337766L); - int from = 100; - int to = sourceBytes.length - 100; - stringUnderTest = ByteString.copyFrom(sourceBytes).substring(from, to); - referenceBytes = new byte[to - from]; - System.arraycopy(sourceBytes, from, referenceBytes, 0, to - from); - expectedHashCode = 727575887; - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ByteStringTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ByteStringTest.java deleted file mode 100644 index 9e334e5e92f4c5bf8e77f2a263cf503a761d1e9e..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ByteStringTest.java +++ /dev/null @@ -1,590 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import com.google.protobuf.ByteString.Output; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Random; - -/** - * Test methods with implementations in {@link ByteString}, plus do some top-level "integration" - * tests. - * - * @author carlanton@google.com (Carl Haverl) - */ -public class ByteStringTest extends TestCase { - - private static final String UTF_16 = "UTF-16"; - - static byte[] getTestBytes(int size, long seed) { - Random random = new Random(seed); - byte[] result = new byte[size]; - random.nextBytes(result); - return result; - } - - private byte[] getTestBytes(int size) { - return getTestBytes(size, 445566L); - } - - private byte[] getTestBytes() { - return getTestBytes(1000); - } - - // Compare the entire left array with a subset of the right array. - private boolean isArrayRange(byte[] left, byte[] right, int rightOffset, int length) { - boolean stillEqual = (left.length == length); - for (int i = 0; (stillEqual && i < length); ++i) { - stillEqual = (left[i] == right[rightOffset + i]); - } - return stillEqual; - } - - // Returns true only if the given two arrays have identical contents. - private boolean isArray(byte[] left, byte[] right) { - return left.length == right.length && isArrayRange(left, right, 0, left.length); - } - - public void testSubstring_BeginIndex() { - byte[] bytes = getTestBytes(); - ByteString substring = ByteString.copyFrom(bytes).substring(500); - assertTrue("substring must contain the tail of the string", - isArrayRange(substring.toByteArray(), bytes, 500, bytes.length - 500)); - } - - public void testCopyFrom_BytesOffsetSize() { - byte[] bytes = getTestBytes(); - ByteString byteString = ByteString.copyFrom(bytes, 500, 200); - assertTrue("copyFrom sub-range must contain the expected bytes", - isArrayRange(byteString.toByteArray(), bytes, 500, 200)); - } - - public void testCopyFrom_Bytes() { - byte[] bytes = getTestBytes(); - ByteString byteString = ByteString.copyFrom(bytes); - assertTrue("copyFrom must contain the expected bytes", - isArray(byteString.toByteArray(), bytes)); - } - - public void testCopyFrom_ByteBufferSize() { - byte[] bytes = getTestBytes(); - ByteBuffer byteBuffer = ByteBuffer.allocate(bytes.length); - byteBuffer.put(bytes); - byteBuffer.position(500); - ByteString byteString = ByteString.copyFrom(byteBuffer, 200); - assertTrue("copyFrom byteBuffer sub-range must contain the expected bytes", - isArrayRange(byteString.toByteArray(), bytes, 500, 200)); - } - - public void testCopyFrom_ByteBuffer() { - byte[] bytes = getTestBytes(); - ByteBuffer byteBuffer = ByteBuffer.allocate(bytes.length); - byteBuffer.put(bytes); - byteBuffer.position(500); - ByteString byteString = ByteString.copyFrom(byteBuffer); - assertTrue("copyFrom byteBuffer sub-range must contain the expected bytes", - isArrayRange(byteString.toByteArray(), bytes, 500, bytes.length - 500)); - } - - public void testCopyFrom_StringEncoding() throws UnsupportedEncodingException { - String testString = "I love unicode \u1234\u5678 characters"; - ByteString byteString = ByteString.copyFrom(testString, UTF_16); - byte[] testBytes = testString.getBytes(UTF_16); - assertTrue("copyFrom string must respect the charset", - isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)); - } - - public void testCopyFrom_Utf8() throws UnsupportedEncodingException { - String testString = "I love unicode \u1234\u5678 characters"; - ByteString byteString = ByteString.copyFromUtf8(testString); - byte[] testBytes = testString.getBytes("UTF-8"); - assertTrue("copyFromUtf8 string must respect the charset", - isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)); - } - - public void testCopyFrom_Iterable() { - byte[] testBytes = getTestBytes(77777, 113344L); - final List pieces = makeConcretePieces(testBytes); - // Call copyFrom() on a Collection - ByteString byteString = ByteString.copyFrom(pieces); - assertTrue("copyFrom a List must contain the expected bytes", - isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)); - // Call copyFrom on an iteration that's not a collection - ByteString byteStringAlt = ByteString.copyFrom(new Iterable() { - public Iterator iterator() { - return pieces.iterator(); - } - }); - assertEquals("copyFrom from an Iteration must contain the expected bytes", - byteString, byteStringAlt); - } - - public void testCopyTo_TargetOffset() { - byte[] bytes = getTestBytes(); - ByteString byteString = ByteString.copyFrom(bytes); - byte[] target = new byte[bytes.length + 1000]; - byteString.copyTo(target, 400); - assertTrue("copyFrom byteBuffer sub-range must contain the expected bytes", - isArrayRange(bytes, target, 400, bytes.length)); - } - - public void testReadFrom_emptyStream() throws IOException { - ByteString byteString = - ByteString.readFrom(new ByteArrayInputStream(new byte[0])); - assertSame("reading an empty stream must result in the EMPTY constant " - + "byte string", ByteString.EMPTY, byteString); - } - - public void testReadFrom_smallStream() throws IOException { - assertReadFrom(getTestBytes(10)); - } - - public void testReadFrom_mutating() throws IOException { - byte[] capturedArray = null; - EvilInputStream eis = new EvilInputStream(); - ByteString byteString = ByteString.readFrom(eis); - - capturedArray = eis.capturedArray; - byte[] originalValue = byteString.toByteArray(); - for (int x = 0; x < capturedArray.length; ++x) { - capturedArray[x] = (byte) 0; - } - - byte[] newValue = byteString.toByteArray(); - assertTrue("copyFrom byteBuffer must not grant access to underlying array", - Arrays.equals(originalValue, newValue)); - } - - // Tests sizes that are over multi-segment rope threshold. - public void testReadFrom_largeStream() throws IOException { - assertReadFrom(getTestBytes(0x100)); - assertReadFrom(getTestBytes(0x101)); - assertReadFrom(getTestBytes(0x110)); - assertReadFrom(getTestBytes(0x1000)); - assertReadFrom(getTestBytes(0x1001)); - assertReadFrom(getTestBytes(0x1010)); - assertReadFrom(getTestBytes(0x10000)); - assertReadFrom(getTestBytes(0x10001)); - assertReadFrom(getTestBytes(0x10010)); - } - - // Tests that IOExceptions propagate through ByteString.readFrom(). - public void testReadFrom_IOExceptions() { - try { - ByteString.readFrom(new FailStream()); - fail("readFrom must throw the underlying IOException"); - - } catch (IOException e) { - assertEquals("readFrom must throw the expected exception", - "synthetic failure", e.getMessage()); - } - } - - // Tests that ByteString.readFrom works with streams that don't - // always fill their buffers. - public void testReadFrom_reluctantStream() throws IOException { - final byte[] data = getTestBytes(0x1000); - - ByteString byteString = ByteString.readFrom(new ReluctantStream(data)); - assertTrue("readFrom byte stream must contain the expected bytes", - isArray(byteString.toByteArray(), data)); - - // Same test as above, but with some specific chunk sizes. - assertReadFromReluctantStream(data, 100); - assertReadFromReluctantStream(data, 248); - assertReadFromReluctantStream(data, 249); - assertReadFromReluctantStream(data, 250); - assertReadFromReluctantStream(data, 251); - assertReadFromReluctantStream(data, 0x1000); - assertReadFromReluctantStream(data, 0x1001); - } - - // Fails unless ByteString.readFrom reads the bytes correctly from a - // reluctant stream with the given chunkSize parameter. - private void assertReadFromReluctantStream(byte[] bytes, int chunkSize) - throws IOException { - ByteString b = ByteString.readFrom(new ReluctantStream(bytes), chunkSize); - assertTrue("readFrom byte stream must contain the expected bytes", - isArray(b.toByteArray(), bytes)); - } - - // Tests that ByteString.readFrom works with streams that implement - // available(). - public void testReadFrom_available() throws IOException { - final byte[] data = getTestBytes(0x1001); - - ByteString byteString = ByteString.readFrom(new AvailableStream(data)); - assertTrue("readFrom byte stream must contain the expected bytes", - isArray(byteString.toByteArray(), data)); - } - - // Fails unless ByteString.readFrom reads the bytes correctly. - private void assertReadFrom(byte[] bytes) throws IOException { - ByteString byteString = - ByteString.readFrom(new ByteArrayInputStream(bytes)); - assertTrue("readFrom byte stream must contain the expected bytes", - isArray(byteString.toByteArray(), bytes)); - } - - // A stream that fails when read. - private static final class FailStream extends InputStream { - @Override public int read() throws IOException { - throw new IOException("synthetic failure"); - } - } - - // A stream that simulates blocking by only producing 250 characters - // per call to read(byte[]). - private static class ReluctantStream extends InputStream { - protected final byte[] data; - protected int pos = 0; - - public ReluctantStream(byte[] data) { - this.data = data; - } - - @Override public int read() { - if (pos == data.length) { - return -1; - } else { - return data[pos++]; - } - } - - @Override public int read(byte[] buf) { - return read(buf, 0, buf.length); - } - - @Override public int read(byte[] buf, int offset, int size) { - if (pos == data.length) { - return -1; - } - int count = Math.min(Math.min(size, data.length - pos), 250); - System.arraycopy(data, pos, buf, offset, count); - pos += count; - return count; - } - } - - // Same as above, but also implements available(). - private static final class AvailableStream extends ReluctantStream { - public AvailableStream(byte[] data) { - super(data); - } - - @Override public int available() { - return Math.min(250, data.length - pos); - } - } - - // A stream which exposes the byte array passed into read(byte[], int, int). - private static class EvilInputStream extends InputStream { - public byte[] capturedArray = null; - - @Override - public int read(byte[] buf, int off, int len) { - if (capturedArray != null) { - return -1; - } else { - capturedArray = buf; - for (int x = 0; x < len; ++x) { - buf[x] = (byte) x; - } - return len; - } - } - - @Override - public int read() { - // Purposefully do nothing. - return -1; - } - } - - // A stream which exposes the byte array passed into write(byte[], int, int). - private static class EvilOutputStream extends OutputStream { - public byte[] capturedArray = null; - - @Override - public void write(byte[] buf, int off, int len) { - if (capturedArray == null) { - capturedArray = buf; - } - } - - @Override - public void write(int ignored) { - // Purposefully do nothing. - } - } - - public void testToStringUtf8() throws UnsupportedEncodingException { - String testString = "I love unicode \u1234\u5678 characters"; - byte[] testBytes = testString.getBytes("UTF-8"); - ByteString byteString = ByteString.copyFrom(testBytes); - assertEquals("copyToStringUtf8 must respect the charset", - testString, byteString.toStringUtf8()); - } - - public void testNewOutput_InitialCapacity() throws IOException { - byte[] bytes = getTestBytes(); - ByteString.Output output = ByteString.newOutput(bytes.length + 100); - output.write(bytes); - ByteString byteString = output.toByteString(); - assertTrue( - "String built from newOutput(int) must contain the expected bytes", - isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); - } - - // Test newOutput() using a variety of buffer sizes and a variety of (fixed) - // write sizes - public void testNewOutput_ArrayWrite() throws IOException { - byte[] bytes = getTestBytes(); - int length = bytes.length; - int[] bufferSizes = {128, 256, length / 2, length - 1, length, length + 1, - 2 * length, 3 * length}; - int[] writeSizes = {1, 4, 5, 7, 23, bytes.length}; - - for (int bufferSize : bufferSizes) { - for (int writeSize : writeSizes) { - // Test writing the entire output writeSize bytes at a time. - ByteString.Output output = ByteString.newOutput(bufferSize); - for (int i = 0; i < length; i += writeSize) { - output.write(bytes, i, Math.min(writeSize, length - i)); - } - ByteString byteString = output.toByteString(); - assertTrue("String built from newOutput() must contain the expected bytes", - isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); - } - } - } - - // Test newOutput() using a variety of buffer sizes, but writing all the - // characters using write(byte); - public void testNewOutput_WriteChar() throws IOException { - byte[] bytes = getTestBytes(); - int length = bytes.length; - int[] bufferSizes = {0, 1, 128, 256, length / 2, - length - 1, length, length + 1, - 2 * length, 3 * length}; - for (int bufferSize : bufferSizes) { - ByteString.Output output = ByteString.newOutput(bufferSize); - for (byte byteValue : bytes) { - output.write(byteValue); - } - ByteString byteString = output.toByteString(); - assertTrue("String built from newOutput() must contain the expected bytes", - isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); - } - } - - // Test newOutput() in which we write the bytes using a variety of methods - // and sizes, and in which we repeatedly call toByteString() in the middle. - public void testNewOutput_Mixed() throws IOException { - Random rng = new Random(1); - byte[] bytes = getTestBytes(); - int length = bytes.length; - int[] bufferSizes = {0, 1, 128, 256, length / 2, - length - 1, length, length + 1, - 2 * length, 3 * length}; - - for (int bufferSize : bufferSizes) { - // Test writing the entire output using a mixture of write sizes and - // methods; - ByteString.Output output = ByteString.newOutput(bufferSize); - int position = 0; - while (position < bytes.length) { - if (rng.nextBoolean()) { - int count = 1 + rng.nextInt(bytes.length - position); - output.write(bytes, position, count); - position += count; - } else { - output.write(bytes[position]); - position++; - } - assertEquals("size() returns the right value", position, output.size()); - assertTrue("newOutput() substring must have correct bytes", - isArrayRange(output.toByteString().toByteArray(), - bytes, 0, position)); - } - ByteString byteString = output.toByteString(); - assertTrue("String built from newOutput() must contain the expected bytes", - isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); - } - } - - public void testNewOutputEmpty() throws IOException { - // Make sure newOutput() correctly builds empty byte strings - ByteString byteString = ByteString.newOutput().toByteString(); - assertEquals(ByteString.EMPTY, byteString); - } - - public void testNewOutput_Mutating() throws IOException { - Output os = ByteString.newOutput(5); - os.write(new byte[] {1, 2, 3, 4, 5}); - EvilOutputStream eos = new EvilOutputStream(); - os.writeTo(eos); - byte[] capturedArray = eos.capturedArray; - ByteString byteString = os.toByteString(); - byte[] oldValue = byteString.toByteArray(); - Arrays.fill(capturedArray, (byte) 0); - byte[] newValue = byteString.toByteArray(); - assertTrue("Output must not provide access to the underlying byte array", - Arrays.equals(oldValue, newValue)); - } - - public void testSubstringParity() { - byte[] bigBytes = getTestBytes(2048 * 1024, 113344L); - int start = 512 * 1024 - 3333; - int end = 512 * 1024 + 7777; - ByteString concreteSubstring = ByteString.copyFrom(bigBytes).substring(start, end); - boolean ok = true; - for (int i = start; ok && i < end; ++i) { - ok = (bigBytes[i] == concreteSubstring.byteAt(i - start)); - } - assertTrue("Concrete substring didn't capture the right bytes", ok); - - ByteString literalString = ByteString.copyFrom(bigBytes, start, end - start); - assertTrue("Substring must be equal to literal string", - concreteSubstring.equals(literalString)); - assertEquals("Substring must have same hashcode as literal string", - literalString.hashCode(), concreteSubstring.hashCode()); - } - - public void testCompositeSubstring() { - byte[] referenceBytes = getTestBytes(77748, 113344L); - - List pieces = makeConcretePieces(referenceBytes); - ByteString listString = ByteString.copyFrom(pieces); - - int from = 1000; - int to = 40000; - ByteString compositeSubstring = listString.substring(from, to); - byte[] substringBytes = compositeSubstring.toByteArray(); - boolean stillEqual = true; - for (int i = 0; stillEqual && i < to - from; ++i) { - stillEqual = referenceBytes[from + i] == substringBytes[i]; - } - assertTrue("Substring must return correct bytes", stillEqual); - - stillEqual = true; - for (int i = 0; stillEqual && i < to - from; ++i) { - stillEqual = referenceBytes[from + i] == compositeSubstring.byteAt(i); - } - assertTrue("Substring must support byteAt() correctly", stillEqual); - - ByteString literalSubstring = ByteString.copyFrom(referenceBytes, from, to - from); - assertTrue("Composite substring must equal a literal substring over the same bytes", - compositeSubstring.equals(literalSubstring)); - assertTrue("Literal substring must equal a composite substring over the same bytes", - literalSubstring.equals(compositeSubstring)); - - assertEquals("We must get the same hashcodes for composite and literal substrings", - literalSubstring.hashCode(), compositeSubstring.hashCode()); - - assertFalse("We can't be equal to a proper substring", - compositeSubstring.equals(literalSubstring.substring(0, literalSubstring.size() - 1))); - } - - public void testCopyFromList() { - byte[] referenceBytes = getTestBytes(77748, 113344L); - ByteString literalString = ByteString.copyFrom(referenceBytes); - - List pieces = makeConcretePieces(referenceBytes); - ByteString listString = ByteString.copyFrom(pieces); - - assertTrue("Composite string must be equal to literal string", - listString.equals(literalString)); - assertEquals("Composite string must have same hashcode as literal string", - literalString.hashCode(), listString.hashCode()); - } - - public void testConcat() { - byte[] referenceBytes = getTestBytes(77748, 113344L); - ByteString literalString = ByteString.copyFrom(referenceBytes); - - List pieces = makeConcretePieces(referenceBytes); - - Iterator iter = pieces.iterator(); - ByteString concatenatedString = iter.next(); - while (iter.hasNext()) { - concatenatedString = concatenatedString.concat(iter.next()); - } - - assertTrue("Concatenated string must be equal to literal string", - concatenatedString.equals(literalString)); - assertEquals("Concatenated string must have same hashcode as literal string", - literalString.hashCode(), concatenatedString.hashCode()); - } - - public void testStartsWith() { - byte[] bytes = getTestBytes(1000, 1234L); - ByteString string = ByteString.copyFrom(bytes); - ByteString prefix = ByteString.copyFrom(bytes, 0, 500); - ByteString suffix = ByteString.copyFrom(bytes, 400, 600); - assertTrue(string.startsWith(ByteString.EMPTY)); - assertTrue(string.startsWith(string)); - assertTrue(string.startsWith(prefix)); - assertFalse(string.startsWith(suffix)); - assertFalse(prefix.startsWith(suffix)); - assertFalse(suffix.startsWith(prefix)); - assertFalse(ByteString.EMPTY.startsWith(prefix)); - assertTrue(ByteString.EMPTY.startsWith(ByteString.EMPTY)); - } - - static List makeConcretePieces(byte[] referenceBytes) { - List pieces = new ArrayList(); - // Starting length should be small enough that we'll do some concatenating by - // copying if we just concatenate all these pieces together. - for (int start = 0, length = 16; start < referenceBytes.length; start += length) { - length = (length << 1) - 1; - if (start + length > referenceBytes.length) { - length = referenceBytes.length - start; - } - pieces.add(ByteString.copyFrom(referenceBytes, start, length)); - } - return pieces; - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java deleted file mode 100644 index 7e67898ea4396a6fa4fecc5c43ffcdc7cec69056..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java +++ /dev/null @@ -1,469 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestRecursiveMessage; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.FilterInputStream; -import java.io.InputStream; -import java.io.IOException; - -/** - * Unit test for {@link CodedInputStream}. - * - * @author kenton@google.com Kenton Varda - */ -public class CodedInputStreamTest extends TestCase { - /** - * Helper to construct a byte array from a bunch of bytes. The inputs are - * actually ints so that I can use hex notation and not get stupid errors - * about precision. - */ - private byte[] bytes(int... bytesAsInts) { - byte[] bytes = new byte[bytesAsInts.length]; - for (int i = 0; i < bytesAsInts.length; i++) { - bytes[i] = (byte) bytesAsInts[i]; - } - return bytes; - } - - /** - * An InputStream which limits the number of bytes it reads at a time. - * We use this to make sure that CodedInputStream doesn't screw up when - * reading in small blocks. - */ - private static final class SmallBlockInputStream extends FilterInputStream { - private final int blockSize; - - public SmallBlockInputStream(byte[] data, int blockSize) { - this(new ByteArrayInputStream(data), blockSize); - } - - public SmallBlockInputStream(InputStream in, int blockSize) { - super(in); - this.blockSize = blockSize; - } - - public int read(byte[] b) throws IOException { - return super.read(b, 0, Math.min(b.length, blockSize)); - } - - public int read(byte[] b, int off, int len) throws IOException { - return super.read(b, off, Math.min(len, blockSize)); - } - } - - /** - * Parses the given bytes using readRawVarint32() and readRawVarint64() and - * checks that the result matches the given value. - */ - private void assertReadVarint(byte[] data, long value) throws Exception { - CodedInputStream input = CodedInputStream.newInstance(data); - assertEquals((int)value, input.readRawVarint32()); - - input = CodedInputStream.newInstance(data); - assertEquals(value, input.readRawVarint64()); - assertTrue(input.isAtEnd()); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { - input = CodedInputStream.newInstance( - new SmallBlockInputStream(data, blockSize)); - assertEquals((int)value, input.readRawVarint32()); - - input = CodedInputStream.newInstance( - new SmallBlockInputStream(data, blockSize)); - assertEquals(value, input.readRawVarint64()); - assertTrue(input.isAtEnd()); - } - - // Try reading direct from an InputStream. We want to verify that it - // doesn't read past the end of the input, so we copy to a new, bigger - // array first. - byte[] longerData = new byte[data.length + 1]; - System.arraycopy(data, 0, longerData, 0, data.length); - InputStream rawInput = new ByteArrayInputStream(longerData); - } - - /** - * Parses the given bytes using readRawVarint32() and readRawVarint64() and - * expects them to fail with an InvalidProtocolBufferException whose - * description matches the given one. - */ - private void assertReadVarintFailure( - InvalidProtocolBufferException expected, byte[] data) - throws Exception { - CodedInputStream input = CodedInputStream.newInstance(data); - try { - input.readRawVarint32(); - fail("Should have thrown an exception."); - } catch (InvalidProtocolBufferException e) { - assertEquals(expected.getMessage(), e.getMessage()); - } - - input = CodedInputStream.newInstance(data); - try { - input.readRawVarint64(); - fail("Should have thrown an exception."); - } catch (InvalidProtocolBufferException e) { - assertEquals(expected.getMessage(), e.getMessage()); - } - } - - /** Tests readRawVarint32() and readRawVarint64(). */ - public void testReadVarint() throws Exception { - assertReadVarint(bytes(0x00), 0); - assertReadVarint(bytes(0x01), 1); - assertReadVarint(bytes(0x7f), 127); - // 14882 - assertReadVarint(bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); - // 2961488830 - assertReadVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - assertReadVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - assertReadVarint( - bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49)); - // 11964378330978735131 - assertReadVarint( - bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), - (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bL << 28) | (0x56L << 35) | (0x00L << 42) | - (0x05L << 49) | (0x26L << 56) | (0x01L << 63)); - } - - /** - * Parses the given bytes using readRawLittleEndian32() and checks - * that the result matches the given value. - */ - private void assertReadLittleEndian32(byte[] data, int value) - throws Exception { - CodedInputStream input = CodedInputStream.newInstance(data); - assertEquals(value, input.readRawLittleEndian32()); - assertTrue(input.isAtEnd()); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { - input = CodedInputStream.newInstance( - new SmallBlockInputStream(data, blockSize)); - assertEquals(value, input.readRawLittleEndian32()); - assertTrue(input.isAtEnd()); - } - } - - /** - * Parses the given bytes using readRawLittleEndian64() and checks - * that the result matches the given value. - */ - private void assertReadLittleEndian64(byte[] data, long value) - throws Exception { - CodedInputStream input = CodedInputStream.newInstance(data); - assertEquals(value, input.readRawLittleEndian64()); - assertTrue(input.isAtEnd()); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { - input = CodedInputStream.newInstance( - new SmallBlockInputStream(data, blockSize)); - assertEquals(value, input.readRawLittleEndian64()); - assertTrue(input.isAtEnd()); - } - } - - /** Tests readRawLittleEndian32() and readRawLittleEndian64(). */ - public void testReadLittleEndian() throws Exception { - assertReadLittleEndian32(bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); - assertReadLittleEndian32(bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); - - assertReadLittleEndian64( - bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), - 0x123456789abcdef0L); - assertReadLittleEndian64( - bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), - 0x9abcdef012345678L); - } - - /** Test decodeZigZag32() and decodeZigZag64(). */ - public void testDecodeZigZag() throws Exception { - assertEquals( 0, CodedInputStream.decodeZigZag32(0)); - assertEquals(-1, CodedInputStream.decodeZigZag32(1)); - assertEquals( 1, CodedInputStream.decodeZigZag32(2)); - assertEquals(-2, CodedInputStream.decodeZigZag32(3)); - assertEquals(0x3FFFFFFF, CodedInputStream.decodeZigZag32(0x7FFFFFFE)); - assertEquals(0xC0000000, CodedInputStream.decodeZigZag32(0x7FFFFFFF)); - assertEquals(0x7FFFFFFF, CodedInputStream.decodeZigZag32(0xFFFFFFFE)); - assertEquals(0x80000000, CodedInputStream.decodeZigZag32(0xFFFFFFFF)); - - assertEquals( 0, CodedInputStream.decodeZigZag64(0)); - assertEquals(-1, CodedInputStream.decodeZigZag64(1)); - assertEquals( 1, CodedInputStream.decodeZigZag64(2)); - assertEquals(-2, CodedInputStream.decodeZigZag64(3)); - assertEquals(0x000000003FFFFFFFL, - CodedInputStream.decodeZigZag64(0x000000007FFFFFFEL)); - assertEquals(0xFFFFFFFFC0000000L, - CodedInputStream.decodeZigZag64(0x000000007FFFFFFFL)); - assertEquals(0x000000007FFFFFFFL, - CodedInputStream.decodeZigZag64(0x00000000FFFFFFFEL)); - assertEquals(0xFFFFFFFF80000000L, - CodedInputStream.decodeZigZag64(0x00000000FFFFFFFFL)); - assertEquals(0x7FFFFFFFFFFFFFFFL, - CodedInputStream.decodeZigZag64(0xFFFFFFFFFFFFFFFEL)); - assertEquals(0x8000000000000000L, - CodedInputStream.decodeZigZag64(0xFFFFFFFFFFFFFFFFL)); - } - - /** Tests reading and parsing a whole message with every field type. */ - public void testReadWholeMessage() throws Exception { - TestAllTypes message = TestUtil.getAllSet(); - - byte[] rawBytes = message.toByteArray(); - assertEquals(rawBytes.length, message.getSerializedSize()); - - TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); - TestUtil.assertAllFieldsSet(message2); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) { - message2 = TestAllTypes.parseFrom( - new SmallBlockInputStream(rawBytes, blockSize)); - TestUtil.assertAllFieldsSet(message2); - } - } - - /** Tests skipField(). */ - public void testSkipWholeMessage() throws Exception { - TestAllTypes message = TestUtil.getAllSet(); - byte[] rawBytes = message.toByteArray(); - - // Create two parallel inputs. Parse one as unknown fields while using - // skipField() to skip each field on the other. Expect the same tags. - CodedInputStream input1 = CodedInputStream.newInstance(rawBytes); - CodedInputStream input2 = CodedInputStream.newInstance(rawBytes); - UnknownFieldSet.Builder unknownFields = UnknownFieldSet.newBuilder(); - - while (true) { - int tag = input1.readTag(); - assertEquals(tag, input2.readTag()); - if (tag == 0) { - break; - } - unknownFields.mergeFieldFrom(tag, input1); - input2.skipField(tag); - } - } - - /** - * Test that a bug in skipRawBytes() has been fixed: if the skip skips - * exactly up to a limit, this should not break things. - */ - public void testSkipRawBytesBug() throws Exception { - byte[] rawBytes = new byte[] { 1, 2 }; - CodedInputStream input = CodedInputStream.newInstance(rawBytes); - - int limit = input.pushLimit(1); - input.skipRawBytes(1); - input.popLimit(limit); - assertEquals(2, input.readRawByte()); - } - - /** - * Test that a bug in skipRawBytes() has been fixed: if the skip skips - * past the end of a buffer with a limit that has been set past the end of - * that buffer, this should not break things. - */ - public void testSkipRawBytesPastEndOfBufferWithLimit() throws Exception { - byte[] rawBytes = new byte[] { 1, 2, 3, 4, 5 }; - CodedInputStream input = CodedInputStream.newInstance( - new SmallBlockInputStream(rawBytes, 3)); - - int limit = input.pushLimit(4); - // In order to expose the bug we need to read at least one byte to prime the - // buffer inside the CodedInputStream. - assertEquals(1, input.readRawByte()); - // Skip to the end of the limit. - input.skipRawBytes(3); - assertTrue(input.isAtEnd()); - input.popLimit(limit); - assertEquals(5, input.readRawByte()); - } - - public void testReadHugeBlob() throws Exception { - // Allocate and initialize a 1MB blob. - byte[] blob = new byte[1 << 20]; - for (int i = 0; i < blob.length; i++) { - blob[i] = (byte)i; - } - - // Make a message containing it. - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - builder.setOptionalBytes(ByteString.copyFrom(blob)); - TestAllTypes message = builder.build(); - - // Serialize and parse it. Make sure to parse from an InputStream, not - // directly from a ByteString, so that CodedInputStream uses buffered - // reading. - TestAllTypes message2 = - TestAllTypes.parseFrom(message.toByteString().newInput()); - - assertEquals(message.getOptionalBytes(), message2.getOptionalBytes()); - - // Make sure all the other fields were parsed correctly. - TestAllTypes message3 = TestAllTypes.newBuilder(message2) - .setOptionalBytes(TestUtil.getAllSet().getOptionalBytes()) - .build(); - TestUtil.assertAllFieldsSet(message3); - } - - public int makeTag(int number, int tag) { - return (number << 3) + tag; - } - - public void testReadMaliciouslyLargeBlob() throws Exception { - ByteString.Output rawOutput = ByteString.newOutput(); - CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - - int tag = makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeRawVarint32(tag); - output.writeRawVarint32(0x7FFFFFFF); - output.writeRawBytes(new byte[32]); // Pad with a few random bytes. - output.flush(); - - CodedInputStream input = rawOutput.toByteString().newCodedInput(); - assertEquals(tag, input.readTag()); - - try { - input.readBytes(); - fail("Should have thrown an exception!"); - } catch (InvalidProtocolBufferException e) { - // success. - } - } - - private TestRecursiveMessage makeRecursiveMessage(int depth) { - if (depth == 0) { - return TestRecursiveMessage.newBuilder().setI(5).build(); - } else { - return TestRecursiveMessage.newBuilder() - .setA(makeRecursiveMessage(depth - 1)).build(); - } - } - - private void assertMessageDepth(TestRecursiveMessage message, int depth) { - if (depth == 0) { - assertFalse(message.hasA()); - assertEquals(5, message.getI()); - } else { - assertTrue(message.hasA()); - assertMessageDepth(message.getA(), depth - 1); - } - } - - public void testResetSizeCounter() throws Exception { - CodedInputStream input = CodedInputStream.newInstance( - new SmallBlockInputStream(new byte[256], 8)); - input.setSizeLimit(16); - input.readRawBytes(16); - assertEquals(16, input.getTotalBytesRead()); - - try { - input.readRawByte(); - fail("Should have thrown an exception!"); - } catch (InvalidProtocolBufferException e) { - // success. - } - - input.resetSizeCounter(); - assertEquals(0, input.getTotalBytesRead()); - input.readRawByte(); // No exception thrown. - input.resetSizeCounter(); - assertEquals(0, input.getTotalBytesRead()); - } - - /** - * Tests that if we read an string that contains invalid UTF-8, no exception - * is thrown. Instead, the invalid bytes are replaced with the Unicode - * "replacement character" U+FFFD. - */ - public void testReadInvalidUtf8() throws Exception { - ByteString.Output rawOutput = ByteString.newOutput(); - CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - - int tag = makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeRawVarint32(tag); - output.writeRawVarint32(1); - output.writeRawBytes(new byte[] { (byte)0x80 }); - output.flush(); - - CodedInputStream input = rawOutput.toByteString().newCodedInput(); - assertEquals(tag, input.readTag()); - String text = input.readString(); - assertEquals(0xfffd, text.charAt(0)); - } - - public void testReadFromSlice() throws Exception { - byte[] bytes = bytes(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); - CodedInputStream in = CodedInputStream.newInstance(bytes, 3, 5); - assertEquals(0, in.getTotalBytesRead()); - for (int i = 3; i < 8; i++) { - assertEquals(i, in.readRawByte()); - assertEquals(i-2, in.getTotalBytesRead()); - } - // eof - assertEquals(0, in.readTag()); - assertEquals(5, in.getTotalBytesRead()); - } - - public void testInvalidTag() throws Exception { - // Any tag number which corresponds to field number zero is invalid and - // should throw InvalidProtocolBufferException. - for (int i = 0; i < 8; i++) { - try { - CodedInputStream.newInstance(bytes(i)).readTag(); - fail("Should have thrown an exception."); - } catch (InvalidProtocolBufferException e) { - } - } - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedOutputStreamTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedOutputStreamTest.java deleted file mode 100644 index 354d89d6640bbde3c86ddde0022cae948b459753..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedOutputStreamTest.java +++ /dev/null @@ -1,318 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.UnittestProto.SparseEnumMessage; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestPackedTypes; -import protobuf_unittest.UnittestProto.TestSparseEnum; - -import junit.framework.TestCase; - -import java.io.ByteArrayOutputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * Unit test for {@link CodedOutputStream}. - * - * @author kenton@google.com Kenton Varda - */ -public class CodedOutputStreamTest extends TestCase { - /** - * Helper to construct a byte array from a bunch of bytes. The inputs are - * actually ints so that I can use hex notation and not get stupid errors - * about precision. - */ - private byte[] bytes(int... bytesAsInts) { - byte[] bytes = new byte[bytesAsInts.length]; - for (int i = 0; i < bytesAsInts.length; i++) { - bytes[i] = (byte) bytesAsInts[i]; - } - return bytes; - } - - /** Arrays.asList() does not work with arrays of primitives. :( */ - private List toList(byte[] bytes) { - List result = new ArrayList(); - for (byte b : bytes) { - result.add(b); - } - return result; - } - - private void assertEqualBytes(byte[] a, byte[] b) { - assertEquals(toList(a), toList(b)); - } - - /** - * Writes the given value using writeRawVarint32() and writeRawVarint64() and - * checks that the result matches the given bytes. - */ - private void assertWriteVarint(byte[] data, long value) throws Exception { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >>> 32) == 0) { - ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); - CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - output.writeRawVarint32((int) value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - - // Also try computing size. - assertEquals(data.length, - CodedOutputStream.computeRawVarint32Size((int) value)); - } - - { - ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); - CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - output.writeRawVarint64(value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - - // Also try computing size. - assertEquals(data.length, - CodedOutputStream.computeRawVarint64Size(value)); - } - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >>> 32) == 0) { - ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); - CodedOutputStream output = - CodedOutputStream.newInstance(rawOutput, blockSize); - output.writeRawVarint32((int) value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - } - - { - ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); - CodedOutputStream output = - CodedOutputStream.newInstance(rawOutput, blockSize); - output.writeRawVarint64(value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - } - } - } - - /** Tests writeRawVarint32() and writeRawVarint64(). */ - public void testWriteVarint() throws Exception { - assertWriteVarint(bytes(0x00), 0); - assertWriteVarint(bytes(0x01), 1); - assertWriteVarint(bytes(0x7f), 127); - // 14882 - assertWriteVarint(bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); - // 2961488830 - assertWriteVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - assertWriteVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - assertWriteVarint( - bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49)); - // 11964378330978735131 - assertWriteVarint( - bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), - (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bL << 28) | (0x56L << 35) | (0x00L << 42) | - (0x05L << 49) | (0x26L << 56) | (0x01L << 63)); - } - - /** - * Parses the given bytes using writeRawLittleEndian32() and checks - * that the result matches the given value. - */ - private void assertWriteLittleEndian32(byte[] data, int value) - throws Exception { - ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); - CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - output.writeRawLittleEndian32(value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { - rawOutput = new ByteArrayOutputStream(); - output = CodedOutputStream.newInstance(rawOutput, blockSize); - output.writeRawLittleEndian32(value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - } - } - - /** - * Parses the given bytes using writeRawLittleEndian64() and checks - * that the result matches the given value. - */ - private void assertWriteLittleEndian64(byte[] data, long value) - throws Exception { - ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); - CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - output.writeRawLittleEndian64(value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { - rawOutput = new ByteArrayOutputStream(); - output = CodedOutputStream.newInstance(rawOutput, blockSize); - output.writeRawLittleEndian64(value); - output.flush(); - assertEqualBytes(data, rawOutput.toByteArray()); - } - } - - /** Tests writeRawLittleEndian32() and writeRawLittleEndian64(). */ - public void testWriteLittleEndian() throws Exception { - assertWriteLittleEndian32(bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); - assertWriteLittleEndian32(bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); - - assertWriteLittleEndian64( - bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), - 0x123456789abcdef0L); - assertWriteLittleEndian64( - bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), - 0x9abcdef012345678L); - } - - /** Test encodeZigZag32() and encodeZigZag64(). */ - public void testEncodeZigZag() throws Exception { - assertEquals(0, CodedOutputStream.encodeZigZag32( 0)); - assertEquals(1, CodedOutputStream.encodeZigZag32(-1)); - assertEquals(2, CodedOutputStream.encodeZigZag32( 1)); - assertEquals(3, CodedOutputStream.encodeZigZag32(-2)); - assertEquals(0x7FFFFFFE, CodedOutputStream.encodeZigZag32(0x3FFFFFFF)); - assertEquals(0x7FFFFFFF, CodedOutputStream.encodeZigZag32(0xC0000000)); - assertEquals(0xFFFFFFFE, CodedOutputStream.encodeZigZag32(0x7FFFFFFF)); - assertEquals(0xFFFFFFFF, CodedOutputStream.encodeZigZag32(0x80000000)); - - assertEquals(0, CodedOutputStream.encodeZigZag64( 0)); - assertEquals(1, CodedOutputStream.encodeZigZag64(-1)); - assertEquals(2, CodedOutputStream.encodeZigZag64( 1)); - assertEquals(3, CodedOutputStream.encodeZigZag64(-2)); - assertEquals(0x000000007FFFFFFEL, - CodedOutputStream.encodeZigZag64(0x000000003FFFFFFFL)); - assertEquals(0x000000007FFFFFFFL, - CodedOutputStream.encodeZigZag64(0xFFFFFFFFC0000000L)); - assertEquals(0x00000000FFFFFFFEL, - CodedOutputStream.encodeZigZag64(0x000000007FFFFFFFL)); - assertEquals(0x00000000FFFFFFFFL, - CodedOutputStream.encodeZigZag64(0xFFFFFFFF80000000L)); - assertEquals(0xFFFFFFFFFFFFFFFEL, - CodedOutputStream.encodeZigZag64(0x7FFFFFFFFFFFFFFFL)); - assertEquals(0xFFFFFFFFFFFFFFFFL, - CodedOutputStream.encodeZigZag64(0x8000000000000000L)); - - // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) - // were chosen semi-randomly via keyboard bashing. - assertEquals(0, - CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(0))); - assertEquals(1, - CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(1))); - assertEquals(-1, - CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(-1))); - assertEquals(14927, - CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(14927))); - assertEquals(-3612, - CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(-3612))); - - assertEquals(0, - CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(0))); - assertEquals(1, - CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(1))); - assertEquals(-1, - CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-1))); - assertEquals(14927, - CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(14927))); - assertEquals(-3612, - CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-3612))); - - assertEquals(856912304801416L, - CodedOutputStream.encodeZigZag64( - CodedInputStream.decodeZigZag64( - 856912304801416L))); - assertEquals(-75123905439571256L, - CodedOutputStream.encodeZigZag64( - CodedInputStream.decodeZigZag64( - -75123905439571256L))); - } - - /** Tests writing a whole message with every field type. */ - public void testWriteWholeMessage() throws Exception { - TestAllTypes message = TestUtil.getAllSet(); - - byte[] rawBytes = message.toByteArray(); - assertEqualBytes(TestUtil.getGoldenMessage().toByteArray(), rawBytes); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) { - ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); - CodedOutputStream output = - CodedOutputStream.newInstance(rawOutput, blockSize); - message.writeTo(output); - output.flush(); - assertEqualBytes(rawBytes, rawOutput.toByteArray()); - } - } - - /** Tests writing a whole message with every packed field type. Ensures the - * wire format of packed fields is compatible with C++. */ - public void testWriteWholePackedFieldsMessage() throws Exception { - TestPackedTypes message = TestUtil.getPackedSet(); - - byte[] rawBytes = message.toByteArray(); - assertEqualBytes(TestUtil.getGoldenPackedFieldsMessage().toByteArray(), - rawBytes); - } - - /** Test writing a message containing a negative enum value. This used to - * fail because the size was not properly computed as a sign-extended varint. - */ - public void testWriteMessageWithNegativeEnumValue() throws Exception { - SparseEnumMessage message = SparseEnumMessage.newBuilder() - .setSparseEnum(TestSparseEnum.SPARSE_E) .build(); - assertTrue(message.getSparseEnum().getNumber() < 0); - byte[] rawBytes = message.toByteArray(); - SparseEnumMessage message2 = SparseEnumMessage.parseFrom(rawBytes); - assertEquals(TestSparseEnum.SPARSE_E, message2.getSparseEnum()); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DescriptorsTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DescriptorsTest.java deleted file mode 100644 index 37e1ca73509708625599db32eff2100de29fd16d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DescriptorsTest.java +++ /dev/null @@ -1,649 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import com.google.protobuf.DescriptorProtos.DescriptorProto; -import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; -import com.google.protobuf.DescriptorProtos.EnumValueDescriptorProto; -import com.google.protobuf.DescriptorProtos.FieldDescriptorProto; -import com.google.protobuf.DescriptorProtos.FileDescriptorProto; -import com.google.protobuf.Descriptors.DescriptorValidationException; -import com.google.protobuf.Descriptors.FileDescriptor; -import com.google.protobuf.Descriptors.Descriptor; -import com.google.protobuf.Descriptors.FieldDescriptor; -import com.google.protobuf.Descriptors.EnumDescriptor; -import com.google.protobuf.Descriptors.EnumValueDescriptor; -import com.google.protobuf.Descriptors.ServiceDescriptor; -import com.google.protobuf.Descriptors.MethodDescriptor; - -import com.google.protobuf.test.UnittestImport; -import com.google.protobuf.test.UnittestImport.ImportEnum; -import com.google.protobuf.test.UnittestImport.ImportMessage; -import protobuf_unittest.UnittestProto; -import protobuf_unittest.UnittestProto.ForeignEnum; -import protobuf_unittest.UnittestProto.ForeignMessage; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestExtremeDefaultValues; -import protobuf_unittest.UnittestProto.TestRequired; -import protobuf_unittest.UnittestProto.TestService; -import protobuf_unittest.UnittestCustomOptions; - - -import junit.framework.TestCase; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * Unit test for {@link Descriptors}. - * - * @author kenton@google.com Kenton Varda - */ -public class DescriptorsTest extends TestCase { - - // Regression test for bug where referencing a FieldDescriptor.Type value - // before a FieldDescriptorProto.Type value would yield a - // ExceptionInInitializerError. - @SuppressWarnings("unused") - private static final Object STATIC_INIT_TEST = FieldDescriptor.Type.BOOL; - - public void testFieldTypeEnumMapping() throws Exception { - assertEquals(FieldDescriptor.Type.values().length, - FieldDescriptorProto.Type.values().length); - for (FieldDescriptor.Type type : FieldDescriptor.Type.values()) { - FieldDescriptorProto.Type protoType = type.toProto(); - assertEquals("TYPE_" + type.name(), protoType.name()); - assertEquals(type, FieldDescriptor.Type.valueOf(protoType)); - } - } - - public void testFileDescriptor() throws Exception { - FileDescriptor file = UnittestProto.getDescriptor(); - - assertEquals("google/protobuf/unittest.proto", file.getName()); - assertEquals("protobuf_unittest", file.getPackage()); - - assertEquals("UnittestProto", file.getOptions().getJavaOuterClassname()); - assertEquals("google/protobuf/unittest.proto", - file.toProto().getName()); - - assertEquals(Arrays.asList(UnittestImport.getDescriptor()), - file.getDependencies()); - - Descriptor messageType = TestAllTypes.getDescriptor(); - assertEquals(messageType, file.getMessageTypes().get(0)); - assertEquals(messageType, file.findMessageTypeByName("TestAllTypes")); - assertNull(file.findMessageTypeByName("NoSuchType")); - assertNull(file.findMessageTypeByName("protobuf_unittest.TestAllTypes")); - for (int i = 0; i < file.getMessageTypes().size(); i++) { - assertEquals(i, file.getMessageTypes().get(i).getIndex()); - } - - EnumDescriptor enumType = ForeignEnum.getDescriptor(); - assertEquals(enumType, file.getEnumTypes().get(0)); - assertEquals(enumType, file.findEnumTypeByName("ForeignEnum")); - assertNull(file.findEnumTypeByName("NoSuchType")); - assertNull(file.findEnumTypeByName("protobuf_unittest.ForeignEnum")); - assertEquals(Arrays.asList(ImportEnum.getDescriptor()), - UnittestImport.getDescriptor().getEnumTypes()); - for (int i = 0; i < file.getEnumTypes().size(); i++) { - assertEquals(i, file.getEnumTypes().get(i).getIndex()); - } - - ServiceDescriptor service = TestService.getDescriptor(); - assertEquals(service, file.getServices().get(0)); - assertEquals(service, file.findServiceByName("TestService")); - assertNull(file.findServiceByName("NoSuchType")); - assertNull(file.findServiceByName("protobuf_unittest.TestService")); - assertEquals(Collections.emptyList(), - UnittestImport.getDescriptor().getServices()); - for (int i = 0; i < file.getServices().size(); i++) { - assertEquals(i, file.getServices().get(i).getIndex()); - } - - FieldDescriptor extension = - UnittestProto.optionalInt32Extension.getDescriptor(); - assertEquals(extension, file.getExtensions().get(0)); - assertEquals(extension, - file.findExtensionByName("optional_int32_extension")); - assertNull(file.findExtensionByName("no_such_ext")); - assertNull(file.findExtensionByName( - "protobuf_unittest.optional_int32_extension")); - assertEquals(Collections.emptyList(), - UnittestImport.getDescriptor().getExtensions()); - for (int i = 0; i < file.getExtensions().size(); i++) { - assertEquals(i, file.getExtensions().get(i).getIndex()); - } - } - - public void testDescriptor() throws Exception { - Descriptor messageType = TestAllTypes.getDescriptor(); - Descriptor nestedType = TestAllTypes.NestedMessage.getDescriptor(); - - assertEquals("TestAllTypes", messageType.getName()); - assertEquals("protobuf_unittest.TestAllTypes", messageType.getFullName()); - assertEquals(UnittestProto.getDescriptor(), messageType.getFile()); - assertNull(messageType.getContainingType()); - assertEquals(DescriptorProtos.MessageOptions.getDefaultInstance(), - messageType.getOptions()); - assertEquals("TestAllTypes", messageType.toProto().getName()); - - assertEquals("NestedMessage", nestedType.getName()); - assertEquals("protobuf_unittest.TestAllTypes.NestedMessage", - nestedType.getFullName()); - assertEquals(UnittestProto.getDescriptor(), nestedType.getFile()); - assertEquals(messageType, nestedType.getContainingType()); - - FieldDescriptor field = messageType.getFields().get(0); - assertEquals("optional_int32", field.getName()); - assertEquals(field, messageType.findFieldByName("optional_int32")); - assertNull(messageType.findFieldByName("no_such_field")); - assertEquals(field, messageType.findFieldByNumber(1)); - assertNull(messageType.findFieldByNumber(571283)); - for (int i = 0; i < messageType.getFields().size(); i++) { - assertEquals(i, messageType.getFields().get(i).getIndex()); - } - - assertEquals(nestedType, messageType.getNestedTypes().get(0)); - assertEquals(nestedType, messageType.findNestedTypeByName("NestedMessage")); - assertNull(messageType.findNestedTypeByName("NoSuchType")); - for (int i = 0; i < messageType.getNestedTypes().size(); i++) { - assertEquals(i, messageType.getNestedTypes().get(i).getIndex()); - } - - EnumDescriptor enumType = TestAllTypes.NestedEnum.getDescriptor(); - assertEquals(enumType, messageType.getEnumTypes().get(0)); - assertEquals(enumType, messageType.findEnumTypeByName("NestedEnum")); - assertNull(messageType.findEnumTypeByName("NoSuchType")); - for (int i = 0; i < messageType.getEnumTypes().size(); i++) { - assertEquals(i, messageType.getEnumTypes().get(i).getIndex()); - } - } - - public void testFieldDescriptor() throws Exception { - Descriptor messageType = TestAllTypes.getDescriptor(); - FieldDescriptor primitiveField = - messageType.findFieldByName("optional_int32"); - FieldDescriptor enumField = - messageType.findFieldByName("optional_nested_enum"); - FieldDescriptor messageField = - messageType.findFieldByName("optional_foreign_message"); - FieldDescriptor cordField = - messageType.findFieldByName("optional_cord"); - FieldDescriptor extension = - UnittestProto.optionalInt32Extension.getDescriptor(); - FieldDescriptor nestedExtension = TestRequired.single.getDescriptor(); - - assertEquals("optional_int32", primitiveField.getName()); - assertEquals("protobuf_unittest.TestAllTypes.optional_int32", - primitiveField.getFullName()); - assertEquals(1, primitiveField.getNumber()); - assertEquals(messageType, primitiveField.getContainingType()); - assertEquals(UnittestProto.getDescriptor(), primitiveField.getFile()); - assertEquals(FieldDescriptor.Type.INT32, primitiveField.getType()); - assertEquals(FieldDescriptor.JavaType.INT, primitiveField.getJavaType()); - assertEquals(DescriptorProtos.FieldOptions.getDefaultInstance(), - primitiveField.getOptions()); - assertFalse(primitiveField.isExtension()); - assertEquals("optional_int32", primitiveField.toProto().getName()); - - assertEquals("optional_nested_enum", enumField.getName()); - assertEquals(FieldDescriptor.Type.ENUM, enumField.getType()); - assertEquals(FieldDescriptor.JavaType.ENUM, enumField.getJavaType()); - assertEquals(TestAllTypes.NestedEnum.getDescriptor(), - enumField.getEnumType()); - - assertEquals("optional_foreign_message", messageField.getName()); - assertEquals(FieldDescriptor.Type.MESSAGE, messageField.getType()); - assertEquals(FieldDescriptor.JavaType.MESSAGE, messageField.getJavaType()); - assertEquals(ForeignMessage.getDescriptor(), messageField.getMessageType()); - - assertEquals("optional_cord", cordField.getName()); - assertEquals(FieldDescriptor.Type.STRING, cordField.getType()); - assertEquals(FieldDescriptor.JavaType.STRING, cordField.getJavaType()); - assertEquals(DescriptorProtos.FieldOptions.CType.CORD, - cordField.getOptions().getCtype()); - - assertEquals("optional_int32_extension", extension.getName()); - assertEquals("protobuf_unittest.optional_int32_extension", - extension.getFullName()); - assertEquals(1, extension.getNumber()); - assertEquals(TestAllExtensions.getDescriptor(), - extension.getContainingType()); - assertEquals(UnittestProto.getDescriptor(), extension.getFile()); - assertEquals(FieldDescriptor.Type.INT32, extension.getType()); - assertEquals(FieldDescriptor.JavaType.INT, extension.getJavaType()); - assertEquals(DescriptorProtos.FieldOptions.getDefaultInstance(), - extension.getOptions()); - assertTrue(extension.isExtension()); - assertEquals(null, extension.getExtensionScope()); - assertEquals("optional_int32_extension", extension.toProto().getName()); - - assertEquals("single", nestedExtension.getName()); - assertEquals("protobuf_unittest.TestRequired.single", - nestedExtension.getFullName()); - assertEquals(TestRequired.getDescriptor(), - nestedExtension.getExtensionScope()); - } - - public void testFieldDescriptorLabel() throws Exception { - FieldDescriptor requiredField = - TestRequired.getDescriptor().findFieldByName("a"); - FieldDescriptor optionalField = - TestAllTypes.getDescriptor().findFieldByName("optional_int32"); - FieldDescriptor repeatedField = - TestAllTypes.getDescriptor().findFieldByName("repeated_int32"); - - assertTrue(requiredField.isRequired()); - assertFalse(requiredField.isRepeated()); - assertFalse(optionalField.isRequired()); - assertFalse(optionalField.isRepeated()); - assertFalse(repeatedField.isRequired()); - assertTrue(repeatedField.isRepeated()); - } - - public void testFieldDescriptorDefault() throws Exception { - Descriptor d = TestAllTypes.getDescriptor(); - assertFalse(d.findFieldByName("optional_int32").hasDefaultValue()); - assertEquals(0, d.findFieldByName("optional_int32").getDefaultValue()); - assertTrue(d.findFieldByName("default_int32").hasDefaultValue()); - assertEquals(41, d.findFieldByName("default_int32").getDefaultValue()); - - d = TestExtremeDefaultValues.getDescriptor(); - assertEquals( - ByteString.copyFrom( - "\0\001\007\b\f\n\r\t\013\\\'\"\u00fe".getBytes("ISO-8859-1")), - d.findFieldByName("escaped_bytes").getDefaultValue()); - assertEquals(-1, d.findFieldByName("large_uint32").getDefaultValue()); - assertEquals(-1L, d.findFieldByName("large_uint64").getDefaultValue()); - } - - public void testEnumDescriptor() throws Exception { - EnumDescriptor enumType = ForeignEnum.getDescriptor(); - EnumDescriptor nestedType = TestAllTypes.NestedEnum.getDescriptor(); - - assertEquals("ForeignEnum", enumType.getName()); - assertEquals("protobuf_unittest.ForeignEnum", enumType.getFullName()); - assertEquals(UnittestProto.getDescriptor(), enumType.getFile()); - assertNull(enumType.getContainingType()); - assertEquals(DescriptorProtos.EnumOptions.getDefaultInstance(), - enumType.getOptions()); - - assertEquals("NestedEnum", nestedType.getName()); - assertEquals("protobuf_unittest.TestAllTypes.NestedEnum", - nestedType.getFullName()); - assertEquals(UnittestProto.getDescriptor(), nestedType.getFile()); - assertEquals(TestAllTypes.getDescriptor(), nestedType.getContainingType()); - - EnumValueDescriptor value = ForeignEnum.FOREIGN_FOO.getValueDescriptor(); - assertEquals(value, enumType.getValues().get(0)); - assertEquals("FOREIGN_FOO", value.getName()); - assertEquals(4, value.getNumber()); - assertEquals(value, enumType.findValueByName("FOREIGN_FOO")); - assertEquals(value, enumType.findValueByNumber(4)); - assertNull(enumType.findValueByName("NO_SUCH_VALUE")); - for (int i = 0; i < enumType.getValues().size(); i++) { - assertEquals(i, enumType.getValues().get(i).getIndex()); - } - } - - public void testServiceDescriptor() throws Exception { - ServiceDescriptor service = TestService.getDescriptor(); - - assertEquals("TestService", service.getName()); - assertEquals("protobuf_unittest.TestService", service.getFullName()); - assertEquals(UnittestProto.getDescriptor(), service.getFile()); - - assertEquals(2, service.getMethods().size()); - - MethodDescriptor fooMethod = service.getMethods().get(0); - assertEquals("Foo", fooMethod.getName()); - assertEquals(UnittestProto.FooRequest.getDescriptor(), - fooMethod.getInputType()); - assertEquals(UnittestProto.FooResponse.getDescriptor(), - fooMethod.getOutputType()); - assertEquals(fooMethod, service.findMethodByName("Foo")); - - MethodDescriptor barMethod = service.getMethods().get(1); - assertEquals("Bar", barMethod.getName()); - assertEquals(UnittestProto.BarRequest.getDescriptor(), - barMethod.getInputType()); - assertEquals(UnittestProto.BarResponse.getDescriptor(), - barMethod.getOutputType()); - assertEquals(barMethod, service.findMethodByName("Bar")); - - assertNull(service.findMethodByName("NoSuchMethod")); - - for (int i = 0; i < service.getMethods().size(); i++) { - assertEquals(i, service.getMethods().get(i).getIndex()); - } - } - - - public void testCustomOptions() throws Exception { - Descriptor descriptor = - UnittestCustomOptions.TestMessageWithCustomOptions.getDescriptor(); - - assertTrue( - descriptor.getOptions().hasExtension(UnittestCustomOptions.messageOpt1)); - assertEquals(Integer.valueOf(-56), - descriptor.getOptions().getExtension(UnittestCustomOptions.messageOpt1)); - - FieldDescriptor field = descriptor.findFieldByName("field1"); - assertNotNull(field); - - assertTrue( - field.getOptions().hasExtension(UnittestCustomOptions.fieldOpt1)); - assertEquals(Long.valueOf(8765432109L), - field.getOptions().getExtension(UnittestCustomOptions.fieldOpt1)); - - EnumDescriptor enumType = - UnittestCustomOptions.TestMessageWithCustomOptions.AnEnum.getDescriptor(); - - assertTrue( - enumType.getOptions().hasExtension(UnittestCustomOptions.enumOpt1)); - assertEquals(Integer.valueOf(-789), - enumType.getOptions().getExtension(UnittestCustomOptions.enumOpt1)); - - ServiceDescriptor service = - UnittestCustomOptions.TestServiceWithCustomOptions.getDescriptor(); - - assertTrue( - service.getOptions().hasExtension(UnittestCustomOptions.serviceOpt1)); - assertEquals(Long.valueOf(-9876543210L), - service.getOptions().getExtension(UnittestCustomOptions.serviceOpt1)); - - MethodDescriptor method = service.findMethodByName("Foo"); - assertNotNull(method); - - assertTrue( - method.getOptions().hasExtension(UnittestCustomOptions.methodOpt1)); - assertEquals(UnittestCustomOptions.MethodOpt1.METHODOPT1_VAL2, - method.getOptions().getExtension(UnittestCustomOptions.methodOpt1)); - } - - /** - * Test that the FieldDescriptor.Type enum is the same as the - * WireFormat.FieldType enum. - */ - public void testFieldTypeTablesMatch() throws Exception { - FieldDescriptor.Type[] values1 = FieldDescriptor.Type.values(); - WireFormat.FieldType[] values2 = WireFormat.FieldType.values(); - - assertEquals(values1.length, values2.length); - - for (int i = 0; i < values1.length; i++) { - assertEquals(values1[i].toString(), values2[i].toString()); - } - } - - /** - * Test that the FieldDescriptor.JavaType enum is the same as the - * WireFormat.JavaType enum. - */ - public void testJavaTypeTablesMatch() throws Exception { - FieldDescriptor.JavaType[] values1 = FieldDescriptor.JavaType.values(); - WireFormat.JavaType[] values2 = WireFormat.JavaType.values(); - - assertEquals(values1.length, values2.length); - - for (int i = 0; i < values1.length; i++) { - assertEquals(values1[i].toString(), values2[i].toString()); - } - } - - public void testEnormousDescriptor() throws Exception { - // The descriptor for this file is larger than 64k, yet it did not cause - // a compiler error due to an over-long string literal. - assertTrue( - UnittestEnormousDescriptor.getDescriptor() - .toProto().getSerializedSize() > 65536); - } - - /** - * Tests that the DescriptorValidationException works as intended. - */ - public void testDescriptorValidatorException() throws Exception { - FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() - .setName("foo.proto") - .addMessageType(DescriptorProto.newBuilder() - .setName("Foo") - .addField(FieldDescriptorProto.newBuilder() - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .setType(FieldDescriptorProto.Type.TYPE_INT32) - .setName("foo") - .setNumber(1) - .setDefaultValue("invalid") - .build()) - .build()) - .build(); - try { - Descriptors.FileDescriptor.buildFrom(fileDescriptorProto, - new FileDescriptor[0]); - fail("DescriptorValidationException expected"); - } catch (DescriptorValidationException e) { - // Expected; check that the error message contains some useful hints - assertTrue(e.getMessage().indexOf("foo") != -1); - assertTrue(e.getMessage().indexOf("Foo") != -1); - assertTrue(e.getMessage().indexOf("invalid") != -1); - assertTrue(e.getCause() instanceof NumberFormatException); - assertTrue(e.getCause().getMessage().indexOf("invalid") != -1); - } - } - - /** - * Tests the translate/crosslink for an example where a message field's name - * and type name are the same. - */ - public void testDescriptorComplexCrosslink() throws Exception { - FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() - .setName("foo.proto") - .addMessageType(DescriptorProto.newBuilder() - .setName("Foo") - .addField(FieldDescriptorProto.newBuilder() - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .setType(FieldDescriptorProto.Type.TYPE_INT32) - .setName("foo") - .setNumber(1) - .build()) - .build()) - .addMessageType(DescriptorProto.newBuilder() - .setName("Bar") - .addField(FieldDescriptorProto.newBuilder() - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .setTypeName("Foo") - .setName("Foo") - .setNumber(1) - .build()) - .build()) - .build(); - // translate and crosslink - FileDescriptor file = - Descriptors.FileDescriptor.buildFrom(fileDescriptorProto, - new FileDescriptor[0]); - // verify resulting descriptors - assertNotNull(file); - List msglist = file.getMessageTypes(); - assertNotNull(msglist); - assertTrue(msglist.size() == 2); - boolean barFound = false; - for (Descriptor desc : msglist) { - if (desc.getName().equals("Bar")) { - barFound = true; - assertNotNull(desc.getFields()); - List fieldlist = desc.getFields(); - assertNotNull(fieldlist); - assertTrue(fieldlist.size() == 1); - assertTrue(fieldlist.get(0).getType() == FieldDescriptor.Type.MESSAGE); - assertTrue(fieldlist.get(0).getMessageType().getName().equals("Foo")); - } - } - assertTrue(barFound); - } - - public void testInvalidPublicDependency() throws Exception { - FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() - .setName("foo.proto") .build(); - FileDescriptorProto barProto = FileDescriptorProto.newBuilder() - .setName("boo.proto") - .addDependency("foo.proto") - .addPublicDependency(1) // Error, should be 0. - .build(); - FileDescriptor fooFile = Descriptors.FileDescriptor.buildFrom(fooProto, - new FileDescriptor[0]); - try { - Descriptors.FileDescriptor.buildFrom(barProto, - new FileDescriptor[] {fooFile}); - fail("DescriptorValidationException expected"); - } catch (DescriptorValidationException e) { - assertTrue( - e.getMessage().indexOf("Invalid public dependency index.") != -1); - } - } - - public void testHiddenDependency() throws Exception { - FileDescriptorProto barProto = FileDescriptorProto.newBuilder() - .setName("bar.proto") - .addMessageType(DescriptorProto.newBuilder().setName("Bar")) - .build(); - FileDescriptorProto forwardProto = FileDescriptorProto.newBuilder() - .setName("forward.proto") - .addDependency("bar.proto") - .build(); - FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() - .setName("foo.proto") - .addDependency("forward.proto") - .addMessageType(DescriptorProto.newBuilder() - .setName("Foo") - .addField(FieldDescriptorProto.newBuilder() - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .setTypeName("Bar") - .setName("bar") - .setNumber(1))) - .build(); - FileDescriptor barFile = Descriptors.FileDescriptor.buildFrom( - barProto, new FileDescriptor[0]); - FileDescriptor forwardFile = Descriptors.FileDescriptor.buildFrom( - forwardProto, new FileDescriptor[] {barFile}); - - try { - Descriptors.FileDescriptor.buildFrom( - fooProto, new FileDescriptor[] {forwardFile}); - fail("DescriptorValidationException expected"); - } catch (DescriptorValidationException e) { - assertTrue(e.getMessage().indexOf("Bar") != -1); - assertTrue(e.getMessage().indexOf("is not defined") != -1); - } - } - - public void testPublicDependency() throws Exception { - FileDescriptorProto barProto = FileDescriptorProto.newBuilder() - .setName("bar.proto") - .addMessageType(DescriptorProto.newBuilder().setName("Bar")) - .build(); - FileDescriptorProto forwardProto = FileDescriptorProto.newBuilder() - .setName("forward.proto") - .addDependency("bar.proto") - .addPublicDependency(0) - .build(); - FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() - .setName("foo.proto") - .addDependency("forward.proto") - .addMessageType(DescriptorProto.newBuilder() - .setName("Foo") - .addField(FieldDescriptorProto.newBuilder() - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .setTypeName("Bar") - .setName("bar") - .setNumber(1))) - .build(); - FileDescriptor barFile = Descriptors.FileDescriptor.buildFrom( - barProto, new FileDescriptor[0]); - FileDescriptor forwardFile = Descriptors.FileDescriptor.buildFrom( - forwardProto, new FileDescriptor[]{barFile}); - Descriptors.FileDescriptor.buildFrom( - fooProto, new FileDescriptor[] {forwardFile}); - } - - /** - * Tests the translate/crosslink for an example with a more complex namespace - * referencing. - */ - public void testComplexNamespacePublicDependency() throws Exception { - FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() - .setName("bar.proto") - .setPackage("a.b.c.d.bar.shared") - .addEnumType(EnumDescriptorProto.newBuilder() - .setName("MyEnum") - .addValue(EnumValueDescriptorProto.newBuilder() - .setName("BLAH") - .setNumber(1))) - .build(); - FileDescriptorProto barProto = FileDescriptorProto.newBuilder() - .setName("foo.proto") - .addDependency("bar.proto") - .setPackage("a.b.c.d.foo.shared") - .addMessageType(DescriptorProto.newBuilder() - .setName("MyMessage") - .addField(FieldDescriptorProto.newBuilder() - .setLabel(FieldDescriptorProto.Label.LABEL_REPEATED) - .setTypeName("bar.shared.MyEnum") - .setName("MyField") - .setNumber(1))) - .build(); - // translate and crosslink - FileDescriptor fooFile = Descriptors.FileDescriptor.buildFrom( - fooProto, new FileDescriptor[0]); - FileDescriptor barFile = Descriptors.FileDescriptor.buildFrom( - barProto, new FileDescriptor[]{fooFile}); - // verify resulting descriptors - assertNotNull(barFile); - List msglist = barFile.getMessageTypes(); - assertNotNull(msglist); - assertTrue(msglist.size() == 1); - Descriptor desc = msglist.get(0); - if (desc.getName().equals("MyMessage")) { - assertNotNull(desc.getFields()); - List fieldlist = desc.getFields(); - assertNotNull(fieldlist); - assertTrue(fieldlist.size() == 1); - FieldDescriptor field = fieldlist.get(0); - assertTrue(field.getType() == FieldDescriptor.Type.ENUM); - assertTrue(field.getEnumType().getName().equals("MyEnum")); - assertTrue(field.getEnumType().getFile().getName().equals("bar.proto")); - assertTrue(field.getEnumType().getFile().getPackage().equals( - "a.b.c.d.bar.shared")); - } - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DynamicMessageTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DynamicMessageTest.java deleted file mode 100644 index 00230678fb50ed29c26364fbdd01b73f9054ba4a..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DynamicMessageTest.java +++ /dev/null @@ -1,265 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestEmptyMessage; -import protobuf_unittest.UnittestProto.TestPackedTypes; - -import junit.framework.TestCase; -import java.util.Arrays; - -/** - * Unit test for {@link DynamicMessage}. See also {@link MessageTest}, which - * tests some {@link DynamicMessage} functionality. - * - * @author kenton@google.com Kenton Varda - */ -public class DynamicMessageTest extends TestCase { - TestUtil.ReflectionTester reflectionTester = - new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null); - - TestUtil.ReflectionTester extensionsReflectionTester = - new TestUtil.ReflectionTester(TestAllExtensions.getDescriptor(), - TestUtil.getExtensionRegistry()); - TestUtil.ReflectionTester packedReflectionTester = - new TestUtil.ReflectionTester(TestPackedTypes.getDescriptor(), null); - - public void testDynamicMessageAccessors() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - reflectionTester.setAllFieldsViaReflection(builder); - Message message = builder.build(); - reflectionTester.assertAllFieldsSetViaReflection(message); - } - - public void testSettersAfterBuild() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - Message firstMessage = builder.build(); - // double build() - builder.build(); - // clear() after build() - builder.clear(); - // setters after build() - reflectionTester.setAllFieldsViaReflection(builder); - Message message = builder.build(); - reflectionTester.assertAllFieldsSetViaReflection(message); - // repeated setters after build() - reflectionTester.modifyRepeatedFieldsViaReflection(builder); - message = builder.build(); - reflectionTester.assertRepeatedFieldsModifiedViaReflection(message); - // firstMessage shouldn't have been modified. - reflectionTester.assertClearViaReflection(firstMessage); - } - - public void testUnknownFields() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestEmptyMessage.getDescriptor()); - builder.setUnknownFields(UnknownFieldSet.newBuilder() - .addField(1, UnknownFieldSet.Field.newBuilder().addVarint(1).build()) - .addField(2, UnknownFieldSet.Field.newBuilder().addFixed32(1).build()) - .build()); - Message message = builder.build(); - assertEquals(2, message.getUnknownFields().asMap().size()); - // clone() with unknown fields - Message.Builder newBuilder = builder.clone(); - assertEquals(2, newBuilder.getUnknownFields().asMap().size()); - // clear() with unknown fields - newBuilder.clear(); - assertTrue(newBuilder.getUnknownFields().asMap().isEmpty()); - // serialize/parse with unknown fields - newBuilder.mergeFrom(message.toByteString()); - assertEquals(2, newBuilder.getUnknownFields().asMap().size()); - } - - public void testDynamicMessageSettersRejectNull() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - reflectionTester.assertReflectionSettersRejectNull(builder); - } - - public void testDynamicMessageExtensionAccessors() throws Exception { - // We don't need to extensively test DynamicMessage's handling of - // extensions because, frankly, it doesn't do anything special with them. - // It treats them just like any other fields. - Message.Builder builder = - DynamicMessage.newBuilder(TestAllExtensions.getDescriptor()); - extensionsReflectionTester.setAllFieldsViaReflection(builder); - Message message = builder.build(); - extensionsReflectionTester.assertAllFieldsSetViaReflection(message); - } - - public void testDynamicMessageExtensionSettersRejectNull() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestAllExtensions.getDescriptor()); - extensionsReflectionTester.assertReflectionSettersRejectNull(builder); - } - - public void testDynamicMessageRepeatedSetters() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - reflectionTester.setAllFieldsViaReflection(builder); - reflectionTester.modifyRepeatedFieldsViaReflection(builder); - Message message = builder.build(); - reflectionTester.assertRepeatedFieldsModifiedViaReflection(message); - } - - public void testDynamicMessageRepeatedSettersRejectNull() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - reflectionTester.assertReflectionRepeatedSettersRejectNull(builder); - } - - public void testDynamicMessageDefaults() throws Exception { - reflectionTester.assertClearViaReflection( - DynamicMessage.getDefaultInstance(TestAllTypes.getDescriptor())); - reflectionTester.assertClearViaReflection( - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()).build()); - } - - public void testDynamicMessageSerializedSize() throws Exception { - TestAllTypes message = TestUtil.getAllSet(); - - Message.Builder dynamicBuilder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - reflectionTester.setAllFieldsViaReflection(dynamicBuilder); - Message dynamicMessage = dynamicBuilder.build(); - - assertEquals(message.getSerializedSize(), - dynamicMessage.getSerializedSize()); - } - - public void testDynamicMessageSerialization() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - reflectionTester.setAllFieldsViaReflection(builder); - Message message = builder.build(); - - ByteString rawBytes = message.toByteString(); - TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); - - TestUtil.assertAllFieldsSet(message2); - - // In fact, the serialized forms should be exactly the same, byte-for-byte. - assertEquals(TestUtil.getAllSet().toByteString(), rawBytes); - } - - public void testDynamicMessageParsing() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes message = builder.build(); - - ByteString rawBytes = message.toByteString(); - - Message message2 = - DynamicMessage.parseFrom(TestAllTypes.getDescriptor(), rawBytes); - reflectionTester.assertAllFieldsSetViaReflection(message2); - - // Test Parser interface. - Message message3 = message2.getParserForType().parseFrom(rawBytes); - reflectionTester.assertAllFieldsSetViaReflection(message3); - } - - public void testDynamicMessageExtensionParsing() throws Exception { - ByteString rawBytes = TestUtil.getAllExtensionsSet().toByteString(); - Message message = DynamicMessage.parseFrom( - TestAllExtensions.getDescriptor(), rawBytes, - TestUtil.getExtensionRegistry()); - extensionsReflectionTester.assertAllFieldsSetViaReflection(message); - - // Test Parser interface. - Message message2 = message.getParserForType().parseFrom( - rawBytes, TestUtil.getExtensionRegistry()); - extensionsReflectionTester.assertAllFieldsSetViaReflection(message2); - } - - public void testDynamicMessagePackedSerialization() throws Exception { - Message.Builder builder = - DynamicMessage.newBuilder(TestPackedTypes.getDescriptor()); - packedReflectionTester.setPackedFieldsViaReflection(builder); - Message message = builder.build(); - - ByteString rawBytes = message.toByteString(); - TestPackedTypes message2 = TestPackedTypes.parseFrom(rawBytes); - - TestUtil.assertPackedFieldsSet(message2); - - // In fact, the serialized forms should be exactly the same, byte-for-byte. - assertEquals(TestUtil.getPackedSet().toByteString(), rawBytes); - } - - public void testDynamicMessagePackedParsing() throws Exception { - TestPackedTypes.Builder builder = TestPackedTypes.newBuilder(); - TestUtil.setPackedFields(builder); - TestPackedTypes message = builder.build(); - - ByteString rawBytes = message.toByteString(); - - Message message2 = - DynamicMessage.parseFrom(TestPackedTypes.getDescriptor(), rawBytes); - packedReflectionTester.assertPackedFieldsSetViaReflection(message2); - - // Test Parser interface. - Message message3 = message2.getParserForType().parseFrom(rawBytes); - packedReflectionTester.assertPackedFieldsSetViaReflection(message3); - } - - public void testDynamicMessageCopy() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes message = builder.build(); - - DynamicMessage copy = DynamicMessage.newBuilder(message).build(); - reflectionTester.assertAllFieldsSetViaReflection(copy); - } - - public void testToBuilder() throws Exception { - DynamicMessage.Builder builder = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); - reflectionTester.setAllFieldsViaReflection(builder); - int unknownFieldNum = 9; - long unknownFieldVal = 90; - builder.setUnknownFields(UnknownFieldSet.newBuilder() - .addField(unknownFieldNum, - UnknownFieldSet.Field.newBuilder() - .addVarint(unknownFieldVal).build()) - .build()); - DynamicMessage message = builder.build(); - - DynamicMessage derived = message.toBuilder().build(); - reflectionTester.assertAllFieldsSetViaReflection(derived); - assertEquals(Arrays.asList(unknownFieldVal), - derived.getUnknownFields().getField(unknownFieldNum).getVarintList()); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/GeneratedMessageTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/GeneratedMessageTest.java deleted file mode 100644 index 1e7d41e8516fc0e16c98a51198ecd5d44f1887d4..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/GeneratedMessageTest.java +++ /dev/null @@ -1,961 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import com.google.protobuf.Descriptors.Descriptor; -import com.google.protobuf.Descriptors.FieldDescriptor; -import com.google.protobuf.test.UnittestImport; -import protobuf_unittest.EnumWithNoOuter; -import protobuf_unittest.MessageWithNoOuter; -import protobuf_unittest.MultipleFilesTestProto; -import protobuf_unittest.NestedExtension.MyNestedExtension; -import protobuf_unittest.NonNestedExtension; -import protobuf_unittest.NonNestedExtension.MessageToBeExtended; -import protobuf_unittest.NonNestedExtension.MyNonNestedExtension; -import protobuf_unittest.ServiceWithNoOuter; -import protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize; -import protobuf_unittest.UnittestOptimizeFor.TestOptionalOptimizedForSize; -import protobuf_unittest.UnittestOptimizeFor.TestRequiredOptimizedForSize; -import protobuf_unittest.UnittestProto; -import protobuf_unittest.UnittestProto.ForeignEnum; -import protobuf_unittest.UnittestProto.ForeignMessage; -import protobuf_unittest.UnittestProto.ForeignMessageOrBuilder; -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage; -import protobuf_unittest.UnittestProto.TestAllTypesOrBuilder; -import protobuf_unittest.UnittestProto.TestExtremeDefaultValues; -import protobuf_unittest.UnittestProto.TestPackedTypes; -import protobuf_unittest.UnittestProto.TestUnpackedTypes; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * Unit test for generated messages and generated code. See also - * {@link MessageTest}, which tests some generated message functionality. - * - * @author kenton@google.com Kenton Varda - */ -public class GeneratedMessageTest extends TestCase { - TestUtil.ReflectionTester reflectionTester = - new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null); - - public void testDefaultInstance() throws Exception { - assertSame(TestAllTypes.getDefaultInstance(), - TestAllTypes.getDefaultInstance().getDefaultInstanceForType()); - assertSame(TestAllTypes.getDefaultInstance(), - TestAllTypes.newBuilder().getDefaultInstanceForType()); - } - - public void testMessageOrBuilder() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes message = builder.build(); - TestUtil.assertAllFieldsSet(message); - } - - public void testUsingBuilderMultipleTimes() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - // primitive field scalar and repeated - builder.setOptionalSfixed64(100); - builder.addRepeatedInt32(100); - // enum field scalar and repeated - builder.setOptionalImportEnum(UnittestImport.ImportEnum.IMPORT_BAR); - builder.addRepeatedImportEnum(UnittestImport.ImportEnum.IMPORT_BAR); - // proto field scalar and repeated - builder.setOptionalForeignMessage(ForeignMessage.newBuilder().setC(1)); - builder.addRepeatedForeignMessage(ForeignMessage.newBuilder().setC(1)); - - TestAllTypes value1 = builder.build(); - - assertEquals(100, value1.getOptionalSfixed64()); - assertEquals(100, value1.getRepeatedInt32(0)); - assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, - value1.getOptionalImportEnum()); - assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, - value1.getRepeatedImportEnum(0)); - assertEquals(1, value1.getOptionalForeignMessage().getC()); - assertEquals(1, value1.getRepeatedForeignMessage(0).getC()); - - // Make sure that builder didn't update previously created values - builder.setOptionalSfixed64(200); - builder.setRepeatedInt32(0, 200); - builder.setOptionalImportEnum(UnittestImport.ImportEnum.IMPORT_FOO); - builder.setRepeatedImportEnum(0, UnittestImport.ImportEnum.IMPORT_FOO); - builder.setOptionalForeignMessage(ForeignMessage.newBuilder().setC(2)); - builder.setRepeatedForeignMessage(0, ForeignMessage.newBuilder().setC(2)); - - TestAllTypes value2 = builder.build(); - - // Make sure value1 didn't change. - assertEquals(100, value1.getOptionalSfixed64()); - assertEquals(100, value1.getRepeatedInt32(0)); - assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, - value1.getOptionalImportEnum()); - assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, - value1.getRepeatedImportEnum(0)); - assertEquals(1, value1.getOptionalForeignMessage().getC()); - assertEquals(1, value1.getRepeatedForeignMessage(0).getC()); - - // Make sure value2 is correct - assertEquals(200, value2.getOptionalSfixed64()); - assertEquals(200, value2.getRepeatedInt32(0)); - assertEquals(UnittestImport.ImportEnum.IMPORT_FOO, - value2.getOptionalImportEnum()); - assertEquals(UnittestImport.ImportEnum.IMPORT_FOO, - value2.getRepeatedImportEnum(0)); - assertEquals(2, value2.getOptionalForeignMessage().getC()); - assertEquals(2, value2.getRepeatedForeignMessage(0).getC()); - } - - public void testRepeatedArraysAreImmutable() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - builder.addRepeatedInt32(100); - builder.addRepeatedImportEnum(UnittestImport.ImportEnum.IMPORT_BAR); - builder.addRepeatedForeignMessage(ForeignMessage.getDefaultInstance()); - assertIsUnmodifiable(builder.getRepeatedInt32List()); - assertIsUnmodifiable(builder.getRepeatedImportEnumList()); - assertIsUnmodifiable(builder.getRepeatedForeignMessageList()); - assertIsUnmodifiable(builder.getRepeatedFloatList()); - - - TestAllTypes value = builder.build(); - assertIsUnmodifiable(value.getRepeatedInt32List()); - assertIsUnmodifiable(value.getRepeatedImportEnumList()); - assertIsUnmodifiable(value.getRepeatedForeignMessageList()); - assertIsUnmodifiable(value.getRepeatedFloatList()); - } - - public void testParsedMessagesAreImmutable() throws Exception { - TestAllTypes value = TestAllTypes.PARSER.parseFrom( - TestUtil.getAllSet().toByteString()); - assertIsUnmodifiable(value.getRepeatedInt32List()); - assertIsUnmodifiable(value.getRepeatedInt64List()); - assertIsUnmodifiable(value.getRepeatedUint32List()); - assertIsUnmodifiable(value.getRepeatedUint64List()); - assertIsUnmodifiable(value.getRepeatedSint32List()); - assertIsUnmodifiable(value.getRepeatedSint64List()); - assertIsUnmodifiable(value.getRepeatedFixed32List()); - assertIsUnmodifiable(value.getRepeatedFixed64List()); - assertIsUnmodifiable(value.getRepeatedSfixed32List()); - assertIsUnmodifiable(value.getRepeatedSfixed64List()); - assertIsUnmodifiable(value.getRepeatedFloatList()); - assertIsUnmodifiable(value.getRepeatedDoubleList()); - assertIsUnmodifiable(value.getRepeatedBoolList()); - assertIsUnmodifiable(value.getRepeatedStringList()); - assertIsUnmodifiable(value.getRepeatedBytesList()); - assertIsUnmodifiable(value.getRepeatedGroupList()); - assertIsUnmodifiable(value.getRepeatedNestedMessageList()); - assertIsUnmodifiable(value.getRepeatedForeignMessageList()); - assertIsUnmodifiable(value.getRepeatedImportMessageList()); - assertIsUnmodifiable(value.getRepeatedNestedEnumList()); - assertIsUnmodifiable(value.getRepeatedForeignEnumList()); - assertIsUnmodifiable(value.getRepeatedImportEnumList()); - } - - private void assertIsUnmodifiable(List list) { - if (list == Collections.emptyList()) { - // OKAY -- Need to check this b/c EmptyList allows you to call clear. - } else { - try { - list.clear(); - fail("List wasn't immutable"); - } catch (UnsupportedOperationException e) { - // good - } - } - } - - public void testSettersRejectNull() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - try { - builder.setOptionalString(null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setOptionalBytes(null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setOptionalNestedMessage((TestAllTypes.NestedMessage) null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setOptionalNestedMessage( - (TestAllTypes.NestedMessage.Builder) null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setOptionalNestedEnum(null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedString(null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedBytes(null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedNestedMessage((TestAllTypes.NestedMessage) null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedNestedMessage( - (TestAllTypes.NestedMessage.Builder) null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedNestedEnum(null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - } - - public void testRepeatedSetters() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestUtil.modifyRepeatedFields(builder); - TestAllTypes message = builder.build(); - TestUtil.assertRepeatedFieldsModified(message); - } - - public void testRepeatedSettersRejectNull() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - - builder.addRepeatedString("one"); - builder.addRepeatedString("two"); - try { - builder.setRepeatedString(1, null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - builder.addRepeatedBytes(TestUtil.toBytes("one")); - builder.addRepeatedBytes(TestUtil.toBytes("two")); - try { - builder.setRepeatedBytes(1, null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - builder.addRepeatedNestedMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(218).build()); - builder.addRepeatedNestedMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(456).build()); - try { - builder.setRepeatedNestedMessage(1, (TestAllTypes.NestedMessage) null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setRepeatedNestedMessage( - 1, (TestAllTypes.NestedMessage.Builder) null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - builder.addRepeatedNestedEnum(TestAllTypes.NestedEnum.FOO); - builder.addRepeatedNestedEnum(TestAllTypes.NestedEnum.BAR); - try { - builder.setRepeatedNestedEnum(1, null); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - } - - public void testRepeatedAppend() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - - builder.addAllRepeatedInt32(Arrays.asList(1, 2, 3, 4)); - builder.addAllRepeatedForeignEnum(Arrays.asList(ForeignEnum.FOREIGN_BAZ)); - - ForeignMessage foreignMessage = - ForeignMessage.newBuilder().setC(12).build(); - builder.addAllRepeatedForeignMessage(Arrays.asList(foreignMessage)); - - TestAllTypes message = builder.build(); - assertEquals(message.getRepeatedInt32List(), Arrays.asList(1, 2, 3, 4)); - assertEquals(message.getRepeatedForeignEnumList(), - Arrays.asList(ForeignEnum.FOREIGN_BAZ)); - assertEquals(1, message.getRepeatedForeignMessageCount()); - assertEquals(12, message.getRepeatedForeignMessage(0).getC()); - } - - public void testRepeatedAppendRejectsNull() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - - ForeignMessage foreignMessage = - ForeignMessage.newBuilder().setC(12).build(); - try { - builder.addAllRepeatedForeignMessage( - Arrays.asList(foreignMessage, (ForeignMessage) null)); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - try { - builder.addAllRepeatedForeignEnum( - Arrays.asList(ForeignEnum.FOREIGN_BAZ, null)); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - try { - builder.addAllRepeatedString(Arrays.asList("one", null)); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - try { - builder.addAllRepeatedBytes(Arrays.asList(TestUtil.toBytes("one"), null)); - fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - } - - public void testSettingForeignMessageUsingBuilder() throws Exception { - TestAllTypes message = TestAllTypes.newBuilder() - // Pass builder for foreign message instance. - .setOptionalForeignMessage(ForeignMessage.newBuilder().setC(123)) - .build(); - TestAllTypes expectedMessage = TestAllTypes.newBuilder() - // Create expected version passing foreign message instance explicitly. - .setOptionalForeignMessage( - ForeignMessage.newBuilder().setC(123).build()) - .build(); - // TODO(ngd): Upgrade to using real #equals method once implemented - assertEquals(expectedMessage.toString(), message.toString()); - } - - public void testSettingRepeatedForeignMessageUsingBuilder() throws Exception { - TestAllTypes message = TestAllTypes.newBuilder() - // Pass builder for foreign message instance. - .addRepeatedForeignMessage(ForeignMessage.newBuilder().setC(456)) - .build(); - TestAllTypes expectedMessage = TestAllTypes.newBuilder() - // Create expected version passing foreign message instance explicitly. - .addRepeatedForeignMessage( - ForeignMessage.newBuilder().setC(456).build()) - .build(); - assertEquals(expectedMessage.toString(), message.toString()); - } - - public void testDefaults() throws Exception { - TestUtil.assertClear(TestAllTypes.getDefaultInstance()); - TestUtil.assertClear(TestAllTypes.newBuilder().build()); - - TestExtremeDefaultValues message = - TestExtremeDefaultValues.getDefaultInstance(); - assertEquals("\u1234", message.getUtf8String()); - assertEquals(Double.POSITIVE_INFINITY, message.getInfDouble()); - assertEquals(Double.NEGATIVE_INFINITY, message.getNegInfDouble()); - assertTrue(Double.isNaN(message.getNanDouble())); - assertEquals(Float.POSITIVE_INFINITY, message.getInfFloat()); - assertEquals(Float.NEGATIVE_INFINITY, message.getNegInfFloat()); - assertTrue(Float.isNaN(message.getNanFloat())); - assertEquals("? ? ?? ?? ??? ??/ ??-", message.getCppTrigraph()); - } - - public void testClear() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.assertClear(builder); - TestUtil.setAllFields(builder); - builder.clear(); - TestUtil.assertClear(builder); - } - - public void testReflectionGetters() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - reflectionTester.assertAllFieldsSetViaReflection(builder); - - TestAllTypes message = builder.build(); - reflectionTester.assertAllFieldsSetViaReflection(message); - } - - public void testReflectionSetters() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - reflectionTester.setAllFieldsViaReflection(builder); - TestUtil.assertAllFieldsSet(builder); - - TestAllTypes message = builder.build(); - TestUtil.assertAllFieldsSet(message); - } - - public void testReflectionSettersRejectNull() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - reflectionTester.assertReflectionSettersRejectNull(builder); - } - - public void testReflectionRepeatedSetters() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - reflectionTester.setAllFieldsViaReflection(builder); - reflectionTester.modifyRepeatedFieldsViaReflection(builder); - TestUtil.assertRepeatedFieldsModified(builder); - - TestAllTypes message = builder.build(); - TestUtil.assertRepeatedFieldsModified(message); - } - - public void testReflectionRepeatedSettersRejectNull() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - reflectionTester.assertReflectionRepeatedSettersRejectNull(builder); - } - - public void testReflectionDefaults() throws Exception { - reflectionTester.assertClearViaReflection( - TestAllTypes.getDefaultInstance()); - reflectionTester.assertClearViaReflection( - TestAllTypes.newBuilder().build()); - } - - public void testEnumInterface() throws Exception { - assertTrue(TestAllTypes.getDefaultInstance().getDefaultNestedEnum() - instanceof ProtocolMessageEnum); - } - - public void testEnumMap() throws Exception { - Internal.EnumLiteMap map = ForeignEnum.internalGetValueMap(); - - for (ForeignEnum value : ForeignEnum.values()) { - assertEquals(value, map.findValueByNumber(value.getNumber())); - } - - assertTrue(map.findValueByNumber(12345) == null); - } - - public void testParsePackedToUnpacked() throws Exception { - TestUnpackedTypes.Builder builder = TestUnpackedTypes.newBuilder(); - TestUnpackedTypes message = - builder.mergeFrom(TestUtil.getPackedSet().toByteString()).build(); - TestUtil.assertUnpackedFieldsSet(message); - } - - public void testParseUnpackedToPacked() throws Exception { - TestPackedTypes.Builder builder = TestPackedTypes.newBuilder(); - TestPackedTypes message = - builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build(); - TestUtil.assertPackedFieldsSet(message); - } - - // ================================================================= - // Extensions. - - TestUtil.ReflectionTester extensionsReflectionTester = - new TestUtil.ReflectionTester(TestAllExtensions.getDescriptor(), - TestUtil.getExtensionRegistry()); - - public void testExtensionMessageOrBuilder() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - TestUtil.setAllExtensions(builder); - TestAllExtensions message = builder.build(); - TestUtil.assertAllExtensionsSet(message); - } - - public void testExtensionRepeatedSetters() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - TestUtil.setAllExtensions(builder); - TestUtil.modifyRepeatedExtensions(builder); - TestAllExtensions message = builder.build(); - TestUtil.assertRepeatedExtensionsModified(message); - } - - public void testExtensionDefaults() throws Exception { - TestUtil.assertExtensionsClear(TestAllExtensions.getDefaultInstance()); - TestUtil.assertExtensionsClear(TestAllExtensions.newBuilder().build()); - } - - public void testExtensionReflectionGetters() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - TestUtil.setAllExtensions(builder); - extensionsReflectionTester.assertAllFieldsSetViaReflection(builder); - - TestAllExtensions message = builder.build(); - extensionsReflectionTester.assertAllFieldsSetViaReflection(message); - } - - public void testExtensionReflectionSetters() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - extensionsReflectionTester.setAllFieldsViaReflection(builder); - TestUtil.assertAllExtensionsSet(builder); - - TestAllExtensions message = builder.build(); - TestUtil.assertAllExtensionsSet(message); - } - - public void testExtensionReflectionSettersRejectNull() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - extensionsReflectionTester.assertReflectionSettersRejectNull(builder); - } - - public void testExtensionReflectionRepeatedSetters() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - extensionsReflectionTester.setAllFieldsViaReflection(builder); - extensionsReflectionTester.modifyRepeatedFieldsViaReflection(builder); - TestUtil.assertRepeatedExtensionsModified(builder); - - TestAllExtensions message = builder.build(); - TestUtil.assertRepeatedExtensionsModified(message); - } - - public void testExtensionReflectionRepeatedSettersRejectNull() - throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - extensionsReflectionTester.assertReflectionRepeatedSettersRejectNull( - builder); - } - - public void testExtensionReflectionDefaults() throws Exception { - extensionsReflectionTester.assertClearViaReflection( - TestAllExtensions.getDefaultInstance()); - extensionsReflectionTester.assertClearViaReflection( - TestAllExtensions.newBuilder().build()); - } - - public void testClearExtension() throws Exception { - // clearExtension() is not actually used in TestUtil, so try it manually. - assertFalse( - TestAllExtensions.newBuilder() - .setExtension(UnittestProto.optionalInt32Extension, 1) - .clearExtension(UnittestProto.optionalInt32Extension) - .hasExtension(UnittestProto.optionalInt32Extension)); - assertEquals(0, - TestAllExtensions.newBuilder() - .addExtension(UnittestProto.repeatedInt32Extension, 1) - .clearExtension(UnittestProto.repeatedInt32Extension) - .getExtensionCount(UnittestProto.repeatedInt32Extension)); - } - - public void testExtensionCopy() throws Exception { - TestAllExtensions original = TestUtil.getAllExtensionsSet(); - TestAllExtensions copy = TestAllExtensions.newBuilder(original).build(); - TestUtil.assertAllExtensionsSet(copy); - } - - public void testExtensionMergeFrom() throws Exception { - TestAllExtensions original = - TestAllExtensions.newBuilder() - .setExtension(UnittestProto.optionalInt32Extension, 1).build(); - TestAllExtensions merged = - TestAllExtensions.newBuilder().mergeFrom(original).build(); - assertTrue(merged.hasExtension(UnittestProto.optionalInt32Extension)); - assertEquals( - 1, (int) merged.getExtension(UnittestProto.optionalInt32Extension)); - } - - // ================================================================= - // multiple_files_test - - public void testMultipleFilesOption() throws Exception { - // We mostly just want to check that things compile. - MessageWithNoOuter message = - MessageWithNoOuter.newBuilder() - .setNested(MessageWithNoOuter.NestedMessage.newBuilder().setI(1)) - .addForeign(TestAllTypes.newBuilder().setOptionalInt32(1)) - .setNestedEnum(MessageWithNoOuter.NestedEnum.BAZ) - .setForeignEnum(EnumWithNoOuter.BAR) - .build(); - assertEquals(message, MessageWithNoOuter.parseFrom(message.toByteString())); - - assertEquals(MultipleFilesTestProto.getDescriptor(), - MessageWithNoOuter.getDescriptor().getFile()); - - Descriptors.FieldDescriptor field = - MessageWithNoOuter.getDescriptor().findFieldByName("foreign_enum"); - assertEquals(EnumWithNoOuter.BAR.getValueDescriptor(), - message.getField(field)); - - assertEquals(MultipleFilesTestProto.getDescriptor(), - ServiceWithNoOuter.getDescriptor().getFile()); - - assertFalse( - TestAllExtensions.getDefaultInstance().hasExtension( - MultipleFilesTestProto.extensionWithOuter)); - } - - public void testOptionalFieldWithRequiredSubfieldsOptimizedForSize() - throws Exception { - TestOptionalOptimizedForSize message = - TestOptionalOptimizedForSize.getDefaultInstance(); - assertTrue(message.isInitialized()); - - message = TestOptionalOptimizedForSize.newBuilder().setO( - TestRequiredOptimizedForSize.newBuilder().buildPartial() - ).buildPartial(); - assertFalse(message.isInitialized()); - - message = TestOptionalOptimizedForSize.newBuilder().setO( - TestRequiredOptimizedForSize.newBuilder().setX(5).buildPartial() - ).buildPartial(); - assertTrue(message.isInitialized()); - } - - public void testUninitializedExtensionInOptimizedForSize() - throws Exception { - TestOptimizedForSize.Builder builder = TestOptimizedForSize.newBuilder(); - builder.setExtension(TestOptimizedForSize.testExtension2, - TestRequiredOptimizedForSize.newBuilder().buildPartial()); - assertFalse(builder.isInitialized()); - assertFalse(builder.buildPartial().isInitialized()); - - builder = TestOptimizedForSize.newBuilder(); - builder.setExtension(TestOptimizedForSize.testExtension2, - TestRequiredOptimizedForSize.newBuilder().setX(10).buildPartial()); - assertTrue(builder.isInitialized()); - assertTrue(builder.buildPartial().isInitialized()); - } - - public void testToBuilder() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes message = builder.build(); - TestUtil.assertAllFieldsSet(message); - TestUtil.assertAllFieldsSet(message.toBuilder().build()); - } - - public void testFieldConstantValues() throws Exception { - assertEquals(TestAllTypes.NestedMessage.BB_FIELD_NUMBER, 1); - assertEquals(TestAllTypes.OPTIONAL_INT32_FIELD_NUMBER, 1); - assertEquals(TestAllTypes.OPTIONALGROUP_FIELD_NUMBER, 16); - assertEquals(TestAllTypes.OPTIONAL_NESTED_MESSAGE_FIELD_NUMBER, 18); - assertEquals(TestAllTypes.OPTIONAL_NESTED_ENUM_FIELD_NUMBER, 21); - assertEquals(TestAllTypes.REPEATED_INT32_FIELD_NUMBER, 31); - assertEquals(TestAllTypes.REPEATEDGROUP_FIELD_NUMBER, 46); - assertEquals(TestAllTypes.REPEATED_NESTED_MESSAGE_FIELD_NUMBER, 48); - assertEquals(TestAllTypes.REPEATED_NESTED_ENUM_FIELD_NUMBER, 51); - } - - public void testExtensionConstantValues() throws Exception { - assertEquals(UnittestProto.TestRequired.SINGLE_FIELD_NUMBER, 1000); - assertEquals(UnittestProto.TestRequired.MULTI_FIELD_NUMBER, 1001); - assertEquals(UnittestProto.OPTIONAL_INT32_EXTENSION_FIELD_NUMBER, 1); - assertEquals(UnittestProto.OPTIONALGROUP_EXTENSION_FIELD_NUMBER, 16); - assertEquals( - UnittestProto.OPTIONAL_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER, 18); - assertEquals(UnittestProto.OPTIONAL_NESTED_ENUM_EXTENSION_FIELD_NUMBER, 21); - assertEquals(UnittestProto.REPEATED_INT32_EXTENSION_FIELD_NUMBER, 31); - assertEquals(UnittestProto.REPEATEDGROUP_EXTENSION_FIELD_NUMBER, 46); - assertEquals( - UnittestProto.REPEATED_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER, 48); - assertEquals(UnittestProto.REPEATED_NESTED_ENUM_EXTENSION_FIELD_NUMBER, 51); - } - - public void testRecursiveMessageDefaultInstance() throws Exception { - UnittestProto.TestRecursiveMessage message = - UnittestProto.TestRecursiveMessage.getDefaultInstance(); - assertTrue(message != null); - assertTrue(message.getA() != null); - assertTrue(message.getA() == message); - } - - public void testSerialize() throws Exception { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes expected = builder.build(); - ObjectOutputStream out = new ObjectOutputStream(baos); - try { - out.writeObject(expected); - } finally { - out.close(); - } - ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - ObjectInputStream in = new ObjectInputStream(bais); - TestAllTypes actual = (TestAllTypes) in.readObject(); - assertEquals(expected, actual); - } - - public void testSerializePartial() throws Exception { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestAllTypes expected = builder.buildPartial(); - ObjectOutputStream out = new ObjectOutputStream(baos); - try { - out.writeObject(expected); - } finally { - out.close(); - } - ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - ObjectInputStream in = new ObjectInputStream(bais); - TestAllTypes actual = (TestAllTypes) in.readObject(); - assertEquals(expected, actual); - } - - public void testEnumValues() { - assertEquals( - TestAllTypes.NestedEnum.BAR.getNumber(), - TestAllTypes.NestedEnum.BAR_VALUE); - assertEquals( - TestAllTypes.NestedEnum.BAZ.getNumber(), - TestAllTypes.NestedEnum.BAZ_VALUE); - assertEquals( - TestAllTypes.NestedEnum.FOO.getNumber(), - TestAllTypes.NestedEnum.FOO_VALUE); - } - - public void testNonNestedExtensionInitialization() { - assertTrue(NonNestedExtension.nonNestedExtension - .getMessageDefaultInstance() instanceof MyNonNestedExtension); - assertEquals("nonNestedExtension", - NonNestedExtension.nonNestedExtension.getDescriptor().getName()); - } - - public void testNestedExtensionInitialization() { - assertTrue(MyNestedExtension.recursiveExtension.getMessageDefaultInstance() - instanceof MessageToBeExtended); - assertEquals("recursiveExtension", - MyNestedExtension.recursiveExtension.getDescriptor().getName()); - } - - - public void testBaseMessageOrBuilder() { - // Mostly just makes sure the base interface exists and has some methods. - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestAllTypes message = builder.buildPartial(); - TestAllTypesOrBuilder builderAsInterface = (TestAllTypesOrBuilder) builder; - TestAllTypesOrBuilder messageAsInterface = (TestAllTypesOrBuilder) message; - - assertEquals( - messageAsInterface.getDefaultBool(), - messageAsInterface.getDefaultBool()); - assertEquals( - messageAsInterface.getOptionalDouble(), - messageAsInterface.getOptionalDouble()); - } - - public void testMessageOrBuilderGetters() { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - - // single fields - assertSame(ForeignMessage.getDefaultInstance(), - builder.getOptionalForeignMessageOrBuilder()); - ForeignMessage.Builder subBuilder = - builder.getOptionalForeignMessageBuilder(); - assertSame(subBuilder, builder.getOptionalForeignMessageOrBuilder()); - - // repeated fields - ForeignMessage m0 = ForeignMessage.newBuilder().buildPartial(); - ForeignMessage m1 = ForeignMessage.newBuilder().buildPartial(); - ForeignMessage m2 = ForeignMessage.newBuilder().buildPartial(); - builder.addRepeatedForeignMessage(m0); - builder.addRepeatedForeignMessage(m1); - builder.addRepeatedForeignMessage(m2); - assertSame(m0, builder.getRepeatedForeignMessageOrBuilder(0)); - assertSame(m1, builder.getRepeatedForeignMessageOrBuilder(1)); - assertSame(m2, builder.getRepeatedForeignMessageOrBuilder(2)); - ForeignMessage.Builder b0 = builder.getRepeatedForeignMessageBuilder(0); - ForeignMessage.Builder b1 = builder.getRepeatedForeignMessageBuilder(1); - assertSame(b0, builder.getRepeatedForeignMessageOrBuilder(0)); - assertSame(b1, builder.getRepeatedForeignMessageOrBuilder(1)); - assertSame(m2, builder.getRepeatedForeignMessageOrBuilder(2)); - - List messageOrBuilderList = - builder.getRepeatedForeignMessageOrBuilderList(); - assertSame(b0, messageOrBuilderList.get(0)); - assertSame(b1, messageOrBuilderList.get(1)); - assertSame(m2, messageOrBuilderList.get(2)); - } - - public void testGetFieldBuilder() { - Descriptor descriptor = TestAllTypes.getDescriptor(); - - FieldDescriptor fieldDescriptor = - descriptor.findFieldByName("optional_nested_message"); - FieldDescriptor foreignFieldDescriptor = - descriptor.findFieldByName("optional_foreign_message"); - FieldDescriptor importFieldDescriptor = - descriptor.findFieldByName("optional_import_message"); - - // Mutate the message with new field builder - // Mutate nested message - TestAllTypes.Builder builder1 = TestAllTypes.newBuilder(); - Message.Builder fieldBuilder1 = builder1.newBuilderForField(fieldDescriptor) - .mergeFrom((Message) builder1.getField(fieldDescriptor)); - FieldDescriptor subFieldDescriptor1 = - fieldBuilder1.getDescriptorForType().findFieldByName("bb"); - fieldBuilder1.setField(subFieldDescriptor1, 1); - builder1.setField(fieldDescriptor, fieldBuilder1.build()); - - // Mutate foreign message - Message.Builder foreignFieldBuilder1 = builder1.newBuilderForField( - foreignFieldDescriptor) - .mergeFrom((Message) builder1.getField(foreignFieldDescriptor)); - FieldDescriptor subForeignFieldDescriptor1 = - foreignFieldBuilder1.getDescriptorForType().findFieldByName("c"); - foreignFieldBuilder1.setField(subForeignFieldDescriptor1, 2); - builder1.setField(foreignFieldDescriptor, foreignFieldBuilder1.build()); - - // Mutate import message - Message.Builder importFieldBuilder1 = builder1.newBuilderForField( - importFieldDescriptor) - .mergeFrom((Message) builder1.getField(importFieldDescriptor)); - FieldDescriptor subImportFieldDescriptor1 = - importFieldBuilder1.getDescriptorForType().findFieldByName("d"); - importFieldBuilder1.setField(subImportFieldDescriptor1, 3); - builder1.setField(importFieldDescriptor, importFieldBuilder1.build()); - - Message newMessage1 = builder1.build(); - - // Mutate the message with existing field builder - // Mutate nested message - TestAllTypes.Builder builder2 = TestAllTypes.newBuilder(); - Message.Builder fieldBuilder2 = builder2.getFieldBuilder(fieldDescriptor); - FieldDescriptor subFieldDescriptor2 = - fieldBuilder2.getDescriptorForType().findFieldByName("bb"); - fieldBuilder2.setField(subFieldDescriptor2, 1); - builder2.setField(fieldDescriptor, fieldBuilder2.build()); - - // Mutate foreign message - Message.Builder foreignFieldBuilder2 = builder2.newBuilderForField( - foreignFieldDescriptor) - .mergeFrom((Message) builder2.getField(foreignFieldDescriptor)); - FieldDescriptor subForeignFieldDescriptor2 = - foreignFieldBuilder2.getDescriptorForType().findFieldByName("c"); - foreignFieldBuilder2.setField(subForeignFieldDescriptor2, 2); - builder2.setField(foreignFieldDescriptor, foreignFieldBuilder2.build()); - - // Mutate import message - Message.Builder importFieldBuilder2 = builder2.newBuilderForField( - importFieldDescriptor) - .mergeFrom((Message) builder2.getField(importFieldDescriptor)); - FieldDescriptor subImportFieldDescriptor2 = - importFieldBuilder2.getDescriptorForType().findFieldByName("d"); - importFieldBuilder2.setField(subImportFieldDescriptor2, 3); - builder2.setField(importFieldDescriptor, importFieldBuilder2.build()); - - Message newMessage2 = builder2.build(); - - // These two messages should be equal. - assertEquals(newMessage1, newMessage2); - } - - public void testGetFieldBuilderWithInitializedValue() { - Descriptor descriptor = TestAllTypes.getDescriptor(); - FieldDescriptor fieldDescriptor = - descriptor.findFieldByName("optional_nested_message"); - - // Before setting field, builder is initialized by default value. - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - NestedMessage.Builder fieldBuilder = - (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); - assertEquals(0, fieldBuilder.getBb()); - - // Setting field value with new field builder instance. - builder = TestAllTypes.newBuilder(); - NestedMessage.Builder newFieldBuilder = - builder.getOptionalNestedMessageBuilder(); - newFieldBuilder.setBb(2); - // Then get the field builder instance by getFieldBuilder(). - fieldBuilder = - (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); - // It should contain new value. - assertEquals(2, fieldBuilder.getBb()); - // These two builder should be equal. - assertSame(fieldBuilder, newFieldBuilder); - } - - public void testGetFieldBuilderNotSupportedException() { - Descriptor descriptor = TestAllTypes.getDescriptor(); - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - try { - builder.getFieldBuilder(descriptor.findFieldByName("optional_int32")); - fail("Exception was not thrown"); - } catch (UnsupportedOperationException e) { - // We expect this exception. - } - try { - builder.getFieldBuilder( - descriptor.findFieldByName("optional_nested_enum")); - fail("Exception was not thrown"); - } catch (UnsupportedOperationException e) { - // We expect this exception. - } - try { - builder.getFieldBuilder(descriptor.findFieldByName("repeated_int32")); - fail("Exception was not thrown"); - } catch (UnsupportedOperationException e) { - // We expect this exception. - } - try { - builder.getFieldBuilder( - descriptor.findFieldByName("repeated_nested_enum")); - fail("Exception was not thrown"); - } catch (UnsupportedOperationException e) { - // We expect this exception. - } - try { - builder.getFieldBuilder( - descriptor.findFieldByName("repeated_nested_message")); - fail("Exception was not thrown"); - } catch (UnsupportedOperationException e) { - // We expect this exception. - } - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringArrayListTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringArrayListTest.java deleted file mode 100644 index 9bc94eef1df4a7f106b3ecd9ddbd6d70e866ebc0..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringArrayListTest.java +++ /dev/null @@ -1,163 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import junit.framework.TestCase; - -import java.util.ArrayList; -import java.util.List; - -/** - * Tests for {@link LazyStringArrayList}. - * - * @author jonp@google.com (Jon Perlow) - */ -public class LazyStringArrayListTest extends TestCase { - - private static String STRING_A = "A"; - private static String STRING_B = "B"; - private static String STRING_C = "C"; - - private static ByteString BYTE_STRING_A = ByteString.copyFromUtf8("A"); - private static ByteString BYTE_STRING_B = ByteString.copyFromUtf8("B"); - private static ByteString BYTE_STRING_C = ByteString.copyFromUtf8("C"); - - public void testJustStrings() { - LazyStringArrayList list = new LazyStringArrayList(); - list.add(STRING_A); - list.add(STRING_B); - list.add(STRING_C); - - assertEquals(3, list.size()); - assertSame(STRING_A, list.get(0)); - assertSame(STRING_B, list.get(1)); - assertSame(STRING_C, list.get(2)); - - list.set(1, STRING_C); - assertSame(STRING_C, list.get(1)); - - list.remove(1); - assertSame(STRING_A, list.get(0)); - assertSame(STRING_C, list.get(1)); - } - - public void testJustByteString() { - LazyStringArrayList list = new LazyStringArrayList(); - list.add(BYTE_STRING_A); - list.add(BYTE_STRING_B); - list.add(BYTE_STRING_C); - - assertEquals(3, list.size()); - assertSame(BYTE_STRING_A, list.getByteString(0)); - assertSame(BYTE_STRING_B, list.getByteString(1)); - assertSame(BYTE_STRING_C, list.getByteString(2)); - - list.remove(1); - assertSame(BYTE_STRING_A, list.getByteString(0)); - assertSame(BYTE_STRING_C, list.getByteString(1)); - } - - public void testConversionBackAndForth() { - LazyStringArrayList list = new LazyStringArrayList(); - list.add(STRING_A); - list.add(BYTE_STRING_B); - list.add(BYTE_STRING_C); - - // String a should be the same because it was originally a string - assertSame(STRING_A, list.get(0)); - - // String b and c should be different because the string has to be computed - // from the ByteString - String bPrime = list.get(1); - assertNotSame(STRING_B, bPrime); - assertEquals(STRING_B, bPrime); - String cPrime = list.get(2); - assertNotSame(STRING_C, cPrime); - assertEquals(STRING_C, cPrime); - - // String c and c should stay the same once cached. - assertSame(bPrime, list.get(1)); - assertSame(cPrime, list.get(2)); - - // ByteString needs to be computed from string for both a and b - ByteString aPrimeByteString = list.getByteString(0); - assertEquals(BYTE_STRING_A, aPrimeByteString); - ByteString bPrimeByteString = list.getByteString(1); - assertNotSame(BYTE_STRING_B, bPrimeByteString); - assertEquals(BYTE_STRING_B, list.getByteString(1)); - - // Once cached, ByteString should stay cached. - assertSame(aPrimeByteString, list.getByteString(0)); - assertSame(bPrimeByteString, list.getByteString(1)); - } - - public void testCopyConstructorCopiesByReference() { - LazyStringArrayList list1 = new LazyStringArrayList(); - list1.add(STRING_A); - list1.add(BYTE_STRING_B); - list1.add(BYTE_STRING_C); - - LazyStringArrayList list2 = new LazyStringArrayList(list1); - assertEquals(3, list2.size()); - assertSame(STRING_A, list2.get(0)); - assertSame(BYTE_STRING_B, list2.getByteString(1)); - assertSame(BYTE_STRING_C, list2.getByteString(2)); - } - - public void testListCopyConstructor() { - List list1 = new ArrayList(); - list1.add(STRING_A); - list1.add(STRING_B); - list1.add(STRING_C); - - LazyStringArrayList list2 = new LazyStringArrayList(list1); - assertEquals(3, list2.size()); - assertSame(STRING_A, list2.get(0)); - assertSame(STRING_B, list2.get(1)); - assertSame(STRING_C, list2.get(2)); - } - - public void testAddAllCopiesByReferenceIfPossible() { - LazyStringArrayList list1 = new LazyStringArrayList(); - list1.add(STRING_A); - list1.add(BYTE_STRING_B); - list1.add(BYTE_STRING_C); - - LazyStringArrayList list2 = new LazyStringArrayList(); - list2.addAll(list1); - - assertEquals(3, list2.size()); - assertSame(STRING_A, list2.get(0)); - assertSame(BYTE_STRING_B, list2.getByteString(1)); - assertSame(BYTE_STRING_C, list2.getByteString(2)); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java deleted file mode 100644 index e21e038993251498308f26e1c134d8a8bf33fa54..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java +++ /dev/null @@ -1,108 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - - -import protobuf_unittest.UnittestProto; - -import junit.framework.TestCase; - -import java.io.IOException; - -/** - * Tests to make sure the lazy conversion of UTF8-encoded byte arrays to - * strings works correctly. - * - * @author jonp@google.com (Jon Perlow) - */ -public class LazyStringEndToEndTest extends TestCase { - - private static ByteString TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8 = - ByteString.copyFrom(new byte[] { - 114, 4, -1, 0, -1, 0, -30, 2, 4, -1, - 0, -1, 0, -30, 2, 4, -1, 0, -1, 0, }); - - private ByteString encodedTestAllTypes; - - @Override - protected void setUp() throws Exception { - super.setUp(); - this.encodedTestAllTypes = UnittestProto.TestAllTypes.newBuilder() - .setOptionalString("foo") - .addRepeatedString("bar") - .addRepeatedString("baz") - .build() - .toByteString(); - } - - /** - * Tests that an invalid UTF8 string will roundtrip through a parse - * and serialization. - */ - public void testParseAndSerialize() throws InvalidProtocolBufferException { - UnittestProto.TestAllTypes tV2 = UnittestProto.TestAllTypes.parseFrom( - TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8); - ByteString bytes = tV2.toByteString(); - assertEquals(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, bytes); - - tV2.getOptionalString(); - bytes = tV2.toByteString(); - assertEquals(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, bytes); - } - - public void testParseAndWrite() throws IOException { - UnittestProto.TestAllTypes tV2 = UnittestProto.TestAllTypes.parseFrom( - TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8); - byte[] sink = new byte[TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8.size()]; - CodedOutputStream outputStream = CodedOutputStream.newInstance(sink); - tV2.writeTo(outputStream); - outputStream.flush(); - assertEquals( - TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, - ByteString.copyFrom(sink)); - } - - public void testNoStringCachingIfOnlyBytesAccessed() throws Exception { - UnittestProto.TestAllTypes proto = - UnittestProto.TestAllTypes.parseFrom(encodedTestAllTypes); - ByteString optional = proto.getOptionalStringBytes(); - assertSame(optional, proto.getOptionalStringBytes()); - assertSame(optional, proto.toBuilder().getOptionalStringBytes()); - - ByteString repeated0 = proto.getRepeatedStringBytes(0); - ByteString repeated1 = proto.getRepeatedStringBytes(1); - assertSame(repeated0, proto.getRepeatedStringBytes(0)); - assertSame(repeated1, proto.getRepeatedStringBytes(1)); - assertSame(repeated0, proto.toBuilder().getRepeatedStringBytes(0)); - assertSame(repeated1, proto.toBuilder().getRepeatedStringBytes(1)); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LiteralByteStringTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LiteralByteStringTest.java deleted file mode 100644 index d2ce563a5cab07ca4f5bae6254665b97cae768c6..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LiteralByteStringTest.java +++ /dev/null @@ -1,344 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import junit.framework.TestCase; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * Test {@link LiteralByteString} by setting up a reference string in {@link #setUp()}. - * This class is designed to be extended for testing extensions of {@link LiteralByteString} - * such as {@link BoundedByteString}, see {@link BoundedByteStringTest}. - * - * @author carlanton@google.com (Carl Haverl) - */ -public class LiteralByteStringTest extends TestCase { - protected static final String UTF_8 = "UTF-8"; - - protected String classUnderTest; - protected byte[] referenceBytes; - protected ByteString stringUnderTest; - protected int expectedHashCode; - - @Override - protected void setUp() throws Exception { - classUnderTest = "LiteralByteString"; - referenceBytes = ByteStringTest.getTestBytes(1234, 11337766L); - stringUnderTest = ByteString.copyFrom(referenceBytes); - expectedHashCode = 331161852; - } - - protected String getActualClassName(Object object) { - String actualClassName = object.getClass().getName(); - actualClassName = actualClassName.substring(actualClassName.lastIndexOf('.') + 1); - return actualClassName; - } - - public void testByteAt() { - boolean stillEqual = true; - for (int i = 0; stillEqual && i < referenceBytes.length; ++i) { - stillEqual = (referenceBytes[i] == stringUnderTest.byteAt(i)); - } - assertTrue(classUnderTest + " must capture the right bytes", stillEqual); - } - - public void testByteIterator() { - boolean stillEqual = true; - ByteString.ByteIterator iter = stringUnderTest.iterator(); - for (int i = 0; stillEqual && i < referenceBytes.length; ++i) { - stillEqual = (iter.hasNext() && referenceBytes[i] == iter.nextByte()); - } - assertTrue(classUnderTest + " must capture the right bytes", stillEqual); - assertFalse(classUnderTest + " must have exhausted the iterator", iter.hasNext()); - - try { - iter.nextByte(); - fail("Should have thrown an exception."); - } catch (NoSuchElementException e) { - // This is success - } - } - - public void testByteIterable() { - boolean stillEqual = true; - int j = 0; - for (byte quantum : stringUnderTest) { - stillEqual = (referenceBytes[j] == quantum); - ++j; - } - assertTrue(classUnderTest + " must capture the right bytes as Bytes", stillEqual); - assertEquals(classUnderTest + " iterable character count", referenceBytes.length, j); - } - - public void testSize() { - assertEquals(classUnderTest + " must have the expected size", referenceBytes.length, - stringUnderTest.size()); - } - - public void testCopyTo_ByteArrayOffsetLength() { - int destinationOffset = 50; - int length = 100; - byte[] destination = new byte[destinationOffset + length]; - int sourceOffset = 213; - stringUnderTest.copyTo(destination, sourceOffset, destinationOffset, length); - boolean stillEqual = true; - for (int i = 0; stillEqual && i < length; ++i) { - stillEqual = referenceBytes[i + sourceOffset] == destination[i + destinationOffset]; - } - assertTrue(classUnderTest + ".copyTo(4 arg) must give the expected bytes", stillEqual); - } - - public void testCopyTo_ByteArrayOffsetLengthErrors() { - int destinationOffset = 50; - int length = 100; - byte[] destination = new byte[destinationOffset + length]; - - try { - // Copy one too many bytes - stringUnderTest.copyTo(destination, stringUnderTest.size() + 1 - length, - destinationOffset, length); - fail("Should have thrown an exception when copying too many bytes of a " - + classUnderTest); - } catch (IndexOutOfBoundsException expected) { - // This is success - } - - try { - // Copy with illegal negative sourceOffset - stringUnderTest.copyTo(destination, -1, destinationOffset, length); - fail("Should have thrown an exception when given a negative sourceOffset in " - + classUnderTest); - } catch (IndexOutOfBoundsException expected) { - // This is success - } - - try { - // Copy with illegal negative destinationOffset - stringUnderTest.copyTo(destination, 0, -1, length); - fail("Should have thrown an exception when given a negative destinationOffset in " - + classUnderTest); - } catch (IndexOutOfBoundsException expected) { - // This is success - } - - try { - // Copy with illegal negative size - stringUnderTest.copyTo(destination, 0, 0, -1); - fail("Should have thrown an exception when given a negative size in " - + classUnderTest); - } catch (IndexOutOfBoundsException expected) { - // This is success - } - - try { - // Copy with illegal too-large sourceOffset - stringUnderTest.copyTo(destination, 2 * stringUnderTest.size(), 0, length); - fail("Should have thrown an exception when the destinationOffset is too large in " - + classUnderTest); - } catch (IndexOutOfBoundsException expected) { - // This is success - } - - try { - // Copy with illegal too-large destinationOffset - stringUnderTest.copyTo(destination, 0, 2 * destination.length, length); - fail("Should have thrown an exception when the destinationOffset is too large in " - + classUnderTest); - } catch (IndexOutOfBoundsException expected) { - // This is success - } - } - - public void testCopyTo_ByteBuffer() { - ByteBuffer myBuffer = ByteBuffer.allocate(referenceBytes.length); - stringUnderTest.copyTo(myBuffer); - assertTrue(classUnderTest + ".copyTo(ByteBuffer) must give back the same bytes", - Arrays.equals(referenceBytes, myBuffer.array())); - } - - public void testAsReadOnlyByteBuffer() { - ByteBuffer byteBuffer = stringUnderTest.asReadOnlyByteBuffer(); - byte[] roundTripBytes = new byte[referenceBytes.length]; - assertTrue(byteBuffer.remaining() == referenceBytes.length); - assertTrue(byteBuffer.isReadOnly()); - byteBuffer.get(roundTripBytes); - assertTrue(classUnderTest + ".asReadOnlyByteBuffer() must give back the same bytes", - Arrays.equals(referenceBytes, roundTripBytes)); - } - - public void testAsReadOnlyByteBufferList() { - List byteBuffers = stringUnderTest.asReadOnlyByteBufferList(); - int bytesSeen = 0; - byte[] roundTripBytes = new byte[referenceBytes.length]; - for (ByteBuffer byteBuffer : byteBuffers) { - int thisLength = byteBuffer.remaining(); - assertTrue(byteBuffer.isReadOnly()); - assertTrue(bytesSeen + thisLength <= referenceBytes.length); - byteBuffer.get(roundTripBytes, bytesSeen, thisLength); - bytesSeen += thisLength; - } - assertTrue(bytesSeen == referenceBytes.length); - assertTrue(classUnderTest + ".asReadOnlyByteBufferTest() must give back the same bytes", - Arrays.equals(referenceBytes, roundTripBytes)); - } - - public void testToByteArray() { - byte[] roundTripBytes = stringUnderTest.toByteArray(); - assertTrue(classUnderTest + ".toByteArray() must give back the same bytes", - Arrays.equals(referenceBytes, roundTripBytes)); - } - - public void testWriteTo() throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - stringUnderTest.writeTo(bos); - byte[] roundTripBytes = bos.toByteArray(); - assertTrue(classUnderTest + ".writeTo() must give back the same bytes", - Arrays.equals(referenceBytes, roundTripBytes)); - } - - public void testWriteTo_mutating() throws IOException { - OutputStream os = new OutputStream() { - @Override - public void write(byte[] b, int off, int len) { - for (int x = 0; x < len; ++x) { - b[off + x] = (byte) 0; - } - } - - @Override - public void write(int b) { - // Purposefully left blank. - } - }; - - stringUnderTest.writeTo(os); - byte[] newBytes = stringUnderTest.toByteArray(); - assertTrue(classUnderTest + ".writeTo() must not grant access to underlying array", - Arrays.equals(referenceBytes, newBytes)); - } - - public void testNewOutput() throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ByteString.Output output = ByteString.newOutput(); - stringUnderTest.writeTo(output); - assertEquals("Output Size returns correct result", - output.size(), stringUnderTest.size()); - output.writeTo(bos); - assertTrue("Output.writeTo() must give back the same bytes", - Arrays.equals(referenceBytes, bos.toByteArray())); - - // write the output stream to itself! This should cause it to double - output.writeTo(output); - assertEquals("Writing an output stream to itself is successful", - stringUnderTest.concat(stringUnderTest), output.toByteString()); - - output.reset(); - assertEquals("Output.reset() resets the output", 0, output.size()); - assertEquals("Output.reset() resets the output", - ByteString.EMPTY, output.toByteString()); - - } - - public void testHashCode() { - int hash = stringUnderTest.hashCode(); - assertEquals(classUnderTest + " must have expected hashCode", expectedHashCode, hash); - } - - public void testNewInput() throws IOException { - InputStream input = stringUnderTest.newInput(); - assertEquals("InputStream.available() returns correct value", - stringUnderTest.size(), input.available()); - boolean stillEqual = true; - for (byte referenceByte : referenceBytes) { - int expectedInt = (referenceByte & 0xFF); - stillEqual = (expectedInt == input.read()); - } - assertEquals("InputStream.available() returns correct value", - 0, input.available()); - assertTrue(classUnderTest + " must give the same bytes from the InputStream", stillEqual); - assertEquals(classUnderTest + " InputStream must now be exhausted", -1, input.read()); - } - - public void testNewInput_skip() throws IOException { - InputStream input = stringUnderTest.newInput(); - int stringSize = stringUnderTest.size(); - int nearEndIndex = stringSize * 2 / 3; - long skipped1 = input.skip(nearEndIndex); - assertEquals("InputStream.skip()", skipped1, nearEndIndex); - assertEquals("InputStream.available()", - stringSize - skipped1, input.available()); - assertTrue("InputStream.mark() is available", input.markSupported()); - input.mark(0); - assertEquals("InputStream.skip(), read()", - stringUnderTest.byteAt(nearEndIndex) & 0xFF, input.read()); - assertEquals("InputStream.available()", - stringSize - skipped1 - 1, input.available()); - long skipped2 = input.skip(stringSize); - assertEquals("InputStream.skip() incomplete", - skipped2, stringSize - skipped1 - 1); - assertEquals("InputStream.skip(), no more input", 0, input.available()); - assertEquals("InputStream.skip(), no more input", -1, input.read()); - input.reset(); - assertEquals("InputStream.reset() succeeded", - stringSize - skipped1, input.available()); - assertEquals("InputStream.reset(), read()", - stringUnderTest.byteAt(nearEndIndex) & 0xFF, input.read()); - } - - public void testNewCodedInput() throws IOException { - CodedInputStream cis = stringUnderTest.newCodedInput(); - byte[] roundTripBytes = cis.readRawBytes(referenceBytes.length); - assertTrue(classUnderTest + " must give the same bytes back from the CodedInputStream", - Arrays.equals(referenceBytes, roundTripBytes)); - assertTrue(classUnderTest + " CodedInputStream must now be exhausted", cis.isAtEnd()); - } - - /** - * Make sure we keep things simple when concatenating with empty. See also - * {@link ByteStringTest#testConcat_empty()}. - */ - public void testConcat_empty() { - assertSame(classUnderTest + " concatenated with empty must give " + classUnderTest, - stringUnderTest.concat(ByteString.EMPTY), stringUnderTest); - assertSame("empty concatenated with " + classUnderTest + " must give " + classUnderTest, - ByteString.EMPTY.concat(stringUnderTest), stringUnderTest); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/MessageTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/MessageTest.java deleted file mode 100644 index 629cabc0c570189fa6b5b09a07304efe1ec0610a..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/MessageTest.java +++ /dev/null @@ -1,354 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestRequired; -import protobuf_unittest.UnittestProto.TestRequiredForeign; -import protobuf_unittest.UnittestProto.ForeignMessage; - -import junit.framework.TestCase; - -import java.util.List; - -/** - * Misc. unit tests for message operations that apply to both generated - * and dynamic messages. - * - * @author kenton@google.com Kenton Varda - */ -public class MessageTest extends TestCase { - // ================================================================= - // Message-merging tests. - - static final TestAllTypes MERGE_SOURCE = - TestAllTypes.newBuilder() - .setOptionalInt32(1) - .setOptionalString("foo") - .setOptionalForeignMessage(ForeignMessage.getDefaultInstance()) - .addRepeatedString("bar") - .build(); - - static final TestAllTypes MERGE_DEST = - TestAllTypes.newBuilder() - .setOptionalInt64(2) - .setOptionalString("baz") - .setOptionalForeignMessage(ForeignMessage.newBuilder().setC(3).build()) - .addRepeatedString("qux") - .build(); - - static final String MERGE_RESULT_TEXT = - "optional_int32: 1\n" + - "optional_int64: 2\n" + - "optional_string: \"foo\"\n" + - "optional_foreign_message {\n" + - " c: 3\n" + - "}\n" + - "repeated_string: \"qux\"\n" + - "repeated_string: \"bar\"\n"; - - public void testMergeFrom() throws Exception { - TestAllTypes result = - TestAllTypes.newBuilder(MERGE_DEST) - .mergeFrom(MERGE_SOURCE).build(); - - assertEquals(MERGE_RESULT_TEXT, result.toString()); - } - - /** - * Test merging a DynamicMessage into a GeneratedMessage. As long as they - * have the same descriptor, this should work, but it is an entirely different - * code path. - */ - public void testMergeFromDynamic() throws Exception { - TestAllTypes result = - TestAllTypes.newBuilder(MERGE_DEST) - .mergeFrom(DynamicMessage.newBuilder(MERGE_SOURCE).build()) - .build(); - - assertEquals(MERGE_RESULT_TEXT, result.toString()); - } - - /** Test merging two DynamicMessages. */ - public void testDynamicMergeFrom() throws Exception { - DynamicMessage result = - DynamicMessage.newBuilder(MERGE_DEST) - .mergeFrom(DynamicMessage.newBuilder(MERGE_SOURCE).build()) - .build(); - - assertEquals(MERGE_RESULT_TEXT, result.toString()); - } - - // ================================================================= - // Required-field-related tests. - - private static final TestRequired TEST_REQUIRED_UNINITIALIZED = - TestRequired.getDefaultInstance(); - private static final TestRequired TEST_REQUIRED_INITIALIZED = - TestRequired.newBuilder().setA(1).setB(2).setC(3).build(); - - public void testRequired() throws Exception { - TestRequired.Builder builder = TestRequired.newBuilder(); - - assertFalse(builder.isInitialized()); - builder.setA(1); - assertFalse(builder.isInitialized()); - builder.setB(1); - assertFalse(builder.isInitialized()); - builder.setC(1); - assertTrue(builder.isInitialized()); - } - - public void testRequiredForeign() throws Exception { - TestRequiredForeign.Builder builder = TestRequiredForeign.newBuilder(); - - assertTrue(builder.isInitialized()); - - builder.setOptionalMessage(TEST_REQUIRED_UNINITIALIZED); - assertFalse(builder.isInitialized()); - - builder.setOptionalMessage(TEST_REQUIRED_INITIALIZED); - assertTrue(builder.isInitialized()); - - builder.addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED); - assertFalse(builder.isInitialized()); - - builder.setRepeatedMessage(0, TEST_REQUIRED_INITIALIZED); - assertTrue(builder.isInitialized()); - } - - public void testRequiredExtension() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - - assertTrue(builder.isInitialized()); - - builder.setExtension(TestRequired.single, TEST_REQUIRED_UNINITIALIZED); - assertFalse(builder.isInitialized()); - - builder.setExtension(TestRequired.single, TEST_REQUIRED_INITIALIZED); - assertTrue(builder.isInitialized()); - - builder.addExtension(TestRequired.multi, TEST_REQUIRED_UNINITIALIZED); - assertFalse(builder.isInitialized()); - - builder.setExtension(TestRequired.multi, 0, TEST_REQUIRED_INITIALIZED); - assertTrue(builder.isInitialized()); - } - - public void testRequiredDynamic() throws Exception { - Descriptors.Descriptor descriptor = TestRequired.getDescriptor(); - DynamicMessage.Builder builder = DynamicMessage.newBuilder(descriptor); - - assertFalse(builder.isInitialized()); - builder.setField(descriptor.findFieldByName("a"), 1); - assertFalse(builder.isInitialized()); - builder.setField(descriptor.findFieldByName("b"), 1); - assertFalse(builder.isInitialized()); - builder.setField(descriptor.findFieldByName("c"), 1); - assertTrue(builder.isInitialized()); - } - - public void testRequiredDynamicForeign() throws Exception { - Descriptors.Descriptor descriptor = TestRequiredForeign.getDescriptor(); - DynamicMessage.Builder builder = DynamicMessage.newBuilder(descriptor); - - assertTrue(builder.isInitialized()); - - builder.setField(descriptor.findFieldByName("optional_message"), - TEST_REQUIRED_UNINITIALIZED); - assertFalse(builder.isInitialized()); - - builder.setField(descriptor.findFieldByName("optional_message"), - TEST_REQUIRED_INITIALIZED); - assertTrue(builder.isInitialized()); - - builder.addRepeatedField(descriptor.findFieldByName("repeated_message"), - TEST_REQUIRED_UNINITIALIZED); - assertFalse(builder.isInitialized()); - - builder.setRepeatedField(descriptor.findFieldByName("repeated_message"), 0, - TEST_REQUIRED_INITIALIZED); - assertTrue(builder.isInitialized()); - } - - public void testUninitializedException() throws Exception { - try { - TestRequired.newBuilder().build(); - fail("Should have thrown an exception."); - } catch (UninitializedMessageException e) { - assertEquals("Message missing required fields: a, b, c", e.getMessage()); - } - } - - public void testBuildPartial() throws Exception { - // We're mostly testing that no exception is thrown. - TestRequired message = TestRequired.newBuilder().buildPartial(); - assertFalse(message.isInitialized()); - } - - public void testNestedUninitializedException() throws Exception { - try { - TestRequiredForeign.newBuilder() - .setOptionalMessage(TEST_REQUIRED_UNINITIALIZED) - .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) - .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) - .build(); - fail("Should have thrown an exception."); - } catch (UninitializedMessageException e) { - assertEquals( - "Message missing required fields: " + - "optional_message.a, " + - "optional_message.b, " + - "optional_message.c, " + - "repeated_message[0].a, " + - "repeated_message[0].b, " + - "repeated_message[0].c, " + - "repeated_message[1].a, " + - "repeated_message[1].b, " + - "repeated_message[1].c", - e.getMessage()); - } - } - - public void testBuildNestedPartial() throws Exception { - // We're mostly testing that no exception is thrown. - TestRequiredForeign message = - TestRequiredForeign.newBuilder() - .setOptionalMessage(TEST_REQUIRED_UNINITIALIZED) - .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) - .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) - .buildPartial(); - assertFalse(message.isInitialized()); - } - - public void testParseUnititialized() throws Exception { - try { - TestRequired.parseFrom(ByteString.EMPTY); - fail("Should have thrown an exception."); - } catch (InvalidProtocolBufferException e) { - assertEquals("Message missing required fields: a, b, c", e.getMessage()); - } - } - - public void testParseNestedUnititialized() throws Exception { - ByteString data = - TestRequiredForeign.newBuilder() - .setOptionalMessage(TEST_REQUIRED_UNINITIALIZED) - .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) - .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) - .buildPartial().toByteString(); - - try { - TestRequiredForeign.parseFrom(data); - fail("Should have thrown an exception."); - } catch (InvalidProtocolBufferException e) { - assertEquals( - "Message missing required fields: " + - "optional_message.a, " + - "optional_message.b, " + - "optional_message.c, " + - "repeated_message[0].a, " + - "repeated_message[0].b, " + - "repeated_message[0].c, " + - "repeated_message[1].a, " + - "repeated_message[1].b, " + - "repeated_message[1].c", - e.getMessage()); - } - } - - public void testDynamicUninitializedException() throws Exception { - try { - DynamicMessage.newBuilder(TestRequired.getDescriptor()).build(); - fail("Should have thrown an exception."); - } catch (UninitializedMessageException e) { - assertEquals("Message missing required fields: a, b, c", e.getMessage()); - } - } - - public void testDynamicBuildPartial() throws Exception { - // We're mostly testing that no exception is thrown. - DynamicMessage message = - DynamicMessage.newBuilder(TestRequired.getDescriptor()) - .buildPartial(); - assertFalse(message.isInitialized()); - } - - public void testDynamicParseUnititialized() throws Exception { - try { - Descriptors.Descriptor descriptor = TestRequired.getDescriptor(); - DynamicMessage.parseFrom(descriptor, ByteString.EMPTY); - fail("Should have thrown an exception."); - } catch (InvalidProtocolBufferException e) { - assertEquals("Message missing required fields: a, b, c", e.getMessage()); - } - } - - /** Test reading unset repeated message from DynamicMessage. */ - public void testDynamicRepeatedMessageNull() throws Exception { - Descriptors.Descriptor descriptor = TestRequired.getDescriptor(); - DynamicMessage result = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()) - .mergeFrom(DynamicMessage.newBuilder(MERGE_SOURCE).build()) - .build(); - - assertTrue(result.getField(result.getDescriptorForType() - .findFieldByName("repeated_foreign_message")) instanceof List); - assertEquals(result.getRepeatedFieldCount(result.getDescriptorForType() - .findFieldByName("repeated_foreign_message")), 0); - } - - /** Test reading repeated message from DynamicMessage. */ - public void testDynamicRepeatedMessageNotNull() throws Exception { - - TestAllTypes REPEATED_NESTED = - TestAllTypes.newBuilder() - .setOptionalInt32(1) - .setOptionalString("foo") - .setOptionalForeignMessage(ForeignMessage.getDefaultInstance()) - .addRepeatedString("bar") - .addRepeatedForeignMessage(ForeignMessage.getDefaultInstance()) - .addRepeatedForeignMessage(ForeignMessage.getDefaultInstance()) - .build(); - Descriptors.Descriptor descriptor = TestRequired.getDescriptor(); - DynamicMessage result = - DynamicMessage.newBuilder(TestAllTypes.getDescriptor()) - .mergeFrom(DynamicMessage.newBuilder(REPEATED_NESTED).build()) - .build(); - - assertTrue(result.getField(result.getDescriptorForType() - .findFieldByName("repeated_foreign_message")) instanceof List); - assertEquals(result.getRepeatedFieldCount(result.getDescriptorForType() - .findFieldByName("repeated_foreign_message")), 2); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/NestedBuildersTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/NestedBuildersTest.java deleted file mode 100644 index 68d70beca1094118dd3fbacc82911e90806e962c..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/NestedBuildersTest.java +++ /dev/null @@ -1,186 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.Vehicle; -import protobuf_unittest.Wheel; - -import junit.framework.TestCase; - -import java.util.List; -import java.util.ArrayList; - -/** - * Test cases that exercise end-to-end use cases involving - * {@link SingleFieldBuilder} and {@link RepeatedFieldBuilder}. - * - * @author jonp@google.com (Jon Perlow) - */ -public class NestedBuildersTest extends TestCase { - - public void testMessagesAndBuilders() { - Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); - vehicleBuilder.addWheelBuilder() - .setRadius(4) - .setWidth(1); - vehicleBuilder.addWheelBuilder() - .setRadius(4) - .setWidth(2); - vehicleBuilder.addWheelBuilder() - .setRadius(4) - .setWidth(3); - vehicleBuilder.addWheelBuilder() - .setRadius(4) - .setWidth(4); - vehicleBuilder.getEngineBuilder() - .setLiters(10); - - Vehicle vehicle = vehicleBuilder.build(); - assertEquals(4, vehicle.getWheelCount()); - for (int i = 0; i < 4; i++) { - Wheel wheel = vehicle.getWheel(i); - assertEquals(4, wheel.getRadius()); - assertEquals(i + 1, wheel.getWidth()); - } - assertEquals(10, vehicle.getEngine().getLiters()); - - for (int i = 0; i < 4; i++) { - vehicleBuilder.getWheelBuilder(i) - .setRadius(5) - .setWidth(i + 10); - } - vehicleBuilder.getEngineBuilder().setLiters(20); - - vehicle = vehicleBuilder.build(); - for (int i = 0; i < 4; i++) { - Wheel wheel = vehicle.getWheel(i); - assertEquals(5, wheel.getRadius()); - assertEquals(i + 10, wheel.getWidth()); - } - assertEquals(20, vehicle.getEngine().getLiters()); - assertTrue(vehicle.hasEngine()); - } - - public void testMessagesAreCached() { - Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); - vehicleBuilder.addWheelBuilder() - .setRadius(1) - .setWidth(2); - vehicleBuilder.addWheelBuilder() - .setRadius(3) - .setWidth(4); - vehicleBuilder.addWheelBuilder() - .setRadius(5) - .setWidth(6); - vehicleBuilder.addWheelBuilder() - .setRadius(7) - .setWidth(8); - - // Make sure messages are cached. - List wheels = new ArrayList(vehicleBuilder.getWheelList()); - for (int i = 0; i < wheels.size(); i++) { - assertSame(wheels.get(i), vehicleBuilder.getWheel(i)); - } - - // Now get builders and check they didn't change. - for (int i = 0; i < wheels.size(); i++) { - vehicleBuilder.getWheel(i); - } - for (int i = 0; i < wheels.size(); i++) { - assertSame(wheels.get(i), vehicleBuilder.getWheel(i)); - } - - // Change just one - vehicleBuilder.getWheelBuilder(3) - .setRadius(20).setWidth(20); - - // Now get wheels and check that only that one changed - for (int i = 0; i < wheels.size(); i++) { - if (i < 3) { - assertSame(wheels.get(i), vehicleBuilder.getWheel(i)); - } else { - assertNotSame(wheels.get(i), vehicleBuilder.getWheel(i)); - } - } - } - - public void testRemove_WithNestedBuilders() { - Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); - vehicleBuilder.addWheelBuilder() - .setRadius(1) - .setWidth(1); - vehicleBuilder.addWheelBuilder() - .setRadius(2) - .setWidth(2); - vehicleBuilder.removeWheel(0); - - assertEquals(1, vehicleBuilder.getWheelCount()); - assertEquals(2, vehicleBuilder.getWheel(0).getRadius()); - } - - public void testRemove_WithNestedMessages() { - Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); - vehicleBuilder.addWheel(Wheel.newBuilder() - .setRadius(1) - .setWidth(1)); - vehicleBuilder.addWheel(Wheel.newBuilder() - .setRadius(2) - .setWidth(2)); - vehicleBuilder.removeWheel(0); - - assertEquals(1, vehicleBuilder.getWheelCount()); - assertEquals(2, vehicleBuilder.getWheel(0).getRadius()); - } - - public void testMerge() { - Vehicle vehicle1 = Vehicle.newBuilder() - .addWheel(Wheel.newBuilder().setRadius(1).build()) - .addWheel(Wheel.newBuilder().setRadius(2).build()) - .build(); - - Vehicle vehicle2 = Vehicle.newBuilder() - .mergeFrom(vehicle1) - .build(); - // List should be the same -- no allocation - assertSame(vehicle1.getWheelList(), vehicle2.getWheelList()); - - Vehicle vehicle3 = vehicle1.toBuilder().build(); - assertSame(vehicle1.getWheelList(), vehicle3.getWheelList()); - } - - public void testGettingBuilderMarksFieldAsHaving() { - Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); - vehicleBuilder.getEngineBuilder(); - Vehicle vehicle = vehicleBuilder.buildPartial(); - assertTrue(vehicle.hasEngine()); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ParserTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ParserTest.java deleted file mode 100644 index b35af689cd2c62fbfa301fc13c7f6efeb2bc85bf..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ParserTest.java +++ /dev/null @@ -1,278 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize; -import protobuf_unittest.UnittestOptimizeFor.TestRequiredOptimizedForSize; -import protobuf_unittest.UnittestOptimizeFor; -import protobuf_unittest.UnittestProto.ForeignMessage; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestEmptyMessage; -import protobuf_unittest.UnittestProto.TestRequired; -import protobuf_unittest.UnittestProto.TestParsingMerge; -import protobuf_unittest.UnittestProto; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * Unit test for {@link Parser}. - * - * @author liujisi@google.com (Pherl Liu) - */ -public class ParserTest extends TestCase { - public void testGeneratedMessageParserSingleton() throws Exception { - for (int i = 0; i < 10; i++) { - assertEquals(TestAllTypes.PARSER, - TestUtil.getAllSet().getParserForType()); - } - } - - private void assertRoundTripEquals(MessageLite message, - ExtensionRegistryLite registry) - throws Exception { - final byte[] data = message.toByteArray(); - final int offset = 20; - final int length = data.length; - final int padding = 30; - Parser parser = message.getParserForType(); - assertMessageEquals(message, parser.parseFrom(data, registry)); - assertMessageEquals(message, parser.parseFrom( - generatePaddingArray(data, offset, padding), - offset, length, registry)); - assertMessageEquals(message, parser.parseFrom( - message.toByteString(), registry)); - assertMessageEquals(message, parser.parseFrom( - new ByteArrayInputStream(data), registry)); - assertMessageEquals(message, parser.parseFrom( - CodedInputStream.newInstance(data), registry)); - } - - private void assertRoundTripEquals(MessageLite message) throws Exception { - final byte[] data = message.toByteArray(); - final int offset = 20; - final int length = data.length; - final int padding = 30; - Parser parser = message.getParserForType(); - assertMessageEquals(message, parser.parseFrom(data)); - assertMessageEquals(message, parser.parseFrom( - generatePaddingArray(data, offset, padding), - offset, length)); - assertMessageEquals(message, parser.parseFrom(message.toByteString())); - assertMessageEquals(message, parser.parseFrom( - new ByteArrayInputStream(data))); - assertMessageEquals(message, parser.parseFrom( - CodedInputStream.newInstance(data))); - } - - private void assertMessageEquals(MessageLite expected, MessageLite actual) - throws Exception { - if (expected instanceof Message) { - assertEquals(expected, actual); - } else { - assertEquals(expected.toByteString(), actual.toByteString()); - } - } - - private byte[] generatePaddingArray(byte[] data, int offset, int padding) { - byte[] result = new byte[offset + data.length + padding]; - System.arraycopy(data, 0, result, offset, data.length); - return result; - } - - public void testNormalMessage() throws Exception { - assertRoundTripEquals(TestUtil.getAllSet()); - } - - public void testParsePartial() throws Exception { - Parser parser = TestRequired.PARSER; - final String errorString = - "Should throw exceptions when the parsed message isn't initialized."; - - // TestRequired.b and TestRequired.c are not set. - TestRequired partialMessage = TestRequired.newBuilder() - .setA(1).buildPartial(); - - // parsePartialFrom should pass. - byte[] data = partialMessage.toByteArray(); - assertEquals(partialMessage, parser.parsePartialFrom(data)); - assertEquals(partialMessage, parser.parsePartialFrom( - partialMessage.toByteString())); - assertEquals(partialMessage, parser.parsePartialFrom( - new ByteArrayInputStream(data))); - assertEquals(partialMessage, parser.parsePartialFrom( - CodedInputStream.newInstance(data))); - - // parseFrom(ByteArray) - try { - parser.parseFrom(partialMessage.toByteArray()); - fail(errorString); - } catch (InvalidProtocolBufferException e) { - // pass. - } - - // parseFrom(ByteString) - try { - parser.parseFrom(partialMessage.toByteString()); - fail(errorString); - } catch (InvalidProtocolBufferException e) { - // pass. - } - - // parseFrom(InputStream) - try { - parser.parseFrom(new ByteArrayInputStream(partialMessage.toByteArray())); - fail(errorString); - } catch (IOException e) { - // pass. - } - - // parseFrom(CodedInputStream) - try { - parser.parseFrom(CodedInputStream.newInstance( - partialMessage.toByteArray())); - fail(errorString); - } catch (IOException e) { - // pass. - } - } - - public void testParseDelimitedTo() throws Exception { - // Write normal Message. - TestAllTypes normalMessage = TestUtil.getAllSet(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - normalMessage.writeDelimitedTo(output); - - InputStream input = new ByteArrayInputStream(output.toByteArray()); - assertMessageEquals( - normalMessage, - normalMessage.getParserForType().parseDelimitedFrom(input)); - } - - public void testParseUnknownFields() throws Exception { - // All fields will be treated as unknown fields in emptyMessage. - TestEmptyMessage emptyMessage = TestEmptyMessage.PARSER.parseFrom( - TestUtil.getAllSet().toByteString()); - assertEquals( - TestUtil.getAllSet().toByteString(), - emptyMessage.toByteString()); - } - - public void testOptimizeForSize() throws Exception { - TestOptimizedForSize.Builder builder = TestOptimizedForSize.newBuilder(); - builder.setI(12).setMsg(ForeignMessage.newBuilder().setC(34).build()); - builder.setExtension(TestOptimizedForSize.testExtension, 56); - builder.setExtension(TestOptimizedForSize.testExtension2, - TestRequiredOptimizedForSize.newBuilder().setX(78).build()); - - TestOptimizedForSize message = builder.build(); - ExtensionRegistry registry = ExtensionRegistry.newInstance(); - UnittestOptimizeFor.registerAllExtensions(registry); - - assertRoundTripEquals(message, registry); - } - - /** Helper method for {@link #testParsingMerge()}.*/ - private void assertMessageMerged(TestAllTypes allTypes) - throws Exception { - assertEquals(3, allTypes.getOptionalInt32()); - assertEquals(2, allTypes.getOptionalInt64()); - assertEquals("hello", allTypes.getOptionalString()); - } - - public void testParsingMerge() throws Exception { - // Build messages. - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestAllTypes msg1 = builder.setOptionalInt32(1).build(); - builder.clear(); - TestAllTypes msg2 = builder.setOptionalInt64(2).build(); - builder.clear(); - TestAllTypes msg3 = builder.setOptionalInt32(3) - .setOptionalString("hello").build(); - - // Build groups. - TestParsingMerge.RepeatedFieldsGenerator.Group1 optionalG1 = - TestParsingMerge.RepeatedFieldsGenerator.Group1.newBuilder() - .setField1(msg1).build(); - TestParsingMerge.RepeatedFieldsGenerator.Group1 optionalG2 = - TestParsingMerge.RepeatedFieldsGenerator.Group1.newBuilder() - .setField1(msg2).build(); - TestParsingMerge.RepeatedFieldsGenerator.Group1 optionalG3 = - TestParsingMerge.RepeatedFieldsGenerator.Group1.newBuilder() - .setField1(msg3).build(); - TestParsingMerge.RepeatedFieldsGenerator.Group2 repeatedG1 = - TestParsingMerge.RepeatedFieldsGenerator.Group2.newBuilder() - .setField1(msg1).build(); - TestParsingMerge.RepeatedFieldsGenerator.Group2 repeatedG2 = - TestParsingMerge.RepeatedFieldsGenerator.Group2.newBuilder() - .setField1(msg2).build(); - TestParsingMerge.RepeatedFieldsGenerator.Group2 repeatedG3 = - TestParsingMerge.RepeatedFieldsGenerator.Group2.newBuilder() - .setField1(msg3).build(); - - // Assign and serialize RepeatedFieldsGenerator. - ByteString data = TestParsingMerge.RepeatedFieldsGenerator.newBuilder() - .addField1(msg1).addField1(msg2).addField1(msg3) - .addField2(msg1).addField2(msg2).addField2(msg3) - .addField3(msg1).addField3(msg2).addField3(msg3) - .addGroup1(optionalG1).addGroup1(optionalG2).addGroup1(optionalG3) - .addGroup2(repeatedG1).addGroup2(repeatedG2).addGroup2(repeatedG3) - .addExt1(msg1).addExt1(msg2).addExt1(msg3) - .addExt2(msg1).addExt2(msg2).addExt2(msg3) - .build().toByteString(); - - // Parse TestParsingMerge. - ExtensionRegistry registry = ExtensionRegistry.newInstance(); - UnittestProto.registerAllExtensions(registry); - TestParsingMerge parsingMerge = - TestParsingMerge.PARSER.parseFrom(data, registry); - - // Required and optional fields should be merged. - assertMessageMerged(parsingMerge.getRequiredAllTypes()); - assertMessageMerged(parsingMerge.getOptionalAllTypes()); - assertMessageMerged( - parsingMerge.getOptionalGroup().getOptionalGroupAllTypes()); - assertMessageMerged(parsingMerge.getExtension( - TestParsingMerge.optionalExt)); - - // Repeated fields should not be merged. - assertEquals(3, parsingMerge.getRepeatedAllTypesCount()); - assertEquals(3, parsingMerge.getRepeatedGroupCount()); - assertEquals(3, parsingMerge.getExtensionCount( - TestParsingMerge.repeatedExt)); - } - -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/RopeByteStringSubstringTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/RopeByteStringSubstringTest.java deleted file mode 100644 index c122385ac1ce29eafdb76e3752761e21283c807e..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/RopeByteStringSubstringTest.java +++ /dev/null @@ -1,62 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import java.io.UnsupportedEncodingException; -import java.util.Iterator; - -/** - * This class tests {@link RopeByteString#substring(int, int)} by inheriting the tests from - * {@link LiteralByteStringTest}. Only a couple of methods are overridden. - * - * @author carlanton@google.com (Carl Haverl) - */ -public class RopeByteStringSubstringTest extends LiteralByteStringTest { - - @Override - protected void setUp() throws Exception { - classUnderTest = "RopeByteString"; - byte[] sourceBytes = ByteStringTest.getTestBytes(22341, 22337766L); - Iterator iter = ByteStringTest.makeConcretePieces(sourceBytes).iterator(); - ByteString sourceString = iter.next(); - while (iter.hasNext()) { - sourceString = sourceString.concat(iter.next()); - } - - int from = 1130; - int to = sourceBytes.length - 5555; - stringUnderTest = sourceString.substring(from, to); - referenceBytes = new byte[to - from]; - System.arraycopy(sourceBytes, from, referenceBytes, 0, to - from); - expectedHashCode = -1259260680; - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ServiceTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ServiceTest.java deleted file mode 100644 index 4c7f751c0a963c167f8c8ddc12d8850a9d272f0c..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ServiceTest.java +++ /dev/null @@ -1,321 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import com.google.protobuf.Descriptors.FileDescriptor; -import com.google.protobuf.Descriptors.MethodDescriptor; -import google.protobuf.no_generic_services_test.UnittestNoGenericServices; -import protobuf_unittest.MessageWithNoOuter; -import protobuf_unittest.ServiceWithNoOuter; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestService; -import protobuf_unittest.UnittestProto.FooRequest; -import protobuf_unittest.UnittestProto.FooResponse; -import protobuf_unittest.UnittestProto.BarRequest; -import protobuf_unittest.UnittestProto.BarResponse; - -import org.easymock.classextension.EasyMock; -import org.easymock.classextension.IMocksControl; -import org.easymock.IArgumentMatcher; - -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -/** - * Tests services and stubs. - * - * @author kenton@google.com Kenton Varda - */ -public class ServiceTest extends TestCase { - private IMocksControl control; - private RpcController mockController; - - private final Descriptors.MethodDescriptor fooDescriptor = - TestService.getDescriptor().getMethods().get(0); - private final Descriptors.MethodDescriptor barDescriptor = - TestService.getDescriptor().getMethods().get(1); - - @Override - protected void setUp() throws Exception { - super.setUp(); - control = EasyMock.createStrictControl(); - mockController = control.createMock(RpcController.class); - } - - // ================================================================= - - /** Tests Service.callMethod(). */ - public void testCallMethod() throws Exception { - FooRequest fooRequest = FooRequest.newBuilder().build(); - BarRequest barRequest = BarRequest.newBuilder().build(); - MockCallback fooCallback = new MockCallback(); - MockCallback barCallback = new MockCallback(); - TestService mockService = control.createMock(TestService.class); - - mockService.foo(EasyMock.same(mockController), EasyMock.same(fooRequest), - this.wrapsCallback(fooCallback)); - mockService.bar(EasyMock.same(mockController), EasyMock.same(barRequest), - this.wrapsCallback(barCallback)); - control.replay(); - - mockService.callMethod(fooDescriptor, mockController, - fooRequest, fooCallback); - mockService.callMethod(barDescriptor, mockController, - barRequest, barCallback); - control.verify(); - } - - /** Tests Service.get{Request,Response}Prototype(). */ - public void testGetPrototype() throws Exception { - TestService mockService = control.createMock(TestService.class); - - assertSame(mockService.getRequestPrototype(fooDescriptor), - FooRequest.getDefaultInstance()); - assertSame(mockService.getResponsePrototype(fooDescriptor), - FooResponse.getDefaultInstance()); - assertSame(mockService.getRequestPrototype(barDescriptor), - BarRequest.getDefaultInstance()); - assertSame(mockService.getResponsePrototype(barDescriptor), - BarResponse.getDefaultInstance()); - } - - /** Tests generated stubs. */ - public void testStub() throws Exception { - FooRequest fooRequest = FooRequest.newBuilder().build(); - BarRequest barRequest = BarRequest.newBuilder().build(); - MockCallback fooCallback = new MockCallback(); - MockCallback barCallback = new MockCallback(); - RpcChannel mockChannel = control.createMock(RpcChannel.class); - TestService stub = TestService.newStub(mockChannel); - - mockChannel.callMethod( - EasyMock.same(fooDescriptor), - EasyMock.same(mockController), - EasyMock.same(fooRequest), - EasyMock.same(FooResponse.getDefaultInstance()), - this.wrapsCallback(fooCallback)); - mockChannel.callMethod( - EasyMock.same(barDescriptor), - EasyMock.same(mockController), - EasyMock.same(barRequest), - EasyMock.same(BarResponse.getDefaultInstance()), - this.wrapsCallback(barCallback)); - control.replay(); - - stub.foo(mockController, fooRequest, fooCallback); - stub.bar(mockController, barRequest, barCallback); - control.verify(); - } - - /** Tests generated blocking stubs. */ - public void testBlockingStub() throws Exception { - FooRequest fooRequest = FooRequest.newBuilder().build(); - BarRequest barRequest = BarRequest.newBuilder().build(); - BlockingRpcChannel mockChannel = - control.createMock(BlockingRpcChannel.class); - TestService.BlockingInterface stub = - TestService.newBlockingStub(mockChannel); - - FooResponse fooResponse = FooResponse.newBuilder().build(); - BarResponse barResponse = BarResponse.newBuilder().build(); - - EasyMock.expect(mockChannel.callBlockingMethod( - EasyMock.same(fooDescriptor), - EasyMock.same(mockController), - EasyMock.same(fooRequest), - EasyMock.same(FooResponse.getDefaultInstance()))).andReturn(fooResponse); - EasyMock.expect(mockChannel.callBlockingMethod( - EasyMock.same(barDescriptor), - EasyMock.same(mockController), - EasyMock.same(barRequest), - EasyMock.same(BarResponse.getDefaultInstance()))).andReturn(barResponse); - control.replay(); - - assertSame(fooResponse, stub.foo(mockController, fooRequest)); - assertSame(barResponse, stub.bar(mockController, barRequest)); - control.verify(); - } - - public void testNewReflectiveService() { - ServiceWithNoOuter.Interface impl = - control.createMock(ServiceWithNoOuter.Interface.class); - RpcController controller = control.createMock(RpcController.class); - Service service = ServiceWithNoOuter.newReflectiveService(impl); - - MethodDescriptor fooMethod = - ServiceWithNoOuter.getDescriptor().findMethodByName("Foo"); - MessageWithNoOuter request = MessageWithNoOuter.getDefaultInstance(); - RpcCallback callback = new RpcCallback() { - public void run(Message parameter) { - // No reason this should be run. - fail(); - } - }; - RpcCallback specializedCallback = - RpcUtil.specializeCallback(callback); - - impl.foo(EasyMock.same(controller), EasyMock.same(request), - EasyMock.same(specializedCallback)); - EasyMock.expectLastCall(); - - control.replay(); - - service.callMethod(fooMethod, controller, request, callback); - - control.verify(); - } - - public void testNewReflectiveBlockingService() throws ServiceException { - ServiceWithNoOuter.BlockingInterface impl = - control.createMock(ServiceWithNoOuter.BlockingInterface.class); - RpcController controller = control.createMock(RpcController.class); - BlockingService service = - ServiceWithNoOuter.newReflectiveBlockingService(impl); - - MethodDescriptor fooMethod = - ServiceWithNoOuter.getDescriptor().findMethodByName("Foo"); - MessageWithNoOuter request = MessageWithNoOuter.getDefaultInstance(); - - TestAllTypes expectedResponse = TestAllTypes.getDefaultInstance(); - EasyMock.expect(impl.foo(EasyMock.same(controller), EasyMock.same(request))) - .andReturn(expectedResponse); - - control.replay(); - - Message response = - service.callBlockingMethod(fooMethod, controller, request); - assertEquals(expectedResponse, response); - - control.verify(); - } - - public void testNoGenericServices() throws Exception { - // Non-services should be usable. - UnittestNoGenericServices.TestMessage message = - UnittestNoGenericServices.TestMessage.newBuilder() - .setA(123) - .setExtension(UnittestNoGenericServices.testExtension, 456) - .build(); - assertEquals(123, message.getA()); - assertEquals(1, UnittestNoGenericServices.TestEnum.FOO.getNumber()); - - // Build a list of the class names nested in UnittestNoGenericServices. - String outerName = "google.protobuf.no_generic_services_test." + - "UnittestNoGenericServices"; - Class outerClass = Class.forName(outerName); - - Set innerClassNames = new HashSet(); - for (Class innerClass : outerClass.getClasses()) { - String fullName = innerClass.getName(); - // Figure out the unqualified name of the inner class. - // Note: Surprisingly, the full name of an inner class will be separated - // from the outer class name by a '$' rather than a '.'. This is not - // mentioned in the documentation for java.lang.Class. I don't want to - // make assumptions, so I'm just going to accept any character as the - // separator. - assertTrue(fullName.startsWith(outerName)); - - if (!Service.class.isAssignableFrom(innerClass) && - !Message.class.isAssignableFrom(innerClass) && - !ProtocolMessageEnum.class.isAssignableFrom(innerClass)) { - // Ignore any classes not generated by the base code generator. - continue; - } - - innerClassNames.add(fullName.substring(outerName.length() + 1)); - } - - // No service class should have been generated. - assertTrue(innerClassNames.contains("TestMessage")); - assertTrue(innerClassNames.contains("TestEnum")); - assertFalse(innerClassNames.contains("TestService")); - - // But descriptors are there. - FileDescriptor file = UnittestNoGenericServices.getDescriptor(); - assertEquals(1, file.getServices().size()); - assertEquals("TestService", file.getServices().get(0).getName()); - assertEquals(1, file.getServices().get(0).getMethods().size()); - assertEquals("Foo", - file.getServices().get(0).getMethods().get(0).getName()); - } - - // ================================================================= - - /** - * wrapsCallback() is an EasyMock argument predicate. wrapsCallback(c) - * matches a callback if calling that callback causes c to be called. - * In other words, c wraps the given callback. - */ - private RpcCallback wrapsCallback( - MockCallback callback) { - EasyMock.reportMatcher(new WrapsCallback(callback)); - return null; - } - - /** The parameter to wrapsCallback() must be a MockCallback. */ - private static class MockCallback - implements RpcCallback { - private boolean called = false; - - public boolean isCalled() { return called; } - - public void reset() { called = false; } - public void run(Type message) { called = true; } - } - - /** Implementation of the wrapsCallback() argument matcher. */ - private static class WrapsCallback implements IArgumentMatcher { - private MockCallback callback; - - public WrapsCallback(MockCallback callback) { - this.callback = callback; - } - - @SuppressWarnings("unchecked") - public boolean matches(Object actual) { - if (!(actual instanceof RpcCallback)) { - return false; - } - RpcCallback actualCallback = (RpcCallback)actual; - - callback.reset(); - actualCallback.run(null); - return callback.isCalled(); - } - - public void appendTo(StringBuffer buffer) { - buffer.append("wrapsCallback(mockCallback)"); - } - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TestBadIdentifiers.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TestBadIdentifiers.java deleted file mode 100644 index 50867322958a1fdee80ae45b90fb5550b6757b42..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TestBadIdentifiers.java +++ /dev/null @@ -1,64 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import junit.framework.TestCase; - -/** - * Tests that proto2 api generation doesn't cause compile errors when - * compiling protocol buffers that have names that would otherwise conflict - * if not fully qualified (like @Deprecated and @Override). - * - * @author jonp@google.com (Jon Perlow) - */ -public class TestBadIdentifiers extends TestCase { - - public void testCompilation() { - // If this compiles, it means the generation was correct. - TestBadIdentifiersProto.Deprecated.newBuilder(); - TestBadIdentifiersProto.Override.newBuilder(); - } - - public void testGetDescriptor() { - Descriptors.FileDescriptor fileDescriptor = - TestBadIdentifiersProto.getDescriptor(); - String descriptorField = TestBadIdentifiersProto.Descriptor - .getDefaultInstance().getDescriptor(); - Descriptors.Descriptor protoDescriptor = TestBadIdentifiersProto.Descriptor - .getDefaultInstance().getDescriptorForType(); - String nestedDescriptorField = TestBadIdentifiersProto.Descriptor - .NestedDescriptor.getDefaultInstance().getDescriptor(); - Descriptors.Descriptor nestedProtoDescriptor = TestBadIdentifiersProto - .Descriptor.NestedDescriptor.getDefaultInstance() - .getDescriptorForType(); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TestUtil.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TestUtil.java deleted file mode 100644 index a92348303e993937c38962bb9475cb2376f90756..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TestUtil.java +++ /dev/null @@ -1,3068 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.UnittestProto; - -// The static imports are to avoid 100+ char lines. The following is roughly equivalent to -// import static protobuf_unittest.UnittestProto.*; -import static protobuf_unittest.UnittestProto.defaultInt32Extension; -import static protobuf_unittest.UnittestProto.defaultInt64Extension; -import static protobuf_unittest.UnittestProto.defaultUint32Extension; -import static protobuf_unittest.UnittestProto.defaultUint64Extension; -import static protobuf_unittest.UnittestProto.defaultSint32Extension; -import static protobuf_unittest.UnittestProto.defaultSint64Extension; -import static protobuf_unittest.UnittestProto.defaultFixed32Extension; -import static protobuf_unittest.UnittestProto.defaultFixed64Extension; -import static protobuf_unittest.UnittestProto.defaultSfixed32Extension; -import static protobuf_unittest.UnittestProto.defaultSfixed64Extension; -import static protobuf_unittest.UnittestProto.defaultFloatExtension; -import static protobuf_unittest.UnittestProto.defaultDoubleExtension; -import static protobuf_unittest.UnittestProto.defaultBoolExtension; -import static protobuf_unittest.UnittestProto.defaultStringExtension; -import static protobuf_unittest.UnittestProto.defaultBytesExtension; -import static protobuf_unittest.UnittestProto.defaultNestedEnumExtension; -import static protobuf_unittest.UnittestProto.defaultForeignEnumExtension; -import static protobuf_unittest.UnittestProto.defaultImportEnumExtension; -import static protobuf_unittest.UnittestProto.defaultStringPieceExtension; -import static protobuf_unittest.UnittestProto.defaultCordExtension; - -import static protobuf_unittest.UnittestProto.optionalInt32Extension; -import static protobuf_unittest.UnittestProto.optionalInt64Extension; -import static protobuf_unittest.UnittestProto.optionalUint32Extension; -import static protobuf_unittest.UnittestProto.optionalUint64Extension; -import static protobuf_unittest.UnittestProto.optionalSint32Extension; -import static protobuf_unittest.UnittestProto.optionalSint64Extension; -import static protobuf_unittest.UnittestProto.optionalFixed32Extension; -import static protobuf_unittest.UnittestProto.optionalFixed64Extension; -import static protobuf_unittest.UnittestProto.optionalSfixed32Extension; -import static protobuf_unittest.UnittestProto.optionalSfixed64Extension; -import static protobuf_unittest.UnittestProto.optionalFloatExtension; -import static protobuf_unittest.UnittestProto.optionalDoubleExtension; -import static protobuf_unittest.UnittestProto.optionalBoolExtension; -import static protobuf_unittest.UnittestProto.optionalStringExtension; -import static protobuf_unittest.UnittestProto.optionalBytesExtension; -import static protobuf_unittest.UnittestProto.optionalGroupExtension; -import static protobuf_unittest.UnittestProto.optionalCordExtension; -import static protobuf_unittest.UnittestProto.optionalForeignEnumExtension; -import static protobuf_unittest.UnittestProto.optionalForeignMessageExtension; -import static protobuf_unittest.UnittestProto.optionalImportEnumExtension; -import static protobuf_unittest.UnittestProto.optionalImportMessageExtension; -import static protobuf_unittest.UnittestProto.optionalNestedEnumExtension; -import static protobuf_unittest.UnittestProto.optionalNestedMessageExtension; -import static protobuf_unittest.UnittestProto.optionalPublicImportMessageExtension; -import static protobuf_unittest.UnittestProto.optionalLazyMessageExtension; -import static protobuf_unittest.UnittestProto.optionalStringPieceExtension; - -import static protobuf_unittest.UnittestProto.repeatedInt32Extension; -import static protobuf_unittest.UnittestProto.repeatedInt64Extension; -import static protobuf_unittest.UnittestProto.repeatedUint32Extension; -import static protobuf_unittest.UnittestProto.repeatedUint64Extension; -import static protobuf_unittest.UnittestProto.repeatedSint32Extension; -import static protobuf_unittest.UnittestProto.repeatedSint64Extension; -import static protobuf_unittest.UnittestProto.repeatedFixed32Extension; -import static protobuf_unittest.UnittestProto.repeatedFixed64Extension; -import static protobuf_unittest.UnittestProto.repeatedSfixed32Extension; -import static protobuf_unittest.UnittestProto.repeatedSfixed64Extension; -import static protobuf_unittest.UnittestProto.repeatedFloatExtension; -import static protobuf_unittest.UnittestProto.repeatedDoubleExtension; -import static protobuf_unittest.UnittestProto.repeatedBoolExtension; -import static protobuf_unittest.UnittestProto.repeatedStringExtension; -import static protobuf_unittest.UnittestProto.repeatedBytesExtension; -import static protobuf_unittest.UnittestProto.repeatedGroupExtension; -import static protobuf_unittest.UnittestProto.repeatedNestedMessageExtension; -import static protobuf_unittest.UnittestProto.repeatedForeignMessageExtension; -import static protobuf_unittest.UnittestProto.repeatedImportMessageExtension; -import static protobuf_unittest.UnittestProto.repeatedLazyMessageExtension; -import static protobuf_unittest.UnittestProto.repeatedNestedEnumExtension; -import static protobuf_unittest.UnittestProto.repeatedForeignEnumExtension; -import static protobuf_unittest.UnittestProto.repeatedImportEnumExtension; -import static protobuf_unittest.UnittestProto.repeatedStringPieceExtension; -import static protobuf_unittest.UnittestProto.repeatedCordExtension; - -import static protobuf_unittest.UnittestProto.OptionalGroup_extension; -import static protobuf_unittest.UnittestProto.RepeatedGroup_extension; - -import static protobuf_unittest.UnittestProto.packedInt32Extension; -import static protobuf_unittest.UnittestProto.packedInt64Extension; -import static protobuf_unittest.UnittestProto.packedUint32Extension; -import static protobuf_unittest.UnittestProto.packedUint64Extension; -import static protobuf_unittest.UnittestProto.packedSint32Extension; -import static protobuf_unittest.UnittestProto.packedSint64Extension; -import static protobuf_unittest.UnittestProto.packedFixed32Extension; -import static protobuf_unittest.UnittestProto.packedFixed64Extension; -import static protobuf_unittest.UnittestProto.packedSfixed32Extension; -import static protobuf_unittest.UnittestProto.packedSfixed64Extension; -import static protobuf_unittest.UnittestProto.packedFloatExtension; -import static protobuf_unittest.UnittestProto.packedDoubleExtension; -import static protobuf_unittest.UnittestProto.packedBoolExtension; -import static protobuf_unittest.UnittestProto.packedEnumExtension; - - -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestAllExtensionsOrBuilder; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestAllTypesOrBuilder; -import protobuf_unittest.UnittestProto.TestPackedExtensions; -import protobuf_unittest.UnittestProto.TestPackedTypes; -import protobuf_unittest.UnittestProto.TestUnpackedTypes; -import protobuf_unittest.UnittestProto.ForeignMessage; -import protobuf_unittest.UnittestProto.ForeignEnum; -import com.google.protobuf.test.UnittestImport.ImportEnum; -import com.google.protobuf.test.UnittestImport.ImportMessage; -import com.google.protobuf.test.UnittestImportPublic.PublicImportMessage; - -import junit.framework.Assert; - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; - -/** - * Contains methods for setting all fields of {@code TestAllTypes} to - * some values as well as checking that all the fields are set to those values. - * These are useful for testing various protocol message features, e.g. - * set all fields of a message, serialize it, parse it, and check that all - * fields are set. - * - *

This code is not to be used outside of {@code com.google.protobuf} and - * subpackages. - * - * @author kenton@google.com Kenton Varda - */ -public final class TestUtil { - private TestUtil() {} - - /** Helper to convert a String to ByteString. */ - static ByteString toBytes(String str) { - try { - return ByteString.copyFrom(str.getBytes("UTF-8")); - } catch(java.io.UnsupportedEncodingException e) { - throw new RuntimeException("UTF-8 not supported.", e); - } - } - - /** - * Get a {@code TestAllTypes} with all fields set as they would be by - * {@link #setAllFields(TestAllTypes.Builder)}. - */ - public static TestAllTypes getAllSet() { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - setAllFields(builder); - return builder.build(); - } - - /** - * Get a {@code TestAllTypes.Builder} with all fields set as they would be by - * {@link #setAllFields(TestAllTypes.Builder)}. - */ - public static TestAllTypes.Builder getAllSetBuilder() { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - setAllFields(builder); - return builder; - } - - /** - * Get a {@code TestAllExtensions} with all fields set as they would be by - * {@link #setAllExtensions(TestAllExtensions.Builder)}. - */ - public static TestAllExtensions getAllExtensionsSet() { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - setAllExtensions(builder); - return builder.build(); - } - - public static TestPackedTypes getPackedSet() { - TestPackedTypes.Builder builder = TestPackedTypes.newBuilder(); - setPackedFields(builder); - return builder.build(); - } - - public static TestUnpackedTypes getUnpackedSet() { - TestUnpackedTypes.Builder builder = TestUnpackedTypes.newBuilder(); - setUnpackedFields(builder); - return builder.build(); - } - - public static TestPackedExtensions getPackedExtensionsSet() { - TestPackedExtensions.Builder builder = TestPackedExtensions.newBuilder(); - setPackedExtensions(builder); - return builder.build(); - } - - /** - * Set every field of {@code message} to the values expected by - * {@code assertAllFieldsSet()}. - */ - public static void setAllFields(TestAllTypes.Builder message) { - message.setOptionalInt32 (101); - message.setOptionalInt64 (102); - message.setOptionalUint32 (103); - message.setOptionalUint64 (104); - message.setOptionalSint32 (105); - message.setOptionalSint64 (106); - message.setOptionalFixed32 (107); - message.setOptionalFixed64 (108); - message.setOptionalSfixed32(109); - message.setOptionalSfixed64(110); - message.setOptionalFloat (111); - message.setOptionalDouble (112); - message.setOptionalBool (true); - message.setOptionalString ("115"); - message.setOptionalBytes (toBytes("116")); - - message.setOptionalGroup( - TestAllTypes.OptionalGroup.newBuilder().setA(117).build()); - message.setOptionalNestedMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(118).build()); - message.setOptionalForeignMessage( - ForeignMessage.newBuilder().setC(119).build()); - message.setOptionalImportMessage( - ImportMessage.newBuilder().setD(120).build()); - message.setOptionalPublicImportMessage( - PublicImportMessage.newBuilder().setE(126).build()); - message.setOptionalLazyMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(127).build()); - - message.setOptionalNestedEnum (TestAllTypes.NestedEnum.BAZ); - message.setOptionalForeignEnum(ForeignEnum.FOREIGN_BAZ); - message.setOptionalImportEnum (ImportEnum.IMPORT_BAZ); - - message.setOptionalStringPiece("124"); - message.setOptionalCord("125"); - - // ----------------------------------------------------------------- - - message.addRepeatedInt32 (201); - message.addRepeatedInt64 (202); - message.addRepeatedUint32 (203); - message.addRepeatedUint64 (204); - message.addRepeatedSint32 (205); - message.addRepeatedSint64 (206); - message.addRepeatedFixed32 (207); - message.addRepeatedFixed64 (208); - message.addRepeatedSfixed32(209); - message.addRepeatedSfixed64(210); - message.addRepeatedFloat (211); - message.addRepeatedDouble (212); - message.addRepeatedBool (true); - message.addRepeatedString ("215"); - message.addRepeatedBytes (toBytes("216")); - - message.addRepeatedGroup( - TestAllTypes.RepeatedGroup.newBuilder().setA(217).build()); - message.addRepeatedNestedMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(218).build()); - message.addRepeatedForeignMessage( - ForeignMessage.newBuilder().setC(219).build()); - message.addRepeatedImportMessage( - ImportMessage.newBuilder().setD(220).build()); - message.addRepeatedLazyMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(227).build()); - - message.addRepeatedNestedEnum (TestAllTypes.NestedEnum.BAR); - message.addRepeatedForeignEnum(ForeignEnum.FOREIGN_BAR); - message.addRepeatedImportEnum (ImportEnum.IMPORT_BAR); - - message.addRepeatedStringPiece("224"); - message.addRepeatedCord("225"); - - // Add a second one of each field. - message.addRepeatedInt32 (301); - message.addRepeatedInt64 (302); - message.addRepeatedUint32 (303); - message.addRepeatedUint64 (304); - message.addRepeatedSint32 (305); - message.addRepeatedSint64 (306); - message.addRepeatedFixed32 (307); - message.addRepeatedFixed64 (308); - message.addRepeatedSfixed32(309); - message.addRepeatedSfixed64(310); - message.addRepeatedFloat (311); - message.addRepeatedDouble (312); - message.addRepeatedBool (false); - message.addRepeatedString ("315"); - message.addRepeatedBytes (toBytes("316")); - - message.addRepeatedGroup( - TestAllTypes.RepeatedGroup.newBuilder().setA(317).build()); - message.addRepeatedNestedMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(318).build()); - message.addRepeatedForeignMessage( - ForeignMessage.newBuilder().setC(319).build()); - message.addRepeatedImportMessage( - ImportMessage.newBuilder().setD(320).build()); - message.addRepeatedLazyMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(327).build()); - - message.addRepeatedNestedEnum (TestAllTypes.NestedEnum.BAZ); - message.addRepeatedForeignEnum(ForeignEnum.FOREIGN_BAZ); - message.addRepeatedImportEnum (ImportEnum.IMPORT_BAZ); - - message.addRepeatedStringPiece("324"); - message.addRepeatedCord("325"); - - // ----------------------------------------------------------------- - - message.setDefaultInt32 (401); - message.setDefaultInt64 (402); - message.setDefaultUint32 (403); - message.setDefaultUint64 (404); - message.setDefaultSint32 (405); - message.setDefaultSint64 (406); - message.setDefaultFixed32 (407); - message.setDefaultFixed64 (408); - message.setDefaultSfixed32(409); - message.setDefaultSfixed64(410); - message.setDefaultFloat (411); - message.setDefaultDouble (412); - message.setDefaultBool (false); - message.setDefaultString ("415"); - message.setDefaultBytes (toBytes("416")); - - message.setDefaultNestedEnum (TestAllTypes.NestedEnum.FOO); - message.setDefaultForeignEnum(ForeignEnum.FOREIGN_FOO); - message.setDefaultImportEnum (ImportEnum.IMPORT_FOO); - - message.setDefaultStringPiece("424"); - message.setDefaultCord("425"); - } - - // ------------------------------------------------------------------- - - /** - * Modify the repeated fields of {@code message} to contain the values - * expected by {@code assertRepeatedFieldsModified()}. - */ - public static void modifyRepeatedFields(TestAllTypes.Builder message) { - message.setRepeatedInt32 (1, 501); - message.setRepeatedInt64 (1, 502); - message.setRepeatedUint32 (1, 503); - message.setRepeatedUint64 (1, 504); - message.setRepeatedSint32 (1, 505); - message.setRepeatedSint64 (1, 506); - message.setRepeatedFixed32 (1, 507); - message.setRepeatedFixed64 (1, 508); - message.setRepeatedSfixed32(1, 509); - message.setRepeatedSfixed64(1, 510); - message.setRepeatedFloat (1, 511); - message.setRepeatedDouble (1, 512); - message.setRepeatedBool (1, true); - message.setRepeatedString (1, "515"); - message.setRepeatedBytes (1, toBytes("516")); - - message.setRepeatedGroup(1, - TestAllTypes.RepeatedGroup.newBuilder().setA(517).build()); - message.setRepeatedNestedMessage(1, - TestAllTypes.NestedMessage.newBuilder().setBb(518).build()); - message.setRepeatedForeignMessage(1, - ForeignMessage.newBuilder().setC(519).build()); - message.setRepeatedImportMessage(1, - ImportMessage.newBuilder().setD(520).build()); - message.setRepeatedLazyMessage(1, - TestAllTypes.NestedMessage.newBuilder().setBb(527).build()); - - message.setRepeatedNestedEnum (1, TestAllTypes.NestedEnum.FOO); - message.setRepeatedForeignEnum(1, ForeignEnum.FOREIGN_FOO); - message.setRepeatedImportEnum (1, ImportEnum.IMPORT_FOO); - - message.setRepeatedStringPiece(1, "524"); - message.setRepeatedCord(1, "525"); - } - - // ------------------------------------------------------------------- - - /** - * Assert (using {@code junit.framework.Assert}} that all fields of - * {@code message} are set to the values assigned by {@code setAllFields}. - */ - public static void assertAllFieldsSet(TestAllTypesOrBuilder message) { - Assert.assertTrue(message.hasOptionalInt32 ()); - Assert.assertTrue(message.hasOptionalInt64 ()); - Assert.assertTrue(message.hasOptionalUint32 ()); - Assert.assertTrue(message.hasOptionalUint64 ()); - Assert.assertTrue(message.hasOptionalSint32 ()); - Assert.assertTrue(message.hasOptionalSint64 ()); - Assert.assertTrue(message.hasOptionalFixed32 ()); - Assert.assertTrue(message.hasOptionalFixed64 ()); - Assert.assertTrue(message.hasOptionalSfixed32()); - Assert.assertTrue(message.hasOptionalSfixed64()); - Assert.assertTrue(message.hasOptionalFloat ()); - Assert.assertTrue(message.hasOptionalDouble ()); - Assert.assertTrue(message.hasOptionalBool ()); - Assert.assertTrue(message.hasOptionalString ()); - Assert.assertTrue(message.hasOptionalBytes ()); - - Assert.assertTrue(message.hasOptionalGroup ()); - Assert.assertTrue(message.hasOptionalNestedMessage ()); - Assert.assertTrue(message.hasOptionalForeignMessage()); - Assert.assertTrue(message.hasOptionalImportMessage ()); - - Assert.assertTrue(message.getOptionalGroup ().hasA()); - Assert.assertTrue(message.getOptionalNestedMessage ().hasBb()); - Assert.assertTrue(message.getOptionalForeignMessage().hasC()); - Assert.assertTrue(message.getOptionalImportMessage ().hasD()); - - Assert.assertTrue(message.hasOptionalNestedEnum ()); - Assert.assertTrue(message.hasOptionalForeignEnum()); - Assert.assertTrue(message.hasOptionalImportEnum ()); - - Assert.assertTrue(message.hasOptionalStringPiece()); - Assert.assertTrue(message.hasOptionalCord()); - - Assert.assertEquals(101 , message.getOptionalInt32 ()); - Assert.assertEquals(102 , message.getOptionalInt64 ()); - Assert.assertEquals(103 , message.getOptionalUint32 ()); - Assert.assertEquals(104 , message.getOptionalUint64 ()); - Assert.assertEquals(105 , message.getOptionalSint32 ()); - Assert.assertEquals(106 , message.getOptionalSint64 ()); - Assert.assertEquals(107 , message.getOptionalFixed32 ()); - Assert.assertEquals(108 , message.getOptionalFixed64 ()); - Assert.assertEquals(109 , message.getOptionalSfixed32()); - Assert.assertEquals(110 , message.getOptionalSfixed64()); - Assert.assertEquals(111 , message.getOptionalFloat (), 0.0); - Assert.assertEquals(112 , message.getOptionalDouble (), 0.0); - Assert.assertEquals(true , message.getOptionalBool ()); - Assert.assertEquals("115", message.getOptionalString ()); - Assert.assertEquals(toBytes("116"), message.getOptionalBytes()); - - Assert.assertEquals(117, message.getOptionalGroup ().getA()); - Assert.assertEquals(118, message.getOptionalNestedMessage ().getBb()); - Assert.assertEquals(119, message.getOptionalForeignMessage ().getC()); - Assert.assertEquals(120, message.getOptionalImportMessage ().getD()); - Assert.assertEquals(126, message.getOptionalPublicImportMessage().getE()); - Assert.assertEquals(127, message.getOptionalLazyMessage ().getBb()); - - Assert.assertEquals(TestAllTypes.NestedEnum.BAZ, message.getOptionalNestedEnum()); - Assert.assertEquals(ForeignEnum.FOREIGN_BAZ, message.getOptionalForeignEnum()); - Assert.assertEquals(ImportEnum.IMPORT_BAZ, message.getOptionalImportEnum()); - - Assert.assertEquals("124", message.getOptionalStringPiece()); - Assert.assertEquals("125", message.getOptionalCord()); - - // ----------------------------------------------------------------- - - Assert.assertEquals(2, message.getRepeatedInt32Count ()); - Assert.assertEquals(2, message.getRepeatedInt64Count ()); - Assert.assertEquals(2, message.getRepeatedUint32Count ()); - Assert.assertEquals(2, message.getRepeatedUint64Count ()); - Assert.assertEquals(2, message.getRepeatedSint32Count ()); - Assert.assertEquals(2, message.getRepeatedSint64Count ()); - Assert.assertEquals(2, message.getRepeatedFixed32Count ()); - Assert.assertEquals(2, message.getRepeatedFixed64Count ()); - Assert.assertEquals(2, message.getRepeatedSfixed32Count()); - Assert.assertEquals(2, message.getRepeatedSfixed64Count()); - Assert.assertEquals(2, message.getRepeatedFloatCount ()); - Assert.assertEquals(2, message.getRepeatedDoubleCount ()); - Assert.assertEquals(2, message.getRepeatedBoolCount ()); - Assert.assertEquals(2, message.getRepeatedStringCount ()); - Assert.assertEquals(2, message.getRepeatedBytesCount ()); - - Assert.assertEquals(2, message.getRepeatedGroupCount ()); - Assert.assertEquals(2, message.getRepeatedNestedMessageCount ()); - Assert.assertEquals(2, message.getRepeatedForeignMessageCount()); - Assert.assertEquals(2, message.getRepeatedImportMessageCount ()); - Assert.assertEquals(2, message.getRepeatedLazyMessageCount ()); - Assert.assertEquals(2, message.getRepeatedNestedEnumCount ()); - Assert.assertEquals(2, message.getRepeatedForeignEnumCount ()); - Assert.assertEquals(2, message.getRepeatedImportEnumCount ()); - - Assert.assertEquals(2, message.getRepeatedStringPieceCount()); - Assert.assertEquals(2, message.getRepeatedCordCount()); - - Assert.assertEquals(201 , message.getRepeatedInt32 (0)); - Assert.assertEquals(202 , message.getRepeatedInt64 (0)); - Assert.assertEquals(203 , message.getRepeatedUint32 (0)); - Assert.assertEquals(204 , message.getRepeatedUint64 (0)); - Assert.assertEquals(205 , message.getRepeatedSint32 (0)); - Assert.assertEquals(206 , message.getRepeatedSint64 (0)); - Assert.assertEquals(207 , message.getRepeatedFixed32 (0)); - Assert.assertEquals(208 , message.getRepeatedFixed64 (0)); - Assert.assertEquals(209 , message.getRepeatedSfixed32(0)); - Assert.assertEquals(210 , message.getRepeatedSfixed64(0)); - Assert.assertEquals(211 , message.getRepeatedFloat (0), 0.0); - Assert.assertEquals(212 , message.getRepeatedDouble (0), 0.0); - Assert.assertEquals(true , message.getRepeatedBool (0)); - Assert.assertEquals("215", message.getRepeatedString (0)); - Assert.assertEquals(toBytes("216"), message.getRepeatedBytes(0)); - - Assert.assertEquals(217, message.getRepeatedGroup (0).getA()); - Assert.assertEquals(218, message.getRepeatedNestedMessage (0).getBb()); - Assert.assertEquals(219, message.getRepeatedForeignMessage(0).getC()); - Assert.assertEquals(220, message.getRepeatedImportMessage (0).getD()); - Assert.assertEquals(227, message.getRepeatedLazyMessage (0).getBb()); - - Assert.assertEquals(TestAllTypes.NestedEnum.BAR, message.getRepeatedNestedEnum (0)); - Assert.assertEquals(ForeignEnum.FOREIGN_BAR, message.getRepeatedForeignEnum(0)); - Assert.assertEquals(ImportEnum.IMPORT_BAR, message.getRepeatedImportEnum(0)); - - Assert.assertEquals("224", message.getRepeatedStringPiece(0)); - Assert.assertEquals("225", message.getRepeatedCord(0)); - - Assert.assertEquals(301 , message.getRepeatedInt32 (1)); - Assert.assertEquals(302 , message.getRepeatedInt64 (1)); - Assert.assertEquals(303 , message.getRepeatedUint32 (1)); - Assert.assertEquals(304 , message.getRepeatedUint64 (1)); - Assert.assertEquals(305 , message.getRepeatedSint32 (1)); - Assert.assertEquals(306 , message.getRepeatedSint64 (1)); - Assert.assertEquals(307 , message.getRepeatedFixed32 (1)); - Assert.assertEquals(308 , message.getRepeatedFixed64 (1)); - Assert.assertEquals(309 , message.getRepeatedSfixed32(1)); - Assert.assertEquals(310 , message.getRepeatedSfixed64(1)); - Assert.assertEquals(311 , message.getRepeatedFloat (1), 0.0); - Assert.assertEquals(312 , message.getRepeatedDouble (1), 0.0); - Assert.assertEquals(false, message.getRepeatedBool (1)); - Assert.assertEquals("315", message.getRepeatedString (1)); - Assert.assertEquals(toBytes("316"), message.getRepeatedBytes(1)); - - Assert.assertEquals(317, message.getRepeatedGroup (1).getA()); - Assert.assertEquals(318, message.getRepeatedNestedMessage (1).getBb()); - Assert.assertEquals(319, message.getRepeatedForeignMessage(1).getC()); - Assert.assertEquals(320, message.getRepeatedImportMessage (1).getD()); - Assert.assertEquals(327, message.getRepeatedLazyMessage (1).getBb()); - - Assert.assertEquals(TestAllTypes.NestedEnum.BAZ, message.getRepeatedNestedEnum (1)); - Assert.assertEquals(ForeignEnum.FOREIGN_BAZ, message.getRepeatedForeignEnum(1)); - Assert.assertEquals(ImportEnum.IMPORT_BAZ, message.getRepeatedImportEnum(1)); - - Assert.assertEquals("324", message.getRepeatedStringPiece(1)); - Assert.assertEquals("325", message.getRepeatedCord(1)); - - // ----------------------------------------------------------------- - - Assert.assertTrue(message.hasDefaultInt32 ()); - Assert.assertTrue(message.hasDefaultInt64 ()); - Assert.assertTrue(message.hasDefaultUint32 ()); - Assert.assertTrue(message.hasDefaultUint64 ()); - Assert.assertTrue(message.hasDefaultSint32 ()); - Assert.assertTrue(message.hasDefaultSint64 ()); - Assert.assertTrue(message.hasDefaultFixed32 ()); - Assert.assertTrue(message.hasDefaultFixed64 ()); - Assert.assertTrue(message.hasDefaultSfixed32()); - Assert.assertTrue(message.hasDefaultSfixed64()); - Assert.assertTrue(message.hasDefaultFloat ()); - Assert.assertTrue(message.hasDefaultDouble ()); - Assert.assertTrue(message.hasDefaultBool ()); - Assert.assertTrue(message.hasDefaultString ()); - Assert.assertTrue(message.hasDefaultBytes ()); - - Assert.assertTrue(message.hasDefaultNestedEnum ()); - Assert.assertTrue(message.hasDefaultForeignEnum()); - Assert.assertTrue(message.hasDefaultImportEnum ()); - - Assert.assertTrue(message.hasDefaultStringPiece()); - Assert.assertTrue(message.hasDefaultCord()); - - Assert.assertEquals(401 , message.getDefaultInt32 ()); - Assert.assertEquals(402 , message.getDefaultInt64 ()); - Assert.assertEquals(403 , message.getDefaultUint32 ()); - Assert.assertEquals(404 , message.getDefaultUint64 ()); - Assert.assertEquals(405 , message.getDefaultSint32 ()); - Assert.assertEquals(406 , message.getDefaultSint64 ()); - Assert.assertEquals(407 , message.getDefaultFixed32 ()); - Assert.assertEquals(408 , message.getDefaultFixed64 ()); - Assert.assertEquals(409 , message.getDefaultSfixed32()); - Assert.assertEquals(410 , message.getDefaultSfixed64()); - Assert.assertEquals(411 , message.getDefaultFloat (), 0.0); - Assert.assertEquals(412 , message.getDefaultDouble (), 0.0); - Assert.assertEquals(false, message.getDefaultBool ()); - Assert.assertEquals("415", message.getDefaultString ()); - Assert.assertEquals(toBytes("416"), message.getDefaultBytes()); - - Assert.assertEquals(TestAllTypes.NestedEnum.FOO, message.getDefaultNestedEnum ()); - Assert.assertEquals(ForeignEnum.FOREIGN_FOO, message.getDefaultForeignEnum()); - Assert.assertEquals(ImportEnum.IMPORT_FOO, message.getDefaultImportEnum()); - - Assert.assertEquals("424", message.getDefaultStringPiece()); - Assert.assertEquals("425", message.getDefaultCord()); - } - - // ------------------------------------------------------------------- - /** - * Assert (using {@code junit.framework.Assert}} that all fields of - * {@code message} are cleared, and that getting the fields returns their - * default values. - */ - public static void assertClear(TestAllTypesOrBuilder message) { - // hasBlah() should initially be false for all optional fields. - Assert.assertFalse(message.hasOptionalInt32 ()); - Assert.assertFalse(message.hasOptionalInt64 ()); - Assert.assertFalse(message.hasOptionalUint32 ()); - Assert.assertFalse(message.hasOptionalUint64 ()); - Assert.assertFalse(message.hasOptionalSint32 ()); - Assert.assertFalse(message.hasOptionalSint64 ()); - Assert.assertFalse(message.hasOptionalFixed32 ()); - Assert.assertFalse(message.hasOptionalFixed64 ()); - Assert.assertFalse(message.hasOptionalSfixed32()); - Assert.assertFalse(message.hasOptionalSfixed64()); - Assert.assertFalse(message.hasOptionalFloat ()); - Assert.assertFalse(message.hasOptionalDouble ()); - Assert.assertFalse(message.hasOptionalBool ()); - Assert.assertFalse(message.hasOptionalString ()); - Assert.assertFalse(message.hasOptionalBytes ()); - - Assert.assertFalse(message.hasOptionalGroup ()); - Assert.assertFalse(message.hasOptionalNestedMessage ()); - Assert.assertFalse(message.hasOptionalForeignMessage()); - Assert.assertFalse(message.hasOptionalImportMessage ()); - - Assert.assertFalse(message.hasOptionalNestedEnum ()); - Assert.assertFalse(message.hasOptionalForeignEnum()); - Assert.assertFalse(message.hasOptionalImportEnum ()); - - Assert.assertFalse(message.hasOptionalStringPiece()); - Assert.assertFalse(message.hasOptionalCord()); - - // Optional fields without defaults are set to zero or something like it. - Assert.assertEquals(0 , message.getOptionalInt32 ()); - Assert.assertEquals(0 , message.getOptionalInt64 ()); - Assert.assertEquals(0 , message.getOptionalUint32 ()); - Assert.assertEquals(0 , message.getOptionalUint64 ()); - Assert.assertEquals(0 , message.getOptionalSint32 ()); - Assert.assertEquals(0 , message.getOptionalSint64 ()); - Assert.assertEquals(0 , message.getOptionalFixed32 ()); - Assert.assertEquals(0 , message.getOptionalFixed64 ()); - Assert.assertEquals(0 , message.getOptionalSfixed32()); - Assert.assertEquals(0 , message.getOptionalSfixed64()); - Assert.assertEquals(0 , message.getOptionalFloat (), 0.0); - Assert.assertEquals(0 , message.getOptionalDouble (), 0.0); - Assert.assertEquals(false, message.getOptionalBool ()); - Assert.assertEquals("" , message.getOptionalString ()); - Assert.assertEquals(ByteString.EMPTY, message.getOptionalBytes()); - - // Embedded messages should also be clear. - Assert.assertFalse(message.getOptionalGroup ().hasA()); - Assert.assertFalse(message.getOptionalNestedMessage ().hasBb()); - Assert.assertFalse(message.getOptionalForeignMessage ().hasC()); - Assert.assertFalse(message.getOptionalImportMessage ().hasD()); - Assert.assertFalse(message.getOptionalPublicImportMessage().hasE()); - Assert.assertFalse(message.getOptionalLazyMessage ().hasBb()); - - Assert.assertEquals(0, message.getOptionalGroup ().getA()); - Assert.assertEquals(0, message.getOptionalNestedMessage ().getBb()); - Assert.assertEquals(0, message.getOptionalForeignMessage ().getC()); - Assert.assertEquals(0, message.getOptionalImportMessage ().getD()); - Assert.assertEquals(0, message.getOptionalPublicImportMessage().getE()); - Assert.assertEquals(0, message.getOptionalLazyMessage ().getBb()); - - // Enums without defaults are set to the first value in the enum. - Assert.assertEquals(TestAllTypes.NestedEnum.FOO, message.getOptionalNestedEnum ()); - Assert.assertEquals(ForeignEnum.FOREIGN_FOO, message.getOptionalForeignEnum()); - Assert.assertEquals(ImportEnum.IMPORT_FOO, message.getOptionalImportEnum()); - - Assert.assertEquals("", message.getOptionalStringPiece()); - Assert.assertEquals("", message.getOptionalCord()); - - // Repeated fields are empty. - Assert.assertEquals(0, message.getRepeatedInt32Count ()); - Assert.assertEquals(0, message.getRepeatedInt64Count ()); - Assert.assertEquals(0, message.getRepeatedUint32Count ()); - Assert.assertEquals(0, message.getRepeatedUint64Count ()); - Assert.assertEquals(0, message.getRepeatedSint32Count ()); - Assert.assertEquals(0, message.getRepeatedSint64Count ()); - Assert.assertEquals(0, message.getRepeatedFixed32Count ()); - Assert.assertEquals(0, message.getRepeatedFixed64Count ()); - Assert.assertEquals(0, message.getRepeatedSfixed32Count()); - Assert.assertEquals(0, message.getRepeatedSfixed64Count()); - Assert.assertEquals(0, message.getRepeatedFloatCount ()); - Assert.assertEquals(0, message.getRepeatedDoubleCount ()); - Assert.assertEquals(0, message.getRepeatedBoolCount ()); - Assert.assertEquals(0, message.getRepeatedStringCount ()); - Assert.assertEquals(0, message.getRepeatedBytesCount ()); - - Assert.assertEquals(0, message.getRepeatedGroupCount ()); - Assert.assertEquals(0, message.getRepeatedNestedMessageCount ()); - Assert.assertEquals(0, message.getRepeatedForeignMessageCount()); - Assert.assertEquals(0, message.getRepeatedImportMessageCount ()); - Assert.assertEquals(0, message.getRepeatedLazyMessageCount ()); - Assert.assertEquals(0, message.getRepeatedNestedEnumCount ()); - Assert.assertEquals(0, message.getRepeatedForeignEnumCount ()); - Assert.assertEquals(0, message.getRepeatedImportEnumCount ()); - - Assert.assertEquals(0, message.getRepeatedStringPieceCount()); - Assert.assertEquals(0, message.getRepeatedCordCount()); - - // hasBlah() should also be false for all default fields. - Assert.assertFalse(message.hasDefaultInt32 ()); - Assert.assertFalse(message.hasDefaultInt64 ()); - Assert.assertFalse(message.hasDefaultUint32 ()); - Assert.assertFalse(message.hasDefaultUint64 ()); - Assert.assertFalse(message.hasDefaultSint32 ()); - Assert.assertFalse(message.hasDefaultSint64 ()); - Assert.assertFalse(message.hasDefaultFixed32 ()); - Assert.assertFalse(message.hasDefaultFixed64 ()); - Assert.assertFalse(message.hasDefaultSfixed32()); - Assert.assertFalse(message.hasDefaultSfixed64()); - Assert.assertFalse(message.hasDefaultFloat ()); - Assert.assertFalse(message.hasDefaultDouble ()); - Assert.assertFalse(message.hasDefaultBool ()); - Assert.assertFalse(message.hasDefaultString ()); - Assert.assertFalse(message.hasDefaultBytes ()); - - Assert.assertFalse(message.hasDefaultNestedEnum ()); - Assert.assertFalse(message.hasDefaultForeignEnum()); - Assert.assertFalse(message.hasDefaultImportEnum ()); - - Assert.assertFalse(message.hasDefaultStringPiece()); - Assert.assertFalse(message.hasDefaultCord()); - - // Fields with defaults have their default values (duh). - Assert.assertEquals( 41 , message.getDefaultInt32 ()); - Assert.assertEquals( 42 , message.getDefaultInt64 ()); - Assert.assertEquals( 43 , message.getDefaultUint32 ()); - Assert.assertEquals( 44 , message.getDefaultUint64 ()); - Assert.assertEquals(-45 , message.getDefaultSint32 ()); - Assert.assertEquals( 46 , message.getDefaultSint64 ()); - Assert.assertEquals( 47 , message.getDefaultFixed32 ()); - Assert.assertEquals( 48 , message.getDefaultFixed64 ()); - Assert.assertEquals( 49 , message.getDefaultSfixed32()); - Assert.assertEquals(-50 , message.getDefaultSfixed64()); - Assert.assertEquals( 51.5 , message.getDefaultFloat (), 0.0); - Assert.assertEquals( 52e3 , message.getDefaultDouble (), 0.0); - Assert.assertEquals(true , message.getDefaultBool ()); - Assert.assertEquals("hello", message.getDefaultString ()); - Assert.assertEquals(toBytes("world"), message.getDefaultBytes()); - - Assert.assertEquals(TestAllTypes.NestedEnum.BAR, message.getDefaultNestedEnum ()); - Assert.assertEquals(ForeignEnum.FOREIGN_BAR, message.getDefaultForeignEnum()); - Assert.assertEquals(ImportEnum.IMPORT_BAR, message.getDefaultImportEnum()); - - Assert.assertEquals("abc", message.getDefaultStringPiece()); - Assert.assertEquals("123", message.getDefaultCord()); - } - - // ------------------------------------------------------------------- - - /** - * Assert (using {@code junit.framework.Assert}} that all fields of - * {@code message} are set to the values assigned by {@code setAllFields} - * followed by {@code modifyRepeatedFields}. - */ - public static void assertRepeatedFieldsModified( - TestAllTypesOrBuilder message) { - // ModifyRepeatedFields only sets the second repeated element of each - // field. In addition to verifying this, we also verify that the first - // element and size were *not* modified. - Assert.assertEquals(2, message.getRepeatedInt32Count ()); - Assert.assertEquals(2, message.getRepeatedInt64Count ()); - Assert.assertEquals(2, message.getRepeatedUint32Count ()); - Assert.assertEquals(2, message.getRepeatedUint64Count ()); - Assert.assertEquals(2, message.getRepeatedSint32Count ()); - Assert.assertEquals(2, message.getRepeatedSint64Count ()); - Assert.assertEquals(2, message.getRepeatedFixed32Count ()); - Assert.assertEquals(2, message.getRepeatedFixed64Count ()); - Assert.assertEquals(2, message.getRepeatedSfixed32Count()); - Assert.assertEquals(2, message.getRepeatedSfixed64Count()); - Assert.assertEquals(2, message.getRepeatedFloatCount ()); - Assert.assertEquals(2, message.getRepeatedDoubleCount ()); - Assert.assertEquals(2, message.getRepeatedBoolCount ()); - Assert.assertEquals(2, message.getRepeatedStringCount ()); - Assert.assertEquals(2, message.getRepeatedBytesCount ()); - - Assert.assertEquals(2, message.getRepeatedGroupCount ()); - Assert.assertEquals(2, message.getRepeatedNestedMessageCount ()); - Assert.assertEquals(2, message.getRepeatedForeignMessageCount()); - Assert.assertEquals(2, message.getRepeatedImportMessageCount ()); - Assert.assertEquals(2, message.getRepeatedLazyMessageCount ()); - Assert.assertEquals(2, message.getRepeatedNestedEnumCount ()); - Assert.assertEquals(2, message.getRepeatedForeignEnumCount ()); - Assert.assertEquals(2, message.getRepeatedImportEnumCount ()); - - Assert.assertEquals(2, message.getRepeatedStringPieceCount()); - Assert.assertEquals(2, message.getRepeatedCordCount()); - - Assert.assertEquals(201 , message.getRepeatedInt32 (0)); - Assert.assertEquals(202L , message.getRepeatedInt64 (0)); - Assert.assertEquals(203 , message.getRepeatedUint32 (0)); - Assert.assertEquals(204L , message.getRepeatedUint64 (0)); - Assert.assertEquals(205 , message.getRepeatedSint32 (0)); - Assert.assertEquals(206L , message.getRepeatedSint64 (0)); - Assert.assertEquals(207 , message.getRepeatedFixed32 (0)); - Assert.assertEquals(208L , message.getRepeatedFixed64 (0)); - Assert.assertEquals(209 , message.getRepeatedSfixed32(0)); - Assert.assertEquals(210L , message.getRepeatedSfixed64(0)); - Assert.assertEquals(211F , message.getRepeatedFloat (0)); - Assert.assertEquals(212D , message.getRepeatedDouble (0)); - Assert.assertEquals(true , message.getRepeatedBool (0)); - Assert.assertEquals("215", message.getRepeatedString (0)); - Assert.assertEquals(toBytes("216"), message.getRepeatedBytes(0)); - - Assert.assertEquals(217, message.getRepeatedGroup (0).getA()); - Assert.assertEquals(218, message.getRepeatedNestedMessage (0).getBb()); - Assert.assertEquals(219, message.getRepeatedForeignMessage(0).getC()); - Assert.assertEquals(220, message.getRepeatedImportMessage (0).getD()); - Assert.assertEquals(227, message.getRepeatedLazyMessage (0).getBb()); - - Assert.assertEquals(TestAllTypes.NestedEnum.BAR, message.getRepeatedNestedEnum (0)); - Assert.assertEquals(ForeignEnum.FOREIGN_BAR, message.getRepeatedForeignEnum(0)); - Assert.assertEquals(ImportEnum.IMPORT_BAR, message.getRepeatedImportEnum(0)); - - Assert.assertEquals("224", message.getRepeatedStringPiece(0)); - Assert.assertEquals("225", message.getRepeatedCord(0)); - - // Actually verify the second (modified) elements now. - Assert.assertEquals(501 , message.getRepeatedInt32 (1)); - Assert.assertEquals(502L , message.getRepeatedInt64 (1)); - Assert.assertEquals(503 , message.getRepeatedUint32 (1)); - Assert.assertEquals(504L , message.getRepeatedUint64 (1)); - Assert.assertEquals(505 , message.getRepeatedSint32 (1)); - Assert.assertEquals(506L , message.getRepeatedSint64 (1)); - Assert.assertEquals(507 , message.getRepeatedFixed32 (1)); - Assert.assertEquals(508L , message.getRepeatedFixed64 (1)); - Assert.assertEquals(509 , message.getRepeatedSfixed32(1)); - Assert.assertEquals(510L , message.getRepeatedSfixed64(1)); - Assert.assertEquals(511F , message.getRepeatedFloat (1)); - Assert.assertEquals(512D , message.getRepeatedDouble (1)); - Assert.assertEquals(true , message.getRepeatedBool (1)); - Assert.assertEquals("515", message.getRepeatedString (1)); - Assert.assertEquals(toBytes("516"), message.getRepeatedBytes(1)); - - Assert.assertEquals(517, message.getRepeatedGroup (1).getA()); - Assert.assertEquals(518, message.getRepeatedNestedMessage (1).getBb()); - Assert.assertEquals(519, message.getRepeatedForeignMessage(1).getC()); - Assert.assertEquals(520, message.getRepeatedImportMessage (1).getD()); - Assert.assertEquals(527, message.getRepeatedLazyMessage (1).getBb()); - - Assert.assertEquals(TestAllTypes.NestedEnum.FOO, message.getRepeatedNestedEnum (1)); - Assert.assertEquals(ForeignEnum.FOREIGN_FOO, message.getRepeatedForeignEnum(1)); - Assert.assertEquals(ImportEnum.IMPORT_FOO, message.getRepeatedImportEnum(1)); - - Assert.assertEquals("524", message.getRepeatedStringPiece(1)); - Assert.assertEquals("525", message.getRepeatedCord(1)); - } - - /** - * Set every field of {@code message} to a unique value. - */ - public static void setPackedFields(TestPackedTypes.Builder message) { - message.addPackedInt32 (601); - message.addPackedInt64 (602); - message.addPackedUint32 (603); - message.addPackedUint64 (604); - message.addPackedSint32 (605); - message.addPackedSint64 (606); - message.addPackedFixed32 (607); - message.addPackedFixed64 (608); - message.addPackedSfixed32(609); - message.addPackedSfixed64(610); - message.addPackedFloat (611); - message.addPackedDouble (612); - message.addPackedBool (true); - message.addPackedEnum (ForeignEnum.FOREIGN_BAR); - // Add a second one of each field. - message.addPackedInt32 (701); - message.addPackedInt64 (702); - message.addPackedUint32 (703); - message.addPackedUint64 (704); - message.addPackedSint32 (705); - message.addPackedSint64 (706); - message.addPackedFixed32 (707); - message.addPackedFixed64 (708); - message.addPackedSfixed32(709); - message.addPackedSfixed64(710); - message.addPackedFloat (711); - message.addPackedDouble (712); - message.addPackedBool (false); - message.addPackedEnum (ForeignEnum.FOREIGN_BAZ); - } - - /** - * Set every field of {@code message} to a unique value. Must correspond with - * the values applied by {@code setPackedFields}. - */ - public static void setUnpackedFields(TestUnpackedTypes.Builder message) { - message.addUnpackedInt32 (601); - message.addUnpackedInt64 (602); - message.addUnpackedUint32 (603); - message.addUnpackedUint64 (604); - message.addUnpackedSint32 (605); - message.addUnpackedSint64 (606); - message.addUnpackedFixed32 (607); - message.addUnpackedFixed64 (608); - message.addUnpackedSfixed32(609); - message.addUnpackedSfixed64(610); - message.addUnpackedFloat (611); - message.addUnpackedDouble (612); - message.addUnpackedBool (true); - message.addUnpackedEnum (ForeignEnum.FOREIGN_BAR); - // Add a second one of each field. - message.addUnpackedInt32 (701); - message.addUnpackedInt64 (702); - message.addUnpackedUint32 (703); - message.addUnpackedUint64 (704); - message.addUnpackedSint32 (705); - message.addUnpackedSint64 (706); - message.addUnpackedFixed32 (707); - message.addUnpackedFixed64 (708); - message.addUnpackedSfixed32(709); - message.addUnpackedSfixed64(710); - message.addUnpackedFloat (711); - message.addUnpackedDouble (712); - message.addUnpackedBool (false); - message.addUnpackedEnum (ForeignEnum.FOREIGN_BAZ); - } - - /** - * Assert (using {@code junit.framework.Assert}} that all fields of - * {@code message} are set to the values assigned by {@code setPackedFields}. - */ - public static void assertPackedFieldsSet(TestPackedTypes message) { - Assert.assertEquals(2, message.getPackedInt32Count ()); - Assert.assertEquals(2, message.getPackedInt64Count ()); - Assert.assertEquals(2, message.getPackedUint32Count ()); - Assert.assertEquals(2, message.getPackedUint64Count ()); - Assert.assertEquals(2, message.getPackedSint32Count ()); - Assert.assertEquals(2, message.getPackedSint64Count ()); - Assert.assertEquals(2, message.getPackedFixed32Count ()); - Assert.assertEquals(2, message.getPackedFixed64Count ()); - Assert.assertEquals(2, message.getPackedSfixed32Count()); - Assert.assertEquals(2, message.getPackedSfixed64Count()); - Assert.assertEquals(2, message.getPackedFloatCount ()); - Assert.assertEquals(2, message.getPackedDoubleCount ()); - Assert.assertEquals(2, message.getPackedBoolCount ()); - Assert.assertEquals(2, message.getPackedEnumCount ()); - Assert.assertEquals(601 , message.getPackedInt32 (0)); - Assert.assertEquals(602 , message.getPackedInt64 (0)); - Assert.assertEquals(603 , message.getPackedUint32 (0)); - Assert.assertEquals(604 , message.getPackedUint64 (0)); - Assert.assertEquals(605 , message.getPackedSint32 (0)); - Assert.assertEquals(606 , message.getPackedSint64 (0)); - Assert.assertEquals(607 , message.getPackedFixed32 (0)); - Assert.assertEquals(608 , message.getPackedFixed64 (0)); - Assert.assertEquals(609 , message.getPackedSfixed32(0)); - Assert.assertEquals(610 , message.getPackedSfixed64(0)); - Assert.assertEquals(611 , message.getPackedFloat (0), 0.0); - Assert.assertEquals(612 , message.getPackedDouble (0), 0.0); - Assert.assertEquals(true , message.getPackedBool (0)); - Assert.assertEquals(ForeignEnum.FOREIGN_BAR, message.getPackedEnum(0)); - Assert.assertEquals(701 , message.getPackedInt32 (1)); - Assert.assertEquals(702 , message.getPackedInt64 (1)); - Assert.assertEquals(703 , message.getPackedUint32 (1)); - Assert.assertEquals(704 , message.getPackedUint64 (1)); - Assert.assertEquals(705 , message.getPackedSint32 (1)); - Assert.assertEquals(706 , message.getPackedSint64 (1)); - Assert.assertEquals(707 , message.getPackedFixed32 (1)); - Assert.assertEquals(708 , message.getPackedFixed64 (1)); - Assert.assertEquals(709 , message.getPackedSfixed32(1)); - Assert.assertEquals(710 , message.getPackedSfixed64(1)); - Assert.assertEquals(711 , message.getPackedFloat (1), 0.0); - Assert.assertEquals(712 , message.getPackedDouble (1), 0.0); - Assert.assertEquals(false, message.getPackedBool (1)); - Assert.assertEquals(ForeignEnum.FOREIGN_BAZ, message.getPackedEnum(1)); - } - - /** - * Assert (using {@code junit.framework.Assert}} that all fields of - * {@code message} are set to the values assigned by {@code setUnpackedFields}. - */ - public static void assertUnpackedFieldsSet(TestUnpackedTypes message) { - Assert.assertEquals(2, message.getUnpackedInt32Count ()); - Assert.assertEquals(2, message.getUnpackedInt64Count ()); - Assert.assertEquals(2, message.getUnpackedUint32Count ()); - Assert.assertEquals(2, message.getUnpackedUint64Count ()); - Assert.assertEquals(2, message.getUnpackedSint32Count ()); - Assert.assertEquals(2, message.getUnpackedSint64Count ()); - Assert.assertEquals(2, message.getUnpackedFixed32Count ()); - Assert.assertEquals(2, message.getUnpackedFixed64Count ()); - Assert.assertEquals(2, message.getUnpackedSfixed32Count()); - Assert.assertEquals(2, message.getUnpackedSfixed64Count()); - Assert.assertEquals(2, message.getUnpackedFloatCount ()); - Assert.assertEquals(2, message.getUnpackedDoubleCount ()); - Assert.assertEquals(2, message.getUnpackedBoolCount ()); - Assert.assertEquals(2, message.getUnpackedEnumCount ()); - Assert.assertEquals(601 , message.getUnpackedInt32 (0)); - Assert.assertEquals(602 , message.getUnpackedInt64 (0)); - Assert.assertEquals(603 , message.getUnpackedUint32 (0)); - Assert.assertEquals(604 , message.getUnpackedUint64 (0)); - Assert.assertEquals(605 , message.getUnpackedSint32 (0)); - Assert.assertEquals(606 , message.getUnpackedSint64 (0)); - Assert.assertEquals(607 , message.getUnpackedFixed32 (0)); - Assert.assertEquals(608 , message.getUnpackedFixed64 (0)); - Assert.assertEquals(609 , message.getUnpackedSfixed32(0)); - Assert.assertEquals(610 , message.getUnpackedSfixed64(0)); - Assert.assertEquals(611 , message.getUnpackedFloat (0), 0.0); - Assert.assertEquals(612 , message.getUnpackedDouble (0), 0.0); - Assert.assertEquals(true , message.getUnpackedBool (0)); - Assert.assertEquals(ForeignEnum.FOREIGN_BAR, message.getUnpackedEnum(0)); - Assert.assertEquals(701 , message.getUnpackedInt32 (1)); - Assert.assertEquals(702 , message.getUnpackedInt64 (1)); - Assert.assertEquals(703 , message.getUnpackedUint32 (1)); - Assert.assertEquals(704 , message.getUnpackedUint64 (1)); - Assert.assertEquals(705 , message.getUnpackedSint32 (1)); - Assert.assertEquals(706 , message.getUnpackedSint64 (1)); - Assert.assertEquals(707 , message.getUnpackedFixed32 (1)); - Assert.assertEquals(708 , message.getUnpackedFixed64 (1)); - Assert.assertEquals(709 , message.getUnpackedSfixed32(1)); - Assert.assertEquals(710 , message.getUnpackedSfixed64(1)); - Assert.assertEquals(711 , message.getUnpackedFloat (1), 0.0); - Assert.assertEquals(712 , message.getUnpackedDouble (1), 0.0); - Assert.assertEquals(false, message.getUnpackedBool (1)); - Assert.assertEquals(ForeignEnum.FOREIGN_BAZ, message.getUnpackedEnum(1)); - } - - // =================================================================== - // Like above, but for extensions - - // Java gets confused with things like assertEquals(int, Integer): it can't - // decide whether to call assertEquals(int, int) or assertEquals(Object, - // Object). So we define these methods to help it. - private static void assertEqualsExactType(int a, int b) { - Assert.assertEquals(a, b); - } - private static void assertEqualsExactType(long a, long b) { - Assert.assertEquals(a, b); - } - private static void assertEqualsExactType(float a, float b) { - Assert.assertEquals(a, b, 0.0); - } - private static void assertEqualsExactType(double a, double b) { - Assert.assertEquals(a, b, 0.0); - } - private static void assertEqualsExactType(boolean a, boolean b) { - Assert.assertEquals(a, b); - } - private static void assertEqualsExactType(String a, String b) { - Assert.assertEquals(a, b); - } - private static void assertEqualsExactType(ByteString a, ByteString b) { - Assert.assertEquals(a, b); - } - private static void assertEqualsExactType(TestAllTypes.NestedEnum a, - TestAllTypes.NestedEnum b) { - Assert.assertEquals(a, b); - } - private static void assertEqualsExactType(ForeignEnum a, ForeignEnum b) { - Assert.assertEquals(a, b); - } - private static void assertEqualsExactType(ImportEnum a, ImportEnum b) { - Assert.assertEquals(a, b); - } - /** - * Get an unmodifiable {@link ExtensionRegistry} containing all the - * extensions of {@code TestAllExtensions}. - */ - public static ExtensionRegistry getExtensionRegistry() { - ExtensionRegistry registry = ExtensionRegistry.newInstance(); - registerAllExtensions(registry); - return registry.getUnmodifiable(); - } - - - /** - * Register all of {@code TestAllExtensions}'s extensions with the - * given {@link ExtensionRegistry}. - */ - public static void registerAllExtensions(ExtensionRegistry registry) { - UnittestProto.registerAllExtensions(registry); - } - - - /** - * Set every field of {@code message} to the values expected by - * {@code assertAllExtensionsSet()}. - */ - public static void setAllExtensions(TestAllExtensions.Builder message) { - message.setExtension(optionalInt32Extension , 101); - message.setExtension(optionalInt64Extension , 102L); - message.setExtension(optionalUint32Extension , 103); - message.setExtension(optionalUint64Extension , 104L); - message.setExtension(optionalSint32Extension , 105); - message.setExtension(optionalSint64Extension , 106L); - message.setExtension(optionalFixed32Extension , 107); - message.setExtension(optionalFixed64Extension , 108L); - message.setExtension(optionalSfixed32Extension, 109); - message.setExtension(optionalSfixed64Extension, 110L); - message.setExtension(optionalFloatExtension , 111F); - message.setExtension(optionalDoubleExtension , 112D); - message.setExtension(optionalBoolExtension , true); - message.setExtension(optionalStringExtension , "115"); - message.setExtension(optionalBytesExtension , toBytes("116")); - - message.setExtension(optionalGroupExtension, - OptionalGroup_extension.newBuilder().setA(117).build()); - message.setExtension(optionalNestedMessageExtension, - TestAllTypes.NestedMessage.newBuilder().setBb(118).build()); - message.setExtension(optionalForeignMessageExtension, - ForeignMessage.newBuilder().setC(119).build()); - message.setExtension(optionalImportMessageExtension, - ImportMessage.newBuilder().setD(120).build()); - message.setExtension(optionalPublicImportMessageExtension, - PublicImportMessage.newBuilder().setE(126).build()); - message.setExtension(optionalLazyMessageExtension, - TestAllTypes.NestedMessage.newBuilder().setBb(127).build()); - - message.setExtension(optionalNestedEnumExtension, TestAllTypes.NestedEnum.BAZ); - message.setExtension(optionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ); - message.setExtension(optionalImportEnumExtension, ImportEnum.IMPORT_BAZ); - - message.setExtension(optionalStringPieceExtension, "124"); - message.setExtension(optionalCordExtension, "125"); - - // ----------------------------------------------------------------- - - message.addExtension(repeatedInt32Extension , 201); - message.addExtension(repeatedInt64Extension , 202L); - message.addExtension(repeatedUint32Extension , 203); - message.addExtension(repeatedUint64Extension , 204L); - message.addExtension(repeatedSint32Extension , 205); - message.addExtension(repeatedSint64Extension , 206L); - message.addExtension(repeatedFixed32Extension , 207); - message.addExtension(repeatedFixed64Extension , 208L); - message.addExtension(repeatedSfixed32Extension, 209); - message.addExtension(repeatedSfixed64Extension, 210L); - message.addExtension(repeatedFloatExtension , 211F); - message.addExtension(repeatedDoubleExtension , 212D); - message.addExtension(repeatedBoolExtension , true); - message.addExtension(repeatedStringExtension , "215"); - message.addExtension(repeatedBytesExtension , toBytes("216")); - - message.addExtension(repeatedGroupExtension, - RepeatedGroup_extension.newBuilder().setA(217).build()); - message.addExtension(repeatedNestedMessageExtension, - TestAllTypes.NestedMessage.newBuilder().setBb(218).build()); - message.addExtension(repeatedForeignMessageExtension, - ForeignMessage.newBuilder().setC(219).build()); - message.addExtension(repeatedImportMessageExtension, - ImportMessage.newBuilder().setD(220).build()); - message.addExtension(repeatedLazyMessageExtension, - TestAllTypes.NestedMessage.newBuilder().setBb(227).build()); - - message.addExtension(repeatedNestedEnumExtension, TestAllTypes.NestedEnum.BAR); - message.addExtension(repeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAR); - message.addExtension(repeatedImportEnumExtension, ImportEnum.IMPORT_BAR); - - message.addExtension(repeatedStringPieceExtension, "224"); - message.addExtension(repeatedCordExtension, "225"); - - // Add a second one of each field. - message.addExtension(repeatedInt32Extension , 301); - message.addExtension(repeatedInt64Extension , 302L); - message.addExtension(repeatedUint32Extension , 303); - message.addExtension(repeatedUint64Extension , 304L); - message.addExtension(repeatedSint32Extension , 305); - message.addExtension(repeatedSint64Extension , 306L); - message.addExtension(repeatedFixed32Extension , 307); - message.addExtension(repeatedFixed64Extension , 308L); - message.addExtension(repeatedSfixed32Extension, 309); - message.addExtension(repeatedSfixed64Extension, 310L); - message.addExtension(repeatedFloatExtension , 311F); - message.addExtension(repeatedDoubleExtension , 312D); - message.addExtension(repeatedBoolExtension , false); - message.addExtension(repeatedStringExtension , "315"); - message.addExtension(repeatedBytesExtension , toBytes("316")); - - message.addExtension(repeatedGroupExtension, - RepeatedGroup_extension.newBuilder().setA(317).build()); - message.addExtension(repeatedNestedMessageExtension, - TestAllTypes.NestedMessage.newBuilder().setBb(318).build()); - message.addExtension(repeatedForeignMessageExtension, - ForeignMessage.newBuilder().setC(319).build()); - message.addExtension(repeatedImportMessageExtension, - ImportMessage.newBuilder().setD(320).build()); - message.addExtension(repeatedLazyMessageExtension, - TestAllTypes.NestedMessage.newBuilder().setBb(327).build()); - - message.addExtension(repeatedNestedEnumExtension, TestAllTypes.NestedEnum.BAZ); - message.addExtension(repeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAZ); - message.addExtension(repeatedImportEnumExtension, ImportEnum.IMPORT_BAZ); - - message.addExtension(repeatedStringPieceExtension, "324"); - message.addExtension(repeatedCordExtension, "325"); - - // ----------------------------------------------------------------- - - message.setExtension(defaultInt32Extension , 401); - message.setExtension(defaultInt64Extension , 402L); - message.setExtension(defaultUint32Extension , 403); - message.setExtension(defaultUint64Extension , 404L); - message.setExtension(defaultSint32Extension , 405); - message.setExtension(defaultSint64Extension , 406L); - message.setExtension(defaultFixed32Extension , 407); - message.setExtension(defaultFixed64Extension , 408L); - message.setExtension(defaultSfixed32Extension, 409); - message.setExtension(defaultSfixed64Extension, 410L); - message.setExtension(defaultFloatExtension , 411F); - message.setExtension(defaultDoubleExtension , 412D); - message.setExtension(defaultBoolExtension , false); - message.setExtension(defaultStringExtension , "415"); - message.setExtension(defaultBytesExtension , toBytes("416")); - - message.setExtension(defaultNestedEnumExtension, TestAllTypes.NestedEnum.FOO); - message.setExtension(defaultForeignEnumExtension, ForeignEnum.FOREIGN_FOO); - message.setExtension(defaultImportEnumExtension, ImportEnum.IMPORT_FOO); - - message.setExtension(defaultStringPieceExtension, "424"); - message.setExtension(defaultCordExtension, "425"); - } - - // ------------------------------------------------------------------- - - /** - * Modify the repeated extensions of {@code message} to contain the values - * expected by {@code assertRepeatedExtensionsModified()}. - */ - public static void modifyRepeatedExtensions( - TestAllExtensions.Builder message) { - message.setExtension(repeatedInt32Extension , 1, 501); - message.setExtension(repeatedInt64Extension , 1, 502L); - message.setExtension(repeatedUint32Extension , 1, 503); - message.setExtension(repeatedUint64Extension , 1, 504L); - message.setExtension(repeatedSint32Extension , 1, 505); - message.setExtension(repeatedSint64Extension , 1, 506L); - message.setExtension(repeatedFixed32Extension , 1, 507); - message.setExtension(repeatedFixed64Extension , 1, 508L); - message.setExtension(repeatedSfixed32Extension, 1, 509); - message.setExtension(repeatedSfixed64Extension, 1, 510L); - message.setExtension(repeatedFloatExtension , 1, 511F); - message.setExtension(repeatedDoubleExtension , 1, 512D); - message.setExtension(repeatedBoolExtension , 1, true); - message.setExtension(repeatedStringExtension , 1, "515"); - message.setExtension(repeatedBytesExtension , 1, toBytes("516")); - - message.setExtension(repeatedGroupExtension, 1, - RepeatedGroup_extension.newBuilder().setA(517).build()); - message.setExtension(repeatedNestedMessageExtension, 1, - TestAllTypes.NestedMessage.newBuilder().setBb(518).build()); - message.setExtension(repeatedForeignMessageExtension, 1, - ForeignMessage.newBuilder().setC(519).build()); - message.setExtension(repeatedImportMessageExtension, 1, - ImportMessage.newBuilder().setD(520).build()); - message.setExtension(repeatedLazyMessageExtension, 1, - TestAllTypes.NestedMessage.newBuilder().setBb(527).build()); - - message.setExtension(repeatedNestedEnumExtension , 1, TestAllTypes.NestedEnum.FOO); - message.setExtension(repeatedForeignEnumExtension, 1, ForeignEnum.FOREIGN_FOO); - message.setExtension(repeatedImportEnumExtension , 1, ImportEnum.IMPORT_FOO); - - message.setExtension(repeatedStringPieceExtension, 1, "524"); - message.setExtension(repeatedCordExtension, 1, "525"); - } - - // ------------------------------------------------------------------- - - /** - * Assert (using {@code junit.framework.Assert}} that all extensions of - * {@code message} are set to the values assigned by {@code setAllExtensions}. - */ - public static void assertAllExtensionsSet( - TestAllExtensionsOrBuilder message) { - Assert.assertTrue(message.hasExtension(optionalInt32Extension )); - Assert.assertTrue(message.hasExtension(optionalInt64Extension )); - Assert.assertTrue(message.hasExtension(optionalUint32Extension )); - Assert.assertTrue(message.hasExtension(optionalUint64Extension )); - Assert.assertTrue(message.hasExtension(optionalSint32Extension )); - Assert.assertTrue(message.hasExtension(optionalSint64Extension )); - Assert.assertTrue(message.hasExtension(optionalFixed32Extension )); - Assert.assertTrue(message.hasExtension(optionalFixed64Extension )); - Assert.assertTrue(message.hasExtension(optionalSfixed32Extension)); - Assert.assertTrue(message.hasExtension(optionalSfixed64Extension)); - Assert.assertTrue(message.hasExtension(optionalFloatExtension )); - Assert.assertTrue(message.hasExtension(optionalDoubleExtension )); - Assert.assertTrue(message.hasExtension(optionalBoolExtension )); - Assert.assertTrue(message.hasExtension(optionalStringExtension )); - Assert.assertTrue(message.hasExtension(optionalBytesExtension )); - - Assert.assertTrue(message.hasExtension(optionalGroupExtension )); - Assert.assertTrue(message.hasExtension(optionalNestedMessageExtension )); - Assert.assertTrue(message.hasExtension(optionalForeignMessageExtension)); - Assert.assertTrue(message.hasExtension(optionalImportMessageExtension )); - - Assert.assertTrue(message.getExtension(optionalGroupExtension ).hasA()); - Assert.assertTrue(message.getExtension(optionalNestedMessageExtension ).hasBb()); - Assert.assertTrue(message.getExtension(optionalForeignMessageExtension).hasC()); - Assert.assertTrue(message.getExtension(optionalImportMessageExtension ).hasD()); - - Assert.assertTrue(message.hasExtension(optionalNestedEnumExtension )); - Assert.assertTrue(message.hasExtension(optionalForeignEnumExtension)); - Assert.assertTrue(message.hasExtension(optionalImportEnumExtension )); - - Assert.assertTrue(message.hasExtension(optionalStringPieceExtension)); - Assert.assertTrue(message.hasExtension(optionalCordExtension)); - - assertEqualsExactType(101 , message.getExtension(optionalInt32Extension )); - assertEqualsExactType(102L , message.getExtension(optionalInt64Extension )); - assertEqualsExactType(103 , message.getExtension(optionalUint32Extension )); - assertEqualsExactType(104L , message.getExtension(optionalUint64Extension )); - assertEqualsExactType(105 , message.getExtension(optionalSint32Extension )); - assertEqualsExactType(106L , message.getExtension(optionalSint64Extension )); - assertEqualsExactType(107 , message.getExtension(optionalFixed32Extension )); - assertEqualsExactType(108L , message.getExtension(optionalFixed64Extension )); - assertEqualsExactType(109 , message.getExtension(optionalSfixed32Extension)); - assertEqualsExactType(110L , message.getExtension(optionalSfixed64Extension)); - assertEqualsExactType(111F , message.getExtension(optionalFloatExtension )); - assertEqualsExactType(112D , message.getExtension(optionalDoubleExtension )); - assertEqualsExactType(true , message.getExtension(optionalBoolExtension )); - assertEqualsExactType("115", message.getExtension(optionalStringExtension )); - assertEqualsExactType(toBytes("116"), message.getExtension(optionalBytesExtension)); - - assertEqualsExactType(117, message.getExtension(optionalGroupExtension ).getA()); - assertEqualsExactType(118, message.getExtension(optionalNestedMessageExtension ).getBb()); - assertEqualsExactType(119, message.getExtension(optionalForeignMessageExtension ).getC()); - assertEqualsExactType(120, message.getExtension(optionalImportMessageExtension ).getD()); - assertEqualsExactType(126, message.getExtension(optionalPublicImportMessageExtension).getE()); - assertEqualsExactType(127, message.getExtension(optionalLazyMessageExtension ).getBb()); - - assertEqualsExactType(TestAllTypes.NestedEnum.BAZ, - message.getExtension(optionalNestedEnumExtension)); - assertEqualsExactType(ForeignEnum.FOREIGN_BAZ, - message.getExtension(optionalForeignEnumExtension)); - assertEqualsExactType(ImportEnum.IMPORT_BAZ, - message.getExtension(optionalImportEnumExtension)); - - assertEqualsExactType("124", message.getExtension(optionalStringPieceExtension)); - assertEqualsExactType("125", message.getExtension(optionalCordExtension)); - - // ----------------------------------------------------------------- - - Assert.assertEquals(2, message.getExtensionCount(repeatedInt32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedInt64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedUint32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedUint64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedSint32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedSint64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedFixed32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedFixed64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedSfixed32Extension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedSfixed64Extension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedFloatExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedDoubleExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedBoolExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedStringExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedBytesExtension )); - - Assert.assertEquals(2, message.getExtensionCount(repeatedGroupExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedNestedMessageExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedForeignMessageExtension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedImportMessageExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedLazyMessageExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedNestedEnumExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedForeignEnumExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedImportEnumExtension )); - - Assert.assertEquals(2, message.getExtensionCount(repeatedStringPieceExtension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedCordExtension)); - - assertEqualsExactType(201 , message.getExtension(repeatedInt32Extension , 0)); - assertEqualsExactType(202L , message.getExtension(repeatedInt64Extension , 0)); - assertEqualsExactType(203 , message.getExtension(repeatedUint32Extension , 0)); - assertEqualsExactType(204L , message.getExtension(repeatedUint64Extension , 0)); - assertEqualsExactType(205 , message.getExtension(repeatedSint32Extension , 0)); - assertEqualsExactType(206L , message.getExtension(repeatedSint64Extension , 0)); - assertEqualsExactType(207 , message.getExtension(repeatedFixed32Extension , 0)); - assertEqualsExactType(208L , message.getExtension(repeatedFixed64Extension , 0)); - assertEqualsExactType(209 , message.getExtension(repeatedSfixed32Extension, 0)); - assertEqualsExactType(210L , message.getExtension(repeatedSfixed64Extension, 0)); - assertEqualsExactType(211F , message.getExtension(repeatedFloatExtension , 0)); - assertEqualsExactType(212D , message.getExtension(repeatedDoubleExtension , 0)); - assertEqualsExactType(true , message.getExtension(repeatedBoolExtension , 0)); - assertEqualsExactType("215", message.getExtension(repeatedStringExtension , 0)); - assertEqualsExactType(toBytes("216"), message.getExtension(repeatedBytesExtension, 0)); - - assertEqualsExactType(217, message.getExtension(repeatedGroupExtension , 0).getA()); - assertEqualsExactType(218, message.getExtension(repeatedNestedMessageExtension , 0).getBb()); - assertEqualsExactType(219, message.getExtension(repeatedForeignMessageExtension, 0).getC()); - assertEqualsExactType(220, message.getExtension(repeatedImportMessageExtension , 0).getD()); - assertEqualsExactType(227, message.getExtension(repeatedLazyMessageExtension , 0).getBb()); - - assertEqualsExactType(TestAllTypes.NestedEnum.BAR, - message.getExtension(repeatedNestedEnumExtension, 0)); - assertEqualsExactType(ForeignEnum.FOREIGN_BAR, - message.getExtension(repeatedForeignEnumExtension, 0)); - assertEqualsExactType(ImportEnum.IMPORT_BAR, - message.getExtension(repeatedImportEnumExtension, 0)); - - assertEqualsExactType("224", message.getExtension(repeatedStringPieceExtension, 0)); - assertEqualsExactType("225", message.getExtension(repeatedCordExtension, 0)); - - assertEqualsExactType(301 , message.getExtension(repeatedInt32Extension , 1)); - assertEqualsExactType(302L , message.getExtension(repeatedInt64Extension , 1)); - assertEqualsExactType(303 , message.getExtension(repeatedUint32Extension , 1)); - assertEqualsExactType(304L , message.getExtension(repeatedUint64Extension , 1)); - assertEqualsExactType(305 , message.getExtension(repeatedSint32Extension , 1)); - assertEqualsExactType(306L , message.getExtension(repeatedSint64Extension , 1)); - assertEqualsExactType(307 , message.getExtension(repeatedFixed32Extension , 1)); - assertEqualsExactType(308L , message.getExtension(repeatedFixed64Extension , 1)); - assertEqualsExactType(309 , message.getExtension(repeatedSfixed32Extension, 1)); - assertEqualsExactType(310L , message.getExtension(repeatedSfixed64Extension, 1)); - assertEqualsExactType(311F , message.getExtension(repeatedFloatExtension , 1)); - assertEqualsExactType(312D , message.getExtension(repeatedDoubleExtension , 1)); - assertEqualsExactType(false, message.getExtension(repeatedBoolExtension , 1)); - assertEqualsExactType("315", message.getExtension(repeatedStringExtension , 1)); - assertEqualsExactType(toBytes("316"), message.getExtension(repeatedBytesExtension, 1)); - - assertEqualsExactType(317, message.getExtension(repeatedGroupExtension , 1).getA()); - assertEqualsExactType(318, message.getExtension(repeatedNestedMessageExtension , 1).getBb()); - assertEqualsExactType(319, message.getExtension(repeatedForeignMessageExtension, 1).getC()); - assertEqualsExactType(320, message.getExtension(repeatedImportMessageExtension , 1).getD()); - assertEqualsExactType(327, message.getExtension(repeatedLazyMessageExtension , 1).getBb()); - - assertEqualsExactType(TestAllTypes.NestedEnum.BAZ, - message.getExtension(repeatedNestedEnumExtension, 1)); - assertEqualsExactType(ForeignEnum.FOREIGN_BAZ, - message.getExtension(repeatedForeignEnumExtension, 1)); - assertEqualsExactType(ImportEnum.IMPORT_BAZ, - message.getExtension(repeatedImportEnumExtension, 1)); - - assertEqualsExactType("324", message.getExtension(repeatedStringPieceExtension, 1)); - assertEqualsExactType("325", message.getExtension(repeatedCordExtension, 1)); - - // ----------------------------------------------------------------- - - Assert.assertTrue(message.hasExtension(defaultInt32Extension )); - Assert.assertTrue(message.hasExtension(defaultInt64Extension )); - Assert.assertTrue(message.hasExtension(defaultUint32Extension )); - Assert.assertTrue(message.hasExtension(defaultUint64Extension )); - Assert.assertTrue(message.hasExtension(defaultSint32Extension )); - Assert.assertTrue(message.hasExtension(defaultSint64Extension )); - Assert.assertTrue(message.hasExtension(defaultFixed32Extension )); - Assert.assertTrue(message.hasExtension(defaultFixed64Extension )); - Assert.assertTrue(message.hasExtension(defaultSfixed32Extension)); - Assert.assertTrue(message.hasExtension(defaultSfixed64Extension)); - Assert.assertTrue(message.hasExtension(defaultFloatExtension )); - Assert.assertTrue(message.hasExtension(defaultDoubleExtension )); - Assert.assertTrue(message.hasExtension(defaultBoolExtension )); - Assert.assertTrue(message.hasExtension(defaultStringExtension )); - Assert.assertTrue(message.hasExtension(defaultBytesExtension )); - - Assert.assertTrue(message.hasExtension(defaultNestedEnumExtension )); - Assert.assertTrue(message.hasExtension(defaultForeignEnumExtension)); - Assert.assertTrue(message.hasExtension(defaultImportEnumExtension )); - - Assert.assertTrue(message.hasExtension(defaultStringPieceExtension)); - Assert.assertTrue(message.hasExtension(defaultCordExtension)); - - assertEqualsExactType(401 , message.getExtension(defaultInt32Extension )); - assertEqualsExactType(402L , message.getExtension(defaultInt64Extension )); - assertEqualsExactType(403 , message.getExtension(defaultUint32Extension )); - assertEqualsExactType(404L , message.getExtension(defaultUint64Extension )); - assertEqualsExactType(405 , message.getExtension(defaultSint32Extension )); - assertEqualsExactType(406L , message.getExtension(defaultSint64Extension )); - assertEqualsExactType(407 , message.getExtension(defaultFixed32Extension )); - assertEqualsExactType(408L , message.getExtension(defaultFixed64Extension )); - assertEqualsExactType(409 , message.getExtension(defaultSfixed32Extension)); - assertEqualsExactType(410L , message.getExtension(defaultSfixed64Extension)); - assertEqualsExactType(411F , message.getExtension(defaultFloatExtension )); - assertEqualsExactType(412D , message.getExtension(defaultDoubleExtension )); - assertEqualsExactType(false, message.getExtension(defaultBoolExtension )); - assertEqualsExactType("415", message.getExtension(defaultStringExtension )); - assertEqualsExactType(toBytes("416"), message.getExtension(defaultBytesExtension)); - - assertEqualsExactType(TestAllTypes.NestedEnum.FOO, - message.getExtension(defaultNestedEnumExtension )); - assertEqualsExactType(ForeignEnum.FOREIGN_FOO, - message.getExtension(defaultForeignEnumExtension)); - assertEqualsExactType(ImportEnum.IMPORT_FOO, - message.getExtension(defaultImportEnumExtension)); - - assertEqualsExactType("424", message.getExtension(defaultStringPieceExtension)); - assertEqualsExactType("425", message.getExtension(defaultCordExtension)); - } - - // ------------------------------------------------------------------- - - /** - * Assert (using {@code junit.framework.Assert}} that all extensions of - * {@code message} are cleared, and that getting the extensions returns their - * default values. - */ - public static void assertExtensionsClear(TestAllExtensionsOrBuilder message) { - // hasBlah() should initially be false for all optional fields. - Assert.assertFalse(message.hasExtension(optionalInt32Extension )); - Assert.assertFalse(message.hasExtension(optionalInt64Extension )); - Assert.assertFalse(message.hasExtension(optionalUint32Extension )); - Assert.assertFalse(message.hasExtension(optionalUint64Extension )); - Assert.assertFalse(message.hasExtension(optionalSint32Extension )); - Assert.assertFalse(message.hasExtension(optionalSint64Extension )); - Assert.assertFalse(message.hasExtension(optionalFixed32Extension )); - Assert.assertFalse(message.hasExtension(optionalFixed64Extension )); - Assert.assertFalse(message.hasExtension(optionalSfixed32Extension)); - Assert.assertFalse(message.hasExtension(optionalSfixed64Extension)); - Assert.assertFalse(message.hasExtension(optionalFloatExtension )); - Assert.assertFalse(message.hasExtension(optionalDoubleExtension )); - Assert.assertFalse(message.hasExtension(optionalBoolExtension )); - Assert.assertFalse(message.hasExtension(optionalStringExtension )); - Assert.assertFalse(message.hasExtension(optionalBytesExtension )); - - Assert.assertFalse(message.hasExtension(optionalGroupExtension )); - Assert.assertFalse(message.hasExtension(optionalNestedMessageExtension )); - Assert.assertFalse(message.hasExtension(optionalForeignMessageExtension)); - Assert.assertFalse(message.hasExtension(optionalImportMessageExtension )); - - Assert.assertFalse(message.hasExtension(optionalNestedEnumExtension )); - Assert.assertFalse(message.hasExtension(optionalForeignEnumExtension)); - Assert.assertFalse(message.hasExtension(optionalImportEnumExtension )); - - Assert.assertFalse(message.hasExtension(optionalStringPieceExtension)); - Assert.assertFalse(message.hasExtension(optionalCordExtension)); - - // Optional fields without defaults are set to zero or something like it. - assertEqualsExactType(0 , message.getExtension(optionalInt32Extension )); - assertEqualsExactType(0L , message.getExtension(optionalInt64Extension )); - assertEqualsExactType(0 , message.getExtension(optionalUint32Extension )); - assertEqualsExactType(0L , message.getExtension(optionalUint64Extension )); - assertEqualsExactType(0 , message.getExtension(optionalSint32Extension )); - assertEqualsExactType(0L , message.getExtension(optionalSint64Extension )); - assertEqualsExactType(0 , message.getExtension(optionalFixed32Extension )); - assertEqualsExactType(0L , message.getExtension(optionalFixed64Extension )); - assertEqualsExactType(0 , message.getExtension(optionalSfixed32Extension)); - assertEqualsExactType(0L , message.getExtension(optionalSfixed64Extension)); - assertEqualsExactType(0F , message.getExtension(optionalFloatExtension )); - assertEqualsExactType(0D , message.getExtension(optionalDoubleExtension )); - assertEqualsExactType(false, message.getExtension(optionalBoolExtension )); - assertEqualsExactType("" , message.getExtension(optionalStringExtension )); - assertEqualsExactType(ByteString.EMPTY, message.getExtension(optionalBytesExtension)); - - // Embedded messages should also be clear. - Assert.assertFalse(message.getExtension(optionalGroupExtension ).hasA()); - Assert.assertFalse(message.getExtension(optionalNestedMessageExtension ).hasBb()); - Assert.assertFalse(message.getExtension(optionalForeignMessageExtension).hasC()); - Assert.assertFalse(message.getExtension(optionalImportMessageExtension ).hasD()); - - assertEqualsExactType(0, message.getExtension(optionalGroupExtension ).getA()); - assertEqualsExactType(0, message.getExtension(optionalNestedMessageExtension ).getBb()); - assertEqualsExactType(0, message.getExtension(optionalForeignMessageExtension).getC()); - assertEqualsExactType(0, message.getExtension(optionalImportMessageExtension ).getD()); - - // Enums without defaults are set to the first value in the enum. - assertEqualsExactType(TestAllTypes.NestedEnum.FOO, - message.getExtension(optionalNestedEnumExtension )); - assertEqualsExactType(ForeignEnum.FOREIGN_FOO, - message.getExtension(optionalForeignEnumExtension)); - assertEqualsExactType(ImportEnum.IMPORT_FOO, - message.getExtension(optionalImportEnumExtension)); - - assertEqualsExactType("", message.getExtension(optionalStringPieceExtension)); - assertEqualsExactType("", message.getExtension(optionalCordExtension)); - - // Repeated fields are empty. - Assert.assertEquals(0, message.getExtensionCount(repeatedInt32Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedInt64Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedUint32Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedUint64Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedSint32Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedSint64Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedFixed32Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedFixed64Extension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedSfixed32Extension)); - Assert.assertEquals(0, message.getExtensionCount(repeatedSfixed64Extension)); - Assert.assertEquals(0, message.getExtensionCount(repeatedFloatExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedDoubleExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedBoolExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedStringExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedBytesExtension )); - - Assert.assertEquals(0, message.getExtensionCount(repeatedGroupExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedNestedMessageExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedForeignMessageExtension)); - Assert.assertEquals(0, message.getExtensionCount(repeatedImportMessageExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedLazyMessageExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedNestedEnumExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedForeignEnumExtension )); - Assert.assertEquals(0, message.getExtensionCount(repeatedImportEnumExtension )); - - Assert.assertEquals(0, message.getExtensionCount(repeatedStringPieceExtension)); - Assert.assertEquals(0, message.getExtensionCount(repeatedCordExtension)); - - // Repeated fields are empty via getExtension().size(). - Assert.assertEquals(0, message.getExtension(repeatedInt32Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedInt64Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedUint32Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedUint64Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedSint32Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedSint64Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedFixed32Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedFixed64Extension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedSfixed32Extension).size()); - Assert.assertEquals(0, message.getExtension(repeatedSfixed64Extension).size()); - Assert.assertEquals(0, message.getExtension(repeatedFloatExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedDoubleExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedBoolExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedStringExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedBytesExtension ).size()); - - Assert.assertEquals(0, message.getExtension(repeatedGroupExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedNestedMessageExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedForeignMessageExtension).size()); - Assert.assertEquals(0, message.getExtension(repeatedImportMessageExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedLazyMessageExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedNestedEnumExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedForeignEnumExtension ).size()); - Assert.assertEquals(0, message.getExtension(repeatedImportEnumExtension ).size()); - - Assert.assertEquals(0, message.getExtension(repeatedStringPieceExtension).size()); - Assert.assertEquals(0, message.getExtension(repeatedCordExtension).size()); - - // hasBlah() should also be false for all default fields. - Assert.assertFalse(message.hasExtension(defaultInt32Extension )); - Assert.assertFalse(message.hasExtension(defaultInt64Extension )); - Assert.assertFalse(message.hasExtension(defaultUint32Extension )); - Assert.assertFalse(message.hasExtension(defaultUint64Extension )); - Assert.assertFalse(message.hasExtension(defaultSint32Extension )); - Assert.assertFalse(message.hasExtension(defaultSint64Extension )); - Assert.assertFalse(message.hasExtension(defaultFixed32Extension )); - Assert.assertFalse(message.hasExtension(defaultFixed64Extension )); - Assert.assertFalse(message.hasExtension(defaultSfixed32Extension)); - Assert.assertFalse(message.hasExtension(defaultSfixed64Extension)); - Assert.assertFalse(message.hasExtension(defaultFloatExtension )); - Assert.assertFalse(message.hasExtension(defaultDoubleExtension )); - Assert.assertFalse(message.hasExtension(defaultBoolExtension )); - Assert.assertFalse(message.hasExtension(defaultStringExtension )); - Assert.assertFalse(message.hasExtension(defaultBytesExtension )); - - Assert.assertFalse(message.hasExtension(defaultNestedEnumExtension )); - Assert.assertFalse(message.hasExtension(defaultForeignEnumExtension)); - Assert.assertFalse(message.hasExtension(defaultImportEnumExtension )); - - Assert.assertFalse(message.hasExtension(defaultStringPieceExtension)); - Assert.assertFalse(message.hasExtension(defaultCordExtension)); - - // Fields with defaults have their default values (duh). - assertEqualsExactType( 41 , message.getExtension(defaultInt32Extension )); - assertEqualsExactType( 42L , message.getExtension(defaultInt64Extension )); - assertEqualsExactType( 43 , message.getExtension(defaultUint32Extension )); - assertEqualsExactType( 44L , message.getExtension(defaultUint64Extension )); - assertEqualsExactType(-45 , message.getExtension(defaultSint32Extension )); - assertEqualsExactType( 46L , message.getExtension(defaultSint64Extension )); - assertEqualsExactType( 47 , message.getExtension(defaultFixed32Extension )); - assertEqualsExactType( 48L , message.getExtension(defaultFixed64Extension )); - assertEqualsExactType( 49 , message.getExtension(defaultSfixed32Extension)); - assertEqualsExactType(-50L , message.getExtension(defaultSfixed64Extension)); - assertEqualsExactType( 51.5F , message.getExtension(defaultFloatExtension )); - assertEqualsExactType( 52e3D , message.getExtension(defaultDoubleExtension )); - assertEqualsExactType(true , message.getExtension(defaultBoolExtension )); - assertEqualsExactType("hello", message.getExtension(defaultStringExtension )); - assertEqualsExactType(toBytes("world"), message.getExtension(defaultBytesExtension)); - - assertEqualsExactType(TestAllTypes.NestedEnum.BAR, - message.getExtension(defaultNestedEnumExtension )); - assertEqualsExactType(ForeignEnum.FOREIGN_BAR, - message.getExtension(defaultForeignEnumExtension)); - assertEqualsExactType(ImportEnum.IMPORT_BAR, - message.getExtension(defaultImportEnumExtension)); - - assertEqualsExactType("abc", message.getExtension(defaultStringPieceExtension)); - assertEqualsExactType("123", message.getExtension(defaultCordExtension)); - } - - // ------------------------------------------------------------------- - - /** - * Assert (using {@code junit.framework.Assert}} that all extensions of - * {@code message} are set to the values assigned by {@code setAllExtensions} - * followed by {@code modifyRepeatedExtensions}. - */ - public static void assertRepeatedExtensionsModified( - TestAllExtensionsOrBuilder message) { - // ModifyRepeatedFields only sets the second repeated element of each - // field. In addition to verifying this, we also verify that the first - // element and size were *not* modified. - Assert.assertEquals(2, message.getExtensionCount(repeatedInt32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedInt64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedUint32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedUint64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedSint32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedSint64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedFixed32Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedFixed64Extension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedSfixed32Extension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedSfixed64Extension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedFloatExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedDoubleExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedBoolExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedStringExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedBytesExtension )); - - Assert.assertEquals(2, message.getExtensionCount(repeatedGroupExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedNestedMessageExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedForeignMessageExtension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedImportMessageExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedLazyMessageExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedNestedEnumExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedForeignEnumExtension )); - Assert.assertEquals(2, message.getExtensionCount(repeatedImportEnumExtension )); - - Assert.assertEquals(2, message.getExtensionCount(repeatedStringPieceExtension)); - Assert.assertEquals(2, message.getExtensionCount(repeatedCordExtension)); - - assertEqualsExactType(201 , message.getExtension(repeatedInt32Extension , 0)); - assertEqualsExactType(202L , message.getExtension(repeatedInt64Extension , 0)); - assertEqualsExactType(203 , message.getExtension(repeatedUint32Extension , 0)); - assertEqualsExactType(204L , message.getExtension(repeatedUint64Extension , 0)); - assertEqualsExactType(205 , message.getExtension(repeatedSint32Extension , 0)); - assertEqualsExactType(206L , message.getExtension(repeatedSint64Extension , 0)); - assertEqualsExactType(207 , message.getExtension(repeatedFixed32Extension , 0)); - assertEqualsExactType(208L , message.getExtension(repeatedFixed64Extension , 0)); - assertEqualsExactType(209 , message.getExtension(repeatedSfixed32Extension, 0)); - assertEqualsExactType(210L , message.getExtension(repeatedSfixed64Extension, 0)); - assertEqualsExactType(211F , message.getExtension(repeatedFloatExtension , 0)); - assertEqualsExactType(212D , message.getExtension(repeatedDoubleExtension , 0)); - assertEqualsExactType(true , message.getExtension(repeatedBoolExtension , 0)); - assertEqualsExactType("215", message.getExtension(repeatedStringExtension , 0)); - assertEqualsExactType(toBytes("216"), message.getExtension(repeatedBytesExtension, 0)); - - assertEqualsExactType(217, message.getExtension(repeatedGroupExtension , 0).getA()); - assertEqualsExactType(218, message.getExtension(repeatedNestedMessageExtension , 0).getBb()); - assertEqualsExactType(219, message.getExtension(repeatedForeignMessageExtension, 0).getC()); - assertEqualsExactType(220, message.getExtension(repeatedImportMessageExtension , 0).getD()); - assertEqualsExactType(227, message.getExtension(repeatedLazyMessageExtension , 0).getBb()); - - assertEqualsExactType(TestAllTypes.NestedEnum.BAR, - message.getExtension(repeatedNestedEnumExtension, 0)); - assertEqualsExactType(ForeignEnum.FOREIGN_BAR, - message.getExtension(repeatedForeignEnumExtension, 0)); - assertEqualsExactType(ImportEnum.IMPORT_BAR, - message.getExtension(repeatedImportEnumExtension, 0)); - - assertEqualsExactType("224", message.getExtension(repeatedStringPieceExtension, 0)); - assertEqualsExactType("225", message.getExtension(repeatedCordExtension, 0)); - - // Actually verify the second (modified) elements now. - assertEqualsExactType(501 , message.getExtension(repeatedInt32Extension , 1)); - assertEqualsExactType(502L , message.getExtension(repeatedInt64Extension , 1)); - assertEqualsExactType(503 , message.getExtension(repeatedUint32Extension , 1)); - assertEqualsExactType(504L , message.getExtension(repeatedUint64Extension , 1)); - assertEqualsExactType(505 , message.getExtension(repeatedSint32Extension , 1)); - assertEqualsExactType(506L , message.getExtension(repeatedSint64Extension , 1)); - assertEqualsExactType(507 , message.getExtension(repeatedFixed32Extension , 1)); - assertEqualsExactType(508L , message.getExtension(repeatedFixed64Extension , 1)); - assertEqualsExactType(509 , message.getExtension(repeatedSfixed32Extension, 1)); - assertEqualsExactType(510L , message.getExtension(repeatedSfixed64Extension, 1)); - assertEqualsExactType(511F , message.getExtension(repeatedFloatExtension , 1)); - assertEqualsExactType(512D , message.getExtension(repeatedDoubleExtension , 1)); - assertEqualsExactType(true , message.getExtension(repeatedBoolExtension , 1)); - assertEqualsExactType("515", message.getExtension(repeatedStringExtension , 1)); - assertEqualsExactType(toBytes("516"), message.getExtension(repeatedBytesExtension, 1)); - - assertEqualsExactType(517, message.getExtension(repeatedGroupExtension , 1).getA()); - assertEqualsExactType(518, message.getExtension(repeatedNestedMessageExtension , 1).getBb()); - assertEqualsExactType(519, message.getExtension(repeatedForeignMessageExtension, 1).getC()); - assertEqualsExactType(520, message.getExtension(repeatedImportMessageExtension , 1).getD()); - assertEqualsExactType(527, message.getExtension(repeatedLazyMessageExtension , 1).getBb()); - - assertEqualsExactType(TestAllTypes.NestedEnum.FOO, - message.getExtension(repeatedNestedEnumExtension, 1)); - assertEqualsExactType(ForeignEnum.FOREIGN_FOO, - message.getExtension(repeatedForeignEnumExtension, 1)); - assertEqualsExactType(ImportEnum.IMPORT_FOO, - message.getExtension(repeatedImportEnumExtension, 1)); - - assertEqualsExactType("524", message.getExtension(repeatedStringPieceExtension, 1)); - assertEqualsExactType("525", message.getExtension(repeatedCordExtension, 1)); - } - - public static void setPackedExtensions(TestPackedExtensions.Builder message) { - message.addExtension(packedInt32Extension , 601); - message.addExtension(packedInt64Extension , 602L); - message.addExtension(packedUint32Extension , 603); - message.addExtension(packedUint64Extension , 604L); - message.addExtension(packedSint32Extension , 605); - message.addExtension(packedSint64Extension , 606L); - message.addExtension(packedFixed32Extension , 607); - message.addExtension(packedFixed64Extension , 608L); - message.addExtension(packedSfixed32Extension, 609); - message.addExtension(packedSfixed64Extension, 610L); - message.addExtension(packedFloatExtension , 611F); - message.addExtension(packedDoubleExtension , 612D); - message.addExtension(packedBoolExtension , true); - message.addExtension(packedEnumExtension, ForeignEnum.FOREIGN_BAR); - // Add a second one of each field. - message.addExtension(packedInt32Extension , 701); - message.addExtension(packedInt64Extension , 702L); - message.addExtension(packedUint32Extension , 703); - message.addExtension(packedUint64Extension , 704L); - message.addExtension(packedSint32Extension , 705); - message.addExtension(packedSint64Extension , 706L); - message.addExtension(packedFixed32Extension , 707); - message.addExtension(packedFixed64Extension , 708L); - message.addExtension(packedSfixed32Extension, 709); - message.addExtension(packedSfixed64Extension, 710L); - message.addExtension(packedFloatExtension , 711F); - message.addExtension(packedDoubleExtension , 712D); - message.addExtension(packedBoolExtension , false); - message.addExtension(packedEnumExtension, ForeignEnum.FOREIGN_BAZ); - } - - public static void assertPackedExtensionsSet(TestPackedExtensions message) { - Assert.assertEquals(2, message.getExtensionCount(packedInt32Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedInt64Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedUint32Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedUint64Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedSint32Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedSint64Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedFixed32Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedFixed64Extension )); - Assert.assertEquals(2, message.getExtensionCount(packedSfixed32Extension)); - Assert.assertEquals(2, message.getExtensionCount(packedSfixed64Extension)); - Assert.assertEquals(2, message.getExtensionCount(packedFloatExtension )); - Assert.assertEquals(2, message.getExtensionCount(packedDoubleExtension )); - Assert.assertEquals(2, message.getExtensionCount(packedBoolExtension )); - Assert.assertEquals(2, message.getExtensionCount(packedEnumExtension)); - assertEqualsExactType(601 , message.getExtension(packedInt32Extension , 0)); - assertEqualsExactType(602L , message.getExtension(packedInt64Extension , 0)); - assertEqualsExactType(603 , message.getExtension(packedUint32Extension , 0)); - assertEqualsExactType(604L , message.getExtension(packedUint64Extension , 0)); - assertEqualsExactType(605 , message.getExtension(packedSint32Extension , 0)); - assertEqualsExactType(606L , message.getExtension(packedSint64Extension , 0)); - assertEqualsExactType(607 , message.getExtension(packedFixed32Extension , 0)); - assertEqualsExactType(608L , message.getExtension(packedFixed64Extension , 0)); - assertEqualsExactType(609 , message.getExtension(packedSfixed32Extension, 0)); - assertEqualsExactType(610L , message.getExtension(packedSfixed64Extension, 0)); - assertEqualsExactType(611F , message.getExtension(packedFloatExtension , 0)); - assertEqualsExactType(612D , message.getExtension(packedDoubleExtension , 0)); - assertEqualsExactType(true , message.getExtension(packedBoolExtension , 0)); - assertEqualsExactType(ForeignEnum.FOREIGN_BAR, - message.getExtension(packedEnumExtension, 0)); - assertEqualsExactType(701 , message.getExtension(packedInt32Extension , 1)); - assertEqualsExactType(702L , message.getExtension(packedInt64Extension , 1)); - assertEqualsExactType(703 , message.getExtension(packedUint32Extension , 1)); - assertEqualsExactType(704L , message.getExtension(packedUint64Extension , 1)); - assertEqualsExactType(705 , message.getExtension(packedSint32Extension , 1)); - assertEqualsExactType(706L , message.getExtension(packedSint64Extension , 1)); - assertEqualsExactType(707 , message.getExtension(packedFixed32Extension , 1)); - assertEqualsExactType(708L , message.getExtension(packedFixed64Extension , 1)); - assertEqualsExactType(709 , message.getExtension(packedSfixed32Extension, 1)); - assertEqualsExactType(710L , message.getExtension(packedSfixed64Extension, 1)); - assertEqualsExactType(711F , message.getExtension(packedFloatExtension , 1)); - assertEqualsExactType(712D , message.getExtension(packedDoubleExtension , 1)); - assertEqualsExactType(false, message.getExtension(packedBoolExtension , 1)); - assertEqualsExactType(ForeignEnum.FOREIGN_BAZ, - message.getExtension(packedEnumExtension, 1)); - } - - // ================================================================= - - /** - * Performs the same things that the methods of {@code TestUtil} do, but - * via the reflection interface. This is its own class because it needs - * to know what descriptor to use. - */ - public static class ReflectionTester { - private final Descriptors.Descriptor baseDescriptor; - private final ExtensionRegistry extensionRegistry; - - private final Descriptors.FileDescriptor file; - private final Descriptors.FileDescriptor importFile; - private final Descriptors.FileDescriptor publicImportFile; - - private final Descriptors.Descriptor optionalGroup; - private final Descriptors.Descriptor repeatedGroup; - private final Descriptors.Descriptor nestedMessage; - private final Descriptors.Descriptor foreignMessage; - private final Descriptors.Descriptor importMessage; - private final Descriptors.Descriptor publicImportMessage; - - private final Descriptors.FieldDescriptor groupA; - private final Descriptors.FieldDescriptor repeatedGroupA; - private final Descriptors.FieldDescriptor nestedB; - private final Descriptors.FieldDescriptor foreignC; - private final Descriptors.FieldDescriptor importD; - private final Descriptors.FieldDescriptor importE; - - private final Descriptors.EnumDescriptor nestedEnum; - private final Descriptors.EnumDescriptor foreignEnum; - private final Descriptors.EnumDescriptor importEnum; - - private final Descriptors.EnumValueDescriptor nestedFoo; - private final Descriptors.EnumValueDescriptor nestedBar; - private final Descriptors.EnumValueDescriptor nestedBaz; - private final Descriptors.EnumValueDescriptor foreignFoo; - private final Descriptors.EnumValueDescriptor foreignBar; - private final Descriptors.EnumValueDescriptor foreignBaz; - private final Descriptors.EnumValueDescriptor importFoo; - private final Descriptors.EnumValueDescriptor importBar; - private final Descriptors.EnumValueDescriptor importBaz; - - /** - * Construct a {@code ReflectionTester} that will expect messages using - * the given descriptor. - * - * Normally {@code baseDescriptor} should be a descriptor for the type - * {@code TestAllTypes}, defined in - * {@code google/protobuf/unittest.proto}. However, if - * {@code extensionRegistry} is non-null, then {@code baseDescriptor} should - * be for {@code TestAllExtensions} instead, and instead of reading and - * writing normal fields, the tester will read and write extensions. - * All of {@code TestAllExtensions}' extensions must be registered in the - * registry. - */ - public ReflectionTester(Descriptors.Descriptor baseDescriptor, - ExtensionRegistry extensionRegistry) { - this.baseDescriptor = baseDescriptor; - this.extensionRegistry = extensionRegistry; - - this.file = baseDescriptor.getFile(); - Assert.assertEquals(1, file.getDependencies().size()); - this.importFile = file.getDependencies().get(0); - this.publicImportFile = importFile.getDependencies().get(0); - - Descriptors.Descriptor testAllTypes; - if (baseDescriptor.getName() == "TestAllTypes") { - testAllTypes = baseDescriptor; - } else { - testAllTypes = file.findMessageTypeByName("TestAllTypes"); - Assert.assertNotNull(testAllTypes); - } - - if (extensionRegistry == null) { - // Use testAllTypes, rather than baseDescriptor, to allow - // initialization using TestPackedTypes descriptors. These objects - // won't be used by the methods for packed fields. - this.optionalGroup = - testAllTypes.findNestedTypeByName("OptionalGroup"); - this.repeatedGroup = - testAllTypes.findNestedTypeByName("RepeatedGroup"); - } else { - this.optionalGroup = - file.findMessageTypeByName("OptionalGroup_extension"); - this.repeatedGroup = - file.findMessageTypeByName("RepeatedGroup_extension"); - } - this.nestedMessage = testAllTypes.findNestedTypeByName("NestedMessage"); - this.foreignMessage = file.findMessageTypeByName("ForeignMessage"); - this.importMessage = importFile.findMessageTypeByName("ImportMessage"); - this.publicImportMessage = publicImportFile.findMessageTypeByName( - "PublicImportMessage"); - - this.nestedEnum = testAllTypes.findEnumTypeByName("NestedEnum"); - this.foreignEnum = file.findEnumTypeByName("ForeignEnum"); - this.importEnum = importFile.findEnumTypeByName("ImportEnum"); - - Assert.assertNotNull(optionalGroup ); - Assert.assertNotNull(repeatedGroup ); - Assert.assertNotNull(nestedMessage ); - Assert.assertNotNull(foreignMessage); - Assert.assertNotNull(importMessage ); - Assert.assertNotNull(nestedEnum ); - Assert.assertNotNull(foreignEnum ); - Assert.assertNotNull(importEnum ); - - this.nestedB = nestedMessage .findFieldByName("bb"); - this.foreignC = foreignMessage.findFieldByName("c"); - this.importD = importMessage .findFieldByName("d"); - this.importE = publicImportMessage.findFieldByName("e"); - this.nestedFoo = nestedEnum.findValueByName("FOO"); - this.nestedBar = nestedEnum.findValueByName("BAR"); - this.nestedBaz = nestedEnum.findValueByName("BAZ"); - this.foreignFoo = foreignEnum.findValueByName("FOREIGN_FOO"); - this.foreignBar = foreignEnum.findValueByName("FOREIGN_BAR"); - this.foreignBaz = foreignEnum.findValueByName("FOREIGN_BAZ"); - this.importFoo = importEnum.findValueByName("IMPORT_FOO"); - this.importBar = importEnum.findValueByName("IMPORT_BAR"); - this.importBaz = importEnum.findValueByName("IMPORT_BAZ"); - - this.groupA = optionalGroup.findFieldByName("a"); - this.repeatedGroupA = repeatedGroup.findFieldByName("a"); - - Assert.assertNotNull(groupA ); - Assert.assertNotNull(repeatedGroupA); - Assert.assertNotNull(nestedB ); - Assert.assertNotNull(foreignC ); - Assert.assertNotNull(importD ); - Assert.assertNotNull(importE ); - Assert.assertNotNull(nestedFoo ); - Assert.assertNotNull(nestedBar ); - Assert.assertNotNull(nestedBaz ); - Assert.assertNotNull(foreignFoo ); - Assert.assertNotNull(foreignBar ); - Assert.assertNotNull(foreignBaz ); - Assert.assertNotNull(importFoo ); - Assert.assertNotNull(importBar ); - Assert.assertNotNull(importBaz ); - } - - /** - * Shorthand to get a FieldDescriptor for a field of unittest::TestAllTypes. - */ - private Descriptors.FieldDescriptor f(String name) { - Descriptors.FieldDescriptor result; - if (extensionRegistry == null) { - result = baseDescriptor.findFieldByName(name); - } else { - result = file.findExtensionByName(name + "_extension"); - } - Assert.assertNotNull(result); - return result; - } - - /** - * Calls {@code parent.newBuilderForField()} or uses the - * {@code ExtensionRegistry} to find an appropriate builder, depending - * on what type is being tested. - */ - private Message.Builder newBuilderForField( - Message.Builder parent, Descriptors.FieldDescriptor field) { - if (extensionRegistry == null) { - return parent.newBuilderForField(field); - } else { - ExtensionRegistry.ExtensionInfo extension = - extensionRegistry.findExtensionByNumber(field.getContainingType(), - field.getNumber()); - Assert.assertNotNull(extension); - Assert.assertNotNull(extension.defaultInstance); - return extension.defaultInstance.newBuilderForType(); - } - } - - // ------------------------------------------------------------------- - - /** - * Set every field of {@code message} to the values expected by - * {@code assertAllFieldsSet()}, using the {@link Message.Builder} - * reflection interface. - */ - void setAllFieldsViaReflection(Message.Builder message) { - message.setField(f("optional_int32" ), 101 ); - message.setField(f("optional_int64" ), 102L); - message.setField(f("optional_uint32" ), 103 ); - message.setField(f("optional_uint64" ), 104L); - message.setField(f("optional_sint32" ), 105 ); - message.setField(f("optional_sint64" ), 106L); - message.setField(f("optional_fixed32" ), 107 ); - message.setField(f("optional_fixed64" ), 108L); - message.setField(f("optional_sfixed32"), 109 ); - message.setField(f("optional_sfixed64"), 110L); - message.setField(f("optional_float" ), 111F); - message.setField(f("optional_double" ), 112D); - message.setField(f("optional_bool" ), true); - message.setField(f("optional_string" ), "115"); - message.setField(f("optional_bytes" ), toBytes("116")); - - message.setField(f("optionalgroup"), - newBuilderForField(message, f("optionalgroup")) - .setField(groupA, 117).build()); - message.setField(f("optional_nested_message"), - newBuilderForField(message, f("optional_nested_message")) - .setField(nestedB, 118).build()); - message.setField(f("optional_foreign_message"), - newBuilderForField(message, f("optional_foreign_message")) - .setField(foreignC, 119).build()); - message.setField(f("optional_import_message"), - newBuilderForField(message, f("optional_import_message")) - .setField(importD, 120).build()); - message.setField(f("optional_public_import_message"), - newBuilderForField(message, f("optional_public_import_message")) - .setField(importE, 126).build()); - message.setField(f("optional_lazy_message"), - newBuilderForField(message, f("optional_lazy_message")) - .setField(nestedB, 127).build()); - - message.setField(f("optional_nested_enum" ), nestedBaz); - message.setField(f("optional_foreign_enum"), foreignBaz); - message.setField(f("optional_import_enum" ), importBaz); - - message.setField(f("optional_string_piece" ), "124"); - message.setField(f("optional_cord" ), "125"); - - // ----------------------------------------------------------------- - - message.addRepeatedField(f("repeated_int32" ), 201 ); - message.addRepeatedField(f("repeated_int64" ), 202L); - message.addRepeatedField(f("repeated_uint32" ), 203 ); - message.addRepeatedField(f("repeated_uint64" ), 204L); - message.addRepeatedField(f("repeated_sint32" ), 205 ); - message.addRepeatedField(f("repeated_sint64" ), 206L); - message.addRepeatedField(f("repeated_fixed32" ), 207 ); - message.addRepeatedField(f("repeated_fixed64" ), 208L); - message.addRepeatedField(f("repeated_sfixed32"), 209 ); - message.addRepeatedField(f("repeated_sfixed64"), 210L); - message.addRepeatedField(f("repeated_float" ), 211F); - message.addRepeatedField(f("repeated_double" ), 212D); - message.addRepeatedField(f("repeated_bool" ), true); - message.addRepeatedField(f("repeated_string" ), "215"); - message.addRepeatedField(f("repeated_bytes" ), toBytes("216")); - - message.addRepeatedField(f("repeatedgroup"), - newBuilderForField(message, f("repeatedgroup")) - .setField(repeatedGroupA, 217).build()); - message.addRepeatedField(f("repeated_nested_message"), - newBuilderForField(message, f("repeated_nested_message")) - .setField(nestedB, 218).build()); - message.addRepeatedField(f("repeated_foreign_message"), - newBuilderForField(message, f("repeated_foreign_message")) - .setField(foreignC, 219).build()); - message.addRepeatedField(f("repeated_import_message"), - newBuilderForField(message, f("repeated_import_message")) - .setField(importD, 220).build()); - message.addRepeatedField(f("repeated_lazy_message"), - newBuilderForField(message, f("repeated_lazy_message")) - .setField(nestedB, 227).build()); - - message.addRepeatedField(f("repeated_nested_enum" ), nestedBar); - message.addRepeatedField(f("repeated_foreign_enum"), foreignBar); - message.addRepeatedField(f("repeated_import_enum" ), importBar); - - message.addRepeatedField(f("repeated_string_piece" ), "224"); - message.addRepeatedField(f("repeated_cord" ), "225"); - - // Add a second one of each field. - message.addRepeatedField(f("repeated_int32" ), 301 ); - message.addRepeatedField(f("repeated_int64" ), 302L); - message.addRepeatedField(f("repeated_uint32" ), 303 ); - message.addRepeatedField(f("repeated_uint64" ), 304L); - message.addRepeatedField(f("repeated_sint32" ), 305 ); - message.addRepeatedField(f("repeated_sint64" ), 306L); - message.addRepeatedField(f("repeated_fixed32" ), 307 ); - message.addRepeatedField(f("repeated_fixed64" ), 308L); - message.addRepeatedField(f("repeated_sfixed32"), 309 ); - message.addRepeatedField(f("repeated_sfixed64"), 310L); - message.addRepeatedField(f("repeated_float" ), 311F); - message.addRepeatedField(f("repeated_double" ), 312D); - message.addRepeatedField(f("repeated_bool" ), false); - message.addRepeatedField(f("repeated_string" ), "315"); - message.addRepeatedField(f("repeated_bytes" ), toBytes("316")); - - message.addRepeatedField(f("repeatedgroup"), - newBuilderForField(message, f("repeatedgroup")) - .setField(repeatedGroupA, 317).build()); - message.addRepeatedField(f("repeated_nested_message"), - newBuilderForField(message, f("repeated_nested_message")) - .setField(nestedB, 318).build()); - message.addRepeatedField(f("repeated_foreign_message"), - newBuilderForField(message, f("repeated_foreign_message")) - .setField(foreignC, 319).build()); - message.addRepeatedField(f("repeated_import_message"), - newBuilderForField(message, f("repeated_import_message")) - .setField(importD, 320).build()); - message.addRepeatedField(f("repeated_lazy_message"), - newBuilderForField(message, f("repeated_lazy_message")) - .setField(nestedB, 327).build()); - - message.addRepeatedField(f("repeated_nested_enum" ), nestedBaz); - message.addRepeatedField(f("repeated_foreign_enum"), foreignBaz); - message.addRepeatedField(f("repeated_import_enum" ), importBaz); - - message.addRepeatedField(f("repeated_string_piece" ), "324"); - message.addRepeatedField(f("repeated_cord" ), "325"); - - // ----------------------------------------------------------------- - - message.setField(f("default_int32" ), 401 ); - message.setField(f("default_int64" ), 402L); - message.setField(f("default_uint32" ), 403 ); - message.setField(f("default_uint64" ), 404L); - message.setField(f("default_sint32" ), 405 ); - message.setField(f("default_sint64" ), 406L); - message.setField(f("default_fixed32" ), 407 ); - message.setField(f("default_fixed64" ), 408L); - message.setField(f("default_sfixed32"), 409 ); - message.setField(f("default_sfixed64"), 410L); - message.setField(f("default_float" ), 411F); - message.setField(f("default_double" ), 412D); - message.setField(f("default_bool" ), false); - message.setField(f("default_string" ), "415"); - message.setField(f("default_bytes" ), toBytes("416")); - - message.setField(f("default_nested_enum" ), nestedFoo); - message.setField(f("default_foreign_enum"), foreignFoo); - message.setField(f("default_import_enum" ), importFoo); - - message.setField(f("default_string_piece" ), "424"); - message.setField(f("default_cord" ), "425"); - } - - // ------------------------------------------------------------------- - - /** - * Modify the repeated fields of {@code message} to contain the values - * expected by {@code assertRepeatedFieldsModified()}, using the - * {@link Message.Builder} reflection interface. - */ - void modifyRepeatedFieldsViaReflection(Message.Builder message) { - message.setRepeatedField(f("repeated_int32" ), 1, 501 ); - message.setRepeatedField(f("repeated_int64" ), 1, 502L); - message.setRepeatedField(f("repeated_uint32" ), 1, 503 ); - message.setRepeatedField(f("repeated_uint64" ), 1, 504L); - message.setRepeatedField(f("repeated_sint32" ), 1, 505 ); - message.setRepeatedField(f("repeated_sint64" ), 1, 506L); - message.setRepeatedField(f("repeated_fixed32" ), 1, 507 ); - message.setRepeatedField(f("repeated_fixed64" ), 1, 508L); - message.setRepeatedField(f("repeated_sfixed32"), 1, 509 ); - message.setRepeatedField(f("repeated_sfixed64"), 1, 510L); - message.setRepeatedField(f("repeated_float" ), 1, 511F); - message.setRepeatedField(f("repeated_double" ), 1, 512D); - message.setRepeatedField(f("repeated_bool" ), 1, true); - message.setRepeatedField(f("repeated_string" ), 1, "515"); - message.setRepeatedField(f("repeated_bytes" ), 1, toBytes("516")); - - message.setRepeatedField(f("repeatedgroup"), 1, - newBuilderForField(message, f("repeatedgroup")) - .setField(repeatedGroupA, 517).build()); - message.setRepeatedField(f("repeated_nested_message"), 1, - newBuilderForField(message, f("repeated_nested_message")) - .setField(nestedB, 518).build()); - message.setRepeatedField(f("repeated_foreign_message"), 1, - newBuilderForField(message, f("repeated_foreign_message")) - .setField(foreignC, 519).build()); - message.setRepeatedField(f("repeated_import_message"), 1, - newBuilderForField(message, f("repeated_import_message")) - .setField(importD, 520).build()); - message.setRepeatedField(f("repeated_lazy_message"), 1, - newBuilderForField(message, f("repeated_lazy_message")) - .setField(nestedB, 527).build()); - - message.setRepeatedField(f("repeated_nested_enum" ), 1, nestedFoo); - message.setRepeatedField(f("repeated_foreign_enum"), 1, foreignFoo); - message.setRepeatedField(f("repeated_import_enum" ), 1, importFoo); - - message.setRepeatedField(f("repeated_string_piece"), 1, "524"); - message.setRepeatedField(f("repeated_cord"), 1, "525"); - } - - // ------------------------------------------------------------------- - - /** - * Assert (using {@code junit.framework.Assert}} that all fields of - * {@code message} are set to the values assigned by {@code setAllFields}, - * using the {@link Message} reflection interface. - */ - public void assertAllFieldsSetViaReflection(MessageOrBuilder message) { - Assert.assertTrue(message.hasField(f("optional_int32" ))); - Assert.assertTrue(message.hasField(f("optional_int64" ))); - Assert.assertTrue(message.hasField(f("optional_uint32" ))); - Assert.assertTrue(message.hasField(f("optional_uint64" ))); - Assert.assertTrue(message.hasField(f("optional_sint32" ))); - Assert.assertTrue(message.hasField(f("optional_sint64" ))); - Assert.assertTrue(message.hasField(f("optional_fixed32" ))); - Assert.assertTrue(message.hasField(f("optional_fixed64" ))); - Assert.assertTrue(message.hasField(f("optional_sfixed32"))); - Assert.assertTrue(message.hasField(f("optional_sfixed64"))); - Assert.assertTrue(message.hasField(f("optional_float" ))); - Assert.assertTrue(message.hasField(f("optional_double" ))); - Assert.assertTrue(message.hasField(f("optional_bool" ))); - Assert.assertTrue(message.hasField(f("optional_string" ))); - Assert.assertTrue(message.hasField(f("optional_bytes" ))); - - Assert.assertTrue(message.hasField(f("optionalgroup" ))); - Assert.assertTrue(message.hasField(f("optional_nested_message" ))); - Assert.assertTrue(message.hasField(f("optional_foreign_message"))); - Assert.assertTrue(message.hasField(f("optional_import_message" ))); - - Assert.assertTrue( - ((Message)message.getField(f("optionalgroup"))).hasField(groupA)); - Assert.assertTrue( - ((Message)message.getField(f("optional_nested_message"))) - .hasField(nestedB)); - Assert.assertTrue( - ((Message)message.getField(f("optional_foreign_message"))) - .hasField(foreignC)); - Assert.assertTrue( - ((Message)message.getField(f("optional_import_message"))) - .hasField(importD)); - - Assert.assertTrue(message.hasField(f("optional_nested_enum" ))); - Assert.assertTrue(message.hasField(f("optional_foreign_enum"))); - Assert.assertTrue(message.hasField(f("optional_import_enum" ))); - - Assert.assertTrue(message.hasField(f("optional_string_piece"))); - Assert.assertTrue(message.hasField(f("optional_cord"))); - - Assert.assertEquals(101 , message.getField(f("optional_int32" ))); - Assert.assertEquals(102L , message.getField(f("optional_int64" ))); - Assert.assertEquals(103 , message.getField(f("optional_uint32" ))); - Assert.assertEquals(104L , message.getField(f("optional_uint64" ))); - Assert.assertEquals(105 , message.getField(f("optional_sint32" ))); - Assert.assertEquals(106L , message.getField(f("optional_sint64" ))); - Assert.assertEquals(107 , message.getField(f("optional_fixed32" ))); - Assert.assertEquals(108L , message.getField(f("optional_fixed64" ))); - Assert.assertEquals(109 , message.getField(f("optional_sfixed32"))); - Assert.assertEquals(110L , message.getField(f("optional_sfixed64"))); - Assert.assertEquals(111F , message.getField(f("optional_float" ))); - Assert.assertEquals(112D , message.getField(f("optional_double" ))); - Assert.assertEquals(true , message.getField(f("optional_bool" ))); - Assert.assertEquals("115", message.getField(f("optional_string" ))); - Assert.assertEquals(toBytes("116"), message.getField(f("optional_bytes"))); - - Assert.assertEquals(117, - ((Message)message.getField(f("optionalgroup"))).getField(groupA)); - Assert.assertEquals(118, - ((Message)message.getField(f("optional_nested_message"))) - .getField(nestedB)); - Assert.assertEquals(119, - ((Message)message.getField(f("optional_foreign_message"))) - .getField(foreignC)); - Assert.assertEquals(120, - ((Message)message.getField(f("optional_import_message"))) - .getField(importD)); - Assert.assertEquals(126, - ((Message)message.getField(f("optional_public_import_message"))) - .getField(importE)); - Assert.assertEquals(127, - ((Message)message.getField(f("optional_lazy_message"))) - .getField(nestedB)); - - Assert.assertEquals( nestedBaz, message.getField(f("optional_nested_enum" ))); - Assert.assertEquals(foreignBaz, message.getField(f("optional_foreign_enum"))); - Assert.assertEquals( importBaz, message.getField(f("optional_import_enum" ))); - - Assert.assertEquals("124", message.getField(f("optional_string_piece"))); - Assert.assertEquals("125", message.getField(f("optional_cord"))); - - // ----------------------------------------------------------------- - - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_int32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_int64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_uint32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_uint64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sint32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sint64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_fixed32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_fixed64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_float" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_double" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_bool" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_string" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_bytes" ))); - - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeatedgroup" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_nested_message" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_import_message" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_lazy_message" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_nested_enum" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_foreign_enum" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_import_enum" ))); - - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_string_piece"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_cord"))); - - Assert.assertEquals(201 , message.getRepeatedField(f("repeated_int32" ), 0)); - Assert.assertEquals(202L , message.getRepeatedField(f("repeated_int64" ), 0)); - Assert.assertEquals(203 , message.getRepeatedField(f("repeated_uint32" ), 0)); - Assert.assertEquals(204L , message.getRepeatedField(f("repeated_uint64" ), 0)); - Assert.assertEquals(205 , message.getRepeatedField(f("repeated_sint32" ), 0)); - Assert.assertEquals(206L , message.getRepeatedField(f("repeated_sint64" ), 0)); - Assert.assertEquals(207 , message.getRepeatedField(f("repeated_fixed32" ), 0)); - Assert.assertEquals(208L , message.getRepeatedField(f("repeated_fixed64" ), 0)); - Assert.assertEquals(209 , message.getRepeatedField(f("repeated_sfixed32"), 0)); - Assert.assertEquals(210L , message.getRepeatedField(f("repeated_sfixed64"), 0)); - Assert.assertEquals(211F , message.getRepeatedField(f("repeated_float" ), 0)); - Assert.assertEquals(212D , message.getRepeatedField(f("repeated_double" ), 0)); - Assert.assertEquals(true , message.getRepeatedField(f("repeated_bool" ), 0)); - Assert.assertEquals("215", message.getRepeatedField(f("repeated_string" ), 0)); - Assert.assertEquals(toBytes("216"), message.getRepeatedField(f("repeated_bytes"), 0)); - - Assert.assertEquals(217, - ((Message)message.getRepeatedField(f("repeatedgroup"), 0)) - .getField(repeatedGroupA)); - Assert.assertEquals(218, - ((Message)message.getRepeatedField(f("repeated_nested_message"), 0)) - .getField(nestedB)); - Assert.assertEquals(219, - ((Message)message.getRepeatedField(f("repeated_foreign_message"), 0)) - .getField(foreignC)); - Assert.assertEquals(220, - ((Message)message.getRepeatedField(f("repeated_import_message"), 0)) - .getField(importD)); - Assert.assertEquals(227, - ((Message)message.getRepeatedField(f("repeated_lazy_message"), 0)) - .getField(nestedB)); - - Assert.assertEquals( nestedBar, message.getRepeatedField(f("repeated_nested_enum" ),0)); - Assert.assertEquals(foreignBar, message.getRepeatedField(f("repeated_foreign_enum"),0)); - Assert.assertEquals( importBar, message.getRepeatedField(f("repeated_import_enum" ),0)); - - Assert.assertEquals("224", message.getRepeatedField(f("repeated_string_piece"), 0)); - Assert.assertEquals("225", message.getRepeatedField(f("repeated_cord"), 0)); - - Assert.assertEquals(301 , message.getRepeatedField(f("repeated_int32" ), 1)); - Assert.assertEquals(302L , message.getRepeatedField(f("repeated_int64" ), 1)); - Assert.assertEquals(303 , message.getRepeatedField(f("repeated_uint32" ), 1)); - Assert.assertEquals(304L , message.getRepeatedField(f("repeated_uint64" ), 1)); - Assert.assertEquals(305 , message.getRepeatedField(f("repeated_sint32" ), 1)); - Assert.assertEquals(306L , message.getRepeatedField(f("repeated_sint64" ), 1)); - Assert.assertEquals(307 , message.getRepeatedField(f("repeated_fixed32" ), 1)); - Assert.assertEquals(308L , message.getRepeatedField(f("repeated_fixed64" ), 1)); - Assert.assertEquals(309 , message.getRepeatedField(f("repeated_sfixed32"), 1)); - Assert.assertEquals(310L , message.getRepeatedField(f("repeated_sfixed64"), 1)); - Assert.assertEquals(311F , message.getRepeatedField(f("repeated_float" ), 1)); - Assert.assertEquals(312D , message.getRepeatedField(f("repeated_double" ), 1)); - Assert.assertEquals(false, message.getRepeatedField(f("repeated_bool" ), 1)); - Assert.assertEquals("315", message.getRepeatedField(f("repeated_string" ), 1)); - Assert.assertEquals(toBytes("316"), message.getRepeatedField(f("repeated_bytes"), 1)); - - Assert.assertEquals(317, - ((Message)message.getRepeatedField(f("repeatedgroup"), 1)) - .getField(repeatedGroupA)); - Assert.assertEquals(318, - ((Message)message.getRepeatedField(f("repeated_nested_message"), 1)) - .getField(nestedB)); - Assert.assertEquals(319, - ((Message)message.getRepeatedField(f("repeated_foreign_message"), 1)) - .getField(foreignC)); - Assert.assertEquals(320, - ((Message)message.getRepeatedField(f("repeated_import_message"), 1)) - .getField(importD)); - Assert.assertEquals(327, - ((Message)message.getRepeatedField(f("repeated_lazy_message"), 1)) - .getField(nestedB)); - - Assert.assertEquals( nestedBaz, message.getRepeatedField(f("repeated_nested_enum" ),1)); - Assert.assertEquals(foreignBaz, message.getRepeatedField(f("repeated_foreign_enum"),1)); - Assert.assertEquals( importBaz, message.getRepeatedField(f("repeated_import_enum" ),1)); - - Assert.assertEquals("324", message.getRepeatedField(f("repeated_string_piece"), 1)); - Assert.assertEquals("325", message.getRepeatedField(f("repeated_cord"), 1)); - - // ----------------------------------------------------------------- - - Assert.assertTrue(message.hasField(f("default_int32" ))); - Assert.assertTrue(message.hasField(f("default_int64" ))); - Assert.assertTrue(message.hasField(f("default_uint32" ))); - Assert.assertTrue(message.hasField(f("default_uint64" ))); - Assert.assertTrue(message.hasField(f("default_sint32" ))); - Assert.assertTrue(message.hasField(f("default_sint64" ))); - Assert.assertTrue(message.hasField(f("default_fixed32" ))); - Assert.assertTrue(message.hasField(f("default_fixed64" ))); - Assert.assertTrue(message.hasField(f("default_sfixed32"))); - Assert.assertTrue(message.hasField(f("default_sfixed64"))); - Assert.assertTrue(message.hasField(f("default_float" ))); - Assert.assertTrue(message.hasField(f("default_double" ))); - Assert.assertTrue(message.hasField(f("default_bool" ))); - Assert.assertTrue(message.hasField(f("default_string" ))); - Assert.assertTrue(message.hasField(f("default_bytes" ))); - - Assert.assertTrue(message.hasField(f("default_nested_enum" ))); - Assert.assertTrue(message.hasField(f("default_foreign_enum"))); - Assert.assertTrue(message.hasField(f("default_import_enum" ))); - - Assert.assertTrue(message.hasField(f("default_string_piece"))); - Assert.assertTrue(message.hasField(f("default_cord"))); - - Assert.assertEquals(401 , message.getField(f("default_int32" ))); - Assert.assertEquals(402L , message.getField(f("default_int64" ))); - Assert.assertEquals(403 , message.getField(f("default_uint32" ))); - Assert.assertEquals(404L , message.getField(f("default_uint64" ))); - Assert.assertEquals(405 , message.getField(f("default_sint32" ))); - Assert.assertEquals(406L , message.getField(f("default_sint64" ))); - Assert.assertEquals(407 , message.getField(f("default_fixed32" ))); - Assert.assertEquals(408L , message.getField(f("default_fixed64" ))); - Assert.assertEquals(409 , message.getField(f("default_sfixed32"))); - Assert.assertEquals(410L , message.getField(f("default_sfixed64"))); - Assert.assertEquals(411F , message.getField(f("default_float" ))); - Assert.assertEquals(412D , message.getField(f("default_double" ))); - Assert.assertEquals(false, message.getField(f("default_bool" ))); - Assert.assertEquals("415", message.getField(f("default_string" ))); - Assert.assertEquals(toBytes("416"), message.getField(f("default_bytes"))); - - Assert.assertEquals( nestedFoo, message.getField(f("default_nested_enum" ))); - Assert.assertEquals(foreignFoo, message.getField(f("default_foreign_enum"))); - Assert.assertEquals( importFoo, message.getField(f("default_import_enum" ))); - - Assert.assertEquals("424", message.getField(f("default_string_piece"))); - Assert.assertEquals("425", message.getField(f("default_cord"))); - } - - // ------------------------------------------------------------------- - - /** - * Assert (using {@code junit.framework.Assert}} that all fields of - * {@code message} are cleared, and that getting the fields returns their - * default values, using the {@link Message} reflection interface. - */ - public void assertClearViaReflection(MessageOrBuilder message) { - // has_blah() should initially be false for all optional fields. - Assert.assertFalse(message.hasField(f("optional_int32" ))); - Assert.assertFalse(message.hasField(f("optional_int64" ))); - Assert.assertFalse(message.hasField(f("optional_uint32" ))); - Assert.assertFalse(message.hasField(f("optional_uint64" ))); - Assert.assertFalse(message.hasField(f("optional_sint32" ))); - Assert.assertFalse(message.hasField(f("optional_sint64" ))); - Assert.assertFalse(message.hasField(f("optional_fixed32" ))); - Assert.assertFalse(message.hasField(f("optional_fixed64" ))); - Assert.assertFalse(message.hasField(f("optional_sfixed32"))); - Assert.assertFalse(message.hasField(f("optional_sfixed64"))); - Assert.assertFalse(message.hasField(f("optional_float" ))); - Assert.assertFalse(message.hasField(f("optional_double" ))); - Assert.assertFalse(message.hasField(f("optional_bool" ))); - Assert.assertFalse(message.hasField(f("optional_string" ))); - Assert.assertFalse(message.hasField(f("optional_bytes" ))); - - Assert.assertFalse(message.hasField(f("optionalgroup" ))); - Assert.assertFalse(message.hasField(f("optional_nested_message" ))); - Assert.assertFalse(message.hasField(f("optional_foreign_message"))); - Assert.assertFalse(message.hasField(f("optional_import_message" ))); - - Assert.assertFalse(message.hasField(f("optional_nested_enum" ))); - Assert.assertFalse(message.hasField(f("optional_foreign_enum"))); - Assert.assertFalse(message.hasField(f("optional_import_enum" ))); - - Assert.assertFalse(message.hasField(f("optional_string_piece"))); - Assert.assertFalse(message.hasField(f("optional_cord"))); - - // Optional fields without defaults are set to zero or something like it. - Assert.assertEquals(0 , message.getField(f("optional_int32" ))); - Assert.assertEquals(0L , message.getField(f("optional_int64" ))); - Assert.assertEquals(0 , message.getField(f("optional_uint32" ))); - Assert.assertEquals(0L , message.getField(f("optional_uint64" ))); - Assert.assertEquals(0 , message.getField(f("optional_sint32" ))); - Assert.assertEquals(0L , message.getField(f("optional_sint64" ))); - Assert.assertEquals(0 , message.getField(f("optional_fixed32" ))); - Assert.assertEquals(0L , message.getField(f("optional_fixed64" ))); - Assert.assertEquals(0 , message.getField(f("optional_sfixed32"))); - Assert.assertEquals(0L , message.getField(f("optional_sfixed64"))); - Assert.assertEquals(0F , message.getField(f("optional_float" ))); - Assert.assertEquals(0D , message.getField(f("optional_double" ))); - Assert.assertEquals(false, message.getField(f("optional_bool" ))); - Assert.assertEquals("" , message.getField(f("optional_string" ))); - Assert.assertEquals(ByteString.EMPTY, message.getField(f("optional_bytes"))); - - // Embedded messages should also be clear. - Assert.assertFalse( - ((Message)message.getField(f("optionalgroup"))).hasField(groupA)); - Assert.assertFalse( - ((Message)message.getField(f("optional_nested_message"))) - .hasField(nestedB)); - Assert.assertFalse( - ((Message)message.getField(f("optional_foreign_message"))) - .hasField(foreignC)); - Assert.assertFalse( - ((Message)message.getField(f("optional_import_message"))) - .hasField(importD)); - Assert.assertFalse( - ((Message)message.getField(f("optional_public_import_message"))) - .hasField(importE)); - Assert.assertFalse( - ((Message)message.getField(f("optional_lazy_message"))) - .hasField(nestedB)); - - Assert.assertEquals(0, - ((Message)message.getField(f("optionalgroup"))).getField(groupA)); - Assert.assertEquals(0, - ((Message)message.getField(f("optional_nested_message"))) - .getField(nestedB)); - Assert.assertEquals(0, - ((Message)message.getField(f("optional_foreign_message"))) - .getField(foreignC)); - Assert.assertEquals(0, - ((Message)message.getField(f("optional_import_message"))) - .getField(importD)); - Assert.assertEquals(0, - ((Message)message.getField(f("optional_public_import_message"))) - .getField(importE)); - Assert.assertEquals(0, - ((Message)message.getField(f("optional_lazy_message"))) - .getField(nestedB)); - - // Enums without defaults are set to the first value in the enum. - Assert.assertEquals( nestedFoo, message.getField(f("optional_nested_enum" ))); - Assert.assertEquals(foreignFoo, message.getField(f("optional_foreign_enum"))); - Assert.assertEquals( importFoo, message.getField(f("optional_import_enum" ))); - - Assert.assertEquals("", message.getField(f("optional_string_piece"))); - Assert.assertEquals("", message.getField(f("optional_cord"))); - - // Repeated fields are empty. - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_int32" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_int64" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_uint32" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_uint64" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_sint32" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_sint64" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_fixed32" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_fixed64" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_float" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_double" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_bool" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_string" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_bytes" ))); - - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeatedgroup" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_nested_message" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_import_message" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_lazy_message" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_nested_enum" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_foreign_enum" ))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_import_enum" ))); - - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_string_piece"))); - Assert.assertEquals(0, message.getRepeatedFieldCount(f("repeated_cord"))); - - // has_blah() should also be false for all default fields. - Assert.assertFalse(message.hasField(f("default_int32" ))); - Assert.assertFalse(message.hasField(f("default_int64" ))); - Assert.assertFalse(message.hasField(f("default_uint32" ))); - Assert.assertFalse(message.hasField(f("default_uint64" ))); - Assert.assertFalse(message.hasField(f("default_sint32" ))); - Assert.assertFalse(message.hasField(f("default_sint64" ))); - Assert.assertFalse(message.hasField(f("default_fixed32" ))); - Assert.assertFalse(message.hasField(f("default_fixed64" ))); - Assert.assertFalse(message.hasField(f("default_sfixed32"))); - Assert.assertFalse(message.hasField(f("default_sfixed64"))); - Assert.assertFalse(message.hasField(f("default_float" ))); - Assert.assertFalse(message.hasField(f("default_double" ))); - Assert.assertFalse(message.hasField(f("default_bool" ))); - Assert.assertFalse(message.hasField(f("default_string" ))); - Assert.assertFalse(message.hasField(f("default_bytes" ))); - - Assert.assertFalse(message.hasField(f("default_nested_enum" ))); - Assert.assertFalse(message.hasField(f("default_foreign_enum"))); - Assert.assertFalse(message.hasField(f("default_import_enum" ))); - - Assert.assertFalse(message.hasField(f("default_string_piece" ))); - Assert.assertFalse(message.hasField(f("default_cord" ))); - - // Fields with defaults have their default values (duh). - Assert.assertEquals( 41 , message.getField(f("default_int32" ))); - Assert.assertEquals( 42L , message.getField(f("default_int64" ))); - Assert.assertEquals( 43 , message.getField(f("default_uint32" ))); - Assert.assertEquals( 44L , message.getField(f("default_uint64" ))); - Assert.assertEquals(-45 , message.getField(f("default_sint32" ))); - Assert.assertEquals( 46L , message.getField(f("default_sint64" ))); - Assert.assertEquals( 47 , message.getField(f("default_fixed32" ))); - Assert.assertEquals( 48L , message.getField(f("default_fixed64" ))); - Assert.assertEquals( 49 , message.getField(f("default_sfixed32"))); - Assert.assertEquals(-50L , message.getField(f("default_sfixed64"))); - Assert.assertEquals( 51.5F , message.getField(f("default_float" ))); - Assert.assertEquals( 52e3D , message.getField(f("default_double" ))); - Assert.assertEquals(true , message.getField(f("default_bool" ))); - Assert.assertEquals("hello", message.getField(f("default_string" ))); - Assert.assertEquals(toBytes("world"), message.getField(f("default_bytes"))); - - Assert.assertEquals( nestedBar, message.getField(f("default_nested_enum" ))); - Assert.assertEquals(foreignBar, message.getField(f("default_foreign_enum"))); - Assert.assertEquals( importBar, message.getField(f("default_import_enum" ))); - - Assert.assertEquals("abc", message.getField(f("default_string_piece"))); - Assert.assertEquals("123", message.getField(f("default_cord"))); - } - - - // --------------------------------------------------------------- - - public void assertRepeatedFieldsModifiedViaReflection( - MessageOrBuilder message) { - // ModifyRepeatedFields only sets the second repeated element of each - // field. In addition to verifying this, we also verify that the first - // element and size were *not* modified. - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_int32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_int64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_uint32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_uint64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sint32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sint64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_fixed32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_fixed64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_float" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_double" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_bool" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_string" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_bytes" ))); - - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeatedgroup" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_nested_message" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_import_message" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_lazy_message" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_nested_enum" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_foreign_enum" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_import_enum" ))); - - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_string_piece"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("repeated_cord"))); - - Assert.assertEquals(201 , message.getRepeatedField(f("repeated_int32" ), 0)); - Assert.assertEquals(202L , message.getRepeatedField(f("repeated_int64" ), 0)); - Assert.assertEquals(203 , message.getRepeatedField(f("repeated_uint32" ), 0)); - Assert.assertEquals(204L , message.getRepeatedField(f("repeated_uint64" ), 0)); - Assert.assertEquals(205 , message.getRepeatedField(f("repeated_sint32" ), 0)); - Assert.assertEquals(206L , message.getRepeatedField(f("repeated_sint64" ), 0)); - Assert.assertEquals(207 , message.getRepeatedField(f("repeated_fixed32" ), 0)); - Assert.assertEquals(208L , message.getRepeatedField(f("repeated_fixed64" ), 0)); - Assert.assertEquals(209 , message.getRepeatedField(f("repeated_sfixed32"), 0)); - Assert.assertEquals(210L , message.getRepeatedField(f("repeated_sfixed64"), 0)); - Assert.assertEquals(211F , message.getRepeatedField(f("repeated_float" ), 0)); - Assert.assertEquals(212D , message.getRepeatedField(f("repeated_double" ), 0)); - Assert.assertEquals(true , message.getRepeatedField(f("repeated_bool" ), 0)); - Assert.assertEquals("215", message.getRepeatedField(f("repeated_string" ), 0)); - Assert.assertEquals(toBytes("216"), message.getRepeatedField(f("repeated_bytes"), 0)); - - Assert.assertEquals(217, - ((Message)message.getRepeatedField(f("repeatedgroup"), 0)) - .getField(repeatedGroupA)); - Assert.assertEquals(218, - ((Message)message.getRepeatedField(f("repeated_nested_message"), 0)) - .getField(nestedB)); - Assert.assertEquals(219, - ((Message)message.getRepeatedField(f("repeated_foreign_message"), 0)) - .getField(foreignC)); - Assert.assertEquals(220, - ((Message)message.getRepeatedField(f("repeated_import_message"), 0)) - .getField(importD)); - Assert.assertEquals(227, - ((Message)message.getRepeatedField(f("repeated_lazy_message"), 0)) - .getField(nestedB)); - - Assert.assertEquals( nestedBar, message.getRepeatedField(f("repeated_nested_enum" ),0)); - Assert.assertEquals(foreignBar, message.getRepeatedField(f("repeated_foreign_enum"),0)); - Assert.assertEquals( importBar, message.getRepeatedField(f("repeated_import_enum" ),0)); - - Assert.assertEquals("224", message.getRepeatedField(f("repeated_string_piece"), 0)); - Assert.assertEquals("225", message.getRepeatedField(f("repeated_cord"), 0)); - - Assert.assertEquals(501 , message.getRepeatedField(f("repeated_int32" ), 1)); - Assert.assertEquals(502L , message.getRepeatedField(f("repeated_int64" ), 1)); - Assert.assertEquals(503 , message.getRepeatedField(f("repeated_uint32" ), 1)); - Assert.assertEquals(504L , message.getRepeatedField(f("repeated_uint64" ), 1)); - Assert.assertEquals(505 , message.getRepeatedField(f("repeated_sint32" ), 1)); - Assert.assertEquals(506L , message.getRepeatedField(f("repeated_sint64" ), 1)); - Assert.assertEquals(507 , message.getRepeatedField(f("repeated_fixed32" ), 1)); - Assert.assertEquals(508L , message.getRepeatedField(f("repeated_fixed64" ), 1)); - Assert.assertEquals(509 , message.getRepeatedField(f("repeated_sfixed32"), 1)); - Assert.assertEquals(510L , message.getRepeatedField(f("repeated_sfixed64"), 1)); - Assert.assertEquals(511F , message.getRepeatedField(f("repeated_float" ), 1)); - Assert.assertEquals(512D , message.getRepeatedField(f("repeated_double" ), 1)); - Assert.assertEquals(true , message.getRepeatedField(f("repeated_bool" ), 1)); - Assert.assertEquals("515", message.getRepeatedField(f("repeated_string" ), 1)); - Assert.assertEquals(toBytes("516"), message.getRepeatedField(f("repeated_bytes"), 1)); - - Assert.assertEquals(517, - ((Message)message.getRepeatedField(f("repeatedgroup"), 1)) - .getField(repeatedGroupA)); - Assert.assertEquals(518, - ((Message)message.getRepeatedField(f("repeated_nested_message"), 1)) - .getField(nestedB)); - Assert.assertEquals(519, - ((Message)message.getRepeatedField(f("repeated_foreign_message"), 1)) - .getField(foreignC)); - Assert.assertEquals(520, - ((Message)message.getRepeatedField(f("repeated_import_message"), 1)) - .getField(importD)); - Assert.assertEquals(527, - ((Message)message.getRepeatedField(f("repeated_lazy_message"), 1)) - .getField(nestedB)); - - Assert.assertEquals( nestedFoo, message.getRepeatedField(f("repeated_nested_enum" ),1)); - Assert.assertEquals(foreignFoo, message.getRepeatedField(f("repeated_foreign_enum"),1)); - Assert.assertEquals( importFoo, message.getRepeatedField(f("repeated_import_enum" ),1)); - - Assert.assertEquals("524", message.getRepeatedField(f("repeated_string_piece"), 1)); - Assert.assertEquals("525", message.getRepeatedField(f("repeated_cord"), 1)); - } - - public void setPackedFieldsViaReflection(Message.Builder message) { - message.addRepeatedField(f("packed_int32" ), 601 ); - message.addRepeatedField(f("packed_int64" ), 602L); - message.addRepeatedField(f("packed_uint32" ), 603 ); - message.addRepeatedField(f("packed_uint64" ), 604L); - message.addRepeatedField(f("packed_sint32" ), 605 ); - message.addRepeatedField(f("packed_sint64" ), 606L); - message.addRepeatedField(f("packed_fixed32" ), 607 ); - message.addRepeatedField(f("packed_fixed64" ), 608L); - message.addRepeatedField(f("packed_sfixed32"), 609 ); - message.addRepeatedField(f("packed_sfixed64"), 610L); - message.addRepeatedField(f("packed_float" ), 611F); - message.addRepeatedField(f("packed_double" ), 612D); - message.addRepeatedField(f("packed_bool" ), true); - message.addRepeatedField(f("packed_enum" ), foreignBar); - // Add a second one of each field. - message.addRepeatedField(f("packed_int32" ), 701 ); - message.addRepeatedField(f("packed_int64" ), 702L); - message.addRepeatedField(f("packed_uint32" ), 703 ); - message.addRepeatedField(f("packed_uint64" ), 704L); - message.addRepeatedField(f("packed_sint32" ), 705 ); - message.addRepeatedField(f("packed_sint64" ), 706L); - message.addRepeatedField(f("packed_fixed32" ), 707 ); - message.addRepeatedField(f("packed_fixed64" ), 708L); - message.addRepeatedField(f("packed_sfixed32"), 709 ); - message.addRepeatedField(f("packed_sfixed64"), 710L); - message.addRepeatedField(f("packed_float" ), 711F); - message.addRepeatedField(f("packed_double" ), 712D); - message.addRepeatedField(f("packed_bool" ), false); - message.addRepeatedField(f("packed_enum" ), foreignBaz); - } - - public void assertPackedFieldsSetViaReflection(MessageOrBuilder message) { - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_int32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_int64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_uint32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_uint64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_sint32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_sint64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_fixed32" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_fixed64" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_sfixed32"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_sfixed64"))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_float" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_double" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_bool" ))); - Assert.assertEquals(2, message.getRepeatedFieldCount(f("packed_enum" ))); - Assert.assertEquals(601 , message.getRepeatedField(f("packed_int32" ), 0)); - Assert.assertEquals(602L , message.getRepeatedField(f("packed_int64" ), 0)); - Assert.assertEquals(603 , message.getRepeatedField(f("packed_uint32" ), 0)); - Assert.assertEquals(604L , message.getRepeatedField(f("packed_uint64" ), 0)); - Assert.assertEquals(605 , message.getRepeatedField(f("packed_sint32" ), 0)); - Assert.assertEquals(606L , message.getRepeatedField(f("packed_sint64" ), 0)); - Assert.assertEquals(607 , message.getRepeatedField(f("packed_fixed32" ), 0)); - Assert.assertEquals(608L , message.getRepeatedField(f("packed_fixed64" ), 0)); - Assert.assertEquals(609 , message.getRepeatedField(f("packed_sfixed32"), 0)); - Assert.assertEquals(610L , message.getRepeatedField(f("packed_sfixed64"), 0)); - Assert.assertEquals(611F , message.getRepeatedField(f("packed_float" ), 0)); - Assert.assertEquals(612D , message.getRepeatedField(f("packed_double" ), 0)); - Assert.assertEquals(true , message.getRepeatedField(f("packed_bool" ), 0)); - Assert.assertEquals(foreignBar, message.getRepeatedField(f("packed_enum" ),0)); - Assert.assertEquals(701 , message.getRepeatedField(f("packed_int32" ), 1)); - Assert.assertEquals(702L , message.getRepeatedField(f("packed_int64" ), 1)); - Assert.assertEquals(703 , message.getRepeatedField(f("packed_uint32" ), 1)); - Assert.assertEquals(704L , message.getRepeatedField(f("packed_uint64" ), 1)); - Assert.assertEquals(705 , message.getRepeatedField(f("packed_sint32" ), 1)); - Assert.assertEquals(706L , message.getRepeatedField(f("packed_sint64" ), 1)); - Assert.assertEquals(707 , message.getRepeatedField(f("packed_fixed32" ), 1)); - Assert.assertEquals(708L , message.getRepeatedField(f("packed_fixed64" ), 1)); - Assert.assertEquals(709 , message.getRepeatedField(f("packed_sfixed32"), 1)); - Assert.assertEquals(710L , message.getRepeatedField(f("packed_sfixed64"), 1)); - Assert.assertEquals(711F , message.getRepeatedField(f("packed_float" ), 1)); - Assert.assertEquals(712D , message.getRepeatedField(f("packed_double" ), 1)); - Assert.assertEquals(false, message.getRepeatedField(f("packed_bool" ), 1)); - Assert.assertEquals(foreignBaz, message.getRepeatedField(f("packed_enum" ),1)); - } - - /** - * Verifies that the reflection setters for the given.Builder object throw a - * NullPointerException if they are passed a null value. Uses Assert to throw an - * appropriate assertion failure, if the condition is not verified. - */ - public void assertReflectionSettersRejectNull(Message.Builder builder) - throws Exception { - try { - builder.setField(f("optional_string"), null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setField(f("optional_bytes"), null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setField(f("optional_nested_enum"), null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setField(f("optional_nested_message"), - (TestAllTypes.NestedMessage) null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.setField(f("optional_nested_message"), - (TestAllTypes.NestedMessage.Builder) null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - try { - builder.addRepeatedField(f("repeated_string"), null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedField(f("repeated_bytes"), null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedField(f("repeated_nested_enum"), null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - try { - builder.addRepeatedField(f("repeated_nested_message"), null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - } - - /** - * Verifies that the reflection repeated setters for the given Builder object throw a - * NullPointerException if they are passed a null value. Uses Assert to throw an appropriate - * assertion failure, if the condition is not verified. - */ - public void assertReflectionRepeatedSettersRejectNull(Message.Builder builder) - throws Exception { - builder.addRepeatedField(f("repeated_string"), "one"); - try { - builder.setRepeatedField(f("repeated_string"), 0, null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - builder.addRepeatedField(f("repeated_bytes"), toBytes("one")); - try { - builder.setRepeatedField(f("repeated_bytes"), 0, null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - builder.addRepeatedField(f("repeated_nested_enum"), nestedBaz); - try { - builder.setRepeatedField(f("repeated_nested_enum"), 0, null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - - builder.addRepeatedField( - f("repeated_nested_message"), - TestAllTypes.NestedMessage.newBuilder().setBb(218).build()); - try { - builder.setRepeatedField(f("repeated_nested_message"), 0, null); - Assert.fail("Exception was not thrown"); - } catch (NullPointerException e) { - // We expect this exception. - } - } - } - - /** - * @param filePath The path relative to - * {@link #getTestDataDir}. - */ - public static String readTextFromFile(String filePath) { - return readBytesFromFile(filePath).toStringUtf8(); - } - - private static File getTestDataDir() { - // Search each parent directory looking for "src/google/protobuf". - File ancestor = new File("."); - try { - ancestor = ancestor.getCanonicalFile(); - } catch (IOException e) { - throw new RuntimeException( - "Couldn't get canonical name of working directory.", e); - } - while (ancestor != null && ancestor.exists()) { - if (new File(ancestor, "src/google/protobuf").exists()) { - return new File(ancestor, "src/google/protobuf/testdata"); - } - ancestor = ancestor.getParentFile(); - } - - throw new RuntimeException( - "Could not find golden files. This test must be run from within the " + - "protobuf source package so that it can read test data files from the " + - "C++ source tree: " + new File(".").getAbsolutePath()); - } - - /** - * @param filename The path relative to - * {@link #getTestDataDir}. - */ - public static ByteString readBytesFromFile(String filename) { - File fullPath = new File(getTestDataDir(), filename); - try { - RandomAccessFile file = new RandomAccessFile(fullPath, "r"); - byte[] content = new byte[(int) file.length()]; - file.readFully(content); - return ByteString.copyFrom(content); - } catch (IOException e) { - // Throw a RuntimeException here so that we can call this function from - // static initializers. - throw new IllegalArgumentException( - "Couldn't read file: " + fullPath.getPath(), e); - } - } - - /** - * Get the bytes of the "golden message". This is a serialized TestAllTypes - * with all fields set as they would be by - * {@link #setAllFields(TestAllTypes.Builder)}, but it is loaded from a file - * on disk rather than generated dynamically. The file is actually generated - * by C++ code, so testing against it verifies compatibility with C++. - */ - public static ByteString getGoldenMessage() { - if (goldenMessage == null) { - goldenMessage = readBytesFromFile("golden_message"); - } - return goldenMessage; - } - private static ByteString goldenMessage = null; - - /** - * Get the bytes of the "golden packed fields message". This is a serialized - * TestPackedTypes with all fields set as they would be by - * {@link #setPackedFields(TestPackedTypes.Builder)}, but it is loaded from a - * file on disk rather than generated dynamically. The file is actually - * generated by C++ code, so testing against it verifies compatibility with - * C++. - */ - public static ByteString getGoldenPackedFieldsMessage() { - if (goldenPackedFieldsMessage == null) { - goldenPackedFieldsMessage = - readBytesFromFile("golden_packed_fields_message"); - } - return goldenPackedFieldsMessage; - } - private static ByteString goldenPackedFieldsMessage = null; - - public static abstract class HackMessage extends GeneratedMessage { - public interface MyInterface extends BuilderParent { - } - } - /** - * Mock implementation of {@link GeneratedMessage.BuilderParent} for testing. - * - * @author jonp@google.com (Jon Perlow) - */ - public static class MockBuilderParent - implements HackMessage.MyInterface { - - private int invalidations; - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void markDirty() { - invalidations++; - } - - public int getInvalidationCount() { - return invalidations; - } - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java deleted file mode 100644 index edcc8908a4d0494b31253a0f33dc614be363131d..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java +++ /dev/null @@ -1,536 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import com.google.protobuf.Descriptors.FieldDescriptor; -import protobuf_unittest.UnittestMset.TestMessageSet; -import protobuf_unittest.UnittestMset.TestMessageSetExtension1; -import protobuf_unittest.UnittestMset.TestMessageSetExtension2; -import protobuf_unittest.UnittestProto.OneString; -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage; -import protobuf_unittest.UnittestProto.TestEmptyMessage; - -import junit.framework.TestCase; - -import java.io.StringReader; - -/** - * Test case for {@link TextFormat}. - * - * TODO(wenboz): ExtensionTest and rest of text_format_unittest.cc. - * - * @author wenboz@google.com (Wenbo Zhu) - */ -public class TextFormatTest extends TestCase { - - // A basic string with different escapable characters for testing. - private final static String kEscapeTestString = - "\"A string with ' characters \n and \r newlines and \t tabs and \001 " - + "slashes \\"; - - // A representation of the above string with all the characters escaped. - private final static String kEscapeTestStringEscaped = - "\\\"A string with \\' characters \\n and \\r newlines " - + "and \\t tabs and \\001 slashes \\\\"; - - private static String allFieldsSetText = TestUtil.readTextFromFile( - "text_format_unittest_data.txt"); - private static String allExtensionsSetText = TestUtil.readTextFromFile( - "text_format_unittest_extensions_data.txt"); - - private static String exoticText = - "repeated_int32: -1\n" + - "repeated_int32: -2147483648\n" + - "repeated_int64: -1\n" + - "repeated_int64: -9223372036854775808\n" + - "repeated_uint32: 4294967295\n" + - "repeated_uint32: 2147483648\n" + - "repeated_uint64: 18446744073709551615\n" + - "repeated_uint64: 9223372036854775808\n" + - "repeated_double: 123.0\n" + - "repeated_double: 123.5\n" + - "repeated_double: 0.125\n" + - "repeated_double: .125\n" + - "repeated_double: -.125\n" + - "repeated_double: 1.23E17\n" + - "repeated_double: 1.23E+17\n" + - "repeated_double: -1.23e-17\n" + - "repeated_double: .23e+17\n" + - "repeated_double: -.23E17\n" + - "repeated_double: 1.235E22\n" + - "repeated_double: 1.235E-18\n" + - "repeated_double: 123.456789\n" + - "repeated_double: Infinity\n" + - "repeated_double: -Infinity\n" + - "repeated_double: NaN\n" + - "repeated_string: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"" + - "\\341\\210\\264\"\n" + - "repeated_bytes: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\376\"\n"; - - private static String canonicalExoticText = - exoticText.replace(": .", ": 0.").replace(": -.", ": -0.") // short-form double - .replace("23e", "23E").replace("E+", "E").replace("0.23E17", "2.3E16"); - - private String messageSetText = - "[protobuf_unittest.TestMessageSetExtension1] {\n" + - " i: 123\n" + - "}\n" + - "[protobuf_unittest.TestMessageSetExtension2] {\n" + - " str: \"foo\"\n" + - "}\n"; - - /** Print TestAllTypes and compare with golden file. */ - public void testPrintMessage() throws Exception { - String javaText = TextFormat.printToString(TestUtil.getAllSet()); - - // Java likes to add a trailing ".0" to floats and doubles. C printf - // (with %g format) does not. Our golden files are used for both - // C++ and Java TextFormat classes, so we need to conform. - javaText = javaText.replace(".0\n", "\n"); - - assertEquals(allFieldsSetText, javaText); - } - - /** Print TestAllTypes as Builder and compare with golden file. */ - public void testPrintMessageBuilder() throws Exception { - String javaText = TextFormat.printToString(TestUtil.getAllSetBuilder()); - - // Java likes to add a trailing ".0" to floats and doubles. C printf - // (with %g format) does not. Our golden files are used for both - // C++ and Java TextFormat classes, so we need to conform. - javaText = javaText.replace(".0\n", "\n"); - - assertEquals(allFieldsSetText, javaText); - } - - /** Print TestAllExtensions and compare with golden file. */ - public void testPrintExtensions() throws Exception { - String javaText = TextFormat.printToString(TestUtil.getAllExtensionsSet()); - - // Java likes to add a trailing ".0" to floats and doubles. C printf - // (with %g format) does not. Our golden files are used for both - // C++ and Java TextFormat classes, so we need to conform. - javaText = javaText.replace(".0\n", "\n"); - - assertEquals(allExtensionsSetText, javaText); - } - - // Creates an example unknown field set. - private UnknownFieldSet makeUnknownFieldSet() { - return UnknownFieldSet.newBuilder() - .addField(5, - UnknownFieldSet.Field.newBuilder() - .addVarint(1) - .addFixed32(2) - .addFixed64(3) - .addLengthDelimited(ByteString.copyFromUtf8("4")) - .addGroup( - UnknownFieldSet.newBuilder() - .addField(10, - UnknownFieldSet.Field.newBuilder() - .addVarint(5) - .build()) - .build()) - .build()) - .addField(8, - UnknownFieldSet.Field.newBuilder() - .addVarint(1) - .addVarint(2) - .addVarint(3) - .build()) - .addField(15, - UnknownFieldSet.Field.newBuilder() - .addVarint(0xABCDEF1234567890L) - .addFixed32(0xABCD1234) - .addFixed64(0xABCDEF1234567890L) - .build()) - .build(); - } - - public void testPrintUnknownFields() throws Exception { - // Test printing of unknown fields in a message. - - TestEmptyMessage message = - TestEmptyMessage.newBuilder() - .setUnknownFields(makeUnknownFieldSet()) - .build(); - - assertEquals( - "5: 1\n" + - "5: 0x00000002\n" + - "5: 0x0000000000000003\n" + - "5: \"4\"\n" + - "5 {\n" + - " 10: 5\n" + - "}\n" + - "8: 1\n" + - "8: 2\n" + - "8: 3\n" + - "15: 12379813812177893520\n" + - "15: 0xabcd1234\n" + - "15: 0xabcdef1234567890\n", - TextFormat.printToString(message)); - } - - public void testPrintField() throws Exception { - final FieldDescriptor dataField = - OneString.getDescriptor().findFieldByName("data"); - assertEquals( - "data: \"test data\"\n", - TextFormat.printFieldToString(dataField, "test data")); - - final FieldDescriptor optionalField = - TestAllTypes.getDescriptor().findFieldByName("optional_nested_message"); - final Object value = NestedMessage.newBuilder().setBb(42).build(); - - assertEquals( - "optional_nested_message {\n bb: 42\n}\n", - TextFormat.printFieldToString(optionalField, value)); - } - - /** - * Helper to construct a ByteString from a String containing only 8-bit - * characters. The characters are converted directly to bytes, *not* - * encoded using UTF-8. - */ - private ByteString bytes(String str) throws Exception { - return ByteString.copyFrom(str.getBytes("ISO-8859-1")); - } - - /** - * Helper to construct a ByteString from a bunch of bytes. The inputs are - * actually ints so that I can use hex notation and not get stupid errors - * about precision. - */ - private ByteString bytes(int... bytesAsInts) { - byte[] bytes = new byte[bytesAsInts.length]; - for (int i = 0; i < bytesAsInts.length; i++) { - bytes[i] = (byte) bytesAsInts[i]; - } - return ByteString.copyFrom(bytes); - } - - public void testPrintExotic() throws Exception { - Message message = TestAllTypes.newBuilder() - // Signed vs. unsigned numbers. - .addRepeatedInt32 (-1) - .addRepeatedUint32(-1) - .addRepeatedInt64 (-1) - .addRepeatedUint64(-1) - - .addRepeatedInt32 (1 << 31) - .addRepeatedUint32(1 << 31) - .addRepeatedInt64 (1l << 63) - .addRepeatedUint64(1l << 63) - - // Floats of various precisions and exponents. - .addRepeatedDouble(123) - .addRepeatedDouble(123.5) - .addRepeatedDouble(0.125) - .addRepeatedDouble(.125) - .addRepeatedDouble(-.125) - .addRepeatedDouble(123e15) - .addRepeatedDouble(123e15) - .addRepeatedDouble(-1.23e-17) - .addRepeatedDouble(.23e17) - .addRepeatedDouble(-23e15) - .addRepeatedDouble(123.5e20) - .addRepeatedDouble(123.5e-20) - .addRepeatedDouble(123.456789) - .addRepeatedDouble(Double.POSITIVE_INFINITY) - .addRepeatedDouble(Double.NEGATIVE_INFINITY) - .addRepeatedDouble(Double.NaN) - - // Strings and bytes that needing escaping. - .addRepeatedString("\0\001\007\b\f\n\r\t\013\\\'\"\u1234") - .addRepeatedBytes(bytes("\0\001\007\b\f\n\r\t\013\\\'\"\u00fe")) - .build(); - - assertEquals(canonicalExoticText, message.toString()); - } - - public void testPrintMessageSet() throws Exception { - TestMessageSet messageSet = - TestMessageSet.newBuilder() - .setExtension( - TestMessageSetExtension1.messageSetExtension, - TestMessageSetExtension1.newBuilder().setI(123).build()) - .setExtension( - TestMessageSetExtension2.messageSetExtension, - TestMessageSetExtension2.newBuilder().setStr("foo").build()) - .build(); - - assertEquals(messageSetText, messageSet.toString()); - } - - // ================================================================= - - public void testParse() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(allFieldsSetText, builder); - TestUtil.assertAllFieldsSet(builder.build()); - } - - public void testParseReader() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(new StringReader(allFieldsSetText), builder); - TestUtil.assertAllFieldsSet(builder.build()); - } - - public void testParseExtensions() throws Exception { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - TextFormat.merge(allExtensionsSetText, - TestUtil.getExtensionRegistry(), - builder); - TestUtil.assertAllExtensionsSet(builder.build()); - } - - public void testParseCompatibility() throws Exception { - String original = "repeated_float: inf\n" + - "repeated_float: -inf\n" + - "repeated_float: nan\n" + - "repeated_float: inff\n" + - "repeated_float: -inff\n" + - "repeated_float: nanf\n" + - "repeated_float: 1.0f\n" + - "repeated_float: infinityf\n" + - "repeated_float: -Infinityf\n" + - "repeated_double: infinity\n" + - "repeated_double: -infinity\n" + - "repeated_double: nan\n"; - String canonical = "repeated_float: Infinity\n" + - "repeated_float: -Infinity\n" + - "repeated_float: NaN\n" + - "repeated_float: Infinity\n" + - "repeated_float: -Infinity\n" + - "repeated_float: NaN\n" + - "repeated_float: 1.0\n" + - "repeated_float: Infinity\n" + - "repeated_float: -Infinity\n" + - "repeated_double: Infinity\n" + - "repeated_double: -Infinity\n" + - "repeated_double: NaN\n"; - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(original, builder); - assertEquals(canonical, builder.build().toString()); - } - - public void testParseExotic() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(exoticText, builder); - - // Too lazy to check things individually. Don't try to debug this - // if testPrintExotic() is failing. - assertEquals(canonicalExoticText, builder.build().toString()); - } - - public void testParseMessageSet() throws Exception { - ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); - extensionRegistry.add(TestMessageSetExtension1.messageSetExtension); - extensionRegistry.add(TestMessageSetExtension2.messageSetExtension); - - TestMessageSet.Builder builder = TestMessageSet.newBuilder(); - TextFormat.merge(messageSetText, extensionRegistry, builder); - TestMessageSet messageSet = builder.build(); - - assertTrue(messageSet.hasExtension( - TestMessageSetExtension1.messageSetExtension)); - assertEquals(123, messageSet.getExtension( - TestMessageSetExtension1.messageSetExtension).getI()); - assertTrue(messageSet.hasExtension( - TestMessageSetExtension2.messageSetExtension)); - assertEquals("foo", messageSet.getExtension( - TestMessageSetExtension2.messageSetExtension).getStr()); - } - - public void testParseNumericEnum() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge("optional_nested_enum: 2", builder); - assertEquals(TestAllTypes.NestedEnum.BAR, builder.getOptionalNestedEnum()); - } - - public void testParseAngleBrackets() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge("OptionalGroup: < a: 1 >", builder); - assertTrue(builder.hasOptionalGroup()); - assertEquals(1, builder.getOptionalGroup().getA()); - } - - public void testParseComment() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge( - "# this is a comment\n" + - "optional_int32: 1 # another comment\n" + - "optional_int64: 2\n" + - "# EOF comment", builder); - assertEquals(1, builder.getOptionalInt32()); - assertEquals(2, builder.getOptionalInt64()); - } - - // ================================================================= - - public void testParseString() throws Exception { - final String zh = "\u9999\u6e2f\u4e0a\u6d77\ud84f\udf80\u8c50\u9280\u884c"; - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge("optional_string: \"" + zh + "\"", builder); - assertEquals(zh, builder.getOptionalString()); - } - - public void testParseLongString() throws Exception { - String longText = - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890"; - - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge("optional_string: \"" + longText + "\"", builder); - assertEquals(longText, builder.getOptionalString()); - } - - public void testParseBoolean() throws Exception { - String goodText = - "repeated_bool: t repeated_bool : 0\n" + - "repeated_bool :f repeated_bool:1"; - String goodTextCanonical = - "repeated_bool: true\n" + - "repeated_bool: false\n" + - "repeated_bool: false\n" + - "repeated_bool: true\n"; - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(goodText, builder); - assertEquals(goodTextCanonical, builder.build().toString()); - - try { - TestAllTypes.Builder badBuilder = TestAllTypes.newBuilder(); - TextFormat.merge("optional_bool:2", badBuilder); - fail("Should have thrown an exception."); - } catch (TextFormat.ParseException e) { - // success - } - try { - TestAllTypes.Builder badBuilder = TestAllTypes.newBuilder(); - TextFormat.merge("optional_bool: foo", badBuilder); - fail("Should have thrown an exception."); - } catch (TextFormat.ParseException e) { - // success - } - } - - public void testParseAdjacentStringLiterals() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge("optional_string: \"foo\" 'corge' \"grault\"", builder); - assertEquals("foocorgegrault", builder.getOptionalString()); - } - - public void testPrintFieldValue() throws Exception { - assertPrintFieldValue("\"Hello\"", "Hello", "repeated_string"); - assertPrintFieldValue("123.0", 123f, "repeated_float"); - assertPrintFieldValue("123.0", 123d, "repeated_double"); - assertPrintFieldValue("123", 123, "repeated_int32"); - assertPrintFieldValue("123", 123L, "repeated_int64"); - assertPrintFieldValue("true", true, "repeated_bool"); - assertPrintFieldValue("4294967295", 0xFFFFFFFF, "repeated_uint32"); - assertPrintFieldValue("18446744073709551615", 0xFFFFFFFFFFFFFFFFL, - "repeated_uint64"); - assertPrintFieldValue("\"\\001\\002\\003\"", - ByteString.copyFrom(new byte[] {1, 2, 3}), "repeated_bytes"); - } - - private void assertPrintFieldValue(String expect, Object value, - String fieldName) throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - StringBuilder sb = new StringBuilder(); - TextFormat.printFieldValue( - TestAllTypes.getDescriptor().findFieldByName(fieldName), - value, sb); - assertEquals(expect, sb.toString()); - } - - public void testShortDebugString() { - assertEquals("optional_nested_message { bb: 42 } repeated_int32: 1" - + " repeated_uint32: 2", - TextFormat.shortDebugString(TestAllTypes.newBuilder() - .addRepeatedInt32(1) - .addRepeatedUint32(2) - .setOptionalNestedMessage( - NestedMessage.newBuilder().setBb(42).build()) - .build())); - } - - public void testShortDebugString_unknown() { - assertEquals("5: 1 5: 0x00000002 5: 0x0000000000000003 5: \"4\" 5 { 10: 5 }" - + " 8: 1 8: 2 8: 3 15: 12379813812177893520 15: 0xabcd1234 15:" - + " 0xabcdef1234567890", - TextFormat.shortDebugString(makeUnknownFieldSet())); - } - - public void testPrintToUnicodeString() { - assertEquals( - "optional_string: \"abc\u3042efg\"\n" + - "optional_bytes: \"\\343\\201\\202\"\n" + - "repeated_string: \"\u3093XYZ\"\n", - TextFormat.printToUnicodeString(TestAllTypes.newBuilder() - .setOptionalString("abc\u3042efg") - .setOptionalBytes(bytes(0xe3, 0x81, 0x82)) - .addRepeatedString("\u3093XYZ") - .build())); - } - - public void testPrintToUnicodeString_unknown() { - assertEquals( - "1: \"\\343\\201\\202\"\n", - TextFormat.printToUnicodeString(UnknownFieldSet.newBuilder() - .addField(1, - UnknownFieldSet.Field.newBuilder() - .addLengthDelimited(bytes(0xe3, 0x81, 0x82)).build()) - .build())); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnknownFieldSetTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnknownFieldSetTest.java deleted file mode 100644 index b9bfb691b1ef3c6571a9abe1a5db9cc05d959683..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnknownFieldSetTest.java +++ /dev/null @@ -1,438 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import protobuf_unittest.UnittestProto; -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestEmptyMessage; -import protobuf_unittest.UnittestProto.TestEmptyMessageWithExtensions; - -import junit.framework.TestCase; - -import java.util.Arrays; -import java.util.Map; - -/** - * Tests related to unknown field handling. - * - * @author kenton@google.com (Kenton Varda) - */ -public class UnknownFieldSetTest extends TestCase { - public void setUp() throws Exception { - descriptor = TestAllTypes.getDescriptor(); - allFields = TestUtil.getAllSet(); - allFieldsData = allFields.toByteString(); - emptyMessage = TestEmptyMessage.parseFrom(allFieldsData); - unknownFields = emptyMessage.getUnknownFields(); - } - - UnknownFieldSet.Field getField(String name) { - Descriptors.FieldDescriptor field = descriptor.findFieldByName(name); - assertNotNull(field); - return unknownFields.getField(field.getNumber()); - } - - // Constructs a protocol buffer which contains fields with all the same - // numbers as allFieldsData except that each field is some other wire - // type. - ByteString getBizarroData() throws Exception { - UnknownFieldSet.Builder bizarroFields = UnknownFieldSet.newBuilder(); - - UnknownFieldSet.Field varintField = - UnknownFieldSet.Field.newBuilder().addVarint(1).build(); - UnknownFieldSet.Field fixed32Field = - UnknownFieldSet.Field.newBuilder().addFixed32(1).build(); - - for (Map.Entry entry : - unknownFields.asMap().entrySet()) { - if (entry.getValue().getVarintList().isEmpty()) { - // Original field is not a varint, so use a varint. - bizarroFields.addField(entry.getKey(), varintField); - } else { - // Original field *is* a varint, so use something else. - bizarroFields.addField(entry.getKey(), fixed32Field); - } - } - - return bizarroFields.build().toByteString(); - } - - Descriptors.Descriptor descriptor; - TestAllTypes allFields; - ByteString allFieldsData; - - // An empty message that has been parsed from allFieldsData. So, it has - // unknown fields of every type. - TestEmptyMessage emptyMessage; - UnknownFieldSet unknownFields; - - // ================================================================= - - public void testVarint() throws Exception { - UnknownFieldSet.Field field = getField("optional_int32"); - assertEquals(1, field.getVarintList().size()); - assertEquals(allFields.getOptionalInt32(), - (long) field.getVarintList().get(0)); - } - - public void testFixed32() throws Exception { - UnknownFieldSet.Field field = getField("optional_fixed32"); - assertEquals(1, field.getFixed32List().size()); - assertEquals(allFields.getOptionalFixed32(), - (int) field.getFixed32List().get(0)); - } - - public void testFixed64() throws Exception { - UnknownFieldSet.Field field = getField("optional_fixed64"); - assertEquals(1, field.getFixed64List().size()); - assertEquals(allFields.getOptionalFixed64(), - (long) field.getFixed64List().get(0)); - } - - public void testLengthDelimited() throws Exception { - UnknownFieldSet.Field field = getField("optional_bytes"); - assertEquals(1, field.getLengthDelimitedList().size()); - assertEquals(allFields.getOptionalBytes(), - field.getLengthDelimitedList().get(0)); - } - - public void testGroup() throws Exception { - Descriptors.FieldDescriptor nestedFieldDescriptor = - TestAllTypes.OptionalGroup.getDescriptor().findFieldByName("a"); - assertNotNull(nestedFieldDescriptor); - - UnknownFieldSet.Field field = getField("optionalgroup"); - assertEquals(1, field.getGroupList().size()); - - UnknownFieldSet group = field.getGroupList().get(0); - assertEquals(1, group.asMap().size()); - assertTrue(group.hasField(nestedFieldDescriptor.getNumber())); - - UnknownFieldSet.Field nestedField = - group.getField(nestedFieldDescriptor.getNumber()); - assertEquals(1, nestedField.getVarintList().size()); - assertEquals(allFields.getOptionalGroup().getA(), - (long) nestedField.getVarintList().get(0)); - } - - public void testSerialize() throws Exception { - // Check that serializing the UnknownFieldSet produces the original data - // again. - ByteString data = emptyMessage.toByteString(); - assertEquals(allFieldsData, data); - } - - public void testCopyFrom() throws Exception { - TestEmptyMessage message = - TestEmptyMessage.newBuilder().mergeFrom(emptyMessage).build(); - - assertEquals(emptyMessage.toString(), message.toString()); - } - - public void testMergeFrom() throws Exception { - TestEmptyMessage source = - TestEmptyMessage.newBuilder() - .setUnknownFields( - UnknownFieldSet.newBuilder() - .addField(2, - UnknownFieldSet.Field.newBuilder() - .addVarint(2).build()) - .addField(3, - UnknownFieldSet.Field.newBuilder() - .addVarint(4).build()) - .build()) - .build(); - TestEmptyMessage destination = - TestEmptyMessage.newBuilder() - .setUnknownFields( - UnknownFieldSet.newBuilder() - .addField(1, - UnknownFieldSet.Field.newBuilder() - .addVarint(1).build()) - .addField(3, - UnknownFieldSet.Field.newBuilder() - .addVarint(3).build()) - .build()) - .mergeFrom(source) - .build(); - - assertEquals( - "1: 1\n" + - "2: 2\n" + - "3: 3\n" + - "3: 4\n", - destination.toString()); - } - - public void testClear() throws Exception { - UnknownFieldSet fields = - UnknownFieldSet.newBuilder().mergeFrom(unknownFields).clear().build(); - assertTrue(fields.asMap().isEmpty()); - } - - public void testClearMessage() throws Exception { - TestEmptyMessage message = - TestEmptyMessage.newBuilder().mergeFrom(emptyMessage).clear().build(); - assertEquals(0, message.getSerializedSize()); - } - - public void testParseKnownAndUnknown() throws Exception { - // Test mixing known and unknown fields when parsing. - - UnknownFieldSet fields = - UnknownFieldSet.newBuilder(unknownFields) - .addField(123456, - UnknownFieldSet.Field.newBuilder().addVarint(654321).build()) - .build(); - - ByteString data = fields.toByteString(); - TestAllTypes destination = TestAllTypes.parseFrom(data); - - TestUtil.assertAllFieldsSet(destination); - assertEquals(1, destination.getUnknownFields().asMap().size()); - - UnknownFieldSet.Field field = - destination.getUnknownFields().getField(123456); - assertEquals(1, field.getVarintList().size()); - assertEquals(654321, (long) field.getVarintList().get(0)); - } - - public void testWrongTypeTreatedAsUnknown() throws Exception { - // Test that fields of the wrong wire type are treated like unknown fields - // when parsing. - - ByteString bizarroData = getBizarroData(); - TestAllTypes allTypesMessage = TestAllTypes.parseFrom(bizarroData); - TestEmptyMessage emptyMessage = TestEmptyMessage.parseFrom(bizarroData); - - // All fields should have been interpreted as unknown, so the debug strings - // should be the same. - assertEquals(emptyMessage.toString(), allTypesMessage.toString()); - } - - public void testUnknownExtensions() throws Exception { - // Make sure fields are properly parsed to the UnknownFieldSet even when - // they are declared as extension numbers. - - TestEmptyMessageWithExtensions message = - TestEmptyMessageWithExtensions.parseFrom(allFieldsData); - - assertEquals(unknownFields.asMap().size(), - message.getUnknownFields().asMap().size()); - assertEquals(allFieldsData, message.toByteString()); - } - - public void testWrongExtensionTypeTreatedAsUnknown() throws Exception { - // Test that fields of the wrong wire type are treated like unknown fields - // when parsing extensions. - - ByteString bizarroData = getBizarroData(); - TestAllExtensions allExtensionsMessage = - TestAllExtensions.parseFrom(bizarroData); - TestEmptyMessage emptyMessage = TestEmptyMessage.parseFrom(bizarroData); - - // All fields should have been interpreted as unknown, so the debug strings - // should be the same. - assertEquals(emptyMessage.toString(), - allExtensionsMessage.toString()); - } - - public void testParseUnknownEnumValue() throws Exception { - Descriptors.FieldDescriptor singularField = - TestAllTypes.getDescriptor().findFieldByName("optional_nested_enum"); - Descriptors.FieldDescriptor repeatedField = - TestAllTypes.getDescriptor().findFieldByName("repeated_nested_enum"); - assertNotNull(singularField); - assertNotNull(repeatedField); - - ByteString data = - UnknownFieldSet.newBuilder() - .addField(singularField.getNumber(), - UnknownFieldSet.Field.newBuilder() - .addVarint(TestAllTypes.NestedEnum.BAR.getNumber()) - .addVarint(5) // not valid - .build()) - .addField(repeatedField.getNumber(), - UnknownFieldSet.Field.newBuilder() - .addVarint(TestAllTypes.NestedEnum.FOO.getNumber()) - .addVarint(4) // not valid - .addVarint(TestAllTypes.NestedEnum.BAZ.getNumber()) - .addVarint(6) // not valid - .build()) - .build() - .toByteString(); - - { - TestAllTypes message = TestAllTypes.parseFrom(data); - assertEquals(TestAllTypes.NestedEnum.BAR, - message.getOptionalNestedEnum()); - assertEquals( - Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ), - message.getRepeatedNestedEnumList()); - assertEquals(Arrays.asList(5L), - message.getUnknownFields() - .getField(singularField.getNumber()) - .getVarintList()); - assertEquals(Arrays.asList(4L, 6L), - message.getUnknownFields() - .getField(repeatedField.getNumber()) - .getVarintList()); - } - - { - TestAllExtensions message = - TestAllExtensions.parseFrom(data, TestUtil.getExtensionRegistry()); - assertEquals(TestAllTypes.NestedEnum.BAR, - message.getExtension(UnittestProto.optionalNestedEnumExtension)); - assertEquals( - Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ), - message.getExtension(UnittestProto.repeatedNestedEnumExtension)); - assertEquals(Arrays.asList(5L), - message.getUnknownFields() - .getField(singularField.getNumber()) - .getVarintList()); - assertEquals(Arrays.asList(4L, 6L), - message.getUnknownFields() - .getField(repeatedField.getNumber()) - .getVarintList()); - } - } - - public void testLargeVarint() throws Exception { - ByteString data = - UnknownFieldSet.newBuilder() - .addField(1, - UnknownFieldSet.Field.newBuilder() - .addVarint(0x7FFFFFFFFFFFFFFFL) - .build()) - .build() - .toByteString(); - UnknownFieldSet parsed = UnknownFieldSet.parseFrom(data); - UnknownFieldSet.Field field = parsed.getField(1); - assertEquals(1, field.getVarintList().size()); - assertEquals(0x7FFFFFFFFFFFFFFFL, (long)field.getVarintList().get(0)); - } - - public void testEqualsAndHashCode() { - UnknownFieldSet.Field fixed32Field = - UnknownFieldSet.Field.newBuilder() - .addFixed32(1) - .build(); - UnknownFieldSet.Field fixed64Field = - UnknownFieldSet.Field.newBuilder() - .addFixed64(1) - .build(); - UnknownFieldSet.Field varIntField = - UnknownFieldSet.Field.newBuilder() - .addVarint(1) - .build(); - UnknownFieldSet.Field lengthDelimitedField = - UnknownFieldSet.Field.newBuilder() - .addLengthDelimited(ByteString.EMPTY) - .build(); - UnknownFieldSet.Field groupField = - UnknownFieldSet.Field.newBuilder() - .addGroup(unknownFields) - .build(); - - UnknownFieldSet a = - UnknownFieldSet.newBuilder() - .addField(1, fixed32Field) - .build(); - UnknownFieldSet b = - UnknownFieldSet.newBuilder() - .addField(1, fixed64Field) - .build(); - UnknownFieldSet c = - UnknownFieldSet.newBuilder() - .addField(1, varIntField) - .build(); - UnknownFieldSet d = - UnknownFieldSet.newBuilder() - .addField(1, lengthDelimitedField) - .build(); - UnknownFieldSet e = - UnknownFieldSet.newBuilder() - .addField(1, groupField) - .build(); - - checkEqualsIsConsistent(a); - checkEqualsIsConsistent(b); - checkEqualsIsConsistent(c); - checkEqualsIsConsistent(d); - checkEqualsIsConsistent(e); - - checkNotEqual(a, b); - checkNotEqual(a, c); - checkNotEqual(a, d); - checkNotEqual(a, e); - checkNotEqual(b, c); - checkNotEqual(b, d); - checkNotEqual(b, e); - checkNotEqual(c, d); - checkNotEqual(c, e); - checkNotEqual(d, e); - } - - /** - * Asserts that the given field sets are not equal and have different - * hash codes. - * - * @warning It's valid for non-equal objects to have the same hash code, so - * this test is stricter than it needs to be. However, this should happen - * relatively rarely. - */ - private void checkNotEqual(UnknownFieldSet s1, UnknownFieldSet s2) { - String equalsError = String.format("%s should not be equal to %s", s1, s2); - assertFalse(equalsError, s1.equals(s2)); - assertFalse(equalsError, s2.equals(s1)); - - assertFalse( - String.format("%s should have a different hash code from %s", s1, s2), - s1.hashCode() == s2.hashCode()); - } - - /** - * Asserts that the given field sets are equal and have identical hash codes. - */ - private void checkEqualsIsConsistent(UnknownFieldSet set) { - // Object should be equal to itself. - assertEquals(set, set); - - // Object should be equal to a copy of itself. - UnknownFieldSet copy = UnknownFieldSet.newBuilder(set).build(); - assertEquals(set, copy); - assertEquals(copy, set); - assertEquals(set.hashCode(), copy.hashCode()); - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnmodifiableLazyStringListTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnmodifiableLazyStringListTest.java deleted file mode 100644 index cb75d74b0c6b34f068653aa85cbd49ea709dca39..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnmodifiableLazyStringListTest.java +++ /dev/null @@ -1,153 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import junit.framework.TestCase; - -import java.util.Iterator; -import java.util.ListIterator; - -/** - * Tests for {@link UnmodifiableLazyStringList}. - * - * @author jonp@google.com (Jon Perlow) - */ -public class UnmodifiableLazyStringListTest extends TestCase { - - private static String STRING_A = "A"; - private static String STRING_B = "B"; - private static String STRING_C = "C"; - - private static ByteString BYTE_STRING_A = ByteString.copyFromUtf8("A"); - private static ByteString BYTE_STRING_B = ByteString.copyFromUtf8("B"); - private static ByteString BYTE_STRING_C = ByteString.copyFromUtf8("C"); - - public void testReadOnlyMethods() { - LazyStringArrayList rawList = createSampleList(); - UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); - assertEquals(3, list.size()); - assertSame(STRING_A, list.get(0)); - assertSame(STRING_B, list.get(1)); - assertSame(STRING_C, list.get(2)); - assertEquals(BYTE_STRING_A, list.getByteString(0)); - assertEquals(BYTE_STRING_B, list.getByteString(1)); - assertEquals(BYTE_STRING_C, list.getByteString(2)); - } - - public void testModifyMethods() { - LazyStringArrayList rawList = createSampleList(); - UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); - - try { - list.remove(0); - fail(); - } catch (UnsupportedOperationException e) { - // expected - } - assertEquals(3, list.size()); - - try { - list.add(STRING_B); - fail(); - } catch (UnsupportedOperationException e) { - // expected - } - assertEquals(3, list.size()); - - try { - list.set(1, STRING_B); - fail(); - } catch (UnsupportedOperationException e) { - // expected - } - } - - public void testIterator() { - LazyStringArrayList rawList = createSampleList(); - UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); - - Iterator iter = list.iterator(); - int count = 0; - while (iter.hasNext()) { - iter.next(); - count++; - try { - iter.remove(); - fail(); - } catch (UnsupportedOperationException e) { - // expected - } - } - assertEquals(3, count); - - } - - public void testListIterator() { - LazyStringArrayList rawList = createSampleList(); - UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); - - ListIterator iter = list.listIterator(); - int count = 0; - while (iter.hasNext()) { - iter.next(); - count++; - try { - iter.remove(); - fail(); - } catch (UnsupportedOperationException e) { - // expected - } - try { - iter.set("bar"); - fail(); - } catch (UnsupportedOperationException e) { - // expected - } - try { - iter.add("bar"); - fail(); - } catch (UnsupportedOperationException e) { - // expected - } - } - assertEquals(3, count); - - } - - private LazyStringArrayList createSampleList() { - LazyStringArrayList rawList = new LazyStringArrayList(); - rawList.add(STRING_A); - rawList.add(STRING_B); - rawList.add(STRING_C); - return rawList; - } -} diff --git a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/WireFormatTest.java b/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/WireFormatTest.java deleted file mode 100644 index 7452872620b750a1fe3109746c852c0e543fe9f0..0000000000000000000000000000000000000000 --- a/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/WireFormatTest.java +++ /dev/null @@ -1,465 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.test; -import com.google.protobuf.*; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.util.List; - -import protobuf_unittest.UnittestProto; -import protobuf_unittest.UnittestProto.TestAllExtensions; -import protobuf_unittest.UnittestProto.TestAllTypes; -import protobuf_unittest.UnittestProto.TestFieldOrderings; -import protobuf_unittest.UnittestProto.TestPackedExtensions; -import protobuf_unittest.UnittestProto.TestPackedTypes; -import protobuf_unittest.UnittestMset.TestMessageSet; -import protobuf_unittest.UnittestMset.RawMessageSet; -import protobuf_unittest.UnittestMset.TestMessageSetExtension1; -import protobuf_unittest.UnittestMset.TestMessageSetExtension2; - -/** - * Tests related to parsing and serialization. - * - * @author kenton@google.com (Kenton Varda) - */ -public class WireFormatTest extends TestCase { - public void testSerialization() throws Exception { - TestAllTypes message = TestUtil.getAllSet(); - - ByteString rawBytes = message.toByteString(); - assertEquals(rawBytes.size(), message.getSerializedSize()); - - TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); - - TestUtil.assertAllFieldsSet(message2); - } - - public void testSerializationPacked() throws Exception { - TestPackedTypes message = TestUtil.getPackedSet(); - - ByteString rawBytes = message.toByteString(); - assertEquals(rawBytes.size(), message.getSerializedSize()); - - TestPackedTypes message2 = TestPackedTypes.parseFrom(rawBytes); - - TestUtil.assertPackedFieldsSet(message2); - } - - public void testSerializeExtensions() throws Exception { - // TestAllTypes and TestAllExtensions should have compatible wire formats, - // so if we serialize a TestAllExtensions then parse it as TestAllTypes - // it should work. - - TestAllExtensions message = TestUtil.getAllExtensionsSet(); - ByteString rawBytes = message.toByteString(); - assertEquals(rawBytes.size(), message.getSerializedSize()); - - TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); - - TestUtil.assertAllFieldsSet(message2); - } - - public void testSerializePackedExtensions() throws Exception { - // TestPackedTypes and TestPackedExtensions should have compatible wire - // formats; check that they serialize to the same string. - TestPackedExtensions message = TestUtil.getPackedExtensionsSet(); - ByteString rawBytes = message.toByteString(); - - TestPackedTypes message2 = TestUtil.getPackedSet(); - ByteString rawBytes2 = message2.toByteString(); - - assertEquals(rawBytes, rawBytes2); - } - - public void testSerializationPackedWithoutGetSerializedSize() - throws Exception { - // Write directly to an OutputStream, without invoking getSerializedSize() - // This used to be a bug where the size of a packed field was incorrect, - // since getSerializedSize() was never invoked. - TestPackedTypes message = TestUtil.getPackedSet(); - - // Directly construct a CodedOutputStream around the actual OutputStream, - // in case writeTo(OutputStream output) invokes getSerializedSize(); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - CodedOutputStream codedOutput = CodedOutputStream.newInstance(outputStream); - - message.writeTo(codedOutput); - - codedOutput.flush(); - - TestPackedTypes message2 = TestPackedTypes.parseFrom( - outputStream.toByteArray()); - - TestUtil.assertPackedFieldsSet(message2); - } - - public void testParseExtensions() throws Exception { - // TestAllTypes and TestAllExtensions should have compatible wire formats, - // so if we serialize a TestAllTypes then parse it as TestAllExtensions - // it should work. - - TestAllTypes message = TestUtil.getAllSet(); - ByteString rawBytes = message.toByteString(); - - ExtensionRegistry registry = TestUtil.getExtensionRegistry(); - - TestAllExtensions message2 = - TestAllExtensions.parseFrom(rawBytes, registry); - - TestUtil.assertAllExtensionsSet(message2); - } - - public void testParsePackedExtensions() throws Exception { - // Ensure that packed extensions can be properly parsed. - TestPackedExtensions message = TestUtil.getPackedExtensionsSet(); - ByteString rawBytes = message.toByteString(); - - ExtensionRegistry registry = TestUtil.getExtensionRegistry(); - - TestPackedExtensions message2 = - TestPackedExtensions.parseFrom(rawBytes, registry); - - TestUtil.assertPackedExtensionsSet(message2); - } - - public void testExtensionsSerializedSize() throws Exception { - assertEquals(TestUtil.getAllSet().getSerializedSize(), - TestUtil.getAllExtensionsSet().getSerializedSize()); - } - - public void testSerializeDelimited() throws Exception { - ByteArrayOutputStream output = new ByteArrayOutputStream(); - TestUtil.getAllSet().writeDelimitedTo(output); - output.write(12); - TestUtil.getPackedSet().writeDelimitedTo(output); - output.write(34); - - ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray()); - - TestUtil.assertAllFieldsSet(TestAllTypes.parseDelimitedFrom(input)); - assertEquals(12, input.read()); - TestUtil.assertPackedFieldsSet(TestPackedTypes.parseDelimitedFrom(input)); - assertEquals(34, input.read()); - assertEquals(-1, input.read()); - - // We're at EOF, so parsing again should return null. - assertTrue(TestAllTypes.parseDelimitedFrom(input) == null); - } - - private void assertFieldsInOrder(ByteString data) throws Exception { - CodedInputStream input = data.newCodedInput(); - int previousTag = 0; - - while (true) { - int tag = input.readTag(); - if (tag == 0) { - break; - } - - assertTrue(tag > previousTag); - previousTag = tag; - input.skipField(tag); - } - } - - public void testInterleavedFieldsAndExtensions() throws Exception { - // Tests that fields are written in order even when extension ranges - // are interleaved with field numbers. - ByteString data = - TestFieldOrderings.newBuilder() - .setMyInt(1) - .setMyString("foo") - .setMyFloat(1.0F) - .setExtension(UnittestProto.myExtensionInt, 23) - .setExtension(UnittestProto.myExtensionString, "bar") - .build().toByteString(); - assertFieldsInOrder(data); - - Descriptors.Descriptor descriptor = TestFieldOrderings.getDescriptor(); - ByteString dynamic_data = - DynamicMessage.newBuilder(TestFieldOrderings.getDescriptor()) - .setField(descriptor.findFieldByName("my_int"), 1L) - .setField(descriptor.findFieldByName("my_string"), "foo") - .setField(descriptor.findFieldByName("my_float"), 1.0F) - .setField(UnittestProto.myExtensionInt.getDescriptor(), 23) - .setField(UnittestProto.myExtensionString.getDescriptor(), "bar") - .build().toByteString(); - assertFieldsInOrder(dynamic_data); - } - - private ExtensionRegistry getTestFieldOrderingsRegistry() { - ExtensionRegistry result = ExtensionRegistry.newInstance(); - result.add(UnittestProto.myExtensionInt); - result.add(UnittestProto.myExtensionString); - return result; - } - - public void testParseMultipleExtensionRanges() throws Exception { - // Make sure we can parse a message that contains multiple extensions - // ranges. - TestFieldOrderings source = - TestFieldOrderings.newBuilder() - .setMyInt(1) - .setMyString("foo") - .setMyFloat(1.0F) - .setExtension(UnittestProto.myExtensionInt, 23) - .setExtension(UnittestProto.myExtensionString, "bar") - .build(); - TestFieldOrderings dest = - TestFieldOrderings.parseFrom(source.toByteString(), - getTestFieldOrderingsRegistry()); - assertEquals(source, dest); - } - - public void testParseMultipleExtensionRangesDynamic() throws Exception { - // Same as above except with DynamicMessage. - Descriptors.Descriptor descriptor = TestFieldOrderings.getDescriptor(); - DynamicMessage source = - DynamicMessage.newBuilder(TestFieldOrderings.getDescriptor()) - .setField(descriptor.findFieldByName("my_int"), 1L) - .setField(descriptor.findFieldByName("my_string"), "foo") - .setField(descriptor.findFieldByName("my_float"), 1.0F) - .setField(UnittestProto.myExtensionInt.getDescriptor(), 23) - .setField(UnittestProto.myExtensionString.getDescriptor(), "bar") - .build(); - DynamicMessage dest = - DynamicMessage.parseFrom(descriptor, source.toByteString(), - getTestFieldOrderingsRegistry()); - assertEquals(source, dest); - } - - private static final int UNKNOWN_TYPE_ID = 1550055; - private static final int TYPE_ID_1 = - TestMessageSetExtension1.getDescriptor().getExtensions().get(0).getNumber(); - private static final int TYPE_ID_2 = - TestMessageSetExtension2.getDescriptor().getExtensions().get(0).getNumber(); - - public void testSerializeMessageSetEagerly() throws Exception { - testSerializeMessageSetWithFlag(true); - } - - public void testSerializeMessageSetNotEagerly() throws Exception { - testSerializeMessageSetWithFlag(false); - } - - private void testSerializeMessageSetWithFlag(boolean eagerParsing) - throws Exception { - ExtensionRegistryLite.setEagerlyParseMessageSets(eagerParsing); - // Set up a TestMessageSet with two known messages and an unknown one. - TestMessageSet messageSet = - TestMessageSet.newBuilder() - .setExtension( - TestMessageSetExtension1.messageSetExtension, - TestMessageSetExtension1.newBuilder().setI(123).build()) - .setExtension( - TestMessageSetExtension2.messageSetExtension, - TestMessageSetExtension2.newBuilder().setStr("foo").build()) - .setUnknownFields( - UnknownFieldSet.newBuilder() - .addField(UNKNOWN_TYPE_ID, - UnknownFieldSet.Field.newBuilder() - .addLengthDelimited(ByteString.copyFromUtf8("bar")) - .build()) - .build()) - .build(); - - ByteString data = messageSet.toByteString(); - - // Parse back using RawMessageSet and check the contents. - RawMessageSet raw = RawMessageSet.parseFrom(data); - - assertTrue(raw.getUnknownFields().asMap().isEmpty()); - - assertEquals(3, raw.getItemCount()); - assertEquals(TYPE_ID_1, raw.getItem(0).getTypeId()); - assertEquals(TYPE_ID_2, raw.getItem(1).getTypeId()); - assertEquals(UNKNOWN_TYPE_ID, raw.getItem(2).getTypeId()); - - TestMessageSetExtension1 message1 = - TestMessageSetExtension1.parseFrom( - raw.getItem(0).getMessage().toByteArray()); - assertEquals(123, message1.getI()); - - TestMessageSetExtension2 message2 = - TestMessageSetExtension2.parseFrom( - raw.getItem(1).getMessage().toByteArray()); - assertEquals("foo", message2.getStr()); - - assertEquals("bar", raw.getItem(2).getMessage().toStringUtf8()); - } - - public void testParseMessageSetEagerly() throws Exception { - testParseMessageSetWithFlag(true); - } - - public void testParseMessageSetNotEagerly()throws Exception { - testParseMessageSetWithFlag(false); - } - - private void testParseMessageSetWithFlag(boolean eagerParsing) - throws Exception { - ExtensionRegistryLite.setEagerlyParseMessageSets(eagerParsing); - ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); - extensionRegistry.add(TestMessageSetExtension1.messageSetExtension); - extensionRegistry.add(TestMessageSetExtension2.messageSetExtension); - - // Set up a RawMessageSet with two known messages and an unknown one. - RawMessageSet raw = - RawMessageSet.newBuilder() - .addItem( - RawMessageSet.Item.newBuilder() - .setTypeId(TYPE_ID_1) - .setMessage( - TestMessageSetExtension1.newBuilder() - .setI(123) - .build().toByteString()) - .build()) - .addItem( - RawMessageSet.Item.newBuilder() - .setTypeId(TYPE_ID_2) - .setMessage( - TestMessageSetExtension2.newBuilder() - .setStr("foo") - .build().toByteString()) - .build()) - .addItem( - RawMessageSet.Item.newBuilder() - .setTypeId(UNKNOWN_TYPE_ID) - .setMessage(ByteString.copyFromUtf8("bar")) - .build()) - .build(); - - ByteString data = raw.toByteString(); - - // Parse as a TestMessageSet and check the contents. - TestMessageSet messageSet = - TestMessageSet.parseFrom(data, extensionRegistry); - - assertEquals(123, messageSet.getExtension( - TestMessageSetExtension1.messageSetExtension).getI()); - assertEquals("foo", messageSet.getExtension( - TestMessageSetExtension2.messageSetExtension).getStr()); - - // Check for unknown field with type LENGTH_DELIMITED, - // number UNKNOWN_TYPE_ID, and contents "bar". - UnknownFieldSet unknownFields = messageSet.getUnknownFields(); - assertEquals(1, unknownFields.asMap().size()); - assertTrue(unknownFields.hasField(UNKNOWN_TYPE_ID)); - - UnknownFieldSet.Field field = unknownFields.getField(UNKNOWN_TYPE_ID); - assertEquals(1, field.getLengthDelimitedList().size()); - assertEquals("bar", field.getLengthDelimitedList().get(0).toStringUtf8()); - } - - public void testParseMessageSetExtensionEagerly() throws Exception { - testParseMessageSetExtensionWithFlag(true); - } - - public void testParseMessageSetExtensionNotEagerly() throws Exception { - testParseMessageSetExtensionWithFlag(false); - } - - private void testParseMessageSetExtensionWithFlag(boolean eagerParsing) - throws Exception { - ExtensionRegistryLite.setEagerlyParseMessageSets(eagerParsing); - ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); - extensionRegistry.add(TestMessageSetExtension1.messageSetExtension); - - // Set up a RawMessageSet with a known messages. - int TYPE_ID_1 = - TestMessageSetExtension1 - .getDescriptor().getExtensions().get(0).getNumber(); - RawMessageSet raw = - RawMessageSet.newBuilder() - .addItem( - RawMessageSet.Item.newBuilder() - .setTypeId(TYPE_ID_1) - .setMessage( - TestMessageSetExtension1.newBuilder() - .setI(123) - .build().toByteString()) - .build()) - .build(); - - ByteString data = raw.toByteString(); - - // Parse as a TestMessageSet and check the contents. - TestMessageSet messageSet = - TestMessageSet.parseFrom(data, extensionRegistry); - assertEquals(123, messageSet.getExtension( - TestMessageSetExtension1.messageSetExtension).getI()); - } - - public void testMergeLazyMessageSetExtensionEagerly() throws Exception { - testMergeLazyMessageSetExtensionWithFlag(true); - } - - public void testMergeLazyMessageSetExtensionNotEagerly() throws Exception { - testMergeLazyMessageSetExtensionWithFlag(false); - } - - private void testMergeLazyMessageSetExtensionWithFlag(boolean eagerParsing) - throws Exception { - ExtensionRegistryLite.setEagerlyParseMessageSets(eagerParsing); - ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); - extensionRegistry.add(TestMessageSetExtension1.messageSetExtension); - - // Set up a RawMessageSet with a known messages. - int TYPE_ID_1 = - TestMessageSetExtension1 - .getDescriptor().getExtensions().get(0).getNumber(); - RawMessageSet raw = - RawMessageSet.newBuilder() - .addItem( - RawMessageSet.Item.newBuilder() - .setTypeId(TYPE_ID_1) - .setMessage( - TestMessageSetExtension1.newBuilder() - .setI(123) - .build().toByteString()) - .build()) - .build(); - - ByteString data = raw.toByteString(); - - // Parse as a TestMessageSet and store value into lazy field - TestMessageSet messageSet = - TestMessageSet.parseFrom(data, extensionRegistry); - // Merge lazy field check the contents. - messageSet = - messageSet.toBuilder().mergeFrom(data, extensionRegistry).build(); - assertEquals(123, messageSet.getExtension( - TestMessageSetExtension1.messageSetExtension).getI()); - } -} diff --git a/java/core/BUILD.bazel b/java/core/BUILD.bazel deleted file mode 100644 index 70fe8faa2595bdb11e0810779f9138af30bd88d6..0000000000000000000000000000000000000000 --- a/java/core/BUILD.bazel +++ /dev/null @@ -1,540 +0,0 @@ -load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("@rules_java//java:defs.bzl", "java_lite_proto_library", "java_proto_library") -load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") -load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") -load("//build_defs:java_opts.bzl", "protobuf_java_export", "protobuf_java_library", "protobuf_versioned_java_library") -load("//conformance:defs.bzl", "conformance_test") -load("//:protobuf.bzl", "internal_gen_well_known_protos_java") -load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") -load("//java/internal:testing.bzl", "junit_tests") - -LITE_SRCS = [ - # Keep in sync with `//java/lite:pom.xml`. - "src/main/java/com/google/protobuf/AbstractMessageLite.java", - "src/main/java/com/google/protobuf/AbstractParser.java", - "src/main/java/com/google/protobuf/AbstractProtobufList.java", - "src/main/java/com/google/protobuf/AllocatedBuffer.java", - "src/main/java/com/google/protobuf/Android.java", - "src/main/java/com/google/protobuf/ArrayDecoders.java", - "src/main/java/com/google/protobuf/BinaryReader.java", - "src/main/java/com/google/protobuf/BinaryWriter.java", - "src/main/java/com/google/protobuf/BooleanArrayList.java", - "src/main/java/com/google/protobuf/BufferAllocator.java", - "src/main/java/com/google/protobuf/ByteBufferWriter.java", - "src/main/java/com/google/protobuf/ByteOutput.java", - "src/main/java/com/google/protobuf/ByteString.java", - "src/main/java/com/google/protobuf/CanIgnoreReturnValue.java", - "src/main/java/com/google/protobuf/CheckReturnValue.java", - "src/main/java/com/google/protobuf/CodedInputStream.java", - "src/main/java/com/google/protobuf/CodedInputStreamReader.java", - "src/main/java/com/google/protobuf/CodedOutputStream.java", - "src/main/java/com/google/protobuf/CodedOutputStreamWriter.java", - "src/main/java/com/google/protobuf/CompileTimeConstant.java", - "src/main/java/com/google/protobuf/DoubleArrayList.java", - "src/main/java/com/google/protobuf/ExperimentalApi.java", - "src/main/java/com/google/protobuf/ExtensionLite.java", - "src/main/java/com/google/protobuf/ExtensionRegistryFactory.java", - "src/main/java/com/google/protobuf/ExtensionRegistryLite.java", - "src/main/java/com/google/protobuf/ExtensionSchema.java", - "src/main/java/com/google/protobuf/ExtensionSchemaLite.java", - "src/main/java/com/google/protobuf/ExtensionSchemas.java", - "src/main/java/com/google/protobuf/FieldInfo.java", - "src/main/java/com/google/protobuf/FieldSet.java", - "src/main/java/com/google/protobuf/FieldType.java", - "src/main/java/com/google/protobuf/FloatArrayList.java", - "src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java", - "src/main/java/com/google/protobuf/GeneratedMessageLite.java", - "src/main/java/com/google/protobuf/InlineMe.java", - "src/main/java/com/google/protobuf/IntArrayList.java", - "src/main/java/com/google/protobuf/Internal.java", - "src/main/java/com/google/protobuf/InvalidProtocolBufferException.java", - "src/main/java/com/google/protobuf/IterableByteBufferInputStream.java", - "src/main/java/com/google/protobuf/Java8Compatibility.java", - "src/main/java/com/google/protobuf/JavaType.java", - "src/main/java/com/google/protobuf/LazyField.java", - "src/main/java/com/google/protobuf/LazyFieldLite.java", - "src/main/java/com/google/protobuf/LazyStringArrayList.java", - "src/main/java/com/google/protobuf/LazyStringList.java", - "src/main/java/com/google/protobuf/ListFieldSchema.java", - "src/main/java/com/google/protobuf/LongArrayList.java", - "src/main/java/com/google/protobuf/ManifestSchemaFactory.java", - "src/main/java/com/google/protobuf/MapEntryLite.java", - "src/main/java/com/google/protobuf/MapFieldLite.java", - "src/main/java/com/google/protobuf/MapFieldSchema.java", - "src/main/java/com/google/protobuf/MapFieldSchemaLite.java", - "src/main/java/com/google/protobuf/MapFieldSchemas.java", - "src/main/java/com/google/protobuf/MessageInfo.java", - "src/main/java/com/google/protobuf/MessageInfoFactory.java", - "src/main/java/com/google/protobuf/MessageLite.java", - "src/main/java/com/google/protobuf/MessageLiteOrBuilder.java", - "src/main/java/com/google/protobuf/MessageLiteToString.java", - "src/main/java/com/google/protobuf/MessageSchema.java", - "src/main/java/com/google/protobuf/MessageSetSchema.java", - "src/main/java/com/google/protobuf/MutabilityOracle.java", - "src/main/java/com/google/protobuf/NewInstanceSchema.java", - "src/main/java/com/google/protobuf/NewInstanceSchemaLite.java", - "src/main/java/com/google/protobuf/NewInstanceSchemas.java", - "src/main/java/com/google/protobuf/NioByteString.java", - "src/main/java/com/google/protobuf/OneofInfo.java", - "src/main/java/com/google/protobuf/Parser.java", - "src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java", - "src/main/java/com/google/protobuf/ProtoSyntax.java", - "src/main/java/com/google/protobuf/Protobuf.java", - "src/main/java/com/google/protobuf/ProtobufArrayList.java", - "src/main/java/com/google/protobuf/ProtocolStringList.java", - "src/main/java/com/google/protobuf/RawMessageInfo.java", - "src/main/java/com/google/protobuf/Reader.java", - "src/main/java/com/google/protobuf/RopeByteString.java", - "src/main/java/com/google/protobuf/Schema.java", - "src/main/java/com/google/protobuf/SchemaFactory.java", - "src/main/java/com/google/protobuf/SchemaUtil.java", - "src/main/java/com/google/protobuf/SmallSortedMap.java", - "src/main/java/com/google/protobuf/StructuralMessageInfo.java", - "src/main/java/com/google/protobuf/TextFormatEscaper.java", - "src/main/java/com/google/protobuf/UninitializedMessageException.java", - "src/main/java/com/google/protobuf/UnknownFieldSchema.java", - "src/main/java/com/google/protobuf/UnknownFieldSetLite.java", - "src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java", - "src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java", - "src/main/java/com/google/protobuf/UnsafeByteOperations.java", - "src/main/java/com/google/protobuf/UnsafeUtil.java", - "src/main/java/com/google/protobuf/Utf8.java", - "src/main/java/com/google/protobuf/WireFormat.java", - "src/main/java/com/google/protobuf/Writer.java", -] - -internal_gen_well_known_protos_java( - name = "gen_well_known_protos_javalite", - javalite = True, - deps = [ - "//:any_proto", - "//:api_proto", - "//:duration_proto", - "//:empty_proto", - "//:field_mask_proto", - "//:source_context_proto", - "//:struct_proto", - "//:timestamp_proto", - "//:type_proto", - "//:wrappers_proto", - ], -) - -# Should be used as `//java/lite`. -java_library( - name = "lite", - srcs = LITE_SRCS + [ - ":gen_well_known_protos_javalite", - ], - visibility = [ - "//java/lite:__pkg__", - ], -) - -protobuf_versioned_java_library( - name = "lite_bundle", - srcs = LITE_SRCS + [ - ":gen_well_known_protos_javalite", - ], - bundle_description = "Lite version of Protocol Buffers library. This " + - "version is optimized for code size, but does not " + - "guarantee API/ABI stability.", - bundle_name = "Protocol Buffers [Lite]", - bundle_symbolic_name = "com.google.protobuf", - visibility = [ - "//java/lite:__pkg__", - ], -) - -# Bazel users, don't depend on this target, use //java/lite. -protobuf_java_export( - name = "lite_mvn", - maven_coordinates = "com.google.protobuf:protobuf-javalite:%s" % PROTOBUF_JAVA_VERSION, - pom_template = "//java/lite:pom_template.xml", - resources = [ - "//:lite_well_known_protos", - ], - tags = ["manual"], - runtime_deps = [":lite_bundle"], -) - -protobuf_java_library( - name = "lite_runtime_only", - srcs = LITE_SRCS, -) - -proto_library( - name = "java_features_proto", - srcs = ["src/main/java/com/google/protobuf/java_features.proto"], - visibility = ["//pkg:__pkg__"], - deps = ["//:descriptor_proto"], -) - -internal_gen_well_known_protos_java( - name = "gen_well_known_protos_java", - deps = [ - "//:any_proto", - "//:api_proto", - "//:compiler_plugin_proto", - "//:descriptor_proto", - "//:duration_proto", - "//:empty_proto", - "//:field_mask_proto", - "//:source_context_proto", - "//:struct_proto", - "//:timestamp_proto", - "//:type_proto", - "//:wrappers_proto", - ], -) - -java_library( - name = "core", - srcs = glob( - [ - "src/main/java/com/google/protobuf/*.java", - ], - exclude = LITE_SRCS, - ) + [ - ":gen_well_known_protos_java", - ], - visibility = ["//visibility:public"], - exports = [ - ":lite_runtime_only", - ], - deps = [ - ":lite_runtime_only", - ], -) - -protobuf_versioned_java_library( - name = "core_bundle", - srcs = glob( - [ - "src/main/java/com/google/protobuf/*.java", - ], - exclude = LITE_SRCS, - ) + [ - ":gen_well_known_protos_java", - ], - bundle_description = "Core Protocol Buffers library. Protocol Buffers " + - "are a way of encoding structured data in an " + - "efficient yet extensible format.", - bundle_name = "Protocol Buffers [Core]", - bundle_symbolic_name = "com.google.protobuf", - visibility = ["//visibility:public"], - exports = [ - ":lite_runtime_only", - ], - deps = [ - ":lite_runtime_only", - ], -) - -# Bazel users, don't depend on this target, use :core. -protobuf_java_export( - name = "core_mvn", - maven_coordinates = "com.google.protobuf:protobuf-java:%s" % PROTOBUF_JAVA_VERSION, - pom_template = "pom_template.xml", - resources = [ - "//:well_known_type_protos", - "//src/google/protobuf:descriptor_proto_srcs", - ], - tags = ["manual"], - runtime_deps = [":core_bundle"], -) - -filegroup( - name = "release", - srcs = [ - ":core_mvn-docs", - ":core_mvn-maven-source", - ":core_mvn-pom", - ":core_mvn-project", - ":lite_mvn-docs", - ":lite_mvn-maven-source", - ":lite_mvn-pom", - ":lite_mvn-project", - ], - visibility = ["//java:__pkg__"], -) - -proto_lang_toolchain( - name = "toolchain", - # keep this in sync w/ WELL_KNOWN_PROTO_MAP in //:BUILD - blacklisted_protos = [ - "//:any_proto", - "//:api_proto", - "//:compiler_plugin_proto", - "//:descriptor_proto", - "//:duration_proto", - "//:empty_proto", - "//:field_mask_proto", - "//:source_context_proto", - "//:struct_proto", - "//:timestamp_proto", - "//:type_proto", - "//:wrappers_proto", - ], - command_line = "--java_out=$(OUT)", - runtime = ":core", - visibility = ["//visibility:public"], -) - -proto_library( - name = "java_test_protos", - srcs = glob(["src/test/proto/**/*.proto"]), - strip_import_prefix = "src/test/proto", - deps = [ - "//:any_proto", - "//:descriptor_proto", - "//:lite_test_protos", - "//:wrappers_proto", - "//src/google/protobuf:generic_test_protos", - ], -) - -java_proto_library( - name = "generic_test_protos_java_proto", - visibility = [ - "//java:__subpackages__", - ], - deps = ["//src/google/protobuf:generic_test_protos"], -) - -java_proto_library( - name = "lite_test_protos_java_proto", - visibility = [ - "//java:__subpackages__", - ], - deps = ["//:lite_test_protos"], -) - -java_proto_library( - name = "java_test_protos_java_proto", - deps = [":java_test_protos"], -) - -protobuf_java_library( - name = "test_util", - srcs = [ - "src/test/java/com/google/protobuf/TestUtil.java", - "src/test/java/com/google/protobuf/TestUtilLite.java", - ], - visibility = ["//java:__subpackages__"], - deps = [ - ":core", - ":generic_test_protos_java_proto", - ":java_test_protos_java_proto", - ":lite_test_protos_java_proto", - "@maven//:com_google_guava_guava", - "@maven//:junit_junit", - ], -) - -test_suite( - name = "tests", - tests = [ - "conformance_test", - "core_build_test", - "core_tests", - "utf8_tests", - ], -) - -build_test( - name = "core_build_test", - targets = [ - ":core", - ], -) - -conformance_test( - name = "conformance_test", - failure_list = "//conformance:failure_list_java.txt", - testee = "//conformance:conformance_java", - text_format_failure_list = "//conformance:text_format_failure_list_java.txt", -) - -junit_tests( - name = "core_tests", - size = "small", - srcs = glob( - ["src/test/java/**/*.java"], - exclude = [ - "src/test/java/com/google/protobuf/DecodeUtf8Test.java", - "src/test/java/com/google/protobuf/IsValidUtf8Test.java", - "src/test/java/com/google/protobuf/TestUtil.java", - "src/test/java/com/google/protobuf/TestUtilLite.java", - ], - ), - data = ["//src/google/protobuf:testdata"], - deps = [ - ":core", - ":generic_test_protos_java_proto", - ":java_test_protos_java_proto", - ":lite_test_protos_java_proto", - ":test_util", - "@maven//:com_google_guava_guava", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - "@maven//:org_mockito_mockito_core", - ], -) - -# The UTF-8 validation tests are much slower than the other tests, so they get -# their own test target with a longer timeout. -junit_tests( - name = "utf8_tests", - size = "large", - srcs = [ - "src/test/java/com/google/protobuf/DecodeUtf8Test.java", - "src/test/java/com/google/protobuf/IsValidUtf8Test.java", - "src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java", - ], - deps = [ - ":core", - "@maven//:com_google_guava_guava", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - ], -) - -java_lite_proto_library( - name = "generic_test_protos_java_proto_lite", - visibility = [ - "//java/kotlin-lite:__pkg__", - "//java/lite:__pkg__", - ], - deps = ["//src/google/protobuf:generic_test_protos"], -) - -java_lite_proto_library( - name = "lite_test_protos_java_proto_lite", - visibility = [ - "//java/kotlin-lite:__pkg__", - "//java/lite:__pkg__", - ], - deps = ["//:lite_test_protos"], -) - -java_lite_proto_library( - name = "java_test_protos_java_proto_lite", - visibility = [ - "//java/lite:__pkg__", - ], - deps = [":java_test_protos"], -) - -genrule( - name = "rewrite_javalite_test_util", - srcs = [ - "//java/lite:lite.awk", - "src/test/java/com/google/protobuf/TestUtil.java", - ], - outs = ["TestUtil.java"], - cmd = "awk -f $(location //java/lite:lite.awk) $(location src/test/java/com/google/protobuf/TestUtil.java) > $@", -) - -protobuf_java_library( - name = "test_util_lite", - srcs = [ - "src/test/java/com/google/protobuf/TestUtilLite.java", - ":rewrite_javalite_test_util", - ], - visibility = [ - "//java/kotlin-lite:__pkg__", - "//java/lite:__pkg__", - ], - deps = [ - ":generic_test_protos_java_proto_lite", - ":java_test_protos_java_proto_lite", - ":lite_runtime_only", - ":lite_test_protos_java_proto_lite", - "@maven//:com_google_guava_guava", - "@maven//:junit_junit", - ], -) - -LITE_TEST_EXCLUSIONS = [ - # Keep in sync with //java/lite:pom.xml id=copy-test-source-files execution. - "src/test/java/com/google/protobuf/AbstractMessageTest.java", - "src/test/java/com/google/protobuf/AbstractProto2SchemaTest.java", - "src/test/java/com/google/protobuf/AnyTest.java", - "src/test/java/com/google/protobuf/CodedInputStreamTest.java", - "src/test/java/com/google/protobuf/DeprecatedFieldTest.java", - "src/test/java/com/google/protobuf/DescriptorsTest.java", - "src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java", - "src/test/java/com/google/protobuf/DynamicMessageTest.java", - "src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java", - "src/test/java/com/google/protobuf/FieldPresenceTest.java", - "src/test/java/com/google/protobuf/ForceFieldBuildersPreRun.java", - "src/test/java/com/google/protobuf/GeneratedMessageTest.java", - "src/test/java/com/google/protobuf/LazyFieldTest.java", - "src/test/java/com/google/protobuf/LazyStringEndToEndTest.java", - "src/test/java/com/google/protobuf/MapForProto2Test.java", - "src/test/java/com/google/protobuf/MapTest.java", - "src/test/java/com/google/protobuf/MessageTest.java", - "src/test/java/com/google/protobuf/NestedBuildersTest.java", - "src/test/java/com/google/protobuf/PackedFieldTest.java", - "src/test/java/com/google/protobuf/ParserTest.java", - "src/test/java/com/google/protobuf/ParseExceptionsTest.java", - "src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java", - "src/test/java/com/google/protobuf/Proto2SchemaTest.java", - "src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java", - "src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java", - "src/test/java/com/google/protobuf/ServiceTest.java", - "src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java", - "src/test/java/com/google/protobuf/TestBadIdentifiers.java", - "src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java", - "src/test/java/com/google/protobuf/TextFormatParseLocationTest.java", - "src/test/java/com/google/protobuf/TextFormatPerformanceTest.java", - "src/test/java/com/google/protobuf/TextFormatTest.java", - "src/test/java/com/google/protobuf/TestUtil.java", - "src/test/java/com/google/protobuf/TestUtilLite.java", - "src/test/java/com/google/protobuf/TypeRegistryTest.java", - "src/test/java/com/google/protobuf/UnknownEnumValueTest.java", - "src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java", - "src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java", - "src/test/java/com/google/protobuf/UnknownFieldSetTest.java", - "src/test/java/com/google/protobuf/WellKnownTypesTest.java", - "src/test/java/com/google/protobuf/WireFormatTest.java", -] - -junit_tests( - name = "lite_tests", - size = "large", - srcs = glob( - ["src/test/java/**/*.java"], - exclude = LITE_TEST_EXCLUSIONS, - ), - data = ["//src/google/protobuf:testdata"], - test_prefix = "Lite", - deps = [ - ":generic_test_protos_java_proto_lite", - ":java_test_protos_java_proto_lite", - ":lite", - ":lite_test_protos_java_proto_lite", - ":test_util_lite", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - "@maven//:org_mockito_mockito_core", - ], -) - -pkg_files( - name = "dist_files", - srcs = glob([ - "src/main/java/com/google/protobuf/*.java", - "src/test/java/**/*.java", - "src/test/proto/**/*.proto", - ]) + [ - "BUILD.bazel", - "generate-sources-build.xml", - "generate-test-sources-build.xml", - "pom.xml", - "pom_template.xml", - ], - strip_prefix = strip_prefix.from_root(""), - visibility = ["//java:__pkg__"], -) diff --git a/java/core/generate-test-sources-build.xml b/java/core/generate-test-sources-build.xml index 68edf0bfc55388c18074fbd443b72545c2bae58c..71a88d07b33b36adf3b87ced422bcc3b22a64997 100644 --- a/java/core/generate-test-sources-build.xml +++ b/java/core/generate-test-sources-build.xml @@ -4,7 +4,6 @@ - @@ -23,7 +22,6 @@ - @@ -32,6 +30,7 @@ + @@ -43,10 +42,8 @@ - - diff --git a/java/core/pom.xml b/java/core/pom.xml index 2e1ad7b79bdc5384cca0dbf4ff1b8db8769e9841..6c0732a358bd90058c60e74d4bf3dfabacf444a3 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.25.2 + 3.14.0 protobuf-java @@ -23,8 +23,13 @@ test - org.mockito - mockito-core + org.easymock + easymock + test + + + org.easymock + easymockclassextension test diff --git a/java/core/pom_template.xml b/java/core/pom_template.xml deleted file mode 100644 index 11bd41964f8d1da1686049c76f112062a04ecbc9..0000000000000000000000000000000000000000 --- a/java/core/pom_template.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - - {groupId} - protobuf-parent - {version} - - - {artifactId} - {type} - - Protocol Buffers [Core] - - Core Protocol Buffers library. Protocol Buffers are a way of encoding structured data in an - efficient yet extensible format. - - - {dependencies} - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - com.google.protobuf - https://developers.google.com/protocol-buffers/ - com.google.protobuf - com.google.protobuf;version=${project.version} - sun.misc;resolution:=optional,* - - - - - - diff --git a/java/core/src/main/java/com/google/protobuf/AbstractMessage.java b/java/core/src/main/java/com/google/protobuf/AbstractMessage.java index f383625b255e73e48b246146f2c71faeb2c7e988..ebf4318b9342885872c414ed7f0284b5a5ee7048 100644 --- a/java/core/src/main/java/com/google/protobuf/AbstractMessage.java +++ b/java/core/src/main/java/com/google/protobuf/AbstractMessage.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -27,7 +50,7 @@ import java.util.Map; * @author kenton@google.com Kenton Varda */ public abstract class AbstractMessage - // TODO: Update GeneratedMessage to parameterize with MessageType and BuilderType. + // TODO(dweis): Update GeneratedMessage to parameterize with MessageType and BuilderType. extends AbstractMessageLite implements Message { @Override @@ -60,6 +83,7 @@ public abstract class AbstractMessage throw new UnsupportedOperationException("Nested builder is not supported for this type."); } + @Override public List findInitializationErrors() { return MessageReflection.findMissingFields(this); @@ -70,13 +94,13 @@ public abstract class AbstractMessage return MessageReflection.delimitWithCommas(findInitializationErrors()); } - // TODO: Clear it when all subclasses have implemented this method. + /** TODO(jieluo): Clear it when all subclasses have implemented this method. */ @Override public boolean hasOneof(OneofDescriptor oneof) { throw new UnsupportedOperationException("hasOneof() is not implemented."); } - // TODO: Clear it when all subclasses have implemented this method. + /** TODO(jieluo): Clear it when all subclasses have implemented this method. */ @Override public FieldDescriptor getOneofFieldDescriptor(OneofDescriptor oneof) { throw new UnsupportedOperationException("getOneofFieldDescriptor() is not implemented."); @@ -200,7 +224,7 @@ public abstract class AbstractMessage } /** - * Compares two sets of fields. This method is used to implement {@link + * Compares two set of fields. This method is used to implement {@link * AbstractMessage#equals(Object)} and {@link AbstractMutableMessage#equals(Object)}. It takes * special care of bytes fields because immutable messages and mutable messages use different Java * type to represent a bytes field and this method should be able to compare immutable messages, @@ -218,8 +242,8 @@ public abstract class AbstractMessage Object value2 = b.get(descriptor); if (descriptor.getType() == FieldDescriptor.Type.BYTES) { if (descriptor.isRepeated()) { - List list1 = (List) value1; - List list2 = (List) value2; + List list1 = (List) value1; + List list2 = (List) value2; if (list1.size() != list2.size()) { return false; } @@ -301,19 +325,19 @@ public abstract class AbstractMessage throw new UnsupportedOperationException("clone() should be implemented in subclasses."); } - /** TODO: Clear it when all subclasses have implemented this method. */ + /** TODO(jieluo): Clear it when all subclasses have implemented this method. */ @Override public boolean hasOneof(OneofDescriptor oneof) { throw new UnsupportedOperationException("hasOneof() is not implemented."); } - /** TODO: Clear it when all subclasses have implemented this method. */ + /** TODO(jieluo): Clear it when all subclasses have implemented this method. */ @Override public FieldDescriptor getOneofFieldDescriptor(OneofDescriptor oneof) { throw new UnsupportedOperationException("getOneofFieldDescriptor() is not implemented."); } - /** TODO: Clear it when all subclasses have implemented this method. */ + /** TODO(jieluo): Clear it when all subclasses have implemented this method. */ @Override public BuilderType clearOneof(OneofDescriptor oneof) { throw new UnsupportedOperationException("clearOneof() is not implemented."); @@ -359,6 +383,8 @@ public abstract class AbstractMessage // them to insure that they don't change after verification (since // the Message interface itself cannot enforce immutability of // implementations). + // TODO(kenton): Provide a function somewhere called makeDeepCopy() + // which allows people to make secure deep copies of messages. for (final Map.Entry entry : allFields.entrySet()) { final FieldDescriptor field = entry.getKey(); @@ -537,6 +563,17 @@ public abstract class AbstractMessage final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException { return (BuilderType) super.mergeFrom(input, extensionRegistry); } + + @Override + public boolean mergeDelimitedFrom(final InputStream input) throws IOException { + return super.mergeDelimitedFrom(input); + } + + @Override + public boolean mergeDelimitedFrom( + final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException { + return super.mergeDelimitedFrom(input, extensionRegistry); + } } /** @@ -547,7 +584,7 @@ public abstract class AbstractMessage protected static int hashLong(long n) { return (int) (n ^ (n >>> 32)); } - + // /** * @deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 * generated code. @@ -556,7 +593,7 @@ public abstract class AbstractMessage protected static int hashBoolean(boolean b) { return b ? 1231 : 1237; } - + // /** * @deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 * generated code. @@ -565,7 +602,7 @@ public abstract class AbstractMessage protected static int hashEnum(EnumLite e) { return e.getNumber(); } - + // /** * @deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 * generated code. diff --git a/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java b/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java index 6a9d7bacf34ec914994a587a21fa0c303bce1039..4e3cf427184a152f9a7765767dd9e9b82a84172c 100644 --- a/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java +++ b/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -66,9 +89,9 @@ public abstract class AbstractMessageLite< final int serialized = getSerializedSize(); final int bufferSize = CodedOutputStream.computePreferredBufferSize( - CodedOutputStream.computeUInt32SizeNoTag(serialized) + serialized); + CodedOutputStream.computeRawVarint32Size(serialized) + serialized); final CodedOutputStream codedOutput = CodedOutputStream.newInstance(output, bufferSize); - codedOutput.writeUInt32NoTag(serialized); + codedOutput.writeRawVarint32(serialized); writeTo(codedOutput); codedOutput.flush(); } @@ -83,8 +106,8 @@ public abstract class AbstractMessageLite< throw new UnsupportedOperationException(); } - int getSerializedSize( - Schema schema) { + + int getSerializedSize(Schema schema) { int memoizedSerializedSize = getMemoizedSerializedSize(); if (memoizedSerializedSize == -1) { memoizedSerializedSize = schema.getSerializedSize(this); @@ -293,11 +316,8 @@ public abstract class AbstractMessageLite< @Override public long skip(final long n) throws IOException { - // because we take the minimum of an int and a long, result is guaranteed to be - // less than or equal to Integer.MAX_INT so this cast is safe - int result = (int) super.skip(Math.min(n, limit)); + final long result = super.skip(Math.min(n, limit)); if (result >= 0) { - // if the superclass adheres to the contract for skip, this condition is always true limit -= result; } return result; @@ -386,7 +406,7 @@ public abstract class AbstractMessageLite< if (values instanceof LazyStringList) { // For StringOrByteStringLists, check the underlying elements to avoid // forcing conversions of ByteStrings to Strings. - // TODO: Could we just prohibit nulls in all protobuf lists and get rid of this? Is + // TODO(dweis): Could we just prohibit nulls in all protobuf lists and get rid of this? Is // if even possible to hit this condition as all protobuf methods check for null first, // right? List lazyValues = ((LazyStringList) values).getUnderlyingElements(); diff --git a/java/core/src/main/java/com/google/protobuf/AbstractParser.java b/java/core/src/main/java/com/google/protobuf/AbstractParser.java index a1cfc616b620d24a94eec13e6437c05cf038bb38..abfaca8cd8b1f8d5872555fdd0384493fc4fc269 100644 --- a/java/core/src/main/java/com/google/protobuf/AbstractParser.java +++ b/java/core/src/main/java/com/google/protobuf/AbstractParser.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java b/java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java index 2b965af9fda27d56c8a5206fc6d5cea17effa245..e792d7d9811981db6f19f18054a00357e48f871c 100644 --- a/java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java +++ b/java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -29,12 +52,7 @@ abstract class AbstractProtobufList extends AbstractList implements Protob /** Constructs a mutable list by default. */ AbstractProtobufList() { - this(true); - } - - /** Constructs an immutable list for EMPTY lists */ - AbstractProtobufList(boolean isMutable) { - this.isMutable = isMutable; + isMutable = true; } @Override @@ -112,9 +130,7 @@ abstract class AbstractProtobufList extends AbstractList implements Protob @Override public final void makeImmutable() { - if (isMutable) { - isMutable = false; - } + isMutable = false; } @Override diff --git a/java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java b/java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java index b689f66cc3e60167da60e72a82e878faf07dfea1..a01a6c1a8b75ffde89348db452d5e19efdce8ecd 100644 --- a/java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java +++ b/java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -15,7 +38,6 @@ import java.nio.ByteBuffer; * A buffer that was allocated by a {@link BufferAllocator}. For every buffer, it is guaranteed that * at least one of {@link #hasArray()} or {@link #hasNioBuffer()} will be {@code true}. */ -@CheckReturnValue @ExperimentalApi abstract class AllocatedBuffer { /** @@ -84,7 +106,6 @@ abstract class AllocatedBuffer { * @return This buffer * @throws IllegalArgumentException If the preconditions on {@code position} do not hold */ - @CanIgnoreReturnValue public abstract AllocatedBuffer position(int position); /** @@ -166,7 +187,7 @@ abstract class AllocatedBuffer { @Override public AllocatedBuffer position(int position) { - Java8Compatibility.position(buffer, position); + buffer.position(position); return this; } diff --git a/java/core/src/main/java/com/google/protobuf/Android.java b/java/core/src/main/java/com/google/protobuf/Android.java index ebcc9a93011f5b69b5ab4919d860550230d4a342..cad547839a1c07004bce51115d21e7e9d9190f32 100644 --- a/java/core/src/main/java/com/google/protobuf/Android.java +++ b/java/core/src/main/java/com/google/protobuf/Android.java @@ -1,28 +1,44 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; final class Android { - private Android() { - } - - // Set to true in lite_proguard_android.pgcfg. - @SuppressWarnings("ConstantField") - private static boolean ASSUME_ANDROID; private static final Class MEMORY_CLASS = getClassForName("libcore.io.Memory"); - private static final boolean IS_ROBOLECTRIC = - !ASSUME_ANDROID && getClassForName("org.robolectric.Robolectric") != null; + getClassForName("org.robolectric.Robolectric") != null; /** Returns {@code true} if running on an Android device. */ static boolean isOnAndroidDevice() { - return ASSUME_ANDROID || (MEMORY_CLASS != null && !IS_ROBOLECTRIC); + return MEMORY_CLASS != null && !IS_ROBOLECTRIC; } /** Returns the memory class or {@code null} if not on Android device. */ diff --git a/java/core/src/main/java/com/google/protobuf/ArrayDecoders.java b/java/core/src/main/java/com/google/protobuf/ArrayDecoders.java index f3241de5095c0e628dee0496f74d14170f3a1dd3..39b79278c7b944db10263faab8646c000545e165 100644 --- a/java/core/src/main/java/com/google/protobuf/ArrayDecoders.java +++ b/java/core/src/main/java/com/google/protobuf/ArrayDecoders.java @@ -1,15 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import static com.google.protobuf.MessageSchema.getMutableUnknownFields; -import com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor; import com.google.protobuf.Internal.ProtobufList; import java.io.IOException; @@ -21,17 +43,15 @@ import java.io.IOException; * IndexOutOfBoundsException and convert it to protobuf's InvalidProtocolBufferException when * crossing protobuf public API boundaries. */ -@CheckReturnValue final class ArrayDecoders { - - private ArrayDecoders() { - } - /** * A helper used to return multiple values in a Java function. Java doesn't natively support * returning multiple values in a function. Creating a new Object to hold the return values will * be too expensive. Instead, we pass a Registers instance to functions that want to return * multiple values and let the function set the return value in this Registers instance instead. + * + *

TODO(xiaofeng): This could be merged into CodedInputStream or CodedInputStreamReader which + * is already being passed through all the parsing routines. */ static final class Registers { public int int1; @@ -263,8 +283,9 @@ final class ArrayDecoders { // A group field must has a MessageSchema (the only other subclass of Schema is MessageSetSchema // and it can't be used in group fields). final MessageSchema messageSchema = (MessageSchema) schema; + // It's OK to directly use parseProto2Message since proto3 doesn't have group. final int endPosition = - messageSchema.parseMessage(msg, data, position, limit, endGroup, registers); + messageSchema.parseProto2Message(msg, data, position, limit, endGroup, registers); registers.object1 = msg; return endPosition; } @@ -551,6 +572,7 @@ final class ArrayDecoders { } /** Decodes a packed sint64 field. Returns the position after all read values. */ + @SuppressWarnings("unchecked") static int decodePackedSInt64List( byte[] data, int position, ProtobufList list, Registers registers) throws IOException { final LongArrayList output = (LongArrayList) list; @@ -760,9 +782,7 @@ final class ArrayDecoders { return decodeUnknownField( tag, data, position, limit, getMutableUnknownFields(message), registers); } else { - // TODO: remove the unused variable - FieldSet unused = - ((GeneratedMessageLite.ExtendableMessage) message).ensureExtensionsAreMutable(); + ((GeneratedMessageLite.ExtendableMessage) message).ensureExtensionsAreMutable(); return decodeExtension( tag, data, position, limit, (GeneratedMessageLite.ExtendableMessage) message, extension, unknownFieldSchema, registers); diff --git a/java/core/src/main/java/com/google/protobuf/BinaryReader.java b/java/core/src/main/java/com/google/protobuf/BinaryReader.java index 2ec22d6b2303c58c88f3f13b988e743cf67a7148..3a0e04dfa23850f6297c97b5d5960c111c4ffd38 100644 --- a/java/core/src/main/java/com/google/protobuf/BinaryReader.java +++ b/java/core/src/main/java/com/google/protobuf/BinaryReader.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -25,7 +48,6 @@ import java.util.Map; * A {@link Reader} that reads from a buffer containing a message serialized with the binary * protocol. */ -@CheckReturnValue @ExperimentalApi abstract class BinaryReader implements Reader { private static final int FIXED32_MULTIPLE_MASK = FIXED32_SIZE - 1; @@ -44,10 +66,10 @@ abstract class BinaryReader implements Reader { */ public static BinaryReader newInstance(ByteBuffer buffer, boolean bufferIsImmutable) { if (buffer.hasArray()) { - // TODO: Add support for unsafe operations. + // TODO(nathanmittler): Add support for unsafe operations. return new SafeHeapReader(buffer, bufferIsImmutable); } - // TODO: Add support for direct buffers + // TODO(nathanmittler): Add support for direct buffers throw new IllegalArgumentException("Direct buffers not yet supported"); } @@ -253,7 +275,6 @@ abstract class BinaryReader implements Reader { } } - @Deprecated @Override public T readGroup(Class clazz, ExtensionRegistryLite extensionRegistry) throws IOException { @@ -261,7 +282,6 @@ abstract class BinaryReader implements Reader { return readGroup(Protobuf.getInstance().schemaFor(clazz), extensionRegistry); } - @Deprecated @Override public T readGroupBySchemaWithCheck( Schema schema, ExtensionRegistryLite extensionRegistry) throws IOException { @@ -944,7 +964,6 @@ abstract class BinaryReader implements Reader { } } - @Deprecated @Override public void readGroupList( List target, Class targetType, ExtensionRegistryLite extensionRegistry) @@ -953,7 +972,6 @@ abstract class BinaryReader implements Reader { readGroupList(target, schema, extensionRegistry); } - @Deprecated @Override public void readGroupList( List target, Schema schema, ExtensionRegistryLite extensionRegistry) diff --git a/java/core/src/main/java/com/google/protobuf/BinaryWriter.java b/java/core/src/main/java/com/google/protobuf/BinaryWriter.java index 4b6a06f75214b11efaed51a634cba3789c72aa58..94259ecd32bba0605a26adf97eacce83ffc4e142 100644 --- a/java/core/src/main/java/com/google/protobuf/BinaryWriter.java +++ b/java/core/src/main/java/com/google/protobuf/BinaryWriter.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -42,7 +65,6 @@ import java.util.Queue; * The {@link #getTotalBytesWritten()} will continue to reflect the total of the write and will not * be reset. */ -@CheckReturnValue @ExperimentalApi abstract class BinaryWriter extends ByteOutput implements Writer { public static final int DEFAULT_CHUNK_SIZE = 4096; @@ -140,7 +162,6 @@ abstract class BinaryWriter extends ByteOutput implements Writer { *

After calling this method, the writer can not be reused. Create a new writer for future * writes. */ - @CanIgnoreReturnValue public final Queue complete() { finishCurrentBuffer(); return buffers; @@ -186,7 +207,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeInt32List_Internal(int fieldNumber, List list, boolean packed) + private final void writeInt32List_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT64_SIZE)); @@ -204,7 +225,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeInt32List_Internal(int fieldNumber, IntArrayList list, boolean packed) + private final void writeInt32List_Internal(int fieldNumber, IntArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT64_SIZE)); @@ -232,7 +253,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeFixed32List_Internal(int fieldNumber, List list, boolean packed) + private final void writeFixed32List_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED32_SIZE)); @@ -250,7 +271,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeFixed32List_Internal(int fieldNumber, IntArrayList list, boolean packed) + private final void writeFixed32List_Internal(int fieldNumber, IntArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED32_SIZE)); @@ -284,7 +305,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeUInt64List_Internal(int fieldNumber, List list, boolean packed) + private final void writeUInt64List_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT64_SIZE)); @@ -302,7 +323,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeUInt64List_Internal(int fieldNumber, LongArrayList list, boolean packed) + private final void writeUInt64List_Internal(int fieldNumber, LongArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT64_SIZE)); @@ -330,7 +351,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeFixed64List_Internal(int fieldNumber, List list, boolean packed) + private final void writeFixed64List_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED64_SIZE)); @@ -348,7 +369,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeFixed64List_Internal(int fieldNumber, LongArrayList list, boolean packed) + private final void writeFixed64List_Internal(int fieldNumber, LongArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED64_SIZE)); @@ -376,7 +397,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeFloatList_Internal(int fieldNumber, List list, boolean packed) + private final void writeFloatList_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED32_SIZE)); @@ -394,7 +415,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeFloatList_Internal(int fieldNumber, FloatArrayList list, boolean packed) + private final void writeFloatList_Internal(int fieldNumber, FloatArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED32_SIZE)); @@ -422,7 +443,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeDoubleList_Internal(int fieldNumber, List list, boolean packed) + private final void writeDoubleList_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED64_SIZE)); @@ -440,7 +461,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeDoubleList_Internal(int fieldNumber, DoubleArrayList list, boolean packed) + private final void writeDoubleList_Internal(int fieldNumber, DoubleArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * FIXED64_SIZE)); @@ -474,7 +495,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeBoolList_Internal(int fieldNumber, List list, boolean packed) + private final void writeBoolList_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + list.size()); @@ -492,7 +513,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeBoolList_Internal(int fieldNumber, BooleanArrayList list, boolean packed) + private final void writeBoolList_Internal(int fieldNumber, BooleanArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + list.size()); @@ -549,7 +570,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeUInt32List_Internal(int fieldNumber, List list, boolean packed) + private final void writeUInt32List_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT32_SIZE)); @@ -567,7 +588,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeUInt32List_Internal(int fieldNumber, IntArrayList list, boolean packed) + private final void writeUInt32List_Internal(int fieldNumber, IntArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT32_SIZE)); @@ -607,7 +628,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeSInt32List_Internal(int fieldNumber, List list, boolean packed) + private final void writeSInt32List_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT32_SIZE)); @@ -625,7 +646,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeSInt32List_Internal(int fieldNumber, IntArrayList list, boolean packed) + private final void writeSInt32List_Internal(int fieldNumber, IntArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT32_SIZE)); @@ -659,7 +680,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { @Override public void writeMap(int fieldNumber, MapEntryLite.Metadata metadata, Map map) throws IOException { - // TODO: Reverse write those entries. + // TODO(liujisi): Reverse write those entries. for (Map.Entry entry : map.entrySet()) { int prevBytes = getTotalBytesWritten(); writeMapEntryField(this, MAP_VALUE_NUMBER, metadata.valueType, entry.getValue()); @@ -736,7 +757,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeSInt64List_Internal(int fieldNumber, List list, boolean packed) + private final void writeSInt64List_Internal(int fieldNumber, List list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT64_SIZE)); @@ -754,7 +775,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - private void writeSInt64List_Internal(int fieldNumber, LongArrayList list, boolean packed) + private final void writeSInt64List_Internal(int fieldNumber, LongArrayList list, boolean packed) throws IOException { if (packed) { requireSpace((MAX_VARINT32_SIZE * 2) + (list.size() * MAX_VARINT64_SIZE)); @@ -787,7 +808,6 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - @Deprecated @Override public final void writeGroupList(int fieldNumber, List list) throws IOException { for (int i = list.size() - 1; i >= 0; i--) { @@ -795,7 +815,6 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } } - @Deprecated @Override public final void writeGroupList(int fieldNumber, List list, Schema schema) throws IOException { @@ -1061,7 +1080,6 @@ abstract class BinaryWriter extends ByteOutput implements Writer { writeTag(fieldNumber, WIRETYPE_LENGTH_DELIMITED); } - @Deprecated @Override public void writeGroup(int fieldNumber, Object value) throws IOException { writeTag(fieldNumber, WIRETYPE_END_GROUP); @@ -1379,7 +1397,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value, offset, length)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); return; } @@ -1409,7 +1427,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); } @@ -1479,8 +1497,8 @@ abstract class BinaryWriter extends ByteOutput implements Writer { this.allocatedBuffer = allocatedBuffer; this.buffer = allocatedBuffer.array(); int arrayOffset = allocatedBuffer.arrayOffset(); - this.limit = (long) arrayOffset + allocatedBuffer.limit(); - this.offset = (long) arrayOffset + allocatedBuffer.position(); + this.limit = arrayOffset + allocatedBuffer.limit(); + this.offset = arrayOffset + allocatedBuffer.position(); this.offsetMinusOne = offset - 1; this.limitMinusOne = limit - 1; this.pos = limitMinusOne; @@ -1920,7 +1938,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value, offset, length)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); return; } @@ -1948,7 +1966,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); } @@ -1996,8 +2014,8 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(allocatedBuffer); buffer = nioBuffer; - Java8Compatibility.limit(buffer, buffer.capacity()); - Java8Compatibility.position(buffer, 0); + buffer.limit(buffer.capacity()); + buffer.position(0); // Set byte order to little endian for fast writing of fixed 32/64. buffer.order(ByteOrder.LITTLE_ENDIAN); @@ -2023,7 +2041,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { if (buffer != null) { totalDoneBytes += bytesWrittenToCurrentBuffer(); // Update the indices on the netty buffer. - Java8Compatibility.position(buffer, pos + 1); + buffer.position(pos + 1); buffer = null; pos = 0; limitMinusOne = 0; @@ -2130,7 +2148,6 @@ abstract class BinaryWriter extends ByteOutput implements Writer { writeTag(fieldNumber, WIRETYPE_LENGTH_DELIMITED); } - @Deprecated @Override public void writeGroup(int fieldNumber, Object value) throws IOException { writeTag(fieldNumber, WIRETYPE_END_GROUP); @@ -2145,13 +2162,11 @@ abstract class BinaryWriter extends ByteOutput implements Writer { writeTag(fieldNumber, WIRETYPE_START_GROUP); } - @Deprecated @Override public void writeStartGroup(int fieldNumber) { writeTag(fieldNumber, WIRETYPE_START_GROUP); } - @Deprecated @Override public void writeEndGroup(int fieldNumber) { writeTag(fieldNumber, WIRETYPE_END_GROUP); @@ -2452,7 +2467,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } pos -= length; - Java8Compatibility.position(buffer, pos + 1); + buffer.position(pos + 1); buffer.put(value, offset, length); } @@ -2465,13 +2480,13 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value, offset, length)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); return; } pos -= length; - Java8Compatibility.position(buffer, pos + 1); + buffer.position(pos + 1); buffer.put(value, offset, length); } @@ -2483,7 +2498,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } pos -= length; - Java8Compatibility.position(buffer, pos + 1); + buffer.position(pos + 1); buffer.put(value); } @@ -2497,13 +2512,13 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); return; } pos -= length; - Java8Compatibility.position(buffer, pos + 1); + buffer.position(pos + 1); buffer.put(value); } @@ -2553,8 +2568,8 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(allocatedBuffer); buffer = nioBuffer; - Java8Compatibility.limit(buffer, buffer.capacity()); - Java8Compatibility.position(buffer, 0); + buffer.limit(buffer.capacity()); + buffer.position(0); bufferOffset = UnsafeUtil.addressOffset(buffer); limitMinusOne = bufferOffset + (buffer.limit() - 1); @@ -2579,7 +2594,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { if (buffer != null) { totalDoneBytes += bytesWrittenToCurrentBuffer(); // Update the indices on the netty buffer. - Java8Compatibility.position(buffer, bufferPos() + 1); + buffer.position(bufferPos() + 1); buffer = null; pos = 0; limitMinusOne = 0; @@ -2704,13 +2719,11 @@ abstract class BinaryWriter extends ByteOutput implements Writer { writeTag(fieldNumber, WIRETYPE_START_GROUP); } - @Deprecated @Override public void writeStartGroup(int fieldNumber) { writeTag(fieldNumber, WIRETYPE_START_GROUP); } - @Deprecated @Override public void writeEndGroup(int fieldNumber) { writeTag(fieldNumber, WIRETYPE_END_GROUP); @@ -2993,7 +3006,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } pos -= length; - Java8Compatibility.position(buffer, bufferPos() + 1); + buffer.position(bufferPos() + 1); buffer.put(value, offset, length); } @@ -3006,13 +3019,13 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value, offset, length)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); return; } pos -= length; - Java8Compatibility.position(buffer, bufferPos() + 1); + buffer.position(bufferPos() + 1); buffer.put(value, offset, length); } @@ -3024,7 +3037,7 @@ abstract class BinaryWriter extends ByteOutput implements Writer { } pos -= length; - Java8Compatibility.position(buffer, bufferPos() + 1); + buffer.position(bufferPos() + 1); buffer.put(value); } @@ -3038,13 +3051,13 @@ abstract class BinaryWriter extends ByteOutput implements Writer { buffers.addFirst(AllocatedBuffer.wrap(value)); // Advance the writer to the next buffer. - // TODO: Consider slicing if space available above some threshold. + // TODO(nathanmittler): Consider slicing if space available above some threshold. nextBuffer(); return; } pos -= length; - Java8Compatibility.position(buffer, bufferPos() + 1); + buffer.position(bufferPos() + 1); buffer.put(value); } diff --git a/java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java b/java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java index 7ad390a58a4cb2afb38ea41bae78573df7ff568e..8af80057f362a9b7bb09e0d09f01f065340ed9e8 100644 --- a/java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java +++ b/java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/BlockingService.java b/java/core/src/main/java/com/google/protobuf/BlockingService.java index 2bf329482278fa9c8f2dadf8dca55793cc701c31..e2b99c96c3304f83b09a6e5f3427e3359369e756 100644 --- a/java/core/src/main/java/com/google/protobuf/BlockingService.java +++ b/java/core/src/main/java/com/google/protobuf/BlockingService.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/BooleanArrayList.java b/java/core/src/main/java/com/google/protobuf/BooleanArrayList.java index 2c78b0d2910c30449d8c96ad7876fbcc15947ee9..451fce1e849923a064117c89e56c32d6206173ec 100644 --- a/java/core/src/main/java/com/google/protobuf/BooleanArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/BooleanArrayList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -22,7 +45,10 @@ import java.util.RandomAccess; final class BooleanArrayList extends AbstractProtobufList implements BooleanList, RandomAccess, PrimitiveNonBoxingCollection { - private static final BooleanArrayList EMPTY_LIST = new BooleanArrayList(new boolean[0], 0, false); + private static final BooleanArrayList EMPTY_LIST = new BooleanArrayList(new boolean[0], 0); + static { + EMPTY_LIST.makeImmutable(); + } public static BooleanArrayList emptyList() { return EMPTY_LIST; @@ -39,16 +65,15 @@ final class BooleanArrayList extends AbstractProtobufList /** Constructs a new mutable {@code BooleanArrayList} with default capacity. */ BooleanArrayList() { - this(new boolean[DEFAULT_CAPACITY], 0, true); + this(new boolean[DEFAULT_CAPACITY], 0); } /** * Constructs a new mutable {@code BooleanArrayList} containing the same elements as {@code * other}. */ - private BooleanArrayList(boolean[] other, int size, boolean isMutable) { - super(isMutable); - this.array = other; + private BooleanArrayList(boolean[] other, int size) { + array = other; this.size = size; } @@ -101,7 +126,7 @@ final class BooleanArrayList extends AbstractProtobufList if (capacity < size) { throw new IllegalArgumentException(); } - return new BooleanArrayList(Arrays.copyOf(array, capacity), size, true); + return new BooleanArrayList(Arrays.copyOf(array, capacity), size); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/BufferAllocator.java b/java/core/src/main/java/com/google/protobuf/BufferAllocator.java index f35ce4bbf71ce17e75c09946308d8b1dbd0c4996..bfd9c7237c0e21aeb9c23a9de7fe2a5379789e8a 100644 --- a/java/core/src/main/java/com/google/protobuf/BufferAllocator.java +++ b/java/core/src/main/java/com/google/protobuf/BufferAllocator.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -13,7 +36,6 @@ import java.nio.ByteBuffer; * An object responsible for allocation of buffers. This is an extension point to enable buffer * pooling within an application. */ -@CheckReturnValue @ExperimentalApi abstract class BufferAllocator { private static final BufferAllocator UNPOOLED = diff --git a/java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java b/java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java index e7d9eec8e3ddb1d90489be4d3f5c1b5601cccc6c..2cb3ada67fb6b658289b6c8ef9e0a2ed8b71bd9b 100644 --- a/java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java +++ b/java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -25,18 +48,18 @@ final class ByteBufferWriter { * Minimum size for a cached buffer. This prevents us from allocating buffers that are too small * to be easily reused. */ - // TODO: tune this property or allow configuration? + // TODO(nathanmittler): tune this property or allow configuration? private static final int MIN_CACHED_BUFFER_SIZE = 1024; /** * Maximum size for a cached buffer. If a larger buffer is required, it will be allocated but not * cached. */ - // TODO: tune this property or allow configuration? + // TODO(nathanmittler): tune this property or allow configuration? private static final int MAX_CACHED_BUFFER_SIZE = 16 * 1024; /** The fraction of the requested buffer size under which the buffer will be reallocated. */ - // TODO: tune this property or allow configuration? + // TODO(nathanmittler): tune this property or allow configuration? private static final float BUFFER_REALLOCATION_THRESHOLD = 0.5f; /** @@ -74,7 +97,7 @@ final class ByteBufferWriter { output.write(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining()); } else if (!writeToChannel(buffer, output)) { // Read all of the data from the buffer to an array. - // TODO: Consider performance improvements for other "known" stream types. + // TODO(nathanmittler): Consider performance improvements for other "known" stream types. final byte[] array = getOrCreateBuffer(buffer.remaining()); while (buffer.hasRemaining()) { int length = min(buffer.remaining(), array.length); @@ -84,7 +107,7 @@ final class ByteBufferWriter { } } finally { // Restore the initial position. - Java8Compatibility.position(buffer, initialPos); + buffer.position(initialPos); } } diff --git a/java/core/src/main/java/com/google/protobuf/ByteOutput.java b/java/core/src/main/java/com/google/protobuf/ByteOutput.java index b40225488bd19d5f4e0ab3cba153670c414acefd..dba7a379f8f33a2decc91e6708e3660202ce2681 100644 --- a/java/core/src/main/java/com/google/protobuf/ByteOutput.java +++ b/java/core/src/main/java/com/google/protobuf/ByteOutput.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/ByteString.java b/java/core/src/main/java/com/google/protobuf/ByteString.java index 8ba729c8e6da6d814fb4169d6aa4ecdec0e5a2e8..17b7c98c99dda2efda678074dc2ebbfabd892e83 100644 --- a/java/core/src/main/java/com/google/protobuf/ByteString.java +++ b/java/core/src/main/java/com/google/protobuf/ByteString.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -50,9 +73,7 @@ import java.util.NoSuchElementException; * @author carlanton@google.com Carl Haverl * @author martinrb@google.com Martin Buchholz */ -@CheckReturnValue public abstract class ByteString implements Iterable, Serializable { - private static final long serialVersionUID = 1L; /** * When two strings to be concatenated have a combined length shorter than this, we just copy @@ -214,11 +235,6 @@ public abstract class ByteString implements Iterable, Serializable { return size() == 0; } - /** Returns an empty {@code ByteString} of size {@code 0}. */ - public static final ByteString empty() { - return EMPTY; - } - // ================================================================= // Comparison @@ -236,38 +252,6 @@ public abstract class ByteString implements Iterable, Serializable { return value & UNSIGNED_BYTE_MASK; } - /** Returns the numeric value of the given character in hex, or -1 if invalid. */ - private static int hexDigit(char c) { - if (c >= '0' && c <= '9') { - return c - '0'; - } else if (c >= 'A' && c <= 'F') { - return c - 'A' + 10; - } else if (c >= 'a' && c <= 'f') { - return c - 'a' + 10; - } else { - return -1; - } - } - - /** - * Returns the numeric value of the given character at index in hexString. - * - * @throws NumberFormatException if the hexString character is invalid. - */ - private static int extractHexDigit(String hexString, int index) { - int digit = hexDigit(hexString.charAt(index)); - if (digit == -1) { - throw new NumberFormatException( - "Invalid hexString " - + hexString - + " must only contain [0-9a-fA-F] but contained " - + hexString.charAt(index) - + " at index " - + index); - } - return digit; - } - /** * Compares two {@link ByteString}s lexicographically, treating their contents as unsigned byte * values between 0 and 255 (inclusive). @@ -283,20 +267,22 @@ public abstract class ByteString implements Iterable, Serializable { ByteIterator latterBytes = latter.iterator(); while (formerBytes.hasNext() && latterBytes.hasNext()) { + // Note: This code was copied from com.google.common.primitives.UnsignedBytes#compare, + // as Guava libraries cannot be used in the {@code com.google.protobuf} package. int result = - Integer.valueOf(toInt(formerBytes.nextByte())) - .compareTo(toInt(latterBytes.nextByte())); + Integer.compare(toInt(formerBytes.nextByte()), toInt(latterBytes.nextByte())); if (result != 0) { return result; } } - return Integer.valueOf(former.size()).compareTo(Integer.valueOf(latter.size())); + + return Integer.compare(former.size(), latter.size()); } }; /** - * Returns a {@link Comparator} which compares {@link ByteString}-s lexicographically as sequences - * of unsigned bytes (i.e. values between 0 and 255, inclusive). + * Returns a {@link Comparator} which compares {@link ByteString}-s lexicographically + * as sequences of unsigned bytes (i.e. values between 0 and 255, inclusive). * *

For example, {@code (byte) -1} is considered to be greater than {@code (byte) 1} because it * is interpreted as an unsigned value, {@code 255}: @@ -359,29 +345,6 @@ public abstract class ByteString implements Iterable, Serializable { return size() >= suffix.size() && substring(size() - suffix.size()).equals(suffix); } - // ================================================================= - // String -> ByteString - - /** - * Returns a {@code ByteString} from a hexadecimal String. - * - * @param hexString String of hexadecimal digits to create {@code ByteString} from. - * @throws NumberFormatException if the hexString does not contain a parsable hex String. - */ - public static ByteString fromHex(@CompileTimeConstant String hexString) { - if (hexString.length() % 2 != 0) { - throw new NumberFormatException( - "Invalid hexString " + hexString + " of length " + hexString.length() + " must be even."); - } - byte[] bytes = new byte[hexString.length() / 2]; - for (int i = 0; i < bytes.length; i++) { - int d1 = extractHexDigit(hexString, 2 * i); - int d2 = extractHexDigit(hexString, 2 * i + 1); - bytes[i] = (byte) (d1 << 4 | d2); - } - return new LiteralByteString(bytes); - } - // ================================================================= // byte[] -> ByteString @@ -409,10 +372,7 @@ public abstract class ByteString implements Iterable, Serializable { return copyFrom(bytes, 0, bytes.length); } - /** - * Wraps the given bytes into a {@code ByteString}. Intended for internal usage within the - * library. - */ + /** Wraps the given bytes into a {@code ByteString}. Intended for internal only usage. */ static ByteString wrap(ByteBuffer buffer) { if (buffer.hasArray()) { final int offset = buffer.arrayOffset(); @@ -423,17 +383,17 @@ public abstract class ByteString implements Iterable, Serializable { } /** - * Wraps the given bytes into a {@code ByteString}. Intended for internal usage within the library - * to force a classload of ByteString before LiteralByteString. + * Wraps the given bytes into a {@code ByteString}. Intended for internal only usage to force a + * classload of ByteString before LiteralByteString. */ static ByteString wrap(byte[] bytes) { - // TODO: Return EMPTY when bytes are empty to reduce allocations? + // TODO(dweis): Return EMPTY when bytes are empty to reduce allocations? return new LiteralByteString(bytes); } /** - * Wraps the given bytes into a {@code ByteString}. Intended for internal usage within the library - * to force a classload of ByteString before BoundedByteString and LiteralByteString. + * Wraps the given bytes into a {@code ByteString}. Intended for internal only usage to force a + * classload of ByteString before BoundedByteString and LiteralByteString. */ static ByteString wrap(byte[] bytes, int offset, int length) { return new BoundedByteString(bytes, offset, length); @@ -519,8 +479,7 @@ public abstract class ByteString implements Iterable, Serializable { * @param streamToDrain The source stream, which is read completely but not closed. * @return A new {@code ByteString} which is made up of chunks of various sizes, depending on the * behavior of the underlying stream. - * @throws IOException if there is a problem reading the underlying stream - * @throws IllegalArgumentException if the stream supplies more than Integer.MAX_VALUE bytes + * @throws IOException IOException is thrown if there is a problem reading the underlying stream. */ public static ByteString readFrom(InputStream streamToDrain) throws IOException { return readFrom(streamToDrain, MIN_READ_FROM_CHUNK_SIZE, MAX_READ_FROM_CHUNK_SIZE); @@ -540,23 +499,13 @@ public abstract class ByteString implements Iterable, Serializable { * @param streamToDrain The source stream, which is read completely but not closed. * @param chunkSize The size of the chunks in which to read the stream. * @return A new {@code ByteString} which is made up of chunks of the given size. - * @throws IOException if there is a problem reading the underlying stream - * @throws IllegalArgumentException if the stream supplies more than Integer.MAX_VALUE bytes + * @throws IOException IOException is thrown if there is a problem reading the underlying stream. */ public static ByteString readFrom(InputStream streamToDrain, int chunkSize) throws IOException { return readFrom(streamToDrain, chunkSize, chunkSize); } - /** - * Helper method that takes the chunk size range as a parameter. - * - * @param streamToDrain the source stream, which is read completely but not closed - * @param minChunkSize the minimum size of the chunks in which to read the stream - * @param maxChunkSize the maximum size of the chunks in which to read the stream - * @return a new {@code ByteString} which is made up of chunks within the given size range - * @throws IOException if there is a problem reading the underlying stream - * @throws IllegalArgumentException if the stream supplies more than Integer.MAX_VALUE bytes - */ + // Helper method that takes the chunk size range as a parameter. public static ByteString readFrom(InputStream streamToDrain, int minChunkSize, int maxChunkSize) throws IOException { Collection results = new ArrayList(); @@ -615,8 +564,6 @@ public abstract class ByteString implements Iterable, Serializable { * * @param other string to concatenate * @return a new {@code ByteString} instance - * @throws IllegalArgumentException if the combined size of the two byte strings exceeds - * Integer.MAX_VALUE */ public final ByteString concat(ByteString other) { if (Integer.MAX_VALUE - size() < other.size()) { @@ -637,8 +584,6 @@ public abstract class ByteString implements Iterable, Serializable { * * @param byteStrings strings to be concatenated * @return new {@code ByteString} - * @throws IllegalArgumentException if the combined size of the byte strings exceeds - * Integer.MAX_VALUE */ public static ByteString copyFrom(Iterable byteStrings) { // Determine the size; @@ -926,8 +871,6 @@ public abstract class ByteString implements Iterable, Serializable { /** Base class for leaf {@link ByteString}s (i.e. non-ropes). */ abstract static class LeafByteString extends ByteString { - private static final long serialVersionUID = 1L; - @Override protected final int getTreeDepth() { return 0; @@ -1100,10 +1043,8 @@ public abstract class ByteString implements Iterable, Serializable { } /** - * Creates a byte string with the size and contents of this output stream. This does not create - * a new copy of the underlying bytes. If the stream size grows dynamically, the runtime is - * O(log n) in respect to the number of bytes written to the {@link Output}. If the stream size - * stays within the initial capacity, the runtime is O(1). + * Creates a byte string. Its size is the current size of this output stream and its output has + * been copied to it. * * @return the current contents of this output stream, as a byte string. */ @@ -1112,6 +1053,13 @@ public abstract class ByteString implements Iterable, Serializable { return ByteString.copyFrom(flushedBuffers); } + /** Implement java.util.Arrays.copyOf() for jdk 1.5. */ + private byte[] copyArray(byte[] buffer, int length) { + byte[] result = new byte[length]; + System.arraycopy(buffer, 0, result, 0, Math.min(buffer.length, length)); + return result; + } + /** * Writes the complete contents of this byte array output stream to the specified output stream * argument. @@ -1126,7 +1074,7 @@ public abstract class ByteString implements Iterable, Serializable { synchronized (this) { // Copy the information we need into local variables so as to hold // the lock for as short a time as possible. - cachedFlushBuffers = flushedBuffers.toArray(new ByteString[0]); + cachedFlushBuffers = flushedBuffers.toArray(new ByteString[flushedBuffers.size()]); cachedBuffer = buffer; cachedBufferPos = bufferPos; } @@ -1134,7 +1082,7 @@ public abstract class ByteString implements Iterable, Serializable { byteString.writeTo(out); } - out.write(Arrays.copyOf(cachedBuffer, cachedBufferPos)); + out.write(copyArray(cachedBuffer, cachedBufferPos)); } /** @@ -1185,7 +1133,7 @@ public abstract class ByteString implements Iterable, Serializable { private void flushLastBuffer() { if (bufferPos < buffer.length) { if (bufferPos > 0) { - byte[] bufferCopy = Arrays.copyOf(buffer, bufferPos); + byte[] bufferCopy = copyArray(buffer, bufferPos); flushedBuffers.add(new LiteralByteString(bufferCopy)); } // We reuse this buffer for further writes. @@ -1310,7 +1258,6 @@ public abstract class ByteString implements Iterable, Serializable { * @return the length of the range. * @throws IndexOutOfBoundsException some or all of the range falls outside of the array. */ - @CanIgnoreReturnValue static int checkRange(int startIndex, int endIndex, int size) { final int length = endIndex - startIndex; if ((startIndex | endIndex | length | (size - endIndex)) < 0) { @@ -1410,7 +1357,7 @@ public abstract class ByteString implements Iterable, Serializable { byte[] target, int sourceOffset, int targetOffset, int numberToCopy) { // Optimized form, not for subclasses, since we don't call // getOffsetIntoBytes() or check the 'numberToCopy' parameter. - // TODO: Is not calling getOffsetIntoBytes really saving that much? + // TODO(nathanmittler): Is not calling getOffsetIntoBytes really saving that much? System.arraycopy(bytes, sourceOffset, target, targetOffset, numberToCopy); } @@ -1586,6 +1533,7 @@ public abstract class ByteString implements Iterable, Serializable { // Keep this class private to avoid deadlocks in classloading across threads as ByteString's // static initializer loads LiteralByteString and another thread loads BoundedByteString. private static final class BoundedByteString extends LiteralByteString { + private final int bytesOffset; private final int bytesLength; diff --git a/java/core/src/main/java/com/google/protobuf/CanIgnoreReturnValue.java b/java/core/src/main/java/com/google/protobuf/CanIgnoreReturnValue.java deleted file mode 100644 index c2260ce4eeac547dd026bbb875dea300e6b90d07..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/CanIgnoreReturnValue.java +++ /dev/null @@ -1,26 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicates that the return value of the annotated method can be safely ignored. - * - *

This is the opposite of {@link CheckReturnValue}. It can be used inside classes or packages - * annotated with {@code @CheckReturnValue} to exempt specific methods from the default. - */ -@Documented -@Target(METHOD) // TODO: consider adding CONSTRUCTOR later if necessary -@Retention(CLASS) -@interface CanIgnoreReturnValue {} diff --git a/java/core/src/main/java/com/google/protobuf/CheckReturnValue.java b/java/core/src/main/java/com/google/protobuf/CheckReturnValue.java deleted file mode 100644 index bfdd99fcf48588b8c4c0fe1e9185ec7c1ef83e45..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/CheckReturnValue.java +++ /dev/null @@ -1,32 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import static java.lang.annotation.ElementType.CONSTRUCTOR; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PACKAGE; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Indicates that the return value of the annotated method must be used. An error is triggered when - * one of these methods is called but the result is not used. - * - *

{@code @CheckReturnValue} may be applied to a class or package to indicate that all methods in - * that class (including indirectly; that is, methods of inner classes within the annotated class) - * or package must have their return values used. For convenience, we provide an annotation, {@link - * CanIgnoreReturnValue}, to exempt specific methods or classes from this behavior. - */ -@Documented -@Target({METHOD, CONSTRUCTOR, TYPE, PACKAGE}) -@Retention(RUNTIME) -@interface CheckReturnValue {} diff --git a/java/core/src/main/java/com/google/protobuf/CodedInputStream.java b/java/core/src/main/java/com/google/protobuf/CodedInputStream.java index 8f1ac736d65119437cc02339abe087534df732b9..ff81e0032f81ed29732b20effeb87e54b53b29ed 100644 --- a/java/core/src/main/java/com/google/protobuf/CodedInputStream.java +++ b/java/core/src/main/java/com/google/protobuf/CodedInputStream.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -38,14 +61,14 @@ import java.util.List; */ public abstract class CodedInputStream { private static final int DEFAULT_BUFFER_SIZE = 4096; + private static final int DEFAULT_RECURSION_LIMIT = 100; // Integer.MAX_VALUE == 0x7FFFFFF == INT_MAX from limits.h private static final int DEFAULT_SIZE_LIMIT = Integer.MAX_VALUE; - private static volatile int defaultRecursionLimit = 100; /** Visible for subclasses. See setRecursionLimit() */ int recursionDepth; - int recursionLimit = defaultRecursionLimit; + int recursionLimit = DEFAULT_RECURSION_LIMIT; /** Visible for subclasses. See setSizeLimit() */ int sizeLimit = DEFAULT_SIZE_LIMIT; @@ -64,7 +87,7 @@ public abstract class CodedInputStream { throw new IllegalArgumentException("bufferSize must be > 0"); } if (input == null) { - // Ideally we would throw here. This is done for backward compatibility. + // TODO(nathanmittler): Ideally we should throw here. This is done for backward compatibility. return newInstance(EMPTY_BYTE_ARRAY); } return new StreamDecoder(input, bufferSize); @@ -102,7 +125,7 @@ public abstract class CodedInputStream { if (flag == 2) { return new IterableDirectByteBufferDecoder(bufs, totalSize, bufferIsImmutable); } else { - // TODO: add another decoders to deal case 1 and 3. + // TODO(yilunchong): add another decoders to deal case 1 and 3. return newInstance(new IterableByteBufferInputStream(bufs)); } } @@ -166,17 +189,12 @@ public abstract class CodedInputStream { // The buffer is non-direct and does not expose the underlying array. Using the ByteBuffer API // to access individual bytes is very slow, so just copy the buffer to an array. - // TODO: Re-evaluate with Java 9 + // TODO(nathanmittler): Re-evaluate with Java 9 byte[] buffer = new byte[buf.remaining()]; buf.duplicate().get(buffer); return newInstance(buffer, 0, buffer.length, true); } - public void checkRecursionLimit() throws InvalidProtocolBufferException { - if (recursionDepth >= recursionLimit) { - throw InvalidProtocolBufferException.recursionLimitExceeded(); - } - } /** Disable construction/inheritance outside of this class. */ private CodedInputStream() {} @@ -231,6 +249,7 @@ public abstract class CodedInputStream { */ public abstract void skipMessage(CodedOutputStream output) throws IOException; + // ----------------------------------------------------------------- /** Read a {@code double} field value from the stream. */ @@ -276,6 +295,7 @@ public abstract class CodedInputStream { final ExtensionRegistryLite extensionRegistry) throws IOException; + /** Read a {@code group} field value from the stream. */ public abstract T readGroup( final int fieldNumber, final Parser parser, final ExtensionRegistryLite extensionRegistry) @@ -297,6 +317,7 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException; + /** Read an embedded message field value from the stream. */ public abstract T readMessage( final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException; @@ -378,9 +399,9 @@ public abstract class CodedInputStream { * *

Set the maximum message size. In order to prevent malicious messages from exhausting memory * or causing integer overflows, {@code CodedInputStream} limits how large a message may be. The - * default limit is {@code Integer.MAX_VALUE}. You should set this limit as small as you can - * without harming your app's functionality. Note that size limits only apply when reading from an - * {@code InputStream}, not when constructed around a raw byte array. + * default limit is {@code Integer.MAX_INT}. You should set this limit as small as you can without + * harming your app's functionality. Note that size limits only apply when reading from an {@code + * InputStream}, not when constructed around a raw byte array. * *

If you want to read several messages from a single CodedInputStream, you could call {@link * #resetSizeCounter()} after each one to avoid hitting the size limit. @@ -654,33 +675,33 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_VARINT: { long value = readInt64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeUInt64NoTag(value); return true; } case WireFormat.WIRETYPE_FIXED64: { long value = readRawLittleEndian64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed64NoTag(value); return true; } case WireFormat.WIRETYPE_LENGTH_DELIMITED: { ByteString value = readBytes(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeBytesNoTag(value); return true; } case WireFormat.WIRETYPE_START_GROUP: { - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); skipMessage(output); int endtag = WireFormat.makeTag( WireFormat.getTagFieldNumber(tag), WireFormat.WIRETYPE_END_GROUP); checkLastTagWas(endtag); - output.writeUInt32NoTag(endtag); + output.writeRawVarint32(endtag); return true; } case WireFormat.WIRETYPE_END_GROUP: @@ -690,7 +711,7 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_FIXED32: { int value = readRawLittleEndian32(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed32NoTag(value); return true; } @@ -719,6 +740,7 @@ public abstract class CodedInputStream { } } + // ----------------------------------------------------------------- @Override @@ -805,20 +827,25 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); --recursionDepth; } + @Override public T readGroup( final int fieldNumber, final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); @@ -838,31 +865,30 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { final int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); } + @Override public T readMessage( final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); return result; } @@ -907,7 +933,7 @@ public abstract class CodedInputStream { ? ByteBuffer.wrap(buffer, pos, size).slice() : ByteBuffer.wrap(Arrays.copyOfRange(buffer, pos, pos + size)); pos += size; - // TODO: Investigate making the ByteBuffer be made read-only + // TODO(nathanmittler): Investigate making the ByteBuffer be made read-only return result; } @@ -1117,7 +1143,7 @@ public abstract class CodedInputStream { final byte[] buffer = this.buffer; pos = tempPos + FIXED32_SIZE; - return ((buffer[tempPos] & 0xff) + return (((buffer[tempPos] & 0xff)) | ((buffer[tempPos + 1] & 0xff) << 8) | ((buffer[tempPos + 2] & 0xff) << 16) | ((buffer[tempPos + 3] & 0xff) << 24)); @@ -1133,7 +1159,7 @@ public abstract class CodedInputStream { final byte[] buffer = this.buffer; pos = tempPos + FIXED64_SIZE; - return ((buffer[tempPos] & 0xffL) + return (((buffer[tempPos] & 0xffL)) | ((buffer[tempPos + 1] & 0xffL) << 8) | ((buffer[tempPos + 2] & 0xffL) << 16) | ((buffer[tempPos + 3] & 0xffL) << 24) @@ -1159,9 +1185,6 @@ public abstract class CodedInputStream { throw InvalidProtocolBufferException.negativeSize(); } byteLimit += getTotalBytesRead(); - if (byteLimit < 0) { - throw InvalidProtocolBufferException.parseFailure(); - } final int oldLimit = currentLimit; if (byteLimit > oldLimit) { throw InvalidProtocolBufferException.truncatedMessage(); @@ -1366,33 +1389,33 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_VARINT: { long value = readInt64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeUInt64NoTag(value); return true; } case WireFormat.WIRETYPE_FIXED64: { long value = readRawLittleEndian64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed64NoTag(value); return true; } case WireFormat.WIRETYPE_LENGTH_DELIMITED: { ByteString value = readBytes(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeBytesNoTag(value); return true; } case WireFormat.WIRETYPE_START_GROUP: { - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); skipMessage(output); int endtag = WireFormat.makeTag( WireFormat.getTagFieldNumber(tag), WireFormat.WIRETYPE_END_GROUP); checkLastTagWas(endtag); - output.writeUInt32NoTag(endtag); + output.writeRawVarint32(endtag); return true; } case WireFormat.WIRETYPE_END_GROUP: @@ -1402,7 +1425,7 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_FIXED32: { int value = readRawLittleEndian32(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed32NoTag(value); return true; } @@ -1431,6 +1454,7 @@ public abstract class CodedInputStream { } } + // ----------------------------------------------------------------- @Override @@ -1477,8 +1501,8 @@ public abstract class CodedInputStream { public String readString() throws IOException { final int size = readRawVarint32(); if (size > 0 && size <= remaining()) { - // TODO: Is there a way to avoid this copy? - // TODO: It might be possible to share the optimized loop with + // TODO(nathanmittler): Is there a way to avoid this copy? + // TODO(anuraaga): It might be possible to share the optimized loop with // readStringRequireUtf8 by implementing Java replacement logic there. // The same as readBytes' logic byte[] bytes = new byte[size]; @@ -1522,20 +1546,25 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); --recursionDepth; } + @Override public T readGroup( final int fieldNumber, final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); @@ -1555,31 +1584,30 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { final int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); } + @Override public T readMessage( final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); return result; } @@ -1633,7 +1661,7 @@ public abstract class CodedInputStream { pos += size; return ByteBuffer.wrap(bytes); } - // TODO: Investigate making the ByteBuffer be made read-only + // TODO(nathanmittler): Investigate making the ByteBuffer be made read-only } if (size == 0) { @@ -1839,7 +1867,7 @@ public abstract class CodedInputStream { } pos = tempPos + FIXED32_SIZE; - return ((UnsafeUtil.getByte(tempPos) & 0xff) + return (((UnsafeUtil.getByte(tempPos) & 0xff)) | ((UnsafeUtil.getByte(tempPos + 1) & 0xff) << 8) | ((UnsafeUtil.getByte(tempPos + 2) & 0xff) << 16) | ((UnsafeUtil.getByte(tempPos + 3) & 0xff) << 24)); @@ -1854,7 +1882,7 @@ public abstract class CodedInputStream { } pos = tempPos + FIXED64_SIZE; - return ((UnsafeUtil.getByte(tempPos) & 0xffL) + return (((UnsafeUtil.getByte(tempPos) & 0xffL)) | ((UnsafeUtil.getByte(tempPos + 1) & 0xffL) << 8) | ((UnsafeUtil.getByte(tempPos + 2) & 0xffL) << 16) | ((UnsafeUtil.getByte(tempPos + 3) & 0xffL) << 24) @@ -1981,20 +2009,15 @@ public abstract class CodedInputStream { private ByteBuffer slice(long begin, long end) throws IOException { int prevPos = buffer.position(); int prevLimit = buffer.limit(); - // View ByteBuffer as Buffer to avoid cross-Java version issues. - // See https://issues.apache.org/jira/browse/MRESOLVER-85 - Buffer asBuffer = buffer; try { - asBuffer.position(bufferPos(begin)); - asBuffer.limit(bufferPos(end)); + ((Buffer) buffer).position(bufferPos(begin)); + ((Buffer) buffer).limit(bufferPos(end)); return buffer.slice(); } catch (IllegalArgumentException e) { - InvalidProtocolBufferException ex = InvalidProtocolBufferException.truncatedMessage(); - ex.initCause(e); - throw ex; + throw InvalidProtocolBufferException.truncatedMessage(); } finally { - asBuffer.position(prevPos); - asBuffer.limit(prevLimit); + ((Buffer) buffer).position(prevPos); + ((Buffer) buffer).limit(prevLimit); } } } @@ -2032,44 +2055,6 @@ public abstract class CodedInputStream { totalBytesRetired = 0; } - /* - * The following wrapper methods exist so that InvalidProtocolBufferExceptions thrown by the - * InputStream can be differentiated from ones thrown by CodedInputStream itself. Each call to - * an InputStream method that can throw IOException must be wrapped like this. We do this - * because we sometimes need to modify IPBE instances after they are thrown far away from where - * they are thrown (ex. to add unfinished messages) and we use this signal elsewhere in the - * exception catch chain to know when to perform these operations directly or to wrap the - * exception in their own IPBE so the extra information can be communicated without trampling - * downstream information. - */ - private static int read(InputStream input, byte[] data, int offset, int length) - throws IOException { - try { - return input.read(data, offset, length); - } catch (InvalidProtocolBufferException e) { - e.setThrownFromInputStream(); - throw e; - } - } - - private static long skip(InputStream input, long length) throws IOException { - try { - return input.skip(length); - } catch (InvalidProtocolBufferException e) { - e.setThrownFromInputStream(); - throw e; - } - } - - private static int available(InputStream input) throws IOException { - try { - return input.available(); - } catch (InvalidProtocolBufferException e) { - e.setThrownFromInputStream(); - throw e; - } - } - @Override public int readTag() throws IOException { if (isAtEnd()) { @@ -2131,33 +2116,33 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_VARINT: { long value = readInt64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeUInt64NoTag(value); return true; } case WireFormat.WIRETYPE_FIXED64: { long value = readRawLittleEndian64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed64NoTag(value); return true; } case WireFormat.WIRETYPE_LENGTH_DELIMITED: { ByteString value = readBytes(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeBytesNoTag(value); return true; } case WireFormat.WIRETYPE_START_GROUP: { - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); skipMessage(output); int endtag = WireFormat.makeTag( WireFormat.getTagFieldNumber(tag), WireFormat.WIRETYPE_END_GROUP); checkLastTagWas(endtag); - output.writeUInt32NoTag(endtag); + output.writeRawVarint32(endtag); return true; } case WireFormat.WIRETYPE_END_GROUP: @@ -2167,7 +2152,7 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_FIXED32: { int value = readRawLittleEndian32(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed32NoTag(value); return true; } @@ -2221,6 +2206,7 @@ public abstract class CodedInputStream { } } + // ----------------------------------------------------------------- @Override @@ -2319,20 +2305,25 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); --recursionDepth; } + @Override public T readGroup( final int fieldNumber, final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); @@ -2352,31 +2343,30 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { final int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); } + @Override public T readMessage( final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); return result; } @@ -2408,7 +2398,7 @@ public abstract class CodedInputStream { return result; } else { // Slow path: Build a byte array first then copy it. - // TODO: Do we want to protect from malicious input streams here? + // TODO(dweis): Do we want to protect from malicious input streams here? return readRawBytesSlowPath(size, /* ensureNoLeakedReferences= */ false); } } @@ -2630,7 +2620,7 @@ public abstract class CodedInputStream { final byte[] buffer = this.buffer; pos = tempPos + FIXED32_SIZE; - return ((buffer[tempPos] & 0xff) + return (((buffer[tempPos] & 0xff)) | ((buffer[tempPos + 1] & 0xff) << 8) | ((buffer[tempPos + 2] & 0xff) << 16) | ((buffer[tempPos + 3] & 0xff) << 24)); @@ -2661,7 +2651,7 @@ public abstract class CodedInputStream { @Override public void enableAliasing(boolean enabled) { - // TODO: Ideally we should throw here. Do nothing for backward compatibility. + // TODO(nathanmittler): Ideally we should throw here. Do nothing for backward compatibility. } @Override @@ -2793,8 +2783,7 @@ public abstract class CodedInputStream { // Here we should refill the buffer as many bytes as possible. int bytesRead = - read( - input, + input.read( buffer, bufferSize, Math.min( @@ -2833,7 +2822,7 @@ public abstract class CodedInputStream { pos = tempPos + size; return Arrays.copyOfRange(buffer, tempPos, tempPos + size); } else { - // TODO: Do we want to protect from malicious input streams here? + // TODO(dweis): Do we want to protect from malicious input streams here? return readRawBytesSlowPath(size, /* ensureNoLeakedReferences= */ false); } } @@ -2888,8 +2877,8 @@ public abstract class CodedInputStream { /** * Attempts to read the data in one byte array when it's safe to do. Returns null if the size to * read is too large and needs to be allocated in smaller chunks for security reasons. - * - *

Returns a byte[] that may have escaped to user code via InputStream APIs. + * + * Returns a byte[] that may have escaped to user code via InputStream APIs. */ private byte[] readRawBytesSlowPathOneChunk(final int size) throws IOException { if (size == 0) { @@ -2915,8 +2904,8 @@ public abstract class CodedInputStream { final int bufferedBytes = bufferSize - pos; // Determine the number of bytes we need to read from the input stream. int sizeLeft = size - bufferedBytes; - // TODO: Consider using a value larger than DEFAULT_BUFFER_SIZE. - if (sizeLeft < DEFAULT_BUFFER_SIZE || sizeLeft <= available(input)) { + // TODO(nathanmittler): Consider using a value larger than DEFAULT_BUFFER_SIZE. + if (sizeLeft < DEFAULT_BUFFER_SIZE || sizeLeft <= input.available()) { // Either the bytes we need are known to be available, or the required buffer is // within an allowed threshold - go ahead and allocate the buffer now. final byte[] bytes = new byte[size]; @@ -2930,7 +2919,7 @@ public abstract class CodedInputStream { // Fill the remaining bytes from the input stream. int tempPos = bufferedBytes; while (tempPos < bytes.length) { - int n = read(input, bytes, tempPos, size - tempPos); + int n = input.read(bytes, tempPos, size - tempPos); if (n == -1) { throw InvalidProtocolBufferException.truncatedMessage(); } @@ -2957,10 +2946,10 @@ public abstract class CodedInputStream { // by allocating and reading only a small chunk at a time, so that the // malicious message must actually *be* extremely large to cause // problems. Meanwhile, we limit the allowed size of a message elsewhere. - final List chunks = new ArrayList<>(); + final List chunks = new ArrayList(); while (sizeLeft > 0) { - // TODO: Consider using a value larger than DEFAULT_BUFFER_SIZE. + // TODO(nathanmittler): Consider using a value larger than DEFAULT_BUFFER_SIZE. final byte[] chunk = new byte[Math.min(sizeLeft, DEFAULT_BUFFER_SIZE)]; int tempPos = 0; while (tempPos < chunk.length) { @@ -3058,7 +3047,7 @@ public abstract class CodedInputStream { try { while (totalSkipped < size) { int toSkip = size - totalSkipped; - long skipped = skip(input, toSkip); + long skipped = input.skip(toSkip); if (skipped < 0 || skipped > toSkip) { throw new IllegalStateException( input.getClass() @@ -3104,16 +3093,16 @@ public abstract class CodedInputStream { */ private static final class IterableDirectByteBufferDecoder extends CodedInputStream { /** The object that need to decode. */ - private final Iterable input; + private Iterable input; /** The {@link Iterator} with type {@link ByteBuffer} of {@code input} */ - private final Iterator iterator; + private Iterator iterator; /** The current ByteBuffer; */ private ByteBuffer currentByteBuffer; /** - * If {@code true}, indicates that all the buffers are backing a {@link ByteString} and are + * If {@code true}, indicates that all the buffer are backing a {@link ByteString} and are * therefore considered to be an immutable input source. */ - private final boolean immutable; + private boolean immutable; /** * If {@code true}, indicates that calls to read {@link ByteString} or {@code byte[]} * may return slices of the underlying buffer, rather than copies. @@ -3249,33 +3238,33 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_VARINT: { long value = readInt64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeUInt64NoTag(value); return true; } case WireFormat.WIRETYPE_FIXED64: { long value = readRawLittleEndian64(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed64NoTag(value); return true; } case WireFormat.WIRETYPE_LENGTH_DELIMITED: { ByteString value = readBytes(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeBytesNoTag(value); return true; } case WireFormat.WIRETYPE_START_GROUP: { - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); skipMessage(output); int endtag = WireFormat.makeTag( WireFormat.getTagFieldNumber(tag), WireFormat.WIRETYPE_END_GROUP); checkLastTagWas(endtag); - output.writeUInt32NoTag(endtag); + output.writeRawVarint32(endtag); return true; } case WireFormat.WIRETYPE_END_GROUP: @@ -3285,7 +3274,7 @@ public abstract class CodedInputStream { case WireFormat.WIRETYPE_FIXED32: { int value = readRawLittleEndian32(); - output.writeUInt32NoTag(tag); + output.writeRawVarint32(tag); output.writeFixed32NoTag(value); return true; } @@ -3366,7 +3355,7 @@ public abstract class CodedInputStream { currentByteBufferPos += size; return result; } else if (size > 0 && size <= remaining()) { - // TODO: To use an underlying bytes[] instead of allocating a new bytes[] + // TODO(yilunchong): To use an underlying bytes[] instead of allocating a new bytes[] byte[] bytes = new byte[size]; readRawBytesTo(bytes, 0, size); String result = new String(bytes, UTF_8); @@ -3412,20 +3401,25 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); --recursionDepth; } + @Override public T readGroup( final int fieldNumber, final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); @@ -3445,31 +3439,30 @@ public abstract class CodedInputStream { final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException { final int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; builder.mergeFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); } + @Override public T readMessage( final Parser parser, final ExtensionRegistryLite extensionRegistry) throws IOException { int length = readRawVarint32(); - checkRecursionLimit(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } final int oldLimit = pushLimit(length); ++recursionDepth; T result = parser.parsePartialFrom(this, extensionRegistry); checkLastTagWas(0); --recursionDepth; - if (getBytesUntilLimit() != 0) { - throw InvalidProtocolBufferException.truncatedMessage(); - } popLimit(oldLimit); return result; } @@ -3484,31 +3477,16 @@ public abstract class CodedInputStream { currentByteBufferPos += size; return result; } else { - byte[] bytes = new byte[size]; + byte[] bytes; + bytes = new byte[size]; UnsafeUtil.copyMemory(currentByteBufferPos, bytes, 0, size); currentByteBufferPos += size; return ByteString.wrap(bytes); } } else if (size > 0 && size <= remaining()) { - if (immutable && enableAliasing) { - ArrayList byteStrings = new ArrayList<>(); - int l = size; - while (l > 0) { - if (currentRemaining() == 0) { - getNextByteBuffer(); - } - int bytesToCopy = Math.min(l, (int) currentRemaining()); - int idx = (int) (currentByteBufferPos - currentAddress); - byteStrings.add(ByteString.wrap(slice(idx, idx + bytesToCopy))); - l -= bytesToCopy; - currentByteBufferPos += bytesToCopy; - } - return ByteString.copyFrom(byteStrings); - } else { - byte[] temp = new byte[size]; - readRawBytesTo(temp, 0, size); - return ByteString.wrap(temp); - } + byte[] temp = new byte[size]; + readRawBytesTo(temp, 0, size); + return ByteString.wrap(temp); } if (size == 0) { @@ -3705,7 +3683,7 @@ public abstract class CodedInputStream { if (currentRemaining() >= FIXED32_SIZE) { long tempPos = currentByteBufferPos; currentByteBufferPos += FIXED32_SIZE; - return ((UnsafeUtil.getByte(tempPos) & 0xff) + return (((UnsafeUtil.getByte(tempPos) & 0xff)) | ((UnsafeUtil.getByte(tempPos + 1) & 0xff) << 8) | ((UnsafeUtil.getByte(tempPos + 2) & 0xff) << 16) | ((UnsafeUtil.getByte(tempPos + 3) & 0xff) << 24)); @@ -3721,7 +3699,7 @@ public abstract class CodedInputStream { if (currentRemaining() >= FIXED64_SIZE) { long tempPos = currentByteBufferPos; currentByteBufferPos += FIXED64_SIZE; - return ((UnsafeUtil.getByte(tempPos) & 0xffL) + return (((UnsafeUtil.getByte(tempPos) & 0xffL)) | ((UnsafeUtil.getByte(tempPos + 1) & 0xffL) << 8) | ((UnsafeUtil.getByte(tempPos + 2) & 0xffL) << 16) | ((UnsafeUtil.getByte(tempPos + 3) & 0xffL) << 24) @@ -3842,6 +3820,11 @@ public abstract class CodedInputStream { * Try to get raw bytes from {@code input} with the size of {@code length} and copy to {@code * bytes} array. If the size is bigger than the number of remaining bytes in the input, then * throw {@code truncatedMessage} exception. + * + * @param bytes + * @param offset + * @param length + * @throws IOException */ private void readRawBytesTo(byte[] bytes, int offset, final int length) throws IOException { if (length >= 0 && length <= remaining()) { @@ -3927,18 +3910,15 @@ public abstract class CodedInputStream { private ByteBuffer slice(int begin, int end) throws IOException { int prevPos = currentByteBuffer.position(); int prevLimit = currentByteBuffer.limit(); - // View ByteBuffer as Buffer to avoid cross-Java version issues. - // See https://issues.apache.org/jira/browse/MRESOLVER-85 - Buffer asBuffer = currentByteBuffer; try { - asBuffer.position(begin); - asBuffer.limit(end); + ((Buffer) currentByteBuffer).position(begin); + ((Buffer) currentByteBuffer).limit(end); return currentByteBuffer.slice(); } catch (IllegalArgumentException e) { throw InvalidProtocolBufferException.truncatedMessage(); } finally { - asBuffer.position(prevPos); - asBuffer.limit(prevLimit); + ((Buffer) currentByteBuffer).position(prevPos); + ((Buffer) currentByteBuffer).limit(prevLimit); } } } diff --git a/java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java b/java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java index 7f4313eb990a4fef6b0ccf1fcff6f12c1dbabc57..1d992d75d068083668d3834880fbc5f852eb5501 100644 --- a/java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java +++ b/java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -21,7 +44,6 @@ import java.util.List; import java.util.Map; /** An adapter between the {@link Reader} interface and {@link CodedInputStream}. */ -@CheckReturnValue @ExperimentalApi final class CodedInputStreamReader implements Reader { private static final int FIXED32_MULTIPLE_MASK = FIXED32_SIZE - 1; @@ -143,6 +165,7 @@ final class CodedInputStreamReader implements Reader { return input.readStringRequireUtf8(); } + @SuppressWarnings("unchecked") @Override public T readMessage(Class clazz, ExtensionRegistryLite extensionRegistry) throws IOException { @@ -158,7 +181,7 @@ final class CodedInputStreamReader implements Reader { return readMessage(schema, extensionRegistry); } - @Deprecated + @SuppressWarnings("unchecked") @Override public T readGroup(Class clazz, ExtensionRegistryLite extensionRegistry) throws IOException { @@ -166,7 +189,7 @@ final class CodedInputStreamReader implements Reader { return readGroup(Protobuf.getInstance().schemaFor(clazz), extensionRegistry); } - @Deprecated + @SuppressWarnings("unchecked") @Override public T readGroupBySchemaWithCheck(Schema schema, ExtensionRegistryLite extensionRegistry) throws IOException { @@ -819,7 +842,6 @@ final class CodedInputStreamReader implements Reader { } } - @Deprecated @Override public void readGroupList( List target, Class targetType, ExtensionRegistryLite extensionRegistry) @@ -828,7 +850,6 @@ final class CodedInputStreamReader implements Reader { readGroupList(target, schema, extensionRegistry); } - @Deprecated @Override public void readGroupList( List target, Schema schema, ExtensionRegistryLite extensionRegistry) @@ -1314,7 +1335,7 @@ final class CodedInputStreamReader implements Reader { case UINT64: return readUInt64(); default: - throw new IllegalArgumentException("unsupported field type."); + throw new RuntimeException("unsupported field type."); } } diff --git a/java/core/src/main/java/com/google/protobuf/CodedOutputStream.java b/java/core/src/main/java/com/google/protobuf/CodedOutputStream.java index 37bb44a057804059da79535c583aa051e3c01442..a9192d33e44af1296d702770ab3923c081df69fb 100644 --- a/java/core/src/main/java/com/google/protobuf/CodedOutputStream.java +++ b/java/core/src/main/java/com/google/protobuf/CodedOutputStream.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -433,7 +456,7 @@ public abstract class CodedOutputStream extends ByteOutput { } /** Write a {@code string} field to the stream. */ - // TODO: Document behavior on ill-formed UTF-16 input. + // TODO(dweis): Document behavior on ill-formed UTF-16 input. // Abstract to avoid overhead of additional virtual method calls. public abstract void writeStringNoTag(String value) throws IOException; @@ -669,7 +692,7 @@ public abstract class CodedOutputStream extends ByteOutput { } /** - * Compute the number of bytes that would be needed to encode a lazily parsed MessageSet + * Compute the number of bytes that would be needed to encode an lazily parsed MessageSet * extension field to the stream. For historical reasons, the wire format differs from normal * fields. */ @@ -818,7 +841,7 @@ public abstract class CodedOutputStream extends ByteOutput { try { length = Utf8.encodedLength(value); } catch (UnpairedSurrogateException e) { - // TODO: Consider using nio Charset methods instead. + // TODO(dweis): Consider using nio Charset methods instead. final byte[] bytes = value.getBytes(Internal.UTF_8); length = bytes.length; } @@ -966,13 +989,15 @@ public abstract class CodedOutputStream extends ByteOutput { // Unfortunately there does not appear to be any way to tell Java to encode // UTF-8 directly into our buffer, so we have to let it create its own byte // array and then copy. - // TODO: Consider using nio Charset methods instead. + // TODO(dweis): Consider using nio Charset methods instead. final byte[] bytes = value.getBytes(Internal.UTF_8); try { writeUInt32NoTag(bytes.length); writeLazy(bytes, 0, bytes.length); } catch (IndexOutOfBoundsException e) { throw new OutOfSpaceException(e); + } catch (OutOfSpaceException e) { + throw e; } } @@ -1031,7 +1056,7 @@ public abstract class CodedOutputStream extends ByteOutput { */ @Deprecated public static int computeGroupSize(final int fieldNumber, final MessageLite value) { - return computeTagSize(fieldNumber) * 2 + value.getSerializedSize(); + return computeTagSize(fieldNumber) * 2 + computeGroupSizeNoTag(value); } /** @@ -1047,7 +1072,6 @@ public abstract class CodedOutputStream extends ByteOutput { /** Compute the number of bytes that would be needed to encode a {@code group} field. */ @Deprecated - @InlineMe(replacement = "value.getSerializedSize()") public static int computeGroupSizeNoTag(final MessageLite value) { return value.getSerializedSize(); } @@ -1065,7 +1089,6 @@ public abstract class CodedOutputStream extends ByteOutput { * @deprecated use {@link #writeUInt32NoTag} instead. */ @Deprecated - @InlineMe(replacement = "this.writeUInt32NoTag(value)") public final void writeRawVarint32(int value) throws IOException { writeUInt32NoTag(value); } @@ -1076,7 +1099,6 @@ public abstract class CodedOutputStream extends ByteOutput { * @deprecated use {@link #writeUInt64NoTag} instead. */ @Deprecated - @InlineMe(replacement = "this.writeUInt64NoTag(value)") public final void writeRawVarint64(long value) throws IOException { writeUInt64NoTag(value); } @@ -1088,9 +1110,6 @@ public abstract class CodedOutputStream extends ByteOutput { * @deprecated use {@link #computeUInt32SizeNoTag(int)} instead. */ @Deprecated - @InlineMe( - replacement = "CodedOutputStream.computeUInt32SizeNoTag(value)", - imports = "com.google.protobuf.CodedOutputStream") public static int computeRawVarint32Size(final int value) { return computeUInt32SizeNoTag(value); } @@ -1101,9 +1120,6 @@ public abstract class CodedOutputStream extends ByteOutput { * @deprecated use {@link #computeUInt64SizeNoTag(long)} instead. */ @Deprecated - @InlineMe( - replacement = "CodedOutputStream.computeUInt64SizeNoTag(value)", - imports = "com.google.protobuf.CodedOutputStream") public static int computeRawVarint64Size(long value) { return computeUInt64SizeNoTag(value); } @@ -1114,7 +1130,6 @@ public abstract class CodedOutputStream extends ByteOutput { * @deprecated Use {@link #writeFixed32NoTag} instead. */ @Deprecated - @InlineMe(replacement = "this.writeFixed32NoTag(value)") public final void writeRawLittleEndian32(final int value) throws IOException { writeFixed32NoTag(value); } @@ -1125,7 +1140,6 @@ public abstract class CodedOutputStream extends ByteOutput { * @deprecated Use {@link #writeFixed64NoTag} instead. */ @Deprecated - @InlineMe(replacement = "this.writeFixed64NoTag(value)") public final void writeRawLittleEndian64(final long value) throws IOException { writeFixed64NoTag(value); } @@ -1248,7 +1262,7 @@ public abstract class CodedOutputStream extends ByteOutput { write(value.array(), value.arrayOffset(), value.capacity()); } else { ByteBuffer duplicated = value.duplicate(); - Java8Compatibility.clear(duplicated); + duplicated.clear(); write(duplicated); } } @@ -1320,19 +1334,49 @@ public abstract class CodedOutputStream extends ByteOutput { @Override public final void writeUInt32NoTag(int value) throws IOException { - try { - while (true) { - if ((value & ~0x7F) == 0) { - buffer[position++] = (byte) value; - return; - } else { - buffer[position++] = (byte) ((value & 0x7F) | 0x80); - value >>>= 7; + if (HAS_UNSAFE_ARRAY_OPERATIONS + && !Android.isOnAndroidDevice() + && spaceLeft() >= MAX_VARINT32_SIZE) { + if ((value & ~0x7F) == 0) { + UnsafeUtil.putByte(buffer, position++, (byte) value); + return; + } + UnsafeUtil.putByte(buffer, position++, (byte) (value | 0x80)); + value >>>= 7; + if ((value & ~0x7F) == 0) { + UnsafeUtil.putByte(buffer, position++, (byte) value); + return; + } + UnsafeUtil.putByte(buffer, position++, (byte) (value | 0x80)); + value >>>= 7; + if ((value & ~0x7F) == 0) { + UnsafeUtil.putByte(buffer, position++, (byte) value); + return; + } + UnsafeUtil.putByte(buffer, position++, (byte) (value | 0x80)); + value >>>= 7; + if ((value & ~0x7F) == 0) { + UnsafeUtil.putByte(buffer, position++, (byte) value); + return; + } + UnsafeUtil.putByte(buffer, position++, (byte) (value | 0x80)); + value >>>= 7; + UnsafeUtil.putByte(buffer, position++, (byte) value); + } else { + try { + while (true) { + if ((value & ~0x7F) == 0) { + buffer[position++] = (byte) value; + return; + } else { + buffer[position++] = (byte) ((value & 0x7F) | 0x80); + value >>>= 7; + } } + } catch (IndexOutOfBoundsException e) { + throw new OutOfSpaceException( + String.format("Pos: %d, limit: %d, len: %d", position, limit, 1), e); } - } catch (IndexOutOfBoundsException e) { - throw new OutOfSpaceException( - String.format("Pos: %d, limit: %d, len: %d", position, limit, 1), e); } } @@ -1456,7 +1500,7 @@ public abstract class CodedOutputStream extends ByteOutput { // Roll back the change - we fall back to inefficient path. position = oldPosition; - // TODO: We should throw an IOException here instead. + // TODO(nathanmittler): We should throw an IOException here instead. inefficientWriteStringNoTag(value, e); } catch (IndexOutOfBoundsException e) { throw new OutOfSpaceException(e); @@ -1499,7 +1543,7 @@ public abstract class CodedOutputStream extends ByteOutput { @Override public void flush() { // Update the position on the buffer. - Java8Compatibility.position(byteBuffer, initialPosition + getTotalBytesWritten()); + byteBuffer.position(initialPosition + getTotalBytesWritten()); } } @@ -1661,7 +1705,7 @@ public abstract class CodedOutputStream extends ByteOutput { write(value.array(), value.arrayOffset(), value.capacity()); } else { ByteBuffer duplicated = value.duplicate(); - Java8Compatibility.clear(duplicated); + duplicated.clear(); write(duplicated); } } @@ -1771,18 +1815,18 @@ public abstract class CodedOutputStream extends ByteOutput { // Save the current position and increment past the length field. We'll come back // and write the length field after the encoding is complete. final int startOfBytes = buffer.position() + minLengthVarIntSize; - Java8Compatibility.position(buffer, startOfBytes); + buffer.position(startOfBytes); // Encode the string. encode(value); // Now go back to the beginning and write the length. int endOfBytes = buffer.position(); - Java8Compatibility.position(buffer, startPos); + buffer.position(startPos); writeUInt32NoTag(endOfBytes - startOfBytes); // Reposition the buffer past the written data. - Java8Compatibility.position(buffer, endOfBytes); + buffer.position(endOfBytes); } else { final int length = Utf8.encodedLength(value); writeUInt32NoTag(length); @@ -1790,9 +1834,9 @@ public abstract class CodedOutputStream extends ByteOutput { } } catch (UnpairedSurrogateException e) { // Roll back the change and convert to an IOException. - Java8Compatibility.position(buffer, startPos); + buffer.position(startPos); - // TODO: We should throw an IOException here instead. + // TODO(nathanmittler): We should throw an IOException here instead. inefficientWriteStringNoTag(value, e); } catch (IllegalArgumentException e) { // Thrown by buffer.position() if out of range. @@ -1803,7 +1847,7 @@ public abstract class CodedOutputStream extends ByteOutput { @Override public void flush() { // Update the position of the original buffer. - Java8Compatibility.position(originalBuffer, buffer.position()); + originalBuffer.position(buffer.position()); } @Override @@ -1991,7 +2035,7 @@ public abstract class CodedOutputStream extends ByteOutput { write(value.array(), value.arrayOffset(), value.capacity()); } else { ByteBuffer duplicated = value.duplicate(); - Java8Compatibility.clear(duplicated); + duplicated.clear(); write(duplicated); } } @@ -2127,7 +2171,7 @@ public abstract class CodedOutputStream extends ByteOutput { // Save the current position and increment past the length field. We'll come back // and write the length field after the encoding is complete. int stringStart = bufferPos(position) + minLengthVarIntSize; - Java8Compatibility.position(buffer, stringStart); + buffer.position(stringStart); // Encode the string. Utf8.encodeUtf8(value, buffer); @@ -2151,7 +2195,7 @@ public abstract class CodedOutputStream extends ByteOutput { position = prevPos; repositionBuffer(position); - // TODO: We should throw an IOException here instead. + // TODO(nathanmittler): We should throw an IOException here instead. inefficientWriteStringNoTag(value, e); } catch (IllegalArgumentException e) { // Thrown by buffer.position() if out of range. @@ -2164,7 +2208,7 @@ public abstract class CodedOutputStream extends ByteOutput { @Override public void flush() { // Update the position of the original buffer. - Java8Compatibility.position(originalBuffer, bufferPos(position)); + originalBuffer.position(bufferPos(position)); } @Override @@ -2178,7 +2222,7 @@ public abstract class CodedOutputStream extends ByteOutput { } private void repositionBuffer(long pos) { - Java8Compatibility.position(buffer, bufferPos(pos)); + buffer.position(bufferPos(pos)); } private int bufferPos(long pos) { @@ -2455,7 +2499,7 @@ public abstract class CodedOutputStream extends ByteOutput { write(value.array(), value.arrayOffset(), value.capacity()); } else { ByteBuffer duplicated = value.duplicate(); - Java8Compatibility.clear(duplicated); + duplicated.clear(); write(duplicated); } } @@ -2600,7 +2644,7 @@ public abstract class CodedOutputStream extends ByteOutput { totalBytesWritten -= position - oldPosition; position = oldPosition; - // TODO: We should throw an IOException here instead. + // TODO(nathanmittler): We should throw an IOException here instead. inefficientWriteStringNoTag(value, e); } catch (IndexOutOfBoundsException e) { throw new OutOfSpaceException(e); @@ -2769,7 +2813,7 @@ public abstract class CodedOutputStream extends ByteOutput { write(value.array(), value.arrayOffset(), value.capacity()); } else { ByteBuffer duplicated = value.duplicate(); - Java8Compatibility.clear(duplicated); + duplicated.clear(); write(duplicated); } } diff --git a/java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java b/java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java index 6c060cc3aba40081183b247ca3e4adbef6893e16..0d1983cb07b1ca2206ddbfdaf40d58670d8d485c 100644 --- a/java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java +++ b/java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -16,7 +39,6 @@ import java.util.List; import java.util.Map; /** An adapter between the {@link Writer} interface and {@link CodedOutputStream}. */ -@CheckReturnValue @ExperimentalApi final class CodedOutputStreamWriter implements Writer { private final CodedOutputStream output; @@ -132,7 +154,6 @@ final class CodedOutputStreamWriter implements Writer { output.writeMessage(fieldNumber, (MessageLite) value, schema); } - @Deprecated @Override public void writeGroup(int fieldNumber, Object value) throws IOException { output.writeGroup(fieldNumber, (MessageLite) value); @@ -143,13 +164,11 @@ final class CodedOutputStreamWriter implements Writer { output.writeGroup(fieldNumber, (MessageLite) value, schema); } - @Deprecated @Override public void writeStartGroup(int fieldNumber) throws IOException { output.writeTag(fieldNumber, WireFormat.WIRETYPE_START_GROUP); } - @Deprecated @Override public void writeEndGroup(int fieldNumber) throws IOException { output.writeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP); @@ -542,7 +561,6 @@ final class CodedOutputStreamWriter implements Writer { } } - @Deprecated @Override public void writeGroupList(int fieldNumber, List value) throws IOException { for (int i = 0; i < value.size(); ++i) { diff --git a/java/core/src/main/java/com/google/protobuf/CompileTimeConstant.java b/java/core/src/main/java/com/google/protobuf/CompileTimeConstant.java deleted file mode 100644 index fc599b2630213a505208676a3acad1ccf71eaf58..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/CompileTimeConstant.java +++ /dev/null @@ -1,24 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import static java.lang.annotation.RetentionPolicy.CLASS; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Annotation for method parameter and class field declarations, which denotes that corresponding - * actual values must be compile-time constant expressions. - */ -@Documented -@Retention(CLASS) -@Target({ElementType.PARAMETER, ElementType.FIELD}) -@interface CompileTimeConstant {} diff --git a/java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java b/java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java index 82109690355f996cce3269d052c40d3889585d15..21ded52d95aee36dbb7c412c3b209579391e1b3b 100644 --- a/java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java +++ b/java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java @@ -1,26 +1,48 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.protobuf.FieldInfo.forExplicitPresenceField; import static com.google.protobuf.FieldInfo.forField; import static com.google.protobuf.FieldInfo.forFieldWithEnumVerifier; -import static com.google.protobuf.FieldInfo.forLegacyRequiredField; import static com.google.protobuf.FieldInfo.forMapField; import static com.google.protobuf.FieldInfo.forOneofMemberField; import static com.google.protobuf.FieldInfo.forPackedField; import static com.google.protobuf.FieldInfo.forPackedFieldWithEnumVerifier; +import static com.google.protobuf.FieldInfo.forProto2OptionalField; +import static com.google.protobuf.FieldInfo.forProto2RequiredField; import static com.google.protobuf.FieldInfo.forRepeatedMessageField; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.Descriptors.FieldDescriptor.Type; -import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.OneofDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -39,31 +61,8 @@ import java.util.concurrent.ConcurrentHashMap; final class DescriptorMessageInfoFactory implements MessageInfoFactory { private static final String GET_DEFAULT_INSTANCE_METHOD_NAME = "getDefaultInstance"; private static final DescriptorMessageInfoFactory instance = new DescriptorMessageInfoFactory(); - - /** - * Names that should be avoided (in UpperCamelCase format). Using them causes the compiler to - * generate accessors whose names collide with methods defined in base classes. - * - *

Keep this list in sync with kForbiddenWordList in - * src/google/protobuf/compiler/java/java_helpers.cc - */ private static final Set specialFieldNames = - new HashSet<>( - Arrays.asList( - // java.lang.Object: - "Class", - // com.google.protobuf.MessageLiteOrBuilder: - "DefaultInstanceForType", - // com.google.protobuf.MessageLite: - "ParserForType", - "SerializedSize", - // com.google.protobuf.MessageOrBuilder: - "AllFields", - "DescriptorForType", - "InitializationErrorString", - "UnknownFields", - // obsolete. kept for backwards compatibility of generated code - "CachedSize")); + new HashSet<>(Arrays.asList("cached_size", "serialized_size", "class")); // Disallow construction - it's a singleton. private DescriptorMessageInfoFactory() {} @@ -100,157 +99,18 @@ final class DescriptorMessageInfoFactory implements MessageInfoFactory { return getDefaultInstance(messageType).getDescriptorForType(); } - private static ProtoSyntax convertSyntax(FileDescriptor.Syntax syntax) { - switch (syntax) { + private static MessageInfo convert(Class messageType, Descriptor messageDescriptor) { + switch (messageDescriptor.getFile().getSyntax()) { case PROTO2: - return ProtoSyntax.PROTO2; + return convertProto2(messageType, messageDescriptor); case PROTO3: - return ProtoSyntax.PROTO3; - case EDITIONS: - return ProtoSyntax.EDITIONS; + return convertProto3(messageType, messageDescriptor); default: - throw new IllegalArgumentException("Unsupported syntax: " + syntax); + throw new IllegalArgumentException( + "Unsupported syntax: " + messageDescriptor.getFile().getSyntax()); } } - private static MessageInfo convert(Class messageType, Descriptor messageDescriptor) { - List fieldDescriptors = messageDescriptor.getFields(); - StructuralMessageInfo.Builder builder = - StructuralMessageInfo.newBuilder(fieldDescriptors.size()); - builder.withDefaultInstance(getDefaultInstance(messageType)); - builder.withSyntax(convertSyntax(messageDescriptor.getFile().getSyntax())); - builder.withMessageSetWireFormat(messageDescriptor.getOptions().getMessageSetWireFormat()); - - OneofState oneofState = new OneofState(); - // Performance optimization to cache presence bits across field iterations. - int bitFieldIndex = 0; - int presenceMask = 1; - Field bitField = null; - - // Fields in the descriptor are ordered by the index position in which they appear in the - // proto file. This is the same order used to determine the presence mask used in the - // bitFields. So to determine the appropriate presence mask to be used for a field, we simply - // need to shift the presence mask whenever a presence-checked field is encountered. - for (int i = 0; i < fieldDescriptors.size(); ++i) { - final FieldDescriptor fd = fieldDescriptors.get(i); - boolean enforceUtf8 = fd.needsUtf8Check(); - Internal.EnumVerifier enumVerifier = null; - // Enum verifier for closed enums. - if (fd.getJavaType() == Descriptors.FieldDescriptor.JavaType.ENUM - && fd.legacyEnumFieldTreatedAsClosed()) { - enumVerifier = - new Internal.EnumVerifier() { - @Override - public boolean isInRange(int number) { - return fd.getEnumType().findValueByNumber(number) != null; - } - }; - } - if (fd.getRealContainingOneof() != null) { - // Build a oneof member field for non-synthetic oneofs. - builder.withField(buildOneofMember(messageType, fd, oneofState, enforceUtf8, enumVerifier)); - continue; - } - - Field field = field(messageType, fd); - int number = fd.getNumber(); - FieldType type = getFieldType(fd); - - // Handle field with implicit presence. - if (!fd.hasPresence()) { - FieldInfo fieldImplicitPresence; - if (fd.isMapField()) { - // Map field points to an auto-generated message entry type with the definition: - // message MapEntry { - // K key = 1; - // V value = 2; - // } - final FieldDescriptor valueField = fd.getMessageType().findFieldByNumber(2); - if (valueField.getJavaType() == Descriptors.FieldDescriptor.JavaType.ENUM - && valueField.legacyEnumFieldTreatedAsClosed()) { - enumVerifier = - new Internal.EnumVerifier() { - @Override - public boolean isInRange(int number) { - return valueField.getEnumType().findValueByNumber(number) != null; - } - }; - } - fieldImplicitPresence = - forMapField( - field, - number, - SchemaUtil.getMapDefaultEntry(messageType, fd.getName()), - enumVerifier); - } else if (fd.isRepeated() && fd.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { - fieldImplicitPresence = - forRepeatedMessageField( - field, number, type, getTypeForRepeatedMessageField(messageType, fd)); - } else if (fd.isPacked()) { - if (enumVerifier != null) { - fieldImplicitPresence = - forPackedFieldWithEnumVerifier( - field, number, type, enumVerifier, cachedSizeField(messageType, fd)); - } else { - fieldImplicitPresence = - forPackedField(field, number, type, cachedSizeField(messageType, fd)); - } - } else { - if (enumVerifier != null) { - fieldImplicitPresence = forFieldWithEnumVerifier(field, number, type, enumVerifier); - } else { - fieldImplicitPresence = forField(field, number, type, enforceUtf8); - } - } - builder.withField(fieldImplicitPresence); - continue; - } - - // Handle field with explicit presence. - FieldInfo fieldExplicitPresence; - if (bitField == null) { - // Lazy-create the next bitfield since we know it must exist. - bitField = bitField(messageType, bitFieldIndex); - } - if (fd.isRequired()) { - fieldExplicitPresence = - forLegacyRequiredField( - field, number, type, bitField, presenceMask, enforceUtf8, enumVerifier); - } else { - fieldExplicitPresence = - forExplicitPresenceField( - field, number, type, bitField, presenceMask, enforceUtf8, enumVerifier); - } - builder.withField(fieldExplicitPresence); - // Update the presence mask for the next iteration. If the shift clears out the mask, we - // will go to the next bitField. - presenceMask <<= 1; - if (presenceMask == 0) { - bitField = null; - presenceMask = 1; - bitFieldIndex++; - } - } - - List fieldsToCheckIsInitialized = new ArrayList<>(); - for (int i = 0; i < fieldDescriptors.size(); ++i) { - FieldDescriptor fd = fieldDescriptors.get(i); - if (fd.isRequired() - || (fd.getJavaType() == FieldDescriptor.JavaType.MESSAGE - && needsIsInitializedCheck(fd.getMessageType()))) { - fieldsToCheckIsInitialized.add(fd.getNumber()); - } - } - int[] numbers = new int[fieldsToCheckIsInitialized.size()]; - for (int i = 0; i < fieldsToCheckIsInitialized.size(); i++) { - numbers[i] = fieldsToCheckIsInitialized.get(i); - } - if (numbers.length > 0) { - builder.withCheckInitialized(numbers); - } - return builder.build(); - } - /** * A helper class to determine whether a message type needs to implement {@code isInitialized()}. * @@ -265,8 +125,6 @@ final class DescriptorMessageInfoFactory implements MessageInfoFactory { * *

This class is thread-safe. */ - //

The code is adapted from the C++ implementation: - // https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/compiler/java/java_helpers.h static class IsInitializedCheckAnalyzer { private final Map resultCache = @@ -398,6 +256,191 @@ final class DescriptorMessageInfoFactory implements MessageInfoFactory { return isInitializedCheckAnalyzer.needsIsInitializedCheck(descriptor); } + private static StructuralMessageInfo convertProto2( + Class messageType, Descriptor messageDescriptor) { + List fieldDescriptors = messageDescriptor.getFields(); + StructuralMessageInfo.Builder builder = + StructuralMessageInfo.newBuilder(fieldDescriptors.size()); + builder.withDefaultInstance(getDefaultInstance(messageType)); + builder.withSyntax(ProtoSyntax.PROTO2); + builder.withMessageSetWireFormat(messageDescriptor.getOptions().getMessageSetWireFormat()); + + OneofState oneofState = new OneofState(); + int bitFieldIndex = 0; + int presenceMask = 1; + Field bitField = null; + + // Fields in the descriptor are ordered by the index position in which they appear in the + // proto file. This is the same order used to determine the presence mask used in the + // bitFields. So to determine the appropriate presence mask to be used for a field, we simply + // need to shift the presence mask whenever a presence-checked field is encountered. + for (int i = 0; i < fieldDescriptors.size(); ++i) { + final FieldDescriptor fd = fieldDescriptors.get(i); + boolean enforceUtf8 = fd.getFile().getOptions().getJavaStringCheckUtf8(); + Internal.EnumVerifier enumVerifier = null; + if (fd.getJavaType() == Descriptors.FieldDescriptor.JavaType.ENUM) { + enumVerifier = + new Internal.EnumVerifier() { + @Override + public boolean isInRange(int number) { + return fd.getEnumType().findValueByNumber(number) != null; + } + }; + } + if (fd.getContainingOneof() != null) { + // Build a oneof member field. + builder.withField(buildOneofMember(messageType, fd, oneofState, enforceUtf8, enumVerifier)); + } else { + Field field = field(messageType, fd); + int number = fd.getNumber(); + FieldType type = getFieldType(fd); + + if (fd.isMapField()) { + // Map field points to an auto-generated message entry type with the definition: + // message MapEntry { + // K key = 1; + // V value = 2; + // } + final FieldDescriptor valueField = fd.getMessageType().findFieldByNumber(2); + if (valueField.getJavaType() == Descriptors.FieldDescriptor.JavaType.ENUM) { + enumVerifier = + new Internal.EnumVerifier() { + @Override + public boolean isInRange(int number) { + return valueField.getEnumType().findValueByNumber(number) != null; + } + }; + } + builder.withField( + forMapField( + field, + number, + SchemaUtil.getMapDefaultEntry(messageType, fd.getName()), + enumVerifier)); + continue; + } + + if (fd.isRepeated()) { + // Repeated fields are not presence-checked. + if (enumVerifier != null) { + if (fd.isPacked()) { + builder.withField( + forPackedFieldWithEnumVerifier( + field, number, type, enumVerifier, cachedSizeField(messageType, fd))); + } else { + builder.withField(forFieldWithEnumVerifier(field, number, type, enumVerifier)); + } + } else if (fd.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { + builder.withField( + forRepeatedMessageField( + field, number, type, getTypeForRepeatedMessageField(messageType, fd))); + } else { + if (fd.isPacked()) { + builder.withField( + forPackedField(field, number, type, cachedSizeField(messageType, fd))); + } else { + builder.withField(forField(field, number, type, enforceUtf8)); + } + } + continue; + } + + if (bitField == null) { + // Lazy-create the next bitfield since we know it must exist. + bitField = bitField(messageType, bitFieldIndex); + } + + // It's a presence-checked field. + if (fd.isRequired()) { + builder.withField( + forProto2RequiredField( + field, number, type, bitField, presenceMask, enforceUtf8, enumVerifier)); + } else { + builder.withField( + forProto2OptionalField( + field, number, type, bitField, presenceMask, enforceUtf8, enumVerifier)); + } + } + + // Update the presence mask for the next iteration. If the shift clears out the mask, we will + // go to the next bitField. + presenceMask <<= 1; + if (presenceMask == 0) { + bitField = null; + presenceMask = 1; + bitFieldIndex++; + } + } + + List fieldsToCheckIsInitialized = new ArrayList(); + for (int i = 0; i < fieldDescriptors.size(); ++i) { + FieldDescriptor fd = fieldDescriptors.get(i); + if (fd.isRequired() + || (fd.getJavaType() == FieldDescriptor.JavaType.MESSAGE + && needsIsInitializedCheck(fd.getMessageType()))) { + fieldsToCheckIsInitialized.add(fd.getNumber()); + } + } + int[] numbers = new int[fieldsToCheckIsInitialized.size()]; + for (int i = 0; i < fieldsToCheckIsInitialized.size(); i++) { + numbers[i] = fieldsToCheckIsInitialized.get(i); + } + builder.withCheckInitialized(numbers); + + return builder.build(); + } + + private static StructuralMessageInfo convertProto3( + Class messageType, Descriptor messageDescriptor) { + List fieldDescriptors = messageDescriptor.getFields(); + StructuralMessageInfo.Builder builder = + StructuralMessageInfo.newBuilder(fieldDescriptors.size()); + builder.withDefaultInstance(getDefaultInstance(messageType)); + builder.withSyntax(ProtoSyntax.PROTO3); + + OneofState oneofState = new OneofState(); + boolean enforceUtf8 = true; + for (int i = 0; i < fieldDescriptors.size(); ++i) { + FieldDescriptor fd = fieldDescriptors.get(i); + if (fd.getContainingOneof() != null && !fd.getContainingOneof().isSynthetic()) { + // Build a oneof member field. But only if it is a real oneof, not a proto3 optional + builder.withField(buildOneofMember(messageType, fd, oneofState, enforceUtf8, null)); + continue; + } + if (fd.isMapField()) { + builder.withField( + forMapField( + field(messageType, fd), + fd.getNumber(), + SchemaUtil.getMapDefaultEntry(messageType, fd.getName()), + null)); + continue; + } + if (fd.isRepeated() && fd.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { + builder.withField( + forRepeatedMessageField( + field(messageType, fd), + fd.getNumber(), + getFieldType(fd), + getTypeForRepeatedMessageField(messageType, fd))); + continue; + } + if (fd.isPacked()) { + builder.withField( + forPackedField( + field(messageType, fd), + fd.getNumber(), + getFieldType(fd), + cachedSizeField(messageType, fd))); + } else { + builder.withField( + forField(field(messageType, fd), fd.getNumber(), getFieldType(fd), enforceUtf8)); + } + } + + return builder.build(); + } + /** Builds info for a oneof member field. */ private static FieldInfo buildOneofMember( Class messageType, @@ -550,104 +593,21 @@ final class DescriptorMessageInfoFactory implements MessageInfoFactory { String name = (fd.getType() == FieldDescriptor.Type.GROUP) ? fd.getMessageType().getName() : fd.getName(); - - // convert to UpperCamelCase for comparison to the specialFieldNames - // (which are in UpperCamelCase) - String upperCamelCaseName = snakeCaseToUpperCamelCase(name); - - // Append underscores to match the behavior of the protoc java compiler - final String suffix; - if (specialFieldNames.contains(upperCamelCaseName)) { - // For proto field names that match the specialFieldNames, - // the protoc java compiler appends "__" to the java field name - // to prevent the field's accessor method names from clashing with other methods. - // For example: - // proto field name = "class" - // java field name = "class__" - // accessor method name = "getClass_()" (so that it does not clash with - // Object.getClass()) - suffix = "__"; - } else { - // For other proto field names, - // the protoc java compiler appends "_" to the java field name - // to prevent field names from clashing with java keywords. - // For example: - // proto field name = "int" - // java field name = "int_" (so that it does not clash with int keyword) - // accessor method name = "getInt()" - suffix = "_"; - } - return snakeCaseToLowerCamelCase(name) + suffix; + String suffix = specialFieldNames.contains(name) ? "__" : "_"; + return snakeCaseToCamelCase(name) + suffix; } private static String getCachedSizeFieldName(FieldDescriptor fd) { - return snakeCaseToLowerCamelCase(fd.getName()) + "MemoizedSerializedSize"; - } - - /** - * Converts a snake case string into lower camel case. - * - *

Some examples: - * - *

-   *     snakeCaseToLowerCamelCase("foo_bar") => "fooBar"
-   *     snakeCaseToLowerCamelCase("foo") => "foo"
-   * 
- * - * @param snakeCase the string in snake case to convert - * @return the string converted to camel case, with a lowercase first character - */ - private static String snakeCaseToLowerCamelCase(String snakeCase) { - return snakeCaseToCamelCase(snakeCase, false); - } - - /** - * Converts a snake case string into upper camel case. - * - *

Some examples: - * - *

-   *     snakeCaseToUpperCamelCase("foo_bar") => "FooBar"
-   *     snakeCaseToUpperCamelCase("foo") => "Foo"
-   * 
- * - * @param snakeCase the string in snake case to convert - * @return the string converted to camel case, with an uppercase first character - */ - private static String snakeCaseToUpperCamelCase(String snakeCase) { - return snakeCaseToCamelCase(snakeCase, true); + return snakeCaseToCamelCase(fd.getName()) + "MemoizedSerializedSize"; } /** - * Converts a snake case string into camel case. - * - *

For better readability, prefer calling either {@link #snakeCaseToLowerCamelCase(String)} or - * {@link #snakeCaseToUpperCamelCase(String)}. - * - *

Some examples: - * - *

-   *     snakeCaseToCamelCase("foo_bar", false) => "fooBar"
-   *     snakeCaseToCamelCase("foo_bar", true) => "FooBar"
-   *     snakeCaseToCamelCase("foo", false) => "foo"
-   *     snakeCaseToCamelCase("foo", true) => "Foo"
-   *     snakeCaseToCamelCase("Foo", false) => "foo"
-   *     snakeCaseToCamelCase("fooBar", false) => "fooBar"
-   * 
- * - *

This implementation of this method must exactly match the corresponding function in the - * protocol compiler. Specifically, the {@code UnderscoresToCamelCase} function in {@code - * src/google/protobuf/compiler/java/java_helpers.cc}. - * - * @param snakeCase the string in snake case to convert - * @param capFirst true if the first letter of the returned string should be uppercase. false if - * the first letter of the returned string should be lowercase. - * @return the string converted to camel case, with an uppercase or lowercase first character - * depending on if {@code capFirst} is true or false, respectively + * This method must match exactly with the corresponding function in protocol compiler. See: + * https://github.com/google/protobuf/blob/v3.0.0/src/google/protobuf/compiler/java/java_helpers.cc#L153 */ - private static String snakeCaseToCamelCase(String snakeCase, boolean capFirst) { + private static String snakeCaseToCamelCase(String snakeCase) { StringBuilder sb = new StringBuilder(snakeCase.length() + 1); - boolean capNext = capFirst; + boolean capNext = false; for (int ctr = 0; ctr < snakeCase.length(); ctr++) { char next = snakeCase.charAt(ctr); if (next == '_') { @@ -693,7 +653,7 @@ final class DescriptorMessageInfoFactory implements MessageInfoFactory { /** Constructs the name of the get method for the given field in the proto. */ private static String getterForField(String snakeCase) { - String camelCase = snakeCaseToLowerCamelCase(snakeCase); + String camelCase = snakeCaseToCamelCase(snakeCase); StringBuilder builder = new StringBuilder("get"); // Capitalize the first character in the field name. builder.append(Character.toUpperCase(camelCase.charAt(0))); @@ -719,7 +679,7 @@ final class DescriptorMessageInfoFactory implements MessageInfoFactory { } private static OneofInfo newInfo(Class messageType, OneofDescriptor desc) { - String camelCase = snakeCaseToLowerCamelCase(desc.getName()); + String camelCase = snakeCaseToCamelCase(desc.getName()); String valueFieldName = camelCase + "_"; String caseFieldName = camelCase + "Case_"; diff --git a/java/core/src/main/java/com/google/protobuf/Descriptors.java b/java/core/src/main/java/com/google/protobuf/Descriptors.java index fb9b661bb030ba8e7d403938887d93d2527cc949..c30b00ddf730a0645476463efaf7c572f0eb4fe4 100644 --- a/java/core/src/main/java/com/google/protobuf/Descriptors.java +++ b/java/core/src/main/java/com/google/protobuf/Descriptors.java @@ -1,16 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import static com.google.protobuf.Internal.checkNotNull; import com.google.protobuf.DescriptorProtos.DescriptorProto; -import com.google.protobuf.DescriptorProtos.Edition; import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; import com.google.protobuf.DescriptorProtos.EnumOptions; import com.google.protobuf.DescriptorProtos.EnumValueDescriptorProto; @@ -27,17 +49,16 @@ import com.google.protobuf.DescriptorProtos.OneofOptions; import com.google.protobuf.DescriptorProtos.ServiceDescriptorProto; import com.google.protobuf.DescriptorProtos.ServiceOptions; import com.google.protobuf.Descriptors.FileDescriptor.Syntax; -import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; -import java.util.IdentityHashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.WeakHashMap; import java.util.logging.Logger; /** @@ -56,16 +77,8 @@ import java.util.logging.Logger; * * @author kenton@google.com Kenton Varda */ -@CheckReturnValue public final class Descriptors { private static final Logger logger = Logger.getLogger(Descriptors.class.getName()); - private static final int[] EMPTY_INT_ARRAY = new int[0]; - private static final Descriptor[] EMPTY_DESCRIPTORS = new Descriptor[0]; - private static final FieldDescriptor[] EMPTY_FIELD_DESCRIPTORS = new FieldDescriptor[0]; - private static final EnumDescriptor[] EMPTY_ENUM_DESCRIPTORS = new EnumDescriptor[0]; - private static final ServiceDescriptor[] EMPTY_SERVICE_DESCRIPTORS = new ServiceDescriptor[0]; - private static final OneofDescriptor[] EMPTY_ONEOF_DESCRIPTORS = new OneofDescriptor[0]; - /** * Describes a {@code .proto} file, including everything defined within. That includes, in * particular, descriptors for all the messages and file descriptors for all other imported {@code @@ -140,13 +153,10 @@ public final class Descriptors { } /** The syntax of the .proto file. */ - @Deprecated - public - enum Syntax { + public enum Syntax { UNKNOWN("unknown"), PROTO2("proto2"), - PROTO3("proto3"), - EDITIONS("editions"); + PROTO3("proto3"); Syntax(String name) { this.name = name; @@ -156,45 +166,13 @@ public final class Descriptors { } /** Get the syntax of the .proto file. */ - @Deprecated - public - Syntax getSyntax() { + public Syntax getSyntax() { if (Syntax.PROTO3.name.equals(proto.getSyntax())) { return Syntax.PROTO3; - } else if (Syntax.EDITIONS.name.equals(proto.getSyntax())) { - return Syntax.EDITIONS; } return Syntax.PROTO2; } - /** Get the edition of the .proto file. */ - public Edition getEdition() { - return proto.getEdition(); - } - - /** Gets the name of the edition as specified in the .proto file. */ - public String getEditionName() { - if (proto.getEdition().equals(Edition.EDITION_UNKNOWN)) { - return ""; - } - return proto.getEdition().name().substring("EDITION_".length()); - } - - public void copyHeadingTo(FileDescriptorProto.Builder protoBuilder) { - protoBuilder.setName(getName()).setSyntax(getSyntax().name); - if (!getPackage().isEmpty()) { - protoBuilder.setPackage(getPackage()); - } - - if (getSyntax().equals(Syntax.EDITIONS)) { - protoBuilder.setEdition(getEdition()); - } - - if (!getOptions().equals(FileOptions.getDefaultInstance())) { - protoBuilder.setOptions(getOptions()); - } - } - /** * Find a message type in the file by name. Does not find nested types. * @@ -212,7 +190,7 @@ public final class Descriptors { name = packageName + '.' + name; } final GenericDescriptor result = pool.findSymbol(name); - if (result instanceof Descriptor && result.getFile() == this) { + if (result != null && result instanceof Descriptor && result.getFile() == this) { return (Descriptor) result; } else { return null; @@ -236,7 +214,7 @@ public final class Descriptors { name = packageName + '.' + name; } final GenericDescriptor result = pool.findSymbol(name); - if (result instanceof EnumDescriptor && result.getFile() == this) { + if (result != null && result instanceof EnumDescriptor && result.getFile() == this) { return (EnumDescriptor) result; } else { return null; @@ -260,7 +238,7 @@ public final class Descriptors { name = packageName + '.' + name; } final GenericDescriptor result = pool.findSymbol(name); - if (result instanceof ServiceDescriptor && result.getFile() == this) { + if (result != null && result instanceof ServiceDescriptor && result.getFile() == this) { return (ServiceDescriptor) result; } else { return null; @@ -282,7 +260,7 @@ public final class Descriptors { name = packageName + '.' + name; } final GenericDescriptor result = pool.findSymbol(name); - if (result instanceof FieldDescriptor && result.getFile() == this) { + if (result != null && result instanceof FieldDescriptor && result.getFile() == this) { return (FieldDescriptor) result; } else { return null; @@ -292,13 +270,14 @@ public final class Descriptors { /** * Construct a {@code FileDescriptor}. * - * @param proto the protocol message form of the FileDescriptort - * @param dependencies {@code FileDescriptor}s corresponding to all of the file's dependencies + * @param proto The protocol message form of the FileDescriptor. + * @param dependencies {@code FileDescriptor}s corresponding to all of the file's dependencies. * @throws DescriptorValidationException {@code proto} is not a valid descriptor. This can occur - * for a number of reasons; for instance, because a field has an undefined type or because - * two messages were defined with the same name. + * for a number of reasons, e.g. because a field has an undefined type or because two + * messages were defined with the same name. */ - public static FileDescriptor buildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies) + public static FileDescriptor buildFrom( + final FileDescriptorProto proto, final FileDescriptor[] dependencies) throws DescriptorValidationException { return buildFrom(proto, dependencies, false); } @@ -306,17 +285,18 @@ public final class Descriptors { /** * Construct a {@code FileDescriptor}. * - * @param proto the protocol message form of the FileDescriptor - * @param dependencies {@code FileDescriptor}s corresponding to all of the file's dependencies - * @param allowUnknownDependencies if true, non-existing dependencies will be ignored and - * undefined message types will be replaced with a placeholder type. Undefined enum types - * still cause a DescriptorValidationException. + * @param proto The protocol message form of the FileDescriptor. + * @param dependencies {@code FileDescriptor}s corresponding to all of the file's dependencies. + * @param allowUnknownDependencies If true, non-exist dependenncies will be ignored and + * undefined message types will be replaced with a placeholder type. * @throws DescriptorValidationException {@code proto} is not a valid descriptor. This can occur - * for a number of reasons; for instance, because a field has an undefined type or because - * two messages were defined with the same name. + * for a number of reasons, e.g. because a field has an undefined type or because two + * messages were defined with the same name. */ public static FileDescriptor buildFrom( - FileDescriptorProto proto, FileDescriptor[] dependencies, boolean allowUnknownDependencies) + final FileDescriptorProto proto, + final FileDescriptor[] dependencies, + final boolean allowUnknownDependencies) throws DescriptorValidationException { // Building descriptors involves two steps: translating and linking. // In the translation step (implemented by FileDescriptor's @@ -327,8 +307,8 @@ public final class Descriptors { // FieldDescriptor for an embedded message contains a pointer directly // to the Descriptor for that message's type. We also detect undefined // types in the linking step. - DescriptorPool pool = new DescriptorPool(dependencies, allowUnknownDependencies); - FileDescriptor result = + final DescriptorPool pool = new DescriptorPool(dependencies, allowUnknownDependencies); + final FileDescriptor result = new FileDescriptor(proto, dependencies, pool, allowUnknownDependencies); result.crossLink(); return result; @@ -358,7 +338,7 @@ public final class Descriptors { final Class descriptorOuterClass, final String[] dependencyClassNames, final String[] dependencyFileNames) { - List descriptors = new ArrayList<>(); + List descriptors = new ArrayList(); for (int i = 0; i < dependencyClassNames.length; i++) { try { Class clazz = descriptorOuterClass.getClassLoader().loadClass(dependencyClassNames[i]); @@ -421,7 +401,8 @@ public final class Descriptors { * except that the {@code FileDescriptorProto} is encoded in protocol buffer wire format. */ public static FileDescriptor internalBuildGeneratedFileFrom( - final String[] descriptorDataParts, final FileDescriptor[] dependencies) { + final String[] descriptorDataParts, + final FileDescriptor[] dependencies) { final byte[] descriptorBytes = latin1Cat(descriptorDataParts); FileDescriptorProto proto; @@ -453,9 +434,10 @@ public final class Descriptors { final String[] dependencyClassNames, final String[] dependencyFileNames, final InternalDescriptorAssigner descriptorAssigner) { - FileDescriptor[] dependencies = - findDescriptors(descriptorOuterClass, dependencyClassNames, dependencyFileNames); - internalBuildGeneratedFileFrom(descriptorDataParts, dependencies, descriptorAssigner); + FileDescriptor[] dependencies = findDescriptors( + descriptorOuterClass, dependencyClassNames, dependencyFileNames); + internalBuildGeneratedFileFrom( + descriptorDataParts, dependencies, descriptorAssigner); } /** @@ -467,26 +449,27 @@ public final class Descriptors { final Class descriptorOuterClass, final String[] dependencyClassNames, final String[] dependencyFileNames) { - FileDescriptor[] dependencies = - findDescriptors(descriptorOuterClass, dependencyClassNames, dependencyFileNames); + FileDescriptor[] dependencies = findDescriptors( + descriptorOuterClass, dependencyClassNames, dependencyFileNames); return internalBuildGeneratedFileFrom(descriptorDataParts, dependencies); } /** - * This method is to be called by generated code only. It updates the FileDescriptorProto - * associated with the descriptor by parsing it again with the given ExtensionRegistry. This is - * needed to recognize custom options. + * This method is to be called by generated code only. It is used to update the + * FileDescriptorProto associated with the descriptor by parsing it again with the given + * ExtensionRegistry. This is needed to recognize custom options. */ public static void internalUpdateFileDescriptor( - FileDescriptor descriptor, ExtensionRegistry registry) { + final FileDescriptor descriptor, final ExtensionRegistry registry) { ByteString bytes = descriptor.proto.toByteString(); + FileDescriptorProto proto; try { - FileDescriptorProto proto = FileDescriptorProto.parseFrom(bytes, registry); - descriptor.setProto(proto); + proto = FileDescriptorProto.parseFrom(bytes, registry); } catch (InvalidProtocolBufferException e) { throw new IllegalArgumentException( "Failed to parse protocol buffer descriptor for generated code.", e); } + descriptor.setProto(proto); } /** @@ -499,8 +482,7 @@ public final class Descriptors { * "Options" messages defined in descriptor.proto. The callback may also return null to indicate * that no extensions are used in the descriptor. * - *

This interface is deprecated. Use the return value of internalBuildGeneratedFrom() - * instead. + * This interface is deprecated. Use the return value of internalBuildGeneratedFrom() instead. */ @Deprecated public interface InternalDescriptorAssigner { @@ -525,11 +507,11 @@ public final class Descriptors { this.pool = pool; this.proto = proto; this.dependencies = dependencies.clone(); - HashMap nameToFileMap = new HashMap<>(); + HashMap nameToFileMap = new HashMap(); for (FileDescriptor file : dependencies) { nameToFileMap.put(file.getName(), file); } - List publicDependencies = new ArrayList<>(); + List publicDependencies = new ArrayList(); for (int i = 0; i < proto.getPublicDependencyCount(); i++) { int index = proto.getPublicDependency(i); if (index < 0 || index >= proto.getDependencyCount()) { @@ -551,34 +533,22 @@ public final class Descriptors { pool.addPackage(getPackage(), this); - messageTypes = - (proto.getMessageTypeCount() > 0) - ? new Descriptor[proto.getMessageTypeCount()] - : EMPTY_DESCRIPTORS; + messageTypes = new Descriptor[proto.getMessageTypeCount()]; for (int i = 0; i < proto.getMessageTypeCount(); i++) { messageTypes[i] = new Descriptor(proto.getMessageType(i), this, null, i); } - enumTypes = - (proto.getEnumTypeCount() > 0) - ? new EnumDescriptor[proto.getEnumTypeCount()] - : EMPTY_ENUM_DESCRIPTORS; + enumTypes = new EnumDescriptor[proto.getEnumTypeCount()]; for (int i = 0; i < proto.getEnumTypeCount(); i++) { enumTypes[i] = new EnumDescriptor(proto.getEnumType(i), this, null, i); } - services = - (proto.getServiceCount() > 0) - ? new ServiceDescriptor[proto.getServiceCount()] - : EMPTY_SERVICE_DESCRIPTORS; + services = new ServiceDescriptor[proto.getServiceCount()]; for (int i = 0; i < proto.getServiceCount(); i++) { services[i] = new ServiceDescriptor(proto.getService(i), this, i); } - extensions = - (proto.getExtensionCount() > 0) - ? new FieldDescriptor[proto.getExtensionCount()] - : EMPTY_FIELD_DESCRIPTORS; + extensions = new FieldDescriptor[proto.getExtensionCount()]; for (int i = 0; i < proto.getExtensionCount(); i++) { extensions[i] = new FieldDescriptor(proto.getExtension(i), this, null, i, true); } @@ -597,9 +567,9 @@ public final class Descriptors { this.publicDependencies = new FileDescriptor[0]; messageTypes = new Descriptor[] {message}; - enumTypes = EMPTY_ENUM_DESCRIPTORS; - services = EMPTY_SERVICE_DESCRIPTORS; - extensions = EMPTY_FIELD_DESCRIPTORS; + enumTypes = new EnumDescriptor[0]; + services = new ServiceDescriptor[0]; + extensions = new FieldDescriptor[0]; pool.addPackage(packageName, this); pool.addSymbol(message); @@ -647,6 +617,10 @@ public final class Descriptors { extensions[i].setProto(proto.getExtension(i)); } } + + boolean supportsUnknownEnumValue() { + return getSyntax() == Syntax.PROTO3; + } } // ================================================================= @@ -750,12 +724,12 @@ public final class Descriptors { /** Determines if the given field number is an extension. */ public boolean isExtensionNumber(final int number) { - int index = Arrays.binarySearch(extensionRangeLowerBounds, number); - if (index < 0) { - index = ~index - 1; + for (final DescriptorProto.ExtensionRange range : proto.getExtensionRangeList()) { + if (range.getStart() <= number && number < range.getEnd()) { + return true; + } } - // extensionRangeLowerBounds[index] is the biggest value <= number - return index >= 0 && number < extensionRangeUpperBounds[index]; + return false; } /** Determines if the given field number is reserved. */ @@ -784,7 +758,7 @@ public final class Descriptors { * y" ranges declared on it. */ public boolean isExtendable() { - return !proto.getExtensionRangeList().isEmpty(); + return proto.getExtensionRangeList().size() != 0; } /** @@ -793,14 +767,12 @@ public final class Descriptors { * @param name The unqualified name of the field (e.g. "foo"). For protocol buffer messages that * follow Google's - * guidance on naming this will be a snake case string, such as - *

song_name
- * . + * guidance on naming this will be a snake case string, such as
song_name
. * @return The field's descriptor, or {@code null} if not found. */ public FieldDescriptor findFieldByName(final String name) { final GenericDescriptor result = file.pool.findSymbol(fullName + '.' + name); - if (result instanceof FieldDescriptor) { + if (result != null && result instanceof FieldDescriptor) { return (FieldDescriptor) result; } else { return null; @@ -814,19 +786,18 @@ public final class Descriptors { * @return The field's descriptor, or {@code null} if not found. */ public FieldDescriptor findFieldByNumber(final int number) { - return binarySearch( - fieldsSortedByNumber, fieldsSortedByNumber.length, FieldDescriptor.NUMBER_GETTER, number); + return file.pool.fieldsByNumber.get(new DescriptorPool.DescriptorIntPair(this, number)); } /** * Finds a nested message type by name. * - * @param name The unqualified name of the nested type such as "Foo" + * @param name The unqualified name of the nested type (e.g. "Foo"). * @return The types's descriptor, or {@code null} if not found. */ public Descriptor findNestedTypeByName(final String name) { final GenericDescriptor result = file.pool.findSymbol(fullName + '.' + name); - if (result instanceof Descriptor) { + if (result != null && result instanceof Descriptor) { return (Descriptor) result; } else { return null; @@ -836,12 +807,12 @@ public final class Descriptors { /** * Finds a nested enum type by name. * - * @param name The unqualified name of the nested type such as "Foo" + * @param name The unqualified name of the nested type (e.g. "Foo"). * @return The types's descriptor, or {@code null} if not found. */ public EnumDescriptor findEnumTypeByName(final String name) { final GenericDescriptor result = file.pool.findSymbol(fullName + '.' + name); - if (result instanceof EnumDescriptor) { + if (result != null && result instanceof EnumDescriptor) { return (EnumDescriptor) result; } else { return null; @@ -856,14 +827,10 @@ public final class Descriptors { private final Descriptor[] nestedTypes; private final EnumDescriptor[] enumTypes; private final FieldDescriptor[] fields; - private final FieldDescriptor[] fieldsSortedByNumber; private final FieldDescriptor[] extensions; private final OneofDescriptor[] oneofs; private final int realOneofCount; - private final int[] extensionRangeLowerBounds; - private final int[] extensionRangeUpperBounds; - // Used to create a placeholder when the type cannot be found. Descriptor(final String fullname) throws DescriptorValidationException { String name = fullname; @@ -883,19 +850,15 @@ public final class Descriptors { this.fullName = fullname; this.containingType = null; - this.nestedTypes = EMPTY_DESCRIPTORS; - this.enumTypes = EMPTY_ENUM_DESCRIPTORS; - this.fields = EMPTY_FIELD_DESCRIPTORS; - this.fieldsSortedByNumber = EMPTY_FIELD_DESCRIPTORS; - this.extensions = EMPTY_FIELD_DESCRIPTORS; - this.oneofs = EMPTY_ONEOF_DESCRIPTORS; + this.nestedTypes = new Descriptor[0]; + this.enumTypes = new EnumDescriptor[0]; + this.fields = new FieldDescriptor[0]; + this.extensions = new FieldDescriptor[0]; + this.oneofs = new OneofDescriptor[0]; this.realOneofCount = 0; // Create a placeholder FileDescriptor to hold this message. this.file = new FileDescriptor(packageName, this); - - extensionRangeLowerBounds = new int[] {1}; - extensionRangeUpperBounds = new int[] {536870912}; } private Descriptor( @@ -910,44 +873,27 @@ public final class Descriptors { this.file = file; containingType = parent; - oneofs = - (proto.getOneofDeclCount() > 0) - ? new OneofDescriptor[proto.getOneofDeclCount()] - : EMPTY_ONEOF_DESCRIPTORS; + oneofs = new OneofDescriptor[proto.getOneofDeclCount()]; for (int i = 0; i < proto.getOneofDeclCount(); i++) { oneofs[i] = new OneofDescriptor(proto.getOneofDecl(i), file, this, i); } - nestedTypes = - (proto.getNestedTypeCount() > 0) - ? new Descriptor[proto.getNestedTypeCount()] - : EMPTY_DESCRIPTORS; + nestedTypes = new Descriptor[proto.getNestedTypeCount()]; for (int i = 0; i < proto.getNestedTypeCount(); i++) { nestedTypes[i] = new Descriptor(proto.getNestedType(i), file, this, i); } - enumTypes = - (proto.getEnumTypeCount() > 0) - ? new EnumDescriptor[proto.getEnumTypeCount()] - : EMPTY_ENUM_DESCRIPTORS; + enumTypes = new EnumDescriptor[proto.getEnumTypeCount()]; for (int i = 0; i < proto.getEnumTypeCount(); i++) { enumTypes[i] = new EnumDescriptor(proto.getEnumType(i), file, this, i); } - fields = - (proto.getFieldCount() > 0) - ? new FieldDescriptor[proto.getFieldCount()] - : EMPTY_FIELD_DESCRIPTORS; + fields = new FieldDescriptor[proto.getFieldCount()]; for (int i = 0; i < proto.getFieldCount(); i++) { fields[i] = new FieldDescriptor(proto.getField(i), file, this, i, false); } - this.fieldsSortedByNumber = - (proto.getFieldCount() > 0) ? fields.clone() : EMPTY_FIELD_DESCRIPTORS; - extensions = - (proto.getExtensionCount() > 0) - ? new FieldDescriptor[proto.getExtensionCount()] - : EMPTY_FIELD_DESCRIPTORS; + extensions = new FieldDescriptor[proto.getExtensionCount()]; for (int i = 0; i < proto.getExtensionCount(); i++) { extensions[i] = new FieldDescriptor(proto.getExtension(i), file, this, i, true); } @@ -976,25 +922,6 @@ public final class Descriptors { this.realOneofCount = this.oneofs.length - syntheticOneofCount; file.pool.addSymbol(this); - - // NOTE: The defined extension ranges are guaranteed to be disjoint. - if (proto.getExtensionRangeCount() > 0) { - extensionRangeLowerBounds = new int[proto.getExtensionRangeCount()]; - extensionRangeUpperBounds = new int[proto.getExtensionRangeCount()]; - int i = 0; - for (final DescriptorProto.ExtensionRange range : proto.getExtensionRangeList()) { - extensionRangeLowerBounds[i] = range.getStart(); - extensionRangeUpperBounds[i] = range.getEnd(); - i++; - } - // Since the ranges are disjoint, sorting these independently must still produce the correct - // order. - Arrays.sort(extensionRangeLowerBounds); - Arrays.sort(extensionRangeUpperBounds); - } else { - extensionRangeLowerBounds = EMPTY_INT_ARRAY; - extensionRangeUpperBounds = EMPTY_INT_ARRAY; - } } /** Look up and cross-link all field types, etc. */ @@ -1006,32 +933,12 @@ public final class Descriptors { for (final FieldDescriptor field : fields) { field.crossLink(); } - Arrays.sort(fieldsSortedByNumber); - validateNoDuplicateFieldNumbers(); for (final FieldDescriptor extension : extensions) { extension.crossLink(); } } - private void validateNoDuplicateFieldNumbers() throws DescriptorValidationException { - for (int i = 0; i + 1 < fieldsSortedByNumber.length; i++) { - FieldDescriptor old = fieldsSortedByNumber[i]; - FieldDescriptor field = fieldsSortedByNumber[i + 1]; - if (old.getNumber() == field.getNumber()) { - throw new DescriptorValidationException( - field, - "Field number " - + field.getNumber() - + " has already been used in \"" - + field.getContainingType().getFullName() - + "\" by field \"" - + old.getName() - + "\"."); - } - } - } - /** See {@link FileDescriptor#setProto}. */ private void setProto(final DescriptorProto proto) { this.proto = proto; @@ -1063,14 +970,6 @@ public final class Descriptors { /** Describes a field of a message type. */ public static final class FieldDescriptor extends GenericDescriptor implements Comparable, FieldSet.FieldDescriptorLite { - private static final NumberGetter NUMBER_GETTER = - new NumberGetter() { - @Override - public int getNumber(FieldDescriptor fieldDescriptor) { - return fieldDescriptor.getNumber(); - } - }; - /** * Get the index of this descriptor within its parent. * @@ -1110,14 +1009,7 @@ public final class Descriptors { /** Get the JSON name of this field. */ public String getJsonName() { - String result = jsonName; - if (result != null) { - return result; - } else if (proto.hasJsonName()) { - return jsonName = proto.getJsonName(); - } else { - return jsonName = fieldNameToJsonName(proto.getName()); - } + return jsonName; } /** @@ -1209,7 +1101,7 @@ public final class Descriptors { } } - /** Can this field be packed? That is, is it a repeated primitive field? */ + /** Can this field be packed? i.e. is it a repeated primitive field? */ public boolean isPackable() { return isRepeated() && getLiteType().isPackable(); } @@ -1264,9 +1156,7 @@ public final class Descriptors { * Returns true if this field was syntactically written with "optional" in the .proto file. * Excludes singular proto3 fields that do not have a label. */ - @Deprecated - public - boolean hasOptionalKeyword() { + public boolean hasOptionalKeyword() { return isProto3Optional || (file.getSyntax() == Syntax.PROTO2 && isOptional() && getContainingOneof() == null); } @@ -1281,7 +1171,7 @@ public final class Descriptors { *

For fields where hasPresence() == true, the return value of msg.hasField() is semantically * meaningful. */ - public boolean hasPresence() { + boolean hasPresence() { if (isRepeated()) { return false; } @@ -1304,13 +1194,13 @@ public final class Descriptors { * } * message Bar { * extend Foo { - * optional int32 moo = 4321; + * optional int32 qux = 4321; * } * } * * - * Both {@code baz}'s and {@code moo}'s containing type is {@code Foo}. However, {@code baz}'s - * extension scope is {@code null} while {@code moo}'s extension scope is {@code Bar}. + * Both {@code baz}'s and {@code qux}'s containing type is {@code Foo}. However, {@code baz}'s + * extension scope is {@code null} while {@code qux}'s extension scope is {@code Bar}. */ public Descriptor getExtensionScope() { if (!isExtension()) { @@ -1339,37 +1229,13 @@ public final class Descriptors { return enumType; } - /** - * Determines if the given enum field is treated as closed based on legacy non-conformant - * behavior. - * - *

Conformant behavior determines closedness based on the enum and can be queried using - * {@code EnumDescriptor.isClosed()}. - * - *

Some runtimes currently have a quirk where non-closed enums are treated as closed when - * used as the type of fields defined in a `syntax = proto2;` file. This quirk is not present in - * all runtimes; as of writing, we know that: - * - *

    - *
  • C++, Java, and C++-based Python share this quirk. - *
  • UPB and UPB-based Python do not. - *
  • PHP and Ruby treat all enums as open regardless of declaration. - *
- * - *

Care should be taken when using this function to respect the target runtime's enum - * handling quirks. - */ - public boolean legacyEnumFieldTreatedAsClosed() { - return getType() == Type.ENUM && getFile().getSyntax() == Syntax.PROTO2; - } - /** * Compare with another {@code FieldDescriptor}. This orders fields in "canonical" order, which - * simply means ascending order by field number. {@code other} must be a field of the same type. - * That is, {@code getContainingType()} must return the same {@code Descriptor} for both fields. + * simply means ascending order by field number. {@code other} must be a field of the same type + * -- i.e. {@code getContainingType()} must return the same {@code Descriptor} for both fields. * * @return negative, zero, or positive if {@code this} is less than, equal to, or greater than - * {@code other}, respectively + * {@code other}, respectively. */ @Override public int compareTo(final FieldDescriptor other) { @@ -1390,7 +1256,7 @@ public final class Descriptors { private FieldDescriptorProto proto; private final String fullName; - private String jsonName; + private final String jsonName; private final FileDescriptor file; private final Descriptor extensionScope; private final boolean isProto3Optional; @@ -1423,14 +1289,11 @@ public final class Descriptors { SINT32(JavaType.INT), SINT64(JavaType.LONG); - // Private copy to avoid repeated allocations from calls to values() in valueOf(). - private static final Type[] types = values(); - - Type(JavaType javaType) { + Type(final JavaType javaType) { this.javaType = javaType; } - private final JavaType javaType; + private JavaType javaType; public FieldDescriptorProto.Type toProto() { return FieldDescriptorProto.Type.forNumber(ordinal() + 1); @@ -1441,13 +1304,13 @@ public final class Descriptors { } public static Type valueOf(final FieldDescriptorProto.Type type) { - return types[type.getNumber() - 1]; + return values()[type.getNumber() - 1]; } } static { // Refuse to init if someone added a new declared type. - if (Type.types.length != FieldDescriptorProto.Type.values().length) { + if (Type.values().length != FieldDescriptorProto.Type.values().length) { throw new RuntimeException( "descriptor.proto has a new declared type but Descriptors.java wasn't updated."); } @@ -1511,6 +1374,11 @@ public final class Descriptors { this.proto = proto; fullName = computeFullName(file, parent, proto.getName()); this.file = file; + if (proto.hasJsonName()) { + jsonName = proto.getJsonName(); + } else { + jsonName = fieldNameToJsonName(proto.getName()); + } if (proto.hasType()) { type = Type.valueOf(proto.getType()); @@ -1736,6 +1604,10 @@ public final class Descriptors { } } + if (!isExtension()) { + file.pool.addFieldByNumber(this); + } + if (containingType != null && containingType.getOptions().getMessageSetWireFormat()) { if (isExtension()) { if (!isOptional() || getType() != Type.MESSAGE) { @@ -1761,6 +1633,7 @@ public final class Descriptors { // down-cast and call mergeFrom directly. return ((Message.Builder) to).mergeFrom((Message) from); } + } // ================================================================= @@ -1805,34 +1678,6 @@ public final class Descriptors { return file; } - /** - * Determines if the given enum is closed. - * - *

Closed enum means that it: - * - *

    - *
  • Has a fixed set of values, rather than being equivalent to an int32. - *
  • Encountering values not in this set causes them to be treated as unknown fields. - *
  • The first value (i.e., the default) may be nonzero. - *
- * - *

WARNING: Some runtimes currently have a quirk where non-closed enums are treated as closed - * when used as the type of fields defined in a `syntax = proto2;` file. This quirk is not - * present in all runtimes; as of writing, we know that: - * - *

    - *
  • C++, Java, and C++-based Python share this quirk. - *
  • UPB and UPB-based Python do not. - *
  • PHP and Ruby treat all enums as open regardless of declaration. - *
- * - *

Care should be taken when using this function to respect the target runtime's enum - * handling quirks. - */ - public boolean isClosed() { - return getFile().getSyntax() != Syntax.PROTO3; - } - /** If this is a nested type, get the outer descriptor, otherwise null. */ public Descriptor getContainingType() { return containingType; @@ -1848,36 +1693,15 @@ public final class Descriptors { return Collections.unmodifiableList(Arrays.asList(values)); } - /** Determines if the given field number is reserved. */ - public boolean isReservedNumber(final int number) { - for (final EnumDescriptorProto.EnumReservedRange range : proto.getReservedRangeList()) { - if (range.getStart() <= number && number <= range.getEnd()) { - return true; - } - } - return false; - } - - /** Determines if the given field name is reserved. */ - public boolean isReservedName(final String name) { - checkNotNull(name); - for (final String reservedName : proto.getReservedNameList()) { - if (reservedName.equals(name)) { - return true; - } - } - return false; - } - /** * Find an enum value by name. * - * @param name the unqualified name of the value such as "FOO" - * @return the value's descriptor, or {@code null} if not found + * @param name The unqualified name of the value (e.g. "FOO"). + * @return the value's descriptor, or {@code null} if not found. */ public EnumValueDescriptor findValueByName(final String name) { final GenericDescriptor result = file.pool.findSymbol(fullName + '.' + name); - if (result instanceof EnumValueDescriptor) { + if (result != null && result instanceof EnumValueDescriptor) { return (EnumValueDescriptor) result; } else { return null; @@ -1893,17 +1717,7 @@ public final class Descriptors { */ @Override public EnumValueDescriptor findValueByNumber(final int number) { - return binarySearch( - valuesSortedByNumber, distinctNumbers, EnumValueDescriptor.NUMBER_GETTER, number); - } - - private static class UnknownEnumValueReference extends WeakReference { - private final int number; - - private UnknownEnumValueReference(int number, EnumValueDescriptor descriptor) { - super(descriptor); - this.number = number; - } + return file.pool.enumValuesByNumber.get(new DescriptorPool.DescriptorIntPair(this, number)); } /** @@ -1917,28 +1731,43 @@ public final class Descriptors { } // The number represents an unknown enum value. synchronized (this) { - if (cleanupQueue == null) { - cleanupQueue = new ReferenceQueue<>(); - unknownValues = new HashMap<>(); - } else { - while (true) { - UnknownEnumValueReference toClean = (UnknownEnumValueReference) cleanupQueue.poll(); - if (toClean == null) { - break; - } - unknownValues.remove(toClean.number); - } + // Descriptors are compared by object identity so for the same number + // we need to return the same EnumValueDescriptor object. This means + // we have to store created EnumValueDescriptors. However, as there + // are potentially 2G unknown enum values, storing all of these + // objects persistently will consume lots of memory for long-running + // services and it's also unnecessary as not many EnumValueDescriptors + // will be used at the same time. + // + // To solve the problem we take advantage of Java's weak references and + // rely on gc to release unused descriptors. + // + // Here is how it works: + // * We store unknown EnumValueDescriptors in a WeakHashMap with the + // value being a weak reference to the descriptor. + // * The descriptor holds a strong reference to the key so as long + // as the EnumValueDescriptor is in use, the key will be there + // and the corresponding map entry will be there. Following-up + // queries with the same number will return the same descriptor. + // * If the user no longer uses an unknown EnumValueDescriptor, + // it will be gc-ed since we only hold a weak reference to it in + // the map. The key in the corresponding map entry will also be + // gc-ed as the only strong reference to it is in the descriptor + // which is just gc-ed. With the key being gone WeakHashMap will + // then remove the whole entry. This way unknown descriptors will + // be freed automatically and we don't need to do anything to + // clean-up unused map entries. + + // Note: We must use "new Integer(number)" here because we don't want + // these Integer objects to be cached. + Integer key = new Integer(number); + WeakReference reference = unknownValues.get(key); + if (reference != null) { + result = reference.get(); } - - // There are two ways we can be missing a value: it wasn't in the map, or the reference - // has been GC'd. (It may even have been GC'd since we cleaned up the references a few - // lines of code ago.) So get out the reference, if it's still present... - WeakReference reference = unknownValues.get(number); - result = (reference == null) ? null : reference.get(); - if (result == null) { - result = new EnumValueDescriptor(this, number); - unknownValues.put(number, new UnknownEnumValueReference(number, result)); + result = new EnumValueDescriptor(file, this, key); + unknownValues.put(key, new WeakReference(result)); } } return result; @@ -1954,11 +1783,9 @@ public final class Descriptors { private final String fullName; private final FileDescriptor file; private final Descriptor containingType; - private final EnumValueDescriptor[] values; - private final EnumValueDescriptor[] valuesSortedByNumber; - private final int distinctNumbers; - private Map> unknownValues = null; - private ReferenceQueue cleanupQueue = null; + private EnumValueDescriptor[] values; + private final WeakHashMap> unknownValues = + new WeakHashMap>(); private EnumDescriptor( final EnumDescriptorProto proto, @@ -1982,19 +1809,6 @@ public final class Descriptors { for (int i = 0; i < proto.getValueCount(); i++) { values[i] = new EnumValueDescriptor(proto.getValue(i), file, this, i); } - valuesSortedByNumber = values.clone(); - Arrays.sort(valuesSortedByNumber, EnumValueDescriptor.BY_NUMBER); - // deduplicate - int j = 0; - for (int i = 1; i < proto.getValueCount(); i++) { - EnumValueDescriptor oldValue = valuesSortedByNumber[j]; - EnumValueDescriptor newValue = valuesSortedByNumber[i]; - if (oldValue.getNumber() != newValue.getNumber()) { - valuesSortedByNumber[++j] = newValue; - } - } - this.distinctNumbers = j + 1; - Arrays.fill(valuesSortedByNumber, distinctNumbers, proto.getValueCount(), null); file.pool.addSymbol(this); } @@ -2018,22 +1832,6 @@ public final class Descriptors { */ public static final class EnumValueDescriptor extends GenericDescriptor implements Internal.EnumLite { - static final Comparator BY_NUMBER = - new Comparator() { - @Override - public int compare(EnumValueDescriptor o1, EnumValueDescriptor o2) { - return Integer.valueOf(o1.getNumber()).compareTo(o2.getNumber()); - } - }; - - static final NumberGetter NUMBER_GETTER = - new NumberGetter() { - @Override - public int getNumber(EnumValueDescriptor enumValueDescriptor) { - return enumValueDescriptor.getNumber(); - } - }; - /** * Get the index of this descriptor within its parent. * @@ -2079,7 +1877,7 @@ public final class Descriptors { /** Get the {@link FileDescriptor} containing this descriptor. */ @Override public FileDescriptor getFile() { - return type.file; + return file; } /** Get the value's enum type. */ @@ -2095,6 +1893,7 @@ public final class Descriptors { private final int index; private EnumValueDescriptorProto proto; private final String fullName; + private final FileDescriptor file; private final EnumDescriptor type; private EnumValueDescriptor( @@ -2105,20 +1904,24 @@ public final class Descriptors { throws DescriptorValidationException { this.index = index; this.proto = proto; + this.file = file; type = parent; fullName = parent.getFullName() + '.' + proto.getName(); file.pool.addSymbol(this); + file.pool.addEnumValueByNumber(this); } // Create an unknown enum value. - private EnumValueDescriptor(final EnumDescriptor parent, final Integer number) { + private EnumValueDescriptor( + final FileDescriptor file, final EnumDescriptor parent, final Integer number) { String name = "UNKNOWN_ENUM_VALUE_" + parent.getName() + "_" + number; EnumValueDescriptorProto proto = EnumValueDescriptorProto.newBuilder().setName(name).setNumber(number).build(); this.index = -1; this.proto = proto; + this.file = file; this.type = parent; this.fullName = parent.getFullName() + '.' + proto.getName(); @@ -2183,12 +1986,12 @@ public final class Descriptors { /** * Find a method by name. * - * @param name the unqualified name of the method such as "Foo" - * @return the method's descriptor, or {@code null} if not found + * @param name The unqualified name of the method (e.g. "Foo"). + * @return the method's descriptor, or {@code null} if not found. */ public MethodDescriptor findMethodByName(final String name) { final GenericDescriptor result = file.pool.findSymbol(fullName + '.' + name); - if (result instanceof MethodDescriptor) { + if (result != null && result instanceof MethodDescriptor) { return (MethodDescriptor) result; } else { return null; @@ -2330,9 +2133,8 @@ public final class Descriptors { private void crossLink() throws DescriptorValidationException { final GenericDescriptor input = - getFile() - .pool - .lookupSymbol(proto.getInputType(), this, DescriptorPool.SearchFilter.TYPES_ONLY); + file.pool.lookupSymbol( + proto.getInputType(), this, DescriptorPool.SearchFilter.TYPES_ONLY); if (!(input instanceof Descriptor)) { throw new DescriptorValidationException( this, '\"' + proto.getInputType() + "\" is not a message type."); @@ -2340,9 +2142,8 @@ public final class Descriptors { inputType = (Descriptor) input; final GenericDescriptor output = - getFile() - .pool - .lookupSymbol(proto.getOutputType(), this, DescriptorPool.SearchFilter.TYPES_ONLY); + file.pool.lookupSymbol( + proto.getOutputType(), this, DescriptorPool.SearchFilter.TYPES_ONLY); if (!(output instanceof Descriptor)) { throw new DescriptorValidationException( this, '\"' + proto.getOutputType() + "\" is not a message type."); @@ -2464,14 +2265,12 @@ public final class Descriptors { } DescriptorPool(final FileDescriptor[] dependencies, boolean allowUnknownDependencies) { - this.dependencies = - Collections.newSetFromMap( - new IdentityHashMap(dependencies.length)); + this.dependencies = new HashSet(); this.allowUnknownDependencies = allowUnknownDependencies; - for (Descriptors.FileDescriptor dependency : dependencies) { - this.dependencies.add(dependency); - importPublicDependencies(dependency); + for (int i = 0; i < dependencies.length; i++) { + this.dependencies.add(dependencies[i]); + importPublicDependencies(dependencies[i]); } for (final FileDescriptor dependency : this.dependencies) { @@ -2496,9 +2295,14 @@ public final class Descriptors { } private final Set dependencies; - private final boolean allowUnknownDependencies; + private boolean allowUnknownDependencies; - private final Map descriptorsByName = new HashMap<>(); + private final Map descriptorsByName = + new HashMap(); + private final Map fieldsByNumber = + new HashMap(); + private final Map enumValuesByNumber = + new HashMap(); /** Find a generic descriptor by fully-qualified name. */ GenericDescriptor findSymbol(final String fullName) { @@ -2556,6 +2360,7 @@ public final class Descriptors { final GenericDescriptor relativeTo, final DescriptorPool.SearchFilter filter) throws DescriptorValidationException { + // TODO(kenton): This could be optimized in a number of ways. GenericDescriptor result; String fullname; @@ -2627,11 +2432,11 @@ public final class Descriptors { logger.warning( "The descriptor for message type \"" + name - + "\" cannot be found and a placeholder is created for it"); + + "\" can not be found and a placeholder is created for it"); // We create a dummy message descriptor here regardless of the // expected type. If the type should be message, this dummy // descriptor will work well and if the type should be enum, a - // DescriptorValidationException will be thrown later. In either + // DescriptorValidationException will be thrown latter. In either // case, the code works as expected: we allow unknown message types // but not unknown enum types. result = new Descriptor(fullname); @@ -2756,9 +2561,71 @@ public final class Descriptors { } } + /** A (GenericDescriptor, int) pair, used as a map key. */ + private static final class DescriptorIntPair { + private final GenericDescriptor descriptor; + private final int number; + + DescriptorIntPair(final GenericDescriptor descriptor, final int number) { + this.descriptor = descriptor; + this.number = number; + } + + @Override + public int hashCode() { + return descriptor.hashCode() * ((1 << 16) - 1) + number; + } + + @Override + public boolean equals(final Object obj) { + if (!(obj instanceof DescriptorIntPair)) { + return false; + } + final DescriptorIntPair other = (DescriptorIntPair) obj; + return descriptor == other.descriptor && number == other.number; + } + } + /** - * Verifies that the descriptor's name is valid. That is, it contains only letters, digits, and - * underscores, and does not start with a digit. + * Adds a field to the fieldsByNumber table. Throws an exception if a field with the same + * containing type and number already exists. + */ + void addFieldByNumber(final FieldDescriptor field) throws DescriptorValidationException { + final DescriptorIntPair key = + new DescriptorIntPair(field.getContainingType(), field.getNumber()); + final FieldDescriptor old = fieldsByNumber.put(key, field); + if (old != null) { + fieldsByNumber.put(key, old); + throw new DescriptorValidationException( + field, + "Field number " + + field.getNumber() + + " has already been used in \"" + + field.getContainingType().getFullName() + + "\" by field \"" + + old.getName() + + "\"."); + } + } + + /** + * Adds an enum value to the enumValuesByNumber table. If an enum value with the same type and + * number already exists, does nothing. (This is allowed; the first value define with the number + * takes precedence.) + */ + void addEnumValueByNumber(final EnumValueDescriptor value) { + final DescriptorIntPair key = new DescriptorIntPair(value.getType(), value.getNumber()); + final EnumValueDescriptor old = enumValuesByNumber.put(key, value); + if (old != null) { + enumValuesByNumber.put(key, old); + // Not an error: Multiple enum values may have the same number, but + // we only want the first one in the map. + } + } + + /** + * Verifies that the descriptor's name is valid (i.e. it contains only letters, digits, and + * underscores, and does not start with a digit). */ static void validateSymbolName(final GenericDescriptor descriptor) throws DescriptorValidationException { @@ -2773,10 +2640,9 @@ public final class Descriptors { // Subsequent characters may be letters, numbers, or digits. for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); - if (('a' <= c && c <= 'z') - || ('A' <= c && c <= 'Z') - || (c == '_') - || ('0' <= c && c <= '9' && i > 0)) { + if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') + || (c == '_') + || ('0' <= c && c <= '9' && i > 0)) { // Valid continue; } @@ -2786,7 +2652,7 @@ public final class Descriptors { } } - /** Describes a oneof of a message type. */ + /** Describes an oneof of a message type. */ public static final class OneofDescriptor extends GenericDescriptor { /** Get the index of this descriptor within its parent. */ public int getIndex() { @@ -2820,6 +2686,10 @@ public final class Descriptors { return proto.getOptions(); } + public boolean isSynthetic() { + return fields.length == 1 && fields[0].isProto3Optional; + } + /** Get a list of this message type's fields. */ public List getFields() { return Collections.unmodifiableList(Arrays.asList(fields)); @@ -2834,12 +2704,6 @@ public final class Descriptors { return proto; } - @Deprecated - public - boolean isSynthetic() { - return fields.length == 1 && fields[0].isProto3Optional; - } - private void setProto(final OneofDescriptorProto proto) { this.proto = proto; } @@ -2848,7 +2712,8 @@ public final class Descriptors { final OneofDescriptorProto proto, final FileDescriptor file, final Descriptor parent, - final int index) { + final int index) + throws DescriptorValidationException { this.proto = proto; fullName = computeFullName(file, parent, proto.getName()); this.file = file; @@ -2867,27 +2732,4 @@ public final class Descriptors { private int fieldCount; private FieldDescriptor[] fields; } - - private static T binarySearch(T[] array, int size, NumberGetter getter, int number) { - int left = 0; - int right = size - 1; - - while (left <= right) { - int mid = (left + right) / 2; - T midValue = array[mid]; - int midValueNumber = getter.getNumber(midValue); - if (number < midValueNumber) { - right = mid - 1; - } else if (number > midValueNumber) { - left = mid + 1; - } else { - return midValue; - } - } - return null; - } - - private interface NumberGetter { - int getNumber(T t); - } } diff --git a/java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java b/java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java index 11c8e9a37e7bdd673bf9b11bceba9ceede3c067a..c2378adce847862dcd8eeb34eae958b888018e76 100644 --- a/java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java +++ b/java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/DoubleArrayList.java b/java/core/src/main/java/com/google/protobuf/DoubleArrayList.java index 32b6b6781c9e23f01a6536f6591b4dc5c5b356c2..408565343720d79fdb2c762203ba04186411bf30 100644 --- a/java/core/src/main/java/com/google/protobuf/DoubleArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/DoubleArrayList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -22,7 +45,10 @@ import java.util.RandomAccess; final class DoubleArrayList extends AbstractProtobufList implements DoubleList, RandomAccess, PrimitiveNonBoxingCollection { - private static final DoubleArrayList EMPTY_LIST = new DoubleArrayList(new double[0], 0, false); + private static final DoubleArrayList EMPTY_LIST = new DoubleArrayList(new double[0], 0); + static { + EMPTY_LIST.makeImmutable(); + } public static DoubleArrayList emptyList() { return EMPTY_LIST; @@ -39,15 +65,14 @@ final class DoubleArrayList extends AbstractProtobufList /** Constructs a new mutable {@code DoubleArrayList} with default capacity. */ DoubleArrayList() { - this(new double[DEFAULT_CAPACITY], 0, true); + this(new double[DEFAULT_CAPACITY], 0); } /** * Constructs a new mutable {@code DoubleArrayList} containing the same elements as {@code other}. */ - private DoubleArrayList(double[] other, int size, boolean isMutable) { - super(isMutable); - this.array = other; + private DoubleArrayList(double[] other, int size) { + array = other; this.size = size; } @@ -101,7 +126,7 @@ final class DoubleArrayList extends AbstractProtobufList if (capacity < size) { throw new IllegalArgumentException(); } - return new DoubleArrayList(Arrays.copyOf(array, capacity), size, true); + return new DoubleArrayList(Arrays.copyOf(array, capacity), size); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/DynamicMessage.java b/java/core/src/main/java/com/google/protobuf/DynamicMessage.java index de98df085c2cb8d406549c657dc52c4ccfb57617..51e6b0c27c1fed37af1653bb79742147160da4bd 100644 --- a/java/core/src/main/java/com/google/protobuf/DynamicMessage.java +++ b/java/core/src/main/java/com/google/protobuf/DynamicMessage.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -15,7 +38,6 @@ import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.Descriptors.OneofDescriptor; import java.io.IOException; import java.io.InputStream; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; @@ -63,6 +85,7 @@ public final class DynamicMessage extends AbstractMessage { UnknownFieldSet.getDefaultInstance()); } + /** Parse a message of the given type from the given input stream. */ public static DynamicMessage parseFrom(Descriptor type, CodedInputStream input) throws IOException { @@ -295,14 +318,14 @@ public final class DynamicMessage extends AbstractMessage { /** Builder for {@link DynamicMessage}s. */ public static final class Builder extends AbstractMessage.Builder { private final Descriptor type; - private FieldSet.Builder fields; + private FieldSet fields; private final FieldDescriptor[] oneofCases; private UnknownFieldSet unknownFields; /** Construct a {@code Builder} for the given type. */ private Builder(Descriptor type) { this.type = type; - this.fields = FieldSet.newBuilder(); + this.fields = FieldSet.newFieldSet(); this.unknownFields = UnknownFieldSet.getDefaultInstance(); this.oneofCases = new FieldDescriptor[type.toProto().getOneofDeclCount()]; } @@ -312,7 +335,11 @@ public final class DynamicMessage extends AbstractMessage { @Override public Builder clear() { - fields = FieldSet.newBuilder(); + if (fields.isImmutable()) { + fields = FieldSet.newFieldSet(); + } else { + fields.clear(); + } unknownFields = UnknownFieldSet.getDefaultInstance(); return this; } @@ -326,6 +353,7 @@ public final class DynamicMessage extends AbstractMessage { throw new IllegalArgumentException( "mergeFrom(Message) can only merge messages of the same type."); } + ensureIsMutable(); fields.mergeFrom(otherDynamicMessage.fields); mergeUnknownFields(otherDynamicMessage.unknownFields); for (int i = 0; i < oneofCases.length; i++) { @@ -350,7 +378,10 @@ public final class DynamicMessage extends AbstractMessage { if (!isInitialized()) { throw newUninitializedMessageException( new DynamicMessage( - type, fields.build(), Arrays.copyOf(oneofCases, oneofCases.length), unknownFields)); + type, + fields, + java.util.Arrays.copyOf(oneofCases, oneofCases.length), + unknownFields)); } return buildPartial(); } @@ -364,8 +395,8 @@ public final class DynamicMessage extends AbstractMessage { throw newUninitializedMessageException( new DynamicMessage( type, - fields.build(), - Arrays.copyOf(oneofCases, oneofCases.length), + fields, + java.util.Arrays.copyOf(oneofCases, oneofCases.length), unknownFields)) .asInvalidProtocolBufferException(); } @@ -387,11 +418,12 @@ public final class DynamicMessage extends AbstractMessage { } } + fields.makeImmutable(); DynamicMessage result = new DynamicMessage( type, - fields.buildPartial(), - Arrays.copyOf(oneofCases, oneofCases.length), + fields, + java.util.Arrays.copyOf(oneofCases, oneofCases.length), unknownFields); return result; } @@ -399,7 +431,7 @@ public final class DynamicMessage extends AbstractMessage { @Override public Builder clone() { Builder result = new Builder(type); - result.fields.mergeFrom(fields.build()); + result.fields.mergeFrom(fields); result.mergeUnknownFields(unknownFields); System.arraycopy(oneofCases, 0, result.oneofCases, 0, oneofCases.length); return result; @@ -407,17 +439,7 @@ public final class DynamicMessage extends AbstractMessage { @Override public boolean isInitialized() { - // Check that all required fields are present. - for (FieldDescriptor field : type.getFields()) { - if (field.isRequired()) { - if (!fields.hasField(field)) { - return false; - } - } - } - - // Check that embedded messages are initialized. - return fields.isInitialized(); + return DynamicMessage.isInitialized(type, fields); } @Override @@ -498,12 +520,15 @@ public final class DynamicMessage extends AbstractMessage { @Override public Builder setField(FieldDescriptor field, Object value) { verifyContainingType(field); - // TODO: This check should really be put in FieldSet.setField() + ensureIsMutable(); + // TODO(xiaofeng): This check should really be put in FieldSet.setField() // where all other such checks are done. However, currently // FieldSet.setField() permits Integer value for enum fields probably // because of some internal features we support. Should figure it out // and move this check to a more appropriate place. - verifyType(field, value); + if (field.getType() == FieldDescriptor.Type.ENUM) { + ensureEnumValueDescriptor(field, value); + } OneofDescriptor oneofDescriptor = field.getContainingOneof(); if (oneofDescriptor != null) { int index = oneofDescriptor.getIndex(); @@ -512,10 +537,11 @@ public final class DynamicMessage extends AbstractMessage { fields.clearField(oldField); } oneofCases[index] = field; - } else if (!field.hasPresence()) { - if (!field.isRepeated() && value.equals(field.getDefaultValue())) { - // Setting a field without presence to its default value is equivalent to clearing the - // field. + } else if (field.getFile().getSyntax() == Descriptors.FileDescriptor.Syntax.PROTO3) { + if (!field.isRepeated() + && field.getJavaType() != FieldDescriptor.JavaType.MESSAGE + && value.equals(field.getDefaultValue())) { + // In proto3, setting a field to its default value is equivalent to clearing the field. fields.clearField(field); return this; } @@ -527,6 +553,7 @@ public final class DynamicMessage extends AbstractMessage { @Override public Builder clearField(FieldDescriptor field) { verifyContainingType(field); + ensureIsMutable(); OneofDescriptor oneofDescriptor = field.getContainingOneof(); if (oneofDescriptor != null) { int index = oneofDescriptor.getIndex(); @@ -553,7 +580,7 @@ public final class DynamicMessage extends AbstractMessage { @Override public Builder setRepeatedField(FieldDescriptor field, int index, Object value) { verifyContainingType(field); - verifySingularValueType(field, value); + ensureIsMutable(); fields.setRepeatedField(field, index, value); return this; } @@ -561,7 +588,7 @@ public final class DynamicMessage extends AbstractMessage { @Override public Builder addRepeatedField(FieldDescriptor field, Object value) { verifyContainingType(field); - verifySingularValueType(field, value); + ensureIsMutable(); fields.addRepeatedField(field, value); return this; } @@ -598,116 +625,53 @@ public final class DynamicMessage extends AbstractMessage { } } - /** - * Verifies that {@code value} is of the appropriate type, in addition to the checks already - * performed by {@link FieldSet.Builder}. - */ - private void verifySingularValueType(FieldDescriptor field, Object value) { - // Most type checks are performed by FieldSet.Builder, but FieldSet.Builder is more permissive - // than generated Message.Builder subclasses, so we perform extra checks in this class so that - // DynamicMessage.Builder's semantics more closely match the semantics of generated builders. - switch (field.getType()) { - case ENUM: - checkNotNull(value); - // FieldSet.Builder accepts Integer values for enum fields. - if (!(value instanceof EnumValueDescriptor)) { - throw new IllegalArgumentException( - "DynamicMessage should use EnumValueDescriptor to set Enum Value."); - } - // TODO: Re-enable this check after Orgstore is fixed to not - // set incorrect EnumValueDescriptors. - // EnumDescriptor fieldType = field.getEnumType(); - // EnumDescriptor fieldValueType = ((EnumValueDescriptor) value).getType(); - // if (fieldType != fieldValueType) { - // throw new IllegalArgumentException(String.format( - // "EnumDescriptor %s of field doesn't match EnumDescriptor %s of field value", - // fieldType.getFullName(), fieldValueType.getFullName())); - // } - break; - case MESSAGE: - // FieldSet.Builder accepts Message.Builder values for message fields. - if (value instanceof Message.Builder) { - throw new IllegalArgumentException( - String.format( - "Wrong object type used with protocol message reflection.\n" - + "Field number: %d, field java type: %s, value type: %s\n", - field.getNumber(), - field.getLiteType().getJavaType(), - value.getClass().getName())); - } - break; - default: - break; + /** Verifies that the value is EnumValueDescriptor and matches Enum Type. */ + private void ensureSingularEnumValueDescriptor(FieldDescriptor field, Object value) { + checkNotNull(value); + if (!(value instanceof EnumValueDescriptor)) { + throw new IllegalArgumentException( + "DynamicMessage should use EnumValueDescriptor to set Enum Value."); } - } - - /** - * Verifies that {@code value} is of the appropriate type, in addition to the checks already - * performed by {@link FieldSet.Builder}. - */ - private void verifyType(FieldDescriptor field, Object value) { + // TODO(xiaofeng): Re-enable this check after Orgstore is fixed to not + // set incorrect EnumValueDescriptors. + // EnumDescriptor fieldType = field.getEnumType(); + // EnumDescriptor fieldValueType = ((EnumValueDescriptor) value).getType(); + // if (fieldType != fieldValueType) { + // throw new IllegalArgumentException(String.format( + // "EnumDescriptor %s of field doesn't match EnumDescriptor %s of field value", + // fieldType.getFullName(), fieldValueType.getFullName())); + // } + } + + /** Verifies the value for an enum field. */ + private void ensureEnumValueDescriptor(FieldDescriptor field, Object value) { if (field.isRepeated()) { - for (Object item : (List) value) { - verifySingularValueType(field, item); + for (Object item : (List) value) { + ensureSingularEnumValueDescriptor(field, item); } } else { - verifySingularValueType(field, value); + ensureSingularEnumValueDescriptor(field, value); } } - @Override - public com.google.protobuf.Message.Builder getFieldBuilder(FieldDescriptor field) { - verifyContainingType(field); - // Error messages chosen for parity with GeneratedMessage.getFieldBuilder. - if (field.isMapField()) { - throw new UnsupportedOperationException("Nested builder not supported for map fields."); - } - if (field.getJavaType() != FieldDescriptor.JavaType.MESSAGE) { - throw new UnsupportedOperationException("getFieldBuilder() called on a non-Message type."); + private void ensureIsMutable() { + if (fields.isImmutable()) { + fields = fields.clone(); } + } - Object existingValue = fields.getFieldAllowBuilders(field); - Message.Builder builder = - existingValue == null - ? new Builder(field.getMessageType()) - : toMessageBuilder(existingValue); - fields.setField(field, builder); - return builder; + @Override + public com.google.protobuf.Message.Builder getFieldBuilder(FieldDescriptor field) { + // TODO(xiangl): need implementation for dynamic message + throw new UnsupportedOperationException( + "getFieldBuilder() called on a dynamic message type."); } @Override public com.google.protobuf.Message.Builder getRepeatedFieldBuilder( FieldDescriptor field, int index) { - verifyContainingType(field); - // Error messages chosen for parity with GeneratedMessage.getRepeatedFieldBuilder. - if (field.isMapField()) { - throw new UnsupportedOperationException("Map fields cannot be repeated"); - } - if (field.getJavaType() != FieldDescriptor.JavaType.MESSAGE) { - throw new UnsupportedOperationException( - "getRepeatedFieldBuilder() called on a non-Message type."); - } - - Message.Builder builder = - toMessageBuilder(fields.getRepeatedFieldAllowBuilders(field, index)); - fields.setRepeatedField(field, index, builder); - return builder; - } - - private static Message.Builder toMessageBuilder(Object o) { - if (o instanceof Message.Builder) { - return (Message.Builder) o; - } - - if (o instanceof LazyField) { - o = ((LazyField) o).getValue(); - } - if (o instanceof Message) { - return ((Message) o).toBuilder(); - } - - throw new IllegalArgumentException( - String.format("Cannot convert %s to Message.Builder", o.getClass())); + throw new UnsupportedOperationException( + "getRepeatedFieldBuilder() called on a dynamic message type."); } } } diff --git a/java/core/src/main/java/com/google/protobuf/ExperimentalApi.java b/java/core/src/main/java/com/google/protobuf/ExperimentalApi.java index d0b57ab99ff205a50c1910ac731e65c9f20b2dbd..d55b278c3f2c7695f3760e7bead5c5cb952c639e 100644 --- a/java/core/src/main/java/com/google/protobuf/ExperimentalApi.java +++ b/java/core/src/main/java/com/google/protobuf/ExperimentalApi.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/Extension.java b/java/core/src/main/java/com/google/protobuf/Extension.java index 83f9163f6fb9dafc12d6eeedaa1eea899a3cbd43..30c828e57bdb287feb67f155e9f0a9495129d3c3 100644 --- a/java/core/src/main/java/com/google/protobuf/Extension.java +++ b/java/core/src/main/java/com/google/protobuf/Extension.java @@ -1,13 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -// TODO: Change ContainingType to extend Message +// TODO(chrisn): Change ContainingType to extend Message /** * Interface that generated extensions implement. * @@ -15,7 +38,7 @@ package com.google.protobuf; */ public abstract class Extension extends ExtensionLite { - // TODO: Add package-private constructor. + // TODO(chrisn): Add package-private constructor. /** {@inheritDoc} Overridden to return {@link Message} instead of {@link MessageLite}. */ @Override diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionLite.java b/java/core/src/main/java/com/google/protobuf/ExtensionLite.java index 5580515690a2c90044b7750f8667569bdb6a3c57..0fb5f49e983c08d58d2184ec8fc83c4f9cd3032d 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionLite.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java b/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java index 39babd3713831fb1dcd135f31b3fafaba9728a8a..aeeaee53e211291f679f0d02a9bfcea6cd20ac4e 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -76,6 +99,7 @@ public class ExtensionRegistry extends ExtensionRegistryLite { return EMPTY_REGISTRY; } + /** Returns an unmodifiable view of the registry. */ @Override public ExtensionRegistry getUnmodifiable() { @@ -130,7 +154,7 @@ public class ExtensionRegistry extends ExtensionRegistryLite { return mutableExtensionsByName.get(fullName); } - /** Deprecated. Use {@link #findImmutableExtensionByNumber(Descriptors.Descriptor, int)} */ + /** Deprecated. Use {@link #findImmutableExtensionByNumber( Descriptors.Descriptor, int)} */ @Deprecated public ExtensionInfo findExtensionByNumber( final Descriptor containingType, final int fieldNumber) { diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java b/java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java index 91aae2bc6eef698c7397d8d0ee1b27e2ce17e803..0a63fad187e8a929389f3173513b39e879e109cf 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -47,6 +70,7 @@ final class ExtensionRegistryFactory { return result != null ? result : EMPTY_REGISTRY_LITE; } + static boolean isFullRegistry(ExtensionRegistryLite registry) { return EXTENSION_REGISTRY_CLASS != null && EXTENSION_REGISTRY_CLASS.isAssignableFrom(registry.getClass()); diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java b/java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java index 18d14bf37778586dbdf7068e07c9fedb62931968..caa58e1ada67e88a6d94b072ff5895663d1ca9c2 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -48,7 +71,7 @@ public class ExtensionRegistryLite { // Set true to enable lazy parsing feature for MessageSet. // - // TODO: Now we use a global flag to control whether enable lazy + // TODO(xiangl): Now we use a global flag to control whether enable lazy // parsing feature for MessageSet, which may be too crude for some // applications. Need to support this feature on smaller granularity. private static volatile boolean eagerlyParseMessageSets = false; @@ -100,21 +123,23 @@ public class ExtensionRegistryLite { * ExtensionRegistry} (if the full (non-Lite) proto libraries are available). */ public static ExtensionRegistryLite getEmptyRegistry() { - if (!doFullRuntimeInheritanceCheck) { - return EMPTY_REGISTRY_LITE; - } ExtensionRegistryLite result = emptyRegistry; if (result == null) { synchronized (ExtensionRegistryLite.class) { result = emptyRegistry; if (result == null) { - result = emptyRegistry = ExtensionRegistryFactory.createEmpty(); + result = + emptyRegistry = + doFullRuntimeInheritanceCheck + ? ExtensionRegistryFactory.createEmpty() + : EMPTY_REGISTRY_LITE; } } } return result; } + /** Returns an unmodifiable view of the registry. */ public ExtensionRegistryLite getUnmodifiable() { return new ExtensionRegistryLite(this); diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionSchema.java b/java/core/src/main/java/com/google/protobuf/ExtensionSchema.java index 3b21d7ff92831365b72a46ea33a8fe4ef14ec855..bd391a2c15db1cd8e74695513901f278f20bcd22 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionSchema.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionSchema.java @@ -1,16 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import java.io.IOException; import java.util.Map; -@CheckReturnValue abstract class ExtensionSchema> { /** Returns true for messages that support extensions. */ diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java b/java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java index 9133e7a56d2635e4e9b2b75d020f7d8140551ae4..9376e87800dd8a83574b359dd8cc20e78be2ddf7 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -475,7 +498,7 @@ final class ExtensionSchemaFull extends ExtensionSchema { Object findExtensionByNumber( ExtensionRegistryLite extensionRegistry, MessageLite defaultInstance, int number) { return ((ExtensionRegistry) extensionRegistry) - .findImmutableExtensionByNumber(((Message) defaultInstance).getDescriptorForType(), number); + .findExtensionByNumber(((Message) defaultInstance).getDescriptorForType(), number); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java b/java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java index 8e4770dbbe44801634acdad4f4587cea562e888d..7e20ed2ff6bc57bf9ff2c0e9e04715b91ea342d6 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -13,7 +36,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -@CheckReturnValue @SuppressWarnings("unchecked") final class ExtensionSchemaLite extends ExtensionSchema { @@ -234,7 +256,7 @@ final class ExtensionSchemaLite extends ExtensionSchema { case GROUP: // Special case handling for non-repeated sub-messages: merge in-place rather than // building up new sub-messages and merging those, which is too slow. - // TODO: clean this up + // TODO(b/249368670): clean this up if (!extension.isRepeated()) { Object oldValue = extensions.getField(extension.descriptor); if (oldValue instanceof GeneratedMessageLite) { @@ -257,7 +279,7 @@ final class ExtensionSchemaLite extends ExtensionSchema { case MESSAGE: // Special case handling for non-repeated sub-messages: merge in-place rather than // building up new sub-messages and merging those, which is too slow. - // TODO: clean this up + // TODO(b/249368670): clean this up if (!extension.isRepeated()) { Object oldValue = extensions.getField(extension.descriptor); if (oldValue instanceof GeneratedMessageLite) { @@ -287,7 +309,7 @@ final class ExtensionSchemaLite extends ExtensionSchema { switch (extension.getLiteType()) { case MESSAGE: case GROUP: - // TODO: this shouldn't be reachable, clean this up + // TODO(b/249368670): this shouldn't be reachable, clean this up Object oldValue = extensions.getField(extension.descriptor); if (oldValue != null) { value = Internal.mergeMessage(oldValue, value); diff --git a/java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java b/java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java index cd8c852e9e3aa37b7968d94b0940554733b09db3..46ce327d133e3c48cb8266e83384189bcc851bf7 100644 --- a/java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java +++ b/java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java @@ -1,13 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -@CheckReturnValue final class ExtensionSchemas { private static final ExtensionSchema LITE_SCHEMA = new ExtensionSchemaLite(); private static final ExtensionSchema FULL_SCHEMA = loadSchemaForFullRuntime(); diff --git a/java/core/src/main/java/com/google/protobuf/FieldInfo.java b/java/core/src/main/java/com/google/protobuf/FieldInfo.java index 77a220c2a59f64cbaede3404dd8792a2f9029cdb..71a307a895b60a5268d89a50af5df2e594491770 100644 --- a/java/core/src/main/java/com/google/protobuf/FieldInfo.java +++ b/java/core/src/main/java/com/google/protobuf/FieldInfo.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -13,7 +36,6 @@ import com.google.protobuf.Internal.EnumVerifier; import java.lang.reflect.Field; /** Information for a single field in a protobuf message class. */ -@CheckReturnValue @ExperimentalApi final class FieldInfo implements Comparable { private final Field field; @@ -33,7 +55,7 @@ final class FieldInfo implements Comparable { */ private final Class oneofStoredType; - // TODO: make map default entry lazy? + // TODO(liujisi): make map default entry lazy? private final Object mapDefaultEntry; private final EnumVerifier enumVerifier; @@ -155,8 +177,8 @@ final class FieldInfo implements Comparable { cachedSizeField); } - /** Constructor for a field with explicit presence (e.g. proto2). */ - public static FieldInfo forExplicitPresenceField( + /** Constructor for a proto2 optional field. */ + public static FieldInfo forProto2OptionalField( Field field, int fieldNumber, FieldType fieldType, @@ -240,8 +262,8 @@ final class FieldInfo implements Comparable { } } - /** Constructor for a legacy required field. */ - public static FieldInfo forLegacyRequiredField( + /** Constructor for a proto2 required field. */ + public static FieldInfo forProto2RequiredField( Field field, int fieldNumber, FieldType fieldType, @@ -525,10 +547,10 @@ final class FieldInfo implements Comparable { } if (presenceField != null) { if (required) { - return forLegacyRequiredField( + return forProto2RequiredField( field, fieldNumber, type, presenceField, presenceMask, enforceUtf8, enumVerifier); } else { - return forExplicitPresenceField( + return forProto2OptionalField( field, fieldNumber, type, presenceField, presenceMask, enforceUtf8, enumVerifier); } } diff --git a/java/core/src/main/java/com/google/protobuf/FieldSet.java b/java/core/src/main/java/com/google/protobuf/FieldSet.java index d2a5d48fb8ed5154a36bea8f856270b47301a7f6..e30cf9063216e9088b02eca921149b875e4616b2 100644 --- a/java/core/src/main/java/com/google/protobuf/FieldSet.java +++ b/java/core/src/main/java/com/google/protobuf/FieldSet.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -97,6 +120,7 @@ final class FieldSet> { } /** Make this FieldSet immutable from this point forward. */ + @SuppressWarnings("unchecked") public void makeImmutable() { if (isImmutable) { return; @@ -162,6 +186,7 @@ final class FieldSet> { return clone; } + // ================================================================= /** See {@link Message.Builder#clear()}. */ @@ -265,14 +290,14 @@ final class FieldSet> { // Wrap the contents in a new list so that the caller cannot change // the list's contents after setting it. - final List newList = new ArrayList<>(); + final List newList = new ArrayList(); newList.addAll((List) value); for (final Object element : newList) { - verifyType(descriptor, element); + verifyType(descriptor.getLiteType(), element); } value = newList; } else { - verifyType(descriptor, value); + verifyType(descriptor.getLiteType(), value); } if (value instanceof LazyField) { @@ -336,7 +361,7 @@ final class FieldSet> { throw new IndexOutOfBoundsException(); } - verifyType(descriptor, value); + verifyType(descriptor.getLiteType(), value); ((List) list).set(index, value); } @@ -351,7 +376,7 @@ final class FieldSet> { "addRepeatedField() can only be called on repeated fields."); } - verifyType(descriptor, value); + verifyType(descriptor.getLiteType(), value); final Object existingValue = getField(descriptor); List list; @@ -370,21 +395,22 @@ final class FieldSet> { * (For repeated fields, this checks if the object is the right type to be one element of the * field.) * - * @throws IllegalArgumentException the value is not of the right type + * @throws IllegalArgumentException The value is not of the right type. */ - private void verifyType(final T descriptor, final Object value) { - if (!isValidType(descriptor.getLiteType(), value)) { + private void verifyType(final WireFormat.FieldType type, final Object value) { + if (!isValidType(type, value)) { + // TODO(kenton): When chaining calls to setField(), it can be hard to + // tell from the stack trace which exact call failed, since the whole + // chain is considered one line of code. It would be nice to print + // more information here, e.g. naming the field. We used to do that. + // But we can't now that FieldSet doesn't use descriptors. Maybe this + // isn't a big deal, though, since it would only really apply when using + // reflection and generally people don't chain reflection setters. throw new IllegalArgumentException( - String.format( - "Wrong object type used with protocol message reflection.\n" - + "Field number: %d, field java type: %s, value type: %s\n", - descriptor.getNumber(), - descriptor.getLiteType().getJavaType(), - value.getClass().getName())); + "Wrong object type used with protocol message reflection."); } } - private static boolean isValidType(final WireFormat.FieldType type, final Object value) { checkNotNull(value); switch (type.getJavaType()) { @@ -403,8 +429,10 @@ final class FieldSet> { case BYTE_STRING: return value instanceof ByteString || value instanceof byte[]; case ENUM: + // TODO(kenton): Caller must do type checking here, I guess. return (value instanceof Integer || value instanceof Internal.EnumLite); case MESSAGE: + // TODO(kenton): Caller must do type checking here, I guess. return (value instanceof MessageLite) || (value instanceof LazyField); } return false; @@ -432,36 +460,34 @@ final class FieldSet> { return true; } + @SuppressWarnings("unchecked") private static > boolean isInitialized( final Map.Entry entry) { final T descriptor = entry.getKey(); if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE) { if (descriptor.isRepeated()) { - for (final Object element : (List) entry.getValue()) { - if (!isMessageFieldValueInitialized(element)) { + for (final MessageLite element : (List) entry.getValue()) { + if (!element.isInitialized()) { return false; } } } else { - return isMessageFieldValueInitialized(entry.getValue()); + Object value = entry.getValue(); + if (value instanceof MessageLite) { + if (!((MessageLite) value).isInitialized()) { + return false; + } + } else if (value instanceof LazyField) { + return true; + } else { + throw new IllegalArgumentException( + "Wrong object type used with protocol message reflection."); + } } } return true; } - private static boolean isMessageFieldValueInitialized(Object value) { - if (value instanceof MessageLiteOrBuilder) { - // Message fields cannot have builder values in FieldSet, but can in FieldSet.Builder, and - // this method is used by FieldSet.Builder.isInitialized. - return ((MessageLiteOrBuilder) value).isInitialized(); - } else if (value instanceof LazyField) { - return true; - } else { - throw new IllegalArgumentException( - "Wrong object type used with protocol message reflection."); - } - } - /** * Given a field type, return the wire type. * @@ -530,15 +556,18 @@ final class FieldSet> { } } + // TODO(kenton): Move static parsing and serialization methods into some + // other class. Probably WireFormat. + /** * Read a field of any primitive type for immutable messages from a CodedInputStream. Enums, * groups, and embedded messages are not handled by this method. * - * @param input the stream from which to read - * @param type declared type of the field - * @param checkUtf8 When true, check that the input is valid UTF-8 - * @return an object representing the field's value, of the exact type which would be returned by - * {@link Message#getField(Descriptors.FieldDescriptor)} for this field + * @param input The stream from which to read. + * @param type Declared type of the field. + * @param checkUtf8 When true, check that the input is valid utf8. + * @return An object representing the field's value, of the exact type which would be returned by + * {@link Message#getField(Descriptors.FieldDescriptor)} for this field. */ public static Object readPrimitiveField( CodedInputStream input, final WireFormat.FieldType type, boolean checkUtf8) @@ -550,6 +579,7 @@ final class FieldSet> { } } + /** See {@link Message#writeTo(CodedOutputStream)}. */ public void writeTo(final CodedOutputStream output) throws IOException { for (int i = 0; i < fields.getNumArrayEntries(); i++) { @@ -579,11 +609,9 @@ final class FieldSet> { && !descriptor.isPacked()) { Object value = entry.getValue(); if (value instanceof LazyField) { - ByteString valueBytes = ((LazyField) value).toByteString(); - output.writeRawMessageSetExtension(entry.getKey().getNumber(), valueBytes); - } else { - output.writeMessageSetExtension(entry.getKey().getNumber(), (MessageLite) value); + value = ((LazyField) value).getValue(); } + output.writeMessageSetExtension(entry.getKey().getNumber(), (MessageLite) value); } else { writeField(descriptor, entry.getValue(), output); } @@ -705,17 +733,13 @@ final class FieldSet> { if (descriptor.isRepeated()) { final List valueList = (List) value; if (descriptor.isPacked()) { - if (valueList.isEmpty()) { - // The tag should not be written for empty packed fields. - return; - } output.writeTag(number, WireFormat.WIRETYPE_LENGTH_DELIMITED); // Compute the total data size so the length can be written. int dataSize = 0; for (final Object element : valueList) { dataSize += computeElementSizeNoTag(type, element); } - output.writeUInt32NoTag(dataSize); + output.writeRawVarint32(dataSize); // Write the data itself, without any tags. for (final Object element : valueList) { writeElementNoTag(output, type, element); @@ -810,6 +834,8 @@ final class FieldSet> { */ static int computeElementSizeNoTag(final WireFormat.FieldType type, final Object value) { switch (type) { + // Note: Minor violation of 80-char limit rule here because this would + // actually be harder to read if we wrapped the lines. case DOUBLE: return CodedOutputStream.computeDoubleSizeNoTag((Double) value); case FLOAT: @@ -874,21 +900,17 @@ final class FieldSet> { WireFormat.FieldType type = descriptor.getLiteType(); int number = descriptor.getNumber(); if (descriptor.isRepeated()) { - List valueList = (List) value; if (descriptor.isPacked()) { - if (valueList.isEmpty()) { - return 0; - } int dataSize = 0; - for (final Object element : valueList) { + for (final Object element : (List) value) { dataSize += computeElementSizeNoTag(type, element); } return dataSize + CodedOutputStream.computeTagSize(number) - + CodedOutputStream.computeUInt32SizeNoTag(dataSize); + + CodedOutputStream.computeRawVarint32Size(dataSize); } else { int size = 0; - for (final Object element : valueList) { + for (final Object element : (List) value) { size += computeElementSize(type, number, element); } return size; @@ -1089,14 +1111,15 @@ final class FieldSet> { // Wrap the contents in a new list so that the caller cannot change // the list's contents after setting it. - final List newList = new ArrayList((List) value); + final List newList = new ArrayList(); + newList.addAll((List) value); for (final Object element : newList) { - verifyType(descriptor, element); + verifyType(descriptor.getLiteType(), element); hasNestedBuilders = hasNestedBuilders || element instanceof MessageLite.Builder; } value = newList; } else { - verifyType(descriptor, value); + verifyType(descriptor.getLiteType(), value); } if (value instanceof LazyField) { @@ -1122,10 +1145,10 @@ final class FieldSet> { public int getRepeatedFieldCount(final T descriptor) { if (!descriptor.isRepeated()) { throw new IllegalArgumentException( - "getRepeatedFieldCount() can only be called on repeated fields."); + "getRepeatedField() can only be called on repeated fields."); } - final Object value = getFieldAllowBuilders(descriptor); + final Object value = getField(descriptor); if (value == null) { return 0; } else { @@ -1177,12 +1200,12 @@ final class FieldSet> { hasNestedBuilders = hasNestedBuilders || value instanceof MessageLite.Builder; - final Object list = getFieldAllowBuilders(descriptor); + final Object list = getField(descriptor); if (list == null) { throw new IndexOutOfBoundsException(); } - verifyType(descriptor, value); + verifyType(descriptor.getLiteType(), value); ((List) list).set(index, value); } @@ -1200,9 +1223,9 @@ final class FieldSet> { hasNestedBuilders = hasNestedBuilders || value instanceof MessageLite.Builder; - verifyType(descriptor, value); + verifyType(descriptor.getLiteType(), value); - final Object existingValue = getFieldAllowBuilders(descriptor); + final Object existingValue = getField(descriptor); List list; if (existingValue == null) { list = new ArrayList<>(); @@ -1221,20 +1244,15 @@ final class FieldSet> { * * @throws IllegalArgumentException The value is not of the right type. */ - private void verifyType(final T descriptor, final Object value) { - if (!FieldSet.isValidType(descriptor.getLiteType(), value)) { + private static void verifyType(final WireFormat.FieldType type, final Object value) { + if (!FieldSet.isValidType(type, value)) { // Builder can accept Message.Builder values even though FieldSet will reject. - if (descriptor.getLiteType().getJavaType() == WireFormat.JavaType.MESSAGE + if (type.getJavaType() == WireFormat.JavaType.MESSAGE && value instanceof MessageLite.Builder) { return; } throw new IllegalArgumentException( - String.format( - "Wrong object type used with protocol message reflection.\n" - + "Field number: %d, field java type: %s, value type: %s\n", - descriptor.getNumber(), - descriptor.getLiteType().getJavaType(), - value.getClass().getName())); + "Wrong object type used with protocol message reflection."); } } @@ -1270,7 +1288,7 @@ final class FieldSet> { } } - @SuppressWarnings("unchecked") + @SuppressWarnings({"unchecked", "rawtypes"}) private void mergeFromField(final Map.Entry entry) { final T descriptor = entry.getKey(); Object otherValue = entry.getValue(); @@ -1279,16 +1297,16 @@ final class FieldSet> { } if (descriptor.isRepeated()) { - List value = (List) getFieldAllowBuilders(descriptor); + Object value = getField(descriptor); if (value == null) { value = new ArrayList<>(); - fields.put(descriptor, value); } - for (Object element : (List) otherValue) { - value.add(FieldSet.cloneIfMutable(element)); + for (Object element : (List) otherValue) { + ((List) value).add(FieldSet.cloneIfMutable(element)); } + fields.put(descriptor, value); } else if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE) { - Object value = getFieldAllowBuilders(descriptor); + Object value = getField(descriptor); if (value == null) { fields.put(descriptor, FieldSet.cloneIfMutable(otherValue)); } else { diff --git a/java/core/src/main/java/com/google/protobuf/FieldType.java b/java/core/src/main/java/com/google/protobuf/FieldType.java index a7839f7d302d4a83768f43d9bc97b56820ccba59..72327537fd2040ae28b9bda808382b2192a55759 100644 --- a/java/core/src/main/java/com/google/protobuf/FieldType.java +++ b/java/core/src/main/java/com/google/protobuf/FieldType.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/FloatArrayList.java b/java/core/src/main/java/com/google/protobuf/FloatArrayList.java index 4a84b92f5dcb53791be2638b489934a301d149c6..e6feba8a354c28795ec57a7629334c644b11dd0f 100644 --- a/java/core/src/main/java/com/google/protobuf/FloatArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/FloatArrayList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -22,7 +45,10 @@ import java.util.RandomAccess; final class FloatArrayList extends AbstractProtobufList implements FloatList, RandomAccess, PrimitiveNonBoxingCollection { - private static final FloatArrayList EMPTY_LIST = new FloatArrayList(new float[0], 0, false); + private static final FloatArrayList EMPTY_LIST = new FloatArrayList(new float[0], 0); + static { + EMPTY_LIST.makeImmutable(); + } public static FloatArrayList emptyList() { return EMPTY_LIST; @@ -39,15 +65,14 @@ final class FloatArrayList extends AbstractProtobufList /** Constructs a new mutable {@code FloatArrayList} with default capacity. */ FloatArrayList() { - this(new float[DEFAULT_CAPACITY], 0, true); + this(new float[DEFAULT_CAPACITY], 0); } /** * Constructs a new mutable {@code FloatArrayList} containing the same elements as {@code other}. */ - private FloatArrayList(float[] other, int size, boolean isMutable) { - super(isMutable); - this.array = other; + private FloatArrayList(float[] other, int size) { + array = other; this.size = size; } @@ -100,7 +125,7 @@ final class FloatArrayList extends AbstractProtobufList if (capacity < size) { throw new IllegalArgumentException(); } - return new FloatArrayList(Arrays.copyOf(array, capacity), size, true); + return new FloatArrayList(Arrays.copyOf(array, capacity), size); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java index d3ff341dc008d4ef1945ef2861174af70bcbbfbf..de0ee11b7e469078c87c8c46fa123f61fd357110 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -13,6 +36,7 @@ import com.google.protobuf.Descriptors.EnumValueDescriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.OneofDescriptor; + import java.io.IOException; import java.io.InputStream; import java.io.ObjectStreamException; @@ -27,23 +51,25 @@ import java.util.Map; import java.util.TreeMap; /** - * All generated protocol message classes extend this class. This class implements most of the - * Message and Builder interfaces using Java reflection. Users can ignore this class and pretend - * that generated messages implement the Message interface directly. + * All generated protocol message classes extend this class. This class + * implements most of the Message and Builder interfaces using Java reflection. + * Users can ignore this class and pretend that generated messages implement + * the Message interface directly. * * @author kenton@google.com Kenton Varda */ -public abstract class GeneratedMessage extends AbstractMessage implements Serializable { +public abstract class GeneratedMessage extends AbstractMessage + implements Serializable { private static final long serialVersionUID = 1L; /** - * For testing. Allows a test to disable the optimization that avoids using field builders for - * nested messages until they are requested. By disabling this optimization, existing tests can be - * reused to test the field builders. + * For testing. Allows a test to disable the optimization that avoids using + * field builders for nested messages until they are requested. By disabling + * this optimization, existing tests can be reused to test the field builders. */ protected static boolean alwaysUseFieldBuilders = false; - /** For use by generated code only. */ + /** For use by generated code only. */ protected UnknownFieldSet unknownFields; protected GeneratedMessage() { @@ -56,22 +82,24 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public Parser getParserForType() { - throw new UnsupportedOperationException("This is supposed to be overridden by subclasses."); + throw new UnsupportedOperationException( + "This is supposed to be overridden by subclasses."); } - /** - * For testing. Allows a test to disable the optimization that avoids using field builders for - * nested messages until they are requested. By disabling this optimization, existing tests can be - * reused to test the field builders. See {@link RepeatedFieldBuilder} and {@link - * SingleFieldBuilder}. - */ + /** + * For testing. Allows a test to disable the optimization that avoids using + * field builders for nested messages until they are requested. By disabling + * this optimization, existing tests can be reused to test the field builders. + * See {@link RepeatedFieldBuilder} and {@link SingleFieldBuilder}. + */ static void enableAlwaysUseFieldBuildersForTesting() { alwaysUseFieldBuilders = true; } /** - * Get the FieldAccessorTable for this type. We can't have the message class pass this in to the - * constructor because of bootstrapping trouble with DescriptorProtos. + * Get the FieldAccessorTable for this type. We can't have the message + * class pass this in to the constructor because of bootstrapping trouble + * with DescriptorProtos. */ protected abstract FieldAccessorTable internalGetFieldAccessorTable(); @@ -81,14 +109,16 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Internal helper to return a modifiable map containing all the fields. The returned Map is - * modifialbe so that the caller can add additional extension fields to implement {@link - * #getAllFields()}. + * Internal helper to return a modifiable map containing all the fields. + * The returned Map is modifialbe so that the caller can add additional + * extension fields to implement {@link #getAllFields()}. * * @param getBytesForString whether to generate ByteString for string fields */ - private Map getAllFieldsMutable(boolean getBytesForString) { - final TreeMap result = new TreeMap(); + private Map getAllFieldsMutable( + boolean getBytesForString) { + final TreeMap result = + new TreeMap(); final Descriptor descriptor = internalGetFieldAccessorTable().descriptor; final List fields = descriptor.getFields(); @@ -144,8 +174,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // Check that embedded messages are initialized. if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { if (field.isRepeated()) { - @SuppressWarnings("unchecked") - final List messageList = (List) getField(field); + @SuppressWarnings("unchecked") final + List messageList = (List) getField(field); for (final Message element : messageList) { if (!element.isInitialized()) { return false; @@ -164,19 +194,23 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public Map getAllFields() { - return Collections.unmodifiableMap(getAllFieldsMutable(/* getBytesForString = */ false)); + return Collections.unmodifiableMap( + getAllFieldsMutable(/* getBytesForString = */ false)); } /** - * Returns a collection of all the fields in this message which are set and their corresponding - * values. A singular ("required" or "optional") field is set iff hasField() returns true for that - * field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values - * are exactly what would be returned by calling {@link #getFieldRaw(Descriptors.FieldDescriptor)} - * for each field. The map is guaranteed to be a sorted map, so iterating over it will return - * fields in order by field number. + * Returns a collection of all the fields in this message which are set + * and their corresponding values. A singular ("required" or "optional") + * field is set iff hasField() returns true for that field. A "repeated" + * field is set iff getRepeatedFieldCount() is greater than zero. The + * values are exactly what would be returned by calling + * {@link #getFieldRaw(Descriptors.FieldDescriptor)} for each field. The map + * is guaranteed to be a sorted map, so iterating over it will return fields + * in order by field number. */ Map getAllFieldsRaw() { - return Collections.unmodifiableMap(getAllFieldsMutable(/* getBytesForString = */ true)); + return Collections.unmodifiableMap( + getAllFieldsMutable(/* getBytesForString = */ true)); } @Override @@ -200,11 +234,12 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Obtains the value of the given field, or the default value if it is not set. For primitive - * fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the - * value is returned. For embedded message fields, the sub-message is returned. For repeated - * fields, a java.util.List is returned. For present string fields, a ByteString is returned - * representing the bytes that the field contains. + * Obtains the value of the given field, or the default value if it is + * not set. For primitive fields, the boxed primitive value is returned. + * For enum fields, the EnumValueDescriptor for the value is returned. For + * embedded message fields, the sub-message is returned. For repeated + * fields, a java.util.List is returned. For present string fields, a + * ByteString is returned representing the bytes that the field contains. */ Object getFieldRaw(final FieldDescriptor field) { return internalGetFieldAccessorTable().getField(field).getRaw(this); @@ -212,30 +247,31 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public int getRepeatedFieldCount(final FieldDescriptor field) { - return internalGetFieldAccessorTable().getField(field).getRepeatedCount(this); + return internalGetFieldAccessorTable().getField(field) + .getRepeatedCount(this); } @Override public Object getRepeatedField(final FieldDescriptor field, final int index) { - return internalGetFieldAccessorTable().getField(field).getRepeated(this, index); + return internalGetFieldAccessorTable().getField(field) + .getRepeated(this, index); } @Override public UnknownFieldSet getUnknownFields() { - throw new UnsupportedOperationException("This is supposed to be overridden by subclasses."); + throw new UnsupportedOperationException( + "This is supposed to be overridden by subclasses."); } /** * Called by subclasses to parse an unknown field. - * * @return {@code true} unless the tag is an end-group tag. */ protected boolean parseUnknownField( CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, - int tag) - throws IOException { + int tag) throws IOException { return unknownFields.mergeFieldFrom(tag, input); } @@ -248,8 +284,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } } - protected static M parseWithIOException( - Parser parser, InputStream input, ExtensionRegistryLite extensions) throws IOException { + protected static M parseWithIOException(Parser parser, InputStream input, + ExtensionRegistryLite extensions) throws IOException { try { return parser.parseFrom(input, extensions); } catch (InvalidProtocolBufferException e) { @@ -257,8 +293,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } } - protected static M parseWithIOException( - Parser parser, CodedInputStream input) throws IOException { + protected static M parseWithIOException(Parser parser, + CodedInputStream input) throws IOException { try { return parser.parseFrom(input); } catch (InvalidProtocolBufferException e) { @@ -266,9 +302,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } } - protected static M parseWithIOException( - Parser parser, CodedInputStream input, ExtensionRegistryLite extensions) - throws IOException { + protected static M parseWithIOException(Parser parser, + CodedInputStream input, ExtensionRegistryLite extensions) throws IOException { try { return parser.parseFrom(input, extensions); } catch (InvalidProtocolBufferException e) { @@ -276,8 +311,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } } - protected static M parseDelimitedWithIOException( - Parser parser, InputStream input) throws IOException { + protected static M parseDelimitedWithIOException(Parser parser, + InputStream input) throws IOException { try { return parser.parseDelimitedFrom(input); } catch (InvalidProtocolBufferException e) { @@ -285,8 +320,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } } - protected static M parseDelimitedWithIOException( - Parser parser, InputStream input, ExtensionRegistryLite extensions) throws IOException { + protected static M parseDelimitedWithIOException(Parser parser, + InputStream input, ExtensionRegistryLite extensions) throws IOException { try { return parser.parseDelimitedFrom(input, extensions); } catch (InvalidProtocolBufferException e) { @@ -306,38 +341,46 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial return size; } - memoizedSize = MessageReflection.getSerializedSize(this, getAllFieldsRaw()); + memoizedSize = MessageReflection.getSerializedSize( + this, getAllFieldsRaw()); return memoizedSize; } - /** Used by parsing constructors in generated classes. */ + + + /** + * Used by parsing constructors in generated classes. + */ protected void makeExtensionsImmutable() { // Noop for messages without extensions. } /** - * TODO: remove this after b/29368482 is fixed. We need to move this interface to - * AbstractMessage in order to versioning GeneratedMessage but this move breaks binary - * compatibility for AppEngine. After AppEngine is fixed we can exclude this from google3. + * TODO(xiaofeng): remove this after b/29368482 is fixed. We need to move this + * interface to AbstractMessage in order to versioning GeneratedMessage but + * this move breaks binary compatibility for AppEngine. After AppEngine is + * fixed we can exclude this from google3. */ protected interface BuilderParent extends AbstractMessage.BuilderParent {} - /** TODO: remove this together with GeneratedMessage.BuilderParent. */ + /** + * TODO(xiaofeng): remove this together with GeneratedMessage.BuilderParent. + */ protected abstract Message.Builder newBuilderForType(BuilderParent parent); @Override protected Message.Builder newBuilderForType(final AbstractMessage.BuilderParent parent) { - return newBuilderForType( - new BuilderParent() { - @Override - public void markDirty() { - parent.markDirty(); - } - }); + return newBuilderForType(new BuilderParent() { + @Override + public void markDirty() { + parent.markDirty(); + } + }); } + @SuppressWarnings("unchecked") - public abstract static class Builder> + public abstract static class Builder > extends AbstractMessage.Builder { private BuilderParent builderParent; @@ -348,7 +391,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // to dispatch dirty invalidations. See GeneratedMessage.BuilderListener. private boolean isClean; - private UnknownFieldSet unknownFields = UnknownFieldSet.getDefaultInstance(); + private UnknownFieldSet unknownFields = + UnknownFieldSet.getDefaultInstance(); protected Builder() { this(null); @@ -363,7 +407,9 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial builderParent = null; } - /** Called by the subclass when a message is built. */ + /** + * Called by the subclass when a message is built. + */ protected void onBuilt() { if (builderParent != null) { markClean(); @@ -371,8 +417,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Called by the subclass or a builder to notify us that a message was built and may be cached - * and therefore invalidations are needed. + * Called by the subclass or a builder to notify us that a message was + * built and may be cached and therefore invalidations are needed. */ @Override protected void markClean() { @@ -390,14 +436,15 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public BuilderType clone() { - BuilderType builder = (BuilderType) getDefaultInstanceForType().newBuilderForType(); + BuilderType builder = + (BuilderType) getDefaultInstanceForType().newBuilderForType(); builder.mergeFrom(buildPartial()); return builder; } /** - * Called by the initialization and clear code paths to allow subclasses to reset any of their - * builtin fields back to the initial values. + * Called by the initialization and clear code paths to allow subclasses to + * reset any of their builtin fields back to the initial values. */ @Override public BuilderType clear() { @@ -407,8 +454,9 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Get the FieldAccessorTable for this type. We can't have the message class pass this in to the - * constructor because of bootstrapping trouble with DescriptorProtos. + * Get the FieldAccessorTable for this type. We can't have the message + * class pass this in to the constructor because of bootstrapping trouble + * with DescriptorProtos. */ protected abstract FieldAccessorTable internalGetFieldAccessorTable(); @@ -424,7 +472,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** Internal helper which returns a mutable map. */ private Map getAllFieldsMutable() { - final TreeMap result = new TreeMap(); + final TreeMap result = + new TreeMap(); final Descriptor descriptor = internalGetFieldAccessorTable().descriptor; final List fields = descriptor.getFields(); @@ -476,7 +525,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public Message.Builder getRepeatedFieldBuilder(final FieldDescriptor field, int index) { - return internalGetFieldAccessorTable().getField(field).getRepeatedBuilder(this, index); + return internalGetFieldAccessorTable().getField(field).getRepeatedBuilder( + this, index); } @Override @@ -526,18 +576,21 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public int getRepeatedFieldCount(final FieldDescriptor field) { - return internalGetFieldAccessorTable().getField(field).getRepeatedCount(this); + return internalGetFieldAccessorTable().getField(field) + .getRepeatedCount(this); } @Override public Object getRepeatedField(final FieldDescriptor field, final int index) { - return internalGetFieldAccessorTable().getField(field).getRepeated(this, index); + return internalGetFieldAccessorTable().getField(field) + .getRepeated(this, index); } @Override public BuilderType setRepeatedField( final FieldDescriptor field, final int index, final Object value) { - internalGetFieldAccessorTable().getField(field).setRepeated(this, index, value); + internalGetFieldAccessorTable().getField(field) + .setRepeated(this, index, value); return (BuilderType) this; } @@ -555,9 +608,12 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } @Override - public BuilderType mergeUnknownFields(final UnknownFieldSet unknownFields) { + public BuilderType mergeUnknownFields( + final UnknownFieldSet unknownFields) { this.unknownFields = - UnknownFieldSet.newBuilder(this.unknownFields).mergeFrom(unknownFields).build(); + UnknownFieldSet.newBuilder(this.unknownFields) + .mergeFrom(unknownFields) + .build(); onChanged(); return (BuilderType) this; } @@ -574,15 +630,16 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // Check that embedded messages are initialized. if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { if (field.isRepeated()) { - @SuppressWarnings("unchecked") - final List messageList = (List) getField(field); + @SuppressWarnings("unchecked") final + List messageList = (List) getField(field); for (final Message element : messageList) { if (!element.isInitialized()) { return false; } } } else { - if (hasField(field) && !((Message) getField(field)).isInitialized()) { + if (hasField(field) && + !((Message) getField(field)).isInitialized()) { return false; } } @@ -598,21 +655,20 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** * Called by subclasses to parse an unknown field. - * * @return {@code true} unless the tag is an end-group tag. */ protected boolean parseUnknownField( final CodedInputStream input, final UnknownFieldSet.Builder unknownFields, final ExtensionRegistryLite extensionRegistry, - final int tag) - throws IOException { + final int tag) throws IOException { return unknownFields.mergeFieldFrom(tag, input); } /** - * Implementation of {@link BuilderParent} for giving to our children. This small inner class - * makes it so we don't publicly expose the BuilderParent methods. + * Implementation of {@link BuilderParent} for giving to our children. This + * small inner class makes it so we don't publicly expose the BuilderParent + * methods. */ private class BuilderParentImpl implements BuilderParent { @@ -624,7 +680,6 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** * Gets the {@link BuilderParent} for giving to our children. - * * @return The builder parent for our children. */ protected BuilderParent getParentForChildren() { @@ -635,8 +690,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Called when a the builder or one of its nested children has changed and any parent should be - * notified of its invalidation. + * Called when a the builder or one of its nested children has changed + * and any parent should be notified of its invalidation. */ protected final void onChanged() { if (isClean && builderParent != null) { @@ -648,19 +703,22 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Gets the map field with the given field number. This method should be overridden in the - * generated message class if the message contains map fields. + * Gets the map field with the given field number. This method should be + * overridden in the generated message class if the message contains map + * fields. * - *

Unlike other field types, reflection support for map fields can't be implemented based on - * generated public API because we need to access a map field as a list in reflection API but - * the generated API only allows us to access it as a map. This method returns the underlying - * map field directly and thus enables us to access the map field as a list. + * Unlike other field types, reflection support for map fields can't be + * implemented based on generated public API because we need to access a + * map field as a list in reflection API but the generated API only allows + * us to access it as a map. This method returns the underlying map field + * directly and thus enables us to access the map field as a list. */ @SuppressWarnings({"unused", "rawtypes"}) protected MapField internalGetMapField(int fieldNumber) { // Note that we can't use descriptor names here because this method will // be called when descriptor is being initialized. - throw new RuntimeException("No map fields found in " + getClass().getName()); + throw new RuntimeException( + "No map fields found in " + getClass().getName()); } /** Like {@link #internalGetMapField} but return a mutable version. */ @@ -668,57 +726,76 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial protected MapField internalGetMutableMapField(int fieldNumber) { // Note that we can't use descriptor names here because this method will // be called when descriptor is being initialized. - throw new RuntimeException("No map fields found in " + getClass().getName()); + throw new RuntimeException( + "No map fields found in " + getClass().getName()); } } // ================================================================= // Extensions-related stuff - public interface ExtendableMessageOrBuilder - extends MessageOrBuilder { + public interface ExtendableMessageOrBuilder< + MessageType extends ExtendableMessage> extends MessageOrBuilder { // Re-define for return type covariance. @Override Message getDefaultInstanceForType(); /** Check if a singular extension is present. */ - boolean hasExtension(ExtensionLite extension); + boolean hasExtension( + ExtensionLite extension); /** Get the number of elements in a repeated extension. */ - int getExtensionCount(ExtensionLite> extension); + int getExtensionCount( + ExtensionLite> extension); /** Get the value of an extension. */ - Type getExtension(ExtensionLite extension); + Type getExtension( + ExtensionLite extension); /** Get one element of a repeated extension. */ - Type getExtension(ExtensionLite> extension, int index); + Type getExtension( + ExtensionLite> extension, + int index); /** Check if a singular extension is present. */ - boolean hasExtension(Extension extension); + boolean hasExtension( + Extension extension); /** Check if a singular extension is present. */ - boolean hasExtension(GeneratedExtension extension); + boolean hasExtension( + GeneratedExtension extension); /** Get the number of elements in a repeated extension. */ - int getExtensionCount(Extension> extension); + int getExtensionCount( + Extension> extension); /** Get the number of elements in a repeated extension. */ - int getExtensionCount(GeneratedExtension> extension); + int getExtensionCount( + GeneratedExtension> extension); /** Get the value of an extension. */ - Type getExtension(Extension extension); + Type getExtension( + Extension extension); /** Get the value of an extension. */ - Type getExtension(GeneratedExtension extension); + Type getExtension( + GeneratedExtension extension); /** Get one element of a repeated extension. */ - Type getExtension(Extension> extension, int index); + Type getExtension( + Extension> extension, + int index); /** Get one element of a repeated extension. */ - Type getExtension(GeneratedExtension> extension, int index); + Type getExtension( + GeneratedExtension> extension, + int index); } /** - * Generated message classes for message types that contain extension ranges subclass this. + * Generated message classes for message types that contain extension ranges + * subclass this. * - *

This class implements type-safe accessors for extensions. They implement all the same - * operations that you can do with normal fields -- e.g. "has", "get", and "getCount" -- but for - * extensions. The extensions are identified using instances of the class {@link - * GeneratedExtension}; the protocol compiler generates a static instance of this class for every - * extension in its input. Through the magic of generics, all is made type-safe. + *

This class implements type-safe accessors for extensions. They + * implement all the same operations that you can do with normal fields -- + * e.g. "has", "get", and "getCount" -- but for extensions. The extensions + * are identified using instances of the class {@link GeneratedExtension}; + * the protocol compiler generates a static instance of this class for every + * extension in its input. Through the magic of generics, all is made + * type-safe. * *

For example, imagine you have the {@code .proto} file: * @@ -743,8 +820,10 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial * *

See also {@link ExtendableBuilder}. */ - public abstract static class ExtendableMessage - extends GeneratedMessage implements ExtendableMessageOrBuilder { + public abstract static class ExtendableMessage< + MessageType extends ExtendableMessage> + extends GeneratedMessage + implements ExtendableMessageOrBuilder { private static final long serialVersionUID = 1L; @@ -754,20 +833,22 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial this.extensions = FieldSet.newFieldSet(); } - protected ExtendableMessage(ExtendableBuilder builder) { + protected ExtendableMessage( + ExtendableBuilder builder) { super(builder); this.extensions = builder.buildExtensions(); } - private void verifyExtensionContainingType(final Extension extension) { - if (extension.getDescriptor().getContainingType() != getDescriptorForType()) { + private void verifyExtensionContainingType( + final Extension extension) { + if (extension.getDescriptor().getContainingType() != + getDescriptorForType()) { // This can only happen if someone uses unchecked operations. throw new IllegalArgumentException( - "Extension is for type \"" - + extension.getDescriptor().getContainingType().getFullName() - + "\" which does not match message type \"" - + getDescriptorForType().getFullName() - + "\"."); + "Extension is for type \"" + + extension.getDescriptor().getContainingType().getFullName() + + "\" which does not match message type \"" + + getDescriptorForType().getFullName() + "\"."); } } @@ -805,10 +886,12 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial if (value == null) { if (descriptor.isRepeated()) { return (Type) Collections.emptyList(); - } else if (descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { + } else if (descriptor.getJavaType() == + FieldDescriptor.JavaType.MESSAGE) { return (Type) extension.getMessageDefaultInstance(); } else { - return (Type) extension.fromReflectionType(descriptor.getDefaultValue()); + return (Type) extension.fromReflectionType( + descriptor.getDefaultValue()); } } else { return (Type) extension.fromReflectionType(value); @@ -824,8 +907,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial verifyExtensionContainingType(extension); FieldDescriptor descriptor = extension.getDescriptor(); - return (Type) - extension.singularFromReflectionType(extensions.getRepeatedField(descriptor, index)); + return (Type) extension.singularFromReflectionType( + extensions.getRepeatedField(descriptor, index)); } /** Check if a singular extension is present. */ @@ -841,7 +924,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount(final Extension> extension) { + public final int getExtensionCount( + final Extension> extension) { return getExtensionCount((ExtensionLite>) extension); } /** Get the number of elements in a repeated extension. */ @@ -857,7 +941,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** Get the value of an extension. */ @Override - public final Type getExtension(final GeneratedExtension extension) { + public final Type getExtension( + final GeneratedExtension extension) { return getExtension((ExtensionLite) extension); } /** Get one element of a repeated extension. */ @@ -888,33 +973,33 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, - int tag) - throws IOException { + int tag) throws IOException { return MessageReflection.mergeFieldFrom( - input, - unknownFields, - extensionRegistry, - getDescriptorForType(), - new MessageReflection.ExtensionAdapter(extensions), - tag); + input, unknownFields, extensionRegistry, getDescriptorForType(), + new MessageReflection.ExtensionAdapter(extensions), tag); } - /** Used by parsing constructors in generated classes. */ + + /** + * Used by parsing constructors in generated classes. + */ @Override protected void makeExtensionsImmutable() { extensions.makeImmutable(); } /** - * Used by subclasses to serialize extensions. Extension ranges may be interleaved with field - * numbers, but we must write them in canonical (sorted by field number) order. ExtensionWriter - * helps us write individual ranges of extensions at once. + * Used by subclasses to serialize extensions. Extension ranges may be + * interleaved with field numbers, but we must write them in canonical + * (sorted by field number) order. ExtensionWriter helps us write + * individual ranges of extensions at once. */ protected class ExtensionWriter { // Imagine how much simpler this code would be if Java iterators had // a way to get the next element without advancing the iterator. - private final Iterator> iter = extensions.iterator(); + private final Iterator> iter = + extensions.iterator(); private Map.Entry next; private final boolean messageSetWireFormat; @@ -925,21 +1010,22 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial this.messageSetWireFormat = messageSetWireFormat; } - public void writeUntil(final int end, final CodedOutputStream output) throws IOException { + public void writeUntil(final int end, final CodedOutputStream output) + throws IOException { while (next != null && next.getKey().getNumber() < end) { FieldDescriptor descriptor = next.getKey(); - if (messageSetWireFormat - && descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE - && !descriptor.isRepeated()) { + if (messageSetWireFormat && descriptor.getLiteJavaType() == + WireFormat.JavaType.MESSAGE && + !descriptor.isRepeated()) { if (next instanceof LazyField.LazyEntry) { - output.writeRawMessageSetExtension( - descriptor.getNumber(), + output.writeRawMessageSetExtension(descriptor.getNumber(), ((LazyField.LazyEntry) next).getField().toByteString()); } else { - output.writeMessageSetExtension(descriptor.getNumber(), (Message) next.getValue()); + output.writeMessageSetExtension(descriptor.getNumber(), + (Message) next.getValue()); } } else { - // TODO: Taken care of following code, it may cause + // TODO(xiangl): Taken care of following code, it may cause // problem when we use LazyField for normal fields/extensions. // Due to the optional field can be duplicated at the end of // serialized bytes, which will make the serialized size change @@ -960,7 +1046,6 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial protected ExtensionWriter newExtensionWriter() { return new ExtensionWriter(false); } - protected ExtensionWriter newMessageSetExtensionWriter() { return new ExtensionWriter(true); } @@ -969,7 +1054,6 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial protected int extensionsSerializedSize() { return extensions.getSerializedSize(); } - protected int extensionsSerializedSizeAsMessageSet() { return extensions.getMessageSetSerializedSize(); } @@ -1041,7 +1125,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } @Override - public Object getRepeatedField(final FieldDescriptor field, final int index) { + public Object getRepeatedField(final FieldDescriptor field, + final int index) { if (field.isExtension()) { verifyContainingType(field); return extensions.getRepeatedField(field, index); @@ -1052,19 +1137,23 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial private void verifyContainingType(final FieldDescriptor field) { if (field.getContainingType() != getDescriptorForType()) { - throw new IllegalArgumentException("FieldDescriptor does not match message type."); + throw new IllegalArgumentException( + "FieldDescriptor does not match message type."); } } } /** - * Generated message builders for message types that contain extension ranges subclass this. + * Generated message builders for message types that contain extension ranges + * subclass this. * - *

This class implements type-safe accessors for extensions. They implement all the same - * operations that you can do with normal fields -- e.g. "get", "set", and "add" -- but for - * extensions. The extensions are identified using instances of the class {@link - * GeneratedExtension}; the protocol compiler generates a static instance of this class for every - * extension in its input. Through the magic of generics, all is made type-safe. + *

This class implements type-safe accessors for extensions. They + * implement all the same operations that you can do with normal fields -- + * e.g. "get", "set", and "add" -- but for extensions. The extensions are + * identified using instances of the class {@link GeneratedExtension}; the + * protocol compiler generates a static instance of this class for every + * extension in its input. Through the magic of generics, all is made + * type-safe. * *

For example, imagine you have the {@code .proto} file: * @@ -1093,15 +1182,17 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial */ @SuppressWarnings("unchecked") public abstract static class ExtendableBuilder< - MessageType extends ExtendableMessage, - BuilderType extends ExtendableBuilder> - extends Builder implements ExtendableMessageOrBuilder { + MessageType extends ExtendableMessage, + BuilderType extends ExtendableBuilder> + extends Builder + implements ExtendableMessageOrBuilder { private FieldSet extensions = FieldSet.emptySet(); protected ExtendableBuilder() {} - protected ExtendableBuilder(BuilderParent parent) { + protected ExtendableBuilder( + BuilderParent parent) { super(parent); } @@ -1130,15 +1221,16 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } } - private void verifyExtensionContainingType(final Extension extension) { - if (extension.getDescriptor().getContainingType() != getDescriptorForType()) { + private void verifyExtensionContainingType( + final Extension extension) { + if (extension.getDescriptor().getContainingType() != + getDescriptorForType()) { // This can only happen if someone uses unchecked operations. throw new IllegalArgumentException( - "Extension is for type \"" - + extension.getDescriptor().getContainingType().getFullName() - + "\" which does not match message type \"" - + getDescriptorForType().getFullName() - + "\"."); + "Extension is for type \"" + + extension.getDescriptor().getContainingType().getFullName() + + "\" which does not match message type \"" + + getDescriptorForType().getFullName() + "\"."); } } @@ -1173,10 +1265,12 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial if (value == null) { if (descriptor.isRepeated()) { return (Type) Collections.emptyList(); - } else if (descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { + } else if (descriptor.getJavaType() == + FieldDescriptor.JavaType.MESSAGE) { return (Type) extension.getMessageDefaultInstance(); } else { - return (Type) extension.fromReflectionType(descriptor.getDefaultValue()); + return (Type) extension.fromReflectionType( + descriptor.getDefaultValue()); } } else { return (Type) extension.fromReflectionType(value); @@ -1191,13 +1285,14 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial verifyExtensionContainingType(extension); FieldDescriptor descriptor = extension.getDescriptor(); - return (Type) - extension.singularFromReflectionType(extensions.getRepeatedField(descriptor, index)); + return (Type) extension.singularFromReflectionType( + extensions.getRepeatedField(descriptor, index)); } /** Set the value of an extension. */ public final BuilderType setExtension( - final ExtensionLite extensionLite, final Type value) { + final ExtensionLite extensionLite, + final Type value) { Extension extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); @@ -1211,27 +1306,30 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** Set the value of one element of a repeated extension. */ public final BuilderType setExtension( final ExtensionLite> extensionLite, - final int index, - final Type value) { + final int index, final Type value) { Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); ensureExtensionsIsMutable(); final FieldDescriptor descriptor = extension.getDescriptor(); - extensions.setRepeatedField(descriptor, index, extension.singularToReflectionType(value)); + extensions.setRepeatedField( + descriptor, index, + extension.singularToReflectionType(value)); onChanged(); return (BuilderType) this; } /** Append a value to a repeated extension. */ public final BuilderType addExtension( - final ExtensionLite> extensionLite, final Type value) { + final ExtensionLite> extensionLite, + final Type value) { Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); ensureExtensionsIsMutable(); final FieldDescriptor descriptor = extension.getDescriptor(); - extensions.addRepeatedField(descriptor, extension.singularToReflectionType(value)); + extensions.addRepeatedField( + descriptor, extension.singularToReflectionType(value)); onChanged(); return (BuilderType) this; } @@ -1261,7 +1359,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount(final Extension> extension) { + public final int getExtensionCount( + final Extension> extension) { return getExtensionCount((ExtensionLite>) extension); } /** Get the number of elements in a repeated extension. */ @@ -1277,7 +1376,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** Get the value of an extension. */ @Override - public final Type getExtension(final GeneratedExtension extension) { + public final Type getExtension( + final GeneratedExtension extension) { return getExtension((ExtensionLite) extension); } /** Get the value of an extension. */ @@ -1304,14 +1404,14 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** Set the value of one element of a repeated extension. */ public final BuilderType setExtension( - final Extension> extension, final int index, final Type value) { + final Extension> extension, + final int index, final Type value) { return setExtension((ExtensionLite>) extension, index, value); } /** Set the value of one element of a repeated extension. */ public BuilderType setExtension( final GeneratedExtension> extension, - final int index, - final Type value) { + final int index, final Type value) { return setExtension((ExtensionLite>) extension, index, value); } /** Append a value to a repeated extension. */ @@ -1325,11 +1425,13 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial return addExtension((ExtensionLite>) extension, value); } /** Clear an extension. */ - public final BuilderType clearExtension(final Extension extension) { + public final BuilderType clearExtension( + final Extension extension) { return clearExtension((ExtensionLite) extension); } /** Clear an extension. */ - public BuilderType clearExtension(final GeneratedExtension extension) { + public BuilderType clearExtension( + final GeneratedExtension extension) { return clearExtension((ExtensionLite) extension); } @@ -1339,7 +1441,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Called by the build code path to create a copy of the extensions for building the message. + * Called by the build code path to create a copy of the extensions for + * building the message. */ private FieldSet buildExtensions() { extensions.makeImmutable(); @@ -1353,7 +1456,6 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** * Called by subclasses to parse an unknown field or an extension. - * * @return {@code true} unless the tag is an end-group tag. */ @Override @@ -1361,15 +1463,10 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial final CodedInputStream input, final UnknownFieldSet.Builder unknownFields, final ExtensionRegistryLite extensionRegistry, - final int tag) - throws IOException { + final int tag) throws IOException { return MessageReflection.mergeFieldFrom( - input, - unknownFields, - extensionRegistry, - getDescriptorForType(), - new MessageReflection.BuilderAdapter(this), - tag); + input, unknownFields, extensionRegistry, getDescriptorForType(), + new MessageReflection.BuilderAdapter(this), tag); } // --------------------------------------------------------------- @@ -1414,7 +1511,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } @Override - public Object getRepeatedField(final FieldDescriptor field, final int index) { + public Object getRepeatedField(final FieldDescriptor field, + final int index) { if (field.isExtension()) { verifyContainingType(field); return extensions.getRepeatedField(field, index); @@ -1434,7 +1532,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } @Override - public BuilderType setField(final FieldDescriptor field, final Object value) { + public BuilderType setField(final FieldDescriptor field, + final Object value) { if (field.isExtension()) { verifyContainingType(field); ensureExtensionsIsMutable(); @@ -1460,8 +1559,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } @Override - public BuilderType setRepeatedField( - final FieldDescriptor field, final int index, final Object value) { + public BuilderType setRepeatedField(final FieldDescriptor field, + final int index, final Object value) { if (field.isExtension()) { verifyContainingType(field); ensureExtensionsIsMutable(); @@ -1474,7 +1573,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } @Override - public BuilderType addRepeatedField(final FieldDescriptor field, final Object value) { + public BuilderType addRepeatedField(final FieldDescriptor field, + final Object value) { if (field.isExtension()) { verifyContainingType(field); ensureExtensionsIsMutable(); @@ -1494,7 +1594,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial private void verifyContainingType(final FieldDescriptor field) { if (field.getContainingType() != getDescriptorForType()) { - throw new IllegalArgumentException("FieldDescriptor does not match message type."); + throw new IllegalArgumentException( + "FieldDescriptor does not match message type."); } } } @@ -1502,8 +1603,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // ----------------------------------------------------------------- /** - * Gets the descriptor for an extension. The implementation depends on whether the extension is - * scoped in the top level of a file or scoped in a Message. + * Gets the descriptor for an extension. The implementation depends on whether + * the extension is scoped in the top level of a file or scoped in a Message. */ static interface ExtensionDescriptorRetriever { FieldDescriptor getDescriptor(); @@ -1511,11 +1612,11 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** For use by generated code only. */ public static - GeneratedExtension newMessageScopedGeneratedExtension( - final Message scope, - final int descriptorIndex, - final Class singularType, - final Message defaultInstance) { + GeneratedExtension + newMessageScopedGeneratedExtension(final Message scope, + final int descriptorIndex, + final Class singularType, + final Message defaultInstance) { // For extensions scoped within a Message, we use the Message to resolve // the outer class's descriptor, from which the extension descriptor is // obtained. @@ -1533,21 +1634,22 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** For use by generated code only. */ public static - GeneratedExtension newFileScopedGeneratedExtension( - final Class singularType, final Message defaultInstance) { + GeneratedExtension + newFileScopedGeneratedExtension(final Class singularType, + final Message defaultInstance) { // For extensions scoped within a file, we rely on the outer class's // static initializer to call internalInit() on the extension when the // descriptor is available. return new GeneratedExtension( - null, // ExtensionDescriptorRetriever is initialized in internalInit(); + null, // ExtensionDescriptorRetriever is initialized in internalInit(); singularType, defaultInstance, Extension.ExtensionType.IMMUTABLE); } - private abstract static class CachedDescriptorRetriever implements ExtensionDescriptorRetriever { + private abstract static class CachedDescriptorRetriever + implements ExtensionDescriptorRetriever { private volatile FieldDescriptor descriptor; - protected abstract FieldDescriptor loadDescriptor(); @Override @@ -1566,16 +1668,15 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** * Used in proto1 generated code only. * - *

After enabling bridge, we can define proto2 extensions (the extended type is a proto2 - * mutable message) in a proto1 .proto file. For these extensions we should generate proto2 - * GeneratedExtensions. + * After enabling bridge, we can define proto2 extensions (the extended type + * is a proto2 mutable message) in a proto1 .proto file. For these extensions + * we should generate proto2 GeneratedExtensions. */ public static - GeneratedExtension newMessageScopedGeneratedExtension( - final Message scope, - final String name, - final Class singularType, - final Message defaultInstance) { + GeneratedExtension + newMessageScopedGeneratedExtension( + final Message scope, final String name, + final Class singularType, final Message defaultInstance) { // For extensions scoped within a Message, we use the Message to resolve // the outer class's descriptor, from which the extension descriptor is // obtained. @@ -1594,16 +1695,15 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** * Used in proto1 generated code only. * - *

After enabling bridge, we can define proto2 extensions (the extended type is a proto2 - * mutable message) in a proto1 .proto file. For these extensions we should generate proto2 - * GeneratedExtensions. + * After enabling bridge, we can define proto2 extensions (the extended type + * is a proto2 mutable message) in a proto1 .proto file. For these extensions + * we should generate proto2 GeneratedExtensions. */ public static - GeneratedExtension newFileScopedGeneratedExtension( - final Class singularType, - final Message defaultInstance, - final String descriptorOuterClass, - final String extensionName) { + GeneratedExtension + newFileScopedGeneratedExtension( + final Class singularType, final Message defaultInstance, + final String descriptorOuterClass, final String extensionName) { // For extensions scoped within a file, we load the descriptor outer // class and rely on it to get the FileDescriptor which then can be // used to obtain the extension's FieldDescriptor. @@ -1630,8 +1730,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Type used to represent generated extensions. The protocol compiler generates a static singleton - * instance of this class for each extension. + * Type used to represent generated extensions. The protocol compiler + * generates a static singleton instance of this class for each extension. * *

For example, imagine you have the {@code .proto} file: * @@ -1647,15 +1747,17 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial * } * * - *

Then, {@code MyProto.Foo.bar} has type {@code GeneratedExtension}. + *

Then, {@code MyProto.Foo.bar} has type + * {@code GeneratedExtension}. * - *

In general, users should ignore the details of this type, and simply use these static - * singletons as parameters to the extension accessors defined in {@link ExtendableMessage} and - * {@link ExtendableBuilder}. + *

In general, users should ignore the details of this type, and simply use + * these static singletons as parameters to the extension accessors defined + * in {@link ExtendableMessage} and {@link ExtendableBuilder}. */ - public static class GeneratedExtension - extends Extension { - // TODO: Find ways to avoid using Java reflection within this + public static class GeneratedExtension< + ContainingType extends Message, Type> extends + Extension { + // TODO(kenton): Find ways to avoid using Java reflection within this // class. Also try to avoid suppressing unchecked warnings. // We can't always initialize the descriptor of a GeneratedExtension when @@ -1670,13 +1772,12 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // In the case of non-nested extensions, we initialize the // ExtensionDescriptorRetriever to null and rely on the outer class's static // initializer to call internalInit() after the descriptor has been parsed. - GeneratedExtension( - ExtensionDescriptorRetriever descriptorRetriever, + GeneratedExtension(ExtensionDescriptorRetriever descriptorRetriever, Class singularType, Message messageDefaultInstance, ExtensionType extensionType) { - if (Message.class.isAssignableFrom(singularType) - && !singularType.isInstance(messageDefaultInstance)) { + if (Message.class.isAssignableFrom(singularType) && + !singularType.isInstance(messageDefaultInstance)) { throw new IllegalArgumentException( "Bad messageDefaultInstance for " + singularType.getName()); } @@ -1685,8 +1786,10 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial this.messageDefaultInstance = messageDefaultInstance; if (ProtocolMessageEnum.class.isAssignableFrom(singularType)) { - this.enumValueOf = getMethodOrDie(singularType, "valueOf", EnumValueDescriptor.class); - this.enumGetValueDescriptor = getMethodOrDie(singularType, "getValueDescriptor"); + this.enumValueOf = getMethodOrDie(singularType, "valueOf", + EnumValueDescriptor.class); + this.enumGetValueDescriptor = + getMethodOrDie(singularType, "getValueDescriptor"); } else { this.enumValueOf = null; this.enumGetValueDescriptor = null; @@ -1718,14 +1821,15 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public FieldDescriptor getDescriptor() { if (descriptorRetriever == null) { - throw new IllegalStateException("getDescriptor() called before internalInit()"); + throw new IllegalStateException( + "getDescriptor() called before internalInit()"); } return descriptorRetriever.getDescriptor(); } /** - * If the extension is an embedded message or group, returns the default instance of the - * message. + * If the extension is an embedded message or group, returns the default + * instance of the message. */ @Override public Message getMessageDefaultInstance() { @@ -1738,17 +1842,18 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Convert from the type used by the reflection accessors to the type used by native accessors. - * E.g., for enums, the reflection accessors use EnumValueDescriptors but the native accessors - * use the generated enum type. + * Convert from the type used by the reflection accessors to the type used + * by native accessors. E.g., for enums, the reflection accessors use + * EnumValueDescriptors but the native accessors use the generated enum + * type. */ @Override @SuppressWarnings("unchecked") protected Object fromReflectionType(final Object value) { FieldDescriptor descriptor = getDescriptor(); if (descriptor.isRepeated()) { - if (descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE - || descriptor.getJavaType() == FieldDescriptor.JavaType.ENUM) { + if (descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE || + descriptor.getJavaType() == FieldDescriptor.JavaType.ENUM) { // Must convert the whole list. final List result = new ArrayList(); for (final Object element : (List) value) { @@ -1764,8 +1869,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Like {@link #fromReflectionType(Object)}, but if the type is a repeated type, this converts a - * single element. + * Like {@link #fromReflectionType(Object)}, but if the type is a repeated + * type, this converts a single element. */ @Override protected Object singularFromReflectionType(final Object value) { @@ -1775,7 +1880,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial if (singularType.isInstance(value)) { return value; } else { - return messageDefaultInstance.newBuilderForType().mergeFrom((Message) value).build(); + return messageDefaultInstance.newBuilderForType() + .mergeFrom((Message) value).build(); } case ENUM: return invokeOrDie(enumValueOf, null, (EnumValueDescriptor) value); @@ -1785,9 +1891,10 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Convert from the type used by the native accessors to the type used by reflection accessors. - * E.g., for enums, the reflection accessors use EnumValueDescriptors but the native accessors - * use the generated enum type. + * Convert from the type used by the native accessors to the type used + * by reflection accessors. E.g., for enums, the reflection accessors use + * EnumValueDescriptors but the native accessors use the generated enum + * type. */ @Override @SuppressWarnings("unchecked") @@ -1810,8 +1917,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Like {@link #toReflectionType(Object)}, but if the type is a repeated type, this converts a - * single element. + * Like {@link #toReflectionType(Object)}, but if the type is a repeated + * type, this converts a single element. */ @Override protected Object singularToReflectionType(final Object value) { @@ -1848,7 +1955,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial if (getDescriptor().getJavaType() == FieldDescriptor.JavaType.MESSAGE) { return (Type) messageDefaultInstance; } - return (Type) singularFromReflectionType(getDescriptor().getDefaultValue()); + return (Type) singularFromReflectionType( + getDescriptor().getDefaultValue()); } } @@ -1862,8 +1970,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial return clazz.getMethod(name, params); } catch (NoSuchMethodException e) { throw new RuntimeException( - "Generated message class \"" + clazz.getName() + "\" missing method \"" + name + "\".", - e); + "Generated message class \"" + clazz.getName() + + "\" missing method \"" + name + "\".", e); } } @@ -1874,7 +1982,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial return method.invoke(object, params); } catch (IllegalAccessException e) { throw new RuntimeException( - "Couldn't use Java reflection to implement protocol message " + "reflection.", e); + "Couldn't use Java reflection to implement protocol message " + + "reflection.", e); } catch (InvocationTargetException e) { final Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { @@ -1883,42 +1992,45 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial throw (Error) cause; } else { throw new RuntimeException( - "Unexpected exception thrown by generated accessor method.", cause); + "Unexpected exception thrown by generated accessor method.", cause); } } } /** - * Gets the map field with the given field number. This method should be overridden in the - * generated message class if the message contains map fields. + * Gets the map field with the given field number. This method should be + * overridden in the generated message class if the message contains map + * fields. * - *

Unlike other field types, reflection support for map fields can't be implemented based on - * generated public API because we need to access a map field as a list in reflection API but the - * generated API only allows us to access it as a map. This method returns the underlying map - * field directly and thus enables us to access the map field as a list. + * Unlike other field types, reflection support for map fields can't be + * implemented based on generated public API because we need to access a + * map field as a list in reflection API but the generated API only allows + * us to access it as a map. This method returns the underlying map field + * directly and thus enables us to access the map field as a list. */ @SuppressWarnings({"rawtypes", "unused"}) protected MapField internalGetMapField(int fieldNumber) { // Note that we can't use descriptor names here because this method will // be called when descriptor is being initialized. - throw new RuntimeException("No map fields found in " + getClass().getName()); + throw new RuntimeException( + "No map fields found in " + getClass().getName()); } /** - * Users should ignore this class. This class provides the implementation with access to the - * fields of a message object using Java reflection. + * Users should ignore this class. This class provides the implementation + * with access to the fields of a message object using Java reflection. */ public static final class FieldAccessorTable { /** - * Construct a FieldAccessorTable for a particular message class. Only one FieldAccessorTable - * should ever be constructed per class. + * Construct a FieldAccessorTable for a particular message class. Only + * one FieldAccessorTable should ever be constructed per class. * - * @param descriptor The type's descriptor. - * @param camelCaseNames The camelcase names of all fields in the message. These are used to - * derive the accessor method names. - * @param messageClass The message type. - * @param builderClass The builder type. + * @param descriptor The type's descriptor. + * @param camelCaseNames The camelcase names of all fields in the message. + * These are used to derive the accessor method names. + * @param messageClass The message type. + * @param builderClass The builder type. */ public FieldAccessorTable( final Descriptor descriptor, @@ -1930,10 +2042,12 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Construct a FieldAccessorTable for a particular message class without initializing - * FieldAccessors. + * Construct a FieldAccessorTable for a particular message class without + * initializing FieldAccessors. */ - public FieldAccessorTable(final Descriptor descriptor, final String[] camelCaseNames) { + public FieldAccessorTable( + final Descriptor descriptor, + final String[] camelCaseNames) { this.descriptor = descriptor; this.camelCaseNames = camelCaseNames; fields = new FieldAccessor[descriptor.getFields().size()]; @@ -1949,19 +2063,16 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** * Ensures the field accessors are initialized. This method is thread-safe. * - * @param messageClass The message type. - * @param builderClass The builder type. + * @param messageClass The message type. + * @param builderClass The builder type. * @return this */ public FieldAccessorTable ensureFieldAccessorsInitialized( - Class messageClass, Class builderClass) { - if (initialized) { - return this; - } + Class messageClass, + Class builderClass) { + if (initialized) { return this; } synchronized (this) { - if (initialized) { - return this; - } + if (initialized) { return this; } int fieldsSize = fields.length; for (int i = 0; i < fieldsSize; i++) { FieldDescriptor field = descriptor.getFields().get(i); @@ -1973,63 +2084,45 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial if (field.isRepeated()) { if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { if (field.isMapField() && isMapFieldEnabled(field)) { - fields[i] = - new MapFieldAccessor(field, camelCaseNames[i], messageClass, builderClass); + fields[i] = new MapFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } else { - fields[i] = - new RepeatedMessageFieldAccessor( - field, camelCaseNames[i], messageClass, builderClass); + fields[i] = new RepeatedMessageFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } } else if (field.getJavaType() == FieldDescriptor.JavaType.ENUM) { - fields[i] = - new RepeatedEnumFieldAccessor( - field, camelCaseNames[i], messageClass, builderClass); + fields[i] = new RepeatedEnumFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } else { - fields[i] = - new RepeatedFieldAccessor(field, camelCaseNames[i], messageClass, builderClass); + fields[i] = new RepeatedFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } } else { if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { - fields[i] = - new SingularMessageFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularMessageFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } else if (field.getJavaType() == FieldDescriptor.JavaType.ENUM) { - fields[i] = - new SingularEnumFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularEnumFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } else if (field.getJavaType() == FieldDescriptor.JavaType.STRING) { - fields[i] = - new SingularStringFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularStringFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } else { - fields[i] = - new SingularFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } } } int oneofsSize = oneofs.length; for (int i = 0; i < oneofsSize; i++) { - oneofs[i] = - new OneofAccessor( - descriptor, camelCaseNames[i + fieldsSize], messageClass, builderClass); + oneofs[i] = new OneofAccessor( + descriptor, camelCaseNames[i + fieldsSize], + messageClass, builderClass); } initialized = true; camelCaseNames = null; @@ -2046,11 +2139,13 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** Get the FieldAccessor for a particular field. */ private FieldAccessor getField(final FieldDescriptor field) { if (field.getContainingType() != descriptor) { - throw new IllegalArgumentException("FieldDescriptor does not match message type."); + throw new IllegalArgumentException( + "FieldDescriptor does not match message type."); } else if (field.isExtension()) { // If this type had extensions, it would subclass ExtendableMessage, // which overrides the reflection interface to handle extensions. - throw new IllegalArgumentException("This type does not have extensions."); + throw new IllegalArgumentException( + "This type does not have extensions."); } return fields[field.getIndex()]; } @@ -2058,65 +2153,51 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** Get the OneofAccessor for a particular oneof. */ private OneofAccessor getOneof(final OneofDescriptor oneof) { if (oneof.getContainingType() != descriptor) { - throw new IllegalArgumentException("OneofDescriptor does not match message type."); + throw new IllegalArgumentException( + "OneofDescriptor does not match message type."); } return oneofs[oneof.getIndex()]; } /** - * Abstract interface that provides access to a single field. This is implemented differently - * depending on the field type and cardinality. + * Abstract interface that provides access to a single field. This is + * implemented differently depending on the field type and cardinality. */ private interface FieldAccessor { Object get(GeneratedMessage message); - Object get(GeneratedMessage.Builder builder); - Object getRaw(GeneratedMessage message); - Object getRaw(GeneratedMessage.Builder builder); - void set(Builder builder, Object value); - Object getRepeated(GeneratedMessage message, int index); - Object getRepeated(GeneratedMessage.Builder builder, int index); - Object getRepeatedRaw(GeneratedMessage message, int index); - Object getRepeatedRaw(GeneratedMessage.Builder builder, int index); - - void setRepeated(Builder builder, int index, Object value); - + void setRepeated(Builder builder, + int index, Object value); void addRepeated(Builder builder, Object value); - boolean has(GeneratedMessage message); - boolean has(GeneratedMessage.Builder builder); - int getRepeatedCount(GeneratedMessage message); - int getRepeatedCount(GeneratedMessage.Builder builder); - void clear(Builder builder); - Message.Builder newBuilder(); - Message.Builder getBuilder(GeneratedMessage.Builder builder); - - Message.Builder getRepeatedBuilder(GeneratedMessage.Builder builder, int index); + Message.Builder getRepeatedBuilder(GeneratedMessage.Builder builder, + int index); } /** OneofAccessor provides access to a single oneof. */ private static class OneofAccessor { OneofAccessor( - final Descriptor descriptor, - final String camelCaseName, + final Descriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass) { this.descriptor = descriptor; - caseMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Case"); - caseMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Case"); + caseMethod = + getMethodOrDie(messageClass, "get" + camelCaseName + "Case"); + caseMethodBuilder = + getMethodOrDie(builderClass, "get" + camelCaseName + "Case"); clearMethod = getMethodOrDie(builderClass, "clear" + camelCaseName); } @@ -2168,32 +2249,27 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial private static class SingularFieldAccessor implements FieldAccessor { SingularFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass, final String containingOneofCamelCaseName) { field = descriptor; isOneofField = descriptor.getContainingOneof() != null; - hasHasMethod = - supportFieldPresence(descriptor.getFile()) - || (!isOneofField && descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE); + hasHasMethod = supportFieldPresence(descriptor.getFile()) + || (!isOneofField && descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE); getMethod = getMethodOrDie(messageClass, "get" + camelCaseName); getMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName); type = getMethod.getReturnType(); setMethod = getMethodOrDie(builderClass, "set" + camelCaseName, type); - hasMethod = hasHasMethod ? getMethodOrDie(messageClass, "has" + camelCaseName) : null; + hasMethod = + hasHasMethod ? getMethodOrDie(messageClass, "has" + camelCaseName) : null; hasMethodBuilder = hasHasMethod ? getMethodOrDie(builderClass, "has" + camelCaseName) : null; clearMethod = getMethodOrDie(builderClass, "clear" + camelCaseName); - caseMethod = - isOneofField - ? getMethodOrDie(messageClass, "get" + containingOneofCamelCaseName + "Case") - : null; - caseMethodBuilder = - isOneofField - ? getMethodOrDie(builderClass, "get" + containingOneofCamelCaseName + "Case") - : null; + caseMethod = isOneofField ? getMethodOrDie( + messageClass, "get" + containingOneofCamelCaseName + "Case") : null; + caseMethodBuilder = isOneofField ? getMethodOrDie( + builderClass, "get" + containingOneofCamelCaseName + "Case") : null; } // Note: We use Java reflection to call public methods rather than @@ -2224,59 +2300,52 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial public Object get(final GeneratedMessage message) { return invokeOrDie(getMethod, message); } - @Override public Object get(GeneratedMessage.Builder builder) { return invokeOrDie(getMethodBuilder, builder); } - @Override public Object getRaw(final GeneratedMessage message) { return get(message); } - @Override public Object getRaw(GeneratedMessage.Builder builder) { return get(builder); } - @Override public void set(final Builder builder, final Object value) { invokeOrDie(setMethod, builder, value); } - @Override public Object getRepeated(final GeneratedMessage message, final int index) { - throw new UnsupportedOperationException("getRepeatedField() called on a singular field."); + throw new UnsupportedOperationException( + "getRepeatedField() called on a singular field."); } - @Override public Object getRepeatedRaw(final GeneratedMessage message, final int index) { throw new UnsupportedOperationException( - "getRepeatedFieldRaw() called on a singular field."); + "getRepeatedFieldRaw() called on a singular field."); } - @Override public Object getRepeated(GeneratedMessage.Builder builder, int index) { - throw new UnsupportedOperationException("getRepeatedField() called on a singular field."); + throw new UnsupportedOperationException( + "getRepeatedField() called on a singular field."); } - @Override public Object getRepeatedRaw(GeneratedMessage.Builder builder, int index) { throw new UnsupportedOperationException( - "getRepeatedFieldRaw() called on a singular field."); + "getRepeatedFieldRaw() called on a singular field."); } - @Override public void setRepeated(final Builder builder, final int index, final Object value) { - throw new UnsupportedOperationException("setRepeatedField() called on a singular field."); + throw new UnsupportedOperationException( + "setRepeatedField() called on a singular field."); } - @Override public void addRepeated(final Builder builder, final Object value) { - throw new UnsupportedOperationException("addRepeatedField() called on a singular field."); + throw new UnsupportedOperationException( + "addRepeatedField() called on a singular field."); } - @Override public boolean has(final GeneratedMessage message) { if (!hasHasMethod) { @@ -2287,7 +2356,6 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } return (Boolean) invokeOrDie(hasMethod, message); } - @Override public boolean has(GeneratedMessage.Builder builder) { if (!hasHasMethod) { @@ -2298,39 +2366,34 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } return (Boolean) invokeOrDie(hasMethodBuilder, builder); } - @Override public int getRepeatedCount(final GeneratedMessage message) { throw new UnsupportedOperationException( - "getRepeatedFieldSize() called on a singular field."); + "getRepeatedFieldSize() called on a singular field."); } - @Override public int getRepeatedCount(GeneratedMessage.Builder builder) { throw new UnsupportedOperationException( - "getRepeatedFieldSize() called on a singular field."); + "getRepeatedFieldSize() called on a singular field."); } - @Override public void clear(final Builder builder) { invokeOrDie(clearMethod, builder); } - @Override public Message.Builder newBuilder() { throw new UnsupportedOperationException( - "newBuilderForField() called on a non-Message type."); + "newBuilderForField() called on a non-Message type."); } - @Override public Message.Builder getBuilder(GeneratedMessage.Builder builder) { - throw new UnsupportedOperationException("getFieldBuilder() called on a non-Message type."); + throw new UnsupportedOperationException( + "getFieldBuilder() called on a non-Message type."); } - @Override public Message.Builder getRepeatedBuilder(GeneratedMessage.Builder builder, int index) { throw new UnsupportedOperationException( - "getRepeatedFieldBuilder() called on a non-Message type."); + "getRepeatedFieldBuilder() called on a non-Message type."); } } @@ -2347,20 +2410,27 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial protected final Method clearMethod; RepeatedFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass) { - getMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "List"); - getMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "List"); - getRepeatedMethod = getMethodOrDie(messageClass, "get" + camelCaseName, Integer.TYPE); + getMethod = getMethodOrDie(messageClass, + "get" + camelCaseName + "List"); + getMethodBuilder = getMethodOrDie(builderClass, + "get" + camelCaseName + "List"); + getRepeatedMethod = + getMethodOrDie(messageClass, "get" + camelCaseName, Integer.TYPE); getRepeatedMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName, Integer.TYPE); type = getRepeatedMethod.getReturnType(); - setRepeatedMethod = getMethodOrDie(builderClass, "set" + camelCaseName, Integer.TYPE, type); - addRepeatedMethod = getMethodOrDie(builderClass, "add" + camelCaseName, type); - getCountMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Count"); - getCountMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Count"); + setRepeatedMethod = + getMethodOrDie(builderClass, "set" + camelCaseName, + Integer.TYPE, type); + addRepeatedMethod = + getMethodOrDie(builderClass, "add" + camelCaseName, type); + getCountMethod = + getMethodOrDie(messageClass, "get" + camelCaseName + "Count"); + getCountMethodBuilder = + getMethodOrDie(builderClass, "get" + camelCaseName + "Count"); clearMethod = getMethodOrDie(builderClass, "clear" + camelCaseName); } @@ -2369,22 +2439,18 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial public Object get(final GeneratedMessage message) { return invokeOrDie(getMethod, message); } - @Override public Object get(GeneratedMessage.Builder builder) { return invokeOrDie(getMethodBuilder, builder); } - @Override public Object getRaw(final GeneratedMessage message) { return get(message); } - @Override public Object getRaw(GeneratedMessage.Builder builder) { return get(builder); } - @Override public void set(final Builder builder, final Object value) { // Add all the elements individually. This serves two purposes: @@ -2396,91 +2462,81 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial addRepeated(builder, element); } } - @Override public Object getRepeated(final GeneratedMessage message, final int index) { return invokeOrDie(getRepeatedMethod, message, index); } - @Override public Object getRepeated(GeneratedMessage.Builder builder, int index) { return invokeOrDie(getRepeatedMethodBuilder, builder, index); } - @Override public Object getRepeatedRaw(GeneratedMessage message, int index) { return getRepeated(message, index); } - @Override public Object getRepeatedRaw(GeneratedMessage.Builder builder, int index) { return getRepeated(builder, index); } - @Override public void setRepeated(final Builder builder, final int index, final Object value) { invokeOrDie(setRepeatedMethod, builder, index, value); } - @Override public void addRepeated(final Builder builder, final Object value) { invokeOrDie(addRepeatedMethod, builder, value); } - @Override public boolean has(final GeneratedMessage message) { - throw new UnsupportedOperationException("hasField() called on a repeated field."); + throw new UnsupportedOperationException( + "hasField() called on a repeated field."); } - @Override public boolean has(GeneratedMessage.Builder builder) { - throw new UnsupportedOperationException("hasField() called on a repeated field."); + throw new UnsupportedOperationException( + "hasField() called on a repeated field."); } - @Override public int getRepeatedCount(final GeneratedMessage message) { return (Integer) invokeOrDie(getCountMethod, message); } - @Override public int getRepeatedCount(GeneratedMessage.Builder builder) { return (Integer) invokeOrDie(getCountMethodBuilder, builder); } - @Override public void clear(final Builder builder) { invokeOrDie(clearMethod, builder); } - @Override public Message.Builder newBuilder() { throw new UnsupportedOperationException( - "newBuilderForField() called on a non-Message type."); + "newBuilderForField() called on a non-Message type."); } - @Override public Message.Builder getBuilder(GeneratedMessage.Builder builder) { - throw new UnsupportedOperationException("getFieldBuilder() called on a non-Message type."); + throw new UnsupportedOperationException( + "getFieldBuilder() called on a non-Message type."); } - @Override public Message.Builder getRepeatedBuilder(GeneratedMessage.Builder builder, int index) { throw new UnsupportedOperationException( - "getRepeatedFieldBuilder() called on a non-Message type."); + "getRepeatedFieldBuilder() called on a non-Message type."); } } private static class MapFieldAccessor implements FieldAccessor { MapFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass) { field = descriptor; - Method getDefaultInstanceMethod = getMethodOrDie(messageClass, "getDefaultInstance"); - MapField defaultMapField = - getMapField((GeneratedMessage) invokeOrDie(getDefaultInstanceMethod, null)); - mapEntryMessageDefaultInstance = defaultMapField.getMapEntryMessageDefaultInstance(); + Method getDefaultInstanceMethod = + getMethodOrDie(messageClass, "getDefaultInstance"); + MapField defaultMapField = getMapField( + (GeneratedMessage) invokeOrDie(getDefaultInstanceMethod, null)); + mapEntryMessageDefaultInstance = + defaultMapField.getMapEntryMessageDefaultInstance(); } private final FieldDescriptor field; @@ -2494,8 +2550,10 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial return (MapField) builder.internalGetMapField(field.getNumber()); } - private MapField getMutableMapField(GeneratedMessage.Builder builder) { - return (MapField) builder.internalGetMutableMapField(field.getNumber()); + private MapField getMutableMapField( + GeneratedMessage.Builder builder) { + return (MapField) builder.internalGetMutableMapField( + field.getNumber()); } @Override @@ -2568,12 +2626,14 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public boolean has(GeneratedMessage message) { - throw new UnsupportedOperationException("hasField() is not supported for repeated fields."); + throw new UnsupportedOperationException( + "hasField() is not supported for repeated fields."); } @Override public boolean has(Builder builder) { - throw new UnsupportedOperationException("hasField() is not supported for repeated fields."); + throw new UnsupportedOperationException( + "hasField() is not supported for repeated fields."); } @Override @@ -2598,21 +2658,23 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public com.google.protobuf.Message.Builder getBuilder(Builder builder) { - throw new UnsupportedOperationException("Nested builder not supported for map fields."); + throw new UnsupportedOperationException( + "Nested builder not supported for map fields."); } @Override public com.google.protobuf.Message.Builder getRepeatedBuilder(Builder builder, int index) { - throw new UnsupportedOperationException("Nested builder not supported for map fields."); + throw new UnsupportedOperationException( + "Nested builder not supported for map fields."); } } // --------------------------------------------------------------- - private static final class SingularEnumFieldAccessor extends SingularFieldAccessor { + private static final class SingularEnumFieldAccessor + extends SingularFieldAccessor { SingularEnumFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass, final String containingOneofCamelCaseName) { @@ -2620,14 +2682,19 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial enumDescriptor = descriptor.getEnumType(); - valueOfMethod = getMethodOrDie(type, "valueOf", EnumValueDescriptor.class); - getValueDescriptorMethod = getMethodOrDie(type, "getValueDescriptor"); + valueOfMethod = getMethodOrDie(type, "valueOf", + EnumValueDescriptor.class); + getValueDescriptorMethod = + getMethodOrDie(type, "getValueDescriptor"); - supportUnknownEnumValue = !descriptor.legacyEnumFieldTreatedAsClosed(); + supportUnknownEnumValue = descriptor.getFile().supportsUnknownEnumValue(); if (supportUnknownEnumValue) { - getValueMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Value"); - getValueMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Value"); - setValueMethod = getMethodOrDie(builderClass, "set" + camelCaseName + "Value", int.class); + getValueMethod = + getMethodOrDie(messageClass, "get" + camelCaseName + "Value"); + getValueMethodBuilder = + getMethodOrDie(builderClass, "get" + camelCaseName + "Value"); + setValueMethod = + getMethodOrDie(builderClass, "set" + camelCaseName + "Value", int.class); } } @@ -2662,27 +2729,30 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial @Override public void set(final Builder builder, final Object value) { if (supportUnknownEnumValue) { - invokeOrDie(setValueMethod, builder, ((EnumValueDescriptor) value).getNumber()); + invokeOrDie(setValueMethod, builder, + ((EnumValueDescriptor) value).getNumber()); return; } super.set(builder, invokeOrDie(valueOfMethod, null, value)); } } - private static final class RepeatedEnumFieldAccessor extends RepeatedFieldAccessor { + private static final class RepeatedEnumFieldAccessor + extends RepeatedFieldAccessor { RepeatedEnumFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass) { super(descriptor, camelCaseName, messageClass, builderClass); enumDescriptor = descriptor.getEnumType(); - valueOfMethod = getMethodOrDie(type, "valueOf", EnumValueDescriptor.class); - getValueDescriptorMethod = getMethodOrDie(type, "getValueDescriptor"); + valueOfMethod = getMethodOrDie(type, "valueOf", + EnumValueDescriptor.class); + getValueDescriptorMethod = + getMethodOrDie(type, "getValueDescriptor"); - supportUnknownEnumValue = !descriptor.legacyEnumFieldTreatedAsClosed(); + supportUnknownEnumValue = descriptor.getFile().supportsUnknownEnumValue(); if (supportUnknownEnumValue) { getRepeatedValueMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Value", int.class); @@ -2694,7 +2764,6 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial getMethodOrDie(builderClass, "add" + camelCaseName + "Value", int.class); } } - private EnumDescriptor enumDescriptor; private final Method valueOfMethod; @@ -2729,37 +2798,41 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } @Override - public Object getRepeated(final GeneratedMessage message, final int index) { + public Object getRepeated(final GeneratedMessage message, + final int index) { if (supportUnknownEnumValue) { int value = (Integer) invokeOrDie(getRepeatedValueMethod, message, index); return enumDescriptor.findValueByNumberCreatingIfUnknown(value); } - return invokeOrDie(getValueDescriptorMethod, super.getRepeated(message, index)); + return invokeOrDie(getValueDescriptorMethod, + super.getRepeated(message, index)); } - @Override - public Object getRepeated(final GeneratedMessage.Builder builder, final int index) { + public Object getRepeated(final GeneratedMessage.Builder builder, + final int index) { if (supportUnknownEnumValue) { int value = (Integer) invokeOrDie(getRepeatedValueMethodBuilder, builder, index); return enumDescriptor.findValueByNumberCreatingIfUnknown(value); } - return invokeOrDie(getValueDescriptorMethod, super.getRepeated(builder, index)); + return invokeOrDie(getValueDescriptorMethod, + super.getRepeated(builder, index)); } - @Override - public void setRepeated(final Builder builder, final int index, final Object value) { + public void setRepeated(final Builder builder, + final int index, final Object value) { if (supportUnknownEnumValue) { - invokeOrDie( - setRepeatedValueMethod, builder, index, ((EnumValueDescriptor) value).getNumber()); + invokeOrDie(setRepeatedValueMethod, builder, index, + ((EnumValueDescriptor) value).getNumber()); return; } - super.setRepeated(builder, index, invokeOrDie(valueOfMethod, null, value)); + super.setRepeated(builder, index, invokeOrDie(valueOfMethod, null, + value)); } - @Override public void addRepeated(final Builder builder, final Object value) { if (supportUnknownEnumValue) { - invokeOrDie(addRepeatedValueMethod, builder, ((EnumValueDescriptor) value).getNumber()); + invokeOrDie(addRepeatedValueMethod, builder, + ((EnumValueDescriptor) value).getNumber()); return; } super.addRepeated(builder, invokeOrDie(valueOfMethod, null, value)); @@ -2771,25 +2844,29 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial /** * Field accessor for string fields. * - *

This class makes getFooBytes() and setFooBytes() available for reflection API so that - * reflection based serialize/parse functions can access the raw bytes of the field to preserve - * non-UTF8 bytes in the string. + *

This class makes getFooBytes() and setFooBytes() available for + * reflection API so that reflection based serialize/parse functions can + * access the raw bytes of the field to preserve non-UTF8 bytes in the + * string. * - *

This ensures the serialize/parse round-trip safety, which is important for servers which - * forward messages. + *

This ensures the serialize/parse round-trip safety, which is important + * for servers which forward messages. */ - private static final class SingularStringFieldAccessor extends SingularFieldAccessor { + private static final class SingularStringFieldAccessor + extends SingularFieldAccessor { SingularStringFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass, final String containingOneofCamelCaseName) { - super(descriptor, camelCaseName, messageClass, builderClass, containingOneofCamelCaseName); - getBytesMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Bytes"); - getBytesMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Bytes"); - setBytesMethodBuilder = - getMethodOrDie(builderClass, "set" + camelCaseName + "Bytes", ByteString.class); + super(descriptor, camelCaseName, messageClass, builderClass, + containingOneofCamelCaseName); + getBytesMethod = getMethodOrDie(messageClass, + "get" + camelCaseName + "Bytes"); + getBytesMethodBuilder = getMethodOrDie(builderClass, + "get" + camelCaseName + "Bytes"); + setBytesMethodBuilder = getMethodOrDie(builderClass, + "set" + camelCaseName + "Bytes", ByteString.class); } private final Method getBytesMethod; @@ -2818,17 +2895,19 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // --------------------------------------------------------------- - private static final class SingularMessageFieldAccessor extends SingularFieldAccessor { + private static final class SingularMessageFieldAccessor + extends SingularFieldAccessor { SingularMessageFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass, final String containingOneofCamelCaseName) { - super(descriptor, camelCaseName, messageClass, builderClass, containingOneofCamelCaseName); + super(descriptor, camelCaseName, messageClass, builderClass, + containingOneofCamelCaseName); newBuilderMethod = getMethodOrDie(type, "newBuilder"); - getBuilderMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Builder"); + getBuilderMethodBuilder = + getMethodOrDie(builderClass, "get" + camelCaseName + "Builder"); } private final Method newBuilderMethod; @@ -2843,8 +2922,7 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // DynamicMessage -- we should accept it. In this case we can make // a copy of the message. return ((Message.Builder) invokeOrDie(newBuilderMethod, null)) - .mergeFrom((Message) value) - .buildPartial(); + .mergeFrom((Message) value).buildPartial(); } } @@ -2852,29 +2930,27 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial public void set(final Builder builder, final Object value) { super.set(builder, coerceType(value)); } - @Override public Message.Builder newBuilder() { return (Message.Builder) invokeOrDie(newBuilderMethod, null); } - @Override public Message.Builder getBuilder(GeneratedMessage.Builder builder) { return (Message.Builder) invokeOrDie(getBuilderMethodBuilder, builder); } } - private static final class RepeatedMessageFieldAccessor extends RepeatedFieldAccessor { + private static final class RepeatedMessageFieldAccessor + extends RepeatedFieldAccessor { RepeatedMessageFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, final Class builderClass) { super(descriptor, camelCaseName, messageClass, builderClass); newBuilderMethod = getMethodOrDie(type, "newBuilder"); - getBuilderMethodBuilder = - getMethodOrDie(builderClass, "get" + camelCaseName + "Builder", Integer.TYPE); + getBuilderMethodBuilder = getMethodOrDie(builderClass, + "get" + camelCaseName + "Builder", Integer.TYPE); } private final Method newBuilderMethod; @@ -2889,39 +2965,36 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial // DynamicMessage -- we should accept it. In this case we can make // a copy of the message. return ((Message.Builder) invokeOrDie(newBuilderMethod, null)) - .mergeFrom((Message) value) - .build(); + .mergeFrom((Message) value).build(); } } @Override - public void setRepeated(final Builder builder, final int index, final Object value) { + public void setRepeated(final Builder builder, + final int index, final Object value) { super.setRepeated(builder, index, coerceType(value)); } - @Override public void addRepeated(final Builder builder, final Object value) { super.addRepeated(builder, coerceType(value)); } - @Override public Message.Builder newBuilder() { return (Message.Builder) invokeOrDie(newBuilderMethod, null); } - @Override public Message.Builder getRepeatedBuilder( final GeneratedMessage.Builder builder, final int index) { - return (Message.Builder) invokeOrDie(getBuilderMethodBuilder, builder, index); + return (Message.Builder) invokeOrDie( + getBuilderMethodBuilder, builder, index); } } } /** - * Replaces this object in the output stream with a serialized form. Part of Java's serialization - * magic. Generated sub-classes must override this method by calling {@code return - * super.writeReplace();} - * + * Replaces this object in the output stream with a serialized form. + * Part of Java's serialization magic. Generated sub-classes must override + * this method by calling {@code return super.writeReplace();} * @return a SerializedForm of this message */ protected Object writeReplace() throws ObjectStreamException { @@ -2929,10 +3002,12 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } /** - * Checks that the {@link Extension} is non-Lite and returns it as a {@link GeneratedExtension}. + * Checks that the {@link Extension} is non-Lite and returns it as a + * {@link GeneratedExtension}. */ private static , T> - Extension checkNotLite(ExtensionLite extension) { + Extension checkNotLite( + ExtensionLite extension) { if (extension.isLite()) { throw new IllegalArgumentException("Expected non-lite extension."); } @@ -2965,8 +3040,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial } } - protected static void writeStringNoTag(CodedOutputStream output, final Object value) - throws IOException { + protected static void writeStringNoTag( + CodedOutputStream output, final Object value) throws IOException { if (value instanceof String) { output.writeStringNoTag((String) value); } else { diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java index 4250bc619b70c4a6d59171d3d1217e5c77f6dcfc..3e3efb929bc360d227a3ff2a51f0fb322e2a1ede 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java index c153960de91b4328d0920fba0723da388d6b86f0..943f6ee8029858e4e1c429fcd3caed5f287b8452 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -165,7 +188,7 @@ public abstract class GeneratedMessageLite< // any unnecessary intermediary allocations while reducing the generated code size. /** Lazily initializes unknown fields. */ - private void ensureUnknownFieldsInitialized() { + private final void ensureUnknownFieldsInitialized() { if (unknownFields == UnknownFieldSetLite.getDefaultInstance()) { unknownFields = UnknownFieldSetLite.newInstance(); } @@ -272,16 +295,10 @@ public abstract class GeneratedMessageLite< * *

For use by generated code only. */ - protected abstract Object dynamicMethod( - MethodToInvoke method, - Object arg0, - Object arg1); + protected abstract Object dynamicMethod(MethodToInvoke method, Object arg0, Object arg1); /** Same as {@link #dynamicMethod(MethodToInvoke, Object, Object)} with {@code null} padding. */ - @CanIgnoreReturnValue - protected Object dynamicMethod( - MethodToInvoke method, - Object arg0) { + protected Object dynamicMethod(MethodToInvoke method, Object arg0) { return dynamicMethod(method, arg0, null); } @@ -316,8 +333,7 @@ public abstract class GeneratedMessageLite< } @Override - int getSerializedSize( - Schema schema) { + int getSerializedSize(Schema schema) { if (isMutable()) { // The serialized size should never be memoized for mutable instances. int size = computeSerializedSize(schema); @@ -343,16 +359,15 @@ public abstract class GeneratedMessageLite< // Calling this with 'null' to delay schema lookup in case the serializedSize is already // memoized. return getSerializedSize(null); - } + } - private int computeSerializedSize( - Schema nullableSchema) { + private int computeSerializedSize(Schema nullableSchema) { if (nullableSchema == null) { return Protobuf.getInstance().schemaFor(this).getSerializedSize(this); } else { return ((Schema>) nullableSchema) .getSerializedSize(this); - } + } } /** Constructs a {@link MessageInfo} for this message type. */ @@ -391,13 +406,8 @@ public abstract class GeneratedMessageLite< protected static > void registerDefaultInstance( Class clazz, T defaultInstance) { - // Default instances must be immutable. - // Marking immutable here to avoid extra bytecode in every generated message class. - // Only calling "markImmutable" rather than "makeImmutable" because for Default Instances: - // 1. All sub-messages are initialized to null / default instances and thus immutable - // 2. All lists are initialized to default instance empty lists which are also immutable. - defaultInstance.markImmutable(); defaultInstanceMap.put(clazz, defaultInstance); + defaultInstance.makeImmutable(); } protected static Object newMessageInfo( @@ -551,7 +561,7 @@ public abstract class GeneratedMessageLite< throws IOException { copyOnWrite(); try { - // TODO: Try to make input with type CodedInputStream.ArrayDecoder use + // TODO(yilunchong): Try to make input with type CodedInputStream.ArrayDecoder use // fast path. Protobuf.getInstance().schemaFor(instance).mergeFrom( instance, CodedInputStreamReader.forCodedInput(input), extensionRegistry); @@ -565,6 +575,7 @@ public abstract class GeneratedMessageLite< } } + // ================================================================= // Extensions-related stuff @@ -620,7 +631,7 @@ public abstract class GeneratedMessageLite< throws IOException { int fieldNumber = WireFormat.getTagFieldNumber(tag); - // TODO: How much bytecode would be saved by not requiring the generated code to + // TODO(dweis): How much bytecode would be saved by not requiring the generated code to // provide the default instance? GeneratedExtension extension = extensionRegistry.findLiteExtensionByNumber(defaultInstance, fieldNumber); @@ -658,8 +669,7 @@ public abstract class GeneratedMessageLite< return parseUnknownField(tag, input); } - // TODO: remove the unused variable - FieldSet unused = ensureExtensionsAreMutable(); + ensureExtensionsAreMutable(); if (packed) { int length = input.readRawVarint32(); @@ -754,13 +764,13 @@ public abstract class GeneratedMessageLite< return true; } - // TODO: Do we really want to support non message set wire format in message sets? + // TODO(dweis): Do we really want to support non message set wire format in message sets? // Full runtime does... So we do for now. int wireType = WireFormat.getTagWireType(tag); if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { return parseUnknownField(defaultInstance, input, extensionRegistry, tag); } else { - // TODO: Should we throw on invalid input? Full runtime does not... + // TODO(dweis): Should we throw on invalid input? Full runtime does not... return input.skipField(tag); } } @@ -780,7 +790,7 @@ public abstract class GeneratedMessageLite< // The wire format for MessageSet is: // message MessageSet { // repeated group Item = 1 { - // required uint32 typeId = 2; + // required int32 typeId = 2; // required bytes message = 3; // } // } @@ -852,8 +862,7 @@ public abstract class GeneratedMessageLite< throws IOException { int fieldNumber = typeId; int tag = WireFormat.makeTag(typeId, WireFormat.WIRETYPE_LENGTH_DELIMITED); - // TODO: remove the unused variable - boolean unused = parseExtension(input, extensionRegistry, extension, tag, fieldNumber); + parseExtension(input, extensionRegistry, extension, tag, fieldNumber); } private void mergeMessageSetExtensionFromBytes( @@ -876,7 +885,6 @@ public abstract class GeneratedMessageLite< .setField(extension.descriptor, extension.singularToFieldSetType(value)); } - @CanIgnoreReturnValue FieldSet ensureExtensionsAreMutable() { if (extensions.isImmutable()) { extensions = extensions.clone(); @@ -1077,6 +1085,7 @@ public abstract class GeneratedMessageLite< /** Get one element of a repeated extension. */ @Override + @SuppressWarnings("unchecked") public final Type getExtension( final ExtensionLite> extension, final int index) { return instance.getExtension(extension, index); @@ -1228,6 +1237,7 @@ public abstract class GeneratedMessageLite< return ((Builder) to).mergeFrom((GeneratedMessageLite) from); } + @Override public int compareTo(ExtensionDescriptor other) { return number - other.number; @@ -1268,6 +1278,7 @@ public abstract class GeneratedMessageLite< } } + /** * Lite equivalent to {@link GeneratedMessage.GeneratedExtension}. * @@ -1331,11 +1342,11 @@ public abstract class GeneratedMessageLite< } @SuppressWarnings("unchecked") - Object fromFieldSetType(Object value) { + Object fromFieldSetType(final Object value) { if (descriptor.isRepeated()) { if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { - List result = new ArrayList<>(); - for (Object element : (List) value) { + final List result = new ArrayList<>(); + for (final Object element : (List) value) { result.add(singularFromFieldSetType(element)); } return result; @@ -1347,7 +1358,7 @@ public abstract class GeneratedMessageLite< } } - Object singularFromFieldSetType(Object value) { + Object singularFromFieldSetType(final Object value) { if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { return descriptor.enumTypeMap.findValueByNumber((Integer) value); } else { @@ -1355,11 +1366,12 @@ public abstract class GeneratedMessageLite< } } - Object toFieldSetType(Object value) { + @SuppressWarnings("unchecked") + Object toFieldSetType(final Object value) { if (descriptor.isRepeated()) { if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { - List result = new ArrayList<>(); - for (Object element : (List) value) { + final List result = new ArrayList<>(); + for (final Object element : (List) value) { result.add(singularToFieldSetType(element)); } return result; @@ -1371,7 +1383,7 @@ public abstract class GeneratedMessageLite< } } - Object singularToFieldSetType(Object value) { + Object singularToFieldSetType(final Object value) { if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { return ((Internal.EnumLite) value).getNumber(); } else { @@ -1409,6 +1421,7 @@ public abstract class GeneratedMessageLite< // since v3.6.1 private final Class messageClass; + // only included for backwards compatibility before messageClass was added private final String messageClassName; private final byte[] asBytes; @@ -1419,7 +1432,7 @@ public abstract class GeneratedMessageLite< */ SerializedForm(MessageLite regularForm) { messageClass = regularForm.getClass(); - messageClassName = regularForm.getClass().getName(); + messageClassName = messageClass.getName(); asBytes = regularForm.toByteArray(); } @@ -1429,6 +1442,7 @@ public abstract class GeneratedMessageLite< * * @return a GeneratedMessage of the type that was serialized */ + @SuppressWarnings("unchecked") protected Object readResolve() throws ObjectStreamException { try { Class messageClass = resolveMessageClass(); @@ -1512,10 +1526,8 @@ public abstract class GeneratedMessageLite< } boolean isInitialized = Protobuf.getInstance().schemaFor(message).isInitialized(message); if (shouldMemoize) { - // TODO: remove the unused variable - Object unused = - message.dynamicMethod( - MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED, isInitialized ? message : null); + message.dynamicMethod( + MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED, isInitialized ? message : null); } return isInitialized; } @@ -1613,30 +1625,23 @@ public abstract class GeneratedMessageLite< * A static helper method for parsing a partial from input using the extension registry and the * instance. */ - // TODO: Should this verify that the last tag was 0? + // TODO(dweis): Should this verify that the last tag was 0? static > T parsePartialFrom( T instance, CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { @SuppressWarnings("unchecked") // Guaranteed by protoc T result = instance.newMutableInstance(); try { - // TODO: Try to make input with type CodedInpuStream.ArrayDecoder use + // TODO(yilunchong): Try to make input with type CodedInpuStream.ArrayDecoder use // fast path. Schema schema = Protobuf.getInstance().schemaFor(result); schema.mergeFrom(result, CodedInputStreamReader.forCodedInput(input), extensionRegistry); schema.makeImmutable(result); - } catch (InvalidProtocolBufferException e) { - if (e.getThrownFromInputStream()) { - e = new InvalidProtocolBufferException(e); - } - throw e.setUnfinishedMessage(result); - } catch (UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(result); } catch (IOException e) { if (e.getCause() instanceof InvalidProtocolBufferException) { throw (InvalidProtocolBufferException) e.getCause(); } - throw new InvalidProtocolBufferException(e).setUnfinishedMessage(result); + throw new InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(result); } catch (RuntimeException e) { if (e.getCause() instanceof InvalidProtocolBufferException) { throw (InvalidProtocolBufferException) e.getCause(); @@ -1647,7 +1652,7 @@ public abstract class GeneratedMessageLite< } /** A static helper method for parsing a partial from byte array. */ - private static > T parsePartialFrom( + static > T parsePartialFrom( T instance, byte[] input, int offset, int length, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { @SuppressWarnings("unchecked") // Guaranteed by protoc @@ -1657,18 +1662,11 @@ public abstract class GeneratedMessageLite< schema.mergeFrom( result, input, offset, offset + length, new ArrayDecoders.Registers(extensionRegistry)); schema.makeImmutable(result); - } catch (InvalidProtocolBufferException e) { - if (e.getThrownFromInputStream()) { - e = new InvalidProtocolBufferException(e); - } - throw e.setUnfinishedMessage(result); - } catch (UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(result); } catch (IOException e) { if (e.getCause() instanceof InvalidProtocolBufferException) { throw (InvalidProtocolBufferException) e.getCause(); } - throw new InvalidProtocolBufferException(e).setUnfinishedMessage(result); + throw new InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(result); } catch (IndexOutOfBoundsException e) { throw InvalidProtocolBufferException.truncatedMessage().setUnfinishedMessage(result); } @@ -1730,14 +1728,28 @@ public abstract class GeneratedMessageLite< private static > T parsePartialFrom( T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { - CodedInputStream input = data.newCodedInput(); - T message = parsePartialFrom(defaultInstance, input, extensionRegistry); + T message; try { - input.checkLastTagWas(0); + CodedInputStream input = data.newCodedInput(); + message = parsePartialFrom(defaultInstance, input, extensionRegistry); + try { + input.checkLastTagWas(0); + } catch (InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(message); + } + return message; } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(message); + throw e; } - return message; + } + + // This is a special case since we want to verify that the last tag is 0. We assume we exhaust the + // ByteString. + private static > T parsePartialFrom( + T defaultInstance, byte[] data, ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return checkMessageInitialized( + parsePartialFrom(defaultInstance, data, 0, data.length, extensionRegistry)); } // Validates last tag. @@ -1812,13 +1824,8 @@ public abstract class GeneratedMessageLite< return null; } size = CodedInputStream.readRawVarint32(firstByte, input); - } catch (InvalidProtocolBufferException e) { - if (e.getThrownFromInputStream()) { - e = new InvalidProtocolBufferException(e); - } - throw e; } catch (IOException e) { - throw new InvalidProtocolBufferException(e); + throw new InvalidProtocolBufferException(e.getMessage()); } InputStream limitedInput = new LimitedInputStream(input, size); CodedInputStream codedInput = CodedInputStream.newInstance(limitedInput); diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java index 9c4980fcbe2259510563fc8223cbfabcb0082e46..e32260406858d7b22f8004fef5ebc204f4c408dc 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -20,15 +43,14 @@ import com.google.protobuf.Internal.DoubleList; import com.google.protobuf.Internal.FloatList; import com.google.protobuf.Internal.IntList; import com.google.protobuf.Internal.LongList; -import com.google.protobuf.Internal.ProtobufList; -// In opensource protobuf, we have versioned this GeneratedMessageV3 class to GeneratedMessageV3 and -// in the future may have GeneratedMessageV4 etc. This allows us to change some aspects of this +// In opensource protobuf, we have versioned this GeneratedMessageV3 class to GeneratedMessageV3V3 and +// in the future may have GeneratedMessageV3V4 etc. This allows us to change some aspects of this // class without breaking binary compatibility with old generated code that still subclasses -// the old GeneratedMessageV3 class. To allow these different GeneratedMessageV? classes to -// interoperate (e.g., a GeneratedMessageV3 object has a message extension field whose class -// type is GeneratedMessageV4), these classes still share a common parent class AbstractMessage +// the old GeneratedMessageV3 class. To allow these different GeneratedMessageV3V? classes to +// interoperate (e.g., a GeneratedMessageV3V3 object has a message extension field whose class +// type is GeneratedMessageV3V4), these classes still share a common parent class AbstractMessage // and are using the same GeneratedMessage.GeneratedExtension class for extension definitions. -// Since this class becomes GeneratedMessageV? in opensource, we have to add an import here +// Since this class becomes GeneratedMessageV3V? in opensource, we have to add an import here // to be able to use GeneratedMessage.GeneratedExtension. The GeneratedExtension definition in // this file is also excluded from opensource to avoid conflict. import com.google.protobuf.GeneratedMessage.GeneratedExtension; @@ -47,13 +69,15 @@ import java.util.Map; import java.util.TreeMap; /** - * All generated protocol message classes extend this class. This class implements most of the - * Message and Builder interfaces using Java reflection. Users can ignore this class and pretend - * that generated messages implement the Message interface directly. + * All generated protocol message classes extend this class. This class + * implements most of the Message and Builder interfaces using Java reflection. + * Users can ignore this class and pretend that generated messages implement + * the Message interface directly. * * @author kenton@google.com Kenton Varda */ -public abstract class GeneratedMessageV3 extends AbstractMessage implements Serializable { +public abstract class GeneratedMessageV3 extends AbstractMessage + implements Serializable { private static final long serialVersionUID = 1L; /** @@ -63,11 +87,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri */ protected static boolean alwaysUseFieldBuilders = false; - /** - * For use by generated code only. - * - *

TODO: mark this private and final (breaking change) - */ + /** For use by generated code only. */ protected UnknownFieldSet unknownFields; protected GeneratedMessageV3() { @@ -78,36 +98,33 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri unknownFields = builder.getUnknownFields(); } - /** TODO: Remove this unnecessary intermediate implementation of this method. */ @Override public Parser getParserForType() { - throw new UnsupportedOperationException("This is supposed to be overridden by subclasses."); + throw new UnsupportedOperationException( + "This is supposed to be overridden by subclasses."); } - /** - * TODO: Stop using SingleFieldBuilder and remove this setting - * - * @see #setAlwaysUseFieldBuildersForTesting(boolean) - */ + /** + * @see #setAlwaysUseFieldBuildersForTesting(boolean) + */ static void enableAlwaysUseFieldBuildersForTesting() { setAlwaysUseFieldBuildersForTesting(true); } /** - * For testing. Allows a test to disable/re-enable the optimization that avoids using field - * builders for nested messages until they are requested. By disabling this optimization, existing - * tests can be reused to test the field builders. See {@link RepeatedFieldBuilder} and {@link - * SingleFieldBuilder}. - * - *

TODO: Stop using SingleFieldBuilder and remove this setting + * For testing. Allows a test to disable/re-enable the optimization that avoids + * using field builders for nested messages until they are requested. By disabling + * this optimization, existing tests can be reused to test the field builders. + * See {@link RepeatedFieldBuilder} and {@link SingleFieldBuilder}. */ static void setAlwaysUseFieldBuildersForTesting(boolean useBuilders) { alwaysUseFieldBuilders = useBuilders; } /** - * Get the FieldAccessorTable for this type. We can't have the message class pass this in to the - * constructor because of bootstrapping trouble with DescriptorProtos. + * Get the FieldAccessorTable for this type. We can't have the message + * class pass this in to the constructor because of bootstrapping trouble + * with DescriptorProtos. */ protected abstract FieldAccessorTable internalGetFieldAccessorTable(); @@ -116,17 +133,15 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri return internalGetFieldAccessorTable().descriptor; } - /** - * TODO: This method should be removed. It enables parsing directly into an - * "immutable" message. Have to leave it for now to support old gencode. - * - * @deprecated use newBuilder().mergeFrom() instead - */ + // TODO(b/248143958): This method should be removed. It enables parsing directly into an + // "immutable" message. Have to leave it for now to support old gencode. + // @deprecated use newBuilder().mergeFrom() instead @Deprecated protected void mergeFromAndMakeImmutableInternal( CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { - Schema schema = Protobuf.getInstance().schemaFor(this); + Schema schema = + (Schema) Protobuf.getInstance().schemaFor(this); try { schema.mergeFrom(this, CodedInputStreamReader.forCodedInput(input), extensionRegistry); } catch (InvalidProtocolBufferException e) { @@ -138,14 +153,16 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } /** - * Internal helper to return a modifiable map containing all the fields. The returned Map is - * modifiable so that the caller can add additional extension fields to implement {@link - * #getAllFields()}. + * Internal helper to return a modifiable map containing all the fields. + * The returned Map is modifiable so that the caller can add additional + * extension fields to implement {@link #getAllFields()}. * * @param getBytesForString whether to generate ByteString for string fields */ - private Map getAllFieldsMutable(boolean getBytesForString) { - final TreeMap result = new TreeMap<>(); + private Map getAllFieldsMutable( + boolean getBytesForString) { + final TreeMap result = + new TreeMap(); final Descriptor descriptor = internalGetFieldAccessorTable().descriptor; final List fields = descriptor.getFields(); @@ -189,7 +206,6 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri return result; } - // TODO: compute this at {@code build()} time in the Builder class. @Override public boolean isInitialized() { for (final FieldDescriptor field : getDescriptorForType().getFields()) { @@ -202,8 +218,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri // Check that embedded messages are initialized. if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { if (field.isRepeated()) { - @SuppressWarnings("unchecked") - final List messageList = (List) getField(field); + @SuppressWarnings("unchecked") final + List messageList = (List) getField(field); for (final Message element : messageList) { if (!element.isInitialized()) { return false; @@ -222,19 +238,23 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public Map getAllFields() { - return Collections.unmodifiableMap(getAllFieldsMutable(/* getBytesForString= */ false)); + return Collections.unmodifiableMap( + getAllFieldsMutable(/* getBytesForString = */ false)); } /** - * Returns a collection of all the fields in this message which are set and their corresponding - * values. A singular ("required" or "optional") field is set iff hasField() returns true for that - * field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values - * are exactly what would be returned by calling {@link #getFieldRaw(Descriptors.FieldDescriptor)} - * for each field. The map is guaranteed to be a sorted map, so iterating over it will return - * fields in order by field number. + * Returns a collection of all the fields in this message which are set + * and their corresponding values. A singular ("required" or "optional") + * field is set iff hasField() returns true for that field. A "repeated" + * field is set iff getRepeatedFieldCount() is greater than zero. The + * values are exactly what would be returned by calling + * {@link #getFieldRaw(Descriptors.FieldDescriptor)} for each field. The map + * is guaranteed to be a sorted map, so iterating over it will return fields + * in order by field number. */ Map getAllFieldsRaw() { - return Collections.unmodifiableMap(getAllFieldsMutable(/* getBytesForString= */ true)); + return Collections.unmodifiableMap( + getAllFieldsMutable(/* getBytesForString = */ true)); } @Override @@ -258,11 +278,12 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } /** - * Obtains the value of the given field, or the default value if it is not set. For primitive - * fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the - * value is returned. For embedded message fields, the sub-message is returned. For repeated - * fields, a java.util.List is returned. For present string fields, a ByteString is returned - * representing the bytes that the field contains. + * Obtains the value of the given field, or the default value if it is + * not set. For primitive fields, the boxed primitive value is returned. + * For enum fields, the EnumValueDescriptor for the value is returned. For + * embedded message fields, the sub-message is returned. For repeated + * fields, a java.util.List is returned. For present string fields, a + * ByteString is returned representing the bytes that the field contains. */ Object getFieldRaw(final FieldDescriptor field) { return internalGetFieldAccessorTable().getField(field).getRaw(this); @@ -270,30 +291,25 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public int getRepeatedFieldCount(final FieldDescriptor field) { - return internalGetFieldAccessorTable().getField(field).getRepeatedCount(this); + return internalGetFieldAccessorTable().getField(field) + .getRepeatedCount(this); } @Override public Object getRepeatedField(final FieldDescriptor field, final int index) { - return internalGetFieldAccessorTable().getField(field).getRepeated(this, index); + return internalGetFieldAccessorTable().getField(field) + .getRepeated(this, index); } - // TODO: This method should be final. @Override public UnknownFieldSet getUnknownFields() { return unknownFields; } - // TODO: This should go away when Schema classes cannot modify immutable - // GeneratedMessageV3 objects anymore. - void setUnknownFields(UnknownFieldSet unknownFields) { - this.unknownFields = unknownFields; - } - /** * Called by subclasses to parse an unknown field. * - *

TODO remove this method + *

TODO(b/248153893) remove this method * * @return {@code true} unless the tag is an end-group tag. */ @@ -313,7 +329,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri * Delegates to parseUnknownField. This method is obsolete, but we must retain it for * compatibility with older generated code. * - *

TODO remove this method + *

TODO(b/248153893) remove this method */ protected boolean parseUnknownFieldProto3( CodedInputStream input, @@ -324,8 +340,6 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri return parseUnknownField(input, unknownFields, extensionRegistry, tag); } - /** Used by generated code. */ - @SuppressWarnings("ProtoParseWithRegistry") protected static M parseWithIOException(Parser parser, InputStream input) throws IOException { try { @@ -335,9 +349,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - /** Used by generated code. */ - protected static M parseWithIOException( - Parser parser, InputStream input, ExtensionRegistryLite extensions) throws IOException { + protected static M parseWithIOException(Parser parser, InputStream input, + ExtensionRegistryLite extensions) throws IOException { try { return parser.parseFrom(input, extensions); } catch (InvalidProtocolBufferException e) { @@ -345,10 +358,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - /** Used by generated code. */ - @SuppressWarnings("ProtoParseWithRegistry") - protected static M parseWithIOException( - Parser parser, CodedInputStream input) throws IOException { + protected static M parseWithIOException(Parser parser, + CodedInputStream input) throws IOException { try { return parser.parseFrom(input); } catch (InvalidProtocolBufferException e) { @@ -356,10 +367,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - /** Used by generated code. */ - protected static M parseWithIOException( - Parser parser, CodedInputStream input, ExtensionRegistryLite extensions) - throws IOException { + protected static M parseWithIOException(Parser parser, + CodedInputStream input, ExtensionRegistryLite extensions) throws IOException { try { return parser.parseFrom(input, extensions); } catch (InvalidProtocolBufferException e) { @@ -367,10 +376,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - /** Used by generated code. */ - @SuppressWarnings("ProtoParseWithRegistry") - protected static M parseDelimitedWithIOException( - Parser parser, InputStream input) throws IOException { + protected static M parseDelimitedWithIOException(Parser parser, + InputStream input) throws IOException { try { return parser.parseDelimitedFrom(input); } catch (InvalidProtocolBufferException e) { @@ -378,9 +385,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - /** Used by generated code. */ - protected static M parseDelimitedWithIOException( - Parser parser, InputStream input, ExtensionRegistryLite extensions) throws IOException { + protected static M parseDelimitedWithIOException(Parser parser, + InputStream input, ExtensionRegistryLite extensions) throws IOException { try { return parser.parseDelimitedFrom(input, extensions); } catch (InvalidProtocolBufferException e) { @@ -396,94 +402,72 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri return IntArrayList.emptyList(); } - // TODO: Unused. Remove. protected static IntList newIntList() { return new IntArrayList(); } - // TODO: Redundant with makeMutableCopy(). Remove. protected static IntList mutableCopy(IntList list) { - return makeMutableCopy(list); - } - - // TODO: Redundant with makeMutableCopy(). Remove. - protected static LongList mutableCopy(LongList list) { - return makeMutableCopy(list); - } - - // TODO: Redundant with makeMutableCopy(). Remove. - protected static FloatList mutableCopy(FloatList list) { - return makeMutableCopy(list); - } - - // TODO: Redundant with makeMutableCopy(). Remove. - protected static DoubleList mutableCopy(DoubleList list) { - return makeMutableCopy(list); - } - - // TODO: Redundant with makeMutableCopy(). Remove. - protected static BooleanList mutableCopy(BooleanList list) { - return makeMutableCopy(list); + int size = list.size(); + return list.mutableCopyWithCapacity( + size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); } protected static LongList emptyLongList() { return LongArrayList.emptyList(); } - // TODO: Unused. Remove. protected static LongList newLongList() { return new LongArrayList(); } + protected static LongList mutableCopy(LongList list) { + int size = list.size(); + return list.mutableCopyWithCapacity( + size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); + } + protected static FloatList emptyFloatList() { return FloatArrayList.emptyList(); } - // TODO: Unused. Remove. protected static FloatList newFloatList() { return new FloatArrayList(); } + protected static FloatList mutableCopy(FloatList list) { + int size = list.size(); + return list.mutableCopyWithCapacity( + size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); + } + protected static DoubleList emptyDoubleList() { return DoubleArrayList.emptyList(); } - // TODO: Unused. Remove. protected static DoubleList newDoubleList() { return new DoubleArrayList(); } + protected static DoubleList mutableCopy(DoubleList list) { + int size = list.size(); + return list.mutableCopyWithCapacity( + size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); + } + protected static BooleanList emptyBooleanList() { return BooleanArrayList.emptyList(); } - // TODO: Unused. Remove. protected static BooleanList newBooleanList() { return new BooleanArrayList(); } - protected static > ListT makeMutableCopy(ListT list) { - return makeMutableCopy(list, 0); - } - - @SuppressWarnings("unchecked") // Guaranteed by proto runtime. - protected static > ListT makeMutableCopy( - ListT list, int minCapacity) { + protected static BooleanList mutableCopy(BooleanList list) { int size = list.size(); - if (minCapacity <= size) { - minCapacity = size * 2; - } - if (minCapacity <= 0) { - minCapacity = AbstractProtobufList.DEFAULT_CAPACITY; - } - - return (ListT) list.mutableCopyWithCapacity(minCapacity); + return list.mutableCopyWithCapacity( + size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); } - @SuppressWarnings("unchecked") // The empty list can be safely cast - protected static ProtobufList emptyList(Class elementType) { - return (ProtobufList) ProtobufArrayList.emptyList(); - } @Override public void writeTo(final CodedOutputStream output) throws IOException { @@ -502,20 +486,26 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri return memoizedSize; } + + /** * This class is used to make a generated protected method inaccessible from user's code (e.g., * the {@link #newInstance} method below). When this class is used as a parameter's type in a - * generated protected method, the method is visible to user's code in the same package, but since - * the constructor of this class is private to protobuf runtime, user's code can't obtain an - * instance of this class and as such can't actually make a method call on the protected method. + * generated protected method, the method is visible to user's code in the same package, but + * since the constructor of this class is private to protobuf runtime, user's code can't obtain + * an instance of this class and as such can't actually make a method call on the protected + * method. */ protected static final class UnusedPrivateParameter { static final UnusedPrivateParameter INSTANCE = new UnusedPrivateParameter(); - private UnusedPrivateParameter() {} + private UnusedPrivateParameter() { + } } - /** Creates a new instance of this message type. Overridden in the generated code. */ + /** + * Creates a new instance of this message type. Overridden in the generated code. + */ @SuppressWarnings({"unused"}) protected Object newInstance(UnusedPrivateParameter unused) { throw new UnsupportedOperationException("This method must be overridden by the subclass."); @@ -523,41 +513,38 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** * Used by parsing constructors in generated classes. - * - *

TODO: remove unused method (extensions should be immutable after build) */ protected void makeExtensionsImmutable() { // Noop for messages without extensions. } /** - * TODO: remove this after b/29368482 is fixed. We need to move this interface to - * AbstractMessage in order to versioning GeneratedMessageV3 but this move breaks binary - * compatibility for AppEngine. After AppEngine is fixed we can exclude this from google3. - * - *

TODO: Remove at breaking change since b/29368482 was fixed in 2020 + * TODO(xiaofeng): remove this after b/29368482 is fixed. We need to move this + * interface to AbstractMessage in order to versioning GeneratedMessageV3 but + * this move breaks binary compatibility for AppEngine. After AppEngine is + * fixed we can exclude this from google3. */ protected interface BuilderParent extends AbstractMessage.BuilderParent {} - /** TODO: remove this together with GeneratedMessageV3.BuilderParent. */ + /** + * TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent. + */ protected abstract Message.Builder newBuilderForType(BuilderParent parent); - /** TODO: generated class should implement this directly */ @Override protected Message.Builder newBuilderForType(final AbstractMessage.BuilderParent parent) { - return newBuilderForType( - new BuilderParent() { - @Override - public void markDirty() { - parent.markDirty(); - } - }); + return newBuilderForType(new BuilderParent() { + @Override + public void markDirty() { + parent.markDirty(); + } + }); } - /** Builder class for {@link GeneratedMessageV3}. */ + @SuppressWarnings("unchecked") - public abstract static class Builder> - extends AbstractMessage.Builder { + public abstract static class Builder > + extends AbstractMessage.Builder { private BuilderParent builderParent; @@ -593,7 +580,9 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri builderParent = null; } - /** Called by the subclass when a message is built. */ + /** + * Called by the subclass when a message is built. + */ protected void onBuilt() { if (builderParent != null) { markClean(); @@ -601,8 +590,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } /** - * Called by the subclass or a builder to notify us that a message was built and may be cached - * and therefore invalidations are needed. + * Called by the subclass or a builder to notify us that a message was + * built and may be cached and therefore invalidations are needed. */ @Override protected void markClean() { @@ -619,26 +608,28 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public BuilderT clone() { - BuilderT builder = (BuilderT) getDefaultInstanceForType().newBuilderForType(); + public BuilderType clone() { + BuilderType builder = + (BuilderType) getDefaultInstanceForType().newBuilderForType(); builder.mergeFrom(buildPartial()); return builder; } /** - * Called by the initialization and clear code paths to allow subclasses to reset any of their - * builtin fields back to the initial values. + * Called by the initialization and clear code paths to allow subclasses to + * reset any of their builtin fields back to the initial values. */ @Override - public BuilderT clear() { + public BuilderType clear() { unknownFieldsOrBuilder = UnknownFieldSet.getDefaultInstance(); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } /** - * Get the FieldAccessorTable for this type. We can't have the message class pass this in to the - * constructor because of bootstrapping trouble with DescriptorProtos. + * Get the FieldAccessorTable for this type. We can't have the message + * class pass this in to the constructor because of bootstrapping trouble + * with DescriptorProtos. */ protected abstract FieldAccessorTable internalGetFieldAccessorTable(); @@ -654,7 +645,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** Internal helper which returns a mutable map. */ private Map getAllFieldsMutable() { - final TreeMap result = new TreeMap<>(); + final TreeMap result = + new TreeMap(); final Descriptor descriptor = internalGetFieldAccessorTable().descriptor; final List fields = descriptor.getFields(); @@ -706,7 +698,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public Message.Builder getRepeatedFieldBuilder(final FieldDescriptor field, int index) { - return internalGetFieldAccessorTable().getField(field).getRepeatedBuilder(this, index); + return internalGetFieldAccessorTable().getField(field).getRepeatedBuilder( + this, index); } @Override @@ -730,88 +723,93 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri if (field.isRepeated()) { // The underlying list object is still modifiable at this point. // Make sure not to expose the modifiable list to the caller. - return Collections.unmodifiableList((List) object); + return Collections.unmodifiableList((List) object); } else { return object; } } @Override - public BuilderT setField(final FieldDescriptor field, final Object value) { + public BuilderType setField(final FieldDescriptor field, final Object value) { internalGetFieldAccessorTable().getField(field).set(this, value); - return (BuilderT) this; + return (BuilderType) this; } @Override - public BuilderT clearField(final FieldDescriptor field) { + public BuilderType clearField(final FieldDescriptor field) { internalGetFieldAccessorTable().getField(field).clear(this); - return (BuilderT) this; + return (BuilderType) this; } @Override - public BuilderT clearOneof(final OneofDescriptor oneof) { + public BuilderType clearOneof(final OneofDescriptor oneof) { internalGetFieldAccessorTable().getOneof(oneof).clear(this); - return (BuilderT) this; + return (BuilderType) this; } @Override public int getRepeatedFieldCount(final FieldDescriptor field) { - return internalGetFieldAccessorTable().getField(field).getRepeatedCount(this); + return internalGetFieldAccessorTable().getField(field) + .getRepeatedCount(this); } @Override public Object getRepeatedField(final FieldDescriptor field, final int index) { - return internalGetFieldAccessorTable().getField(field).getRepeated(this, index); + return internalGetFieldAccessorTable().getField(field) + .getRepeated(this, index); } @Override - public BuilderT setRepeatedField( + public BuilderType setRepeatedField( final FieldDescriptor field, final int index, final Object value) { - internalGetFieldAccessorTable().getField(field).setRepeated(this, index, value); - return (BuilderT) this; + internalGetFieldAccessorTable().getField(field) + .setRepeated(this, index, value); + return (BuilderType) this; } @Override - public BuilderT addRepeatedField(final FieldDescriptor field, final Object value) { + public BuilderType addRepeatedField(final FieldDescriptor field, final Object value) { internalGetFieldAccessorTable().getField(field).addRepeated(this, value); - return (BuilderT) this; + return (BuilderType) this; } - private BuilderT setUnknownFieldsInternal(final UnknownFieldSet unknownFields) { + private BuilderType setUnknownFieldsInternal(final UnknownFieldSet unknownFields) { unknownFieldsOrBuilder = unknownFields; onChanged(); - return (BuilderT) this; + return (BuilderType) this; } @Override - public BuilderT setUnknownFields(final UnknownFieldSet unknownFields) { + public BuilderType setUnknownFields(final UnknownFieldSet unknownFields) { return setUnknownFieldsInternal(unknownFields); } /** - * This method is obsolete, but we must retain it for compatibility with older generated code. + * This method is obsolete, but we must retain it for compatibility with + * older generated code. */ - protected BuilderT setUnknownFieldsProto3(final UnknownFieldSet unknownFields) { + protected BuilderType setUnknownFieldsProto3(final UnknownFieldSet unknownFields) { return setUnknownFieldsInternal(unknownFields); } @Override - public BuilderT mergeUnknownFields(final UnknownFieldSet unknownFields) { + public BuilderType mergeUnknownFields(final UnknownFieldSet unknownFields) { if (UnknownFieldSet.getDefaultInstance().equals(unknownFields)) { - return (BuilderT) this; + return (BuilderType) this; } if (UnknownFieldSet.getDefaultInstance().equals(unknownFieldsOrBuilder)) { unknownFieldsOrBuilder = unknownFields; onChanged(); - return (BuilderT) this; + return (BuilderType) this; } getUnknownFieldSetBuilder().mergeFrom(unknownFields); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } + @Override public boolean isInitialized() { for (final FieldDescriptor field : getDescriptorForType().getFields()) { @@ -824,15 +822,16 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri // Check that embedded messages are initialized. if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { if (field.isRepeated()) { - @SuppressWarnings("unchecked") - final List messageList = (List) getField(field); + @SuppressWarnings("unchecked") final + List messageList = (List) getField(field); for (final Message element : messageList) { if (!element.isInitialized()) { return false; } } } else { - if (hasField(field) && !((Message) getField(field)).isInitialized()) { + if (hasField(field) && + !((Message) getField(field)).isInitialized()) { return false; } } @@ -890,8 +889,9 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } /** - * Implementation of {@link BuilderParent} for giving to our children. This small inner class - * makes it so we don't publicly expose the BuilderParent methods. + * Implementation of {@link BuilderParent} for giving to our children. This + * small inner class makes it so we don't publicly expose the BuilderParent + * methods. */ private class BuilderParentImpl implements BuilderParent { @@ -903,7 +903,6 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** * Gets the {@link BuilderParent} for giving to our children. - * * @return The builder parent for our children. */ protected BuilderParent getParentForChildren() { @@ -914,8 +913,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } /** - * Called when a builder or one of its nested children has changed and any parent should be - * notified of its invalidation. + * Called when a the builder or one of its nested children has changed + * and any parent should be notified of its invalidation. */ protected final void onChanged() { if (isClean && builderParent != null) { @@ -927,126 +926,99 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } /** - * Gets the map field with the given field number. This method should be overridden in the - * generated message class if the message contains map fields. + * Gets the map field with the given field number. This method should be + * overridden in the generated message class if the message contains map + * fields. * - *

Unlike other field types, reflection support for map fields can't be implemented based on - * generated public API because we need to access a map field as a list in reflection API but - * the generated API only allows us to access it as a map. This method returns the underlying - * map field directly and thus enables us to access the map field as a list. + * Unlike other field types, reflection support for map fields can't be + * implemented based on generated public API because we need to access a + * map field as a list in reflection API but the generated API only allows + * us to access it as a map. This method returns the underlying map field + * directly and thus enables us to access the map field as a list. */ @SuppressWarnings({"unused", "rawtypes"}) - protected MapFieldReflectionAccessor internalGetMapFieldReflection(int fieldNumber) { - return internalGetMapField(fieldNumber); - } - - /** TODO: Remove, exists for compatibility with generated code. */ - @Deprecated - @SuppressWarnings({"unused", "rawtypes"}) protected MapField internalGetMapField(int fieldNumber) { // Note that we can't use descriptor names here because this method will // be called when descriptor is being initialized. - throw new IllegalArgumentException("No map fields found in " + getClass().getName()); - } - - /** Like {@link #internalGetMapFieldReflection} but return a mutable version. */ - @SuppressWarnings({"unused", "rawtypes"}) - protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int fieldNumber) { - return internalGetMutableMapField(fieldNumber); + throw new RuntimeException( + "No map fields found in " + getClass().getName()); } - /** TODO: Remove, exists for compatibility with generated code. */ - @Deprecated + /** Like {@link #internalGetMapField} but return a mutable version. */ @SuppressWarnings({"unused", "rawtypes"}) protected MapField internalGetMutableMapField(int fieldNumber) { // Note that we can't use descriptor names here because this method will // be called when descriptor is being initialized. - throw new IllegalArgumentException("No map fields found in " + getClass().getName()); + throw new RuntimeException( + "No map fields found in " + getClass().getName()); } } // ================================================================= // Extensions-related stuff - /** Extends {@link MessageOrBuilder} with extension-related functions. */ - public interface ExtendableMessageOrBuilder> - extends MessageOrBuilder { + public interface ExtendableMessageOrBuilder< + MessageType extends ExtendableMessage> extends MessageOrBuilder { // Re-define for return type covariance. @Override Message getDefaultInstanceForType(); /** Check if a singular extension is present. */ - boolean hasExtension(ExtensionLite extension); + boolean hasExtension( + ExtensionLite extension); /** Get the number of elements in a repeated extension. */ - int getExtensionCount(ExtensionLite> extension); + int getExtensionCount( + ExtensionLite> extension); /** Get the value of an extension. */ - T getExtension(ExtensionLite extension); + Type getExtension( + ExtensionLite extension); /** Get one element of a repeated extension. */ - T getExtension(ExtensionLite> extension, int index); + Type getExtension( + ExtensionLite> extension, + int index); - /** - * Check if a singular extension is present. - *

TODO: handled by ExtensionLite version - */ - boolean hasExtension( - Extension extension); - /** - * Check if a singular extension is present. - *

TODO: handled by ExtensionLite version - */ - boolean hasExtension( - GeneratedExtension extension); - /** - * Get the number of elements in a repeated extension. - *

TODO: handled by ExtensionLite version - */ - int getExtensionCount( - Extension> extension); - /** - * Get the number of elements in a repeated extension. - *

TODO: handled by ExtensionLite version - */ - int getExtensionCount( - GeneratedExtension> extension); - /** - * Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ - T getExtension( - Extension extension); - /** - * Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ - T getExtension( - GeneratedExtension extension); - /** - * Get one element of a repeated extension. - *

TODO: handled by ExtensionLite version - */ - T getExtension( - Extension> extension, + /** Check if a singular extension is present. */ + boolean hasExtension( + Extension extension); + /** Check if a singular extension is present. */ + boolean hasExtension( + GeneratedExtension extension); + /** Get the number of elements in a repeated extension. */ + int getExtensionCount( + Extension> extension); + /** Get the number of elements in a repeated extension. */ + int getExtensionCount( + GeneratedExtension> extension); + /** Get the value of an extension. */ + Type getExtension( + Extension extension); + /** Get the value of an extension. */ + Type getExtension( + GeneratedExtension extension); + /** Get one element of a repeated extension. */ + Type getExtension( + Extension> extension, int index); - /** - * Get one element of a repeated extension. - *

TODO: handled by ExtensionLite version - */ - T getExtension( - GeneratedExtension> extension, + /** Get one element of a repeated extension. */ + Type getExtension( + GeneratedExtension> extension, int index); } /** - * Generated message classes for message types that contain extension ranges subclass this. + * Generated message classes for message types that contain extension ranges + * subclass this. * - *

This class implements type-safe accessors for extensions. They implement all the same - * operations that you can do with normal fields -- e.g. "has", "get", and "getCount" -- but for - * extensions. The extensions are identified using instances of the class {@link - * GeneratedExtension}; the protocol compiler generates a static instance of this class for every - * extension in its input. Through the magic of generics, all is made type-safe. + *

This class implements type-safe accessors for extensions. They + * implement all the same operations that you can do with normal fields -- + * e.g. "has", "get", and "getCount" -- but for extensions. The extensions + * are identified using instances of the class {@link GeneratedExtension}; + * the protocol compiler generates a static instance of this class for every + * extension in its input. Through the magic of generics, all is made + * type-safe. * *

For example, imagine you have the {@code .proto} file: * @@ -1071,8 +1043,10 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri * *

See also {@link ExtendableBuilder}. */ - public abstract static class ExtendableMessage> - extends GeneratedMessageV3 implements ExtendableMessageOrBuilder { + public abstract static class ExtendableMessage< + MessageType extends ExtendableMessage> + extends GeneratedMessageV3 + implements ExtendableMessageOrBuilder { private static final long serialVersionUID = 1L; @@ -1082,27 +1056,30 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri this.extensions = FieldSet.newFieldSet(); } - protected ExtendableMessage(ExtendableBuilder builder) { + protected ExtendableMessage( + ExtendableBuilder builder) { super(builder); this.extensions = builder.buildExtensions(); } - private void verifyExtensionContainingType(final Extension extension) { - if (extension.getDescriptor().getContainingType() != getDescriptorForType()) { + private void verifyExtensionContainingType( + final Extension extension) { + if (extension.getDescriptor().getContainingType() != + getDescriptorForType()) { // This can only happen if someone uses unchecked operations. throw new IllegalArgumentException( - "Extension is for type \"" - + extension.getDescriptor().getContainingType().getFullName() - + "\" which does not match message type \"" - + getDescriptorForType().getFullName() - + "\"."); + "Extension is for type \"" + + extension.getDescriptor().getContainingType().getFullName() + + "\" which does not match message type \"" + + getDescriptorForType().getFullName() + "\"."); } } /** Check if a singular extension is present. */ @Override - public final boolean hasExtension(final ExtensionLite extensionLite) { - Extension extension = checkNotLite(extensionLite); + @SuppressWarnings("unchecked") + public final boolean hasExtension(final ExtensionLite extensionLite) { + Extension extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); return extensions.hasField(extension.getDescriptor()); @@ -1110,8 +1087,10 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount(final ExtensionLite> extensionLite) { - Extension> extension = checkNotLite(extensionLite); + @SuppressWarnings("unchecked") + public final int getExtensionCount( + final ExtensionLite> extensionLite) { + Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); final FieldDescriptor descriptor = extension.getDescriptor(); @@ -1121,107 +1100,85 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** Get the value of an extension. */ @Override @SuppressWarnings("unchecked") - public final T getExtension(final ExtensionLite extensionLite) { - Extension extension = checkNotLite(extensionLite); + public final Type getExtension(final ExtensionLite extensionLite) { + Extension extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); FieldDescriptor descriptor = extension.getDescriptor(); final Object value = extensions.getField(descriptor); if (value == null) { if (descriptor.isRepeated()) { - return (T) Collections.emptyList(); - } else if (descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { - return (T) extension.getMessageDefaultInstance(); + return (Type) Collections.emptyList(); + } else if (descriptor.getJavaType() == + FieldDescriptor.JavaType.MESSAGE) { + return (Type) extension.getMessageDefaultInstance(); } else { - return (T) extension.fromReflectionType(descriptor.getDefaultValue()); + return (Type) extension.fromReflectionType( + descriptor.getDefaultValue()); } } else { - return (T) extension.fromReflectionType(value); + return (Type) extension.fromReflectionType(value); } } /** Get one element of a repeated extension. */ @Override @SuppressWarnings("unchecked") - public final T getExtension( - final ExtensionLite> extensionLite, final int index) { - Extension> extension = checkNotLite(extensionLite); + public final Type getExtension( + final ExtensionLite> extensionLite, final int index) { + Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); FieldDescriptor descriptor = extension.getDescriptor(); - return (T) - extension.singularFromReflectionType(extensions.getRepeatedField(descriptor, index)); + return (Type) extension.singularFromReflectionType( + extensions.getRepeatedField(descriptor, index)); } - /** - * Check if a singular extension is present. - *

TODO: handled by ExtensionLite version - */ + /** Check if a singular extension is present. */ @Override - public final boolean hasExtension(final Extension extension) { - return hasExtension((ExtensionLite) extension); + public final boolean hasExtension(final Extension extension) { + return hasExtension((ExtensionLite) extension); } - /** - * Check if a singular extension is present. - *

TODO: handled by ExtensionLite version - */ + /** Check if a singular extension is present. */ @Override - public final boolean hasExtension( - final GeneratedExtension extension) { - return hasExtension((ExtensionLite) extension); + public final boolean hasExtension( + final GeneratedExtension extension) { + return hasExtension((ExtensionLite) extension); } - /** - * Get the number of elements in a repeated extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount( - final Extension> extension) { - return getExtensionCount((ExtensionLite>) extension); + public final int getExtensionCount( + final Extension> extension) { + return getExtensionCount((ExtensionLite>) extension); } - /** - * Get the number of elements in a repeated extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount( - final GeneratedExtension> extension) { - return getExtensionCount((ExtensionLite>) extension); + public final int getExtensionCount( + final GeneratedExtension> extension) { + return getExtensionCount((ExtensionLite>) extension); } - /** - * Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the value of an extension. */ @Override - public final T getExtension(final Extension extension) { - return getExtension((ExtensionLite) extension); + public final Type getExtension(final Extension extension) { + return getExtension((ExtensionLite) extension); } - /** - * Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the value of an extension. */ @Override - public final T getExtension( - final GeneratedExtension extension) { - return getExtension((ExtensionLite) extension); + public final Type getExtension( + final GeneratedExtension extension) { + return getExtension((ExtensionLite) extension); } - /** - * Get one element of a repeated extension. - *

TODO: handled by ExtensionLite version - */ + /** Get one element of a repeated extension. */ @Override - public final T getExtension( - final Extension> extension, final int index) { - return getExtension((ExtensionLite>) extension, index); + public final Type getExtension( + final Extension> extension, final int index) { + return getExtension((ExtensionLite>) extension, index); } - /** - * Get one element of a repeated extension. - *

TODO: handled by ExtensionLite version - */ + /** Get one element of a repeated extension. */ @Override - public final T getExtension( - final GeneratedExtension> extension, final int index) { - return getExtension((ExtensionLite>) extension, index); + public final Type getExtension( + final GeneratedExtension> extension, final int index) { + return getExtension((ExtensionLite>) extension, index); } /** Called by subclasses to check if all extensions are initialized. */ @@ -1229,49 +1186,38 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri return extensions.isInitialized(); } - // TODO: compute this in the builder at {@code build()} time. @Override public boolean isInitialized() { return super.isInitialized() && extensionsAreInitialized(); } - // TODO: remove mutating method from immutable type @Override protected boolean parseUnknownField( CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, - int tag) - throws IOException { + int tag) throws IOException { return MessageReflection.mergeFieldFrom( - input, - input.shouldDiscardUnknownFields() ? null : unknownFields, - extensionRegistry, - getDescriptorForType(), - new MessageReflection.ExtensionAdapter(extensions), - tag); + input, input.shouldDiscardUnknownFields() ? null : unknownFields, extensionRegistry, + getDescriptorForType(), new MessageReflection.ExtensionAdapter(extensions), tag); } /** * Delegates to parseUnknownField. This method is obsolete, but we must retain it for * compatibility with older generated code. - * - *

TODO: remove mutating method from immutable type */ @Override protected boolean parseUnknownFieldProto3( CodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistryLite extensionRegistry, - int tag) - throws IOException { + int tag) throws IOException { return parseUnknownField(input, unknownFields, extensionRegistry, tag); } + /** * Used by parsing constructors in generated classes. - * - *

TODO: remove unused method (extensions should be immutable after build) */ @Override protected void makeExtensionsImmutable() { @@ -1279,15 +1225,17 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } /** - * Used by subclasses to serialize extensions. Extension ranges may be interleaved with field - * numbers, but we must write them in canonical (sorted by field number) order. ExtensionWriter - * helps us write individual ranges of extensions at once. + * Used by subclasses to serialize extensions. Extension ranges may be + * interleaved with field numbers, but we must write them in canonical + * (sorted by field number) order. ExtensionWriter helps us write + * individual ranges of extensions at once. */ protected class ExtensionWriter { // Imagine how much simpler this code would be if Java iterators had // a way to get the next element without advancing the iterator. - private final Iterator> iter = extensions.iterator(); + private final Iterator> iter = + extensions.iterator(); private Map.Entry next; private final boolean messageSetWireFormat; @@ -1298,21 +1246,22 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri this.messageSetWireFormat = messageSetWireFormat; } - public void writeUntil(final int end, final CodedOutputStream output) throws IOException { + public void writeUntil(final int end, final CodedOutputStream output) + throws IOException { while (next != null && next.getKey().getNumber() < end) { FieldDescriptor descriptor = next.getKey(); - if (messageSetWireFormat - && descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE - && !descriptor.isRepeated()) { + if (messageSetWireFormat && descriptor.getLiteJavaType() == + WireFormat.JavaType.MESSAGE && + !descriptor.isRepeated()) { if (next instanceof LazyField.LazyEntry) { - output.writeRawMessageSetExtension( - descriptor.getNumber(), + output.writeRawMessageSetExtension(descriptor.getNumber(), ((LazyField.LazyEntry) next).getField().toByteString()); } else { - output.writeMessageSetExtension(descriptor.getNumber(), (Message) next.getValue()); + output.writeMessageSetExtension(descriptor.getNumber(), + (Message) next.getValue()); } } else { - // TODO: Taken care of following code, it may cause + // TODO(xiangl): Taken care of following code, it may cause // problem when we use LazyField for normal fields/extensions. // Due to the optional field can be duplicated at the end of // serialized bytes, which will make the serialized size change @@ -1333,7 +1282,6 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri protected ExtensionWriter newExtensionWriter() { return new ExtensionWriter(false); } - protected ExtensionWriter newMessageSetExtensionWriter() { return new ExtensionWriter(true); } @@ -1342,7 +1290,6 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri protected int extensionsSerializedSize() { return extensions.getSerializedSize(); } - protected int extensionsSerializedSizeAsMessageSet() { return extensions.getMessageSetSerializedSize(); } @@ -1357,7 +1304,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public Map getAllFields() { final Map result = - super.getAllFieldsMutable(/* getBytesForString= */ false); + super.getAllFieldsMutable(/* getBytesForString = */ false); result.putAll(getExtensionFields()); return Collections.unmodifiableMap(result); } @@ -1365,7 +1312,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public Map getAllFieldsRaw() { final Map result = - super.getAllFieldsMutable(/* getBytesForString= */ false); + super.getAllFieldsMutable(/* getBytesForString = */ false); result.putAll(getExtensionFields()); return Collections.unmodifiableMap(result); } @@ -1414,7 +1361,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object getRepeatedField(final FieldDescriptor field, final int index) { + public Object getRepeatedField(final FieldDescriptor field, + final int index) { if (field.isExtension()) { verifyContainingType(field); return extensions.getRepeatedField(field, index); @@ -1425,19 +1373,23 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri private void verifyContainingType(final FieldDescriptor field) { if (field.getContainingType() != getDescriptorForType()) { - throw new IllegalArgumentException("FieldDescriptor does not match message type."); + throw new IllegalArgumentException( + "FieldDescriptor does not match message type."); } } } /** - * Generated message builders for message types that contain extension ranges subclass this. + * Generated message builders for message types that contain extension ranges + * subclass this. * - *

This class implements type-safe accessors for extensions. They implement all the same - * operations that you can do with normal fields -- e.g. "get", "set", and "add" -- but for - * extensions. The extensions are identified using instances of the class {@link - * GeneratedExtension}; the protocol compiler generates a static instance of this class for every - * extension in its input. Through the magic of generics, all is made type-safe. + *

This class implements type-safe accessors for extensions. They + * implement all the same operations that you can do with normal fields -- + * e.g. "get", "set", and "add" -- but for extensions. The extensions are + * identified using instances of the class {@link GeneratedExtension}; the + * protocol compiler generates a static instance of this class for every + * extension in its input. Through the magic of generics, all is made + * type-safe. * *

For example, imagine you have the {@code .proto} file: * @@ -1466,15 +1418,17 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri */ @SuppressWarnings("unchecked") public abstract static class ExtendableBuilder< - MessageT extends ExtendableMessage, - BuilderT extends ExtendableBuilder> - extends Builder implements ExtendableMessageOrBuilder { + MessageType extends ExtendableMessage, + BuilderType extends ExtendableBuilder> + extends Builder + implements ExtendableMessageOrBuilder { private FieldSet.Builder extensions; protected ExtendableBuilder() {} - protected ExtendableBuilder(BuilderParent parent) { + protected ExtendableBuilder( + BuilderParent parent) { super(parent); } @@ -1484,7 +1438,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public BuilderT clear() { + public BuilderType clear() { extensions = null; return super.clear(); } @@ -1495,31 +1449,33 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - private void verifyExtensionContainingType(final Extension extension) { - if (extension.getDescriptor().getContainingType() != getDescriptorForType()) { + private void verifyExtensionContainingType( + final Extension extension) { + if (extension.getDescriptor().getContainingType() != + getDescriptorForType()) { // This can only happen if someone uses unchecked operations. throw new IllegalArgumentException( - "Extension is for type \"" - + extension.getDescriptor().getContainingType().getFullName() - + "\" which does not match message type \"" - + getDescriptorForType().getFullName() - + "\"."); + "Extension is for type \"" + + extension.getDescriptor().getContainingType().getFullName() + + "\" which does not match message type \"" + + getDescriptorForType().getFullName() + "\"."); } } /** Check if a singular extension is present. */ @Override - public final boolean hasExtension(final ExtensionLite extensionLite) { - Extension extension = checkNotLite(extensionLite); + public final boolean hasExtension(final ExtensionLite extensionLite) { + Extension extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); - return extensions != null && extensions.hasField(extension.getDescriptor()); + return extensions == null ? false : extensions.hasField(extension.getDescriptor()); } /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount(final ExtensionLite> extensionLite) { - Extension> extension = checkNotLite(extensionLite); + public final int getExtensionCount( + final ExtensionLite> extensionLite) { + Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); final FieldDescriptor descriptor = extension.getDescriptor(); @@ -1528,233 +1484,195 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** Get the value of an extension. */ @Override - public final T getExtension(final ExtensionLite extensionLite) { - Extension extension = checkNotLite(extensionLite); + public final Type getExtension(final ExtensionLite extensionLite) { + Extension extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); FieldDescriptor descriptor = extension.getDescriptor(); final Object value = extensions == null ? null : extensions.getField(descriptor); if (value == null) { if (descriptor.isRepeated()) { - return (T) Collections.emptyList(); - } else if (descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { - return (T) extension.getMessageDefaultInstance(); + return (Type) Collections.emptyList(); + } else if (descriptor.getJavaType() == + FieldDescriptor.JavaType.MESSAGE) { + return (Type) extension.getMessageDefaultInstance(); } else { - return (T) extension.fromReflectionType(descriptor.getDefaultValue()); + return (Type) extension.fromReflectionType( + descriptor.getDefaultValue()); } } else { - return (T) extension.fromReflectionType(value); + return (Type) extension.fromReflectionType(value); } } /** Get one element of a repeated extension. */ @Override - public final T getExtension( - final ExtensionLite> extensionLite, final int index) { - Extension> extension = checkNotLite(extensionLite); + public final Type getExtension( + final ExtensionLite> extensionLite, final int index) { + Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); FieldDescriptor descriptor = extension.getDescriptor(); if (extensions == null) { throw new IndexOutOfBoundsException(); } - return (T) + return (Type) extension.singularFromReflectionType(extensions.getRepeatedField(descriptor, index)); } /** Set the value of an extension. */ - public final BuilderT setExtension( - final ExtensionLite extensionLite, final T value) { - Extension extension = checkNotLite(extensionLite); + public final BuilderType setExtension( + final ExtensionLite extensionLite, + final Type value) { + Extension extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); ensureExtensionsIsMutable(); final FieldDescriptor descriptor = extension.getDescriptor(); extensions.setField(descriptor, extension.toReflectionType(value)); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } /** Set the value of one element of a repeated extension. */ - public final BuilderT setExtension( - final ExtensionLite> extensionLite, final int index, final T value) { - Extension> extension = checkNotLite(extensionLite); + public final BuilderType setExtension( + final ExtensionLite> extensionLite, + final int index, final Type value) { + Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); ensureExtensionsIsMutable(); final FieldDescriptor descriptor = extension.getDescriptor(); - extensions.setRepeatedField(descriptor, index, extension.singularToReflectionType(value)); + extensions.setRepeatedField( + descriptor, index, + extension.singularToReflectionType(value)); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } /** Append a value to a repeated extension. */ - public final BuilderT addExtension( - final ExtensionLite> extensionLite, final T value) { - Extension> extension = checkNotLite(extensionLite); + public final BuilderType addExtension( + final ExtensionLite> extensionLite, + final Type value) { + Extension> extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); ensureExtensionsIsMutable(); final FieldDescriptor descriptor = extension.getDescriptor(); - extensions.addRepeatedField(descriptor, extension.singularToReflectionType(value)); + extensions.addRepeatedField( + descriptor, extension.singularToReflectionType(value)); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } /** Clear an extension. */ - public final BuilderT clearExtension(final ExtensionLite extensionLite) { - Extension extension = checkNotLite(extensionLite); + public final BuilderType clearExtension(final ExtensionLite extensionLite) { + Extension extension = checkNotLite(extensionLite); verifyExtensionContainingType(extension); ensureExtensionsIsMutable(); extensions.clearField(extension.getDescriptor()); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } - /** - * Check if a singular extension is present. - *

TODO: handled by ExtensionLite version - */ + /** Check if a singular extension is present. */ @Override - public final boolean hasExtension(final Extension extension) { - return hasExtension((ExtensionLite) extension); + public final boolean hasExtension(final Extension extension) { + return hasExtension((ExtensionLite) extension); } - /** - * Check if a singular extension is present. - *

TODO: handled by ExtensionLite version - */ + /** Check if a singular extension is present. */ @Override - public final boolean hasExtension( - final GeneratedExtension extension) { - return hasExtension((ExtensionLite) extension); + public final boolean hasExtension( + final GeneratedExtension extension) { + return hasExtension((ExtensionLite) extension); } - /** - * Get the number of elements in a repeated extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount( - final Extension> extension) { - return getExtensionCount((ExtensionLite>) extension); + public final int getExtensionCount( + final Extension> extension) { + return getExtensionCount((ExtensionLite>) extension); } - /** - * Get the number of elements in a repeated extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the number of elements in a repeated extension. */ @Override - public final int getExtensionCount( - final GeneratedExtension> extension) { - return getExtensionCount((ExtensionLite>) extension); + public final int getExtensionCount( + final GeneratedExtension> extension) { + return getExtensionCount((ExtensionLite>) extension); } - /** - * Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the value of an extension. */ @Override - public final T getExtension(final Extension extension) { - return getExtension((ExtensionLite) extension); + public final Type getExtension(final Extension extension) { + return getExtension((ExtensionLite) extension); } - /** Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the value of an extension. */ @Override - public final T getExtension( - final GeneratedExtension extension) { - return getExtension((ExtensionLite) extension); + public final Type getExtension( + final GeneratedExtension extension) { + return getExtension((ExtensionLite) extension); } - /** - * Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the value of an extension. */ @Override - public final T getExtension( - final Extension> extension, final int index) { - return getExtension((ExtensionLite>) extension, index); + public final Type getExtension( + final Extension> extension, final int index) { + return getExtension((ExtensionLite>) extension, index); } - /** - * Get the value of an extension. - *

TODO: handled by ExtensionLite version - */ + /** Get the value of an extension. */ @Override - public final T getExtension( - final GeneratedExtension> extension, final int index) { - return getExtension((ExtensionLite>) extension, index); + public final Type getExtension( + final GeneratedExtension> extension, final int index) { + return getExtension((ExtensionLite>) extension, index); } - /** - * Set the value of an extension. - *

TODO: handled by ExtensionLite version - */ - public final BuilderT setExtension( - final Extension extension, final T value) { - return setExtension((ExtensionLite) extension, value); + /** Set the value of an extension. */ + public final BuilderType setExtension( + final Extension extension, final Type value) { + return setExtension((ExtensionLite) extension, value); } - /** - * Set the value of an extension. - *

TODO: handled by ExtensionLite version - */ - public BuilderT setExtension( - final GeneratedExtension extension, final T value) { - return setExtension((ExtensionLite) extension, value); + /** Set the value of an extension. */ + public BuilderType setExtension( + final GeneratedExtension extension, final Type value) { + return setExtension((ExtensionLite) extension, value); } - /** - * Set the value of one element of a repeated extension. - *

TODO: handled by ExtensionLite version - */ - public final BuilderT setExtension( - final Extension> extension, - final int index, final T value) { - return setExtension((ExtensionLite>) extension, index, value); + /** Set the value of one element of a repeated extension. */ + public final BuilderType setExtension( + final Extension> extension, + final int index, final Type value) { + return setExtension((ExtensionLite>) extension, index, value); } - /** - * Set the value of one element of a repeated extension. - *

TODO: handled by ExtensionLite version - */ - public BuilderT setExtension( - final GeneratedExtension> extension, - final int index, final T value) { - return setExtension((ExtensionLite>) extension, index, value); + /** Set the value of one element of a repeated extension. */ + public BuilderType setExtension( + final GeneratedExtension> extension, + final int index, final Type value) { + return setExtension((ExtensionLite>) extension, index, value); } - /** - * Append a value to a repeated extension. - *

TODO: handled by ExtensionLite version - */ - public final BuilderT addExtension( - final Extension> extension, final T value) { - return addExtension((ExtensionLite>) extension, value); + /** Append a value to a repeated extension. */ + public final BuilderType addExtension( + final Extension> extension, final Type value) { + return addExtension((ExtensionLite>) extension, value); } - /** - * Append a value to a repeated extension. - *

TODO: handled by ExtensionLite version - */ - public BuilderT addExtension( - final GeneratedExtension> extension, final T value) { - return addExtension((ExtensionLite>) extension, value); + /** Append a value to a repeated extension. */ + public BuilderType addExtension( + final GeneratedExtension> extension, final Type value) { + return addExtension((ExtensionLite>) extension, value); } - /** - * Clear an extension. - *

TODO: handled by ExtensionLite version - */ - public final BuilderT clearExtension( - final Extension extension) { - return clearExtension((ExtensionLite) extension); + /** Clear an extension. */ + public final BuilderType clearExtension( + final Extension extension) { + return clearExtension((ExtensionLite) extension); } - /** - * Clears an extension. - *

TODO: handled by ExtensionLite version - */ - public BuilderT clearExtension( - final GeneratedExtension extension) { - return clearExtension((ExtensionLite) extension); + /** Clear an extension. */ + public BuilderType clearExtension( + final GeneratedExtension extension) { + return clearExtension((ExtensionLite) extension); } /** Called by subclasses to check if all extensions are initialized. */ protected boolean extensionsAreInitialized() { - return extensions == null || extensions.isInitialized(); + return extensions == null ? true : extensions.isInitialized(); } /** - * Called by the build code path to create a copy of the extensions for building the message. + * Called by the build code path to create a copy of the extensions for + * building the message. */ private FieldSet buildExtensions() { return extensions == null @@ -1844,7 +1762,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object getRepeatedField(final FieldDescriptor field, final int index) { + public Object getRepeatedField(final FieldDescriptor field, + final int index) { if (field.isExtension()) { verifyContainingType(field); if (extensions == null) { @@ -1886,60 +1805,62 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri public boolean hasField(final FieldDescriptor field) { if (field.isExtension()) { verifyContainingType(field); - return extensions != null && extensions.hasField(field); + return extensions == null ? false : extensions.hasField(field); } else { return super.hasField(field); } } @Override - public BuilderT setField(final FieldDescriptor field, final Object value) { + public BuilderType setField(final FieldDescriptor field, + final Object value) { if (field.isExtension()) { verifyContainingType(field); ensureExtensionsIsMutable(); extensions.setField(field, value); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } else { return super.setField(field, value); } } @Override - public BuilderT clearField(final FieldDescriptor field) { + public BuilderType clearField(final FieldDescriptor field) { if (field.isExtension()) { verifyContainingType(field); ensureExtensionsIsMutable(); extensions.clearField(field); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } else { return super.clearField(field); } } @Override - public BuilderT setRepeatedField( - final FieldDescriptor field, final int index, final Object value) { + public BuilderType setRepeatedField(final FieldDescriptor field, + final int index, final Object value) { if (field.isExtension()) { verifyContainingType(field); ensureExtensionsIsMutable(); extensions.setRepeatedField(field, index, value); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } else { return super.setRepeatedField(field, index, value); } } @Override - public BuilderT addRepeatedField(final FieldDescriptor field, final Object value) { + public BuilderType addRepeatedField(final FieldDescriptor field, + final Object value) { if (field.isExtension()) { verifyContainingType(field); ensureExtensionsIsMutable(); extensions.addRepeatedField(field, value); onChanged(); - return (BuilderT) this; + return (BuilderType) this; } else { return super.addRepeatedField(field, value); } @@ -1954,7 +1875,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - protected final void mergeExtensionFields(final ExtendableMessage other) { + protected final void mergeExtensionFields(final ExtendableMessage other) { if (other.extensions != null) { ensureExtensionsIsMutable(); extensions.mergeFrom(other.extensions); @@ -1978,7 +1899,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri private void verifyContainingType(final FieldDescriptor field) { if (field.getContainingType() != getDescriptorForType()) { - throw new IllegalArgumentException("FieldDescriptor does not match message type."); + throw new IllegalArgumentException( + "FieldDescriptor does not match message type."); } } } @@ -1986,36 +1908,38 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri // ----------------------------------------------------------------- /** - * Gets the descriptor for an extension. The implementation depends on whether the extension is - * scoped in the top level of a file or scoped in a Message. + * Gets the descriptor for an extension. The implementation depends on whether + * the extension is scoped in the top level of a file or scoped in a Message. */ - interface ExtensionDescriptorRetriever { + static interface ExtensionDescriptorRetriever { FieldDescriptor getDescriptor(); } + // ================================================================= /** Calls Class.getMethod and throws a RuntimeException if it fails. */ + @SuppressWarnings("unchecked") private static Method getMethodOrDie( - final Class clazz, final String name, final Class... params) { + final Class clazz, final String name, final Class... params) { try { return clazz.getMethod(name, params); } catch (NoSuchMethodException e) { - throw new IllegalStateException( - "Generated message class \"" + clazz.getName() + "\" missing method \"" + name + "\".", - e); + throw new RuntimeException( + "Generated message class \"" + clazz.getName() + + "\" missing method \"" + name + "\".", e); } } /** Calls invoke and throws a RuntimeException if it fails. */ - @CanIgnoreReturnValue private static Object invokeOrDie( final Method method, final Object object, final Object... params) { try { return method.invoke(object, params); } catch (IllegalAccessException e) { - throw new IllegalStateException( - "Couldn't use Java reflection to implement protocol message reflection.", e); + throw new RuntimeException( + "Couldn't use Java reflection to implement protocol message " + + "reflection.", e); } catch (InvocationTargetException e) { final Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { @@ -2023,8 +1947,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } else if (cause instanceof Error) { throw (Error) cause; } else { - throw new IllegalStateException( - "Unexpected exception thrown by generated accessor method.", cause); + throw new RuntimeException( + "Unexpected exception thrown by generated accessor method.", cause); } } } @@ -2038,50 +1962,46 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri * generated API only allows us to access it as a map. This method returns the underlying map * field directly and thus enables us to access the map field as a list. */ - @SuppressWarnings("unused") - protected MapFieldReflectionAccessor internalGetMapFieldReflection(int fieldNumber) { - return internalGetMapField(fieldNumber); - } - - /** TODO: Remove, exists for compatibility with generated code. */ - @Deprecated @SuppressWarnings({"rawtypes", "unused"}) protected MapField internalGetMapField(int fieldNumber) { // Note that we can't use descriptor names here because this method will // be called when descriptor is being initialized. - throw new IllegalArgumentException("No map fields found in " + getClass().getName()); + throw new RuntimeException( + "No map fields found in " + getClass().getName()); } /** - * Users should ignore this class. This class provides the implementation with access to the - * fields of a message object using Java reflection. + * Users should ignore this class. This class provides the implementation + * with access to the fields of a message object using Java reflection. */ public static final class FieldAccessorTable { /** - * Construct a FieldAccessorTable for a particular message class. Only one FieldAccessorTable - * should ever be constructed per class. + * Construct a FieldAccessorTable for a particular message class. Only + * one FieldAccessorTable should ever be constructed per class. * - * @param descriptor The type's descriptor. - * @param camelCaseNames The camelcase names of all fields in the message. These are used to - * derive the accessor method names. - * @param messageClass The message type. - * @param builderClass The builder type. + * @param descriptor The type's descriptor. + * @param camelCaseNames The camelcase names of all fields in the message. + * These are used to derive the accessor method names. + * @param messageClass The message type. + * @param builderClass The builder type. */ public FieldAccessorTable( final Descriptor descriptor, final String[] camelCaseNames, final Class messageClass, - final Class> builderClass) { + final Class builderClass) { this(descriptor, camelCaseNames); ensureFieldAccessorsInitialized(messageClass, builderClass); } /** - * Construct a FieldAccessorTable for a particular message class without initializing - * FieldAccessors. + * Construct a FieldAccessorTable for a particular message class without + * initializing FieldAccessors. */ - public FieldAccessorTable(final Descriptor descriptor, final String[] camelCaseNames) { + public FieldAccessorTable( + final Descriptor descriptor, + final String[] camelCaseNames) { this.descriptor = descriptor; this.camelCaseNames = camelCaseNames; fields = new FieldAccessor[descriptor.getFields().size()]; @@ -2092,93 +2012,67 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** * Ensures the field accessors are initialized. This method is thread-safe. * - * @param messageClass The message type. - * @param builderClass The builder type. + * @param messageClass The message type. + * @param builderClass The builder type. * @return this */ public FieldAccessorTable ensureFieldAccessorsInitialized( - Class messageClass, Class> builderClass) { - if (initialized) { - return this; - } + Class messageClass, + Class builderClass) { + if (initialized) { return this; } synchronized (this) { - if (initialized) { - return this; - } + if (initialized) { return this; } int fieldsSize = fields.length; for (int i = 0; i < fieldsSize; i++) { FieldDescriptor field = descriptor.getFields().get(i); String containingOneofCamelCaseName = null; if (field.getContainingOneof() != null) { - int index = fieldsSize + field.getContainingOneof().getIndex(); - if (index < camelCaseNames.length) { - containingOneofCamelCaseName = camelCaseNames[index]; - } + containingOneofCamelCaseName = + camelCaseNames[fieldsSize + field.getContainingOneof().getIndex()]; } if (field.isRepeated()) { if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { if (field.isMapField()) { - fields[i] = new MapFieldAccessor(field, messageClass); + fields[i] = new MapFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } else { - fields[i] = - new RepeatedMessageFieldAccessor( - field, camelCaseNames[i], messageClass, builderClass); + fields[i] = new RepeatedMessageFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } } else if (field.getJavaType() == FieldDescriptor.JavaType.ENUM) { - fields[i] = - new RepeatedEnumFieldAccessor( - field, camelCaseNames[i], messageClass, builderClass); + fields[i] = new RepeatedEnumFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } else { - fields[i] = - new RepeatedFieldAccessor(field, camelCaseNames[i], messageClass, builderClass); + fields[i] = new RepeatedFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass); } } else { if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { - fields[i] = - new SingularMessageFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularMessageFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } else if (field.getJavaType() == FieldDescriptor.JavaType.ENUM) { - fields[i] = - new SingularEnumFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularEnumFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } else if (field.getJavaType() == FieldDescriptor.JavaType.STRING) { - fields[i] = - new SingularStringFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularStringFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } else { - fields[i] = - new SingularFieldAccessor( - field, - camelCaseNames[i], - messageClass, - builderClass, - containingOneofCamelCaseName); + fields[i] = new SingularFieldAccessor( + field, camelCaseNames[i], messageClass, builderClass, + containingOneofCamelCaseName); } } } - for (int i = 0; i < descriptor.getOneofs().size(); i++) { - if (i < descriptor.getRealOneofs().size()) { - oneofs[i] = - new RealOneofAccessor( - descriptor, i, camelCaseNames[i + fieldsSize], messageClass, builderClass); - } else { - oneofs[i] = new SyntheticOneofAccessor(descriptor, i); - } + int oneofsSize = oneofs.length; + for (int i = 0; i < oneofsSize; i++) { + oneofs[i] = + new OneofAccessor( + descriptor, i, camelCaseNames[i + fieldsSize], messageClass, builderClass); } - initialized = true; camelCaseNames = null; return this; @@ -2194,11 +2088,13 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** Get the FieldAccessor for a particular field. */ private FieldAccessor getField(final FieldDescriptor field) { if (field.getContainingType() != descriptor) { - throw new IllegalArgumentException("FieldDescriptor does not match message type."); + throw new IllegalArgumentException( + "FieldDescriptor does not match message type."); } else if (field.isExtension()) { // If this type had extensions, it would subclass ExtendableMessage, // which overrides the reflection interface to handle extensions. - throw new IllegalArgumentException("This type does not have extensions."); + throw new IllegalArgumentException( + "This type does not have extensions."); } return fields[field.getIndex()]; } @@ -2206,73 +2102,59 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** Get the OneofAccessor for a particular oneof. */ private OneofAccessor getOneof(final OneofDescriptor oneof) { if (oneof.getContainingType() != descriptor) { - throw new IllegalArgumentException("OneofDescriptor does not match message type."); + throw new IllegalArgumentException( + "OneofDescriptor does not match message type."); } return oneofs[oneof.getIndex()]; } /** - * Abstract interface that provides access to a single field. This is implemented differently - * depending on the field type and cardinality. + * Abstract interface that provides access to a single field. This is + * implemented differently depending on the field type and cardinality. */ private interface FieldAccessor { Object get(GeneratedMessageV3 message); - - Object get(GeneratedMessageV3.Builder builder); - + Object get(GeneratedMessageV3.Builder builder); Object getRaw(GeneratedMessageV3 message); - - void set(Builder builder, Object value); - + Object getRaw(GeneratedMessageV3.Builder builder); + void set(Builder builder, Object value); Object getRepeated(GeneratedMessageV3 message, int index); - - Object getRepeated(GeneratedMessageV3.Builder builder, int index); - - void setRepeated(Builder builder, int index, Object value); - - void addRepeated(Builder builder, Object value); - + Object getRepeated(GeneratedMessageV3.Builder builder, int index); + Object getRepeatedRaw(GeneratedMessageV3 message, int index); + Object getRepeatedRaw(GeneratedMessageV3.Builder builder, int index); + void setRepeated(Builder builder, + int index, Object value); + void addRepeated(Builder builder, Object value); boolean has(GeneratedMessageV3 message); - - boolean has(GeneratedMessageV3.Builder builder); - + boolean has(GeneratedMessageV3.Builder builder); int getRepeatedCount(GeneratedMessageV3 message); - - int getRepeatedCount(GeneratedMessageV3.Builder builder); - - void clear(Builder builder); - + int getRepeatedCount(GeneratedMessageV3.Builder builder); + void clear(Builder builder); Message.Builder newBuilder(); - - Message.Builder getBuilder(GeneratedMessageV3.Builder builder); - - Message.Builder getRepeatedBuilder(GeneratedMessageV3.Builder builder, int index); + Message.Builder getBuilder(GeneratedMessageV3.Builder builder); + Message.Builder getRepeatedBuilder(GeneratedMessageV3.Builder builder, + int index); } /** OneofAccessor provides access to a single oneof. */ - private static interface OneofAccessor { - public boolean has(final GeneratedMessageV3 message); - - public boolean has(GeneratedMessageV3.Builder builder); - - public FieldDescriptor get(final GeneratedMessageV3 message); - - public FieldDescriptor get(GeneratedMessageV3.Builder builder); - - public void clear(final Builder builder); - } - - /** RealOneofAccessor provides access to a single real oneof. */ - private static class RealOneofAccessor implements OneofAccessor { - RealOneofAccessor( + private static class OneofAccessor { + OneofAccessor( final Descriptor descriptor, final int oneofIndex, final String camelCaseName, final Class messageClass, - final Class> builderClass) { + final Class builderClass) { this.descriptor = descriptor; - caseMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Case"); - caseMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Case"); + OneofDescriptor oneofDescriptor = descriptor.getOneofs().get(oneofIndex); + if (oneofDescriptor.isSynthetic()) { + caseMethod = null; + caseMethodBuilder = null; + fieldDescriptor = oneofDescriptor.getFields().get(0); + } else { + caseMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Case"); + caseMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Case"); + fieldDescriptor = null; + } clearMethod = getMethodOrDie(builderClass, "clear" + camelCaseName); } @@ -2280,79 +2162,62 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri private final Method caseMethod; private final Method caseMethodBuilder; private final Method clearMethod; + private final FieldDescriptor fieldDescriptor; - @Override public boolean has(final GeneratedMessageV3 message) { - return ((Internal.EnumLite) invokeOrDie(caseMethod, message)).getNumber() != 0; + if (fieldDescriptor != null) { + return message.hasField(fieldDescriptor); + } else { + if (((Internal.EnumLite) invokeOrDie(caseMethod, message)).getNumber() == 0) { + return false; + } + } + return true; } - @Override - public boolean has(GeneratedMessageV3.Builder builder) { - return ((Internal.EnumLite) invokeOrDie(caseMethodBuilder, builder)).getNumber() != 0; + public boolean has(GeneratedMessageV3.Builder builder) { + if (fieldDescriptor != null) { + return builder.hasField(fieldDescriptor); + } else { + if (((Internal.EnumLite) invokeOrDie(caseMethodBuilder, builder)).getNumber() == 0) { + return false; + } + } + return true; } - @Override public FieldDescriptor get(final GeneratedMessageV3 message) { - int fieldNumber = ((Internal.EnumLite) invokeOrDie(caseMethod, message)).getNumber(); - if (fieldNumber > 0) { - return descriptor.findFieldByNumber(fieldNumber); + if (fieldDescriptor != null) { + return message.hasField(fieldDescriptor) ? fieldDescriptor : null; + } else { + int fieldNumber = ((Internal.EnumLite) invokeOrDie(caseMethod, message)).getNumber(); + if (fieldNumber > 0) { + return descriptor.findFieldByNumber(fieldNumber); + } } return null; } - @Override - public FieldDescriptor get(GeneratedMessageV3.Builder builder) { - int fieldNumber = ((Internal.EnumLite) invokeOrDie(caseMethodBuilder, builder)).getNumber(); - if (fieldNumber > 0) { - return descriptor.findFieldByNumber(fieldNumber); + public FieldDescriptor get(GeneratedMessageV3.Builder builder) { + if (fieldDescriptor != null) { + return builder.hasField(fieldDescriptor) ? fieldDescriptor : null; + } else { + int fieldNumber = + ((Internal.EnumLite) invokeOrDie(caseMethodBuilder, builder)).getNumber(); + if (fieldNumber > 0) { + return descriptor.findFieldByNumber(fieldNumber); + } } return null; } - @Override - public void clear(final Builder builder) { - // TODO: remove the unused variable - Object unused = invokeOrDie(clearMethod, builder); - } - } - - /** SyntheticOneofAccessor provides access to a single synthetic oneof. */ - private static class SyntheticOneofAccessor implements OneofAccessor { - SyntheticOneofAccessor(final Descriptor descriptor, final int oneofIndex) { - OneofDescriptor oneofDescriptor = descriptor.getOneofs().get(oneofIndex); - fieldDescriptor = oneofDescriptor.getFields().get(0); - } - - private final FieldDescriptor fieldDescriptor; - - @Override - public boolean has(final GeneratedMessageV3 message) { - return message.hasField(fieldDescriptor); - } - - @Override - public boolean has(GeneratedMessageV3.Builder builder) { - return builder.hasField(fieldDescriptor); - } - - @Override - public FieldDescriptor get(final GeneratedMessageV3 message) { - return message.hasField(fieldDescriptor) ? fieldDescriptor : null; - } - - public FieldDescriptor get(GeneratedMessageV3.Builder builder) { - return builder.hasField(fieldDescriptor) ? fieldDescriptor : null; - } - - @Override - public void clear(final Builder builder) { - builder.clearField(fieldDescriptor); + public void clear(final Builder builder) { + invokeOrDie(clearMethod, builder); } } // --------------------------------------------------------------- - @SuppressWarnings("SameNameButDifferent") private static class SingularFieldAccessor implements FieldAccessor { private interface MethodInvoker { Object get(final GeneratedMessageV3 message); @@ -2373,20 +2238,20 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } private static final class ReflectionInvoker implements MethodInvoker { - private final Method getMethod; - private final Method getMethodBuilder; - private final Method setMethod; - private final Method hasMethod; - private final Method hasMethodBuilder; - private final Method clearMethod; - private final Method caseMethod; - private final Method caseMethodBuilder; + protected final Method getMethod; + protected final Method getMethodBuilder; + protected final Method setMethod; + protected final Method hasMethod; + protected final Method hasMethodBuilder; + protected final Method clearMethod; + protected final Method caseMethod; + protected final Method caseMethodBuilder; ReflectionInvoker( final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass, + final Class builderClass, final String containingOneofCamelCaseName, boolean isOneofField, boolean hasHasMethod) { @@ -2430,8 +2295,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public void set(final GeneratedMessageV3.Builder builder, final Object value) { - // TODO: remove the unused variable - Object unused = invokeOrDie(setMethod, builder, value); + invokeOrDie(setMethod, builder, value); } @Override @@ -2446,8 +2310,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public void clear(final GeneratedMessageV3.Builder builder) { - // TODO: remove the unused variable - Object unused = invokeOrDie(clearMethod, builder); + invokeOrDie(clearMethod, builder); } } @@ -2455,13 +2318,13 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass, + final Class builderClass, final String containingOneofCamelCaseName) { isOneofField = - descriptor.getRealContainingOneof() != null; + descriptor.getContainingOneof() != null + && !descriptor.getContainingOneof().isSynthetic(); hasHasMethod = - descriptor.getFile().getSyntax() == FileDescriptor.Syntax.EDITIONS && descriptor.hasPresence() - || descriptor.getFile().getSyntax() == FileDescriptor.Syntax.PROTO2 + descriptor.getFile().getSyntax() == FileDescriptor.Syntax.PROTO2 || descriptor.hasOptionalKeyword() || (!isOneofField && descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE); ReflectionInvoker reflectionInvoker = @@ -2495,42 +2358,48 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri public Object get(final GeneratedMessageV3 message) { return invoker.get(message); } - @Override - public Object get(GeneratedMessageV3.Builder builder) { + public Object get(GeneratedMessageV3.Builder builder) { return invoker.get(builder); } - @Override public Object getRaw(final GeneratedMessageV3 message) { return get(message); } - @Override - public void set(final Builder builder, final Object value) { + public Object getRaw(GeneratedMessageV3.Builder builder) { + return get(builder); + } + @Override + public void set(final Builder builder, final Object value) { invoker.set(builder, value); } - @Override public Object getRepeated(final GeneratedMessageV3 message, final int index) { throw new UnsupportedOperationException("getRepeatedField() called on a singular field."); } - @Override - public Object getRepeated(GeneratedMessageV3.Builder builder, int index) { + public Object getRepeatedRaw(final GeneratedMessageV3 message, final int index) { + throw new UnsupportedOperationException( + "getRepeatedFieldRaw() called on a singular field."); + } + @Override + public Object getRepeated(GeneratedMessageV3.Builder builder, int index) { throw new UnsupportedOperationException("getRepeatedField() called on a singular field."); } - @Override - public void setRepeated(final Builder builder, final int index, final Object value) { + public Object getRepeatedRaw(GeneratedMessageV3.Builder builder, int index) { + throw new UnsupportedOperationException( + "getRepeatedFieldRaw() called on a singular field."); + } + @Override + public void setRepeated(final Builder builder, final int index, final Object value) { throw new UnsupportedOperationException("setRepeatedField() called on a singular field."); } - @Override - public void addRepeated(final Builder builder, final Object value) { + public void addRepeated(final Builder builder, final Object value) { throw new UnsupportedOperationException("addRepeatedField() called on a singular field."); } - @Override public boolean has(final GeneratedMessageV3 message) { if (!hasHasMethod) { @@ -2541,9 +2410,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } return invoker.has(message); } - @Override - public boolean has(GeneratedMessageV3.Builder builder) { + public boolean has(GeneratedMessageV3.Builder builder) { if (!hasHasMethod) { if (isOneofField) { return invoker.getOneofFieldNumber(builder) == field.getNumber(); @@ -2552,48 +2420,41 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } return invoker.has(builder); } - @Override public int getRepeatedCount(final GeneratedMessageV3 message) { throw new UnsupportedOperationException( "getRepeatedFieldSize() called on a singular field."); } - @Override - public int getRepeatedCount(GeneratedMessageV3.Builder builder) { + public int getRepeatedCount(GeneratedMessageV3.Builder builder) { throw new UnsupportedOperationException( "getRepeatedFieldSize() called on a singular field."); } - @Override - public void clear(final Builder builder) { + public void clear(final Builder builder) { invoker.clear(builder); } - @Override public Message.Builder newBuilder() { throw new UnsupportedOperationException( "newBuilderForField() called on a non-Message type."); } - @Override - public Message.Builder getBuilder(GeneratedMessageV3.Builder builder) { + public Message.Builder getBuilder(GeneratedMessageV3.Builder builder) { throw new UnsupportedOperationException("getFieldBuilder() called on a non-Message type."); } - @Override - public Message.Builder getRepeatedBuilder(GeneratedMessageV3.Builder builder, int index) { + public Message.Builder getRepeatedBuilder(GeneratedMessageV3.Builder builder, int index) { throw new UnsupportedOperationException( "getRepeatedFieldBuilder() called on a non-Message type."); } } - @SuppressWarnings("SameNameButDifferent") private static class RepeatedFieldAccessor implements FieldAccessor { interface MethodInvoker { - Object get(final GeneratedMessageV3 message); + public Object get(final GeneratedMessageV3 message); - Object get(GeneratedMessageV3.Builder builder); + public Object get(GeneratedMessageV3.Builder builder); Object getRepeated(final GeneratedMessageV3 message, final int index); @@ -2612,21 +2473,21 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } private static final class ReflectionInvoker implements MethodInvoker { - private final Method getMethod; - private final Method getMethodBuilder; - private final Method getRepeatedMethod; - private final Method getRepeatedMethodBuilder; - private final Method setRepeatedMethod; - private final Method addRepeatedMethod; - private final Method getCountMethod; - private final Method getCountMethodBuilder; - private final Method clearMethod; + protected final Method getMethod; + protected final Method getMethodBuilder; + protected final Method getRepeatedMethod; + protected final Method getRepeatedMethodBuilder; + protected final Method setRepeatedMethod; + protected final Method addRepeatedMethod; + protected final Method getCountMethod; + protected final Method getCountMethodBuilder; + protected final Method clearMethod; ReflectionInvoker( final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass) { + final Class builderClass) { getMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "List"); getMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "List"); getRepeatedMethod = getMethodOrDie(messageClass, "get" + camelCaseName, Integer.TYPE); @@ -2652,7 +2513,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object getRepeated(final GeneratedMessageV3 message, final int index) { + public Object getRepeated( + final GeneratedMessageV3 message, final int index) { return invokeOrDie(getRepeatedMethod, message, index); } @@ -2664,14 +2526,13 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public void setRepeated( final GeneratedMessageV3.Builder builder, final int index, final Object value) { - // TODO: remove the unused variable - Object unused = invokeOrDie(setRepeatedMethod, builder, index, value); + invokeOrDie(setRepeatedMethod, builder, index, value); } @Override - public void addRepeated(final GeneratedMessageV3.Builder builder, final Object value) { - // TODO: remove the unused variable - Object unused = invokeOrDie(addRepeatedMethod, builder, value); + public void addRepeated( + final GeneratedMessageV3.Builder builder, final Object value) { + invokeOrDie(addRepeatedMethod, builder, value); } @Override @@ -2686,19 +2547,17 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri @Override public void clear(final GeneratedMessageV3.Builder builder) { - // TODO: remove the unused variable - Object unused = invokeOrDie(clearMethod, builder); + invokeOrDie(clearMethod, builder); } } - protected final Class type; + protected final Class type; protected final MethodInvoker invoker; RepeatedFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass) { + final Class builderClass) { ReflectionInvoker reflectionInvoker = new ReflectionInvoker(descriptor, camelCaseName, messageClass, builderClass); type = reflectionInvoker.getRepeatedMethod.getReturnType(); @@ -2713,19 +2572,20 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri public Object get(final GeneratedMessageV3 message) { return invoker.get(message); } - @Override - public Object get(GeneratedMessageV3.Builder builder) { + public Object get(GeneratedMessageV3.Builder builder) { return invoker.get(builder); } - @Override public Object getRaw(final GeneratedMessageV3 message) { return get(message); } - @Override - public void set(final Builder builder, final Object value) { + public Object getRaw(GeneratedMessageV3.Builder builder) { + return get(builder); + } + @Override + public void set(final Builder builder, final Object value) { // Add all the elements individually. This serves two purposes: // 1) Verifies that each element has the correct type. // 2) Insures that the caller cannot modify the list later on and @@ -2735,65 +2595,61 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri addRepeated(builder, element); } } - @Override public Object getRepeated(final GeneratedMessageV3 message, final int index) { return invoker.getRepeated(message, index); } - @Override - public Object getRepeated(GeneratedMessageV3.Builder builder, int index) { + public Object getRepeated(GeneratedMessageV3.Builder builder, int index) { return invoker.getRepeated(builder, index); } - @Override - public void setRepeated(final Builder builder, final int index, final Object value) { + public Object getRepeatedRaw(GeneratedMessageV3 message, int index) { + return getRepeated(message, index); + } + @Override + public Object getRepeatedRaw(GeneratedMessageV3.Builder builder, int index) { + return getRepeated(builder, index); + } + @Override + public void setRepeated(final Builder builder, final int index, final Object value) { invoker.setRepeated(builder, index, value); } - @Override - public void addRepeated(final Builder builder, final Object value) { + public void addRepeated(final Builder builder, final Object value) { invoker.addRepeated(builder, value); } - @Override public boolean has(final GeneratedMessageV3 message) { throw new UnsupportedOperationException("hasField() called on a repeated field."); } - @Override - public boolean has(GeneratedMessageV3.Builder builder) { + public boolean has(GeneratedMessageV3.Builder builder) { throw new UnsupportedOperationException("hasField() called on a repeated field."); } - @Override public int getRepeatedCount(final GeneratedMessageV3 message) { return invoker.getRepeatedCount(message); } - @Override - public int getRepeatedCount(GeneratedMessageV3.Builder builder) { + public int getRepeatedCount(GeneratedMessageV3.Builder builder) { return invoker.getRepeatedCount(builder); } - @Override - public void clear(final Builder builder) { + public void clear(final Builder builder) { invoker.clear(builder); } - @Override public Message.Builder newBuilder() { throw new UnsupportedOperationException( "newBuilderForField() called on a non-Message type."); } - @Override - public Message.Builder getBuilder(GeneratedMessageV3.Builder builder) { + public Message.Builder getBuilder(GeneratedMessageV3.Builder builder) { throw new UnsupportedOperationException("getFieldBuilder() called on a non-Message type."); } - @Override - public Message.Builder getRepeatedBuilder(GeneratedMessageV3.Builder builder, int index) { + public Message.Builder getRepeatedBuilder(GeneratedMessageV3.Builder builder, int index) { throw new UnsupportedOperationException( "getRepeatedFieldBuilder() called on a non-Message type."); } @@ -2801,27 +2657,33 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri private static class MapFieldAccessor implements FieldAccessor { MapFieldAccessor( - final FieldDescriptor descriptor, final Class messageClass) { + final FieldDescriptor descriptor, final String camelCaseName, + final Class messageClass, + final Class builderClass) { field = descriptor; - Method getDefaultInstanceMethod = getMethodOrDie(messageClass, "getDefaultInstance"); - MapFieldReflectionAccessor defaultMapField = - getMapField((GeneratedMessageV3) invokeOrDie(getDefaultInstanceMethod, null)); - mapEntryMessageDefaultInstance = defaultMapField.getMapEntryMessageDefaultInstance(); + Method getDefaultInstanceMethod = + getMethodOrDie(messageClass, "getDefaultInstance"); + MapField defaultMapField = getMapField( + (GeneratedMessageV3) invokeOrDie(getDefaultInstanceMethod, null)); + mapEntryMessageDefaultInstance = + defaultMapField.getMapEntryMessageDefaultInstance(); } private final FieldDescriptor field; private final Message mapEntryMessageDefaultInstance; - private MapFieldReflectionAccessor getMapField(GeneratedMessageV3 message) { - return message.internalGetMapFieldReflection(field.getNumber()); + private MapField getMapField(GeneratedMessageV3 message) { + return (MapField) message.internalGetMapField(field.getNumber()); } - private MapFieldReflectionAccessor getMapField(GeneratedMessageV3.Builder builder) { - return builder.internalGetMapFieldReflection(field.getNumber()); + private MapField getMapField(GeneratedMessageV3.Builder builder) { + return (MapField) builder.internalGetMapField(field.getNumber()); } - private MapFieldReflectionAccessor getMutableMapField(GeneratedMessageV3.Builder builder) { - return builder.internalGetMutableMapFieldReflection(field.getNumber()); + private MapField getMutableMapField( + GeneratedMessageV3.Builder builder) { + return (MapField) builder.internalGetMutableMapField( + field.getNumber()); } private Message coerceType(Message value) { @@ -2839,8 +2701,9 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override + @SuppressWarnings("unchecked") public Object get(GeneratedMessageV3 message) { - List result = new ArrayList<>(); + List result = new ArrayList<>(); for (int i = 0; i < getRepeatedCount(message); i++) { result.add(getRepeated(message, i)); } @@ -2848,8 +2711,9 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object get(Builder builder) { - List result = new ArrayList<>(); + @SuppressWarnings("unchecked") + public Object get(Builder builder) { + List result = new ArrayList<>(); for (int i = 0; i < getRepeatedCount(builder); i++) { result.add(getRepeated(builder, i)); } @@ -2862,9 +2726,14 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public void set(Builder builder, Object value) { + public Object getRaw(GeneratedMessageV3.Builder builder) { + return get(builder); + } + + @Override + public void set(Builder builder, Object value) { clear(builder); - for (Object entry : (List) value) { + for (Object entry : (List) value) { addRepeated(builder, entry); } } @@ -2875,28 +2744,40 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object getRepeated(Builder builder, int index) { + public Object getRepeated(Builder builder, int index) { return getMapField(builder).getList().get(index); } @Override - public void setRepeated(Builder builder, int index, Object value) { + public Object getRepeatedRaw(GeneratedMessageV3 message, int index) { + return getRepeated(message, index); + } + + @Override + public Object getRepeatedRaw(Builder builder, int index) { + return getRepeated(builder, index); + } + + @Override + public void setRepeated(Builder builder, int index, Object value) { getMutableMapField(builder).getMutableList().set(index, coerceType((Message) value)); } @Override - public void addRepeated(Builder builder, Object value) { + public void addRepeated(Builder builder, Object value) { getMutableMapField(builder).getMutableList().add(coerceType((Message) value)); } @Override public boolean has(GeneratedMessageV3 message) { - throw new UnsupportedOperationException("hasField() is not supported for repeated fields."); + throw new UnsupportedOperationException( + "hasField() is not supported for repeated fields."); } @Override - public boolean has(Builder builder) { - throw new UnsupportedOperationException("hasField() is not supported for repeated fields."); + public boolean has(Builder builder) { + throw new UnsupportedOperationException( + "hasField() is not supported for repeated fields."); } @Override @@ -2905,39 +2786,41 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public int getRepeatedCount(Builder builder) { + public int getRepeatedCount(Builder builder) { return getMapField(builder).getList().size(); } @Override - public void clear(Builder builder) { + public void clear(Builder builder) { getMutableMapField(builder).getMutableList().clear(); } @Override - public Message.Builder newBuilder() { + public com.google.protobuf.Message.Builder newBuilder() { return mapEntryMessageDefaultInstance.newBuilderForType(); } @Override - public Message.Builder getBuilder(Builder builder) { - throw new UnsupportedOperationException("Nested builder not supported for map fields."); + public com.google.protobuf.Message.Builder getBuilder(Builder builder) { + throw new UnsupportedOperationException( + "Nested builder not supported for map fields."); } @Override - public Message.Builder getRepeatedBuilder(Builder builder, int index) { - throw new UnsupportedOperationException("Map fields cannot be repeated"); + public com.google.protobuf.Message.Builder getRepeatedBuilder(Builder builder, int index) { + throw new UnsupportedOperationException( + "Nested builder not supported for map fields."); } } // --------------------------------------------------------------- - private static final class SingularEnumFieldAccessor extends SingularFieldAccessor { + private static final class SingularEnumFieldAccessor + extends SingularFieldAccessor { SingularEnumFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass, + final Class builderClass, final String containingOneofCamelCaseName) { super(descriptor, camelCaseName, messageClass, builderClass, containingOneofCamelCaseName); @@ -2946,20 +2829,23 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri valueOfMethod = getMethodOrDie(type, "valueOf", EnumValueDescriptor.class); getValueDescriptorMethod = getMethodOrDie(type, "getValueDescriptor"); - supportUnknownEnumValue = !descriptor.legacyEnumFieldTreatedAsClosed(); + supportUnknownEnumValue = descriptor.getFile().supportsUnknownEnumValue(); if (supportUnknownEnumValue) { - getValueMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Value"); - getValueMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Value"); - setValueMethod = getMethodOrDie(builderClass, "set" + camelCaseName + "Value", int.class); + getValueMethod = + getMethodOrDie(messageClass, "get" + camelCaseName + "Value"); + getValueMethodBuilder = + getMethodOrDie(builderClass, "get" + camelCaseName + "Value"); + setValueMethod = + getMethodOrDie(builderClass, "set" + camelCaseName + "Value", int.class); } } - private final EnumDescriptor enumDescriptor; + private EnumDescriptor enumDescriptor; - private final Method valueOfMethod; - private final Method getValueDescriptorMethod; + private Method valueOfMethod; + private Method getValueDescriptorMethod; - private final boolean supportUnknownEnumValue; + private boolean supportUnknownEnumValue; private Method getValueMethod; private Method getValueMethodBuilder; private Method setValueMethod; @@ -2974,7 +2860,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object get(final GeneratedMessageV3.Builder builder) { + public Object get(final GeneratedMessageV3.Builder builder) { if (supportUnknownEnumValue) { int value = (Integer) invokeOrDie(getValueMethodBuilder, builder); return enumDescriptor.findValueByNumberCreatingIfUnknown(value); @@ -2983,23 +2869,22 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public void set(final Builder builder, final Object value) { + public void set(final Builder builder, final Object value) { if (supportUnknownEnumValue) { - // TODO: remove the unused variable - Object unused = - invokeOrDie(setValueMethod, builder, ((EnumValueDescriptor) value).getNumber()); + invokeOrDie(setValueMethod, builder, + ((EnumValueDescriptor) value).getNumber()); return; } super.set(builder, invokeOrDie(valueOfMethod, null, value)); } } - private static final class RepeatedEnumFieldAccessor extends RepeatedFieldAccessor { + private static final class RepeatedEnumFieldAccessor + extends RepeatedFieldAccessor { RepeatedEnumFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass) { + final Class builderClass) { super(descriptor, camelCaseName, messageClass, builderClass); enumDescriptor = descriptor.getEnumType(); @@ -3007,7 +2892,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri valueOfMethod = getMethodOrDie(type, "valueOf", EnumValueDescriptor.class); getValueDescriptorMethod = getMethodOrDie(type, "getValueDescriptor"); - supportUnknownEnumValue = !descriptor.legacyEnumFieldTreatedAsClosed(); + supportUnknownEnumValue = descriptor.getFile().supportsUnknownEnumValue(); if (supportUnknownEnumValue) { getRepeatedValueMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Value", int.class); @@ -3019,22 +2904,21 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri getMethodOrDie(builderClass, "add" + camelCaseName + "Value", int.class); } } - - private final EnumDescriptor enumDescriptor; + private EnumDescriptor enumDescriptor; private final Method valueOfMethod; private final Method getValueDescriptorMethod; - private final boolean supportUnknownEnumValue; - + private boolean supportUnknownEnumValue; private Method getRepeatedValueMethod; private Method getRepeatedValueMethodBuilder; private Method setRepeatedValueMethod; private Method addRepeatedValueMethod; @Override + @SuppressWarnings("unchecked") public Object get(final GeneratedMessageV3 message) { - final List newList = new ArrayList<>(); + final List newList = new ArrayList<>(); final int size = getRepeatedCount(message); for (int i = 0; i < size; i++) { newList.add(getRepeated(message, i)); @@ -3043,8 +2927,9 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object get(final GeneratedMessageV3.Builder builder) { - final List newList = new ArrayList<>(); + @SuppressWarnings("unchecked") + public Object get(final GeneratedMessageV3.Builder builder) { + final List newList = new ArrayList<>(); final int size = getRepeatedCount(builder); for (int i = 0; i < size; i++) { newList.add(getRepeated(builder, i)); @@ -3062,7 +2947,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public Object getRepeated(final GeneratedMessageV3.Builder builder, final int index) { + public Object getRepeated(final GeneratedMessageV3.Builder builder, final int index) { if (supportUnknownEnumValue) { int value = (Integer) invokeOrDie(getRepeatedValueMethodBuilder, builder, index); return enumDescriptor.findValueByNumberCreatingIfUnknown(value); @@ -3071,27 +2956,19 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public void setRepeated(final Builder builder, final int index, final Object value) { + public void setRepeated(final Builder builder, final int index, final Object value) { if (supportUnknownEnumValue) { - // TODO: remove the unused variable - Object unused = - invokeOrDie( - setRepeatedValueMethod, - builder, - index, - ((EnumValueDescriptor) value).getNumber()); + invokeOrDie(setRepeatedValueMethod, builder, index, + ((EnumValueDescriptor) value).getNumber()); return; } super.setRepeated(builder, index, invokeOrDie(valueOfMethod, null, value)); } - @Override - public void addRepeated(final Builder builder, final Object value) { + public void addRepeated(final Builder builder, final Object value) { if (supportUnknownEnumValue) { - // TODO: remove the unused variable - Object unused = - invokeOrDie( - addRepeatedValueMethod, builder, ((EnumValueDescriptor) value).getNumber()); + invokeOrDie(addRepeatedValueMethod, builder, + ((EnumValueDescriptor) value).getNumber()); return; } super.addRepeated(builder, invokeOrDie(valueOfMethod, null, value)); @@ -3103,27 +2980,33 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** * Field accessor for string fields. * - *

This class makes getFooBytes() and setFooBytes() available for reflection API so that - * reflection based serialize/parse functions can access the raw bytes of the field to preserve - * non-UTF8 bytes in the string. + *

This class makes getFooBytes() and setFooBytes() available for + * reflection API so that reflection based serialize/parse functions can + * access the raw bytes of the field to preserve non-UTF8 bytes in the + * string. * - *

This ensures the serialize/parse round-trip safety, which is important for servers which - * forward messages. + *

This ensures the serialize/parse round-trip safety, which is important + * for servers which forward messages. */ - private static final class SingularStringFieldAccessor extends SingularFieldAccessor { + private static final class SingularStringFieldAccessor + extends SingularFieldAccessor { SingularStringFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass, + final Class builderClass, final String containingOneofCamelCaseName) { - super(descriptor, camelCaseName, messageClass, builderClass, containingOneofCamelCaseName); - getBytesMethod = getMethodOrDie(messageClass, "get" + camelCaseName + "Bytes"); - setBytesMethodBuilder = - getMethodOrDie(builderClass, "set" + camelCaseName + "Bytes", ByteString.class); + super(descriptor, camelCaseName, messageClass, builderClass, + containingOneofCamelCaseName); + getBytesMethod = getMethodOrDie(messageClass, + "get" + camelCaseName + "Bytes"); + getBytesMethodBuilder = getMethodOrDie(builderClass, + "get" + camelCaseName + "Bytes"); + setBytesMethodBuilder = getMethodOrDie(builderClass, + "set" + camelCaseName + "Bytes", ByteString.class); } private final Method getBytesMethod; + private final Method getBytesMethodBuilder; private final Method setBytesMethodBuilder; @Override @@ -3132,10 +3015,14 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public void set(GeneratedMessageV3.Builder builder, Object value) { + public Object getRaw(GeneratedMessageV3.Builder builder) { + return invokeOrDie(getBytesMethodBuilder, builder); + } + + @Override + public void set(GeneratedMessageV3.Builder builder, Object value) { if (value instanceof ByteString) { - // TODO: remove the unused variable - Object unused = invokeOrDie(setBytesMethodBuilder, builder, value); + invokeOrDie(setBytesMethodBuilder, builder, value); } else { super.set(builder, value); } @@ -3144,17 +3031,19 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri // --------------------------------------------------------------- - private static final class SingularMessageFieldAccessor extends SingularFieldAccessor { + private static final class SingularMessageFieldAccessor + extends SingularFieldAccessor { SingularMessageFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass, + final Class builderClass, final String containingOneofCamelCaseName) { - super(descriptor, camelCaseName, messageClass, builderClass, containingOneofCamelCaseName); + super(descriptor, camelCaseName, messageClass, builderClass, + containingOneofCamelCaseName); newBuilderMethod = getMethodOrDie(type, "newBuilder"); - getBuilderMethodBuilder = getMethodOrDie(builderClass, "get" + camelCaseName + "Builder"); + getBuilderMethodBuilder = + getMethodOrDie(builderClass, "get" + camelCaseName + "Builder"); } private final Method newBuilderMethod; @@ -3175,32 +3064,30 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public void set(final Builder builder, final Object value) { + public void set(final Builder builder, final Object value) { super.set(builder, coerceType(value)); } - @Override public Message.Builder newBuilder() { return (Message.Builder) invokeOrDie(newBuilderMethod, null); } - @Override - public Message.Builder getBuilder(GeneratedMessageV3.Builder builder) { + public Message.Builder getBuilder(GeneratedMessageV3.Builder builder) { return (Message.Builder) invokeOrDie(getBuilderMethodBuilder, builder); } } - private static final class RepeatedMessageFieldAccessor extends RepeatedFieldAccessor { + private static final class RepeatedMessageFieldAccessor + extends RepeatedFieldAccessor { RepeatedMessageFieldAccessor( - final FieldDescriptor descriptor, - final String camelCaseName, + final FieldDescriptor descriptor, final String camelCaseName, final Class messageClass, - final Class> builderClass) { + final Class builderClass) { super(descriptor, camelCaseName, messageClass, builderClass); newBuilderMethod = getMethodOrDie(type, "newBuilder"); - getBuilderMethodBuilder = - getMethodOrDie(builderClass, "get" + camelCaseName + "Builder", Integer.TYPE); + getBuilderMethodBuilder = getMethodOrDie(builderClass, + "get" + camelCaseName + "Builder", Integer.TYPE); } private final Method newBuilderMethod; @@ -3221,33 +3108,30 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } @Override - public void setRepeated(final Builder builder, final int index, final Object value) { + public void setRepeated(final Builder builder, final int index, final Object value) { super.setRepeated(builder, index, coerceType(value)); } - @Override - public void addRepeated(final Builder builder, final Object value) { + public void addRepeated(final Builder builder, final Object value) { super.addRepeated(builder, coerceType(value)); } - @Override public Message.Builder newBuilder() { return (Message.Builder) invokeOrDie(newBuilderMethod, null); } - @Override public Message.Builder getRepeatedBuilder( - final GeneratedMessageV3.Builder builder, final int index) { - return (Message.Builder) invokeOrDie(getBuilderMethodBuilder, builder, index); + final GeneratedMessageV3.Builder builder, final int index) { + return (Message.Builder) invokeOrDie( + getBuilderMethodBuilder, builder, index); } } } /** - * Replaces this object in the output stream with a serialized form. Part of Java's serialization - * magic. Generated sub-classes must override this method by calling {@code return - * super.writeReplace();} - * + * Replaces this object in the output stream with a serialized form. + * Part of Java's serialization magic. Generated sub-classes must override + * this method by calling {@code return super.writeReplace();} * @return a SerializedForm of this message */ protected Object writeReplace() throws ObjectStreamException { @@ -3257,21 +3141,13 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri /** * Checks that the {@link Extension} is non-Lite and returns it as a {@link GeneratedExtension}. */ - private static , T> - Extension checkNotLite(ExtensionLite extension) { + private static , T> + Extension checkNotLite(ExtensionLite extension) { if (extension.isLite()) { throw new IllegalArgumentException("Expected non-lite extension."); } - return (Extension) extension; - } - - protected static boolean isStringEmpty(final Object value) { - if (value instanceof String) { - return ((String) value).isEmpty(); - } else { - return ((ByteString) value).isEmpty(); - } + return (Extension) extension; } protected static int computeStringSize(final int fieldNumber, final Object value) { @@ -3299,8 +3175,8 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } } - protected static void writeStringNoTag(CodedOutputStream output, final Object value) - throws IOException { + protected static void writeStringNoTag( + CodedOutputStream output, final Object value) throws IOException { if (value instanceof String) { output.writeStringNoTag((String) value); } else { @@ -3312,8 +3188,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri CodedOutputStream out, MapField field, MapEntry defaultEntry, - int fieldNumber) - throws IOException { + int fieldNumber) throws IOException { Map m = field.getMap(); if (!out.isSerializationDeterministic()) { serializeMapTo(out, m, defaultEntry, fieldNumber); @@ -3328,8 +3203,11 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } Arrays.sort(keys); for (int key : keys) { - out.writeMessage( - fieldNumber, defaultEntry.newBuilderForType().setKey(key).setValue(m.get(key)).build()); + out.writeMessage(fieldNumber, + defaultEntry.newBuilderForType() + .setKey(key) + .setValue(m.get(key)) + .build()); } } @@ -3352,8 +3230,11 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri } Arrays.sort(keys); for (long key : keys) { - out.writeMessage( - fieldNumber, defaultEntry.newBuilderForType().setKey(key).setValue(m.get(key)).build()); + out.writeMessage(fieldNumber, + defaultEntry.newBuilderForType() + .setKey(key) + .setValue(m.get(key)) + .build()); } } @@ -3375,8 +3256,11 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri keys = m.keySet().toArray(keys); Arrays.sort(keys); for (String key : keys) { - out.writeMessage( - fieldNumber, defaultEntry.newBuilderForType().setKey(key).setValue(m.get(key)).build()); + out.writeMessage(fieldNumber, + defaultEntry.newBuilderForType() + .setKey(key) + .setValue(m.get(key)) + .build()); } } @@ -3403,23 +3287,28 @@ public abstract class GeneratedMessageV3 extends AbstractMessage implements Seri boolean key) throws IOException { if (m.containsKey(key)) { - out.writeMessage( - fieldNumber, defaultEntry.newBuilderForType().setKey(key).setValue(m.get(key)).build()); + out.writeMessage(fieldNumber, + defaultEntry.newBuilderForType() + .setKey(key) + .setValue(m.get(key)) + .build()); } } /** Serialize the map using the iteration order. */ private static void serializeMapTo( - CodedOutputStream out, Map m, MapEntry defaultEntry, int fieldNumber) + CodedOutputStream out, + Map m, + MapEntry defaultEntry, + int fieldNumber) throws IOException { for (Map.Entry entry : m.entrySet()) { - out.writeMessage( - fieldNumber, - defaultEntry - .newBuilderForType() + out.writeMessage(fieldNumber, + defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build()); } } } + diff --git a/java/core/src/main/java/com/google/protobuf/InlineMe.java b/java/core/src/main/java/com/google/protobuf/InlineMe.java deleted file mode 100644 index 12894d75ce861025eedea3d01c8b9406ac6f6304..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/InlineMe.java +++ /dev/null @@ -1,36 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import static java.lang.annotation.ElementType.CONSTRUCTOR; -import static java.lang.annotation.ElementType.METHOD; - -import java.lang.annotation.Documented; -import java.lang.annotation.Target; - -/** - * Indicates that callers of this API should be inlined. That is, this API is trivially expressible - * in terms of another API, for example a method that just calls another method. - */ -@Documented -@Target({METHOD, CONSTRUCTOR}) -@interface InlineMe { - /** - * What the caller should be replaced with. Local parameter names can be used in the replacement - * string. If you are invoking an instance method or constructor, you must include the implicit - * {@code this} in the replacement body. If you are invoking a static method, you must include the - * implicit {@code ClassName} in the replacement body. - */ - String replacement(); - - /** The new imports to (optionally) add to the caller. */ - String[] imports() default {}; - - /** The new static imports to (optionally) add to the caller. */ - String[] staticImports() default {}; -} diff --git a/java/core/src/main/java/com/google/protobuf/IntArrayList.java b/java/core/src/main/java/com/google/protobuf/IntArrayList.java index eea507ae8fdee1448651438faccfc60319492372..9daeebed99236ec652fb65368a00d5561566e13d 100644 --- a/java/core/src/main/java/com/google/protobuf/IntArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/IntArrayList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -22,7 +45,10 @@ import java.util.RandomAccess; final class IntArrayList extends AbstractProtobufList implements IntList, RandomAccess, PrimitiveNonBoxingCollection { - private static final IntArrayList EMPTY_LIST = new IntArrayList(new int[0], 0, false); + private static final IntArrayList EMPTY_LIST = new IntArrayList(new int[0], 0); + static { + EMPTY_LIST.makeImmutable(); + } public static IntArrayList emptyList() { return EMPTY_LIST; @@ -39,14 +65,13 @@ final class IntArrayList extends AbstractProtobufList /** Constructs a new mutable {@code IntArrayList} with default capacity. */ IntArrayList() { - this(new int[DEFAULT_CAPACITY], 0, true); + this(new int[DEFAULT_CAPACITY], 0); } /** * Constructs a new mutable {@code IntArrayList} containing the same elements as {@code other}. */ - private IntArrayList(int[] other, int size, boolean isMutable) { - super(isMutable); + private IntArrayList(int[] other, int size) { array = other; this.size = size; } @@ -100,7 +125,7 @@ final class IntArrayList extends AbstractProtobufList if (capacity < size) { throw new IllegalArgumentException(); } - return new IntArrayList(Arrays.copyOf(array, capacity), size, true); + return new IntArrayList(Arrays.copyOf(array, capacity), size); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/Internal.java b/java/core/src/main/java/com/google/protobuf/Internal.java index 3024aa9dfb3943432f3292455e62764a2ddb939d..90643b8abb999bc6c4a505c2c77e0abbb8119de8 100644 --- a/java/core/src/main/java/com/google/protobuf/Internal.java +++ b/java/core/src/main/java/com/google/protobuf/Internal.java @@ -1,14 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import java.lang.reflect.Method; -import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.AbstractList; @@ -32,7 +54,6 @@ public final class Internal { private Internal() {} - static final Charset US_ASCII = Charset.forName("US-ASCII"); static final Charset UTF_8 = Charset.forName("UTF-8"); static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1"); @@ -117,12 +138,10 @@ public final class Internal { ByteBuffer temp = source.duplicate(); // We want to copy all the data in the source ByteBuffer, not just the // remaining bytes. - // View ByteBuffer as Buffer to avoid issue with covariant return types - // See https://issues.apache.org/jira/browse/MRESOLVER-85 - ((Buffer) temp).clear(); + temp.clear(); ByteBuffer result = ByteBuffer.allocate(temp.capacity()); result.put(temp); - ((Buffer) result).clear(); + result.clear(); return result; } @@ -236,9 +255,7 @@ public final class Internal { /** Helper method for implementing {@link Message#equals(Object)} for bytes field. */ public static boolean equals(List a, List b) { - if (a.size() != b.size()) { - return false; - } + if (a.size() != b.size()) return false; for (int i = 0; i < a.size(); ++i) { if (!Arrays.equals(a.get(i), b.get(i))) { return false; @@ -290,11 +307,7 @@ public final class Internal { } // ByteBuffer.equals() will only compare the remaining bytes, but we want to // compare all the content. - ByteBuffer aDuplicate = a.duplicate(); - Java8Compatibility.clear(aDuplicate); - ByteBuffer bDuplicate = b.duplicate(); - Java8Compatibility.clear(bDuplicate); - return aDuplicate.equals(bDuplicate); + return a.duplicate().clear().equals(b.duplicate().clear()); } /** Helper method for implementing {@link Message#equals(Object)} for bytes field. */ @@ -334,7 +347,7 @@ public final class Internal { bytes.capacity() > DEFAULT_BUFFER_SIZE ? DEFAULT_BUFFER_SIZE : bytes.capacity(); final byte[] buffer = new byte[bufferSize]; final ByteBuffer duplicated = bytes.duplicate(); - Java8Compatibility.clear(duplicated); + duplicated.clear(); int h = bytes.capacity(); while (duplicated.remaining() > 0) { final int length = @@ -356,6 +369,7 @@ public final class Internal { } } + /** An empty byte array constant used in generated code. */ public static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; @@ -366,6 +380,7 @@ public final class Internal { public static final CodedInputStream EMPTY_CODED_INPUT_STREAM = CodedInputStream.newInstance(EMPTY_BYTE_ARRAY); + /** Helper method to merge two MessageLite instances. */ static Object mergeMessage(Object destination, Object source) { return ((MessageLite) destination).toBuilder().mergeFrom((MessageLite) source).buildPartial(); @@ -434,6 +449,7 @@ public final class Internal { this.valueConverter = valueConverter; } + @SuppressWarnings("unchecked") @Override public V get(Object key) { RealValue result = realMap.get(key); @@ -532,6 +548,7 @@ public final class Internal { if (!(o instanceof Map.Entry)) { return false; } + @SuppressWarnings("unchecked") Map.Entry other = (Map.Entry) o; return getKey().equals(other.getKey()) && getValue().equals(getValue()); } @@ -579,7 +596,6 @@ public final class Internal { void addInt(int element); /** Like {@link #set(int, Object)} but more efficient in that it doesn't box the element. */ - @CanIgnoreReturnValue int setInt(int index, int element); /** Returns a mutable clone of this list with the specified capacity. */ @@ -600,7 +616,6 @@ public final class Internal { void addBoolean(boolean element); /** Like {@link #set(int, Object)} but more efficient in that it doesn't box the element. */ - @CanIgnoreReturnValue boolean setBoolean(int index, boolean element); /** Returns a mutable clone of this list with the specified capacity. */ @@ -621,7 +636,6 @@ public final class Internal { void addLong(long element); /** Like {@link #set(int, Object)} but more efficient in that it doesn't box the element. */ - @CanIgnoreReturnValue long setLong(int index, long element); /** Returns a mutable clone of this list with the specified capacity. */ @@ -642,7 +656,6 @@ public final class Internal { void addDouble(double element); /** Like {@link #set(int, Object)} but more efficient in that it doesn't box the element. */ - @CanIgnoreReturnValue double setDouble(int index, double element); /** Returns a mutable clone of this list with the specified capacity. */ @@ -663,11 +676,11 @@ public final class Internal { void addFloat(float element); /** Like {@link #set(int, Object)} but more efficient in that it doesn't box the element. */ - @CanIgnoreReturnValue float setFloat(int index, float element); /** Returns a mutable clone of this list with the specified capacity. */ @Override FloatList mutableCopyWithCapacity(int capacity); } + } diff --git a/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java b/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java index 5d10e48884c1abeec44b0c24673793cf911669ea..22f31bbc0b3b35f844536bc625521e145df106d3 100644 --- a/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java +++ b/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java @@ -1,42 +1,56 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import java.io.IOException; /** - * Thrown when a protocol message being parsed is invalid in some way. For instance, - * it contains a malformed varint or a negative byte length. + * Thrown when a protocol message being parsed is invalid in some way, e.g. it contains a malformed + * varint or a negative byte length. * * @author kenton@google.com Kenton Varda */ public class InvalidProtocolBufferException extends IOException { private static final long serialVersionUID = -1616151763072450476L; private MessageLite unfinishedMessage = null; - private boolean wasThrownFromInputStream; - public InvalidProtocolBufferException(String description) { + public InvalidProtocolBufferException(final String description) { super(description); } - public InvalidProtocolBufferException(Exception e) { - super(e.getMessage(), e); - } - - public InvalidProtocolBufferException(String description, Exception e) { - super(description, e); - } - public InvalidProtocolBufferException(IOException e) { super(e.getMessage(), e); } - public InvalidProtocolBufferException(String description, IOException e) { + public InvalidProtocolBufferException(final String description, IOException e) { super(description, e); } @@ -58,28 +72,6 @@ public class InvalidProtocolBufferException extends IOException { return unfinishedMessage; } - /** Set by CodedInputStream */ - void setThrownFromInputStream() { - /* This write can be racy if the same exception is stored and then thrown by multiple custom - * InputStreams on different threads. But since it only ever moves from false->true, there's no - * problem. A thread checking this condition after catching this exception from a delegate - * stream of CodedInputStream is guaranteed to always observe true, because a write on the same - * thread set the value when the exception left the delegate. A thread checking the same - * condition with an exception created by CodedInputStream is guaranteed to always see false, - * because the exception has not been exposed to any code that could publish it to other threads - * and cause a write. - */ - wasThrownFromInputStream = true; - } - - /** - * Allows code catching IOException from CodedInputStream to tell whether this instance was thrown - * by a delegate InputStream, rather than directly by a parse failure. - */ - boolean getThrownFromInputStream() { - return wasThrownFromInputStream; - } - /** * Unwraps the underlying {@link IOException} if this exception was caused by an I/O problem. * Otherwise, returns {@code this}. @@ -119,7 +111,7 @@ public class InvalidProtocolBufferException extends IOException { return new InvalidWireTypeException("Protocol message tag had invalid wire type."); } - /** Exception indicating that an unexpected wire type was encountered for a field. */ + /** Exception indicating that and unexpected wire type was encountered for a field. */ @ExperimentalApi public static class InvalidWireTypeException extends InvalidProtocolBufferException { private static final long serialVersionUID = 3283890091615336259L; diff --git a/java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java b/java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java index 77eb56aaf7e039e1541c3f771b7737606ea4447d..713e80646931faef4bcd497abdc7347492512fd0 100644 --- a/java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java +++ b/java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -117,9 +140,9 @@ class IterableByteBufferInputStream extends InputStream { updateCurrentByteBufferPos(length); } else { int prevPos = currentByteBuffer.position(); - Java8Compatibility.position(currentByteBuffer, currentByteBufferPos); + currentByteBuffer.position(currentByteBufferPos); currentByteBuffer.get(output, offset, length); - Java8Compatibility.position(currentByteBuffer, prevPos); + currentByteBuffer.position(prevPos); updateCurrentByteBufferPos(length); } return length; diff --git a/java/core/src/main/java/com/google/protobuf/Java8Compatibility.java b/java/core/src/main/java/com/google/protobuf/Java8Compatibility.java deleted file mode 100644 index 40e807c8069fce2ca3daefcdfe1a954e4d5fb5bb..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/Java8Compatibility.java +++ /dev/null @@ -1,44 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import java.nio.Buffer; - -/** - * Wrappers around {@link Buffer} methods that are covariantly overridden in Java 9+. See - * https://github.com/protocolbuffers/protobuf/issues/11393 - * - *

TODO remove when Java 8 support is no longer needed. - */ -final class Java8Compatibility { - static void clear(Buffer b) { - b.clear(); - } - - static void flip(Buffer b) { - b.flip(); - } - - static void limit(Buffer b, int limit) { - b.limit(limit); - } - - static void mark(Buffer b) { - b.mark(); - } - - static void position(Buffer b, int position) { - b.position(position); - } - - static void reset(Buffer b) { - b.reset(); - } - - private Java8Compatibility() {} -} diff --git a/java/core/src/main/java/com/google/protobuf/JavaType.java b/java/core/src/main/java/com/google/protobuf/JavaType.java index a16a3051800af1516073a31a27dc0f773daecd87..770aa9ef1ff5c0631f6a24e49bc53772ad4706ea 100644 --- a/java/core/src/main/java/com/google/protobuf/JavaType.java +++ b/java/core/src/main/java/com/google/protobuf/JavaType.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/LazyField.java b/java/core/src/main/java/com/google/protobuf/LazyField.java index d7dddd955aec40f0c2757f3f529f772019952828..891171d7c867a54357ab809b79bbf1ad7ac017a8 100644 --- a/java/core/src/main/java/com/google/protobuf/LazyField.java +++ b/java/core/src/main/java/com/google/protobuf/LazyField.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -12,10 +35,10 @@ import java.util.Map.Entry; /** * LazyField encapsulates the logic of lazily parsing message fields. It stores the message in a - * ByteString initially and then parses it on-demand. + * ByteString initially and then parse it on-demand. * - *

Most methods are implemented in {@link LazyFieldLite} but this class can contain a - * default instance of the message to provide {@code hashCode()}, {@code equals()}, and {@code + *

Most of key methods are implemented in {@link LazyFieldLite} but this class can contain + * default instance of the message to provide {@code hashCode()}, {@code euqals()} and {@code * toString()}. * * @author xiangl@google.com (Xiang Li) @@ -23,7 +46,7 @@ import java.util.Map.Entry; public class LazyField extends LazyFieldLite { /** - * Carry a message's default instance which is used by {@code hashCode()}, {@code equals()}, and + * Carry a message's default instance which is used by {@code hashCode()}, {@code euqals()} and * {@code toString()}. */ private final MessageLite defaultInstance; diff --git a/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java b/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java index d5579fe28f05ad968f709f68ad5ea2eb96efc7f6..6fab26fc53711f3c85f6e3a3664f6332a6ed4ed6 100644 --- a/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java +++ b/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -22,7 +45,7 @@ import java.io.IOException; * All of the getters are expected to be thread-safe. When used in the context of a * MessageLite.Builder, setters can be invoked, but there is no guarantee of thread safety. * - *

TODO: Consider splitting this class's functionality and put the mutable methods + *

TODO(yatin,dweis): Consider splitting this class's functionality and put the mutable methods * into a separate builder class to allow us to give stronger compile-time guarantees. * *

This class is internal implementation detail of the protobuf library, so you don't need to use @@ -86,7 +109,7 @@ public class LazyFieldLite { /** * The memoized bytes for {@code value}. This is an optimization for the toByteString() method to - * not have to recompute its return-value on each invocation. TODO: Figure out whether this + * not have to recompute its return-value on each invocation. TODO(yatin): Figure out whether this * optimization is actually necessary. */ private volatile ByteString memoizedBytes; diff --git a/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java b/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java index cb9b62accebf310ae82b3a5299025384e4719b87..a2de6f9cfeb0eacabe76587be27d20a13332408a 100644 --- a/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -38,21 +61,18 @@ import java.util.RandomAccess; public class LazyStringArrayList extends AbstractProtobufList implements LazyStringList, RandomAccess { - private static final LazyStringArrayList EMPTY_LIST = new LazyStringArrayList(false); + private static final LazyStringArrayList EMPTY_LIST = new LazyStringArrayList(); + + static { + EMPTY_LIST.makeImmutable(); + } - /** Returns an empty immutable {@code LazyStringArrayList} instance */ - public static LazyStringArrayList emptyList() { + static LazyStringArrayList emptyList() { return EMPTY_LIST; } - /** - * For compatibility with older runtimes. - * - *

TODO Remove this in a breaking release. - * - * @deprecated use {@link emptyList()} instead - */ - @Deprecated public static final LazyStringList EMPTY = EMPTY_LIST; + // For compatibility with older runtimes. + public static final LazyStringList EMPTY = EMPTY_LIST; private final List list; @@ -60,11 +80,6 @@ public class LazyStringArrayList extends AbstractProtobufList this(DEFAULT_CAPACITY); } - private LazyStringArrayList(boolean isMutable) { - super(isMutable); - this.list = Collections.emptyList(); - } - public LazyStringArrayList(int initialCapacity) { this(new ArrayList(initialCapacity)); } diff --git a/java/core/src/main/java/com/google/protobuf/LazyStringList.java b/java/core/src/main/java/com/google/protobuf/LazyStringList.java index 307a3e81b13605585d600073e9abb58324783d5f..6b55022caa4abb7afbdb7fb09fd1c3fec39c96b0 100644 --- a/java/core/src/main/java/com/google/protobuf/LazyStringList.java +++ b/java/core/src/main/java/com/google/protobuf/LazyStringList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/LegacyDescriptorsUtil.java b/java/core/src/main/java/com/google/protobuf/LegacyDescriptorsUtil.java deleted file mode 100644 index 7b2351caf813937801cc38379f3838762176a67d..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/LegacyDescriptorsUtil.java +++ /dev/null @@ -1,72 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import com.google.protobuf.Descriptors.FieldDescriptor; -import com.google.protobuf.Descriptors.FileDescriptor; -import com.google.protobuf.Descriptors.OneofDescriptor; - -/** - * This file is meant to be a temporary housing for legacy descriptor APIs we want to deprecate and - * remove. This will help prevent backslide by allowing us to control visibility. - */ -public final class LegacyDescriptorsUtil { - - /** Wraps FileDescriptor */ - public static final class LegacyFileDescriptor { - - /** The syntax of the .proto file. */ - public static enum Syntax { - UNKNOWN("unknown"), - PROTO2("proto2"), - PROTO3("proto3"); - - Syntax(String name) { - this.name = name; - } - - final String name; - } - - public static Syntax getSyntax(FileDescriptor descriptor) { - switch (descriptor.getSyntax()) { - case UNKNOWN: - return Syntax.UNKNOWN; - case PROTO2: - return Syntax.PROTO2; - case PROTO3: - return Syntax.PROTO3; - } - throw new IllegalArgumentException("Unexpected syntax"); - } - - private LegacyFileDescriptor() {} - } - - /** Wraps FieldDescriptor */ - public static final class LegacyFieldDescriptor { - - public static boolean hasOptionalKeyword(FieldDescriptor descriptor) { - return descriptor.hasOptionalKeyword(); - } - - private LegacyFieldDescriptor() {} - } - - /** Wraps OneofDescriptor */ - public static final class LegacyOneofDescriptor { - - public static boolean isSynthetic(OneofDescriptor descriptor) { - return descriptor.isSynthetic(); - } - - private LegacyOneofDescriptor() {} - } - - private LegacyDescriptorsUtil() {} -} diff --git a/java/core/src/main/java/com/google/protobuf/ListFieldSchema.java b/java/core/src/main/java/com/google/protobuf/ListFieldSchema.java index bc55eb23c7ccce2bf9e615cbf1e081605186c588..ebc8561a7261da6861d4ca05c1d01d4bd12e4fd4 100644 --- a/java/core/src/main/java/com/google/protobuf/ListFieldSchema.java +++ b/java/core/src/main/java/com/google/protobuf/ListFieldSchema.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -15,7 +38,6 @@ import java.util.List; /** * Utility class that aids in properly manipulating list fields for either the lite or full runtime. */ -@CheckReturnValue abstract class ListFieldSchema { // Disallow construction. private ListFieldSchema() {} diff --git a/java/core/src/main/java/com/google/protobuf/LongArrayList.java b/java/core/src/main/java/com/google/protobuf/LongArrayList.java index b85398453e1f675d23c66b4ba28c1edf4f3d73a3..bda43a41bb4a183313f99b85f7f3b8a2b95e3b3a 100644 --- a/java/core/src/main/java/com/google/protobuf/LongArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/LongArrayList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -22,7 +45,10 @@ import java.util.RandomAccess; final class LongArrayList extends AbstractProtobufList implements LongList, RandomAccess, PrimitiveNonBoxingCollection { - private static final LongArrayList EMPTY_LIST = new LongArrayList(new long[0], 0, false); + private static final LongArrayList EMPTY_LIST = new LongArrayList(new long[0], 0); + static { + EMPTY_LIST.makeImmutable(); + } public static LongArrayList emptyList() { return EMPTY_LIST; @@ -39,15 +65,14 @@ final class LongArrayList extends AbstractProtobufList /** Constructs a new mutable {@code LongArrayList} with default capacity. */ LongArrayList() { - this(new long[DEFAULT_CAPACITY], 0, true); + this(new long[DEFAULT_CAPACITY], 0); } /** * Constructs a new mutable {@code LongArrayList} containing the same elements as {@code other}. */ - private LongArrayList(long[] other, int size, boolean isMutable) { - super(isMutable); - this.array = other; + private LongArrayList(long[] other, int size) { + array = other; this.size = size; } @@ -100,7 +125,7 @@ final class LongArrayList extends AbstractProtobufList if (capacity < size) { throw new IllegalArgumentException(); } - return new LongArrayList(Arrays.copyOf(array, capacity), size, true); + return new LongArrayList(Arrays.copyOf(array, capacity), size); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java b/java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java index c923b129db92de7d6361b70b167d4a5664ef124e..84ca9ae0f7576523117661ee73cdf2f8be0b7fdd 100644 --- a/java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java +++ b/java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -12,7 +35,6 @@ import static com.google.protobuf.Internal.checkNotNull; /** * Dynamically generates a manifest-based (i.e. table-based) schema for a given protobuf message. */ -@CheckReturnValue @ExperimentalApi final class ManifestSchemaFactory implements SchemaFactory { @@ -41,7 +63,7 @@ final class ManifestSchemaFactory implements SchemaFactory { messageInfo.getDefaultInstance()); } return MessageSetSchema.newSchema( - SchemaUtil.unknownFieldSetFullSchema(), + SchemaUtil.proto2UnknownFieldSetSchema(), ExtensionSchemas.full(), messageInfo.getDefaultInstance()); } @@ -51,7 +73,7 @@ final class ManifestSchemaFactory implements SchemaFactory { private static Schema newSchema(Class messageType, MessageInfo messageInfo) { if (GeneratedMessageLite.class.isAssignableFrom(messageType)) { - return allowExtensions(messageInfo) + return isProto2(messageInfo) ? MessageSchema.newSchema( messageType, messageInfo, @@ -69,13 +91,13 @@ final class ManifestSchemaFactory implements SchemaFactory { /* extensionSchema= */ null, MapFieldSchemas.lite()); } - return allowExtensions(messageInfo) + return isProto2(messageInfo) ? MessageSchema.newSchema( messageType, messageInfo, NewInstanceSchemas.full(), ListFieldSchema.full(), - SchemaUtil.unknownFieldSetFullSchema(), + SchemaUtil.proto2UnknownFieldSetSchema(), ExtensionSchemas.full(), MapFieldSchemas.full()) : MessageSchema.newSchema( @@ -83,18 +105,13 @@ final class ManifestSchemaFactory implements SchemaFactory { messageInfo, NewInstanceSchemas.full(), ListFieldSchema.full(), - SchemaUtil.unknownFieldSetFullSchema(), + SchemaUtil.proto3UnknownFieldSetSchema(), /* extensionSchema= */ null, MapFieldSchemas.full()); } - private static boolean allowExtensions(MessageInfo messageInfo) { - switch (messageInfo.getSyntax()) { - case PROTO3: - return false; - default: - return true; - } + private static boolean isProto2(MessageInfo messageInfo) { + return messageInfo.getSyntax() == ProtoSyntax.PROTO2; } private static MessageInfoFactory getDefaultMessageInfoFactory() { diff --git a/java/core/src/main/java/com/google/protobuf/MapEntry.java b/java/core/src/main/java/com/google/protobuf/MapEntry.java index c065bee6de70a82d4d45c99ad4ecf75dde4b9278..ca0678e2f128fd125e2bc83c97c4a0a85e4308d6 100644 --- a/java/core/src/main/java/com/google/protobuf/MapEntry.java +++ b/java/core/src/main/java/com/google/protobuf/MapEntry.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -313,17 +336,13 @@ public final class MapEntry extends AbstractMessage { @Override public Builder setField(FieldDescriptor field, Object value) { checkFieldDescriptor(field); - if (value == null) { - throw new NullPointerException(field.getFullName() + " is null"); - } - if (field.getNumber() == 1) { setKey((K) value); } else { if (field.getType() == FieldDescriptor.Type.ENUM) { value = ((EnumValueDescriptor) value).getNumber(); } else if (field.getType() == FieldDescriptor.Type.MESSAGE) { - if (!metadata.defaultValue.getClass().isInstance(value)) { + if (value != null && !metadata.defaultValue.getClass().isInstance(value)) { // The value is not the exact right message type. However, if it // is an alternative implementation of the same type -- e.g. a // DynamicMessage -- we should accept it. In this case we can make @@ -418,6 +437,7 @@ public final class MapEntry extends AbstractMessage { } @Override + @SuppressWarnings("unchecked") public Builder clone() { return new Builder<>(metadata, key, value, hasKey, hasValue); } diff --git a/java/core/src/main/java/com/google/protobuf/MapEntryLite.java b/java/core/src/main/java/com/google/protobuf/MapEntryLite.java index 99f3460d3f6bcc28900ea6d80e865397e81df2ba..81bf4c2b18406127809d2586e193a23b419de245 100644 --- a/java/core/src/main/java/com/google/protobuf/MapEntryLite.java +++ b/java/core/src/main/java/com/google/protobuf/MapEntryLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/MapField.java b/java/core/src/main/java/com/google/protobuf/MapField.java index 81566a2e1b4a7a8bc5e194251b53f9f9628e6900..f487736065f2f4180ec4ed7080d21c71cba747a7 100644 --- a/java/core/src/main/java/com/google/protobuf/MapField.java +++ b/java/core/src/main/java/com/google/protobuf/MapField.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -30,7 +53,7 @@ import java.util.Set; *

THREAD-SAFETY NOTE: Read-only access is thread-safe. Users can call getMap() and getList() * concurrently in multiple threads. If write-access is needed, all access must be synchronized. */ -public class MapField extends MapFieldReflectionAccessor implements MutabilityOracle { +public class MapField implements MutabilityOracle { /** * Indicates where the data of this map field is currently stored. @@ -62,7 +85,7 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi private volatile boolean isMutable; private volatile StorageMode mode; - private MutabilityAwareMap mapData; + private MutatabilityAwareMap mapData; private List listData; // Convert between a map entry Message and a key-value pair. @@ -99,13 +122,14 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } } + private final Converter converter; private MapField(Converter converter, StorageMode mode, Map mapData) { this.converter = converter; this.isMutable = true; this.mode = mode; - this.mapData = new MutabilityAwareMap(this, mapData); + this.mapData = new MutatabilityAwareMap(this, mapData); this.listData = null; } @@ -113,25 +137,29 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi this(new ImmutableMessageConverter(defaultEntry), mode, mapData); } + /** Returns an immutable empty MapField. */ public static MapField emptyMapField(MapEntry defaultEntry) { return new MapField(defaultEntry, StorageMode.MAP, Collections.emptyMap()); } + /** Creates a new mutable empty MapField. */ public static MapField newMapField(MapEntry defaultEntry) { return new MapField(defaultEntry, StorageMode.MAP, new LinkedHashMap()); } + private Message convertKeyAndValueToMessage(K key, V value) { return converter.convertKeyAndValueToMessage(key, value); } + @SuppressWarnings("unchecked") private void convertMessageToKeyAndValue(Message message, Map map) { converter.convertMessageToKeyAndValue(message, map); } - private List convertMapToList(MutabilityAwareMap mapData) { + private List convertMapToList(MutatabilityAwareMap mapData) { List listData = new ArrayList(); for (Map.Entry entry : mapData.entrySet()) { listData.add(convertKeyAndValueToMessage(entry.getKey(), entry.getValue())); @@ -139,12 +167,12 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi return listData; } - private MutabilityAwareMap convertListToMap(List listData) { + private MutatabilityAwareMap convertListToMap(List listData) { Map mapData = new LinkedHashMap(); for (Message item : listData) { convertMessageToKeyAndValue(item, mapData); } - return new MutabilityAwareMap(this, mapData); + return new MutatabilityAwareMap(this, mapData); } /** Returns the content of this MapField as a read-only Map. */ @@ -177,7 +205,7 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } public void clear() { - mapData = new MutabilityAwareMap(this, new LinkedHashMap()); + mapData = new MutatabilityAwareMap(this, new LinkedHashMap()); mode = StorageMode.MAP; } @@ -202,7 +230,6 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } /** Gets the content of this MapField as a read-only List. */ - @Override List getList() { if (mode == StorageMode.MAP) { synchronized (this) { @@ -216,7 +243,6 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } /** Gets a mutable List view of this MapField. */ - @Override List getMutableList() { if (mode != StorageMode.LIST) { if (mode == StorageMode.MAP) { @@ -229,7 +255,6 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } /** Gets the default instance of the message stored in the list view of this map field. */ - @Override Message getMapEntryMessageDefaultInstance() { return converter.getMessageDefaultInstance(); } @@ -258,11 +283,11 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } /** An internal map that checks for mutability before delegating. */ - static class MutabilityAwareMap implements Map { + private static class MutatabilityAwareMap implements Map { private final MutabilityOracle mutabilityOracle; private final Map delegate; - MutabilityAwareMap(MutabilityOracle mutabilityOracle, Map delegate) { + MutatabilityAwareMap(MutabilityOracle mutabilityOracle, Map delegate) { this.mutabilityOracle = mutabilityOracle; this.delegate = delegate; } @@ -324,17 +349,17 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi @Override public Set keySet() { - return new MutabilityAwareSet(mutabilityOracle, delegate.keySet()); + return new MutatabilityAwareSet(mutabilityOracle, delegate.keySet()); } @Override public Collection values() { - return new MutabilityAwareCollection(mutabilityOracle, delegate.values()); + return new MutatabilityAwareCollection(mutabilityOracle, delegate.values()); } @Override public Set> entrySet() { - return new MutabilityAwareSet>(mutabilityOracle, delegate.entrySet()); + return new MutatabilityAwareSet>(mutabilityOracle, delegate.entrySet()); } @Override @@ -353,11 +378,11 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } /** An internal collection that checks for mutability before delegating. */ - private static class MutabilityAwareCollection implements Collection { + private static class MutatabilityAwareCollection implements Collection { private final MutabilityOracle mutabilityOracle; private final Collection delegate; - MutabilityAwareCollection(MutabilityOracle mutabilityOracle, Collection delegate) { + MutatabilityAwareCollection(MutabilityOracle mutabilityOracle, Collection delegate) { this.mutabilityOracle = mutabilityOracle; this.delegate = delegate; } @@ -379,7 +404,7 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi @Override public Iterator iterator() { - return new MutabilityAwareIterator(mutabilityOracle, delegate.iterator()); + return new MutatabilityAwareIterator(mutabilityOracle, delegate.iterator()); } @Override @@ -450,11 +475,11 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } /** An internal set that checks for mutability before delegating. */ - private static class MutabilityAwareSet implements Set { + private static class MutatabilityAwareSet implements Set { private final MutabilityOracle mutabilityOracle; private final Set delegate; - MutabilityAwareSet(MutabilityOracle mutabilityOracle, Set delegate) { + MutatabilityAwareSet(MutabilityOracle mutabilityOracle, Set delegate) { this.mutabilityOracle = mutabilityOracle; this.delegate = delegate; } @@ -476,7 +501,7 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi @Override public Iterator iterator() { - return new MutabilityAwareIterator(mutabilityOracle, delegate.iterator()); + return new MutatabilityAwareIterator(mutabilityOracle, delegate.iterator()); } @Override @@ -547,11 +572,11 @@ public class MapField extends MapFieldReflectionAccessor implements Mutabi } /** An internal iterator that checks for mutability before delegating. */ - private static class MutabilityAwareIterator implements Iterator { + private static class MutatabilityAwareIterator implements Iterator { private final MutabilityOracle mutabilityOracle; private final Iterator delegate; - MutabilityAwareIterator(MutabilityOracle mutabilityOracle, Iterator delegate) { + MutatabilityAwareIterator(MutabilityOracle mutabilityOracle, Iterator delegate) { this.mutabilityOracle = mutabilityOracle; this.delegate = delegate; } diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldBuilder.java b/java/core/src/main/java/com/google/protobuf/MapFieldBuilder.java deleted file mode 100644 index 05a6d093cf4a38d8a1a9cbd2bcb2545b163aadbc..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/MapFieldBuilder.java +++ /dev/null @@ -1,218 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * Internal representation of map fields in generated builders. - * - *

This class supports accessing the map field as a {@link Map} to be used in generated API and - * also supports accessing the field as a {@link List} to be used in reflection API. It keeps track - * of where the data is currently stored and do necessary conversions between map and list. - * - *

This class is a protobuf implementation detail. Users shouldn't use this class directly. - */ -public class MapFieldBuilder< - KeyT, - MessageOrBuilderT extends MessageOrBuilder, - MessageT extends MessageOrBuilderT, - BuilderT extends MessageOrBuilderT> - extends MapFieldReflectionAccessor { - - // Only one of the three fields may be non-null at any time. - /** nullable */ - Map builderMap = new LinkedHashMap<>(); - - /** nullable */ - Map messageMap = null; - - // We need a List for reflection. - // - // messageList elements are always MapEntry, where SomeT and MessageT - // have the same descriptor (i.e. SomeT can be DynamicMessage) - /** nullable */ - List messageList = null; - - Converter converter; - - /** Convert a MessageOrBuilder to a Message regardless of which it holds. */ - public interface Converter< - KeyT, MessageOrBuilderT extends MessageOrBuilder, MessageT extends MessageOrBuilderT> { - MessageT build(MessageOrBuilderT val); - - MapEntry defaultEntry(); - } - - public MapFieldBuilder(Converter converter) { - this.converter = converter; - } - - @SuppressWarnings("unchecked") - private List> getMapEntryList() { - ArrayList> list = new ArrayList<>(messageList.size()); - Class valueClass = converter.defaultEntry().getValue().getClass(); - for (Message entry : messageList) { - MapEntry typedEntry = (MapEntry) entry; - if (valueClass.isInstance(typedEntry.getValue())) { - list.add((MapEntry) typedEntry); - } else { - // This needs to use mergeFrom to allow MapEntry to be used. - list.add(converter.defaultEntry().toBuilder().mergeFrom(entry).build()); - } - } - return list; - } - - public Map ensureBuilderMap() { - if (builderMap != null) { - return builderMap; - } - if (messageMap != null) { - builderMap = new LinkedHashMap<>(messageMap.size()); - for (Map.Entry entry : messageMap.entrySet()) { - builderMap.put(entry.getKey(), entry.getValue()); - } - messageMap = null; - return builderMap; - } - builderMap = new LinkedHashMap<>(messageList.size()); - for (MapEntry entry : getMapEntryList()) { - builderMap.put(entry.getKey(), entry.getValue()); - } - messageList = null; - return builderMap; - } - - public List ensureMessageList() { - if (messageList != null) { - return messageList; - } - if (builderMap != null) { - messageList = new ArrayList<>(builderMap.size()); - for (Map.Entry entry : builderMap.entrySet()) { - messageList.add( - converter.defaultEntry().toBuilder() - .setKey(entry.getKey()) - .setValue(converter.build(entry.getValue())) - .build()); - } - builderMap = null; - return messageList; - } - messageList = new ArrayList<>(messageMap.size()); - for (Map.Entry entry : messageMap.entrySet()) { - messageList.add( - converter.defaultEntry().toBuilder() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build()); - } - messageMap = null; - return messageList; - } - - public Map ensureMessageMap() { - messageMap = populateMutableMap(); - builderMap = null; - messageList = null; - return messageMap; - } - - public Map getImmutableMap() { - return new MapField.MutabilityAwareMap<>(MutabilityOracle.IMMUTABLE, populateMutableMap()); - } - - private Map populateMutableMap() { - if (messageMap != null) { - return messageMap; - } - if (builderMap != null) { - Map toReturn = new LinkedHashMap<>(builderMap.size()); - for (Map.Entry entry : builderMap.entrySet()) { - toReturn.put(entry.getKey(), converter.build(entry.getValue())); - } - return toReturn; - } - Map toReturn = new LinkedHashMap<>(messageList.size()); - for (MapEntry entry : getMapEntryList()) { - toReturn.put(entry.getKey(), entry.getValue()); - } - return toReturn; - } - - public void mergeFrom(MapField other) { - ensureBuilderMap().putAll(MapFieldLite.copy(other.getMap())); - } - - public void clear() { - builderMap = new LinkedHashMap<>(); - messageMap = null; - messageList = null; - } - - private boolean typedEquals(MapFieldBuilder other) { - return MapFieldLite.equals( - ensureBuilderMap(), other.ensureBuilderMap()); - } - - @SuppressWarnings("unchecked") - @Override - public boolean equals(Object object) { - if (!(object instanceof MapFieldBuilder)) { - return false; - } - return typedEquals((MapFieldBuilder) object); - } - - @Override - public int hashCode() { - return MapFieldLite.calculateHashCodeForMap(ensureBuilderMap()); - } - - /** Returns a deep copy of this MapFieldBuilder. */ - public MapFieldBuilder copy() { - MapFieldBuilder clone = - new MapFieldBuilder<>(converter); - clone.ensureBuilderMap().putAll(ensureBuilderMap()); - return clone; - } - - /** Converts this MapFieldBuilder to a MapField. */ - public MapField build(MapEntry defaultEntry) { - MapField mapField = MapField.newMapField(defaultEntry); - Map map = mapField.getMutableMap(); - for (Map.Entry entry : ensureBuilderMap().entrySet()) { - map.put(entry.getKey(), converter.build(entry.getValue())); - } - mapField.makeImmutable(); - return mapField; - } - - // MapFieldReflectionAccessor implementation. - /** Gets the content of this MapField as a read-only List. */ - @Override - List getList() { - return ensureMessageList(); - } - - /** Gets a mutable List view of this MapField. */ - @Override - List getMutableList() { - return ensureMessageList(); - } - - /** Gets the default instance of the message stored in the list view of this map field. */ - @Override - Message getMapEntryMessageDefaultInstance() { - return converter.defaultEntry(); - } -} diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldLite.java b/java/core/src/main/java/com/google/protobuf/MapFieldLite.java index bc5704b94821de666ae450e65a7310e3eb5415e4..a9fec4d7d72aa5d32affbddf3cddf3a7a939847a 100644 --- a/java/core/src/main/java/com/google/protobuf/MapFieldLite.java +++ b/java/core/src/main/java/com/google/protobuf/MapFieldLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -34,14 +57,15 @@ public final class MapFieldLite extends LinkedHashMap { this.isMutable = true; } - private static final MapFieldLite EMPTY_MAP_FIELD = new MapFieldLite<>(); + @SuppressWarnings({"rawtypes", "unchecked"}) + private static final MapFieldLite EMPTY_MAP_FIELD = new MapFieldLite<>(); static { EMPTY_MAP_FIELD.makeImmutable(); } - /** Returns a singleton immutable empty MapFieldLite instance. */ - @SuppressWarnings("unchecked") + /** Returns an singleton immutable empty MapFieldLite instance. */ + @SuppressWarnings({"unchecked", "cast"}) public static MapFieldLite emptyMapField() { return (MapFieldLite) EMPTY_MAP_FIELD; } @@ -53,6 +77,7 @@ public final class MapFieldLite extends LinkedHashMap { } } + @SuppressWarnings({"unchecked", "cast"}) @Override public Set> entrySet() { return isEmpty() ? Collections.>emptySet() : super.entrySet(); @@ -177,7 +202,7 @@ public final class MapFieldLite extends LinkedHashMap { */ @SuppressWarnings("unchecked") static Map copy(Map map) { - Map result = new LinkedHashMap(map.size() * 4 / 3 + 1); + Map result = new LinkedHashMap(); for (Map.Entry entry : map.entrySet()) { result.put(entry.getKey(), (V) copy(entry.getValue())); } diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldReflectionAccessor.java b/java/core/src/main/java/com/google/protobuf/MapFieldReflectionAccessor.java deleted file mode 100644 index f514238165c0f9d7f52387dbbcfc0b4af0943924..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/MapFieldReflectionAccessor.java +++ /dev/null @@ -1,25 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import java.util.List; - -/** - * A base class for package private shared methods between MapField and MapFieldBuilder to allow - * reflection to access both. - */ -public abstract class MapFieldReflectionAccessor { - /** Gets the content of this MapField as a read-only List. */ - abstract List getList(); - - /** Gets a mutable List view of this MapField. */ - abstract List getMutableList(); - - /** Gets the default instance of the message stored in the list view of this map field. */ - abstract Message getMapEntryMessageDefaultInstance(); -} diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldSchema.java b/java/core/src/main/java/com/google/protobuf/MapFieldSchema.java index 747834a746821b6ade9d45405fb259277e0df866..195126e51435f9367f2c9d76a6c9d5004ca76734 100644 --- a/java/core/src/main/java/com/google/protobuf/MapFieldSchema.java +++ b/java/core/src/main/java/com/google/protobuf/MapFieldSchema.java @@ -1,15 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import java.util.Map; -@CheckReturnValue interface MapFieldSchema { /** Returns the map data for mutation. */ Map forMutableMapData(Object mapField); @@ -34,7 +56,6 @@ interface MapFieldSchema { MapEntryLite.Metadata forMapMetadata(Object mapDefaultEntry); /** Merges {@code srcMapField} into {@code destMapField}, and returns the merged instance. */ - @CanIgnoreReturnValue Object mergeFrom(Object destMapField, Object srcMapField); /** Compute the serialized size for the map with a given field number. */ diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java b/java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java index d4114491725facdeb5c2a643d11b19953eaaab8b..1efaab3bcee85dbb7b0506fc480c29a4dbcbccb7 100644 --- a/java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java +++ b/java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java b/java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java index f7c5d85f31c62830a50e243598daebe91a0a6b79..8a8c78de8aaa6124c816302d4f47a69ff956e8fa 100644 --- a/java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java +++ b/java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java @@ -1,16 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import com.google.protobuf.MapEntryLite.Metadata; import java.util.Map; -@CheckReturnValue class MapFieldSchemaLite implements MapFieldSchema { @Override diff --git a/java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java b/java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java index d7eeccd8c4e0fd975cddc1c70a544658025c46be..b398c61022149b4b15cc0c8c6fec0f9da2700c66 100644 --- a/java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java +++ b/java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java @@ -1,13 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -@CheckReturnValue final class MapFieldSchemas { private static final MapFieldSchema FULL_SCHEMA = loadSchemaForFullRuntime(); private static final MapFieldSchema LITE_SCHEMA = new MapFieldSchemaLite(); diff --git a/java/core/src/main/java/com/google/protobuf/Message.java b/java/core/src/main/java/com/google/protobuf/Message.java index 5b02c464aecbfb9a5ddef757c97ea4d30af6a48f..9b3a015ba9825c4b98b294b54ea6e165b728dea4 100644 --- a/java/core/src/main/java/com/google/protobuf/Message.java +++ b/java/core/src/main/java/com/google/protobuf/Message.java @@ -1,9 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// TODO(kenton): Use generics? E.g. Builder, then +// mergeFrom*() could return BuilderType for better type-safety. package com.google.protobuf; @@ -15,19 +41,19 @@ import java.util.Map; * Abstract interface implemented by Protocol Message objects. * *

See also {@link MessageLite}, which defines most of the methods that typical users care about. - * {@link Message} adds methods that are not available in the "lite" runtime. The biggest added - * features are introspection and reflection; that is, getting descriptors for the message type and - * accessing the field values dynamically. + * {@link Message} adds to it methods that are not available in the "lite" runtime. The biggest + * added features are introspection and reflection -- i.e., getting descriptors for the message type + * and accessing the field values dynamically. * * @author kenton@google.com Kenton Varda */ -@CheckReturnValue public interface Message extends MessageLite, MessageOrBuilder { // (From MessageLite, re-declared here only for return type covariance.) @Override Parser getParserForType(); + // ----------------------------------------------------------------- // Comparison and hashing @@ -79,7 +105,6 @@ public interface Message extends MessageLite, MessageOrBuilder { // (From MessageLite.Builder, re-declared here only for return type // covariance.) @Override - @CanIgnoreReturnValue Builder clear(); /** @@ -99,7 +124,6 @@ public interface Message extends MessageLite, MessageOrBuilder { * *

This is equivalent to the {@code Message::MergeFrom} method in C++. */ - @CanIgnoreReturnValue Builder mergeFrom(Message other); // (From MessageLite.Builder, re-declared here only for return type @@ -114,11 +138,9 @@ public interface Message extends MessageLite, MessageOrBuilder { Builder clone(); @Override - @CanIgnoreReturnValue Builder mergeFrom(CodedInputStream input) throws IOException; @Override - @CanIgnoreReturnValue Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException; @@ -143,13 +165,16 @@ public interface Message extends MessageLite, MessageOrBuilder { * Get a nested builder instance for the given field. * *

Normally, we hold a reference to the immutable message object for the message type field. - * Some implementations (the generated message builders) can also hold a reference to + * Some implementations(the generated message builders), however, can also hold a reference to * the builder object (a nested builder) for the field. * - *

If the field is already backed up by a nested builder, the nested builder is - * returned. Otherwise, a new field builder is created and returned. The original message - * field (if one exists) is merged into the field builder, which is then nested into its + *

If the field is already backed up by a nested builder, the nested builder will be + * returned. Otherwise, a new field builder will be created and returned. The original message + * field (if exist) will be merged into the field builder, which will then be nested into its * parent builder. + * + *

NOTE: implementations that do not support nested builders will throw + * UnsupportedOperationException. */ Builder getFieldBuilder(Descriptors.FieldDescriptor field); @@ -157,63 +182,59 @@ public interface Message extends MessageLite, MessageOrBuilder { * Get a nested builder instance for the given repeated field instance. * *

Normally, we hold a reference to the immutable message object for the message type field. - * Some implementations (the generated message builders) can also hold a reference to + * Some implementations(the generated message builders), however, can also hold a reference to * the builder object (a nested builder) for the field. * - *

If the field is already backed up by a nested builder, the nested builder is - * returned. Otherwise, a new field builder is created and returned. The original message - * field (if one exists) is merged into the field builder, which is then nested into its + *

If the field is already backed up by a nested builder, the nested builder will be + * returned. Otherwise, a new field builder will be created and returned. The original message + * field (if exist) will be merged into the field builder, which will then be nested into its * parent builder. + * + *

NOTE: implementations that do not support nested builders will throw + * UnsupportedOperationException. */ Builder getRepeatedFieldBuilder(Descriptors.FieldDescriptor field, int index); /** - * Sets a field to the given value. The value must be of the correct type for this field, that - * is, the same type that {@link Message#getField(Descriptors.FieldDescriptor)} returns. + * Sets a field to the given value. The value must be of the correct type for this field, i.e. + * the same type that {@link Message#getField(Descriptors.FieldDescriptor)} would return. */ - @CanIgnoreReturnValue Builder setField(Descriptors.FieldDescriptor field, Object value); /** * Clears the field. This is exactly equivalent to calling the generated "clear" accessor method * corresponding to the field. */ - @CanIgnoreReturnValue Builder clearField(Descriptors.FieldDescriptor field); /** * Clears the oneof. This is exactly equivalent to calling the generated "clear" accessor method * corresponding to the oneof. */ - @CanIgnoreReturnValue Builder clearOneof(Descriptors.OneofDescriptor oneof); /** * Sets an element of a repeated field to the given value. The value must be of the correct type - * for this field; that is, the same type that {@link - * Message#getRepeatedField(Descriptors.FieldDescriptor,int)} returns. + * for this field, i.e. the same type that {@link + * Message#getRepeatedField(Descriptors.FieldDescriptor,int)} would return. * - * @throws IllegalArgumentException if the field is not a repeated field, or {@code + * @throws IllegalArgumentException The field is not a repeated field, or {@code * field.getContainingType() != getDescriptorForType()}. */ - @CanIgnoreReturnValue Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value); /** * Like {@code setRepeatedField}, but appends the value as a new element. * - * @throws IllegalArgumentException if the field is not a repeated field, or {@code - * field.getContainingType() != getDescriptorForType()} + * @throws IllegalArgumentException The field is not a repeated field, or {@code + * field.getContainingType() != getDescriptorForType()}. */ - @CanIgnoreReturnValue Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value); /** Set the {@link UnknownFieldSet} for this message. */ - @CanIgnoreReturnValue Builder setUnknownFields(UnknownFieldSet unknownFields); /** Merge some unknown fields into the {@link UnknownFieldSet} for this message. */ - @CanIgnoreReturnValue Builder mergeUnknownFields(UnknownFieldSet unknownFields); // --------------------------------------------------------------- @@ -222,38 +243,30 @@ public interface Message extends MessageLite, MessageOrBuilder { // (From MessageLite.Builder, re-declared here only for return type // covariance.) @Override - @CanIgnoreReturnValue Builder mergeFrom(ByteString data) throws InvalidProtocolBufferException; @Override - @CanIgnoreReturnValue Builder mergeFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; @Override - @CanIgnoreReturnValue Builder mergeFrom(byte[] data) throws InvalidProtocolBufferException; @Override - @CanIgnoreReturnValue Builder mergeFrom(byte[] data, int off, int len) throws InvalidProtocolBufferException; @Override - @CanIgnoreReturnValue Builder mergeFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; @Override - @CanIgnoreReturnValue Builder mergeFrom(byte[] data, int off, int len, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; @Override - @CanIgnoreReturnValue Builder mergeFrom(InputStream input) throws IOException; @Override - @CanIgnoreReturnValue Builder mergeFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException; diff --git a/java/core/src/main/java/com/google/protobuf/MessageInfo.java b/java/core/src/main/java/com/google/protobuf/MessageInfo.java index 5891fd6c2df0b43b15798fad62d27e781cba6200..69e318696aa33e2cfa299c7b2b7c06f3374b7f7f 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageInfo.java +++ b/java/core/src/main/java/com/google/protobuf/MessageInfo.java @@ -1,14 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -/** A MessageInfo object describes a proto message type. */ -@CheckReturnValue +/** A MesageInfo object describes a proto message type. */ interface MessageInfo { /** Gets syntax for this type. */ ProtoSyntax getSyntax(); diff --git a/java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java b/java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java index abe559e52b5d8dcc3066480134687ccbef8772fd..005c26d05f7d44ecbea28a8a31622a9a20acc60e 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java +++ b/java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java @@ -1,15 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; /** A factory that creates {@link MessageInfo} instances for message types. */ @ExperimentalApi -@CheckReturnValue interface MessageInfoFactory { /** Whether the message class is supported by this factory. */ boolean isSupported(Class clazz); diff --git a/java/core/src/main/java/com/google/protobuf/MessageLite.java b/java/core/src/main/java/com/google/protobuf/MessageLite.java index 9a580ad56f33a467dbd953ed740708c1042f7565..7d2ef33a17f0ec0374347971986ceea5517045a5 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageLite.java +++ b/java/core/src/main/java/com/google/protobuf/MessageLite.java @@ -1,9 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// TODO(kenton): Use generics? E.g. Builder, then +// mergeFrom*() could return BuilderType for better type-safety. package com.google.protobuf; @@ -36,7 +62,6 @@ import java.io.OutputStream; * * @author kenton@google.com Kenton Varda */ -@CheckReturnValue public interface MessageLite extends MessageLiteOrBuilder { /** @@ -48,9 +73,6 @@ public interface MessageLite extends MessageLiteOrBuilder { /** * Get the number of bytes required to encode this message. The result is only computed on the * first call and memoized after that. - * - * If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will - * be smaller than the actual number of bytes required and might be negative. */ int getSerializedSize(); @@ -63,18 +85,12 @@ public interface MessageLite extends MessageLiteOrBuilder { /** * Serializes the message to a {@code ByteString} and returns it. This is just a trivial wrapper * around {@link #writeTo(CodedOutputStream)}. - * - * If this message requires more than Integer.MAX_VALUE bytes to encode, the behavior is - * unpredictable. It may throw a runtime exception or truncate or slice the data. */ ByteString toByteString(); /** * Serializes the message to a {@code byte} array and returns it. This is just a trivial wrapper * around {@link #writeTo(CodedOutputStream)}. - * - * If this message requires more than Integer.MAX_VALUE bytes to encode, the behavior is - * unpredictable. It may throw a runtime exception or truncate or slice the data. */ byte[] toByteArray(); @@ -84,10 +100,10 @@ public interface MessageLite extends MessageLiteOrBuilder { * *

NOTE: Protocol Buffers are not self-delimiting. Therefore, if you write any more data to the * stream after the message, you must somehow ensure that the parser on the receiving end does not - * interpret this as being part of the protocol message. This can be done, for instance, by - * writing the size of the message before the data, then making sure to limit the input to that - * size on the receiving end by wrapping the InputStream in one which limits the input. - * Alternatively, just use {@link #writeDelimitedTo(OutputStream)}. + * interpret this as being part of the protocol message. This can be done e.g. by writing the size + * of the message before the data, then making sure to limit the input to that size on the + * receiving end (e.g. by wrapping the InputStream in one which limits the input). Alternatively, + * just use {@link #writeDelimitedTo(OutputStream)}. */ void writeTo(OutputStream output) throws IOException; @@ -100,6 +116,7 @@ public interface MessageLite extends MessageLiteOrBuilder { */ void writeDelimitedTo(OutputStream output) throws IOException; + // ================================================================= // Builders @@ -115,7 +132,6 @@ public interface MessageLite extends MessageLiteOrBuilder { /** Abstract interface implemented by Protocol Message builders. */ interface Builder extends MessageLiteOrBuilder, Cloneable { /** Resets all fields to their default values. */ - @CanIgnoreReturnValue Builder clear(); /** @@ -158,26 +174,14 @@ public interface MessageLite extends MessageLiteOrBuilder { * *

Note: The caller should call {@link CodedInputStream#checkLastTagWas(int)} after calling * this to verify that the last tag seen was the appropriate end-group tag, or zero for EOF. - * - * @throws InvalidProtocolBufferException the bytes read are not syntactically correct according - * to the protobuf wire format specification. The data is corrupt, incomplete, or was never - * a protobuf in the first place. - * @throws IOException an I/O error reading from the stream */ - @CanIgnoreReturnValue Builder mergeFrom(CodedInputStream input) throws IOException; /** * Like {@link Builder#mergeFrom(CodedInputStream)}, but also parses extensions. The extensions * that you want to be able to parse must be registered in {@code extensionRegistry}. Extensions * not in the registry will be treated as unknown fields. - * - * @throws InvalidProtocolBufferException the bytes read are not syntactically correct according - * to the protobuf wire format specification. The data is corrupt, incomplete, or was never - * a protobuf in the first place. - * @throws IOException an I/O error reading from the stream */ - @CanIgnoreReturnValue Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException; @@ -188,24 +192,16 @@ public interface MessageLite extends MessageLiteOrBuilder { * Parse {@code data} as a message of this type and merge it with the message being built. This * is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. * - * @throws InvalidProtocolBufferException the bytes in data are not syntactically correct - * according to the protobuf wire format specification. The data is corrupt, incomplete, or - * was never a protobuf in the first place. * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(ByteString data) throws InvalidProtocolBufferException; /** * Parse {@code data} as a message of this type and merge it with the message being built. This * is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. * - * @throws InvalidProtocolBufferException the bytes in data are not syntactically correct - * according to the protobuf wire format specification. The data is corrupt, incomplete, or - * was never a protobuf in the first place. * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; @@ -213,36 +209,24 @@ public interface MessageLite extends MessageLiteOrBuilder { * Parse {@code data} as a message of this type and merge it with the message being built. This * is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. * - * @throws InvalidProtocolBufferException the bytes in data are not syntactically correct - * according to the protobuf wire format specification. The data is corrupt, incomplete, or - * was never a protobuf in the first place. * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(byte[] data) throws InvalidProtocolBufferException; /** * Parse {@code data} as a message of this type and merge it with the message being built. This * is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. * - * @throws InvalidProtocolBufferException the bytes in data are not syntactically correct - * according to the protobuf wire format specification. The data is corrupt, incomplete, or - * was never a protobuf in the first place. * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(byte[] data, int off, int len) throws InvalidProtocolBufferException; /** * Parse {@code data} as a message of this type and merge it with the message being built. This * is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. * - * @throws InvalidProtocolBufferException the bytes in data are not syntactically correct - * according to the protobuf wire format specification. The data is corrupt, incomplete, or - * was never a protobuf in the first place. * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; @@ -250,12 +234,8 @@ public interface MessageLite extends MessageLiteOrBuilder { * Parse {@code data} as a message of this type and merge it with the message being built. This * is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. * - * @throws InvalidProtocolBufferException the bytes in data are not syntactically correct - * according to the protobuf wire format specification. The data is corrupt, incomplete, or - * was never a protobuf in the first place. * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(byte[] data, int off, int len, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; @@ -269,13 +249,8 @@ public interface MessageLite extends MessageLiteOrBuilder { * *

Despite usually reading the entire input, this does not close the stream. * - * @throws InvalidProtocolBufferException the bytes read are not syntactically correct according - * to the protobuf wire format specification. The data is corrupt, incomplete, or was never - * a protobuf in the first place. - * @throws IOException an I/O error reading from the stream * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(InputStream input) throws IOException; /** @@ -285,7 +260,6 @@ public interface MessageLite extends MessageLiteOrBuilder { * * @return this */ - @CanIgnoreReturnValue Builder mergeFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException; @@ -305,7 +279,6 @@ public interface MessageLite extends MessageLiteOrBuilder { * *

This is equivalent to the {@code Message::MergeFrom} method in C++. */ - @CanIgnoreReturnValue Builder mergeFrom(MessageLite other); /** @@ -313,25 +286,12 @@ public interface MessageLite extends MessageLiteOrBuilder { * message (encoded as a varint) is read first, then the message data. Use {@link * MessageLite#writeDelimitedTo(OutputStream)} to write messages in this format. * - * @return true if successful, or false if the stream is at EOF when the method starts. Any - * other error (including reaching EOF during parsing) causes an exception to be thrown. - * @throws InvalidProtocolBufferException the bytes read are not syntactically correct according - * to the protobuf wire format specification. The data is corrupt, incomplete, or was never - * a protobuf in the first place. - * @throws IOException an I/O error reading from the stream + * @return True if successful, or false if the stream is at EOF when the method starts. Any + * other error (including reaching EOF during parsing) will cause an exception to be thrown. */ boolean mergeDelimitedFrom(InputStream input) throws IOException; - /** - * Like {@link #mergeDelimitedFrom(InputStream)} but supporting extensions. - * - * @return true if successful, or false if the stream is at EOF when the method starts. Any - * other error (including reaching EOF during parsing) causes an exception to be thrown. - * @throws InvalidProtocolBufferException the bytes read are not syntactically correct according - * to the protobuf wire format specification. The data is corrupt, incomplete, or was never - * a protobuf in the first place. - * @throws IOException an I/O error reading from the stream - */ + /** Like {@link #mergeDelimitedFrom(InputStream)} but supporting extensions. */ boolean mergeDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException; } diff --git a/java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java b/java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java index 018c1e534958355d05da9fa1125bde7705c81314..7a5ef3ed518d0c8c5c475b4ffeb3480fdb849b58 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java +++ b/java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -13,7 +36,6 @@ package com.google.protobuf; * * @author jonp@google.com (Jon Perlow) */ -@CheckReturnValue public interface MessageLiteOrBuilder { /** * Get an instance of the type with no fields set. Because no fields are set, all getters for diff --git a/java/core/src/main/java/com/google/protobuf/MessageLiteToString.java b/java/core/src/main/java/com/google/protobuf/MessageLiteToString.java index 67976f13b95fe2db0625f68dab0dd084022c4fae..3a3a70f13ffae8f81bb8559f19af5bd59967639d 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageLiteToString.java +++ b/java/core/src/main/java/com/google/protobuf/MessageLiteToString.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -32,16 +55,13 @@ final class MessageLiteToString { Arrays.fill(INDENT_BUFFER, ' '); } - private MessageLiteToString() { - // Classes which are not intended to be instantiated should be made non-instantiable with a - // private constructor. This includes utility classes (classes with only static members). - } - /** * Returns a {@link String} representation of the {@link MessageLite} object. The first line of - * the {@code String} representation includes a comment string to uniquely identify + * the {@code String} representation representation includes a comment string to uniquely identify * the object instance. This acts as an indicator that this should not be relied on for * comparisons. + * + *

For use by generated code only. */ static String toString(MessageLite messageLite, String commentString) { StringBuilder buffer = new StringBuilder(); @@ -145,14 +165,14 @@ final class MessageLiteToString { // only works if the method names have not been proguarded out or renamed. Method getMethod = getter.getValue(); Method hasMethod = hazzers.get("has" + suffix); - // TODO: Fix proto3 semantics. + // TODO(dweis): Fix proto3 semantics. if (getMethod != null) { Object value = GeneratedMessageLite.invokeOrDie(getMethod, messageLite); final boolean hasValue = hasMethod == null ? !isDefaultValue(value) : (Boolean) GeneratedMessageLite.invokeOrDie(hasMethod, messageLite); - // TODO: This doesn't stop printing oneof case twice: value and enum style. + // TODO(dweis): This doesn't stop printing oneof case twice: value and enum style. if (hasValue) { printField(buffer, indent, suffix, value); } @@ -182,10 +202,10 @@ final class MessageLiteToString { return ((Integer) o) == 0; } if (o instanceof Float) { - return Float.floatToRawIntBits((Float) o) == 0; + return ((Float) o) == 0f; } if (o instanceof Double) { - return Double.doubleToRawLongBits((Double) o) == 0; + return ((Double) o) == 0d; } if (o instanceof String) { return o.equals(""); @@ -252,7 +272,7 @@ final class MessageLiteToString { indent(indent, buffer); buffer.append("}"); } else { - buffer.append(": ").append(object); + buffer.append(": ").append(object.toString()); } } diff --git a/java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java b/java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java index aa4a541fe07ba8b79f89d281bdd4c691d7140a5d..0254df99ac9aa63ccc78ce827e186b2447b19a7c 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java +++ b/java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -16,7 +39,6 @@ import java.util.Map; * * @author jonp@google.com (Jon Perlow) */ -@CheckReturnValue public interface MessageOrBuilder extends MessageLiteOrBuilder { // (From MessageLite, re-declared here only for return type covariance.) @@ -72,8 +94,7 @@ public interface MessageOrBuilder extends MessageLiteOrBuilder { /** * Returns true if the given field is set. This is exactly equivalent to calling the generated - * "has" accessor method corresponding to the field. The return value of hasField() is - * semantically meaningful only for fields where field.hasPresence() == true. + * "has" accessor method corresponding to the field. * * @throws IllegalArgumentException The field is a repeated field, or {@code * field.getContainingType() != getDescriptorForType()}. diff --git a/java/core/src/main/java/com/google/protobuf/MessageReflection.java b/java/core/src/main/java/com/google/protobuf/MessageReflection.java index e33cc4596005739f39e70cff047c5f6c1480c3c2..13a6b8de5e5920fbb372106ab8e308c3c5a03515 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageReflection.java +++ b/java/core/src/main/java/com/google/protobuf/MessageReflection.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -637,7 +660,7 @@ class MessageReflection { if (descriptor.needsUtf8Check()) { return WireFormat.Utf8Validation.STRICT; } - // TODO: support lazy strings for repeated fields. + // TODO(liujisi): support lazy strings for repeated fields. if (!descriptor.isRepeated() && builder instanceof GeneratedMessage.Builder) { return WireFormat.Utf8Validation.LAZY; } @@ -650,6 +673,7 @@ class MessageReflection { } } + static class ExtensionAdapter implements MergeTarget { private final FieldSet extensions; @@ -850,7 +874,7 @@ class MessageReflection { if (descriptor.needsUtf8Check()) { return WireFormat.Utf8Validation.STRICT; } - // TODO: support lazy strings for ExtesnsionSet. + // TODO(b/248145492): support lazy strings for ExtesnsionSet. return WireFormat.Utf8Validation.LOOSE; } @@ -884,21 +908,18 @@ class MessageReflection { } @Override - @CanIgnoreReturnValue public MergeTarget setField(Descriptors.FieldDescriptor field, Object value) { extensions.setField(field, value); return this; } @Override - @CanIgnoreReturnValue public MergeTarget clearField(Descriptors.FieldDescriptor field) { extensions.clearField(field); return this; } @Override - @CanIgnoreReturnValue public MergeTarget setRepeatedField( Descriptors.FieldDescriptor field, int index, Object value) { extensions.setRepeatedField(field, index, value); @@ -906,7 +927,6 @@ class MessageReflection { } @Override - @CanIgnoreReturnValue public MergeTarget addRepeatedField(Descriptors.FieldDescriptor field, Object value) { extensions.addRepeatedField(field, value); return this; @@ -918,7 +938,6 @@ class MessageReflection { } @Override - @CanIgnoreReturnValue public MergeTarget clearOneof(Descriptors.OneofDescriptor oneof) { // Nothing to clear. return this; @@ -1077,7 +1096,7 @@ class MessageReflection { if (descriptor.needsUtf8Check()) { return WireFormat.Utf8Validation.STRICT; } - // TODO: support lazy strings for ExtesnsionSet. + // TODO(b/248145492): support lazy strings for ExtesnsionSet. return WireFormat.Utf8Validation.LOOSE; } @@ -1176,7 +1195,10 @@ class MessageReflection { if (field.getLiteType() == WireFormat.FieldType.ENUM) { while (input.getBytesUntilLimit() > 0) { final int rawValue = input.readEnum(); - if (field.legacyEnumFieldTreatedAsClosed()) { + if (field.getFile().supportsUnknownEnumValue()) { + target.addRepeatedField( + field, field.getEnumType().findValueByNumberCreatingIfUnknown(rawValue)); + } else { final Object value = field.getEnumType().findValueByNumber(rawValue); // If the number isn't recognized as a valid value for this enum, // add it to the unknown fields. @@ -1187,9 +1209,6 @@ class MessageReflection { } else { target.addRepeatedField(field, value); } - } else { - target.addRepeatedField( - field, field.getEnumType().findValueByNumberCreatingIfUnknown(rawValue)); } } } else { @@ -1216,7 +1235,9 @@ class MessageReflection { } case ENUM: final int rawValue = input.readEnum(); - if (field.legacyEnumFieldTreatedAsClosed()) { + if (field.getFile().supportsUnknownEnumValue()) { + value = field.getEnumType().findValueByNumberCreatingIfUnknown(rawValue); + } else { value = field.getEnumType().findValueByNumber(rawValue); // If the number isn't recognized as a valid value for this enum, // add it to the unknown fields. @@ -1226,8 +1247,6 @@ class MessageReflection { } return true; } - } else { - value = field.getEnumType().findValueByNumberCreatingIfUnknown(rawValue); } break; default: @@ -1282,7 +1301,7 @@ class MessageReflection { // The wire format for MessageSet is: // message MessageSet { // repeated group Item = 1 { - // required uint32 typeId = 2; + // required int32 typeId = 2; // required bytes message = 3; // } // } diff --git a/java/core/src/main/java/com/google/protobuf/MessageSchema.java b/java/core/src/main/java/com/google/protobuf/MessageSchema.java index de3890f7023aaaa009be3226fd63be890d3209d1..8f873c1ef049140260f60fb434147f14e8dd162d 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageSchema.java +++ b/java/core/src/main/java/com/google/protobuf/MessageSchema.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -60,7 +83,6 @@ import java.util.List; import java.util.Map; /** Schema used for standard messages. */ -@CheckReturnValue final class MessageSchema implements Schema { private static final int INTS_PER_FIELD = 3; private static final int OFFSET_BITS = 20; @@ -68,21 +90,9 @@ final class MessageSchema implements Schema { private static final int FIELD_TYPE_MASK = 0x0FF00000; private static final int REQUIRED_MASK = 0x10000000; private static final int ENFORCE_UTF8_MASK = 0x20000000; - private static final int LEGACY_ENUM_IS_CLOSED_MASK = 0x80000000; private static final int NO_PRESENCE_SENTINEL = -1 & OFFSET_MASK; private static final int[] EMPTY_INT_ARRAY = new int[0]; - /** - * Bit masks for field type extra feature bits encoded in Java gencode via - * GetExperimentalJavaFieldType in helpers.cc. - */ - private static final int REQUIRED_BIT = 0x100; - - private static final int UTF8_CHECK_BIT = 0x200; - private static final int CHECK_INITIALIZED_BIT = 0x400; - private static final int LEGACY_ENUM_IS_CLOSED_BIT = 0x800; - private static final int HAS_HAS_BIT = 0x1000; - /** An offset applied to the field type ID for scalar fields that are a member of a oneof. */ static final int ONEOF_TYPE_OFFSET = 51 /* FieldType.MAP + 1 */; @@ -99,31 +109,22 @@ final class MessageSchema implements Schema { *

* *

-   * buffer[i]
    * [ 0 -    3] unused
    * [ 4 -   31] field number
-   *
-   * buffer[i+1]
    * [32 -   33] unused
    * [34 -   34] whether UTF-8 enforcement should be applied to a string field.
    * [35 -   35] whether the field is required
    * [36 -   43] field type / for oneof: field type + {@link #ONEOF_TYPE_OFFSET}
    * [44 -   63] field offset / oneof value field offset
-   *
-   * buffer[i+2]
    * [64 -   69] unused
    * [70 -   75] field presence mask shift (unused for oneof/repeated fields)
    * [76 -   95] presence field offset / oneof case field offset / cached size field offset
    * 
* - * Offset refer to the field offsets returned by Unsafe.objectFieldOffset() for reflective access - * to corresponding field. - * - *

Note that presence field offset can only use 20 bits - 1. All bits set to 1 is the sentinel - * value for non-presence. This is not validated at runtime, we simply assume message layouts will - * not exceed 1MB (assuming ~10 bytes per field, that implies 100k fields which should hit other - * javac limits first). This corresponds to a shared bitFieldN_, which must have the field - * presence mask shift applied to get the corresponding field's presence. + * Note that presence field offset can only use 20 bits - 1. All bits set to 1 is the sentinel + * value for non-presence. This is not validated at runtime, we simply assume message layouts + * will not exceed 1MB (assuming ~10 bytes per field, that implies 100k fields which should hit + * other javac limits first). */ private final int[] buffer; @@ -152,8 +153,8 @@ final class MessageSchema implements Schema { private final MessageLite defaultInstance; private final boolean hasExtensions; private final boolean lite; - private final ProtoSyntax syntax; - // TODO: Make both full-runtime and lite-runtime support cached field size. + private final boolean proto3; + // TODO(xiaofeng): Make both full-runtime and lite-runtime support cached field size. private final boolean useCachedSizeField; /** Represents [checkInitialized positions, map field positions, repeated field offsets]. */ @@ -183,7 +184,7 @@ final class MessageSchema implements Schema { int minFieldNumber, int maxFieldNumber, MessageLite defaultInstance, - ProtoSyntax syntax, + boolean proto3, boolean useCachedSizeField, int[] intArray, int checkInitialized, @@ -199,7 +200,7 @@ final class MessageSchema implements Schema { this.maxFieldNumber = maxFieldNumber; this.lite = defaultInstance instanceof GeneratedMessageLite; - this.syntax = syntax; + this.proto3 = proto3; this.hasExtensions = extensionSchema != null && extensionSchema.hasExtensions(defaultInstance); this.useCachedSizeField = useCachedSizeField; @@ -250,6 +251,8 @@ final class MessageSchema implements Schema { UnknownFieldSchema unknownFieldSchema, ExtensionSchema extensionSchema, MapFieldSchema mapFieldSchema) { + final boolean isProto3 = messageInfo.getSyntax() == ProtoSyntax.PROTO3; + String info = messageInfo.getStringInfo(); final int length = info.length(); int i = 0; @@ -441,7 +444,7 @@ final class MessageSchema implements Schema { fieldTypeWithExtraBits = next; fieldType = fieldTypeWithExtraBits & 0xFF; - if ((fieldTypeWithExtraBits & CHECK_INITIALIZED_BIT) != 0) { + if ((fieldTypeWithExtraBits & 0x400) != 0) { intArray[checkInitializedPosition++] = bufferIndex; } @@ -468,10 +471,7 @@ final class MessageSchema implements Schema { || oneofFieldType == 17 /* FieldType.GROUP */) { objects[bufferIndex / INTS_PER_FIELD * 2 + 1] = messageInfoObjects[objectsPosition++]; } else if (oneofFieldType == 12 /* FieldType.ENUM */) { - // TODO: Remove proto2 check once legacy gencode not setting this bit - // no longer needs to be supported. - if (messageInfo.getSyntax().equals(ProtoSyntax.PROTO2) - || (fieldTypeWithExtraBits & LEGACY_ENUM_IS_CLOSED_BIT) != 0) { + if (!isProto3) { objects[bufferIndex / INTS_PER_FIELD * 2 + 1] = messageInfoObjects[objectsPosition++]; } } @@ -514,22 +514,19 @@ final class MessageSchema implements Schema { } else if (fieldType == 12 /* FieldType.ENUM */ || fieldType == 30 /* FieldType.ENUM_LIST */ || fieldType == 44 /* FieldType.ENUM_LIST_PACKED */) { - // TODO: Remove proto2 check once legacy gencode not setting this bit - // no longer needs to be supported. - if (messageInfo.getSyntax() == ProtoSyntax.PROTO2 - || (fieldTypeWithExtraBits & LEGACY_ENUM_IS_CLOSED_BIT) != 0) { + if (!isProto3) { objects[bufferIndex / INTS_PER_FIELD * 2 + 1] = messageInfoObjects[objectsPosition++]; } } else if (fieldType == 50 /* FieldType.MAP */) { intArray[mapFieldIndex++] = bufferIndex; objects[bufferIndex / INTS_PER_FIELD * 2] = messageInfoObjects[objectsPosition++]; - if ((fieldTypeWithExtraBits & LEGACY_ENUM_IS_CLOSED_BIT) != 0) { + if ((fieldTypeWithExtraBits & 0x800) != 0) { objects[bufferIndex / INTS_PER_FIELD * 2 + 1] = messageInfoObjects[objectsPosition++]; } } fieldOffset = (int) unsafe.objectFieldOffset(field); - boolean hasHasBit = (fieldTypeWithExtraBits & HAS_HAS_BIT) != 0; + boolean hasHasBit = (fieldTypeWithExtraBits & 0x1000) == 0x1000; if (hasHasBit && fieldType <= 17 /* FieldType.GROUP */) { next = info.charAt(i++); if (next >= 0xD800) { @@ -569,11 +566,8 @@ final class MessageSchema implements Schema { buffer[bufferIndex++] = fieldNumber; buffer[bufferIndex++] = - ((fieldTypeWithExtraBits & UTF8_CHECK_BIT) != 0 ? ENFORCE_UTF8_MASK : 0) - | ((fieldTypeWithExtraBits & REQUIRED_BIT) != 0 ? REQUIRED_MASK : 0) - | ((fieldTypeWithExtraBits & LEGACY_ENUM_IS_CLOSED_BIT) != 0 - ? LEGACY_ENUM_IS_CLOSED_MASK - : 0) + ((fieldTypeWithExtraBits & 0x200) != 0 ? ENFORCE_UTF8_MASK : 0) + | ((fieldTypeWithExtraBits & 0x100) != 0 ? REQUIRED_MASK : 0) | (fieldType << OFFSET_BITS) | fieldOffset; buffer[bufferIndex++] = (presenceMaskShift << OFFSET_BITS) | presenceFieldOffset; @@ -585,7 +579,7 @@ final class MessageSchema implements Schema { minFieldNumber, maxFieldNumber, messageInfo.getDefaultInstance(), - messageInfo.getSyntax(), + isProto3, /* useCachedSizeField= */ false, intArray, checkInitialized, @@ -629,6 +623,7 @@ final class MessageSchema implements Schema { UnknownFieldSchema unknownFieldSchema, ExtensionSchema extensionSchema, MapFieldSchema mapFieldSchema) { + final boolean isProto3 = messageInfo.getSyntax() == ProtoSyntax.PROTO3; FieldInfo[] fis = messageInfo.getFields(); final int minFieldNumber; final int maxFieldNumber; @@ -718,7 +713,7 @@ final class MessageSchema implements Schema { minFieldNumber, maxFieldNumber, messageInfo.getDefaultInstance(), - messageInfo.getSyntax(), + isProto3, /* useCachedSizeField= */ true, combined, checkInitialized.length, @@ -1461,8 +1456,12 @@ final class MessageSchema implements Schema { } @Override - @SuppressWarnings("unchecked") // Field type checks guarantee type casts from Unsafe. public int getSerializedSize(T message) { + return proto3 ? getSerializedSizeProto3(message) : getSerializedSizeProto2(message); + } + + @SuppressWarnings("unchecked") + private int getSerializedSizeProto2(T message) { int size = 0; final sun.misc.Unsafe unsafe = UNSAFE; @@ -1470,87 +1469,70 @@ final class MessageSchema implements Schema { int currentPresenceField = 0; for (int i = 0; i < buffer.length; i += INTS_PER_FIELD) { final int typeAndOffset = typeAndOffsetAt(i); - final int fieldType = type(typeAndOffset); final int number = numberAt(i); + int fieldType = type(typeAndOffset); + int presenceMaskAndOffset = 0; int presenceMask = 0; - int presenceMaskAndOffset = buffer[i + 2]; - final int presenceOrCachedSizeFieldOffset = presenceMaskAndOffset & OFFSET_MASK; if (fieldType <= 17) { - // Performance optimization to cache the presence field which is shared for multiple - // fields. - // TODO: Improve caching for case when fields alternate between having and not - // having presence by caching presence field for last field with presence only. - if (presenceOrCachedSizeFieldOffset != currentPresenceFieldOffset) { - currentPresenceFieldOffset = presenceOrCachedSizeFieldOffset; - currentPresenceField = - currentPresenceFieldOffset == NO_PRESENCE_SENTINEL - ? 0 - : unsafe.getInt(message, (long) currentPresenceFieldOffset); - } - // Mask for presence bit of the current field from the shared presence field. + presenceMaskAndOffset = buffer[i + 2]; + final int presenceFieldOffset = presenceMaskAndOffset & OFFSET_MASK; presenceMask = 1 << (presenceMaskAndOffset >>> OFFSET_BITS); + if (presenceFieldOffset != currentPresenceFieldOffset) { + currentPresenceFieldOffset = presenceFieldOffset; + currentPresenceField = unsafe.getInt(message, (long) presenceFieldOffset); + } + } else if (useCachedSizeField + && fieldType >= FieldType.DOUBLE_LIST_PACKED.id() + && fieldType <= FieldType.SINT64_LIST_PACKED.id()) { + presenceMaskAndOffset = buffer[i + 2] & OFFSET_MASK; } final long offset = offset(typeAndOffset); - final int cachedSizeOffset = - fieldType >= FieldType.DOUBLE_LIST_PACKED.id() - && fieldType <= FieldType.SINT64_LIST_PACKED.id() - ? presenceOrCachedSizeFieldOffset - : 0; switch (fieldType) { case 0: // DOUBLE: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeDoubleSize(number, 0); } break; case 1: // FLOAT: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeFloatSize(number, 0); } break; case 2: // INT64: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeInt64Size(number, unsafe.getLong(message, offset)); } break; case 3: // UINT64: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeUInt64Size(number, unsafe.getLong(message, offset)); } break; case 4: // INT32: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeInt32Size(number, unsafe.getInt(message, offset)); } break; case 5: // FIXED64: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeFixed64Size(number, 0); } break; case 6: // FIXED32: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeFixed32Size(number, 0); } break; case 7: // BOOL: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeBoolSize(number, true); } break; case 8: // STRING: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { Object value = unsafe.getObject(message, offset); if (value instanceof ByteString) { size += CodedOutputStream.computeBytesSize(number, (ByteString) value); @@ -1560,58 +1542,49 @@ final class MessageSchema implements Schema { } break; case 9: // MESSAGE: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { Object value = unsafe.getObject(message, offset); size += SchemaUtil.computeSizeMessage(number, value, getMessageFieldSchema(i)); } break; case 10: // BYTES: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { ByteString value = (ByteString) unsafe.getObject(message, offset); size += CodedOutputStream.computeBytesSize(number, value); } break; case 11: // UINT32: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeUInt32Size(number, unsafe.getInt(message, offset)); } break; case 12: // ENUM: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeEnumSize(number, unsafe.getInt(message, offset)); } break; case 13: // SFIXED32: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeSFixed32Size(number, 0); } break; case 14: // SFIXED64: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeSFixed64Size(number, 0); } break; case 15: // SINT32: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeSInt32Size(number, unsafe.getInt(message, offset)); } break; case 16: // SINT64: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeSInt64Size(number, unsafe.getLong(message, offset)); } break; case 17: // GROUP: - if (isFieldPresent( - message, i, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { + if ((currentPresenceField & presenceMask) != 0) { size += CodedOutputStream.computeGroupSize( number, @@ -1710,7 +1683,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1726,7 +1699,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1742,7 +1715,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1758,7 +1731,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1774,7 +1747,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1790,7 +1763,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1806,7 +1779,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1822,7 +1795,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1838,7 +1811,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1854,7 +1827,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1870,7 +1843,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1886,7 +1859,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1902,7 +1875,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1918,7 +1891,7 @@ final class MessageSchema implements Schema { (List) unsafe.getObject(message, offset)); if (fieldSize > 0) { if (useCachedSizeField) { - unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + unsafe.putInt(message, (long) presenceMaskAndOffset, fieldSize); } size += CodedOutputStream.computeTagSize(number) @@ -1935,7 +1908,7 @@ final class MessageSchema implements Schema { getMessageFieldSchema(i)); break; case 50: // MAP: - // TODO: Use schema cache. + // TODO(dweis): Use schema cache. size += mapFieldSchema.getSerializedSize( number, unsafe.getObject(message, offset), getMapFieldDefaultEntry(i)); @@ -2056,413 +2029,1380 @@ final class MessageSchema implements Schema { return size; } - private int getUnknownFieldsSerializedSize( - UnknownFieldSchema schema, T message) { - UT unknowns = schema.getFromMessage(message); - return schema.getSerializedSize(unknowns); - } - - @Override - // TODO: Consider serializing oneof fields last so that only one entry per - // oneof is actually serialized. This would mean that we would violate the serialization order - // contract. It should also be noted that Go currently does this. - public void writeTo(T message, Writer writer) throws IOException { - if (writer.fieldOrder() == Writer.FieldOrder.DESCENDING) { - writeFieldsInDescendingOrder(message, writer); - } else { - writeFieldsInAscendingOrder(message, writer); - } - } - - @SuppressWarnings("unchecked") - private void writeFieldsInAscendingOrder(T message, Writer writer) throws IOException { - Iterator> extensionIterator = null; - Map.Entry nextExtension = null; - if (hasExtensions) { - FieldSet extensions = extensionSchema.getExtensions(message); - if (!extensions.isEmpty()) { - extensionIterator = extensions.iterator(); - nextExtension = extensionIterator.next(); - } - } - - int currentPresenceFieldOffset = NO_PRESENCE_SENTINEL; - int currentPresenceField = 0; - final int bufferLength = buffer.length; + private int getSerializedSizeProto3(T message) { final sun.misc.Unsafe unsafe = UNSAFE; - for (int pos = 0; pos < bufferLength; pos += INTS_PER_FIELD) { - final int typeAndOffset = typeAndOffsetAt(pos); - final int number = numberAt(pos); + int size = 0; + for (int i = 0; i < buffer.length; i += INTS_PER_FIELD) { + final int typeAndOffset = typeAndOffsetAt(i); final int fieldType = type(typeAndOffset); + final int number = numberAt(i); - int presenceMask = 0; - if (fieldType <= 17) { - int presenceMaskAndOffset = buffer[pos + 2]; - final int presenceFieldOffset = presenceMaskAndOffset & OFFSET_MASK; - - // Performance optimization to cache the presence field which is shared for multiple - // fields. - // TODO: Improve caching for case when fields alternate between having and not - // having presence by caching presence field for last field with presence only. - if (presenceFieldOffset != currentPresenceFieldOffset) { - currentPresenceFieldOffset = presenceFieldOffset; - currentPresenceField = - currentPresenceFieldOffset == NO_PRESENCE_SENTINEL - ? 0 - : unsafe.getInt(message, (long) presenceFieldOffset); - } - // Mask for presence bit of the current field from the shared presence field. - presenceMask = 1 << (presenceMaskAndOffset >>> OFFSET_BITS); - } - - // Write any extensions that need to be written before the current field. - while (nextExtension != null && extensionSchema.extensionNumber(nextExtension) <= number) { - extensionSchema.serializeExtension(writer, nextExtension); - nextExtension = extensionIterator.hasNext() ? extensionIterator.next() : null; - } final long offset = offset(typeAndOffset); + final int cachedSizeOffset = + fieldType >= FieldType.DOUBLE_LIST_PACKED.id() + && fieldType <= FieldType.SINT64_LIST_PACKED.id() + ? buffer[i + 2] & OFFSET_MASK + : 0; switch (fieldType) { case 0: // DOUBLE: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeDouble(number, doubleAt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeDoubleSize(number, 0); } break; case 1: // FLOAT: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeFloat(number, floatAt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeFloatSize(number, 0); } break; case 2: // INT64: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeInt64(number, unsafe.getLong(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeInt64Size(number, UnsafeUtil.getLong(message, offset)); } break; case 3: // UINT64: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeUInt64(number, unsafe.getLong(message, offset)); + if (isFieldPresent(message, i)) { + size += + CodedOutputStream.computeUInt64Size(number, UnsafeUtil.getLong(message, offset)); } break; case 4: // INT32: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeInt32(number, unsafe.getInt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeInt32Size(number, UnsafeUtil.getInt(message, offset)); } break; case 5: // FIXED64: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeFixed64(number, unsafe.getLong(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeFixed64Size(number, 0); } break; case 6: // FIXED32: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeFixed32(number, unsafe.getInt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeFixed32Size(number, 0); } break; case 7: // BOOL: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeBool(number, booleanAt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeBoolSize(number, true); } break; case 8: // STRING: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writeString(number, unsafe.getObject(message, offset), writer); + if (isFieldPresent(message, i)) { + Object value = UnsafeUtil.getObject(message, offset); + if (value instanceof ByteString) { + size += CodedOutputStream.computeBytesSize(number, (ByteString) value); + } else { + size += CodedOutputStream.computeStringSize(number, (String) value); + } } break; case 9: // MESSAGE: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - Object value = unsafe.getObject(message, offset); - writer.writeMessage(number, value, getMessageFieldSchema(pos)); + if (isFieldPresent(message, i)) { + Object value = UnsafeUtil.getObject(message, offset); + size += SchemaUtil.computeSizeMessage(number, value, getMessageFieldSchema(i)); } break; case 10: // BYTES: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeBytes(number, (ByteString) unsafe.getObject(message, offset)); + if (isFieldPresent(message, i)) { + ByteString value = (ByteString) UnsafeUtil.getObject(message, offset); + size += CodedOutputStream.computeBytesSize(number, value); } break; case 11: // UINT32: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeUInt32(number, unsafe.getInt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeUInt32Size(number, UnsafeUtil.getInt(message, offset)); } break; case 12: // ENUM: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeEnum(number, unsafe.getInt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeEnumSize(number, UnsafeUtil.getInt(message, offset)); } break; case 13: // SFIXED32: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeSFixed32(number, unsafe.getInt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeSFixed32Size(number, 0); } break; case 14: // SFIXED64: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeSFixed64(number, unsafe.getLong(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeSFixed64Size(number, 0); } break; case 15: // SINT32: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeSInt32(number, unsafe.getInt(message, offset)); + if (isFieldPresent(message, i)) { + size += CodedOutputStream.computeSInt32Size(number, UnsafeUtil.getInt(message, offset)); } break; case 16: // SINT64: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeSInt64(number, unsafe.getLong(message, offset)); + if (isFieldPresent(message, i)) { + size += + CodedOutputStream.computeSInt64Size(number, UnsafeUtil.getLong(message, offset)); } break; case 17: // GROUP: - if (isFieldPresent( - message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { - writer.writeGroup( - number, unsafe.getObject(message, offset), getMessageFieldSchema(pos)); + if (isFieldPresent(message, i)) { + size += + CodedOutputStream.computeGroupSize( + number, + (MessageLite) UnsafeUtil.getObject(message, offset), + getMessageFieldSchema(i)); } break; case 18: // DOUBLE_LIST: - SchemaUtil.writeDoubleList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += SchemaUtil.computeSizeFixed64List(number, listAt(message, offset), false); break; case 19: // FLOAT_LIST: - SchemaUtil.writeFloatList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += SchemaUtil.computeSizeFixed32List(number, listAt(message, offset), false); break; case 20: // INT64_LIST: - SchemaUtil.writeInt64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += + SchemaUtil.computeSizeInt64List(number, (List) listAt(message, offset), false); break; case 21: // UINT64_LIST: - SchemaUtil.writeUInt64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += + SchemaUtil.computeSizeUInt64List(number, (List) listAt(message, offset), false); break; case 22: // INT32_LIST: - SchemaUtil.writeInt32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += + SchemaUtil.computeSizeInt32List( + number, (List) listAt(message, offset), false); break; case 23: // FIXED64_LIST: - SchemaUtil.writeFixed64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += SchemaUtil.computeSizeFixed64List(number, listAt(message, offset), false); break; case 24: // FIXED32_LIST: - SchemaUtil.writeFixed32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += SchemaUtil.computeSizeFixed32List(number, listAt(message, offset), false); break; case 25: // BOOL_LIST: - SchemaUtil.writeBoolList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += SchemaUtil.computeSizeBoolList(number, listAt(message, offset), false); break; case 26: // STRING_LIST: - SchemaUtil.writeStringList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer); + size += SchemaUtil.computeSizeStringList(number, listAt(message, offset)); break; case 27: // MESSAGE_LIST: - SchemaUtil.writeMessageList( - numberAt(pos), - (List) unsafe.getObject(message, offset), - writer, - getMessageFieldSchema(pos)); + size += + SchemaUtil.computeSizeMessageList( + number, listAt(message, offset), getMessageFieldSchema(i)); break; case 28: // BYTES_LIST: - SchemaUtil.writeBytesList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer); + size += + SchemaUtil.computeSizeByteStringList( + number, (List) listAt(message, offset)); break; case 29: // UINT32_LIST: - SchemaUtil.writeUInt32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += + SchemaUtil.computeSizeUInt32List( + number, (List) listAt(message, offset), false); break; case 30: // ENUM_LIST: - SchemaUtil.writeEnumList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += + SchemaUtil.computeSizeEnumList( + number, (List) listAt(message, offset), false); break; case 31: // SFIXED32_LIST: - SchemaUtil.writeSFixed32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += SchemaUtil.computeSizeFixed32List(number, listAt(message, offset), false); break; case 32: // SFIXED64_LIST: - SchemaUtil.writeSFixed64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += SchemaUtil.computeSizeFixed64List(number, listAt(message, offset), false); break; case 33: // SINT32_LIST: - SchemaUtil.writeSInt32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + size += + SchemaUtil.computeSizeSInt32List( + number, (List) listAt(message, offset), false); break; case 34: // SINT64_LIST: - SchemaUtil.writeSInt64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); - break; - case 35: // DOUBLE_LIST_PACKED: - // TODO: Make use of cached field size to speed up serialization. - SchemaUtil.writeDoubleList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); - break; - case 36: // FLOAT_LIST_PACKED: - SchemaUtil.writeFloatList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); - break; - case 37: // INT64_LIST_PACKED: - SchemaUtil.writeInt64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); - break; - case 38: // UINT64_LIST_PACKED: - SchemaUtil.writeUInt64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); - break; - case 39: // INT32_LIST_PACKED: - SchemaUtil.writeInt32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); - break; - case 40: // FIXED64_LIST_PACKED: - SchemaUtil.writeFixed64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); - break; - case 41: // FIXED32_LIST_PACKED: - SchemaUtil.writeFixed32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); - - break; - case 42: // BOOL_LIST_PACKED: - SchemaUtil.writeBoolList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + size += + SchemaUtil.computeSizeSInt64List(number, (List) listAt(message, offset), false); break; - case 43: // UINT32_LIST_PACKED: - SchemaUtil.writeUInt32List( + case 35: + { // DOUBLE_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeFixed64ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 36: + { // FLOAT_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeFixed32ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 37: + { // INT64_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeInt64ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 38: + { // UINT64_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeUInt64ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 39: + { // INT32_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeInt32ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 40: + { // FIXED64_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeFixed64ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 41: + { // FIXED32_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeFixed32ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 42: + { // BOOL_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeBoolListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 43: + { // UINT32_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeUInt32ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 44: + { // ENUM_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeEnumListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 45: + { // SFIXED32_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeFixed32ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 46: + { // SFIXED64_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeFixed64ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 47: + { // SINT32_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeSInt32ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 48: + { // SINT64_LIST_PACKED: + int fieldSize = + SchemaUtil.computeSizeSInt64ListNoTag( + (List) unsafe.getObject(message, offset)); + if (fieldSize > 0) { + if (useCachedSizeField) { + unsafe.putInt(message, (long) cachedSizeOffset, fieldSize); + } + size += + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeUInt32SizeNoTag(fieldSize) + + fieldSize; + } + break; + } + case 49: // GROUP_LIST: + size += + SchemaUtil.computeSizeGroupList( + number, (List) listAt(message, offset), getMessageFieldSchema(i)); + break; + case 50: // MAP: + // TODO(dweis): Use schema cache. + size += + mapFieldSchema.getSerializedSize( + number, UnsafeUtil.getObject(message, offset), getMapFieldDefaultEntry(i)); + break; + case 51: // ONEOF_DOUBLE: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeDoubleSize(number, 0); + } + break; + case 52: // ONEOF_FLOAT: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeFloatSize(number, 0); + } + break; + case 53: // ONEOF_INT64: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeInt64Size(number, oneofLongAt(message, offset)); + } + break; + case 54: // ONEOF_UINT64: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeUInt64Size(number, oneofLongAt(message, offset)); + } + break; + case 55: // ONEOF_INT32: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeInt32Size(number, oneofIntAt(message, offset)); + } + break; + case 56: // ONEOF_FIXED64: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeFixed64Size(number, 0); + } + break; + case 57: // ONEOF_FIXED32: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeFixed32Size(number, 0); + } + break; + case 58: // ONEOF_BOOL: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeBoolSize(number, true); + } + break; + case 59: // ONEOF_STRING: + if (isOneofPresent(message, number, i)) { + Object value = UnsafeUtil.getObject(message, offset); + if (value instanceof ByteString) { + size += CodedOutputStream.computeBytesSize(number, (ByteString) value); + } else { + size += CodedOutputStream.computeStringSize(number, (String) value); + } + } + break; + case 60: // ONEOF_MESSAGE: + if (isOneofPresent(message, number, i)) { + Object value = UnsafeUtil.getObject(message, offset); + size += SchemaUtil.computeSizeMessage(number, value, getMessageFieldSchema(i)); + } + break; + case 61: // ONEOF_BYTES: + if (isOneofPresent(message, number, i)) { + size += + CodedOutputStream.computeBytesSize( + number, (ByteString) UnsafeUtil.getObject(message, offset)); + } + break; + case 62: // ONEOF_UINT32: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeUInt32Size(number, oneofIntAt(message, offset)); + } + break; + case 63: // ONEOF_ENUM: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeEnumSize(number, oneofIntAt(message, offset)); + } + break; + case 64: // ONEOF_SFIXED32: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeSFixed32Size(number, 0); + } + break; + case 65: // ONEOF_SFIXED64: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeSFixed64Size(number, 0); + } + break; + case 66: // ONEOF_SINT32: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeSInt32Size(number, oneofIntAt(message, offset)); + } + break; + case 67: // ONEOF_SINT64: + if (isOneofPresent(message, number, i)) { + size += CodedOutputStream.computeSInt64Size(number, oneofLongAt(message, offset)); + } + break; + case 68: // ONEOF_GROUP: + if (isOneofPresent(message, number, i)) { + size += + CodedOutputStream.computeGroupSize( + number, + (MessageLite) UnsafeUtil.getObject(message, offset), + getMessageFieldSchema(i)); + } + break; + default: + // Assume it's an empty entry. + } + } + + size += getUnknownFieldsSerializedSize(unknownFieldSchema, message); + + return size; + } + + private int getUnknownFieldsSerializedSize( + UnknownFieldSchema schema, T message) { + UT unknowns = schema.getFromMessage(message); + return schema.getSerializedSize(unknowns); + } + + private static List listAt(Object message, long offset) { + return (List) UnsafeUtil.getObject(message, offset); + } + + @SuppressWarnings("unchecked") + @Override + // TODO(nathanmittler): Consider serializing oneof fields last so that only one entry per + // oneof is actually serialized. This would mean that we would violate the serialization order + // contract. It should also be noted that Go currently does this. + public void writeTo(T message, Writer writer) throws IOException { + if (writer.fieldOrder() == Writer.FieldOrder.DESCENDING) { + writeFieldsInDescendingOrder(message, writer); + } else { + if (proto3) { + writeFieldsInAscendingOrderProto3(message, writer); + } else { + writeFieldsInAscendingOrderProto2(message, writer); + } + } + } + + @SuppressWarnings("unchecked") + private void writeFieldsInAscendingOrderProto2(T message, Writer writer) throws IOException { + Iterator> extensionIterator = null; + Map.Entry nextExtension = null; + if (hasExtensions) { + FieldSet extensions = extensionSchema.getExtensions(message); + if (!extensions.isEmpty()) { + extensionIterator = extensions.iterator(); + nextExtension = extensionIterator.next(); + } + } + int currentPresenceFieldOffset = NO_PRESENCE_SENTINEL; + int currentPresenceField = 0; + final int bufferLength = buffer.length; + final sun.misc.Unsafe unsafe = UNSAFE; + for (int pos = 0; pos < bufferLength; pos += INTS_PER_FIELD) { + final int typeAndOffset = typeAndOffsetAt(pos); + final int number = numberAt(pos); + final int fieldType = type(typeAndOffset); + + int presenceMaskAndOffset = 0; + int presenceMask = 0; + if (fieldType <= 17) { + presenceMaskAndOffset = buffer[pos + 2]; + final int presenceFieldOffset = presenceMaskAndOffset & OFFSET_MASK; + if (presenceFieldOffset != currentPresenceFieldOffset) { + currentPresenceFieldOffset = presenceFieldOffset; + currentPresenceField = unsafe.getInt(message, (long) presenceFieldOffset); + } + presenceMask = 1 << (presenceMaskAndOffset >>> OFFSET_BITS); + } + + // Write any extensions that need to be written before the current field. + while (nextExtension != null && extensionSchema.extensionNumber(nextExtension) <= number) { + extensionSchema.serializeExtension(writer, nextExtension); + nextExtension = extensionIterator.hasNext() ? extensionIterator.next() : null; + } + final long offset = offset(typeAndOffset); + + switch (fieldType) { + case 0: // DOUBLE: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeDouble(number, doubleAt(message, offset)); + } + break; + case 1: // FLOAT: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeFloat(number, floatAt(message, offset)); + } + break; + case 2: // INT64: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeInt64(number, unsafe.getLong(message, offset)); + } + break; + case 3: // UINT64: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeUInt64(number, unsafe.getLong(message, offset)); + } + break; + case 4: // INT32: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeInt32(number, unsafe.getInt(message, offset)); + } + break; + case 5: // FIXED64: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeFixed64(number, unsafe.getLong(message, offset)); + } + break; + case 6: // FIXED32: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeFixed32(number, unsafe.getInt(message, offset)); + } + break; + case 7: // BOOL: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeBool(number, booleanAt(message, offset)); + } + break; + case 8: // STRING: + if ((currentPresenceField & presenceMask) != 0) { + writeString(number, unsafe.getObject(message, offset), writer); + } + break; + case 9: // MESSAGE: + if ((currentPresenceField & presenceMask) != 0) { + Object value = unsafe.getObject(message, offset); + writer.writeMessage(number, value, getMessageFieldSchema(pos)); + } + break; + case 10: // BYTES: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeBytes(number, (ByteString) unsafe.getObject(message, offset)); + } + break; + case 11: // UINT32: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeUInt32(number, unsafe.getInt(message, offset)); + } + break; + case 12: // ENUM: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeEnum(number, unsafe.getInt(message, offset)); + } + break; + case 13: // SFIXED32: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeSFixed32(number, unsafe.getInt(message, offset)); + } + break; + case 14: // SFIXED64: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeSFixed64(number, unsafe.getLong(message, offset)); + } + break; + case 15: // SINT32: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeSInt32(number, unsafe.getInt(message, offset)); + } + break; + case 16: // SINT64: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeSInt64(number, unsafe.getLong(message, offset)); + } + break; + case 17: // GROUP: + if ((currentPresenceField & presenceMask) != 0) { + writer.writeGroup( + number, unsafe.getObject(message, offset), getMessageFieldSchema(pos)); + } + break; + case 18: // DOUBLE_LIST: + SchemaUtil.writeDoubleList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 19: // FLOAT_LIST: + SchemaUtil.writeFloatList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 20: // INT64_LIST: + SchemaUtil.writeInt64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 21: // UINT64_LIST: + SchemaUtil.writeUInt64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 22: // INT32_LIST: + SchemaUtil.writeInt32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 23: // FIXED64_LIST: + SchemaUtil.writeFixed64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 24: // FIXED32_LIST: + SchemaUtil.writeFixed32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 25: // BOOL_LIST: + SchemaUtil.writeBoolList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 26: // STRING_LIST: + SchemaUtil.writeStringList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer); + break; + case 27: // MESSAGE_LIST: + SchemaUtil.writeMessageList( + numberAt(pos), + (List) unsafe.getObject(message, offset), + writer, + getMessageFieldSchema(pos)); + break; + case 28: // BYTES_LIST: + SchemaUtil.writeBytesList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer); + break; + case 29: // UINT32_LIST: + SchemaUtil.writeUInt32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 30: // ENUM_LIST: + SchemaUtil.writeEnumList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 31: // SFIXED32_LIST: + SchemaUtil.writeSFixed32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 32: // SFIXED64_LIST: + SchemaUtil.writeSFixed64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 33: // SINT32_LIST: + SchemaUtil.writeSInt32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 34: // SINT64_LIST: + SchemaUtil.writeSInt64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, false); + break; + case 35: // DOUBLE_LIST_PACKED: + // TODO(xiaofeng): Make use of cached field size to speed up serialization. + SchemaUtil.writeDoubleList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 36: // FLOAT_LIST_PACKED: + SchemaUtil.writeFloatList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 37: // INT64_LIST_PACKED: + SchemaUtil.writeInt64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 38: // UINT64_LIST_PACKED: + SchemaUtil.writeUInt64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 39: // INT32_LIST_PACKED: + SchemaUtil.writeInt32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 40: // FIXED64_LIST_PACKED: + SchemaUtil.writeFixed64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 41: // FIXED32_LIST_PACKED: + SchemaUtil.writeFixed32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + + break; + case 42: // BOOL_LIST_PACKED: + SchemaUtil.writeBoolList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 43: // UINT32_LIST_PACKED: + SchemaUtil.writeUInt32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 44: // ENUM_LIST_PACKED: + SchemaUtil.writeEnumList( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 45: // SFIXED32_LIST_PACKED: + SchemaUtil.writeSFixed32List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 46: // SFIXED64_LIST_PACKED: + SchemaUtil.writeSFixed64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 47: // SINT32_LIST_PACKED: + SchemaUtil.writeSInt32List( numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); break; + case 48: // SINT64_LIST_PACKED: + SchemaUtil.writeSInt64List( + numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + break; + case 49: // GROUP_LIST: + SchemaUtil.writeGroupList( + numberAt(pos), + (List) unsafe.getObject(message, offset), + writer, + getMessageFieldSchema(pos)); + break; + case 50: // MAP: + // TODO(dweis): Use schema cache. + writeMapHelper(writer, number, unsafe.getObject(message, offset), pos); + break; + case 51: // ONEOF_DOUBLE: + if (isOneofPresent(message, number, pos)) { + writer.writeDouble(number, oneofDoubleAt(message, offset)); + } + break; + case 52: // ONEOF_FLOAT: + if (isOneofPresent(message, number, pos)) { + writer.writeFloat(number, oneofFloatAt(message, offset)); + } + break; + case 53: // ONEOF_INT64: + if (isOneofPresent(message, number, pos)) { + writer.writeInt64(number, oneofLongAt(message, offset)); + } + break; + case 54: // ONEOF_UINT64: + if (isOneofPresent(message, number, pos)) { + writer.writeUInt64(number, oneofLongAt(message, offset)); + } + break; + case 55: // ONEOF_INT32: + if (isOneofPresent(message, number, pos)) { + writer.writeInt32(number, oneofIntAt(message, offset)); + } + break; + case 56: // ONEOF_FIXED64: + if (isOneofPresent(message, number, pos)) { + writer.writeFixed64(number, oneofLongAt(message, offset)); + } + break; + case 57: // ONEOF_FIXED32: + if (isOneofPresent(message, number, pos)) { + writer.writeFixed32(number, oneofIntAt(message, offset)); + } + break; + case 58: // ONEOF_BOOL: + if (isOneofPresent(message, number, pos)) { + writer.writeBool(number, oneofBooleanAt(message, offset)); + } + break; + case 59: // ONEOF_STRING: + if (isOneofPresent(message, number, pos)) { + writeString(number, unsafe.getObject(message, offset), writer); + } + break; + case 60: // ONEOF_MESSAGE: + if (isOneofPresent(message, number, pos)) { + Object value = unsafe.getObject(message, offset); + writer.writeMessage(number, value, getMessageFieldSchema(pos)); + } + break; + case 61: // ONEOF_BYTES: + if (isOneofPresent(message, number, pos)) { + writer.writeBytes(number, (ByteString) unsafe.getObject(message, offset)); + } + break; + case 62: // ONEOF_UINT32: + if (isOneofPresent(message, number, pos)) { + writer.writeUInt32(number, oneofIntAt(message, offset)); + } + break; + case 63: // ONEOF_ENUM: + if (isOneofPresent(message, number, pos)) { + writer.writeEnum(number, oneofIntAt(message, offset)); + } + break; + case 64: // ONEOF_SFIXED32: + if (isOneofPresent(message, number, pos)) { + writer.writeSFixed32(number, oneofIntAt(message, offset)); + } + break; + case 65: // ONEOF_SFIXED64: + if (isOneofPresent(message, number, pos)) { + writer.writeSFixed64(number, oneofLongAt(message, offset)); + } + break; + case 66: // ONEOF_SINT32: + if (isOneofPresent(message, number, pos)) { + writer.writeSInt32(number, oneofIntAt(message, offset)); + } + break; + case 67: // ONEOF_SINT64: + if (isOneofPresent(message, number, pos)) { + writer.writeSInt64(number, oneofLongAt(message, offset)); + } + break; + case 68: // ONEOF_GROUP: + if (isOneofPresent(message, number, pos)) { + writer.writeGroup( + number, unsafe.getObject(message, offset), getMessageFieldSchema(pos)); + } + break; + default: + // Assume it's an empty entry - just go to the next entry. + break; + } + } + while (nextExtension != null) { + extensionSchema.serializeExtension(writer, nextExtension); + nextExtension = extensionIterator.hasNext() ? extensionIterator.next() : null; + } + writeUnknownInMessageTo(unknownFieldSchema, message, writer); + } + + @SuppressWarnings("unchecked") + private void writeFieldsInAscendingOrderProto3(T message, Writer writer) throws IOException { + Iterator> extensionIterator = null; + Map.Entry nextExtension = null; + if (hasExtensions) { + FieldSet extensions = extensionSchema.getExtensions(message); + if (!extensions.isEmpty()) { + extensionIterator = extensions.iterator(); + nextExtension = extensionIterator.next(); + } + } + final int bufferLength = buffer.length; + for (int pos = 0; pos < bufferLength; pos += INTS_PER_FIELD) { + final int typeAndOffset = typeAndOffsetAt(pos); + final int number = numberAt(pos); + + // Write any extensions that need to be written before the current field. + while (nextExtension != null && extensionSchema.extensionNumber(nextExtension) <= number) { + extensionSchema.serializeExtension(writer, nextExtension); + nextExtension = extensionIterator.hasNext() ? extensionIterator.next() : null; + } + + switch (type(typeAndOffset)) { + case 0: // DOUBLE: + if (isFieldPresent(message, pos)) { + writer.writeDouble(number, doubleAt(message, offset(typeAndOffset))); + } + break; + case 1: // FLOAT: + if (isFieldPresent(message, pos)) { + writer.writeFloat(number, floatAt(message, offset(typeAndOffset))); + } + break; + case 2: // INT64: + if (isFieldPresent(message, pos)) { + writer.writeInt64(number, longAt(message, offset(typeAndOffset))); + } + break; + case 3: // UINT64: + if (isFieldPresent(message, pos)) { + writer.writeUInt64(number, longAt(message, offset(typeAndOffset))); + } + break; + case 4: // INT32: + if (isFieldPresent(message, pos)) { + writer.writeInt32(number, intAt(message, offset(typeAndOffset))); + } + break; + case 5: // FIXED64: + if (isFieldPresent(message, pos)) { + writer.writeFixed64(number, longAt(message, offset(typeAndOffset))); + } + break; + case 6: // FIXED32: + if (isFieldPresent(message, pos)) { + writer.writeFixed32(number, intAt(message, offset(typeAndOffset))); + } + break; + case 7: // BOOL: + if (isFieldPresent(message, pos)) { + writer.writeBool(number, booleanAt(message, offset(typeAndOffset))); + } + break; + case 8: // STRING: + if (isFieldPresent(message, pos)) { + writeString(number, UnsafeUtil.getObject(message, offset(typeAndOffset)), writer); + } + break; + case 9: // MESSAGE: + if (isFieldPresent(message, pos)) { + Object value = UnsafeUtil.getObject(message, offset(typeAndOffset)); + writer.writeMessage(number, value, getMessageFieldSchema(pos)); + } + break; + case 10: // BYTES: + if (isFieldPresent(message, pos)) { + writer.writeBytes( + number, (ByteString) UnsafeUtil.getObject(message, offset(typeAndOffset))); + } + break; + case 11: // UINT32: + if (isFieldPresent(message, pos)) { + writer.writeUInt32(number, intAt(message, offset(typeAndOffset))); + } + break; + case 12: // ENUM: + if (isFieldPresent(message, pos)) { + writer.writeEnum(number, intAt(message, offset(typeAndOffset))); + } + break; + case 13: // SFIXED32: + if (isFieldPresent(message, pos)) { + writer.writeSFixed32(number, intAt(message, offset(typeAndOffset))); + } + break; + case 14: // SFIXED64: + if (isFieldPresent(message, pos)) { + writer.writeSFixed64(number, longAt(message, offset(typeAndOffset))); + } + break; + case 15: // SINT32: + if (isFieldPresent(message, pos)) { + writer.writeSInt32(number, intAt(message, offset(typeAndOffset))); + } + break; + case 16: // SINT64: + if (isFieldPresent(message, pos)) { + writer.writeSInt64(number, longAt(message, offset(typeAndOffset))); + } + break; + case 17: // GROUP: + if (isFieldPresent(message, pos)) { + writer.writeGroup( + number, + UnsafeUtil.getObject(message, offset(typeAndOffset)), + getMessageFieldSchema(pos)); + } + break; + case 18: // DOUBLE_LIST: + SchemaUtil.writeDoubleList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 19: // FLOAT_LIST: + SchemaUtil.writeFloatList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 20: // INT64_LIST: + SchemaUtil.writeInt64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 21: // UINT64_LIST: + SchemaUtil.writeUInt64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 22: // INT32_LIST: + SchemaUtil.writeInt32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 23: // FIXED64_LIST: + SchemaUtil.writeFixed64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 24: // FIXED32_LIST: + SchemaUtil.writeFixed32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 25: // BOOL_LIST: + SchemaUtil.writeBoolList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 26: // STRING_LIST: + SchemaUtil.writeStringList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer); + break; + case 27: // MESSAGE_LIST: + SchemaUtil.writeMessageList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + getMessageFieldSchema(pos)); + break; + case 28: // BYTES_LIST: + SchemaUtil.writeBytesList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer); + break; + case 29: // UINT32_LIST: + SchemaUtil.writeUInt32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 30: // ENUM_LIST: + SchemaUtil.writeEnumList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 31: // SFIXED32_LIST: + SchemaUtil.writeSFixed32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 32: // SFIXED64_LIST: + SchemaUtil.writeSFixed64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 33: // SINT32_LIST: + SchemaUtil.writeSInt32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 34: // SINT64_LIST: + SchemaUtil.writeSInt64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + false); + break; + case 35: // DOUBLE_LIST_PACKED: + // TODO(xiaofeng): Make use of cached field size to speed up serialization. + SchemaUtil.writeDoubleList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; + case 36: // FLOAT_LIST_PACKED: + SchemaUtil.writeFloatList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; + case 37: // INT64_LIST_PACKED: + SchemaUtil.writeInt64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; + case 38: // UINT64_LIST_PACKED: + SchemaUtil.writeUInt64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; + case 39: // INT32_LIST_PACKED: + SchemaUtil.writeInt32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; + case 40: // FIXED64_LIST_PACKED: + SchemaUtil.writeFixed64List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; + case 41: // FIXED32_LIST_PACKED: + SchemaUtil.writeFixed32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + + break; + case 42: // BOOL_LIST_PACKED: + SchemaUtil.writeBoolList( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; + case 43: // UINT32_LIST_PACKED: + SchemaUtil.writeUInt32List( + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); + break; case 44: // ENUM_LIST_PACKED: SchemaUtil.writeEnumList( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); break; case 45: // SFIXED32_LIST_PACKED: SchemaUtil.writeSFixed32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); break; case 46: // SFIXED64_LIST_PACKED: SchemaUtil.writeSFixed64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); break; case 47: // SINT32_LIST_PACKED: SchemaUtil.writeSInt32List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); break; case 48: // SINT64_LIST_PACKED: SchemaUtil.writeSInt64List( - numberAt(pos), (List) unsafe.getObject(message, offset), writer, true); + numberAt(pos), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), + writer, + true); break; case 49: // GROUP_LIST: SchemaUtil.writeGroupList( numberAt(pos), - (List) unsafe.getObject(message, offset), + (List) UnsafeUtil.getObject(message, offset(typeAndOffset)), writer, getMessageFieldSchema(pos)); break; case 50: // MAP: - // TODO: Use schema cache. - writeMapHelper(writer, number, unsafe.getObject(message, offset), pos); + // TODO(dweis): Use schema cache. + writeMapHelper(writer, number, UnsafeUtil.getObject(message, offset(typeAndOffset)), pos); break; case 51: // ONEOF_DOUBLE: if (isOneofPresent(message, number, pos)) { - writer.writeDouble(number, oneofDoubleAt(message, offset)); + writer.writeDouble(number, oneofDoubleAt(message, offset(typeAndOffset))); } break; case 52: // ONEOF_FLOAT: if (isOneofPresent(message, number, pos)) { - writer.writeFloat(number, oneofFloatAt(message, offset)); + writer.writeFloat(number, oneofFloatAt(message, offset(typeAndOffset))); } break; case 53: // ONEOF_INT64: if (isOneofPresent(message, number, pos)) { - writer.writeInt64(number, oneofLongAt(message, offset)); + writer.writeInt64(number, oneofLongAt(message, offset(typeAndOffset))); } break; case 54: // ONEOF_UINT64: if (isOneofPresent(message, number, pos)) { - writer.writeUInt64(number, oneofLongAt(message, offset)); + writer.writeUInt64(number, oneofLongAt(message, offset(typeAndOffset))); } break; case 55: // ONEOF_INT32: if (isOneofPresent(message, number, pos)) { - writer.writeInt32(number, oneofIntAt(message, offset)); + writer.writeInt32(number, oneofIntAt(message, offset(typeAndOffset))); } break; case 56: // ONEOF_FIXED64: if (isOneofPresent(message, number, pos)) { - writer.writeFixed64(number, oneofLongAt(message, offset)); + writer.writeFixed64(number, oneofLongAt(message, offset(typeAndOffset))); } break; case 57: // ONEOF_FIXED32: if (isOneofPresent(message, number, pos)) { - writer.writeFixed32(number, oneofIntAt(message, offset)); + writer.writeFixed32(number, oneofIntAt(message, offset(typeAndOffset))); } break; case 58: // ONEOF_BOOL: if (isOneofPresent(message, number, pos)) { - writer.writeBool(number, oneofBooleanAt(message, offset)); + writer.writeBool(number, oneofBooleanAt(message, offset(typeAndOffset))); } break; case 59: // ONEOF_STRING: if (isOneofPresent(message, number, pos)) { - writeString(number, unsafe.getObject(message, offset), writer); + writeString(number, UnsafeUtil.getObject(message, offset(typeAndOffset)), writer); } break; case 60: // ONEOF_MESSAGE: if (isOneofPresent(message, number, pos)) { - Object value = unsafe.getObject(message, offset); + Object value = UnsafeUtil.getObject(message, offset(typeAndOffset)); writer.writeMessage(number, value, getMessageFieldSchema(pos)); } break; case 61: // ONEOF_BYTES: if (isOneofPresent(message, number, pos)) { - writer.writeBytes(number, (ByteString) unsafe.getObject(message, offset)); + writer.writeBytes( + number, (ByteString) UnsafeUtil.getObject(message, offset(typeAndOffset))); } break; case 62: // ONEOF_UINT32: if (isOneofPresent(message, number, pos)) { - writer.writeUInt32(number, oneofIntAt(message, offset)); + writer.writeUInt32(number, oneofIntAt(message, offset(typeAndOffset))); } break; case 63: // ONEOF_ENUM: if (isOneofPresent(message, number, pos)) { - writer.writeEnum(number, oneofIntAt(message, offset)); + writer.writeEnum(number, oneofIntAt(message, offset(typeAndOffset))); } break; case 64: // ONEOF_SFIXED32: if (isOneofPresent(message, number, pos)) { - writer.writeSFixed32(number, oneofIntAt(message, offset)); + writer.writeSFixed32(number, oneofIntAt(message, offset(typeAndOffset))); } break; case 65: // ONEOF_SFIXED64: if (isOneofPresent(message, number, pos)) { - writer.writeSFixed64(number, oneofLongAt(message, offset)); + writer.writeSFixed64(number, oneofLongAt(message, offset(typeAndOffset))); } break; case 66: // ONEOF_SINT32: if (isOneofPresent(message, number, pos)) { - writer.writeSInt32(number, oneofIntAt(message, offset)); + writer.writeSInt32(number, oneofIntAt(message, offset(typeAndOffset))); } break; case 67: // ONEOF_SINT64: if (isOneofPresent(message, number, pos)) { - writer.writeSInt64(number, oneofLongAt(message, offset)); + writer.writeSInt64(number, oneofLongAt(message, offset(typeAndOffset))); } break; case 68: // ONEOF_GROUP: if (isOneofPresent(message, number, pos)) { writer.writeGroup( - number, unsafe.getObject(message, offset), getMessageFieldSchema(pos)); + number, + UnsafeUtil.getObject(message, offset(typeAndOffset)), + getMessageFieldSchema(pos)); } break; default: @@ -2821,7 +3761,7 @@ final class MessageSchema implements Schema { getMessageFieldSchema(pos)); break; case 50: // MAP: - // TODO: Use schema cache. + // TODO(dweis): Use schema cache. writeMapHelper(writer, number, UnsafeUtil.getObject(message, offset(typeAndOffset)), pos); break; case 51: // ONEOF_DOUBLE: @@ -3417,7 +4357,7 @@ final class MessageSchema implements Schema { @SuppressWarnings("ReferenceEquality") static UnknownFieldSetLite getMutableUnknownFields(Object message) { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. UnknownFieldSetLite unknownFields = ((GeneratedMessageLite) message).unknownFields; if (unknownFields == UnknownFieldSetLite.getDefaultInstance()) { @@ -3923,14 +4863,13 @@ final class MessageSchema implements Schema { } /** - * Parses a message and returns the position after the message/group. If it's parsing a - * LENGTH_PREFIXED message (endDelimited == 0), returns limit if parsing is successful; If it's - * parsing a DELIMITED message aka group (endDelimited != 0), parsing ends when a tag == - * endDelimited is encountered and the position after that tag is returned. + * Parses a proto2 message or group and returns the position after the message/group. If it's + * parsing a message (endGroup == 0), returns limit if parsing is successful; It it's parsing a + * group (endGroup != 0), parsing ends when a tag == endGroup is encountered and the position + * after that tag is returned. */ - @CanIgnoreReturnValue - int parseMessage( - T message, byte[] data, int position, int limit, int endDelimited, Registers registers) + int parseProto2Message( + T message, byte[] data, int position, int limit, int endGroup, Registers registers) throws IOException { checkMutable(message); final sun.misc.Unsafe unsafe = UNSAFE; @@ -3961,23 +4900,18 @@ final class MessageSchema implements Schema { final int fieldType = type(typeAndOffset); final long fieldOffset = offset(typeAndOffset); if (fieldType <= 17) { - // Fields with explicit presence (i.e. optional) have has-bits. + // Proto2 optional fields have has-bits. final int presenceMaskAndOffset = buffer[pos + 2]; final int presenceMask = 1 << (presenceMaskAndOffset >>> OFFSET_BITS); final int presenceFieldOffset = presenceMaskAndOffset & OFFSET_MASK; - // We cache the 32-bit presence integer value and only write it back when parsing a field - // using a different presence integer. + // We cache the 32-bit has-bits integer value and only write it back when parsing a field + // using a different has-bits integer. if (presenceFieldOffset != currentPresenceFieldOffset) { if (currentPresenceFieldOffset != NO_PRESENCE_SENTINEL) { unsafe.putInt(message, (long) currentPresenceFieldOffset, currentPresenceField); } currentPresenceFieldOffset = presenceFieldOffset; - // For fields without presence, we unconditionally write and discard - // the data. - currentPresenceField = - presenceFieldOffset == NO_PRESENCE_SENTINEL - ? 0 - : unsafe.getInt(message, (long) presenceFieldOffset); + currentPresenceField = unsafe.getInt(message, (long) presenceFieldOffset); } switch (fieldType) { case 0: // DOUBLE @@ -4042,10 +4976,10 @@ final class MessageSchema implements Schema { break; case 8: // STRING if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { - if (isEnforceUtf8(typeAndOffset)) { - position = decodeStringRequireUtf8(data, position, registers); - } else { + if ((typeAndOffset & ENFORCE_UTF8_MASK) == 0) { position = decodeString(data, position, registers); + } else { + position = decodeStringRequireUtf8(data, position, registers); } unsafe.putObject(message, fieldOffset, registers.object1); currentPresenceField |= presenceMask; @@ -4076,14 +5010,10 @@ final class MessageSchema implements Schema { position = decodeVarint32(data, position, registers); final int enumValue = registers.int1; EnumVerifier enumVerifier = getEnumFieldVerifier(pos); - if (!isLegacyEnumIsClosed(typeAndOffset) - || enumVerifier == null - || enumVerifier.isInRange(enumValue)) { - // Parse open enums and in-range closed enums into their fields directly. + if (enumVerifier == null || enumVerifier.isInRange(enumValue)) { unsafe.putInt(message, fieldOffset, enumValue); currentPresenceField |= presenceMask; } else { - // Store out-of-range closed enums in unknown fields. // UnknownFieldSetLite requires varint to be represented as Long. getMutableUnknownFields(message).storeField(tag, (long) enumValue); } @@ -4131,7 +5061,7 @@ final class MessageSchema implements Schema { break; } } else if (fieldType == 27) { - // Handle repeated message field. + // Handle repeated message fields. if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { ProtobufList list = (ProtobufList) unsafe.getObject(message, fieldOffset); if (!list.isModifiable()) { @@ -4195,7 +5125,7 @@ final class MessageSchema implements Schema { } } } - if (tag == endDelimited && endDelimited != 0) { + if (tag == endGroup && endGroup != 0) { break; } @@ -4227,12 +5157,12 @@ final class MessageSchema implements Schema { ((UnknownFieldSchema) unknownFieldSchema) .setBuilderToMessage(message, unknownFields); } - if (endDelimited == 0) { + if (endGroup == 0) { if (position != limit) { throw InvalidProtocolBufferException.parseFailure(); } } else { - if (position > limit || tag != endDelimited) { + if (position > limit || tag != endGroup) { throw InvalidProtocolBufferException.parseFailure(); } } @@ -4294,10 +5224,262 @@ final class MessageSchema implements Schema { setOneofPresent(message, fieldNumber, pos); } + /** Parses a proto3 message and returns the limit if parsing is successful. */ + private int parseProto3Message( + T message, byte[] data, int position, int limit, Registers registers) throws IOException { + checkMutable(message); + final sun.misc.Unsafe unsafe = UNSAFE; + int currentPresenceFieldOffset = NO_PRESENCE_SENTINEL; + int currentPresenceField = 0; + int tag = 0; + int oldNumber = -1; + int pos = 0; + while (position < limit) { + tag = data[position++]; + if (tag < 0) { + position = decodeVarint32(tag, data, position, registers); + tag = registers.int1; + } + final int number = tag >>> 3; + final int wireType = tag & 0x7; + if (number > oldNumber) { + pos = positionForFieldNumber(number, pos / INTS_PER_FIELD); + } else { + pos = positionForFieldNumber(number); + } + oldNumber = number; + if (pos == -1) { + // need to reset + pos = 0; + } else { + final int typeAndOffset = buffer[pos + 1]; + final int fieldType = type(typeAndOffset); + final long fieldOffset = offset(typeAndOffset); + if (fieldType <= 17) { + // Proto3 optional fields have has-bits. + final int presenceMaskAndOffset = buffer[pos + 2]; + final int presenceMask = 1 << (presenceMaskAndOffset >>> OFFSET_BITS); + final int presenceFieldOffset = presenceMaskAndOffset & OFFSET_MASK; + // We cache the 32-bit has-bits integer value and only write it back when parsing a field + // using a different has-bits integer. + // + // Note that for fields that do not have hasbits, we unconditionally write and discard + // the data. + if (presenceFieldOffset != currentPresenceFieldOffset) { + if (currentPresenceFieldOffset != NO_PRESENCE_SENTINEL) { + unsafe.putInt(message, (long) currentPresenceFieldOffset, currentPresenceField); + } + if (presenceFieldOffset != NO_PRESENCE_SENTINEL) { + currentPresenceField = unsafe.getInt(message, (long) presenceFieldOffset); + } + currentPresenceFieldOffset = presenceFieldOffset; + } + switch (fieldType) { + case 0: // DOUBLE: + if (wireType == WireFormat.WIRETYPE_FIXED64) { + UnsafeUtil.putDouble(message, fieldOffset, decodeDouble(data, position)); + position += 8; + currentPresenceField |= presenceMask; + continue; + } + break; + case 1: // FLOAT: + if (wireType == WireFormat.WIRETYPE_FIXED32) { + UnsafeUtil.putFloat(message, fieldOffset, decodeFloat(data, position)); + position += 4; + currentPresenceField |= presenceMask; + continue; + } + break; + case 2: // INT64: + case 3: // UINT64: + if (wireType == WireFormat.WIRETYPE_VARINT) { + position = decodeVarint64(data, position, registers); + unsafe.putLong(message, fieldOffset, registers.long1); + currentPresenceField |= presenceMask; + continue; + } + break; + case 4: // INT32: + case 11: // UINT32: + if (wireType == WireFormat.WIRETYPE_VARINT) { + position = decodeVarint32(data, position, registers); + unsafe.putInt(message, fieldOffset, registers.int1); + currentPresenceField |= presenceMask; + continue; + } + break; + case 5: // FIXED64: + case 14: // SFIXED64: + if (wireType == WireFormat.WIRETYPE_FIXED64) { + unsafe.putLong(message, fieldOffset, decodeFixed64(data, position)); + position += 8; + currentPresenceField |= presenceMask; + continue; + } + break; + case 6: // FIXED32: + case 13: // SFIXED32: + if (wireType == WireFormat.WIRETYPE_FIXED32) { + unsafe.putInt(message, fieldOffset, decodeFixed32(data, position)); + position += 4; + currentPresenceField |= presenceMask; + continue; + } + break; + case 7: // BOOL: + if (wireType == WireFormat.WIRETYPE_VARINT) { + position = decodeVarint64(data, position, registers); + UnsafeUtil.putBoolean(message, fieldOffset, registers.long1 != 0); + currentPresenceField |= presenceMask; + continue; + } + break; + case 8: // STRING: + if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { + if ((typeAndOffset & ENFORCE_UTF8_MASK) == 0) { + position = decodeString(data, position, registers); + } else { + position = decodeStringRequireUtf8(data, position, registers); + } + unsafe.putObject(message, fieldOffset, registers.object1); + currentPresenceField |= presenceMask; + continue; + } + break; + case 9: // MESSAGE: + if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { + final Object current = mutableMessageFieldForMerge(message, pos); + position = + mergeMessageField( + current, getMessageFieldSchema(pos), data, position, limit, registers); + storeMessageField(message, pos, current); + currentPresenceField |= presenceMask; + continue; + } + break; + case 10: // BYTES: + if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { + position = decodeBytes(data, position, registers); + unsafe.putObject(message, fieldOffset, registers.object1); + currentPresenceField |= presenceMask; + continue; + } + break; + case 12: // ENUM: + if (wireType == WireFormat.WIRETYPE_VARINT) { + position = decodeVarint32(data, position, registers); + unsafe.putInt(message, fieldOffset, registers.int1); + currentPresenceField |= presenceMask; + continue; + } + break; + case 15: // SINT32: + if (wireType == WireFormat.WIRETYPE_VARINT) { + position = decodeVarint32(data, position, registers); + unsafe.putInt( + message, fieldOffset, CodedInputStream.decodeZigZag32(registers.int1)); + currentPresenceField |= presenceMask; + continue; + } + break; + case 16: // SINT64: + if (wireType == WireFormat.WIRETYPE_VARINT) { + position = decodeVarint64(data, position, registers); + unsafe.putLong( + message, fieldOffset, CodedInputStream.decodeZigZag64(registers.long1)); + currentPresenceField |= presenceMask; + continue; + } + break; + default: + break; + } + } else if (fieldType == 27) { + // Handle repeated message field. + if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { + ProtobufList list = (ProtobufList) unsafe.getObject(message, fieldOffset); + if (!list.isModifiable()) { + final int size = list.size(); + list = + list.mutableCopyWithCapacity( + size == 0 ? AbstractProtobufList.DEFAULT_CAPACITY : size * 2); + unsafe.putObject(message, fieldOffset, list); + } + position = + decodeMessageList( + getMessageFieldSchema(pos), tag, data, position, limit, list, registers); + continue; + } + } else if (fieldType <= 49) { + // Handle all other repeated fields. + final int oldPosition = position; + position = + parseRepeatedField( + message, + data, + position, + limit, + tag, + number, + wireType, + pos, + typeAndOffset, + fieldType, + fieldOffset, + registers); + if (position != oldPosition) { + continue; + } + } else if (fieldType == 50) { + if (wireType == WireFormat.WIRETYPE_LENGTH_DELIMITED) { + final int oldPosition = position; + position = parseMapField(message, data, position, limit, pos, fieldOffset, registers); + if (position != oldPosition) { + continue; + } + } + } else { + final int oldPosition = position; + position = + parseOneofField( + message, + data, + position, + limit, + tag, + number, + wireType, + typeAndOffset, + fieldType, + fieldOffset, + pos, + registers); + if (position != oldPosition) { + continue; + } + } + } + position = decodeUnknownField( + tag, data, position, limit, getMutableUnknownFields(message), registers); + } + if (currentPresenceFieldOffset != NO_PRESENCE_SENTINEL) { + unsafe.putInt(message, (long) currentPresenceFieldOffset, currentPresenceField); + } + if (position != limit) { + throw InvalidProtocolBufferException.parseFailure(); + } + return position; + } + @Override public void mergeFrom(T message, byte[] data, int position, int limit, Registers registers) throws IOException { - parseMessage(message, data, position, limit, 0, registers); + if (proto3) { + parseProto3Message(message, data, position, limit, registers); + } else { + parseProto2Message(message, data, position, limit, 0, registers); + } } @Override @@ -4306,7 +5488,7 @@ final class MessageSchema implements Schema { return; } - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (message instanceof GeneratedMessageLite) { GeneratedMessageLite generatedMessage = ((GeneratedMessageLite) message); @@ -4326,12 +5508,6 @@ final class MessageSchema implements Schema { getMessageFieldSchema(pos).makeImmutable(UNSAFE.getObject(message, offset)); } break; - case 60: // ONEOF_MESSAGE - case 68: // ONEOF_GROUP - if (isOneofPresent(message, numberAt(pos), pos)) { - getMessageFieldSchema(pos).makeImmutable(UNSAFE.getObject(message, offset)); - } - break; case 18: // DOUBLE_LIST: case 19: // FLOAT_LIST: case 20: // INT64_LIST: @@ -4392,7 +5568,7 @@ final class MessageSchema implements Schema { throws IOException { long offset = offset(typeAndOffsetAt(pos)); Object mapField = UnsafeUtil.getObject(message, offset); - // TODO: Consider creating separate implementations for full and lite. In lite + // TODO(xiaofeng): Consider creating separate implementations for full and lite. In lite // runtime map field will never be null but here we still need to check null because the // code is shared by both full and lite. It might be better if full/lite uses different // schema implementations. @@ -4499,7 +5675,7 @@ final class MessageSchema implements Schema { message, pos, currentPresenceFieldOffset, currentPresenceField, presenceMask)) { return false; } - // If a required message field is set but has no required fields of its own, we still + // If a required message field is set but has no required fields of it's own, we still // proceed and check the message is initialized. It should be fairly cheap to check these // messages but is worth documenting. } @@ -4577,7 +5753,7 @@ final class MessageSchema implements Schema { if (metadata.valueType.getJavaType() != WireFormat.JavaType.MESSAGE) { return true; } - // TODO: Use schema cache. + // TODO(dweis): Use schema cache. Schema schema = null; for (Object nested : map.values()) { if (schema == null) { @@ -4669,10 +5845,6 @@ final class MessageSchema implements Schema { return (value & ENFORCE_UTF8_MASK) != 0; } - private static boolean isLegacyEnumIsClosed(int value) { - return (value & LEGACY_ENUM_IS_CLOSED_MASK) != 0; - } - private static long offset(int value) { return value & OFFSET_MASK; } @@ -4682,7 +5854,7 @@ final class MessageSchema implements Schema { return false; } - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (message instanceof GeneratedMessageLite) { return ((GeneratedMessageLite) message).isMutable(); @@ -4761,9 +5933,9 @@ final class MessageSchema implements Schema { final long offset = offset(typeAndOffset); switch (type(typeAndOffset)) { case 0: // DOUBLE: - return Double.doubleToRawLongBits(UnsafeUtil.getDouble(message, offset)) != 0L; + return UnsafeUtil.getDouble(message, offset) != 0D; case 1: // FLOAT: - return Float.floatToRawIntBits(UnsafeUtil.getFloat(message, offset)) != 0; + return UnsafeUtil.getFloat(message, offset) != 0F; case 2: // INT64: return UnsafeUtil.getLong(message, offset) != 0L; case 3: // UINT64: diff --git a/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java b/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java index eec3acd35ca79ab5aafcf8cda4bdadba08c6798b..eae93b912f6c73df4e2baf62264122e8397a05ba 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java +++ b/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -12,7 +35,6 @@ import java.util.Iterator; import java.util.Map.Entry; /** Schema used for proto2 messages using message_set_wireformat. */ -@CheckReturnValue final class MessageSetSchema implements Schema { private final MessageLite defaultInstance; private final UnknownFieldSchema unknownFieldSchema; @@ -39,7 +61,7 @@ final class MessageSetSchema implements Schema { @SuppressWarnings("unchecked") @Override public T newInstance() { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (defaultInstance instanceof GeneratedMessageLite) { return (T) ((GeneratedMessageLite) defaultInstance).newMutableInstance(); @@ -116,7 +138,7 @@ final class MessageSetSchema implements Schema { public void mergeFrom( T message, byte[] data, int position, int limit, ArrayDecoders.Registers registers) throws IOException { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. UnknownFieldSetLite unknownFields = ((GeneratedMessageLite) message).unknownFields; if (unknownFields == UnknownFieldSetLite.getDefaultInstance()) { @@ -166,7 +188,7 @@ final class MessageSetSchema implements Schema { if (wireType == WireFormat.WIRETYPE_VARINT) { position = ArrayDecoders.decodeVarint32(data, position, registers); typeId = registers.int1; - // TODO decide if we're keeping support for Full in schema classes and + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and // handle this better. extension = (GeneratedMessageLite.GeneratedExtension) @@ -220,6 +242,7 @@ final class MessageSetSchema implements Schema { * A helper method for wildcard capture of {@code unknownFieldSchema}. See: * https://docs.oracle.com/javase/tutorial/java/generics/capture.html */ + @SuppressWarnings("unchecked") private > void mergeFromHelper( UnknownFieldSchema unknownFieldSchema, ExtensionSchema extensionSchema, @@ -288,7 +311,7 @@ final class MessageSetSchema implements Schema { // The wire format for MessageSet is: // message MessageSet { // repeated group Item = 1 { - // required uint32 typeId = 2; + // required int32 typeId = 2; // required bytes message = 3; // } // } @@ -343,7 +366,7 @@ final class MessageSetSchema implements Schema { // If there are any rawBytes left, it means the message content appears before the type ID. if (rawBytes != null) { if (extension != null) { // We known the type - // TODO: Instead of reading into a temporary ByteString, maybe there is a way + // TODO(xiaofeng): Instead of reading into a temporary ByteString, maybe there is a way // to read directly from Reader to the submessage? extensionSchema.parseMessageSetItem(rawBytes, extension, extensionRegistry, extensions); } else { diff --git a/java/core/src/main/java/com/google/protobuf/MutabilityOracle.java b/java/core/src/main/java/com/google/protobuf/MutabilityOracle.java index 94c37d4f292b8f573f53579a2b323579eee53f17..7c2f157567543e446d52a5ce1b5c3202943b33a8 100644 --- a/java/core/src/main/java/com/google/protobuf/MutabilityOracle.java +++ b/java/core/src/main/java/com/google/protobuf/MutabilityOracle.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java b/java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java index d1dc53f64062e1194eb6423ac009ca11ca0088de..f2dbb8ef9cc11d1420064cc3f34977823142b817 100644 --- a/java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java +++ b/java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java @@ -1,13 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -@CheckReturnValue interface NewInstanceSchema { /** Create a new message instance given the default instance of the message type. */ Object newInstance(Object defaultInstance); diff --git a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java index aacec0a55a6a945d6f1077e4a60650eb6a3b39ab..3433b657e6cd1ed60e72e227047d64f5bb00a2b1 100644 --- a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java +++ b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java index 90451d2e70f4842dd015526849a498a4e0bed5e5..00cfe3b6c7f0f21974eb79c16936637774fe3bff 100644 --- a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java +++ b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java @@ -1,17 +1,39 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -@CheckReturnValue final class NewInstanceSchemaLite implements NewInstanceSchema { @Override public Object newInstance(Object defaultInstance) { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. return ((GeneratedMessageLite) defaultInstance).newMutableInstance(); } diff --git a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java index 800f44891cb21d91ce39a9bccfeb013672c49485..eff45f67b9c04df4b3a0be0462a0234bb7092a43 100644 --- a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java +++ b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java @@ -1,13 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -@CheckReturnValue final class NewInstanceSchemas { private static final NewInstanceSchema FULL_SCHEMA = loadSchemaForFullRuntime(); private static final NewInstanceSchema LITE_SCHEMA = new NewInstanceSchemaLite(); diff --git a/java/core/src/main/java/com/google/protobuf/NioByteString.java b/java/core/src/main/java/com/google/protobuf/NioByteString.java index 56c0de9e8aeec1ec8cef1995d34bd3bf5457304e..1e594ff878c5791b0ebadce1d8827a2fa0bf8135 100644 --- a/java/core/src/main/java/com/google/protobuf/NioByteString.java +++ b/java/core/src/main/java/com/google/protobuf/NioByteString.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -14,6 +37,7 @@ import java.io.InputStream; import java.io.InvalidObjectException; import java.io.ObjectInputStream; import java.io.OutputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.InvalidMarkException; @@ -86,7 +110,7 @@ final class NioByteString extends ByteString.LeafByteString { protected void copyToInternal( byte[] target, int sourceOffset, int targetOffset, int numberToCopy) { ByteBuffer slice = buffer.slice(); - Java8Compatibility.position(slice, sourceOffset); + ((Buffer) slice).position(sourceOffset); slice.get(target, targetOffset, numberToCopy); } @@ -143,7 +167,7 @@ final class NioByteString extends ByteString.LeafByteString { offset = buffer.arrayOffset() + buffer.position(); length = buffer.remaining(); } else { - // TODO: Can we optimize this? + // TODO(nathanmittler): Can we optimize this? bytes = toByteArray(); offset = 0; length = bytes.length; @@ -200,7 +224,7 @@ final class NioByteString extends ByteString.LeafByteString { @Override public void mark(int readlimit) { - Java8Compatibility.mark(buf); + buf.mark(); } @Override @@ -211,7 +235,7 @@ final class NioByteString extends ByteString.LeafByteString { @Override public void reset() throws IOException { try { - Java8Compatibility.reset(buf); + buf.reset(); } catch (InvalidMarkException e) { throw new IOException(e); } @@ -262,8 +286,8 @@ final class NioByteString extends ByteString.LeafByteString { } ByteBuffer slice = buffer.slice(); - Java8Compatibility.position(slice, beginIndex - buffer.position()); - Java8Compatibility.limit(slice, endIndex - buffer.position()); + ((Buffer) slice).position(beginIndex - buffer.position()); + ((Buffer) slice).limit(endIndex - buffer.position()); return slice; } } diff --git a/java/core/src/main/java/com/google/protobuf/OneofInfo.java b/java/core/src/main/java/com/google/protobuf/OneofInfo.java index 88a0c19ed5639b9fc2f0c6efd391fb93dffc4927..bc518fcadd93f57051ad53cc0ac44b3579424ae1 100644 --- a/java/core/src/main/java/com/google/protobuf/OneofInfo.java +++ b/java/core/src/main/java/com/google/protobuf/OneofInfo.java @@ -1,18 +1,40 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import java.lang.reflect.Field; /** Information for a oneof within a protobuf message. */ -// TODO: make this private once all of experimental code is migrated to protobuf. +// TODO(nathanmittler): make this private once all of experimental code is migrated to protobuf. @ExperimentalApi -@CheckReturnValue final class OneofInfo { private final int id; private final Field caseField; diff --git a/java/core/src/main/java/com/google/protobuf/Parser.java b/java/core/src/main/java/com/google/protobuf/Parser.java index 9ab468c42b100183774132e2698783f44f6c9299..22ee99b1891bad3a5f2dde780af28a461c32fac3 100644 --- a/java/core/src/main/java/com/google/protobuf/Parser.java +++ b/java/core/src/main/java/com/google/protobuf/Parser.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java b/java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java index a2b0565905485200dc3dbf7b0785592a044c663c..79b5769d19877746e381d3b9e2ba268f7dfab411 100644 --- a/java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java +++ b/java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/ProtoSyntax.java b/java/core/src/main/java/com/google/protobuf/ProtoSyntax.java index 52fe59289f7d4935e24f6c17c0ea270e26114ca2..851b839f6fbda11ecb04cac1dd17b9d23cbe56ca 100644 --- a/java/core/src/main/java/com/google/protobuf/ProtoSyntax.java +++ b/java/core/src/main/java/com/google/protobuf/ProtoSyntax.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -11,6 +34,5 @@ package com.google.protobuf; @ExperimentalApi public enum ProtoSyntax { PROTO2, - PROTO3, - EDITIONS; + PROTO3; } diff --git a/java/core/src/main/java/com/google/protobuf/Protobuf.java b/java/core/src/main/java/com/google/protobuf/Protobuf.java index 82bb66b784c36e51701b7ca8bd109320ee456ce3..0affac5f0a40cd85c9aabca811475c0b1af2c1d7 100644 --- a/java/core/src/main/java/com/google/protobuf/Protobuf.java +++ b/java/core/src/main/java/com/google/protobuf/Protobuf.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -18,13 +41,12 @@ import java.util.concurrent.ConcurrentMap; * than directly accessing internal APIs) in order to perform operations on protobuf messages. */ @ExperimentalApi -@CheckReturnValue final class Protobuf { private static final Protobuf INSTANCE = new Protobuf(); private final SchemaFactory schemaFactory; - // TODO: Consider using ClassValue instead. + // TODO(nathanmittler): Consider using ClassValue instead. private final ConcurrentMap, Schema> schemaCache = new ConcurrentHashMap, Schema>(); @@ -105,7 +127,6 @@ final class Protobuf { * @return the previously registered schema, or {@code null} if no schema was registered * previously. */ - @CanIgnoreReturnValue public Schema registerSchemaOverride(Class messageType, Schema schema) { checkNotNull(messageType, "messageType"); checkNotNull(schema, "schema"); diff --git a/java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java b/java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java index 68dba518aedb704f0db242408c32fb08196a0d9f..33e4bd5e35e2d11f37cac4ac27aee4f63e0fc314 100644 --- a/java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java +++ b/java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -15,7 +38,11 @@ import java.util.RandomAccess; final class ProtobufArrayList extends AbstractProtobufList implements RandomAccess { private static final ProtobufArrayList EMPTY_LIST = - new ProtobufArrayList(new Object[0], 0, false); + new ProtobufArrayList(new Object[0], 0); + + static { + EMPTY_LIST.makeImmutable(); + } @SuppressWarnings("unchecked") // Guaranteed safe by runtime. public static ProtobufArrayList emptyList() { @@ -27,11 +54,10 @@ final class ProtobufArrayList extends AbstractProtobufList implements Rand @SuppressWarnings("unchecked") ProtobufArrayList() { - this((E[]) new Object[DEFAULT_CAPACITY], 0, true); + this((E[]) new Object[DEFAULT_CAPACITY], 0); } - private ProtobufArrayList(E[] array, int size, boolean isMutable) { - super(isMutable); + private ProtobufArrayList(E[] array, int size) { this.array = array; this.size = size; } @@ -44,7 +70,7 @@ final class ProtobufArrayList extends AbstractProtobufList implements Rand E[] newArray = Arrays.copyOf(array, capacity); - return new ProtobufArrayList(newArray, size, true); + return new ProtobufArrayList(newArray, size); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java b/java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java index a105d316f936caa9adc33839761b6956513f102d..5d6f5ac4422813591d85b200c5ba6fcee957b273 100644 --- a/java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java +++ b/java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/ProtocolStringList.java b/java/core/src/main/java/com/google/protobuf/ProtocolStringList.java index 2eac33184eb3d6b16841e663ef676e53c6a6e75b..5df3dbdbdaf219474a170a843d3507ee92114d54 100644 --- a/java/core/src/main/java/com/google/protobuf/ProtocolStringList.java +++ b/java/core/src/main/java/com/google/protobuf/ProtocolStringList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/RawMessageInfo.java b/java/core/src/main/java/com/google/protobuf/RawMessageInfo.java index aec973b6218cc06ba1f41e9f7719c67923d8121c..72f56ed88e5d769bff955adc56a35d224c26ec8c 100644 --- a/java/core/src/main/java/com/google/protobuf/RawMessageInfo.java +++ b/java/core/src/main/java/com/google/protobuf/RawMessageInfo.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -11,10 +34,7 @@ package com.google.protobuf; * RawMessageInfo stores the same amount of information as {@link MessageInfo} but in a more compact * format. */ -@CheckReturnValue final class RawMessageInfo implements MessageInfo { - private static final int IS_PROTO2_BIT = 0x1; - private static final int IS_EDITION_BIT = 0x4; private final MessageLite defaultInstance; @@ -39,8 +59,7 @@ final class RawMessageInfo implements MessageInfo { *

The integer sequence encoded in the String object has the following layout: * *

    - *
  • [0]: flags, flags & 0x1 = is proto2?, flags & 0x2 = is message?, flags & 0x4 = is - * edition? + *
  • [0]: flags, flags & 0x1 = is proto2?, flags & 0x2 = is message?. *
  • [1]: field count, if 0, this is the end of the integer sequence and the corresponding * Object[] array should be null. *
  • [2]: oneof count @@ -61,15 +80,14 @@ final class RawMessageInfo implements MessageInfo { *
  • [1]: field type with extra bits: *
      *
    • v & 0xFF = field type as defined in the FieldType class - *
    • v & 0x0100 = is required? - *
    • v & 0x0200 = is checkUtf8? - *
    • v & 0x0400 = needs isInitialized check? - *
    • v & 0x0800 = is enum field or map field enum value with legacy closedness? - *
    • v & 0x1000 = supports presence checking? + *
    • v & 0x100 = is required? + *
    • v & 0x200 = is checkUtf8? + *
    • v & 0x400 = needs isInitialized check? + *
    • v & 0x800 = is map field with proto2 enum value? *
    *
* - * If the (singular) field supports presence checking: + * If the file is proto2 and this is a singular field: * *
    *
  • [2]: hasbits offset @@ -192,13 +210,7 @@ final class RawMessageInfo implements MessageInfo { @Override public ProtoSyntax getSyntax() { - if ((flags & IS_PROTO2_BIT) != 0) { - return ProtoSyntax.PROTO2; - } else if ((flags & IS_EDITION_BIT) == 0x4) { - return ProtoSyntax.EDITIONS; - } else { - return ProtoSyntax.PROTO3; - } + return (flags & 0x1) == 0x1 ? ProtoSyntax.PROTO2 : ProtoSyntax.PROTO3; } @Override diff --git a/java/core/src/main/java/com/google/protobuf/Reader.java b/java/core/src/main/java/com/google/protobuf/Reader.java index 097e47b9a9d678513d631255e8af5995ca6f5347..b99ee43d4fd6afd6ad231b9348b147f1988386ca 100644 --- a/java/core/src/main/java/com/google/protobuf/Reader.java +++ b/java/core/src/main/java/com/google/protobuf/Reader.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -12,9 +35,8 @@ import java.util.List; import java.util.Map; /** A reader of fields from a serialized protobuf message. */ -// TODO: Refactor to allow the reader to allocate properly sized lists. +// TODO(nathanmittler): Refactor to allow the reader to allocate properly sized lists. @ExperimentalApi -@CheckReturnValue interface Reader { /** Value used to indicate that the end of input has been reached. */ int READ_DONE = Integer.MAX_VALUE; @@ -27,7 +49,7 @@ interface Reader { /** * Gets the field number for the current field being read. * - *

    TODO: Rename it to make it more explicit about the side effect on the underlying + *

    TODO(liujisi): Rename it to make it more explicit about the side effect on the underlying * buffer. * * @return the current field number or {@link #READ_DONE} if the end of input has been reached. @@ -112,7 +134,7 @@ interface Reader { */ String readStringRequireUtf8() throws IOException; - // TODO: the lack of other opinions for whether to expose this on the interface + // TODO(yilunchong): the lack of other opinions for whether to expose this on the interface T readMessageBySchemaWithCheck(Schema schema, ExtensionRegistryLite extensionRegistry) throws IOException; @@ -131,7 +153,7 @@ interface Reader { @Deprecated T readGroup(Class clazz, ExtensionRegistryLite extensionRegistry) throws IOException; - // TODO: the lack of other opinions for whether to expose this on the interface + // TODO(yilunchong): the lack of other opinions for whether to expose this on the interface @Deprecated T readGroupBySchemaWithCheck(Schema schema, ExtensionRegistryLite extensionRegistry) throws IOException; diff --git a/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java b/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java index d30e3ecfa7258162e779f634fa0a125b3051d882..f51436c83d23b44c3eb6201631fb061ab02d38d2 100644 --- a/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java +++ b/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -14,7 +37,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.RandomAccess; /** * {@code RepeatedFieldBuilder} implements a structure that a protocol message uses to hold a @@ -254,7 +276,6 @@ public class RepeatedFieldBuilder< * @param message the message to set * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilder setMessage(int index, MType message) { checkNotNull(message); ensureMutableMessageList(); @@ -276,7 +297,6 @@ public class RepeatedFieldBuilder< * @param message the message to add * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilder addMessage(MType message) { checkNotNull(message); ensureMutableMessageList(); @@ -298,7 +318,6 @@ public class RepeatedFieldBuilder< * @param message the message to add * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilder addMessage(int index, MType message) { checkNotNull(message); ensureMutableMessageList(); @@ -318,7 +337,6 @@ public class RepeatedFieldBuilder< * @param values the messages to add * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilder addAllMessages( Iterable values) { for (final MType value : values) { @@ -554,7 +572,7 @@ public class RepeatedFieldBuilder< MType extends GeneratedMessage, BType extends GeneratedMessage.Builder, IType extends MessageOrBuilder> - extends AbstractList implements List, RandomAccess { + extends AbstractList implements List { RepeatedFieldBuilder builder; @@ -588,7 +606,7 @@ public class RepeatedFieldBuilder< MType extends GeneratedMessage, BType extends GeneratedMessage.Builder, IType extends MessageOrBuilder> - extends AbstractList implements List, RandomAccess { + extends AbstractList implements List { RepeatedFieldBuilder builder; @@ -622,7 +640,7 @@ public class RepeatedFieldBuilder< MType extends GeneratedMessage, BType extends GeneratedMessage.Builder, IType extends MessageOrBuilder> - extends AbstractList implements List, RandomAccess { + extends AbstractList implements List { RepeatedFieldBuilder builder; diff --git a/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java b/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java index b36794ffa926763622f6b234444118c4632117a6..91bc3e286dd09a36c93a2a312ec32caef21774f9 100644 --- a/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java +++ b/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -14,7 +37,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.RandomAccess; /** * {@code RepeatedFieldBuilderV3} implements a structure that a protocol message uses to hold a @@ -254,7 +276,6 @@ public class RepeatedFieldBuilderV3< * @param message the message to set * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilderV3 setMessage(int index, MType message) { checkNotNull(message); ensureMutableMessageList(); @@ -276,7 +297,6 @@ public class RepeatedFieldBuilderV3< * @param message the message to add * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilderV3 addMessage(MType message) { checkNotNull(message); ensureMutableMessageList(); @@ -298,7 +318,6 @@ public class RepeatedFieldBuilderV3< * @param message the message to add * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilderV3 addMessage(int index, MType message) { checkNotNull(message); ensureMutableMessageList(); @@ -318,7 +337,6 @@ public class RepeatedFieldBuilderV3< * @param values the messages to add * @return the builder */ - @CanIgnoreReturnValue public RepeatedFieldBuilderV3 addAllMessages( Iterable values) { for (final MType value : values) { @@ -554,7 +572,7 @@ public class RepeatedFieldBuilderV3< MType extends AbstractMessage, BType extends AbstractMessage.Builder, IType extends MessageOrBuilder> - extends AbstractList implements List, RandomAccess { + extends AbstractList implements List { RepeatedFieldBuilderV3 builder; @@ -588,7 +606,7 @@ public class RepeatedFieldBuilderV3< MType extends AbstractMessage, BType extends AbstractMessage.Builder, IType extends MessageOrBuilder> - extends AbstractList implements List, RandomAccess { + extends AbstractList implements List { RepeatedFieldBuilderV3 builder; @@ -622,7 +640,7 @@ public class RepeatedFieldBuilderV3< MType extends AbstractMessage, BType extends AbstractMessage.Builder, IType extends MessageOrBuilder> - extends AbstractList implements List, RandomAccess { + extends AbstractList implements List { RepeatedFieldBuilderV3 builder; diff --git a/java/core/src/main/java/com/google/protobuf/RopeByteString.java b/java/core/src/main/java/com/google/protobuf/RopeByteString.java index aa8c6e14737145f5a0dd3354039ef78a1d2c04cc..cc6e0445b0d6877bcd29f78567e49bf98a0d8730 100644 --- a/java/core/src/main/java/com/google/protobuf/RopeByteString.java +++ b/java/core/src/main/java/com/google/protobuf/RopeByteString.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -580,12 +603,7 @@ final class RopeByteString extends ByteString { @Override public CodedInputStream newCodedInput() { - // Passing along direct references to internal ByteBuffers can support more efficient parsing - // via aliasing in CodedInputStream for users who wish to use it. - // - // Otherwise we force data copies, both in copying as an input stream and in buffering in the - // CodedInputSteam. - return CodedInputStream.newInstance(asReadOnlyByteBufferList(), /* bufferIsImmutable= */ true); + return CodedInputStream.newInstance(new RopeInputStream()); } @Override diff --git a/java/core/src/main/java/com/google/protobuf/RpcCallback.java b/java/core/src/main/java/com/google/protobuf/RpcCallback.java index a00707895290e63e65916119e525a737d34badc0..51a34b63d463b92e7687653effdb460fd81452f7 100644 --- a/java/core/src/main/java/com/google/protobuf/RpcCallback.java +++ b/java/core/src/main/java/com/google/protobuf/RpcCallback.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/RpcChannel.java b/java/core/src/main/java/com/google/protobuf/RpcChannel.java index 2011a9680ec59d129a39d43571b903999f78db6f..13b5ec165eacb62a499da86a10c54ee1372ef537 100644 --- a/java/core/src/main/java/com/google/protobuf/RpcChannel.java +++ b/java/core/src/main/java/com/google/protobuf/RpcChannel.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/RpcController.java b/java/core/src/main/java/com/google/protobuf/RpcController.java index 52961d949d56dfb760b568501f56b26c634573b9..073f27a2aad819f69d5d13cd5e2dd4d2fdbfc284 100644 --- a/java/core/src/main/java/com/google/protobuf/RpcController.java +++ b/java/core/src/main/java/com/google/protobuf/RpcController.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/RpcUtil.java b/java/core/src/main/java/com/google/protobuf/RpcUtil.java index e8dcf3b9b330b988d474e63de0a650e76c06878f..7bd056a5329efea513f487b1f1a302570d39ba0d 100644 --- a/java/core/src/main/java/com/google/protobuf/RpcUtil.java +++ b/java/core/src/main/java/com/google/protobuf/RpcUtil.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/Schema.java b/java/core/src/main/java/com/google/protobuf/Schema.java index fe87af1cf3c0d334434ce1aa2ae8b02c1f461740..d0e1e26e5bf781dc30fd1211366720f755bd8328 100644 --- a/java/core/src/main/java/com/google/protobuf/Schema.java +++ b/java/core/src/main/java/com/google/protobuf/Schema.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -15,7 +38,6 @@ import java.io.IOException; * such as serialization/deserialization. */ @ExperimentalApi -@CheckReturnValue interface Schema { /** Writes the given message to the target {@link Writer}. */ void writeTo(T message, Writer writer) throws IOException; diff --git a/java/core/src/main/java/com/google/protobuf/SchemaFactory.java b/java/core/src/main/java/com/google/protobuf/SchemaFactory.java index 233e16fa5772965ba4360b4fbf07dbdaa556c3cf..cf38dd69945f7136882a27dcee244f743baf1023 100644 --- a/java/core/src/main/java/com/google/protobuf/SchemaFactory.java +++ b/java/core/src/main/java/com/google/protobuf/SchemaFactory.java @@ -1,15 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; /** A factory that manufactures {@link Schema} instances for protobuf messages. */ @ExperimentalApi -@CheckReturnValue interface SchemaFactory { /** Creates a schema instance for the given protobuf message type. */ Schema createSchema(Class messageType); diff --git a/java/core/src/main/java/com/google/protobuf/SchemaUtil.java b/java/core/src/main/java/com/google/protobuf/SchemaUtil.java index ecc9b2a326c40129bb6e91393b085405318d1678..0e4c42c2dcae7fdbfae13e9226a44384e62ee899 100644 --- a/java/core/src/main/java/com/google/protobuf/SchemaUtil.java +++ b/java/core/src/main/java/com/google/protobuf/SchemaUtil.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -18,11 +41,12 @@ import java.util.RandomAccess; /** Helper methods used by schemas. */ @ExperimentalApi -@CheckReturnValue final class SchemaUtil { private static final Class GENERATED_MESSAGE_CLASS = getGeneratedMessageClass(); - private static final UnknownFieldSchema UNKNOWN_FIELD_SET_FULL_SCHEMA = - getUnknownFieldSetSchema(); + private static final UnknownFieldSchema PROTO2_UNKNOWN_FIELD_SET_SCHEMA = + getUnknownFieldSetSchema(false); + private static final UnknownFieldSchema PROTO3_UNKNOWN_FIELD_SET_SCHEMA = + getUnknownFieldSetSchema(true); private static final UnknownFieldSchema UNKNOWN_FIELD_SET_LITE_SCHEMA = new UnknownFieldSetLiteSchema(); @@ -35,24 +59,24 @@ final class SchemaUtil { * GeneratedMessageLite}. */ public static void requireGeneratedMessage(Class messageType) { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (!GeneratedMessageLite.class.isAssignableFrom(messageType) && GENERATED_MESSAGE_CLASS != null && !GENERATED_MESSAGE_CLASS.isAssignableFrom(messageType)) { throw new IllegalArgumentException( - "Message classes must extend GeneratedMessageV3 or GeneratedMessageLite"); + "Message classes must extend GeneratedMessage or GeneratedMessageLite"); } } public static void writeDouble(int fieldNumber, double value, Writer writer) throws IOException { - if (Double.doubleToRawLongBits(value) != 0) { + if (Double.compare(value, 0.0) != 0) { writer.writeDouble(fieldNumber, value); } } public static void writeFloat(int fieldNumber, float value, Writer writer) throws IOException { - if (Float.floatToRawIntBits(value) != 0) { + if (Float.compare(value, 0.0f) != 0) { writer.writeFloat(fieldNumber, value); } } @@ -760,21 +784,25 @@ final class SchemaUtil { return tableSpaceCost + 3 * tableTimeCost <= lookupSpaceCost + 3 * lookupTimeCost; } - public static UnknownFieldSchema unknownFieldSetFullSchema() { - return UNKNOWN_FIELD_SET_FULL_SCHEMA; + public static UnknownFieldSchema proto2UnknownFieldSetSchema() { + return PROTO2_UNKNOWN_FIELD_SET_SCHEMA; + } + + public static UnknownFieldSchema proto3UnknownFieldSetSchema() { + return PROTO3_UNKNOWN_FIELD_SET_SCHEMA; } public static UnknownFieldSchema unknownFieldSetLiteSchema() { return UNKNOWN_FIELD_SET_LITE_SCHEMA; } - private static UnknownFieldSchema getUnknownFieldSetSchema() { + private static UnknownFieldSchema getUnknownFieldSetSchema(boolean proto3) { try { Class clz = getUnknownFieldSetSchemaClass(); if (clz == null) { return null; } - return (UnknownFieldSchema) clz.getConstructor().newInstance(); + return (UnknownFieldSchema) clz.getConstructor(boolean.class).newInstance(proto3); } catch (Throwable t) { return null; } @@ -782,7 +810,7 @@ final class SchemaUtil { private static Class getGeneratedMessageClass() { try { - // TODO decide if we're keeping support for Full in schema classes and handle + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle // this better. return Class.forName("com.google.protobuf.GeneratedMessageV3"); } catch (Throwable e) { @@ -876,7 +904,6 @@ final class SchemaUtil { } /** Filters unrecognized enum values in a list. */ - @CanIgnoreReturnValue static UB filterUnknownEnumList( Object containerMessage, int number, @@ -887,7 +914,7 @@ final class SchemaUtil { if (enumMap == null) { return unknownFields; } - // TODO: Specialize for IntArrayList to avoid boxing. + // TODO(dweis): Specialize for IntArrayList to avoid boxing. if (enumList instanceof RandomAccess) { int writePos = 0; int size = enumList.size(); @@ -922,7 +949,6 @@ final class SchemaUtil { } /** Filters unrecognized enum values in a list. */ - @CanIgnoreReturnValue static UB filterUnknownEnumList( Object containerMessage, int number, @@ -933,7 +959,7 @@ final class SchemaUtil { if (enumVerifier == null) { return unknownFields; } - // TODO: Specialize for IntArrayList to avoid boxing. + // TODO(dweis): Specialize for IntArrayList to avoid boxing. if (enumList instanceof RandomAccess) { int writePos = 0; int size = enumList.size(); @@ -968,7 +994,6 @@ final class SchemaUtil { } /** Stores an unrecognized enum value as an unknown value. */ - @CanIgnoreReturnValue static UB storeUnknownEnum( Object containerMessage, int number, diff --git a/java/core/src/main/java/com/google/protobuf/Service.java b/java/core/src/main/java/com/google/protobuf/Service.java index b28bd334d5ca7a1ae102c5086f98b7eb6a5a6f08..d45cdaec9a00cb9c41e36ed724c202464d902e7e 100644 --- a/java/core/src/main/java/com/google/protobuf/Service.java +++ b/java/core/src/main/java/com/google/protobuf/Service.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/ServiceException.java b/java/core/src/main/java/com/google/protobuf/ServiceException.java index 68367136699c1012de0f38030f72cd5f702f20b5..00d5707523523cb3620a764b9fd36cf753797549 100644 --- a/java/core/src/main/java/com/google/protobuf/ServiceException.java +++ b/java/core/src/main/java/com/google/protobuf/ServiceException.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java b/java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java index 17326cb0b87824c96e6a442b63b73c2308186127..acdc1de18315ab4d5c75b5eaa419dff61b979fa5 100644 --- a/java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java +++ b/java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -133,7 +156,6 @@ public class SingleFieldBuilder< * @param message the message to set * @return the builder */ - @CanIgnoreReturnValue public SingleFieldBuilder setMessage(MType message) { this.message = checkNotNull(message); if (builder != null) { @@ -150,7 +172,6 @@ public class SingleFieldBuilder< * @param value the value to merge from * @return the builder */ - @CanIgnoreReturnValue public SingleFieldBuilder mergeFrom(MType value) { if (builder == null && message == message.getDefaultInstanceForType()) { message = value; @@ -167,7 +188,6 @@ public class SingleFieldBuilder< * @return the builder */ @SuppressWarnings("unchecked") - @CanIgnoreReturnValue public SingleFieldBuilder clear() { message = (MType) @@ -179,9 +199,6 @@ public class SingleFieldBuilder< builder = null; } onChanged(); - // After clearing, parent is dirty, but this field builder is now clean and any changes should - // trickle up. - isClean = true; return this; } diff --git a/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java b/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java index 0aff2b82a36ba32725df97a764f722585af07148..78a4a21664b20d168d7797b081517a4c4a362069 100644 --- a/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java +++ b/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -133,7 +156,6 @@ public class SingleFieldBuilderV3< * @param message the message to set * @return the builder */ - @CanIgnoreReturnValue public SingleFieldBuilderV3 setMessage(MType message) { this.message = checkNotNull(message); if (builder != null) { @@ -150,7 +172,6 @@ public class SingleFieldBuilderV3< * @param value the value to merge from * @return the builder */ - @CanIgnoreReturnValue public SingleFieldBuilderV3 mergeFrom(MType value) { if (builder == null && message == message.getDefaultInstanceForType()) { message = value; @@ -167,7 +188,6 @@ public class SingleFieldBuilderV3< * @return the builder */ @SuppressWarnings("unchecked") - @CanIgnoreReturnValue public SingleFieldBuilderV3 clear() { message = (MType) @@ -179,9 +199,6 @@ public class SingleFieldBuilderV3< builder = null; } onChanged(); - // After clearing, parent is dirty, but this field builder is now clean and any changes should - // trickle up. - isClean = true; return this; } diff --git a/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java b/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java index 17e8d77dba0a889ea214f7d7a8e39ed59aa18825..546e56e856130944eb0e84ab74fb1edba9514054 100644 --- a/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java +++ b/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -351,6 +374,7 @@ class SmallSortedMap, V> extends AbstractMap { * @return a {@link SortedMap} to which overflow entries mappings can be added or removed. * @throws UnsupportedOperationException if {@link #makeImmutable()} has been called. */ + @SuppressWarnings("unchecked") private SortedMap getOverflowEntriesMutable() { checkMutable(); if (overflowEntries.isEmpty() && !(overflowEntries instanceof TreeMap)) { @@ -417,6 +441,7 @@ class SmallSortedMap, V> extends AbstractMap { if (!(o instanceof Map.Entry)) { return false; } + @SuppressWarnings("unchecked") Map.Entry other = (Map.Entry) o; return equals(key, other.getKey()) && equals(value, other.getValue()); } diff --git a/java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java b/java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java index 56b5753d01d69abf6bad29cf335dc25ab8ab82ff..a32b1430ee1150b2f51b910dfcf6c5ef293e78b3 100644 --- a/java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java +++ b/java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -18,7 +41,6 @@ import java.util.List; * contained within a message. */ @ExperimentalApi -@CheckReturnValue final class StructuralMessageInfo implements MessageInfo { private final ProtoSyntax syntax; private final boolean messageSetWireFormat; diff --git a/java/core/src/main/java/com/google/protobuf/TextFormat.java b/java/core/src/main/java/com/google/protobuf/TextFormat.java index a49919ef012a262954eeaa70ac10f8afc2ac195b..a5709cca2005b20dcf35d561529fc52c2d2b7103 100644 --- a/java/core/src/main/java/com/google/protobuf/TextFormat.java +++ b/java/core/src/main/java/com/google/protobuf/TextFormat.java @@ -1,12 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; +import static java.nio.charset.StandardCharsets.UTF_8; + import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.EnumDescriptor; import com.google.protobuf.Descriptors.EnumValueDescriptor; @@ -26,7 +51,7 @@ import java.util.regex.Pattern; /** * Provide text parsing and formatting support for proto2 instances. The implementation largely - * follows text_format.cc. + * follows google/protobuf/text_format.cc. * * @author wenboz@google.com Wenbo Zhu * @author kenton@google.com Kenton Varda @@ -36,8 +61,6 @@ public final class TextFormat { private static final Logger logger = Logger.getLogger(TextFormat.class.getName()); - private static final String DEBUG_STRING_SILENT_MARKER = "\t "; - /** * Outputs a textual representation of the Protocol Message supplied into the parameter output. * (This representation is the new version of the classic "ProtocolPrinter" output from the @@ -46,9 +69,6 @@ public final class TextFormat { * @deprecated Use {@code printer().print(MessageOrBuilder, Appendable)} */ @Deprecated - @InlineMe( - replacement = "TextFormat.printer().print(message, output)", - imports = "com.google.protobuf.TextFormat") public static void print(final MessageOrBuilder message, final Appendable output) throws IOException { printer().print(message, output); @@ -71,9 +91,6 @@ public final class TextFormat { * @deprecated Use {@code printer().escapingNonAscii(false).print(MessageOrBuilder, Appendable)} */ @Deprecated - @InlineMe( - replacement = "TextFormat.printer().escapingNonAscii(false).print(message, output)", - imports = "com.google.protobuf.TextFormat") public static void printUnicode(final MessageOrBuilder message, final Appendable output) throws IOException { printer().escapingNonAscii(false).print(message, output); @@ -92,8 +109,8 @@ public final class TextFormat { /** * Generates a human readable form of this message, useful for debugging and other purposes, with - * no newline characters. This is just a trivial wrapper around {@link - * TextFormat.Printer#shortDebugString(MessageOrBuilder)}. + * no newline characters. This is just a trivial wrapper around + * {@link TextFormat.Printer#shortDebugString(MessageOrBuilder)}. */ public static String shortDebugString(final MessageOrBuilder message) { return printer().shortDebugString(message); @@ -109,7 +126,7 @@ public final class TextFormat { public static String shortDebugString(final FieldDescriptor field, final Object value) { return printer().shortDebugString(field, value); } - + // /** * Generates a human readable form of the unknown fields, useful for debugging and other * purposes, with no newline characters. @@ -127,9 +144,6 @@ public final class TextFormat { * @deprecated Use {@code message.toString()} */ @Deprecated - @InlineMe( - replacement = "TextFormat.printer().printToString(message)", - imports = "com.google.protobuf.TextFormat") public static String printToString(final MessageOrBuilder message) { return printer().printToString(message); } @@ -151,9 +165,6 @@ public final class TextFormat { * @deprecated Use {@code printer().escapingNonAscii(false).printToString(MessageOrBuilder)} */ @Deprecated - @InlineMe( - replacement = "TextFormat.printer().escapingNonAscii(false).printToString(message)", - imports = "com.google.protobuf.TextFormat") public static String printToUnicodeString(final MessageOrBuilder message) { return printer().escapingNonAscii(false).printToString(message); } @@ -168,7 +179,7 @@ public final class TextFormat { public static String printToUnicodeString(final UnknownFieldSet fields) { return printer().escapingNonAscii(false).printToString(fields); } - + // /** @deprecated Use {@code printer().printField(FieldDescriptor, Object, Appendable)} */ @Deprecated public static void printField( @@ -176,13 +187,13 @@ public final class TextFormat { throws IOException { printer().printField(field, value, output); } - + // /** @deprecated Use {@code printer().printFieldToString(FieldDescriptor, Object)} */ @Deprecated public static String printFieldToString(final FieldDescriptor field, final Object value) { return printer().printFieldToString(field, value); } - + // /** * Outputs a unicode textual representation of the value of given field value. * @@ -215,9 +226,6 @@ public final class TextFormat { * @throws IOException if there is an exception writing to the output */ @Deprecated - @InlineMe( - replacement = "TextFormat.printer().printFieldValue(field, value, output)", - imports = "com.google.protobuf.TextFormat") public static void printFieldValue( final FieldDescriptor field, final Object value, final Appendable output) throws IOException { printer().printFieldValue(field, value, output); @@ -435,16 +443,21 @@ public final class TextFormat { } } - /** An adapter class that can take a {@link MapEntry} and returns its key and entry. */ + /** + * An adapter class that can take a MapEntry or a MutableMapEntry and returns its key and entry. + * This class is created solely for the purpose of sorting map entries by its key and prevent + * duplicated logic by having a separate comparator for MapEntry and MutableMapEntry. + */ private static class MapEntryAdapter implements Comparable { private Object entry; @SuppressWarnings({"rawtypes"}) private MapEntry mapEntry; + private final FieldDescriptor.JavaType fieldType; - MapEntryAdapter(Object entry, FieldDescriptor fieldDescriptor) { + public MapEntryAdapter(Object entry, FieldDescriptor fieldDescriptor) { if (entry instanceof MapEntry) { this.mapEntry = (MapEntry) entry; } else { @@ -457,14 +470,14 @@ public final class TextFormat { return fieldDescriptor.getMessageType().getFields().get(0).getJavaType(); } - Object getKey() { + public Object getKey() { if (mapEntry != null) { return mapEntry.getKey(); } return null; } - Object getEntry() { + public Object getEntry() { if (mapEntry != null) { return mapEntry; } @@ -479,11 +492,11 @@ public final class TextFormat { } switch (fieldType) { case BOOLEAN: - return Boolean.valueOf((boolean) getKey()).compareTo((boolean) b.getKey()); + return Boolean.compare((boolean) getKey(), (boolean) b.getKey()); case LONG: - return Long.valueOf((long) getKey()).compareTo((long) b.getKey()); + return Long.compare((long) getKey(), (long) b.getKey()); case INT: - return Integer.valueOf((int) getKey()).compareTo((int) b.getKey()); + return Integer.compare((int) getKey(), (int) b.getKey()); case STRING: String aString = (String) getKey(); String bString = (String) b.getKey(); @@ -920,15 +933,6 @@ public final class TextFormat { Pattern.compile("-?inf(inity)?f?", Pattern.CASE_INSENSITIVE); private static final Pattern FLOAT_NAN = Pattern.compile("nanf?", Pattern.CASE_INSENSITIVE); - /** - * {@link containsSilentMarkerAfterCurrentToken} indicates if there is a silent marker after the - * current token. This value is moved to {@link containsSilentMarkerAfterPrevToken} every time - * the next token is parsed. - */ - private boolean containsSilentMarkerAfterCurrentToken = false; - - private boolean containsSilentMarkerAfterPrevToken = false; - /** Construct a tokenizer that parses tokens from the given text. */ private Tokenizer(final CharSequence text) { this.text = text; @@ -953,21 +957,13 @@ public final class TextFormat { return column; } - boolean getContainsSilentMarkerAfterCurrentToken() { - return containsSilentMarkerAfterCurrentToken; - } - - boolean getContainsSilentMarkerAfterPrevToken() { - return containsSilentMarkerAfterPrevToken; - } - /** Are we at the end of the input? */ - boolean atEnd() { + public boolean atEnd() { return currentToken.length() == 0; } /** Advance to the next token. */ - void nextToken() { + public void nextToken() { previousLine = line; previousColumn = column; @@ -1013,7 +1009,7 @@ public final class TextFormat { * If the next token exactly matches {@code token}, consume it and return {@code true}. * Otherwise, return {@code false} without doing anything. */ - boolean tryConsume(final String token) { + public boolean tryConsume(final String token) { if (currentToken.equals(token)) { nextToken(); return true; @@ -1026,14 +1022,14 @@ public final class TextFormat { * If the next token exactly matches {@code token}, consume it. Otherwise, throw a {@link * ParseException}. */ - void consume(final String token) throws ParseException { + public void consume(final String token) throws ParseException { if (!tryConsume(token)) { throw parseException("Expected \"" + token + "\"."); } } /** Returns {@code true} if the next token is an integer, but does not consume it. */ - boolean lookingAtInteger() { + public boolean lookingAtInteger() { if (currentToken.length() == 0) { return false; } @@ -1043,7 +1039,7 @@ public final class TextFormat { } /** Returns {@code true} if the current token's text is equal to that specified. */ - boolean lookingAt(String text) { + public boolean lookingAt(String text) { return currentToken.equals(text); } @@ -1051,7 +1047,7 @@ public final class TextFormat { * If the next token is an identifier, consume it and return its value. Otherwise, throw a * {@link ParseException}. */ - String consumeIdentifier() throws ParseException { + public String consumeIdentifier() throws ParseException { for (int i = 0; i < currentToken.length(); i++) { final char c = currentToken.charAt(i); if (('a' <= c && c <= 'z') @@ -1074,7 +1070,7 @@ public final class TextFormat { * If the next token is an identifier, consume it and return {@code true}. Otherwise, return * {@code false} without doing anything. */ - boolean tryConsumeIdentifier() { + public boolean tryConsumeIdentifier() { try { consumeIdentifier(); return true; @@ -1087,7 +1083,7 @@ public final class TextFormat { * If the next token is a 32-bit signed integer, consume it and return its value. Otherwise, * throw a {@link ParseException}. */ - int consumeInt32() throws ParseException { + public int consumeInt32() throws ParseException { try { final int result = parseInt32(currentToken); nextToken(); @@ -1101,7 +1097,7 @@ public final class TextFormat { * If the next token is a 32-bit unsigned integer, consume it and return its value. Otherwise, * throw a {@link ParseException}. */ - int consumeUInt32() throws ParseException { + public int consumeUInt32() throws ParseException { try { final int result = parseUInt32(currentToken); nextToken(); @@ -1115,7 +1111,7 @@ public final class TextFormat { * If the next token is a 64-bit signed integer, consume it and return its value. Otherwise, * throw a {@link ParseException}. */ - long consumeInt64() throws ParseException { + public long consumeInt64() throws ParseException { try { final long result = parseInt64(currentToken); nextToken(); @@ -1129,7 +1125,7 @@ public final class TextFormat { * If the next token is a 64-bit signed integer, consume it and return {@code true}. Otherwise, * return {@code false} without doing anything. */ - boolean tryConsumeInt64() { + public boolean tryConsumeInt64() { try { consumeInt64(); return true; @@ -1142,7 +1138,7 @@ public final class TextFormat { * If the next token is a 64-bit unsigned integer, consume it and return its value. Otherwise, * throw a {@link ParseException}. */ - long consumeUInt64() throws ParseException { + public long consumeUInt64() throws ParseException { try { final long result = parseUInt64(currentToken); nextToken(); @@ -1271,12 +1267,21 @@ public final class TextFormat { return consumeByteString().toStringUtf8(); } + /** If the next token is a string, consume it and return true. Otherwise, return false. */ + public boolean tryConsumeString() { + try { + consumeString(); + return true; + } catch (ParseException e) { + return false; + } + } + /** * If the next token is a string, consume it, unescape it as a {@link ByteString}, and return * it. Otherwise, throw a {@link ParseException}. */ - @CanIgnoreReturnValue - ByteString consumeByteString() throws ParseException { + public ByteString consumeByteString() throws ParseException { List list = new ArrayList(); consumeByteString(list); while (currentToken.startsWith("'") || currentToken.startsWith("\"")) { @@ -1285,16 +1290,6 @@ public final class TextFormat { return ByteString.copyFrom(list); } - /** If the next token is a string, consume it and return true. Otherwise, return false. */ - boolean tryConsumeByteString() { - try { - consumeByteString(); - return true; - } catch (ParseException e) { - return false; - } - } - /** * Like {@link #consumeByteString()} but adds each token of the string to the given list. String * literals (whether bytes or text) may come in multiple adjacent tokens which are automatically @@ -1324,7 +1319,7 @@ public final class TextFormat { * Returns a {@link ParseException} with the current line and column numbers in the description, * suitable for throwing. */ - ParseException parseException(final String description) { + public ParseException parseException(final String description) { // Note: People generally prefer one-based line and column numbers. return new ParseException(line + 1, column + 1, description); } @@ -1333,7 +1328,7 @@ public final class TextFormat { * Returns a {@link ParseException} with the line and column numbers of the previous token in * the description, suitable for throwing. */ - ParseException parseExceptionPreviousToken(final String description) { + public ParseException parseExceptionPreviousToken(final String description) { // Note: People generally prefer one-based line and column numbers. return new ParseException(previousLine + 1, previousColumn + 1, description); } @@ -1353,6 +1348,17 @@ public final class TextFormat { private ParseException floatParseException(final NumberFormatException e) { return parseException("Couldn't parse number: " + e.getMessage()); } + + /** + * Returns a {@link UnknownFieldParseException} with the line and column numbers of the previous + * token in the description, and the unknown field name, suitable for throwing. + */ + public UnknownFieldParseException unknownFieldParseExceptionPreviousToken( + final String unknownField, final String description) { + // Note: People generally prefer one-based line and column numbers. + return new UnknownFieldParseException( + previousLine + 1, previousColumn + 1, unknownField, description); + } } /** Thrown when parsing an invalid text format message. */ @@ -1476,6 +1482,7 @@ public final class TextFormat { PARSER.merge(input, extensionRegistry, builder); } + /** * Parse a text-format message from {@code input} and merge the contents into {@code builder}. * Extensions will be recognized if they are registered in {@code extensionRegistry}. @@ -1506,6 +1513,7 @@ public final class TextFormat { return output; } + /** * Parser for text-format proto2 instances. This class is thread-safe. The implementation largely * follows google/protobuf/text_format.cc. @@ -1514,28 +1522,15 @@ public final class TextFormat { * control the parser behavior. */ public static class Parser { - - /** - * A valid silent marker appears between a field name and its value. If there is a ":" in - * between, the silent marker will only appear after the colon. This is called after a field - * name is parsed, and before the ":" if it exists. If the current token is ":", then - * containsSilentMarkerAfterCurrentToken indicates if there is a valid silent marker. Otherwise, - * the current token is part of the field value, so the silent marker is indicated by - * containsSilentMarkerAfterPrevToken. - */ - private void detectSilentMarker( - Tokenizer tokenizer, Descriptor immediateMessageType, String fieldName) { - } - /** * Determines if repeated values for non-repeated fields and oneofs are permitted. For example, - * given required/optional field "foo" and a oneof containing "baz" and "moo": + * given required/optional field "foo" and a oneof containing "baz" and "qux": * *

      *
    • "foo: 1 foo: 2" - *
    • "baz: 1 moo: 2" + *
    • "baz: 1 qux: 2" *
    • merging "foo: 2" into a proto in which foo is already set, or - *
    • merging "moo: 2" into a proto in which baz is already set. + *
    • merging "qux: 2" into a proto in which baz is already set. *
    */ public enum SingularOverwritePolicy { @@ -1554,7 +1549,6 @@ public final class TextFormat { private final boolean allowUnknownExtensions; private final SingularOverwritePolicy singularOverwritePolicy; private TextFormatParseInfoTree.Builder parseInfoTreeBuilder; - private final int recursionLimit; private Parser( TypeRegistry typeRegistry, @@ -1562,15 +1556,13 @@ public final class TextFormat { boolean allowUnknownEnumValues, boolean allowUnknownExtensions, SingularOverwritePolicy singularOverwritePolicy, - TextFormatParseInfoTree.Builder parseInfoTreeBuilder, - int recursionLimit) { + TextFormatParseInfoTree.Builder parseInfoTreeBuilder) { this.typeRegistry = typeRegistry; this.allowUnknownFields = allowUnknownFields; this.allowUnknownEnumValues = allowUnknownEnumValues; this.allowUnknownExtensions = allowUnknownExtensions; this.singularOverwritePolicy = singularOverwritePolicy; this.parseInfoTreeBuilder = parseInfoTreeBuilder; - this.recursionLimit = recursionLimit; } /** Returns a new instance of {@link Builder}. */ @@ -1587,7 +1579,6 @@ public final class TextFormat { SingularOverwritePolicy.ALLOW_SINGULAR_OVERWRITES; private TextFormatParseInfoTree.Builder parseInfoTreeBuilder = null; private TypeRegistry typeRegistry = TypeRegistry.getEmptyTypeRegistry(); - private int recursionLimit = 100; /** * Sets the TypeRegistry for resolving Any. If this is not set, TextFormat will not be able to @@ -1605,8 +1596,8 @@ public final class TextFormat { * unknown field is encountered. If this is set, the parser will only log a warning. Allow * unknown fields will also allow unknown extensions. * - *

    Use of this parameter is discouraged which may hide some errors (e.g. spelling error on - * field name). + *

    Use of this parameter is discouraged which may hide some errors (e.g. + * spelling error on field name). */ public Builder setAllowUnknownFields(boolean allowUnknownFields) { this.allowUnknownFields = allowUnknownFields; @@ -1614,9 +1605,10 @@ public final class TextFormat { } /** - * Set whether this parser will allow unknown extensions. By default, an exception is thrown - * if unknown extension is encountered. If this is set true, the parser will only log a - * warning. Allow unknown extensions does not mean allow normal unknown fields. + * Set whether this parser will allow unknown extensions. By default, an + * exception is thrown if unknown extension is encountered. If this is set true, + * the parser will only log a warning. Allow unknown extensions does not mean + * allow normal unknown fields. */ public Builder setAllowUnknownExtensions(boolean allowUnknownExtensions) { this.allowUnknownExtensions = allowUnknownExtensions; @@ -1634,15 +1626,6 @@ public final class TextFormat { return this; } - /** - * Set the maximum recursion limit that the parser will allow. If the depth of the message - * exceeds this limit then the parser will stop and throw an exception. - */ - public Builder setRecursionLimit(int recursionLimit) { - this.recursionLimit = recursionLimit; - return this; - } - public Parser build() { return new Parser( typeRegistry, @@ -1650,8 +1633,7 @@ public final class TextFormat { allowUnknownEnumValues, allowUnknownExtensions, singularOverwritePolicy, - parseInfoTreeBuilder, - recursionLimit); + parseInfoTreeBuilder); } } @@ -1690,9 +1672,10 @@ public final class TextFormat { merge(toStringBuilder(input), extensionRegistry, builder); } + private static final int BUFFER_SIZE = 4096; - // TODO: See if working around java.io.Reader#read(CharBuffer) + // TODO(chrisn): See if working around java.io.Reader#read(CharBuffer) // overhead is worthwhile private static StringBuilder toStringBuilder(final Readable input) throws IOException { final StringBuilder text = new StringBuilder(); @@ -1702,7 +1685,7 @@ public final class TextFormat { if (n == -1) { break; } - Java8Compatibility.flip(buffer); + buffer.flip(); text.append(buffer, 0, n); } return text; @@ -1710,8 +1693,7 @@ public final class TextFormat { static final class UnknownField { static enum Type { - FIELD, - EXTENSION; + FIELD, EXTENSION; } final String message; @@ -1772,29 +1754,30 @@ public final class TextFormat { throws ParseException { final Tokenizer tokenizer = new Tokenizer(input); MessageReflection.BuilderAdapter target = new MessageReflection.BuilderAdapter(builder); + List unknownFields = new ArrayList(); while (!tokenizer.atEnd()) { - mergeField(tokenizer, extensionRegistry, target, unknownFields, recursionLimit); + mergeField(tokenizer, extensionRegistry, target, unknownFields); } + checkUnknownFields(unknownFields); } + /** Parse a single field from {@code tokenizer} and merge it into {@code builder}. */ private void mergeField( final Tokenizer tokenizer, final ExtensionRegistry extensionRegistry, final MessageReflection.MergeTarget target, - List unknownFields, - int recursionLimit) + List unknownFields) throws ParseException { mergeField( tokenizer, extensionRegistry, target, parseInfoTreeBuilder, - unknownFields, - recursionLimit); + unknownFields); } /** Parse a single field from {@code tokenizer} and merge it into {@code target}. */ @@ -1803,41 +1786,29 @@ public final class TextFormat { final ExtensionRegistry extensionRegistry, final MessageReflection.MergeTarget target, TextFormatParseInfoTree.Builder parseTreeBuilder, - List unknownFields, - int recursionLimit) + List unknownFields) throws ParseException { FieldDescriptor field = null; - String name; int startLine = tokenizer.getLine(); int startColumn = tokenizer.getColumn(); final Descriptor type = target.getDescriptorForType(); ExtensionRegistry.ExtensionInfo extension = null; if ("google.protobuf.Any".equals(type.getFullName()) && tokenizer.tryConsume("[")) { - if (recursionLimit < 1) { - throw tokenizer.parseException("Message is nested too deep"); - } - mergeAnyFieldValue( - tokenizer, - extensionRegistry, - target, - parseTreeBuilder, - unknownFields, - type, - recursionLimit - 1); + mergeAnyFieldValue(tokenizer, extensionRegistry, target, parseTreeBuilder, unknownFields, + type); return; } if (tokenizer.tryConsume("[")) { // An extension. - StringBuilder nameBuilder = new StringBuilder(tokenizer.consumeIdentifier()); + final StringBuilder name = new StringBuilder(tokenizer.consumeIdentifier()); while (tokenizer.tryConsume(".")) { - nameBuilder.append('.'); - nameBuilder.append(tokenizer.consumeIdentifier()); + name.append('.'); + name.append(tokenizer.consumeIdentifier()); } - name = nameBuilder.toString(); - extension = target.findExtensionByName(extensionRegistry, name); + extension = target.findExtensionByName(extensionRegistry, name.toString()); if (extension == null) { String message = @@ -1864,7 +1835,7 @@ public final class TextFormat { tokenizer.consume("]"); } else { - name = tokenizer.consumeIdentifier(); + final String name = tokenizer.consumeIdentifier(); field = type.findFieldByName(name); // Group names are expected to be capitalized as they appear in the @@ -1888,28 +1859,35 @@ public final class TextFormat { } if (field == null) { - String message = - (tokenizer.getPreviousLine() + 1) - + ":" - + (tokenizer.getPreviousColumn() + 1) - + ":\t" - + type.getFullName() - + "." - + name; + String message = (tokenizer.getPreviousLine() + 1) + + ":" + + (tokenizer.getPreviousColumn() + 1) + + ":\t" + + type.getFullName() + + "." + + name; unknownFields.add(new UnknownField(message, UnknownField.Type.FIELD)); } } // Skips unknown fields. if (field == null) { - detectSilentMarker(tokenizer, type, name); - guessFieldTypeAndSkip(tokenizer, type, recursionLimit); + // Try to guess the type of this field. + // If this field is not a message, there should be a ":" between the + // field name and the field value and also the field value should not + // start with "{" or "<" which indicates the beginning of a message body. + // If there is no ":" or there is a "{" or "<" after ":", this field has + // to be a message or the input is ill-formed. + if (tokenizer.tryConsume(":") && !tokenizer.lookingAt("{") && !tokenizer.lookingAt("<")) { + skipFieldValue(tokenizer); + } else { + skipFieldMessage(tokenizer); + } return; } // Handle potential ':'. if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { - detectSilentMarker(tokenizer, type, field.getFullName()); tokenizer.tryConsume(":"); // optional if (parseTreeBuilder != null) { TextFormatParseInfoTree.Builder childParseTreeBuilder = @@ -1921,8 +1899,7 @@ public final class TextFormat { field, extension, childParseTreeBuilder, - unknownFields, - recursionLimit); + unknownFields); } else { consumeFieldValues( tokenizer, @@ -1931,11 +1908,9 @@ public final class TextFormat { field, extension, parseTreeBuilder, - unknownFields, - recursionLimit); + unknownFields); } } else { - detectSilentMarker(tokenizer, type, field.getFullName()); tokenizer.consume(":"); // required consumeFieldValues( tokenizer, @@ -1944,8 +1919,7 @@ public final class TextFormat { field, extension, parseTreeBuilder, - unknownFields, - recursionLimit); + unknownFields); } if (parseTreeBuilder != null) { @@ -1959,29 +1933,6 @@ public final class TextFormat { } } - private String consumeFullTypeName(Tokenizer tokenizer) throws ParseException { - // If there is not a leading `[`, this is just a type name. - if (!tokenizer.tryConsume("[")) { - return tokenizer.consumeIdentifier(); - } - - // Otherwise, this is an extension or google.protobuf.Any type URL: we consume proto path - // elements until we've addressed the type. - String name = tokenizer.consumeIdentifier(); - while (tokenizer.tryConsume(".")) { - name += "." + tokenizer.consumeIdentifier(); - } - if (tokenizer.tryConsume("/")) { - name += "/" + tokenizer.consumeIdentifier(); - while (tokenizer.tryConsume(".")) { - name += "." + tokenizer.consumeIdentifier(); - } - } - tokenizer.consume("]"); - - return name; - } - /** * Parse a one or more field values from {@code tokenizer} and merge it into {@code builder}. */ @@ -1992,8 +1943,7 @@ public final class TextFormat { final FieldDescriptor field, final ExtensionRegistry.ExtensionInfo extension, final TextFormatParseInfoTree.Builder parseTreeBuilder, - List unknownFields, - int recursionLimit) + List unknownFields) throws ParseException { // Support specifying repeated field values as a comma-separated list. // Ex."foo: [1, 2, 3]" @@ -2007,8 +1957,7 @@ public final class TextFormat { field, extension, parseTreeBuilder, - unknownFields, - recursionLimit); + unknownFields); if (tokenizer.tryConsume("]")) { // End of list. break; @@ -2024,8 +1973,7 @@ public final class TextFormat { field, extension, parseTreeBuilder, - unknownFields, - recursionLimit); + unknownFields); } } @@ -2037,8 +1985,7 @@ public final class TextFormat { final FieldDescriptor field, final ExtensionRegistry.ExtensionInfo extension, final TextFormatParseInfoTree.Builder parseTreeBuilder, - List unknownFields, - int recursionLimit) + List unknownFields) throws ParseException { if (singularOverwritePolicy == SingularOverwritePolicy.FORBID_SINGULAR_OVERWRITES && !field.isRepeated()) { @@ -2062,10 +2009,6 @@ public final class TextFormat { Object value = null; if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { - if (recursionLimit < 1) { - throw tokenizer.parseException("Message is nested too deep"); - } - final String endToken; if (tokenizer.tryConsume("<")) { endToken = ">"; @@ -2074,24 +2017,32 @@ public final class TextFormat { endToken = "}"; } - Message defaultInstance = (extension == null) ? null : extension.defaultInstance; - MessageReflection.MergeTarget subField = - target.newMergeTargetForField(field, defaultInstance); + // Try to parse human readable format of Any in the form: [type_url]: { ... } + if (field.getMessageType().getFullName().equals("google.protobuf.Any") + && tokenizer.tryConsume("[")) { + // Use Proto reflection here since depending on Any would intoduce a cyclic dependency + // (java_proto_library for any_java_proto depends on the protobuf_impl). + Message anyBuilder = DynamicMessage.getDefaultInstance(field.getMessageType()); + MessageReflection.MergeTarget anyField = target.newMergeTargetForField(field, anyBuilder); + mergeAnyFieldValue(tokenizer, extensionRegistry, anyField, parseTreeBuilder, + unknownFields, field.getMessageType()); + value = anyField.finish(); + tokenizer.consume(endToken); + } else { + Message defaultInstance = (extension == null) ? null : extension.defaultInstance; + MessageReflection.MergeTarget subField = + target.newMergeTargetForField(field, defaultInstance); - while (!tokenizer.tryConsume(endToken)) { - if (tokenizer.atEnd()) { - throw tokenizer.parseException("Expected \"" + endToken + "\"."); + while (!tokenizer.tryConsume(endToken)) { + if (tokenizer.atEnd()) { + throw tokenizer.parseException("Expected \"" + endToken + "\"."); + } + mergeField(tokenizer, extensionRegistry, subField, parseTreeBuilder, unknownFields); } - mergeField( - tokenizer, - extensionRegistry, - subField, - parseTreeBuilder, - unknownFields, - recursionLimit - 1); + + value = subField.finish(); } - value = subField.finish(); } else { switch (field.getType()) { case INT32: @@ -2189,7 +2140,7 @@ public final class TextFormat { } if (field.isRepeated()) { - // TODO: If field.isMapField() and FORBID_SINGULAR_OVERWRITES mode, + // TODO(b/29122459): If field.isMapField() and FORBID_SINGULAR_OVERWRITES mode, // check for duplicate map keys here. target.addRepeatedField(field, value); } else { @@ -2203,8 +2154,7 @@ public final class TextFormat { MergeTarget target, final TextFormatParseInfoTree.Builder parseTreeBuilder, List unknownFields, - Descriptor anyDescriptor, - int recursionLimit) + Descriptor anyDescriptor) throws ParseException { // Try to parse human readable format of Any in the form: [type_url]: { ... } StringBuilder typeUrlBuilder = new StringBuilder(); @@ -2222,7 +2172,6 @@ public final class TextFormat { throw tokenizer.parseExceptionPreviousToken("Expected a valid type URL."); } } - detectSilentMarker(tokenizer, anyDescriptor, typeUrlBuilder.toString()); tokenizer.tryConsume(":"); final String anyEndToken; if (tokenizer.tryConsume("<")) { @@ -2250,13 +2199,7 @@ public final class TextFormat { MessageReflection.BuilderAdapter contentTarget = new MessageReflection.BuilderAdapter(contentBuilder); while (!tokenizer.tryConsume(anyEndToken)) { - mergeField( - tokenizer, - extensionRegistry, - contentTarget, - parseTreeBuilder, - unknownFields, - recursionLimit); + mergeField(tokenizer, extensionRegistry, contentTarget, parseTreeBuilder, unknownFields); } target.setField(anyDescriptor.findFieldByName("type_url"), typeUrlBuilder.toString()); @@ -2265,12 +2208,28 @@ public final class TextFormat { } /** Skips the next field including the field's name and value. */ - private void skipField(Tokenizer tokenizer, Descriptor type, int recursionLimit) - throws ParseException { - String name = consumeFullTypeName(tokenizer); - detectSilentMarker(tokenizer, type, name); - guessFieldTypeAndSkip(tokenizer, type, recursionLimit); + private static void skipField(Tokenizer tokenizer) throws ParseException { + if (tokenizer.tryConsume("[")) { + // Extension name. + do { + tokenizer.consumeIdentifier(); + } while (tokenizer.tryConsume(".")); + tokenizer.consume("]"); + } else { + tokenizer.consumeIdentifier(); + } + // Try to guess the type of this field. + // If this field is not a message, there should be a ":" between the + // field name and the field value and also the field value should not + // start with "{" or "<" which indicates the beginning of a message body. + // If there is no ":" or there is a "{" or "<" after ":", this field has + // to be a message or the input is ill-formed. + if (tokenizer.tryConsume(":") && !tokenizer.lookingAt("<") && !tokenizer.lookingAt("{")) { + skipFieldValue(tokenizer); + } else { + skipFieldMessage(tokenizer); + } // For historical reasons, fields may optionally be separated by commas or // semicolons. if (!tokenizer.tryConsume(";")) { @@ -2281,8 +2240,7 @@ public final class TextFormat { /** * Skips the whole body of a message including the beginning delimiter and the ending delimiter. */ - private void skipFieldMessage(Tokenizer tokenizer, Descriptor type, int recursionLimit) - throws ParseException { + private static void skipFieldMessage(Tokenizer tokenizer) throws ParseException { final String delimiter; if (tokenizer.tryConsume("<")) { delimiter = ">"; @@ -2291,15 +2249,18 @@ public final class TextFormat { delimiter = "}"; } while (!tokenizer.lookingAt(">") && !tokenizer.lookingAt("}")) { - skipField(tokenizer, type, recursionLimit); + skipField(tokenizer); } tokenizer.consume(delimiter); } /** Skips a field value. */ - private void skipFieldValue(Tokenizer tokenizer) throws ParseException { - if (!tokenizer.tryConsumeByteString() - && !tokenizer.tryConsumeIdentifier() // includes enum & boolean + private static void skipFieldValue(Tokenizer tokenizer) throws ParseException { + if (tokenizer.tryConsumeString()) { + while (tokenizer.tryConsumeString()) {} + return; + } + if (!tokenizer.tryConsumeIdentifier() // includes enum & boolean && !tokenizer.tryConsumeInt64() // includes int32 && !tokenizer.tryConsumeUInt64() // includes uint32 && !tokenizer.tryConsumeDouble() @@ -2307,66 +2268,6 @@ public final class TextFormat { throw tokenizer.parseException("Invalid field value: " + tokenizer.currentToken); } } - - /** - * Tries to guess the type of this field and skip it. - * - *

    If this field is not a message, there should be a ":" between the field name and the field - * value and also the field value should not start with "{" or "<" which indicates the beginning - * of a message body. If there is no ":" or there is a "{" or "<" after ":", this field has to - * be a message or the input is ill-formed. For short-formed repeated fields (i.e. with "[]"), - * if it is repeated scalar, there must be a ":" between the field name and the starting "[" . - */ - private void guessFieldTypeAndSkip(Tokenizer tokenizer, Descriptor type, int recursionLimit) - throws ParseException { - boolean semicolonConsumed = tokenizer.tryConsume(":"); - if (tokenizer.lookingAt("[")) { - // Short repeated field form. If a semicolon was consumed, it could be repeated scalar or - // repeated message. If not, it must be repeated message. - skipFieldShortFormedRepeated(tokenizer, semicolonConsumed, type, recursionLimit); - } else if (semicolonConsumed && !tokenizer.lookingAt("{") && !tokenizer.lookingAt("<")) { - skipFieldValue(tokenizer); - } else { - if (recursionLimit < 1) { - throw tokenizer.parseException("Message is nested too deep"); - } - skipFieldMessage(tokenizer, type, recursionLimit - 1); - } - } - - /** - * Skips a short-formed repeated field value. - * - *

    Reports an error if scalar type is not allowed but showing up inside "[]". - */ - private void skipFieldShortFormedRepeated( - Tokenizer tokenizer, boolean scalarAllowed, Descriptor type, int recursionLimit) - throws ParseException { - if (!tokenizer.tryConsume("[") || tokenizer.tryConsume("]")) { - // Try skipping "[]". - return; - } - - while (true) { - if (tokenizer.lookingAt("{") || tokenizer.lookingAt("<")) { - // Try skipping message field inside "[]" - if (recursionLimit < 1) { - throw tokenizer.parseException("Message is nested too deep"); - } - skipFieldMessage(tokenizer, type, recursionLimit - 1); - } else if (scalarAllowed) { - // Try skipping scalar field inside "[]". - skipFieldValue(tokenizer); - } else { - throw tokenizer.parseException( - "Invalid repeated scalar field: missing \":\" before \"[\"."); - } - if (tokenizer.tryConsume("]")) { - break; - } - tokenizer.consume(","); - } - } } // ================================================================= @@ -2394,7 +2295,7 @@ public final class TextFormat { * Un-escape a byte sequence as escaped using {@link #escapeBytes(ByteString)}. Two-digit hex * escapes (starting with "\x") are also recognized. */ - public static ByteString unescapeBytes(CharSequence charString) + public static ByteString unescapeBytes(final CharSequence charString) throws InvalidEscapeSequenceException { // First convert the Java character sequence to UTF-8 bytes. ByteString input = ByteString.copyFromUtf8(charString.toString()); @@ -2458,9 +2359,6 @@ public final class TextFormat { case '"': result[pos++] = '\"'; break; - case '?': - result[pos++] = '?'; - break; case 'x': // hex escape @@ -2493,12 +2391,11 @@ public final class TextFormat { | digitValue(input.byteAt(i + 1)) << 8 | digitValue(input.byteAt(i + 2)) << 4 | digitValue(input.byteAt(i + 3))); - - if (ch >= Character.MIN_SURROGATE && ch <= Character.MAX_SURROGATE) { + if (Character.isSurrogate(ch)) { throw new InvalidEscapeSequenceException( "Invalid escape sequence: '\\u' refers to a surrogate"); } - byte[] chUtf8 = Character.toString(ch).getBytes(Internal.UTF_8); + byte[] chUtf8 = Character.toString(ch).getBytes(UTF_8); System.arraycopy(chUtf8, 0, result, pos, chUtf8.length); pos += chUtf8.length; i += 3; @@ -2531,11 +2428,9 @@ public final class TextFormat { + "' is not a valid code point value"); } Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of(codepoint); - if (unicodeBlock != null - && (unicodeBlock.equals(Character.UnicodeBlock.LOW_SURROGATES) - || unicodeBlock.equals(Character.UnicodeBlock.HIGH_SURROGATES) - || unicodeBlock.equals( - Character.UnicodeBlock.HIGH_PRIVATE_USE_SURROGATES))) { + if (unicodeBlock.equals(Character.UnicodeBlock.LOW_SURROGATES) + || unicodeBlock.equals(Character.UnicodeBlock.HIGH_SURROGATES) + || unicodeBlock.equals(Character.UnicodeBlock.HIGH_PRIVATE_USE_SURROGATES)) { throw new InvalidEscapeSequenceException( "Invalid escape sequence: '\\U" + input.substring(i, i + 8).toStringUtf8() @@ -2543,7 +2438,7 @@ public final class TextFormat { } int[] codepoints = new int[1]; codepoints[0] = codepoint; - byte[] chUtf8 = new String(codepoints, 0, 1).getBytes(Internal.UTF_8); + byte[] chUtf8 = new String(codepoints, 0, 1).getBytes(UTF_8); System.arraycopy(chUtf8, 0, result, pos, chUtf8.length); pos += chUtf8.length; i += 7; diff --git a/java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java b/java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java index 8e43fb01a904f02af63eb5567cab1bb9b3c699b4..2501ec936c6314ee9545384e36421108e0df097c 100644 --- a/java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java +++ b/java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java @@ -1,30 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -/** - * Provide text format escaping of proto instances. These ASCII characters are escaped: - * - * ASCII #7 (bell) --> \a - * ASCII #8 (backspace) --> \b - * ASCII #9 (horizontal tab) --> \t - * ASCII #10 (linefeed) --> \n - * ASCII #11 (vertical tab) --> \v - * ASCII #13 (carriage return) --> \r - * ASCII #12 (formfeed) --> \f - * ASCII #34 (apostrophe) --> \' - * ASCII #39 (straight double quote) --> \" - * ASCII #92 (backslash) --> \\ - * - * Other printable ASCII characters between 32 and 127 inclusive are output as is, unescaped. - * Other ASCII characters less than 32 and all Unicode characters 128 or greater are - * first encoded as UTF-8, then each byte is escaped individually as a 3-digit octal escape. - */ +/** Provide text format escaping support for proto2 instances. */ final class TextFormatEscaper { private TextFormatEscaper() {} @@ -35,13 +41,17 @@ final class TextFormatEscaper { } /** - * Backslash escapes bytes in the format used in protocol buffer text format. + * Escapes bytes in the format used in protocol buffer text format, which is the same as the + * format used for C string literals. All bytes that are not printable 7-bit ASCII characters are + * escaped, as well as backslash, single-quote, and double-quote characters. Characters for which + * no defined short-hand escape sequence is defined will be escaped using 3-digit octal sequences. */ - static String escapeBytes(ByteSequence input) { + static String escapeBytes(final ByteSequence input) { final StringBuilder builder = new StringBuilder(input.size()); for (int i = 0; i < input.size(); i++) { - byte b = input.byteAt(i); + final byte b = input.byteAt(i); switch (b) { + // Java does not recognize \a or \v, apparently. case 0x07: builder.append("\\a"); break; @@ -90,7 +100,10 @@ final class TextFormatEscaper { } /** - * Backslash escapes bytes in the format used in protocol buffer text format. + * Escapes bytes in the format used in protocol buffer text format, which is the same as the + * format used for C string literals. All bytes that are not printable 7-bit ASCII characters are + * escaped, as well as backslash, single-quote, and double-quote characters. Characters for which + * no defined short-hand escape sequence is defined will be escaped using 3-digit octal sequences. */ static String escapeBytes(final ByteString input) { return escapeBytes( @@ -124,14 +137,16 @@ final class TextFormatEscaper { } /** - * Like {@link #escapeBytes(ByteString)}, but escapes a text string. + * Like {@link #escapeBytes(ByteString)}, but escapes a text string. Non-ASCII characters are + * first encoded as UTF-8, then each byte is escaped individually as a 3-digit octal escape. Yes, + * it's weird. */ - static String escapeText(String input) { + static String escapeText(final String input) { return escapeBytes(ByteString.copyFromUtf8(input)); } /** Escape double quotes and backslashes in a String for unicode output of a message. */ - static String escapeDoubleQuotesAndBackslashes(String input) { + static String escapeDoubleQuotesAndBackslashes(final String input) { return input.replace("\\", "\\\\").replace("\"", "\\\""); } } diff --git a/java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java b/java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java index 5d54947a0fcf6b8edf8cec382f60151dd833869c..6ce9f783ac246798526921aaf6b64f7d85d164c9 100644 --- a/java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java +++ b/java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -67,7 +90,7 @@ public class TextFormatParseInfoTree { /** * Retrieve all the locations of a field. * - * @param fieldDescriptor the {@link FieldDescriptor} of the desired field + * @param fieldDescriptor the @{link FieldDescriptor} of the desired field * @return a list of the locations of values of the field. If there are not values or the field * doesn't exist, an empty list is returned. */ @@ -82,7 +105,7 @@ public class TextFormatParseInfoTree { *

    Returns the {@link TextFormatParseLocation} for index-th value of the field in the parsed * text. * - * @param fieldDescriptor the {@link FieldDescriptor} of the desired field + * @param fieldDescriptor the @{link FieldDescriptor} of the desired field * @param index the index of the value. * @return the {@link TextFormatParseLocation} of the value * @throws IllegalArgumentException index is out of range @@ -94,7 +117,7 @@ public class TextFormatParseInfoTree { /** * Retrieve a list of all the location information trees for a sub message field. * - * @param fieldDescriptor the {@link FieldDescriptor} of the desired field + * @param fieldDescriptor the @{link FieldDescriptor} of the desired field * @return A list of {@link TextFormatParseInfoTree} */ public List getNestedTrees(final FieldDescriptor fieldDescriptor) { @@ -105,7 +128,7 @@ public class TextFormatParseInfoTree { /** * Returns the parse info tree for the given field, which must be a message type. * - * @param fieldDescriptor the {@link FieldDescriptor} of the desired sub message + * @param fieldDescriptor the @{link FieldDescriptor} of the desired sub message * @param index the index of message value. * @return the {@code ParseInfoTree} of the message value. {@code null} is returned if the field * doesn't exist or the index is out of range. diff --git a/java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java b/java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java index 154efaa5519627f21e1be061231f5a0ed618ce23..eebfb1b54580f4d03e2ace06801010bf97be28ca 100644 --- a/java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java +++ b/java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/TypeRegistry.java b/java/core/src/main/java/com/google/protobuf/TypeRegistry.java index 98a59c479062b69c0a072a908d10186107aba9e6..422ff1f870fc5af2db7c07e5946df057b93050bc 100644 --- a/java/core/src/main/java/com/google/protobuf/TypeRegistry.java +++ b/java/core/src/main/java/com/google/protobuf/TypeRegistry.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -32,6 +55,7 @@ public class TypeRegistry { return EmptyTypeRegistryHolder.EMPTY; } + public static Builder newBuilder() { return new Builder(); } @@ -59,7 +83,7 @@ public class TypeRegistry { private static String getTypeName(String typeUrl) throws InvalidProtocolBufferException { String[] parts = typeUrl.split("/"); - if (parts.length <= 1) { + if (parts.length == 1) { throw new InvalidProtocolBufferException("Invalid type url found: " + typeUrl); } return parts[parts.length - 1]; diff --git a/java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java b/java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java index 35d57624d0c2dd1542667cf381fcf95f5bb6e4ca..c633a4e8902eb857b32ba1ed3b1677bd681bc06f 100644 --- a/java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java +++ b/java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java b/java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java index c4ec645bf7fc8e5db19d2a837ed3111cdda00f24..e736d5ce9cdca0fd24f88c5e843e3cbf0e44cb2b 100644 --- a/java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java +++ b/java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java @@ -1,16 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import java.io.IOException; @ExperimentalApi -@CheckReturnValue abstract class UnknownFieldSchema { /** Whether unknown fields should be dropped. */ diff --git a/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java b/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java index 10fd7a7f62ede1751329ee5adb72031fcdfa7218..5c482d62dab523c431232cf3bd365b7d6772744e 100644 --- a/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java +++ b/java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -39,7 +62,7 @@ public final class UnknownFieldSet implements MessageLite { /** * Construct an {@code UnknownFieldSet} around the given map. */ - private UnknownFieldSet(TreeMap fields) { + UnknownFieldSet(TreeMap fields) { this.fields = fields; } @@ -66,6 +89,7 @@ public final class UnknownFieldSet implements MessageLite { private static final UnknownFieldSet defaultInstance = new UnknownFieldSet(new TreeMap()); + @Override public boolean equals(Object other) { if (this == other) { @@ -730,7 +754,7 @@ public final class UnknownFieldSet implements MessageLite { */ public ByteString toByteString(int fieldNumber) { try { - // TODO: consider caching serialized size in a volatile long + // TODO(lukes): consider caching serialized size in a volatile long ByteString.CodedBuilder out = ByteString.newCodedBuilder(getSerializedSize(fieldNumber)); writeTo(fieldNumber, out.getCodedOutput()); diff --git a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java index 36c9481d7e4ecee02a15f76298b3be48a6804204..37a14e214e4fd2b2b1714e64f70a40cea35047e6 100644 --- a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java +++ b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -23,7 +46,7 @@ import java.util.Arrays; public final class UnknownFieldSetLite { // Arbitrarily chosen. - // TODO: Tune this number? + // TODO(dweis): Tune this number? private static final int MIN_CAPACITY = 8; private static final UnknownFieldSetLite DEFAULT_INSTANCE = @@ -90,9 +113,7 @@ public final class UnknownFieldSetLite { *

    Future calls to methods that attempt to modify this object will throw. */ public void makeImmutable() { - if (this.isMutable) { - this.isMutable = false; - } + this.isMutable = false; } /** Throws an {@link UnsupportedOperationException} if immutable. */ @@ -209,7 +230,7 @@ public final class UnknownFieldSetLite { } break; default: - // TODO: Change writeTo to throw IOException? + // TODO(liujisi): Change writeTo to throw IOException? throw new RuntimeException(InvalidProtocolBufferException.invalidWireType()); } } @@ -477,7 +498,6 @@ public final class UnknownFieldSetLite { return this; } - @CanIgnoreReturnValue UnknownFieldSetLite mergeFrom(UnknownFieldSetLite other) { if (other.equals(getDefaultInstance())) { return this; diff --git a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java index de2845bb96256ba9907c16e4195f6cad79736a2d..2cfdeca2450aea8447a853315f06562c418c3ea7 100644 --- a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java +++ b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java @@ -1,15 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import java.io.IOException; -@CheckReturnValue class UnknownFieldSetLiteSchema extends UnknownFieldSchema { diff --git a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java index e1eccccea3831e216f33a32d5064be77b8ab3af7..b838c4b54a49029ecb94ddba708f97ea53118ba0 100644 --- a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java +++ b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -11,7 +34,11 @@ import java.io.IOException; class UnknownFieldSetSchema extends UnknownFieldSchema { - public UnknownFieldSetSchema() {} + private final boolean proto3; + + public UnknownFieldSetSchema(boolean proto3) { + this.proto3 = proto3; + } @Override boolean shouldDiscardUnknownFields(Reader reader) { diff --git a/java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java b/java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java index a4e2a71c92e35d1b409c806ded100a2b71aa73a7..415b2cde0de3541eb5abbc8cf9793f01aae47461 100644 --- a/java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java +++ b/java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -20,9 +43,7 @@ import java.util.RandomAccess; * it cannot be modified via the wrapper. * * @author jonp@google.com (Jon Perlow) - * @deprecated use {@link LazyStringArrayList#makeImmutable} instead. */ -@Deprecated public class UnmodifiableLazyStringList extends AbstractList implements LazyStringList, RandomAccess { diff --git a/java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java b/java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java index 06121780f5bde063f0cf0610b87f334cf1d054bb..bcaf1d2f33d8325abb1d4b8a02fd66d300052737 100644 --- a/java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java +++ b/java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -12,7 +35,7 @@ import java.nio.ByteBuffer; /** * Provides a number of unsafe byte operations to be used by advanced applications with high - * performance requirements. These methods are referred to as "unsafe" because they + * performance requirements. These methods are referred to as "unsafe" due to the fact that they * potentially expose the backing buffer of a {@link ByteString} to the application. * *

    DISCLAIMER: The methods in this class should only be called if it is @@ -20,7 +43,7 @@ import java.nio.ByteBuffer; * ByteString} can lead to unexpected and undesirable consequences in your application, and will * likely be difficult to debug. Proceed with caution! * - *

    This can have a number of significant side effects that have spooky-action-at-a-distance-like + *

    This can have a number of significant side affects that have spooky-action-at-a-distance-like * behavior. In particular, if the bytes value changes out from under a Protocol Buffer: * *

      @@ -94,4 +117,5 @@ public final class UnsafeByteOperations { public static void unsafeWriteTo(ByteString bytes, ByteOutput output) throws IOException { bytes.writeTo(output); } + } diff --git a/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java b/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java index 2bf7979acb28121ff1e3dba4cd133cfb4aae1f0c..471238ae4325d6c6c226c3b6791a45ce76ce99d1 100644 --- a/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java +++ b/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -309,21 +332,86 @@ final class UnsafeUtil { return new JvmMemoryAccessor(UNSAFE); } + /** Indicates whether or not unsafe array operations are supported on this platform. */ private static boolean supportsUnsafeArrayOperations() { - if (MEMORY_ACCESSOR == null) { + if (UNSAFE == null) { return false; } - return MEMORY_ACCESSOR.supportsUnsafeArrayOperations(); + try { + Class clazz = UNSAFE.getClass(); + clazz.getMethod("objectFieldOffset", Field.class); + clazz.getMethod("arrayBaseOffset", Class.class); + clazz.getMethod("arrayIndexScale", Class.class); + clazz.getMethod("getInt", Object.class, long.class); + clazz.getMethod("putInt", Object.class, long.class, int.class); + clazz.getMethod("getLong", Object.class, long.class); + clazz.getMethod("putLong", Object.class, long.class, long.class); + clazz.getMethod("getObject", Object.class, long.class); + clazz.getMethod("putObject", Object.class, long.class, Object.class); + if (Android.isOnAndroidDevice()) { + return true; + } + clazz.getMethod("getByte", Object.class, long.class); + clazz.getMethod("putByte", Object.class, long.class, byte.class); + clazz.getMethod("getBoolean", Object.class, long.class); + clazz.getMethod("putBoolean", Object.class, long.class, boolean.class); + clazz.getMethod("getFloat", Object.class, long.class); + clazz.getMethod("putFloat", Object.class, long.class, float.class); + clazz.getMethod("getDouble", Object.class, long.class); + clazz.getMethod("putDouble", Object.class, long.class, double.class); + + return true; + } catch (Throwable e) { + // Because log statements are fairly sparse in this class, this logger is initialized + // non-statically. Static initialization adds undue runtime costs to the first client to + // initialize this class. + Logger.getLogger(UnsafeUtil.class.getName()) + .log( + Level.WARNING, + "platform method missing - proto runtime falling back to safer methods: " + e); + } + return false; } private static boolean supportsUnsafeByteBufferOperations() { - if (MEMORY_ACCESSOR == null) { + if (UNSAFE == null) { return false; } - return MEMORY_ACCESSOR.supportsUnsafeByteBufferOperations(); + try { + Class clazz = UNSAFE.getClass(); + // Methods for getting direct buffer address. + clazz.getMethod("objectFieldOffset", Field.class); + clazz.getMethod("getLong", Object.class, long.class); + + if (bufferAddressField() == null) { + return false; + } + + if (Android.isOnAndroidDevice()) { + return true; + } + clazz.getMethod("getByte", long.class); + clazz.getMethod("putByte", long.class, byte.class); + clazz.getMethod("getInt", long.class); + clazz.getMethod("putInt", long.class, int.class); + clazz.getMethod("getLong", long.class); + clazz.getMethod("putLong", long.class, long.class); + clazz.getMethod("copyMemory", long.class, long.class, long.class); + clazz.getMethod("copyMemory", Object.class, long.class, Object.class, long.class, long.class); + return true; + } catch (Throwable e) { + // Because log statements are fairly sparse in this class, this logger is initialized + // non-statically. Static initialization adds undue runtime costs to the first client to + // initialize this class. + Logger.getLogger(UnsafeUtil.class.getName()) + .log( + Level.WARNING, + "platform method missing - proto runtime falling back to safer methods: " + e); + } + return false; } - static boolean determineAndroidSupportByAddressSize(Class addressClass) { + private static boolean determineAndroidSupportByAddressSize(Class addressClass) { if (!Android.isOnAndroidDevice()) { return false; } @@ -465,43 +553,6 @@ final class UnsafeUtil { return unsafe.objectFieldOffset(field); } - public final int arrayBaseOffset(Class clazz) { - return unsafe.arrayBaseOffset(clazz); - } - - public final int arrayIndexScale(Class clazz) { - return unsafe.arrayIndexScale(clazz); - } - - public abstract Object getStaticObject(Field field); - - // Relative Address Operations --------------------------------------------- - - // Indicates whether the following relative address operations are supported - // by this memory accessor. - public boolean supportsUnsafeArrayOperations() { - if (unsafe == null) { - return false; - } - try { - Class clazz = unsafe.getClass(); - clazz.getMethod("objectFieldOffset", Field.class); - clazz.getMethod("arrayBaseOffset", Class.class); - clazz.getMethod("arrayIndexScale", Class.class); - clazz.getMethod("getInt", Object.class, long.class); - clazz.getMethod("putInt", Object.class, long.class, int.class); - clazz.getMethod("getLong", Object.class, long.class); - clazz.getMethod("putLong", Object.class, long.class, long.class); - clazz.getMethod("getObject", Object.class, long.class); - clazz.getMethod("putObject", Object.class, long.class, Object.class); - - return true; - } catch (Throwable e) { - logMissingMethod(e); - } - return false; - } - public abstract byte getByte(Object target, long offset); public abstract void putByte(Object target, long offset, byte value); @@ -542,29 +593,12 @@ final class UnsafeUtil { unsafe.putObject(target, offset, value); } - // Absolute Address Operations -------------------------------------------- - - // Indicates whether the following absolute address operations are - // supported by this memory accessor. - public boolean supportsUnsafeByteBufferOperations() { - if (unsafe == null) { - return false; - } - try { - Class clazz = unsafe.getClass(); - // Methods for getting direct buffer address. - clazz.getMethod("objectFieldOffset", Field.class); - clazz.getMethod("getLong", Object.class, long.class); - - if (bufferAddressField() == null) { - return false; - } + public final int arrayBaseOffset(Class clazz) { + return unsafe.arrayBaseOffset(clazz); + } - return true; - } catch (Throwable e) { - logMissingMethod(e); - } - return false; + public final int arrayIndexScale(Class clazz) { + return unsafe.arrayIndexScale(clazz); } public abstract byte getByte(long address); @@ -579,6 +613,8 @@ final class UnsafeUtil { public abstract void putLong(long address, long value); + public abstract Object getStaticObject(Field field); + public abstract void copyMemory(long srcOffset, byte[] target, long targetIndex, long length); public abstract void copyMemory(byte[] src, long srcIndex, long targetOffset, long length); @@ -591,32 +627,33 @@ final class UnsafeUtil { } @Override - public Object getStaticObject(Field field) { - return getObject(unsafe.staticFieldBase(field), unsafe.staticFieldOffset(field)); + public byte getByte(long address) { + return unsafe.getByte(address); } @Override - public boolean supportsUnsafeArrayOperations() { - if (!super.supportsUnsafeArrayOperations()) { - return false; - } + public void putByte(long address, byte value) { + unsafe.putByte(address, value); + } - try { - Class clazz = unsafe.getClass(); - clazz.getMethod("getByte", Object.class, long.class); - clazz.getMethod("putByte", Object.class, long.class, byte.class); - clazz.getMethod("getBoolean", Object.class, long.class); - clazz.getMethod("putBoolean", Object.class, long.class, boolean.class); - clazz.getMethod("getFloat", Object.class, long.class); - clazz.getMethod("putFloat", Object.class, long.class, float.class); - clazz.getMethod("getDouble", Object.class, long.class); - clazz.getMethod("putDouble", Object.class, long.class, double.class); + @Override + public int getInt(long address) { + return unsafe.getInt(address); + } - return true; - } catch (Throwable e) { - logMissingMethod(e); - } - return false; + @Override + public void putInt(long address, int value) { + unsafe.putInt(address, value); + } + + @Override + public long getLong(long address) { + return unsafe.getLong(address); + } + + @Override + public void putLong(long address, long value) { + unsafe.putLong(address, value); } @Override @@ -660,83 +697,55 @@ final class UnsafeUtil { } @Override - public boolean supportsUnsafeByteBufferOperations() { - if (!super.supportsUnsafeByteBufferOperations()) { - return false; - } - - try { - Class clazz = unsafe.getClass(); - clazz.getMethod("getByte", long.class); - clazz.getMethod("putByte", long.class, byte.class); - clazz.getMethod("getInt", long.class); - clazz.getMethod("putInt", long.class, int.class); - clazz.getMethod("getLong", long.class); - clazz.getMethod("putLong", long.class, long.class); - clazz.getMethod("copyMemory", long.class, long.class, long.class); - clazz.getMethod( - "copyMemory", Object.class, long.class, Object.class, long.class, long.class); - return true; - } catch (Throwable e) { - logMissingMethod(e); - } - return false; + public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) { + unsafe.copyMemory(null, srcOffset, target, BYTE_ARRAY_BASE_OFFSET + targetIndex, length); } @Override - public byte getByte(long address) { - return unsafe.getByte(address); + public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) { + unsafe.copyMemory(src, BYTE_ARRAY_BASE_OFFSET + srcIndex, null, targetOffset, length); } @Override - public void putByte(long address, byte value) { - unsafe.putByte(address, value); + public Object getStaticObject(Field field) { + return getObject(unsafe.staticFieldBase(field), unsafe.staticFieldOffset(field)); } + } - @Override - public int getInt(long address) { - return unsafe.getInt(address); - } + private static final class Android64MemoryAccessor extends MemoryAccessor { - @Override - public void putInt(long address, int value) { - unsafe.putInt(address, value); + Android64MemoryAccessor(sun.misc.Unsafe unsafe) { + super(unsafe); } @Override - public long getLong(long address) { - return unsafe.getLong(address); + public byte getByte(long address) { + throw new UnsupportedOperationException(); } @Override - public void putLong(long address, long value) { - unsafe.putLong(address, value); + public void putByte(long address, byte value) { + throw new UnsupportedOperationException(); } @Override - public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) { - unsafe.copyMemory(null, srcOffset, target, BYTE_ARRAY_BASE_OFFSET + targetIndex, length); + public int getInt(long address) { + throw new UnsupportedOperationException(); } @Override - public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) { - unsafe.copyMemory(src, BYTE_ARRAY_BASE_OFFSET + srcIndex, null, targetOffset, length); + public void putInt(long address, int value) { + throw new UnsupportedOperationException(); } - } - - private static final class Android64MemoryAccessor extends MemoryAccessor { - Android64MemoryAccessor(sun.misc.Unsafe unsafe) { - super(unsafe); + @Override + public long getLong(long address) { + throw new UnsupportedOperationException(); } @Override - public Object getStaticObject(Field field) { - try { - return field.get(null); - } catch (IllegalAccessException e) { - return null; - } + public void putLong(long address, long value) { + throw new UnsupportedOperationException(); } @Override @@ -796,72 +805,67 @@ final class UnsafeUtil { } @Override - public boolean supportsUnsafeByteBufferOperations() { - return false; + public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) { + throw new UnsupportedOperationException(); } @Override - public byte getByte(long address) { + public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) { throw new UnsupportedOperationException(); } @Override - public void putByte(long address, byte value) { - throw new UnsupportedOperationException(); + public Object getStaticObject(Field field) { + try { + return field.get(null); + } catch (IllegalAccessException e) { + return null; + } } + } - @Override - public int getInt(long address) { - throw new UnsupportedOperationException(); + private static final class Android32MemoryAccessor extends MemoryAccessor { + + /** Mask used to convert a 64 bit memory address to a 32 bit address. */ + private static final long SMALL_ADDRESS_MASK = 0x00000000FFFFFFFF; + + /** Truncate a {@code long} address into a short {@code int} address. */ + private static int smallAddress(long address) { + return (int) (SMALL_ADDRESS_MASK & address); } - @Override - public void putInt(long address, int value) { - throw new UnsupportedOperationException(); + Android32MemoryAccessor(sun.misc.Unsafe unsafe) { + super(unsafe); } @Override - public long getLong(long address) { + public byte getByte(long address) { throw new UnsupportedOperationException(); } @Override - public void putLong(long address, long value) { + public void putByte(long address, byte value) { throw new UnsupportedOperationException(); } @Override - public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) { + public int getInt(long address) { throw new UnsupportedOperationException(); } @Override - public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) { + public void putInt(long address, int value) { throw new UnsupportedOperationException(); } - } - - private static final class Android32MemoryAccessor extends MemoryAccessor { - - /** Mask used to convert a 64 bit memory address to a 32 bit address. */ - private static final long SMALL_ADDRESS_MASK = 0x00000000FFFFFFFF; - - /** Truncate a {@code long} address into a short {@code int} address. */ - private static int smallAddress(long address) { - return (int) (SMALL_ADDRESS_MASK & address); - } - Android32MemoryAccessor(sun.misc.Unsafe unsafe) { - super(unsafe); + @Override + public long getLong(long address) { + throw new UnsupportedOperationException(); } @Override - public Object getStaticObject(Field field) { - try { - return field.get(null); - } catch (IllegalAccessException e) { - return null; - } + public void putLong(long address, long value) { + throw new UnsupportedOperationException(); } @Override @@ -921,48 +925,22 @@ final class UnsafeUtil { } @Override - public boolean supportsUnsafeByteBufferOperations() { - return false; - } - - @Override - public byte getByte(long address) { - throw new UnsupportedOperationException(); - } - - @Override - public void putByte(long address, byte value) { - throw new UnsupportedOperationException(); - } - - @Override - public int getInt(long address) { - throw new UnsupportedOperationException(); - } - - @Override - public void putInt(long address, int value) { - throw new UnsupportedOperationException(); - } - - @Override - public long getLong(long address) { - throw new UnsupportedOperationException(); - } - - @Override - public void putLong(long address, long value) { + public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) { throw new UnsupportedOperationException(); } @Override - public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) { + public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) { throw new UnsupportedOperationException(); } @Override - public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) { - throw new UnsupportedOperationException(); + public Object getStaticObject(Field field) { + try { + return field.get(null); + } catch (IllegalAccessException e) { + return null; + } } } @@ -1003,11 +981,4 @@ final class UnsafeUtil { private static void putBooleanLittleEndian(Object target, long offset, boolean value) { putByteLittleEndian(target, offset, (byte) (value ? 1 : 0)); } - - private static void logMissingMethod(Throwable e) { - Logger.getLogger(UnsafeUtil.class.getName()) - .log( - Level.WARNING, - "platform method missing - proto runtime falling back to safer methods: " + e); - } } diff --git a/java/core/src/main/java/com/google/protobuf/Utf8.java b/java/core/src/main/java/com/google/protobuf/Utf8.java index f71820ef9f17262b2ec43d09f16e9fbf1237622a..104ab098325acd9e15f54477945a4bf19a8c08a7 100644 --- a/java/core/src/main/java/com/google/protobuf/Utf8.java +++ b/java/core/src/main/java/com/google/protobuf/Utf8.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -19,7 +42,6 @@ import static java.lang.Character.isSurrogatePair; import static java.lang.Character.toCodePoint; import java.nio.ByteBuffer; -import java.util.Arrays; /** * A set of low-level, high-performance static utility methods related to the UTF-8 character @@ -42,15 +64,15 @@ import java.util.Arrays; * Well Formed UTF-8 Byte Sequences. * *

      This class supports decoding of partial byte sequences, so that the bytes in a complete UTF-8 - * byte sequence can be stored in multiple segments. Methods typically return {@link #MALFORMED} if - * the partial byte sequence is definitely not well-formed; {@link #COMPLETE} if it is well-formed - * in the absence of additional input; or, if the byte sequence apparently terminated in the middle + * byte sequences can be stored in multiple segments. Methods typically return {@link #MALFORMED} if + * the partial byte sequence is definitely not well-formed, {@link #COMPLETE} if it is well-formed + * in the absence of additional input, or if the byte sequence apparently terminated in the middle * of a character, an opaque integer "state" value containing enough information to decode the * character when passed to a subsequent invocation of a partial decoding method. * * @author martinrb@google.com (Martin Buchholz) */ -// TODO: Copy changes in this class back to Guava +// TODO(nathanmittler): Copy changes in this class back to Guava final class Utf8 { /** @@ -80,10 +102,10 @@ final class Utf8 { * State value indicating that the byte sequence is well-formed and complete (no further bytes are * needed to complete a character). */ - static final int COMPLETE = 0; + public static final int COMPLETE = 0; /** State value indicating that the byte sequence is definitely not well-formed. */ - static final int MALFORMED = -1; + public static final int MALFORMED = -1; /** * Used by {@code Unsafe} UTF-8 string validation logic to determine the minimum string length @@ -121,7 +143,7 @@ final class Utf8 { *

      This is a convenience method, equivalent to a call to {@code isValidUtf8(bytes, 0, * bytes.length)}. */ - static boolean isValidUtf8(byte[] bytes) { + public static boolean isValidUtf8(byte[] bytes) { return processor.isValidUtf8(bytes, 0, bytes.length); } @@ -133,7 +155,7 @@ final class Utf8 { *

      This is a convenience method, equivalent to {@code partialIsValidUtf8(bytes, index, limit) * == Utf8.COMPLETE}. */ - static boolean isValidUtf8(byte[] bytes, int index, int limit) { + public static boolean isValidUtf8(byte[] bytes, int index, int limit) { return processor.isValidUtf8(bytes, index, limit); } @@ -150,7 +172,7 @@ final class Utf8 { * "state" value containing enough information to decode the character when passed to a * subsequent invocation of a partial decoding method. */ - static int partialIsValidUtf8(int state, byte[] bytes, int index, int limit) { + public static int partialIsValidUtf8(int state, byte[] bytes, int index, int limit) { return processor.partialIsValidUtf8(state, bytes, index, limit); } @@ -354,7 +376,7 @@ final class Utf8 { } /** A processor of UTF-8 strings, providing methods for checking validity and encoding. */ - // TODO: Add support for Memory/MemoryBlock on Android. + // TODO(nathanmittler): Add support for Memory/MemoryBlock on Android. abstract static class Processor { /** * Returns {@code true} if the given byte array slice is a well-formed UTF-8 byte sequence. The @@ -520,7 +542,7 @@ final class Utf8 { for (; ; ) { // Optimize for interior runs of ASCII bytes. - // TODO: Consider checking 8 bytes at a time after some threshold? + // TODO(nathanmittler): Consider checking 8 bytes at a time after some threshold? // Maybe after seeing a few in a row that are ASCII, go back to fast mode? int byte1; do { @@ -550,7 +572,7 @@ final class Utf8 { return incompleteStateFor(buffer, byte1, index, limit - index); } - byte byte2 = buffer.get(index++); + final byte byte2 = buffer.get(index++); if (byte2 > (byte) 0xBF // overlong? 5 most significant bits must not all be zero || (byte1 == (byte) 0xE0 && byte2 < (byte) 0xA0) @@ -568,8 +590,8 @@ final class Utf8 { return incompleteStateFor(buffer, byte1, index, limit - index); } - // TODO: Consider using getInt() to improve performance. - int byte2 = buffer.get(index++); + // TODO(nathanmittler): Consider using getInt() to improve performance. + final int byte2 = buffer.get(index++); if (byte2 > (byte) 0xBF // Check that 1 <= plane <= 16. Tricky optimized form of: // if (byte1 > (byte) 0xF4 || @@ -589,7 +611,7 @@ final class Utf8 { /** * Decodes the given byte array slice into a {@link String}. * - * @throws InvalidProtocolBufferException if the byte array slice is not valid UTF-8 + * @throws InvalidProtocolBufferException if the byte array slice is not valid UTF-8. */ abstract String decodeUtf8(byte[] bytes, int index, int size) throws InvalidProtocolBufferException; @@ -597,7 +619,7 @@ final class Utf8 { /** * Decodes the given portion of the {@link ByteBuffer} into a {@link String}. * - * @throws InvalidProtocolBufferException if the portion of the buffer is not valid UTF-8 + * @throws InvalidProtocolBufferException if the portion of the buffer is not valid UTF-8. */ final String decodeUtf8(ByteBuffer buffer, int index, int size) throws InvalidProtocolBufferException { @@ -627,7 +649,7 @@ final class Utf8 { } int offset = index; - int limit = offset + size; + final int limit = offset + size; // The longest possible resulting String is the same as the number of input bytes, when it is // all ASCII. For other cases, this over-allocates and we will truncate in the end. @@ -747,7 +769,7 @@ final class Utf8 { if (out.hasArray()) { final int offset = out.arrayOffset(); int endIndex = Utf8.encode(in, out.array(), offset + out.position(), out.remaining()); - Java8Compatibility.position(out, endIndex - offset); + out.position(endIndex - offset); } else if (out.isDirect()) { encodeUtf8Direct(in, out); } else { @@ -778,7 +800,7 @@ final class Utf8 { } if (inIx == inLength) { // Successfully encoded the entire string. - Java8Compatibility.position(out, outIx + inIx); + out.position(outIx + inIx); return; } @@ -811,7 +833,7 @@ final class Utf8 { if (inIx + 1 == inLength || !isSurrogatePair(c, (low = in.charAt(++inIx)))) { throw new UnpairedSurrogateException(inIx, inLength); } - // TODO: Consider using putInt() to improve performance. + // TODO(nathanmittler): Consider using putInt() to improve performance. int codePoint = toCodePoint(c, low); out.put(outIx++, (byte) ((0xF << 4) | (codePoint >>> 18))); out.put(outIx++, (byte) (0x80 | (0x3F & (codePoint >>> 12)))); @@ -821,9 +843,9 @@ final class Utf8 { } // Successfully encoded the entire string. - Java8Compatibility.position(out, outIx); + out.position(outIx); } catch (IndexOutOfBoundsException e) { - // TODO: Consider making the API throw IndexOutOfBoundsException instead. + // TODO(nathanmittler): Consider making the API throw IndexOutOfBoundsException instead. // If we failed in the outer ASCII loop, outIx will not have been updated. In this case, // use inIx to determine the bad write index. @@ -1344,25 +1366,77 @@ final class Utf8 { @Override String decodeUtf8(byte[] bytes, int index, int size) throws InvalidProtocolBufferException { - String s = new String(bytes, index, size, Internal.UTF_8); + if ((index | size | bytes.length - index - size) < 0) { + throw new ArrayIndexOutOfBoundsException( + String.format("buffer length=%d, index=%d, size=%d", bytes.length, index, size)); + } + + int offset = index; + final int limit = offset + size; - // "\uFFFD" is UTF-8 default replacement string, which illegal byte sequences get replaced - // with. - if (!s.contains("\uFFFD")) { - return s; + // The longest possible resulting String is the same as the number of input bytes, when it is + // all ASCII. For other cases, this over-allocates and we will truncate in the end. + char[] resultArr = new char[size]; + int resultPos = 0; + + // Optimize for 100% ASCII (Hotspot loves small simple top-level loops like this). + // This simple loop stops when we encounter a byte >= 0x80 (i.e. non-ASCII). + while (offset < limit) { + byte b = UnsafeUtil.getByte(bytes, offset); + if (!DecodeUtil.isOneByte(b)) { + break; + } + offset++; + DecodeUtil.handleOneByte(b, resultArr, resultPos++); } - // Since s contains "\uFFFD" there are 2 options: - // 1) The byte array slice is invalid UTF-8. - // 2) The byte array slice is valid UTF-8 and contains encodings for "\uFFFD". - // To rule out (1), we encode s and compare it to the byte array slice. - // If the byte array slice was invalid UTF-8, then we would get a different sequence of bytes. - if (Arrays.equals( - s.getBytes(Internal.UTF_8), Arrays.copyOfRange(bytes, index, index + size))) { - return s; + while (offset < limit) { + byte byte1 = UnsafeUtil.getByte(bytes, offset++); + if (DecodeUtil.isOneByte(byte1)) { + DecodeUtil.handleOneByte(byte1, resultArr, resultPos++); + // It's common for there to be multiple ASCII characters in a run mixed in, so add an + // extra optimized loop to take care of these runs. + while (offset < limit) { + byte b = UnsafeUtil.getByte(bytes, offset); + if (!DecodeUtil.isOneByte(b)) { + break; + } + offset++; + DecodeUtil.handleOneByte(b, resultArr, resultPos++); + } + } else if (DecodeUtil.isTwoBytes(byte1)) { + if (offset >= limit) { + throw InvalidProtocolBufferException.invalidUtf8(); + } + DecodeUtil.handleTwoBytes( + byte1, /* byte2 */ UnsafeUtil.getByte(bytes, offset++), resultArr, resultPos++); + } else if (DecodeUtil.isThreeBytes(byte1)) { + if (offset >= limit - 1) { + throw InvalidProtocolBufferException.invalidUtf8(); + } + DecodeUtil.handleThreeBytes( + byte1, + /* byte2 */ UnsafeUtil.getByte(bytes, offset++), + /* byte3 */ UnsafeUtil.getByte(bytes, offset++), + resultArr, + resultPos++); + } else { + if (offset >= limit - 2) { + throw InvalidProtocolBufferException.invalidUtf8(); + } + DecodeUtil.handleFourBytes( + byte1, + /* byte2 */ UnsafeUtil.getByte(bytes, offset++), + /* byte3 */ UnsafeUtil.getByte(bytes, offset++), + /* byte4 */ UnsafeUtil.getByte(bytes, offset++), + resultArr, + resultPos++); + // 4-byte case requires two chars. + resultPos++; + } } - throw InvalidProtocolBufferException.invalidUtf8(); + return new String(resultArr, 0, resultPos); } @Override @@ -1522,7 +1596,7 @@ final class Utf8 { } if (inIx == inLimit) { // We're done, it was ASCII encoded. - Java8Compatibility.position(out, (int) (outIx - address)); + out.position((int) (outIx - address)); return; } @@ -1562,7 +1636,7 @@ final class Utf8 { } // All bytes have been encoded. - Java8Compatibility.position(out, (int) (outIx - address)); + out.position((int) (outIx - address)); } /** @@ -1582,29 +1656,7 @@ final class Utf8 { return 0; } - // Read bytes until 8-byte aligned so that we can read longs in the loop below. - // Byte arrays are already either 8 or 16-byte aligned, so we just need to make sure that - // the index (relative to the start of the array) is also 8-byte aligned. We do this by - // ANDing the index with 7 to determine the number of bytes that need to be read before - // we're 8-byte aligned. - final int unaligned = 8 - ((int) offset & 7); - int i; - for (i = 0; i < unaligned; i++) { - if (UnsafeUtil.getByte(bytes, offset++) < 0) { - return i; - } - } - - for (; i + 8 <= maxChars; i += 8) { - if ((UnsafeUtil.getLong(bytes, UnsafeUtil.BYTE_ARRAY_BASE_OFFSET + offset) - & ASCII_MASK_LONG) - != 0L) { - break; - } - offset += 8; - } - - for (; i < maxChars; i++) { + for (int i = 0; i < maxChars; i++) { if (UnsafeUtil.getByte(bytes, offset++) < 0) { return i; } @@ -1624,9 +1676,9 @@ final class Utf8 { } // Read bytes until 8-byte aligned so that we can read longs in the loop below. - // This is equivalent to (8-address) mod 8, the number of bytes we need to read before we're - // 8-byte aligned. - final int unaligned = (int) (-address & 7); + // We do this by ANDing the address with 7 to determine the number of bytes that need to + // be read before we're 8-byte aligned. + final int unaligned = 8 - ((int) address & 7); for (int j = unaligned; j > 0; j--) { if (UnsafeUtil.getByte(address++) < 0) { return unaligned - j; @@ -1651,7 +1703,7 @@ final class Utf8 { for (; ; ) { // Optimize for interior runs of ASCII bytes. - // TODO: Consider checking 8 bytes at a time after some threshold? + // TODO(nathanmittler): Consider checking 8 bytes at a time after some threshold? // Maybe after seeing a few in a row that are ASCII, go back to fast mode? int byte1 = 0; for (; remaining > 0 && (byte1 = UnsafeUtil.getByte(bytes, offset++)) >= 0; --remaining) {} @@ -1725,7 +1777,7 @@ final class Utf8 { for (; ; ) { // Optimize for interior runs of ASCII bytes. - // TODO: Consider checking 8 bytes at a time after some threshold? + // TODO(nathanmittler): Consider checking 8 bytes at a time after some threshold? // Maybe after seeing a few in a row that are ASCII, go back to fast mode? int byte1 = 0; for (; remaining > 0 && (byte1 = UnsafeUtil.getByte(address++)) >= 0; --remaining) {} @@ -1835,24 +1887,12 @@ final class Utf8 { return b >= 0; } - /** - * Returns whether this is a two-byte codepoint with the form '10XXXXXX' iff - * {@link #isOneByte(byte)} is false. This private method works in the limited use in - * this class where this method is only called when {@link #isOneByte(byte)} has already - * returned false. It is not suitable for general or public use. - */ + /** Returns whether this is a two-byte codepoint with the form '10XXXXXX'. */ private static boolean isTwoBytes(byte b) { return b < (byte) 0xE0; } - /** - * Returns whether this is a three-byte codepoint with the form '110XXXXX' iff - * {@link #isOneByte(byte)} and {@link #isTwoBytes(byte)} are false. - * This private method works in the limited use in - * this class where this method is only called when {@link #isOneByte(byte)} an - * {@link #isTwoBytes(byte)} have already returned false. It is not suitable for general - * or public use. - */ + /** Returns whether this is a three-byte codepoint with the form '110XXXXX'. */ private static boolean isThreeBytes(byte b) { return b < (byte) 0xF0; } diff --git a/java/core/src/main/java/com/google/protobuf/WireFormat.java b/java/core/src/main/java/com/google/protobuf/WireFormat.java index ca6f880bc16cceee39f940a528f8d12225a08cc9..3c6e8dda4de1b0ae0747e98d331db02419ef21f5 100644 --- a/java/core/src/main/java/com/google/protobuf/WireFormat.java +++ b/java/core/src/main/java/com/google/protobuf/WireFormat.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/main/java/com/google/protobuf/Writer.java b/java/core/src/main/java/com/google/protobuf/Writer.java index fa64775f458fa8c0fdced9104494fb865cc0a544..3f95c325de46e128df6c32f499610a3cb5fe21ee 100644 --- a/java/core/src/main/java/com/google/protobuf/Writer.java +++ b/java/core/src/main/java/com/google/protobuf/Writer.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -13,7 +36,6 @@ import java.util.Map; /** A writer that performs serialization of protobuf message fields. */ @ExperimentalApi -@CheckReturnValue interface Writer { /** The order in which the fields are written by a {@link Writer}. */ diff --git a/java/core/src/main/java/com/google/protobuf/java_features.proto b/java/core/src/main/java/com/google/protobuf/java_features.proto deleted file mode 100644 index d02d067a397c5165ddad1ed31de7cf7a70308184..0000000000000000000000000000000000000000 --- a/java/core/src/main/java/com/google/protobuf/java_features.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto2"; - -package pb; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "JavaFeaturesProto"; - -extend google.protobuf.FeatureSet { - optional JavaFeatures java = 1001; -} - -message JavaFeatures { - // Whether or not to treat an enum field as closed. This option is only - // applicable to enum fields, and will be removed in the future. It is - // consistent with the legacy behavior of using proto3 enum types for proto2 - // fields. - optional bool legacy_closed_enum = 1 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "true" }, - edition_defaults = { edition: EDITION_PROTO3, value: "false" } - ]; - - // The UTF8 validation strategy to use. See go/editions-utf8-validation for - // more information on this feature. - enum Utf8Validation { - // Invalid default, which should never be used. - UTF8_VALIDATION_UNKNOWN = 0; - // Respect the UTF8 validation behavior specified by the global - // utf8_validation feature. - DEFAULT = 1; - // Verifies UTF8 validity overriding the global utf8_validation - // feature. This represents the legacy java_string_check_utf8 option. - VERIFY = 2; - } - optional Utf8Validation utf8_validation = 2 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "DEFAULT" } - ]; -} diff --git a/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java b/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java index 60aa76b6ec0f471ecd68704b9e1840dbc3ac5086..cc979ac5132928929f98bb909b9143a96371865c 100644 --- a/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java +++ b/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static com.google.protobuf.TestUtil.TEST_REQUIRED_INITIALIZED; import static com.google.protobuf.TestUtil.TEST_REQUIRED_UNINITIALIZED; @@ -23,13 +44,14 @@ import protobuf_unittest.UnittestProto.TestRequired; import protobuf_unittest.UnittestProto.TestRequiredForeign; import protobuf_unittest.UnittestProto.TestUnpackedTypes; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Unit test for {@link AbstractMessage}. */ -@RunWith(JUnit4.class) -public class AbstractMessageTest { +import junit.framework.TestCase; + +/** + * Unit test for {@link AbstractMessage}. + * + * @author kenton@google.com Kenton Varda + */ +public class AbstractMessageTest extends TestCase { /** * Extends AbstractMessage and wraps some other message object. The methods of the Message * interface which aren't explicitly implemented by AbstractMessage are forwarded to the wrapped @@ -216,7 +238,6 @@ public class AbstractMessageTest { new TestUtil.ReflectionTester( TestAllExtensions.getDescriptor(), TestUtil.getFullExtensionRegistry()); - @Test public void testClear() throws Exception { AbstractMessageWrapper message = new AbstractMessageWrapper.Builder(TestAllTypes.newBuilder(TestUtil.getAllSet())) @@ -225,7 +246,6 @@ public class AbstractMessageTest { TestUtil.assertClear((TestAllTypes) message.wrappedMessage); } - @Test public void testCopy() throws Exception { AbstractMessageWrapper message = new AbstractMessageWrapper.Builder(TestAllTypes.newBuilder()) @@ -234,35 +254,28 @@ public class AbstractMessageTest { TestUtil.assertAllFieldsSet((TestAllTypes) message.wrappedMessage); } - @Test public void testSerializedSize() throws Exception { TestAllTypes message = TestUtil.getAllSet(); Message abstractMessage = new AbstractMessageWrapper(TestUtil.getAllSet()); - assertThat(message.getSerializedSize()).isEqualTo(abstractMessage.getSerializedSize()); + + assertEquals(message.getSerializedSize(), abstractMessage.getSerializedSize()); } - @Test public void testSerialization() throws Exception { Message abstractMessage = new AbstractMessageWrapper(TestUtil.getAllSet()); - TestUtil.assertAllFieldsSet( - TestAllTypes.parseFrom( - abstractMessage.toByteString(), ExtensionRegistryLite.getEmptyRegistry())); - assertThat(TestUtil.getAllSet().toByteString()).isEqualTo(abstractMessage.toByteString()); + + TestUtil.assertAllFieldsSet(TestAllTypes.parseFrom(abstractMessage.toByteString())); + + assertEquals(TestUtil.getAllSet().toByteString(), abstractMessage.toByteString()); } - @Test public void testParsing() throws Exception { AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestAllTypes.newBuilder()); - AbstractMessageWrapper message = - builder - .mergeFrom( - TestUtil.getAllSet().toByteString(), ExtensionRegistryLite.getEmptyRegistry()) - .build(); + AbstractMessageWrapper message = builder.mergeFrom(TestUtil.getAllSet().toByteString()).build(); TestUtil.assertAllFieldsSet((TestAllTypes) message.wrappedMessage); } - @Test public void testParsingUninitialized() throws Exception { TestRequiredForeign.Builder builder = TestRequiredForeign.newBuilder(); builder.getOptionalMessageBuilder().setDummy2(10); @@ -270,13 +283,10 @@ public class AbstractMessageTest { Message.Builder abstractMessageBuilder = new AbstractMessageWrapper.Builder(TestRequiredForeign.newBuilder()); // mergeFrom() should not throw initialization error. - Message unused1 = - abstractMessageBuilder - .mergeFrom(bytes, ExtensionRegistryLite.getEmptyRegistry()) - .buildPartial(); + abstractMessageBuilder.mergeFrom(bytes).buildPartial(); try { - abstractMessageBuilder.mergeFrom(bytes, ExtensionRegistryLite.getEmptyRegistry()).build(); - assertWithMessage("shouldn't pass").fail(); + abstractMessageBuilder.mergeFrom(bytes).build(); + fail(); } catch (UninitializedMessageException ex) { // pass } @@ -285,140 +295,115 @@ public class AbstractMessageTest { Message.Builder dynamicMessageBuilder = DynamicMessage.newBuilder(TestRequiredForeign.getDescriptor()); // mergeFrom() should not throw initialization error. - Message unused2 = - dynamicMessageBuilder - .mergeFrom(bytes, ExtensionRegistryLite.getEmptyRegistry()) - .buildPartial(); + dynamicMessageBuilder.mergeFrom(bytes).buildPartial(); try { - dynamicMessageBuilder.mergeFrom(bytes, ExtensionRegistryLite.getEmptyRegistry()).build(); - assertWithMessage("shouldn't pass").fail(); + dynamicMessageBuilder.mergeFrom(bytes).build(); + fail(); } catch (UninitializedMessageException ex) { // pass } } - @Test public void testPackedSerialization() throws Exception { Message abstractMessage = new AbstractMessageWrapper(TestUtil.getPackedSet()); - TestUtil.assertPackedFieldsSet( - TestPackedTypes.parseFrom( - abstractMessage.toByteString(), ExtensionRegistryLite.getEmptyRegistry())); - assertThat(TestUtil.getPackedSet().toByteString()).isEqualTo(abstractMessage.toByteString()); + + TestUtil.assertPackedFieldsSet(TestPackedTypes.parseFrom(abstractMessage.toByteString())); + + assertEquals(TestUtil.getPackedSet().toByteString(), abstractMessage.toByteString()); } - @Test public void testPackedParsing() throws Exception { AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestPackedTypes.newBuilder()); AbstractMessageWrapper message = - builder - .mergeFrom( - TestUtil.getPackedSet().toByteString(), ExtensionRegistryLite.getEmptyRegistry()) - .build(); + builder.mergeFrom(TestUtil.getPackedSet().toByteString()).build(); TestUtil.assertPackedFieldsSet((TestPackedTypes) message.wrappedMessage); } - @Test public void testUnpackedSerialization() throws Exception { Message abstractMessage = new AbstractMessageWrapper(TestUtil.getUnpackedSet()); - TestUtil.assertUnpackedFieldsSet( - TestUnpackedTypes.parseFrom( - abstractMessage.toByteString(), ExtensionRegistryLite.getEmptyRegistry())); - assertThat(TestUtil.getUnpackedSet().toByteString()).isEqualTo(abstractMessage.toByteString()); + + TestUtil.assertUnpackedFieldsSet(TestUnpackedTypes.parseFrom(abstractMessage.toByteString())); + + assertEquals(TestUtil.getUnpackedSet().toByteString(), abstractMessage.toByteString()); } - @Test public void testParsePackedToUnpacked() throws Exception { AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestUnpackedTypes.newBuilder()); AbstractMessageWrapper message = - builder - .mergeFrom( - TestUtil.getPackedSet().toByteString(), ExtensionRegistryLite.getEmptyRegistry()) - .build(); + builder.mergeFrom(TestUtil.getPackedSet().toByteString()).build(); TestUtil.assertUnpackedFieldsSet((TestUnpackedTypes) message.wrappedMessage); } - @Test public void testParseUnpackedToPacked() throws Exception { AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestPackedTypes.newBuilder()); AbstractMessageWrapper message = - builder - .mergeFrom( - TestUtil.getUnpackedSet().toByteString(), ExtensionRegistryLite.getEmptyRegistry()) - .build(); + builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build(); TestUtil.assertPackedFieldsSet((TestPackedTypes) message.wrappedMessage); } - @Test public void testUnpackedParsing() throws Exception { AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestUnpackedTypes.newBuilder()); AbstractMessageWrapper message = - builder - .mergeFrom( - TestUtil.getUnpackedSet().toByteString(), ExtensionRegistryLite.getEmptyRegistry()) - .build(); + builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build(); TestUtil.assertUnpackedFieldsSet((TestUnpackedTypes) message.wrappedMessage); } - @Test public void testOptimizedForSize() throws Exception { // We're mostly only checking that this class was compiled successfully. TestOptimizedForSize message = TestOptimizedForSize.newBuilder().setI(1).build(); - message = - TestOptimizedForSize.parseFrom( - message.toByteString(), ExtensionRegistryLite.getEmptyRegistry()); - assertThat(message.getSerializedSize()).isEqualTo(2); + message = TestOptimizedForSize.parseFrom(message.toByteString()); + assertEquals(2, message.getSerializedSize()); } // ----------------------------------------------------------------- // Tests for isInitialized(). - @Test public void testIsInitialized() throws Exception { TestRequired.Builder builder = TestRequired.newBuilder(); AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder); - assertThat(abstractBuilder.isInitialized()).isFalse(); - assertThat(abstractBuilder.getInitializationErrorString()).isEqualTo("a, b, c"); + assertFalse(abstractBuilder.isInitialized()); + assertEquals("a, b, c", abstractBuilder.getInitializationErrorString()); builder.setA(1); - assertThat(abstractBuilder.isInitialized()).isFalse(); - assertThat(abstractBuilder.getInitializationErrorString()).isEqualTo("b, c"); + assertFalse(abstractBuilder.isInitialized()); + assertEquals("b, c", abstractBuilder.getInitializationErrorString()); builder.setB(1); - assertThat(abstractBuilder.isInitialized()).isFalse(); - assertThat(abstractBuilder.getInitializationErrorString()).isEqualTo("c"); + assertFalse(abstractBuilder.isInitialized()); + assertEquals("c", abstractBuilder.getInitializationErrorString()); builder.setC(1); - assertThat(abstractBuilder.isInitialized()).isTrue(); - assertThat(abstractBuilder.getInitializationErrorString()).isEmpty(); + assertTrue(abstractBuilder.isInitialized()); + assertEquals("", abstractBuilder.getInitializationErrorString()); } - @Test public void testForeignIsInitialized() throws Exception { TestRequiredForeign.Builder builder = TestRequiredForeign.newBuilder(); AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder); - assertThat(abstractBuilder.isInitialized()).isTrue(); - assertThat(abstractBuilder.getInitializationErrorString()).isEmpty(); + assertTrue(abstractBuilder.isInitialized()); + assertEquals("", abstractBuilder.getInitializationErrorString()); builder.setOptionalMessage(TEST_REQUIRED_UNINITIALIZED); - assertThat(abstractBuilder.isInitialized()).isFalse(); - assertThat(abstractBuilder.getInitializationErrorString()) - .isEqualTo("optional_message.b, optional_message.c"); + assertFalse(abstractBuilder.isInitialized()); + assertEquals( + "optional_message.b, optional_message.c", abstractBuilder.getInitializationErrorString()); builder.setOptionalMessage(TEST_REQUIRED_INITIALIZED); - assertThat(abstractBuilder.isInitialized()).isTrue(); - assertThat(abstractBuilder.getInitializationErrorString()).isEmpty(); + assertTrue(abstractBuilder.isInitialized()); + assertEquals("", abstractBuilder.getInitializationErrorString()); builder.addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED); - assertThat(abstractBuilder.isInitialized()).isFalse(); - assertThat(abstractBuilder.getInitializationErrorString()) - .isEqualTo("repeated_message[0].b, repeated_message[0].c"); + assertFalse(abstractBuilder.isInitialized()); + assertEquals( + "repeated_message[0].b, repeated_message[0].c", + abstractBuilder.getInitializationErrorString()); builder.setRepeatedMessage(0, TEST_REQUIRED_INITIALIZED); - assertThat(abstractBuilder.isInitialized()).isTrue(); - assertThat(abstractBuilder.getInitializationErrorString()).isEmpty(); + assertTrue(abstractBuilder.isInitialized()); + assertEquals("", abstractBuilder.getInitializationErrorString()); } // ----------------------------------------------------------------- @@ -451,23 +436,21 @@ public class AbstractMessageTest { + "repeated_string: \"qux\"\n" + "repeated_string: \"bar\"\n"; - @Test public void testMergeFrom() throws Exception { AbstractMessageWrapper result = new AbstractMessageWrapper.Builder(TestAllTypes.newBuilder(MERGE_DEST)) .mergeFrom(MERGE_SOURCE) .build(); - assertThat(result.toString()).isEqualTo(MERGE_RESULT_TEXT); + assertEquals(MERGE_RESULT_TEXT, result.toString()); } // ----------------------------------------------------------------- // Tests for equals and hashCode - @Test public void testEqualsAndHashCode() throws Exception { TestAllTypes a = TestUtil.getAllSet(); - TestAllTypes b = TestAllTypes.getDefaultInstance(); + TestAllTypes b = TestAllTypes.newBuilder().build(); TestAllTypes c = TestAllTypes.newBuilder(b).addRepeatedString("x").build(); TestAllTypes d = TestAllTypes.newBuilder(c).addRepeatedString("y").build(); TestAllExtensions e = TestUtil.getAllExtensionsSet(); @@ -506,26 +489,23 @@ public class AbstractMessageTest { // Deserializing into the TestEmptyMessage such that every field // is an {@link UnknownFieldSet.Field}. UnittestProto.TestEmptyMessage eUnknownFields = - UnittestProto.TestEmptyMessage.parseFrom( - e.toByteArray(), ExtensionRegistryLite.getEmptyRegistry()); + UnittestProto.TestEmptyMessage.parseFrom(e.toByteArray()); UnittestProto.TestEmptyMessage fUnknownFields = - UnittestProto.TestEmptyMessage.parseFrom( - f.toByteArray(), ExtensionRegistryLite.getEmptyRegistry()); + UnittestProto.TestEmptyMessage.parseFrom(f.toByteArray()); checkNotEqual(eUnknownFields, fUnknownFields); checkEqualsIsConsistent(eUnknownFields); checkEqualsIsConsistent(fUnknownFields); // Subsequent reconstitutions should be identical UnittestProto.TestEmptyMessage eUnknownFields2 = - UnittestProto.TestEmptyMessage.parseFrom( - e.toByteArray(), ExtensionRegistryLite.getEmptyRegistry()); + UnittestProto.TestEmptyMessage.parseFrom(e.toByteArray()); checkEqualsIsConsistent(eUnknownFields, eUnknownFields2); } /** Asserts that the given proto has symmetric equals and hashCode methods. */ private void checkEqualsIsConsistent(Message message) { - // Test equals explicitly. - assertThat(message.equals(message)).isTrue(); + // Object should be equal to itself. + assertEquals(message, message); // Object should be equal to a dynamic copy of itself. DynamicMessage dynamic = DynamicMessage.newBuilder(message).build(); @@ -534,9 +514,9 @@ public class AbstractMessageTest { /** Asserts that the given protos are equal and have the same hash code. */ private void checkEqualsIsConsistent(Message message1, Message message2) { - assertThat(message1).isEqualTo(message2); - assertThat(message2).isEqualTo(message1); - assertThat(message2.hashCode()).isEqualTo(message1.hashCode()); + assertEquals(message1, message2); + assertEquals(message2, message1); + assertEquals(message2.hashCode(), message1.hashCode()); } /** @@ -547,33 +527,28 @@ public class AbstractMessageTest { */ private void checkNotEqual(Message m1, Message m2) { String equalsError = String.format("%s should not be equal to %s", m1, m2); - assertWithMessage(equalsError).that(m1.equals(m2)).isFalse(); - assertWithMessage(equalsError).that(m2.equals(m1)).isFalse(); + assertFalse(equalsError, m1.equals(m2)); + assertFalse(equalsError, m2.equals(m1)); - assertWithMessage(String.format("%s should have a different hash code from %s", m1, m2)) - .that(m1.hashCode()) - .isNotEqualTo(m2.hashCode()); + assertFalse( + String.format("%s should have a different hash code from %s", m1, m2), + m1.hashCode() == m2.hashCode()); } - @Test public void testCheckByteStringIsUtf8OnUtf8() { ByteString byteString = ByteString.copyFromUtf8("some text"); AbstractMessageLite.checkByteStringIsUtf8(byteString); // No exception thrown. } - @Test public void testCheckByteStringIsUtf8OnNonUtf8() { ByteString byteString = ByteString.copyFrom(new byte[] {(byte) 0x80}); // A lone continuation byte. try { AbstractMessageLite.checkByteStringIsUtf8(byteString); - assertWithMessage( - "Expected AbstractMessageLite.checkByteStringIsUtf8 to throw" - + " IllegalArgumentException") - .fail(); + fail("Expected AbstractMessageLite.checkByteStringIsUtf8 to throw IllegalArgumentException"); } catch (IllegalArgumentException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Byte string is not UTF-8."); + assertEquals("Byte string is not UTF-8.", exception.getMessage()); } } } diff --git a/java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java b/java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java index aeaa8151d9b283aa738f828c922e1904f27c1f4c..5d3fd3bd696cb668d692be57c5e1b8f571038f20 100644 --- a/java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java +++ b/java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java @@ -1,14 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; import com.google.protobuf.testing.Proto2TestingLite.Proto2EmptyLite; import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite; @@ -49,8 +73,8 @@ public abstract class AbstractProto2LiteSchemaTest extends AbstractSchemaTest singularEnum = parsed .getUnknownFields() .getField(Proto2Message.FIELD_ENUM_13_FIELD_NUMBER) .getVarintList(); - assertThat(singularEnum).hasSize(1); - assertThat((Long) (long) outOfRange).isEqualTo(singularEnum.get(0)); + assertEquals(1, singularEnum.size()); + assertEquals((Long) (long) outOfRange, singularEnum.get(0)); } { List repeatedEnum = @@ -171,8 +193,8 @@ public abstract class AbstractProto2SchemaTest extends AbstractSchemaTest packedRepeatedEnum = @@ -180,19 +202,19 @@ public abstract class AbstractProto2SchemaTest extends AbstractSchemaTest { T newMsg = schema.newInstance(); try { schema.mergeFrom(newMsg, reader, ExtensionRegistryLite.getEmptyRegistry()); - assertWithMessage("should throw invalid").fail(); + fail("should throw invalid "); } catch (InvalidProtocolBufferException expected) { } } @@ -81,15 +106,13 @@ public abstract class AbstractSchemaTest { exceptionCount += 1; } } - assertThat(exceptionCount).isNotEqualTo(0); + assertNotEquals(0, exceptionCount); } protected static final void roundtrip( String failureMessage, M msg, Schema schema) throws IOException { byte[] serializedBytes = ExperimentalSerializationUtil.toByteArray(msg, schema); - assertWithMessage(failureMessage) - .that(serializedBytes.length) - .isEqualTo(msg.getSerializedSize()); + assertEquals(failureMessage, msg.getSerializedSize(), serializedBytes.length); // Now read it back in and verify it matches the original. if (Android.isOnAndroidDevice()) { @@ -98,14 +121,14 @@ public abstract class AbstractSchemaTest { schema.mergeFrom( newMsg, serializedBytes, 0, serializedBytes.length, new ArrayDecoders.Registers()); schema.makeImmutable(newMsg); - assertWithMessage(failureMessage).that(newMsg).isEqualTo(msg); + assertEquals(failureMessage, msg, newMsg); } M newMsg = schema.newInstance(); Reader reader = BinaryReader.newInstance(ByteBuffer.wrap(serializedBytes), true); schema.mergeFrom(newMsg, reader, ExtensionRegistryLite.getEmptyRegistry()); schema.makeImmutable(newMsg); - assertWithMessage(failureMessage).that(newMsg).isEqualTo(msg); + assertEquals(failureMessage, msg, newMsg); } protected final void roundtrip(String failureMessage, T msg) throws IOException { @@ -125,10 +148,10 @@ public abstract class AbstractSchemaTest { public void testRequiredFields() throws Exception { for (T msg : newMessagesMissingRequiredFields()) { if (schema.isInitialized(msg)) { - assertThat(msg.toString()).isEmpty(); + assertEquals("", msg.toString()); msg = (T) msg.toBuilder().build(); } - assertThat(schema.isInitialized(msg)).isFalse(); + assertFalse(schema.isInitialized(msg)); } } } diff --git a/java/core/src/test/java/com/google/protobuf/AnyTest.java b/java/core/src/test/java/com/google/protobuf/AnyTest.java index c84f6e64e9d8b5bc849d06fd2e7b69b15d2f228a..d660ca7372c8b36448950db49619bb2419c17627 100644 --- a/java/core/src/test/java/com/google/protobuf/AnyTest.java +++ b/java/core/src/test/java/com/google/protobuf/AnyTest.java @@ -1,26 +1,42 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import any_test.AnyTestProto.TestAny; import protobuf_unittest.UnittestProto.TestAllTypes; import java.util.Objects; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Unit tests for Any message. */ -@RunWith(JUnit4.class) -public class AnyTest { - @Test +public class AnyTest extends TestCase { public void testAnyGeneratedApi() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -28,16 +44,17 @@ public class AnyTest { TestAny container = TestAny.newBuilder().setValue(Any.pack(message)).build(); - assertThat(container.getValue().is(TestAllTypes.class)).isTrue(); - assertThat(container.getValue().is(TestAny.class)).isFalse(); + assertTrue(container.getValue().is(TestAllTypes.class)); + assertFalse(container.getValue().is(TestAny.class)); TestAllTypes result = container.getValue().unpack(TestAllTypes.class); TestUtil.assertAllFieldsSet(result); + // Unpacking to a wrong type will throw an exception. try { container.getValue().unpack(TestAny.class); - assertWithMessage("Exception is expected.").fail(); + fail("Exception is expected."); } catch (InvalidProtocolBufferException e) { // expected. } @@ -48,47 +65,12 @@ public class AnyTest { container = containerBuilder.build(); try { container.getValue().unpack(TestAllTypes.class); - assertWithMessage("Exception is expected.").fail(); - } catch (InvalidProtocolBufferException e) { - // expected. - } - } - - @Test - public void testAnyGeneratedExemplarApi() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes message = builder.build(); - - TestAny container = TestAny.newBuilder().setValue(Any.pack(message)).build(); - - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - assertThat(container.getValue().isSameTypeAs(TestAny.getDefaultInstance())).isFalse(); - - TestAllTypes result = container.getValue().unpackSameTypeAs(TestAllTypes.getDefaultInstance()); - TestUtil.assertAllFieldsSet(result); - - // Unpacking to a wrong exemplar will throw an exception. - try { - container.getValue().unpackSameTypeAs(TestAny.getDefaultInstance()); - assertWithMessage("Exception is expected.").fail(); - } catch (InvalidProtocolBufferException e) { - // expected. - } - - // Test that unpacking throws an exception if parsing fails. - TestAny.Builder containerBuilder = container.toBuilder(); - containerBuilder.getValueBuilder().setValue(ByteString.copyFrom(new byte[] {0x11})); - container = containerBuilder.build(); - try { - container.getValue().unpackSameTypeAs(TestAllTypes.getDefaultInstance()); - assertWithMessage("Exception is expected.").fail(); + fail("Exception is expected."); } catch (InvalidProtocolBufferException e) { // expected. } } - @Test public void testCustomTypeUrls() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -96,85 +78,38 @@ public class AnyTest { TestAny container = TestAny.newBuilder().setValue(Any.pack(message, "xxx.com")).build(); - assertThat(container.getValue().getTypeUrl()) - .isEqualTo("xxx.com/" + TestAllTypes.getDescriptor().getFullName()); + assertEquals( + "xxx.com/" + TestAllTypes.getDescriptor().getFullName(), container.getValue().getTypeUrl()); - assertThat(container.getValue().is(TestAllTypes.class)).isTrue(); - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - assertThat(container.getValue().is(TestAny.class)).isFalse(); - assertThat(container.getValue().isSameTypeAs(TestAny.getDefaultInstance())).isFalse(); + assertTrue(container.getValue().is(TestAllTypes.class)); + assertFalse(container.getValue().is(TestAny.class)); TestAllTypes result = container.getValue().unpack(TestAllTypes.class); TestUtil.assertAllFieldsSet(result); container = TestAny.newBuilder().setValue(Any.pack(message, "yyy.com/")).build(); - assertThat(container.getValue().getTypeUrl()) - .isEqualTo("yyy.com/" + TestAllTypes.getDescriptor().getFullName()); + assertEquals( + "yyy.com/" + TestAllTypes.getDescriptor().getFullName(), container.getValue().getTypeUrl()); - assertThat(container.getValue().is(TestAllTypes.class)).isTrue(); - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - assertThat(container.getValue().is(TestAny.class)).isFalse(); - assertThat(container.getValue().isSameTypeAs(TestAny.getDefaultInstance())).isFalse(); + assertTrue(container.getValue().is(TestAllTypes.class)); + assertFalse(container.getValue().is(TestAny.class)); result = container.getValue().unpack(TestAllTypes.class); TestUtil.assertAllFieldsSet(result); container = TestAny.newBuilder().setValue(Any.pack(message, "")).build(); - assertThat(container.getValue().getTypeUrl()) - .isEqualTo("/" + TestAllTypes.getDescriptor().getFullName()); + assertEquals( + "/" + TestAllTypes.getDescriptor().getFullName(), container.getValue().getTypeUrl()); - assertThat(container.getValue().is(TestAllTypes.class)).isTrue(); - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - assertThat(container.getValue().is(TestAny.class)).isFalse(); - assertThat(container.getValue().isSameTypeAs(TestAny.getDefaultInstance())).isFalse(); + assertTrue(container.getValue().is(TestAllTypes.class)); + assertFalse(container.getValue().is(TestAny.class)); result = container.getValue().unpack(TestAllTypes.class); TestUtil.assertAllFieldsSet(result); } - @Test - public void testCustomTypeUrlsWithExemplars() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes message = builder.build(); - - TestAny container = TestAny.newBuilder().setValue(Any.pack(message, "xxx.com")).build(); - - assertThat(container.getValue().getTypeUrl()) - .isEqualTo("xxx.com/" + TestAllTypes.getDescriptor().getFullName()); - - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - assertThat(container.getValue().isSameTypeAs(TestAny.getDefaultInstance())).isFalse(); - - TestAllTypes result = container.getValue().unpackSameTypeAs(TestAllTypes.getDefaultInstance()); - TestUtil.assertAllFieldsSet(result); - - container = TestAny.newBuilder().setValue(Any.pack(message, "yyy.com/")).build(); - - assertThat(container.getValue().getTypeUrl()) - .isEqualTo("yyy.com/" + TestAllTypes.getDescriptor().getFullName()); - - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - assertThat(container.getValue().isSameTypeAs(TestAny.getDefaultInstance())).isFalse(); - - result = container.getValue().unpackSameTypeAs(TestAllTypes.getDefaultInstance()); - TestUtil.assertAllFieldsSet(result); - - container = TestAny.newBuilder().setValue(Any.pack(message, "")).build(); - - assertThat(container.getValue().getTypeUrl()) - .isEqualTo("/" + TestAllTypes.getDescriptor().getFullName()); - - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - assertThat(container.getValue().isSameTypeAs(TestAny.getDefaultInstance())).isFalse(); - - result = container.getValue().unpackSameTypeAs(TestAllTypes.getDefaultInstance()); - TestUtil.assertAllFieldsSet(result); - } - - @Test public void testCachedUnpackResult() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -182,25 +117,10 @@ public class AnyTest { TestAny container = TestAny.newBuilder().setValue(Any.pack(message)).build(); - assertThat(container.getValue().is(TestAllTypes.class)).isTrue(); + assertTrue(container.getValue().is(TestAllTypes.class)); TestAllTypes result1 = container.getValue().unpack(TestAllTypes.class); TestAllTypes result2 = container.getValue().unpack(TestAllTypes.class); - assertThat(Objects.equals(result1, result2)).isTrue(); - } - - @Test - public void testCachedUnpackExemplarResult() throws Exception { - TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TestUtil.setAllFields(builder); - TestAllTypes message = builder.build(); - - TestAny container = TestAny.newBuilder().setValue(Any.pack(message)).build(); - - assertThat(container.getValue().isSameTypeAs(TestAllTypes.getDefaultInstance())).isTrue(); - - TestAllTypes result1 = container.getValue().unpackSameTypeAs(TestAllTypes.getDefaultInstance()); - TestAllTypes result2 = container.getValue().unpackSameTypeAs(TestAllTypes.getDefaultInstance()); - assertThat(Objects.equals(result1, result2)).isTrue(); + assertTrue(Objects.equals(result1, result2)); } } diff --git a/java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java b/java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java index 48689d51055bb2c0534a1b0103da079e338c94cc..037173b667433f76a5d7b358e584ccf8e4d431ab 100644 --- a/java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java +++ b/java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java @@ -1,23 +1,40 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertWithMessage; - import com.google.protobuf.ArrayDecoders.Registers; import java.io.IOException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -@RunWith(JUnit4.class) -public class ArrayDecodersTest { +public class ArrayDecodersTest extends TestCase { private static final int TAG = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); private static final ByteString NEGATIVE_SIZE_0 = generateNegativeLength(0); @@ -25,40 +42,36 @@ public class ArrayDecodersTest { private Registers registers; - @Before + @Override public void setUp() { registers = new Registers(); registers.int1 = TAG; } - @Test public void testException_decodeString() { try { ArrayDecoders.decodeString(NEGATIVE_SIZE_0.toByteArray(), 0, registers); - assertWithMessage("should throw exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeStringRequireUtf8() { try { ArrayDecoders.decodeStringRequireUtf8(NEGATIVE_SIZE_0.toByteArray(), 0, registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeBytes() { try { ArrayDecoders.decodeBytes(NEGATIVE_SIZE_0.toByteArray(), 0, registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeStringList_first() { try { ArrayDecoders.decodeStringList( @@ -68,12 +81,11 @@ public class ArrayDecodersTest { NEGATIVE_SIZE_0.size(), new ProtobufArrayList(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeStringList_second() { try { ArrayDecoders.decodeStringList( @@ -83,12 +95,11 @@ public class ArrayDecodersTest { NEGATIVE_SIZE_1.size(), new ProtobufArrayList(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeStringListRequireUtf8_first() { try { ArrayDecoders.decodeStringListRequireUtf8( @@ -98,12 +109,11 @@ public class ArrayDecodersTest { NEGATIVE_SIZE_0.size(), new ProtobufArrayList(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeStringListRequireUtf8_second() { try { ArrayDecoders.decodeStringListRequireUtf8( @@ -113,12 +123,11 @@ public class ArrayDecodersTest { NEGATIVE_SIZE_1.size(), new ProtobufArrayList(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeBytesList_first() { try { ArrayDecoders.decodeBytesList( @@ -128,12 +137,11 @@ public class ArrayDecodersTest { NEGATIVE_SIZE_0.size(), new ProtobufArrayList(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeBytesList_second() { try { ArrayDecoders.decodeBytesList( @@ -143,12 +151,11 @@ public class ArrayDecodersTest { NEGATIVE_SIZE_1.size(), new ProtobufArrayList(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeUnknownField() { try { ArrayDecoders.decodeUnknownField( @@ -158,12 +165,11 @@ public class ArrayDecodersTest { NEGATIVE_SIZE_0.size(), UnknownFieldSetLite.newInstance(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } - @Test public void testException_decodeHugeField() { byte[] badBytes = new byte[] { @@ -172,13 +178,13 @@ public class ArrayDecodersTest { try { ArrayDecoders.decodeUnknownField( TAG, badBytes, 0, badBytes.length, UnknownFieldSetLite.newInstance(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } try { ArrayDecoders.decodeBytes(badBytes, 0, registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } @@ -200,7 +206,7 @@ public class ArrayDecodersTest { try { ArrayDecoders.decodeBytesList( TAG, badBytesList, 0, badBytes.length, new ProtobufArrayList<>(), registers); - assertWithMessage("should throw an exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { } } diff --git a/java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java b/java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java index 2f1b0fc75a0e66f7a966206574ed2093473aae84..cda2998f5d8b31e5fe55767192c7c46539908448 100644 --- a/java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java +++ b/java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java @@ -1,16 +1,40 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; import com.google.protobuf.testing.Proto2Testing.Proto2Message; import com.google.protobuf.testing.Proto3Testing.Proto3Message; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,15 +58,15 @@ public final class BinaryProtocolTest { // Deserialize with BinaryReader and verify that the message matches the original. Proto3Message result = ExperimentalSerializationUtil.fromByteArray(expectedBytes, Proto3Message.class); - assertThat(result).isEqualTo(expected); + assertEquals(expected, result); // Now write it back out using BinaryWriter and verify the output length. byte[] actualBytes = ExperimentalSerializationUtil.toByteArray(result); - assertThat(actualBytes).hasLength(expectedBytes.length); + Assert.assertEquals(expectedBytes.length, actualBytes.length); // Read back in the bytes and verify that it matches the original message. Proto3Message actual = Proto3Message.parseFrom(actualBytes); - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } @Test @@ -53,14 +77,14 @@ public final class BinaryProtocolTest { // Deserialize with BinaryReader and verify that the message matches the original. Proto2Message result = ExperimentalSerializationUtil.fromByteArray(expectedBytes, Proto2Message.class); - assertThat(result).isEqualTo(expected); + assertEquals(expected, result); // Now write it back out using BinaryWriter and verify the output length. byte[] actualBytes = ExperimentalSerializationUtil.toByteArray(result); - assertThat(actualBytes).hasLength(expectedBytes.length); + Assert.assertEquals(expectedBytes.length, actualBytes.length); // Read back in the bytes and verify that it matches the original message. Proto2Message actual = Proto2Message.parseFrom(actualBytes); - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } } diff --git a/java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java b/java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java index 6b2a5374687959593635553e3870e5d7721e0584..805b7b042f25bf7191551d31a7fe0f033434287e 100644 --- a/java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java +++ b/java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java @@ -1,28 +1,49 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static java.util.Arrays.asList; import com.google.protobuf.Internal.BooleanList; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Iterator; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests for {@link BooleanArrayList}. */ -@RunWith(JUnit4.class) -public class BooleanArrayListTest { +/** + * Tests for {@link BooleanArrayList}. + * + * @author dweis@google.com (Daniel Weis) + */ +public class BooleanArrayListTest extends TestCase { private static final BooleanArrayList UNARY_LIST = newImmutableBooleanArrayList(true); private static final BooleanArrayList TERTIARY_LIST = @@ -30,22 +51,19 @@ public class BooleanArrayListTest { private BooleanArrayList list; - @Before - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { list = new BooleanArrayList(); } - @Test public void testEmptyListReturnsSameInstance() { - assertThat(BooleanArrayList.emptyList()).isSameInstanceAs(BooleanArrayList.emptyList()); + assertSame(BooleanArrayList.emptyList(), BooleanArrayList.emptyList()); } - @Test public void testEmptyListIsImmutable() { assertImmutable(BooleanArrayList.emptyList()); } - @Test public void testMakeImmutable() { list.addBoolean(true); list.addBoolean(false); @@ -55,20 +73,19 @@ public class BooleanArrayListTest { assertImmutable(list); } - @Test public void testModificationWithIteration() { list.addAll(asList(true, false, true, false)); Iterator iterator = list.iterator(); - assertThat(list).hasSize(4); - assertThat((boolean) list.get(0)).isEqualTo(true); - assertThat((boolean) iterator.next()).isEqualTo(true); + assertEquals(4, list.size()); + assertEquals(true, (boolean) list.get(0)); + assertEquals(true, (boolean) iterator.next()); list.set(0, true); - assertThat((boolean) iterator.next()).isEqualTo(false); + assertEquals(false, (boolean) iterator.next()); list.remove(0); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } @@ -77,211 +94,191 @@ public class BooleanArrayListTest { list.add(0, false); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } } - @Test public void testGet() { - assertThat((boolean) TERTIARY_LIST.get(0)).isEqualTo(true); - assertThat((boolean) TERTIARY_LIST.get(1)).isEqualTo(false); - assertThat((boolean) TERTIARY_LIST.get(2)).isEqualTo(true); + assertEquals(true, (boolean) TERTIARY_LIST.get(0)); + assertEquals(false, (boolean) TERTIARY_LIST.get(1)); + assertEquals(true, (boolean) TERTIARY_LIST.get(2)); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testGetBoolean() { - assertThat(TERTIARY_LIST.getBoolean(0)).isEqualTo(true); - assertThat(TERTIARY_LIST.getBoolean(1)).isEqualTo(false); - assertThat(TERTIARY_LIST.getBoolean(2)).isEqualTo(true); + assertEquals(true, TERTIARY_LIST.getBoolean(0)); + assertEquals(false, TERTIARY_LIST.getBoolean(1)); + assertEquals(true, TERTIARY_LIST.getBoolean(2)); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testIndexOf_nullElement() { - assertThat(TERTIARY_LIST.indexOf(null)).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(null)); } - @Test public void testIndexOf_incompatibleElementType() { - assertThat(TERTIARY_LIST.indexOf(new Object())).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(new Object())); } - @Test public void testIndexOf_notInList() { - assertThat(UNARY_LIST.indexOf(false)).isEqualTo(-1); + assertEquals(-1, UNARY_LIST.indexOf(false)); } - @Test public void testIndexOf_notInListWithDuplicates() { BooleanArrayList listWithDupes = newImmutableBooleanArrayList(true, true); - assertThat(listWithDupes.indexOf(false)).isEqualTo(-1); + assertEquals(-1, listWithDupes.indexOf(false)); } - @Test public void testIndexOf_inList() { - assertThat(TERTIARY_LIST.indexOf(false)).isEqualTo(1); + assertEquals(1, TERTIARY_LIST.indexOf(false)); } - @Test public void testIndexOf_inListWithDuplicates_matchAtHead() { BooleanArrayList listWithDupes = newImmutableBooleanArrayList(true, true, false); - assertThat(listWithDupes.indexOf(true)).isEqualTo(0); + assertEquals(0, listWithDupes.indexOf(true)); } - @Test public void testIndexOf_inListWithDuplicates_matchMidList() { BooleanArrayList listWithDupes = newImmutableBooleanArrayList(false, true, true, false); - assertThat(listWithDupes.indexOf(true)).isEqualTo(1); + assertEquals(1, listWithDupes.indexOf(true)); } - @Test public void testContains_nullElement() { - assertThat(TERTIARY_LIST).doesNotContain(null); + assertEquals(false, TERTIARY_LIST.contains(null)); } - @Test public void testContains_incompatibleElementType() { - assertThat(TERTIARY_LIST).doesNotContain(new Object()); + assertEquals(false, TERTIARY_LIST.contains(new Object())); } - @Test public void testContains_notInList() { - assertThat(UNARY_LIST).doesNotContain(false); + assertEquals(false, UNARY_LIST.contains(false)); } - @Test public void testContains_notInListWithDuplicates() { BooleanArrayList listWithDupes = newImmutableBooleanArrayList(true, true); - assertThat(listWithDupes).doesNotContain(false); + assertEquals(false, listWithDupes.contains(false)); } - @Test public void testContains_inList() { - assertThat(TERTIARY_LIST).contains(false); + assertEquals(true, TERTIARY_LIST.contains(false)); } - @Test public void testContains_inListWithDuplicates_matchAtHead() { BooleanArrayList listWithDupes = newImmutableBooleanArrayList(true, true, false); - assertThat(listWithDupes).contains(true); + assertEquals(true, listWithDupes.contains(true)); } - @Test public void testContains_inListWithDuplicates_matchMidList() { BooleanArrayList listWithDupes = newImmutableBooleanArrayList(false, true, true, false); - assertThat(listWithDupes).contains(true); + assertEquals(true, listWithDupes.contains(true)); } - @Test public void testSize() { - assertThat(BooleanArrayList.emptyList()).isEmpty(); - assertThat(UNARY_LIST).hasSize(1); - assertThat(TERTIARY_LIST).hasSize(3); + assertEquals(0, BooleanArrayList.emptyList().size()); + assertEquals(1, UNARY_LIST.size()); + assertEquals(3, TERTIARY_LIST.size()); list.addBoolean(true); list.addBoolean(false); list.addBoolean(false); list.addBoolean(false); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); list.remove(0); - assertThat(list).hasSize(3); + assertEquals(3, list.size()); list.add(true); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); } - @Test public void testSet() { list.addBoolean(false); list.addBoolean(false); - assertThat((boolean) list.set(0, true)).isEqualTo(false); - assertThat(list.getBoolean(0)).isEqualTo(true); + assertEquals(false, (boolean) list.set(0, true)); + assertEquals(true, list.getBoolean(0)); - assertThat((boolean) list.set(1, false)).isEqualTo(false); - assertThat(list.getBoolean(1)).isEqualTo(false); + assertEquals(false, (boolean) list.set(1, false)); + assertEquals(false, list.getBoolean(1)); try { list.set(-1, false); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.set(2, false); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testSetBoolean() { list.addBoolean(true); list.addBoolean(true); - assertThat(list.setBoolean(0, false)).isEqualTo(true); - assertThat(list.getBoolean(0)).isEqualTo(false); + assertEquals(true, list.setBoolean(0, false)); + assertEquals(false, list.getBoolean(0)); - assertThat(list.setBoolean(1, false)).isEqualTo(true); - assertThat(list.getBoolean(1)).isEqualTo(false); + assertEquals(true, list.setBoolean(1, false)); + assertEquals(false, list.getBoolean(1)); try { list.setBoolean(-1, false); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.setBoolean(2, false); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testAdd() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.add(false)).isTrue(); - assertThat(list).containsExactly(false); + assertTrue(list.add(false)); + assertEquals(asList(false), list); - assertThat(list.add(true)).isTrue(); + assertTrue(list.add(true)); list.add(0, false); - assertThat(list).containsExactly(false, false, true).inOrder(); + assertEquals(asList(false, false, true), list); list.add(0, true); list.add(0, false); @@ -289,9 +286,8 @@ public class BooleanArrayListTest { for (int i = 0; i < 6; i++) { list.add(i % 2 == 0); } - assertThat(list) - .containsExactly(false, true, false, false, true, true, false, true, false, true, false) - .inOrder(); + assertEquals( + asList(false, true, false, false, true, true, false, true, false, true, false), list); try { list.add(-1, true); @@ -306,247 +302,237 @@ public class BooleanArrayListTest { } } - @Test public void testAddBoolean() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); list.addBoolean(false); - assertThat(list).containsExactly(false); + assertEquals(asList(false), list); list.addBoolean(true); - assertThat(list).containsExactly(false, true).inOrder(); + assertEquals(asList(false, true), list); } - @Test public void testAddAll() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.addAll(Collections.singleton(true))).isTrue(); - assertThat(list).hasSize(1); - assertThat((boolean) list.get(0)).isEqualTo(true); - assertThat(list.getBoolean(0)).isEqualTo(true); + assertTrue(list.addAll(Collections.singleton(true))); + assertEquals(1, list.size()); + assertEquals(true, (boolean) list.get(0)); + assertEquals(true, list.getBoolean(0)); - assertThat(list.addAll(asList(false, true, false, true, false))).isTrue(); - assertThat(list).containsExactly(true, false, true, false, true, false).inOrder(); + assertTrue(list.addAll(asList(false, true, false, true, false))); + assertEquals(asList(true, false, true, false, true, false), list); - assertThat(list.addAll(TERTIARY_LIST)).isTrue(); - assertThat(list) - .containsExactly(true, false, true, false, true, false, true, false, true) - .inOrder(); + assertTrue(list.addAll(TERTIARY_LIST)); + assertEquals(asList(true, false, true, false, true, false, true, false, true), list); - assertThat(list.addAll(Collections.emptyList())).isFalse(); - assertThat(list.addAll(BooleanArrayList.emptyList())).isFalse(); + assertFalse(list.addAll(Collections.emptyList())); + assertFalse(list.addAll(BooleanArrayList.emptyList())); } - @Test public void testEquals() { BooleanArrayList list1 = new BooleanArrayList(); BooleanArrayList list2 = new BooleanArrayList(); - assertThat(list1).isEqualTo(list2); + assertEquals(list1, list2); } - @Test public void testRemove() { list.addAll(TERTIARY_LIST); - assertThat((boolean) list.remove(0)).isEqualTo(true); - assertThat(list).containsExactly(false, true).inOrder(); + assertEquals(true, (boolean) list.remove(0)); + assertEquals(asList(false, true), list); - assertThat(list.remove(Boolean.TRUE)).isTrue(); - assertThat(list).containsExactly(false); + assertTrue(list.remove(Boolean.TRUE)); + assertEquals(asList(false), list); - assertThat(list.remove(Boolean.TRUE)).isFalse(); - assertThat(list).containsExactly(false); + assertFalse(list.remove(Boolean.TRUE)); + assertEquals(asList(false), list); - assertThat((boolean) list.remove(0)).isEqualTo(false); - assertThat(list).isEmpty(); + assertEquals(false, (boolean) list.remove(0)); + assertEquals(asList(), list); try { list.remove(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.remove(0); - assertWithMessage("expected exception").fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testRemoveEnd_listAtCapacity() { BooleanList toRemove = BooleanArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addBoolean(true); toRemove.remove(0); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } - @Test public void testRemove_listAtCapacity() { BooleanList toRemove = BooleanArrayList.emptyList().mutableCopyWithCapacity(2); toRemove.addBoolean(true); toRemove.addBoolean(false); toRemove.remove(0); - assertThat(toRemove).hasSize(1); - assertThat((boolean) toRemove.get(0)).isEqualTo(false); + assertEquals(1, toRemove.size()); + assertEquals(false, (boolean) toRemove.get(0)); } - @Test public void testSublistRemoveEndOfCapacity() { BooleanList toRemove = BooleanArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addBoolean(true); toRemove.subList(0, 1).clear(); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } private void assertImmutable(BooleanList list) { try { list.add(true); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.add(0, true); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.singletonList(true)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(new BooleanArrayList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.singleton(true)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addBoolean(false); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.clear(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.singleton(Boolean.TRUE)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.singleton(Boolean.TRUE)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, false); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.setBoolean(0, false); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } diff --git a/java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java b/java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java index f64791e356b4d4f8ba5b0c7add7cd66a36d7a622..654d62bc3552b742cd4430b11ade63510bb3bdde 100644 --- a/java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java +++ b/java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java @@ -1,36 +1,53 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertWithMessage; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.UnsupportedEncodingException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; /** * This class tests {@link BoundedByteString}, which extends {@link LiteralByteString}, by * inheriting the tests from {@link LiteralByteStringTest}. The only method which is strange enough * that it needs to be overridden here is {@link #testToString()}. + * + * @author carlanton@google.com (Carl Haverl) */ -@RunWith(JUnit4.class) public class BoundedByteStringTest extends LiteralByteStringTest { @Override - @Before - public void setUp() throws Exception { + protected void setUp() throws Exception { classUnderTest = "BoundedByteString"; byte[] sourceBytes = ByteStringTest.getTestBytes(2341, 11337766L); int from = 100; @@ -42,39 +59,40 @@ public class BoundedByteStringTest extends LiteralByteStringTest { } @Override - @Test public void testToString() throws UnsupportedEncodingException { String testString = "I love unicode \u1234\u5678 characters"; ByteString unicode = ByteString.wrap(testString.getBytes(Internal.UTF_8)); ByteString chopped = unicode.substring(2, unicode.size() - 6); - assertWithMessage("%s.substring() must have the expected type", classUnderTest) - .that(classUnderTest) - .isEqualTo(getActualClassName(chopped)); + assertEquals( + classUnderTest + ".substring() must have the expected type", + classUnderTest, + getActualClassName(chopped)); String roundTripString = chopped.toString(UTF_8); - assertWithMessage("%s unicode bytes must match", classUnderTest) - .that(testString.substring(2, testString.length() - 6)) - .isEqualTo(roundTripString); + assertEquals( + classUnderTest + " unicode bytes must match", + testString.substring(2, testString.length() - 6), + roundTripString); } @Override - @Test public void testCharsetToString() { String testString = "I love unicode \u1234\u5678 characters"; ByteString unicode = ByteString.wrap(testString.getBytes(Internal.UTF_8)); ByteString chopped = unicode.substring(2, unicode.size() - 6); - assertWithMessage("%s.substring() must have the expected type", classUnderTest) - .that(classUnderTest) - .isEqualTo(getActualClassName(chopped)); + assertEquals( + classUnderTest + ".substring() must have the expected type", + classUnderTest, + getActualClassName(chopped)); String roundTripString = chopped.toString(Internal.UTF_8); - assertWithMessage("%s unicode bytes must match", classUnderTest) - .that(testString.substring(2, testString.length() - 6)) - .isEqualTo(roundTripString); + assertEquals( + classUnderTest + " unicode bytes must match", + testString.substring(2, testString.length() - 6), + roundTripString); } @Override - @Test public void testJavaSerialization() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(out); @@ -84,7 +102,7 @@ public class BoundedByteStringTest extends LiteralByteStringTest { InputStream in = new ByteArrayInputStream(pickled); ObjectInputStream ois = new ObjectInputStream(in); Object o = ois.readObject(); - assertWithMessage("Didn't get a ByteString back").that(o).isInstanceOf(ByteString.class); - assertWithMessage("Should get an equal ByteString back").that(stringUnderTest).isEqualTo(o); + assertTrue("Didn't get a ByteString back", o instanceof ByteString); + assertEquals("Should get an equal ByteString back", stringUnderTest, o); } } diff --git a/java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java b/java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java index 4cc65f430db9ddee5b412ecc6507b44618858e75..5f0ef620283338dc65c631c14798d868a4249738 100644 --- a/java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java +++ b/java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java @@ -1,35 +1,51 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Random; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Tests for {@link ByteBufferWriter}. */ -@RunWith(JUnit4.class) -public class ByteBufferWriterTest { +public class ByteBufferWriterTest extends TestCase { - @Test public void testHeapBuffer() throws IOException { // Test a small and large buffer. testWrite(ByteBuffer.allocate(100)); testWrite(ByteBuffer.allocate(1024 * 100)); } - @Test public void testDirectBuffer() throws IOException { // Test a small and large buffer. testWrite(ByteBuffer.allocateDirect(100)); @@ -40,8 +56,8 @@ public class ByteBufferWriterTest { fillRandom(buffer); ByteArrayOutputStream os = new ByteArrayOutputStream(buffer.remaining()); ByteBufferWriter.write(buffer, os); - assertThat(buffer.position()).isEqualTo(0); - assertThat(Arrays.equals(toArray(buffer), os.toByteArray())).isTrue(); + assertEquals(0, buffer.position()); + assertTrue(Arrays.equals(toArray(buffer), os.toByteArray())); } private void fillRandom(ByteBuffer buf) { diff --git a/java/core/src/test/java/com/google/protobuf/ByteStringTest.java b/java/core/src/test/java/com/google/protobuf/ByteStringTest.java index 1a022f35dcbbb046e11a32ef6899b4ca5679ed8c..1b1a786bfb3fa905153b6f1b554abe9c76341dfe 100644 --- a/java/core/src/test/java/com/google/protobuf/ByteStringTest.java +++ b/java/core/src/test/java/com/google/protobuf/ByteStringTest.java @@ -1,15 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import com.google.protobuf.ByteString.Output; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -26,16 +46,15 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import java.util.Random; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Test methods with implementations in {@link ByteString}, plus do some top-level "integration" * tests. + * + * @author carlanton@google.com (Carl Haverl) */ -@RunWith(JUnit4.class) -public class ByteStringTest { +public class ByteStringTest extends TestCase { private static final Charset UTF_16 = Charset.forName("UTF-16"); @@ -46,16 +65,16 @@ public class ByteStringTest { return result; } - private static byte[] getTestBytes(int size) { + private byte[] getTestBytes(int size) { return getTestBytes(size, 445566L); } - private static byte[] getTestBytes() { + private byte[] getTestBytes() { return getTestBytes(1000); } // Compare the entire left array with a subset of the right array. - private static boolean isArrayRange(byte[] left, byte[] right, int rightOffset, int length) { + private boolean isArrayRange(byte[] left, byte[] right, int rightOffset, int length) { boolean stillEqual = (left.length == length); for (int i = 0; (stillEqual && i < length); ++i) { stillEqual = (left[i] == right[rightOffset + i]); @@ -64,22 +83,21 @@ public class ByteStringTest { } // Returns true only if the given two arrays have identical contents. - private static boolean isArray(byte[] left, byte[] right) { + private boolean isArray(byte[] left, byte[] right) { return left.length == right.length && isArrayRange(left, right, 0, left.length); } - @Test public void testCompare_equalByteStrings_compareEqual() throws Exception { byte[] referenceBytes = getTestBytes(); ByteString string1 = ByteString.copyFrom(referenceBytes); ByteString string2 = ByteString.copyFrom(referenceBytes); - assertWithMessage("ByteString instances containing the same data must compare equal.") - .that(ByteString.unsignedLexicographicalComparator().compare(string1, string2)) - .isEqualTo(0); + assertEquals( + "ByteString instances containing the same data must compare equal.", + 0, + ByteString.unsignedLexicographicalComparator().compare(string1, string2)); } - @Test public void testCompare_byteStringsSortLexicographically() throws Exception { ByteString app = ByteString.copyFromUtf8("app"); ByteString apple = ByteString.copyFromUtf8("apple"); @@ -87,168 +105,93 @@ public class ByteStringTest { Comparator comparator = ByteString.unsignedLexicographicalComparator(); - assertWithMessage("ByteString(app) < ByteString(apple)") - .that(comparator.compare(app, apple) < 0) - .isTrue(); - assertWithMessage("ByteString(app) < ByteString(banana)") - .that(comparator.compare(app, banana) < 0) - .isTrue(); - assertWithMessage("ByteString(apple) < ByteString(banana)") - .that(comparator.compare(apple, banana) < 0) - .isTrue(); + assertTrue("ByteString(app) < ByteString(apple)", comparator.compare(app, apple) < 0); + assertTrue("ByteString(app) < ByteString(banana)", comparator.compare(app, banana) < 0); + assertTrue("ByteString(apple) < ByteString(banana)", comparator.compare(apple, banana) < 0); } - @Test public void testCompare_interpretsByteValuesAsUnsigned() throws Exception { // Two's compliment of `-1` == 0b11111111 == 255 ByteString twoHundredFiftyFive = ByteString.copyFrom(new byte[] {-1}); // 0b00000001 == 1 ByteString one = ByteString.copyFrom(new byte[] {1}); - assertWithMessage("ByteString comparison treats bytes as unsigned values") - .that(ByteString.unsignedLexicographicalComparator().compare(one, twoHundredFiftyFive) < 0) - .isTrue(); + assertTrue( + "ByteString comparison treats bytes as unsigned values", + ByteString.unsignedLexicographicalComparator().compare(one, twoHundredFiftyFive) < 0); } - @Test - public void testSubstring_beginIndex() { + public void testSubstring_BeginIndex() { byte[] bytes = getTestBytes(); ByteString substring = ByteString.copyFrom(bytes).substring(500); - assertWithMessage("substring must contain the tail of the string") - .that(isArrayRange(substring.toByteArray(), bytes, 500, bytes.length - 500)) - .isTrue(); - } - - @Test - public void testEmpty_isEmpty() { - ByteString byteString = ByteString.empty(); - assertThat(byteString.isEmpty()).isTrue(); - assertWithMessage("ByteString.empty() must return empty byte array") - .that(isArray(byteString.toByteArray(), new byte[] {})) - .isTrue(); - } - - @Test - public void testEmpty_referenceEquality() { - assertThat(ByteString.empty()).isSameInstanceAs(ByteString.EMPTY); - assertThat(ByteString.empty()).isSameInstanceAs(ByteString.empty()); - } - - @Test - public void testFromHex_hexString() { - ByteString byteString; - byteString = ByteString.fromHex("0a0b0c"); - assertWithMessage("fromHex must contain the expected bytes") - .that(isArray(byteString.toByteArray(), new byte[] {0x0a, 0x0b, 0x0c})) - .isTrue(); - - byteString = ByteString.fromHex("0A0B0C"); - assertWithMessage("fromHex must contain the expected bytes") - .that(isArray(byteString.toByteArray(), new byte[] {0x0a, 0x0b, 0x0c})) - .isTrue(); - - byteString = ByteString.fromHex("0a0b0c0d0e0f"); - assertWithMessage("fromHex must contain the expected bytes") - .that(isArray(byteString.toByteArray(), new byte[] {0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f})) - .isTrue(); - } - - @Test - @SuppressWarnings("AlwaysThrows") // Verifying that indeed these calls do throw. - public void testFromHex_invalidHexString() { - try { - ByteString.fromHex("a0b0c"); - assertWithMessage("Should throw").fail(); - } catch (NumberFormatException expected) { - assertThat(expected).hasMessageThat().contains("even"); - } - - try { - ByteString.fromHex("0x0y0z"); - assertWithMessage("Should throw").fail(); - } catch (NumberFormatException expected) { - assertThat(expected).hasMessageThat().contains("[0-9a-fA-F]"); - } - - try { - ByteString.fromHex("0૫"); - assertWithMessage("Should throw").fail(); - } catch (NumberFormatException expected) { - assertThat(expected).hasMessageThat().contains("[0-9a-fA-F]"); - } + assertTrue( + "substring must contain the tail of the string", + isArrayRange(substring.toByteArray(), bytes, 500, bytes.length - 500)); } - @Test - public void testCopyFrom_bytesOffsetSize() { + public void testCopyFrom_BytesOffsetSize() { byte[] bytes = getTestBytes(); ByteString byteString = ByteString.copyFrom(bytes, 500, 200); - assertWithMessage("copyFrom sub-range must contain the expected bytes") - .that(isArrayRange(byteString.toByteArray(), bytes, 500, 200)) - .isTrue(); + assertTrue( + "copyFrom sub-range must contain the expected bytes", + isArrayRange(byteString.toByteArray(), bytes, 500, 200)); } - @Test - public void testCopyFrom_bytes() { + public void testCopyFrom_Bytes() { byte[] bytes = getTestBytes(); ByteString byteString = ByteString.copyFrom(bytes); - assertWithMessage("copyFrom must contain the expected bytes") - .that(isArray(byteString.toByteArray(), bytes)) - .isTrue(); + assertTrue( + "copyFrom must contain the expected bytes", isArray(byteString.toByteArray(), bytes)); } - @Test - public void testCopyFrom_byteBufferSize() { + public void testCopyFrom_ByteBufferSize() { byte[] bytes = getTestBytes(); ByteBuffer byteBuffer = ByteBuffer.allocate(bytes.length); byteBuffer.put(bytes); byteBuffer.position(500); ByteString byteString = ByteString.copyFrom(byteBuffer, 200); - assertWithMessage("copyFrom byteBuffer sub-range must contain the expected bytes") - .that(isArrayRange(byteString.toByteArray(), bytes, 500, 200)) - .isTrue(); + assertTrue( + "copyFrom byteBuffer sub-range must contain the expected bytes", + isArrayRange(byteString.toByteArray(), bytes, 500, 200)); } - @Test - public void testCopyFrom_byteBuffer() { + public void testCopyFrom_ByteBuffer() { byte[] bytes = getTestBytes(); ByteBuffer byteBuffer = ByteBuffer.allocate(bytes.length); byteBuffer.put(bytes); byteBuffer.position(500); ByteString byteString = ByteString.copyFrom(byteBuffer); - assertWithMessage("copyFrom byteBuffer sub-range must contain the expected bytes") - .that(isArrayRange(byteString.toByteArray(), bytes, 500, bytes.length - 500)) - .isTrue(); + assertTrue( + "copyFrom byteBuffer sub-range must contain the expected bytes", + isArrayRange(byteString.toByteArray(), bytes, 500, bytes.length - 500)); } - @Test - public void testCopyFrom_stringEncoding() { + public void testCopyFrom_StringEncoding() { String testString = "I love unicode \u1234\u5678 characters"; ByteString byteString = ByteString.copyFrom(testString, UTF_16); byte[] testBytes = testString.getBytes(UTF_16); - assertWithMessage("copyFrom string must respect the charset") - .that(isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)) - .isTrue(); + assertTrue( + "copyFrom string must respect the charset", + isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)); } - @Test - public void testCopyFrom_utf8() { + public void testCopyFrom_Utf8() { String testString = "I love unicode \u1234\u5678 characters"; ByteString byteString = ByteString.copyFromUtf8(testString); byte[] testBytes = testString.getBytes(Internal.UTF_8); - assertWithMessage("copyFromUtf8 string must respect the charset") - .that(isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)) - .isTrue(); + assertTrue( + "copyFromUtf8 string must respect the charset", + isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)); } - @Test - public void testCopyFrom_iterable() { + public void testCopyFrom_Iterable() { byte[] testBytes = getTestBytes(77777, 113344L); final List pieces = makeConcretePieces(testBytes); // Call copyFrom() on a Collection ByteString byteString = ByteString.copyFrom(pieces); - assertWithMessage("copyFrom a List must contain the expected bytes") - .that(isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)) - .isTrue(); + assertTrue( + "copyFrom a List must contain the expected bytes", + isArrayRange(byteString.toByteArray(), testBytes, 0, testBytes.length)); // Call copyFrom on an iteration that's not a collection ByteString byteStringAlt = ByteString.copyFrom( @@ -258,65 +201,60 @@ public class ByteStringTest { return pieces.iterator(); } }); - assertWithMessage("copyFrom from an Iteration must contain the expected bytes") - .that(byteString) - .isEqualTo(byteStringAlt); + assertEquals( + "copyFrom from an Iteration must contain the expected bytes", byteString, byteStringAlt); } - @Test - public void testCopyFrom_lengthTooBig() { + public void testCopyFrom_LengthTooBig() { byte[] testBytes = getTestBytes(100); try { ByteString.copyFrom(testBytes, 0, 200); - assertWithMessage("Should throw").fail(); + fail("Should throw"); } catch (IndexOutOfBoundsException expected) { } try { ByteString.copyFrom(testBytes, 99, 2); - assertWithMessage("Should throw").fail(); + fail(); } catch (IndexOutOfBoundsException expected) { } ByteBuffer buf = ByteBuffer.wrap(testBytes); try { ByteString.copyFrom(buf, 101); - assertWithMessage("Should throw").fail(); + fail(); } catch (IndexOutOfBoundsException expected) { } try { ByteString.copyFrom(testBytes, -1, 10); - assertWithMessage("Should throw").fail(); + fail("Should throw"); } catch (IndexOutOfBoundsException expected) { } } - @Test - public void testCopyTo_targetOffset() { + public void testCopyTo_TargetOffset() { byte[] bytes = getTestBytes(); ByteString byteString = ByteString.copyFrom(bytes); byte[] target = new byte[bytes.length + 1000]; byteString.copyTo(target, 400); - assertWithMessage("copyFrom byteBuffer sub-range must contain the expected bytes") - .that(isArrayRange(bytes, target, 400, bytes.length)) - .isTrue(); + assertTrue( + "copyFrom byteBuffer sub-range must contain the expected bytes", + isArrayRange(bytes, target, 400, bytes.length)); } - @Test public void testReadFrom_emptyStream() throws IOException { ByteString byteString = ByteString.readFrom(new ByteArrayInputStream(new byte[0])); - assertWithMessage("reading an empty stream must result in the EMPTY constant byte string") - .that(ByteString.EMPTY) - .isSameInstanceAs(byteString); + assertSame( + "reading an empty stream must result in the EMPTY constant byte string", + ByteString.EMPTY, + byteString); } - @Test public void testReadFrom_smallStream() throws IOException { assertReadFrom(getTestBytes(10)); } - @Test public void testReadFrom_mutating() throws IOException { EvilInputStream eis = new EvilInputStream(); ByteString byteString = ByteString.readFrom(eis); @@ -328,13 +266,12 @@ public class ByteStringTest { } byte[] newValue = byteString.toByteArray(); - assertWithMessage("copyFrom byteBuffer must not grant access to underlying array") - .that(Arrays.equals(originalValue, newValue)) - .isTrue(); + assertTrue( + "copyFrom byteBuffer must not grant access to underlying array", + Arrays.equals(originalValue, newValue)); } // Tests sizes that are near the rope copy-out threshold. - @Test public void testReadFrom_mediumStream() throws IOException { assertReadFrom(getTestBytes(ByteString.CONCATENATE_BY_COPY_SIZE - 1)); assertReadFrom(getTestBytes(ByteString.CONCATENATE_BY_COPY_SIZE)); @@ -343,7 +280,6 @@ public class ByteStringTest { } // Tests sizes that are over multi-segment rope threshold. - @Test public void testReadFrom_largeStream() throws IOException { assertReadFrom(getTestBytes(0x100)); assertReadFrom(getTestBytes(0x101)); @@ -357,7 +293,6 @@ public class ByteStringTest { } // Tests sizes that are near the read buffer size. - @Test public void testReadFrom_byteBoundaries() throws IOException { final int min = ByteString.MIN_READ_FROM_CHUNK_SIZE; final int max = ByteString.MAX_READ_FROM_CHUNK_SIZE; @@ -388,30 +323,26 @@ public class ByteStringTest { } // Tests that IOExceptions propagate through ByteString.readFrom(). - @Test - public void testReadFrom_iOExceptions() { + public void testReadFrom_IOExceptions() { try { ByteString.readFrom(new FailStream()); - assertWithMessage("readFrom must throw the underlying IOException").fail(); + fail("readFrom must throw the underlying IOException"); } catch (IOException e) { - assertWithMessage("readFrom must throw the expected exception") - .that(e) - .hasMessageThat() - .isEqualTo("synthetic failure"); + assertEquals( + "readFrom must throw the expected exception", "synthetic failure", e.getMessage()); } } // Tests that ByteString.readFrom works with streams that don't // always fill their buffers. - @Test public void testReadFrom_reluctantStream() throws IOException { final byte[] data = getTestBytes(0x1000); ByteString byteString = ByteString.readFrom(new ReluctantStream(data)); - assertWithMessage("readFrom byte stream must contain the expected bytes") - .that(isArray(byteString.toByteArray(), data)) - .isTrue(); + assertTrue( + "readFrom byte stream must contain the expected bytes", + isArray(byteString.toByteArray(), data)); // Same test as above, but with some specific chunk sizes. assertReadFromReluctantStream(data, 100); @@ -427,29 +358,27 @@ public class ByteStringTest { // reluctant stream with the given chunkSize parameter. private void assertReadFromReluctantStream(byte[] bytes, int chunkSize) throws IOException { ByteString b = ByteString.readFrom(new ReluctantStream(bytes), chunkSize); - assertWithMessage("readFrom byte stream must contain the expected bytes") - .that(isArray(b.toByteArray(), bytes)) - .isTrue(); + assertTrue( + "readFrom byte stream must contain the expected bytes", isArray(b.toByteArray(), bytes)); } // Tests that ByteString.readFrom works with streams that implement // available(). - @Test public void testReadFrom_available() throws IOException { final byte[] data = getTestBytes(0x1001); ByteString byteString = ByteString.readFrom(new AvailableStream(data)); - assertWithMessage("readFrom byte stream must contain the expected bytes") - .that(isArray(byteString.toByteArray(), data)) - .isTrue(); + assertTrue( + "readFrom byte stream must contain the expected bytes", + isArray(byteString.toByteArray(), data)); } // Fails unless ByteString.readFrom reads the bytes correctly. private void assertReadFrom(byte[] bytes) throws IOException { ByteString byteString = ByteString.readFrom(new ByteArrayInputStream(bytes)); - assertWithMessage("readFrom byte stream must contain the expected bytes") - .that(isArray(byteString.toByteArray(), bytes)) - .isTrue(); + assertTrue( + "readFrom byte stream must contain the expected bytes", + isArray(byteString.toByteArray(), bytes)); } // A stream that fails when read. @@ -549,54 +478,46 @@ public class ByteStringTest { } } - @Test public void testToStringUtf8() { String testString = "I love unicode \u1234\u5678 characters"; byte[] testBytes = testString.getBytes(Internal.UTF_8); ByteString byteString = ByteString.copyFrom(testBytes); - assertWithMessage("copyToStringUtf8 must respect the charset") - .that(testString) - .isEqualTo(byteString.toStringUtf8()); + assertEquals( + "copyToStringUtf8 must respect the charset", testString, byteString.toStringUtf8()); } - @Test public void testToString() { String toString = ByteString.copyFrom("Here are some bytes: \t\u00a1".getBytes(Internal.UTF_8)).toString(); - assertWithMessage(toString).that(toString.contains("size=24")).isTrue(); - assertWithMessage(toString) - .that(toString.contains("contents=\"Here are some bytes: \\t\\302\\241\"")) - .isTrue(); + assertTrue(toString, toString.contains("size=24")); + assertTrue(toString, toString.contains("contents=\"Here are some bytes: \\t\\302\\241\"")); } - @Test public void testToString_long() { String toString = ByteString.copyFrom( "123456789012345678901234567890123456789012345678901234567890" .getBytes(Internal.UTF_8)) .toString(); - assertWithMessage(toString).that(toString.contains("size=60")).isTrue(); - assertWithMessage(toString) - .that(toString.contains("contents=\"12345678901234567890123456789012345678901234567...\"")) - .isTrue(); + assertTrue(toString, toString.contains("size=60")); + assertTrue( + toString, + toString.contains("contents=\"12345678901234567890123456789012345678901234567...\"")); } - @Test - public void testNewOutput_initialCapacity() throws IOException { + public void testNewOutput_InitialCapacity() throws IOException { byte[] bytes = getTestBytes(); ByteString.Output output = ByteString.newOutput(bytes.length + 100); output.write(bytes); ByteString byteString = output.toByteString(); - assertWithMessage("String built from newOutput(int) must contain the expected bytes") - .that(isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)) - .isTrue(); + assertTrue( + "String built from newOutput(int) must contain the expected bytes", + isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); } // Test newOutput() using a variety of buffer sizes and a variety of (fixed) // write sizes - @Test - public void testNewOutput_arrayWrite() { + public void testNewOutput_ArrayWrite() { byte[] bytes = getTestBytes(); int length = bytes.length; int[] bufferSizes = { @@ -612,17 +533,16 @@ public class ByteStringTest { output.write(bytes, i, Math.min(writeSize, length - i)); } ByteString byteString = output.toByteString(); - assertWithMessage("String built from newOutput() must contain the expected bytes") - .that(isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)) - .isTrue(); + assertTrue( + "String built from newOutput() must contain the expected bytes", + isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); } } } // Test newOutput() using a variety of buffer sizes, but writing all the // characters using write(byte); - @Test - public void testNewOutput_writeChar() { + public void testNewOutput_WriteChar() { byte[] bytes = getTestBytes(); int length = bytes.length; int[] bufferSizes = { @@ -634,16 +554,15 @@ public class ByteStringTest { output.write(byteValue); } ByteString byteString = output.toByteString(); - assertWithMessage("String built from newOutput() must contain the expected bytes") - .that(isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)) - .isTrue(); + assertTrue( + "String built from newOutput() must contain the expected bytes", + isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); } } // Test newOutput() in which we write the bytes using a variety of methods // and sizes, and in which we repeatedly call toByteString() in the middle. - @Test - public void testNewOutput_mixed() { + public void testNewOutput_Mixed() { Random rng = new Random(1); byte[] bytes = getTestBytes(); int length = bytes.length; @@ -665,27 +584,25 @@ public class ByteStringTest { output.write(bytes[position]); position++; } - assertWithMessage("size() returns the right value").that(position).isEqualTo(output.size()); - assertWithMessage("newOutput() substring must have correct bytes") - .that(isArrayRange(output.toByteString().toByteArray(), bytes, 0, position)) - .isTrue(); + assertEquals("size() returns the right value", position, output.size()); + assertTrue( + "newOutput() substring must have correct bytes", + isArrayRange(output.toByteString().toByteArray(), bytes, 0, position)); } ByteString byteString = output.toByteString(); - assertWithMessage("String built from newOutput() must contain the expected bytes") - .that(isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)) - .isTrue(); + assertTrue( + "String built from newOutput() must contain the expected bytes", + isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); } } - @Test public void testNewOutputEmpty() { // Make sure newOutput() correctly builds empty byte strings ByteString byteString = ByteString.newOutput().toByteString(); - assertThat(ByteString.EMPTY).isEqualTo(byteString); + assertEquals(ByteString.EMPTY, byteString); } - @Test - public void testNewOutput_mutating() throws IOException { + public void testNewOutput_Mutating() throws IOException { Output os = ByteString.newOutput(5); os.write(new byte[] {1, 2, 3, 4, 5}); EvilOutputStream eos = new EvilOutputStream(); @@ -695,23 +612,21 @@ public class ByteStringTest { byte[] oldValue = byteString.toByteArray(); Arrays.fill(capturedArray, (byte) 0); byte[] newValue = byteString.toByteArray(); - assertWithMessage("Output must not provide access to the underlying byte array") - .that(Arrays.equals(oldValue, newValue)) - .isTrue(); + assertTrue( + "Output must not provide access to the underlying byte array", + Arrays.equals(oldValue, newValue)); } - @Test public void testNewCodedBuilder() throws IOException { byte[] bytes = getTestBytes(); ByteString.CodedBuilder builder = ByteString.newCodedBuilder(bytes.length); builder.getCodedOutput().writeRawBytes(bytes); ByteString byteString = builder.build(); - assertWithMessage("String built from newCodedBuilder() must contain the expected bytes") - .that(isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)) - .isTrue(); + assertTrue( + "String built from newCodedBuilder() must contain the expected bytes", + isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length)); } - @Test public void testSubstringParity() { byte[] bigBytes = getTestBytes(2048 * 1024, 113344L); int start = 512 * 1024 - 3333; @@ -721,18 +636,16 @@ public class ByteStringTest { for (int i = start; ok && i < end; ++i) { ok = (bigBytes[i] == concreteSubstring.byteAt(i - start)); } - assertWithMessage("Concrete substring didn't capture the right bytes").that(ok).isTrue(); + assertTrue("Concrete substring didn't capture the right bytes", ok); ByteString literalString = ByteString.copyFrom(bigBytes, start, end - start); - assertWithMessage("Substring must be equal to literal string") - .that(literalString) - .isEqualTo(concreteSubstring); - assertWithMessage("Substring must have same hashcode as literal string") - .that(literalString.hashCode()) - .isEqualTo(concreteSubstring.hashCode()); + assertEquals("Substring must be equal to literal string", literalString, concreteSubstring); + assertEquals( + "Substring must have same hashcode as literal string", + literalString.hashCode(), + concreteSubstring.hashCode()); } - @Test public void testCompositeSubstring() { byte[] referenceBytes = getTestBytes(77748, 113344L); @@ -747,32 +660,34 @@ public class ByteStringTest { for (int i = 0; stillEqual && i < to - from; ++i) { stillEqual = referenceBytes[from + i] == substringBytes[i]; } - assertWithMessage("Substring must return correct bytes").that(stillEqual).isTrue(); + assertTrue("Substring must return correct bytes", stillEqual); stillEqual = true; for (int i = 0; stillEqual && i < to - from; ++i) { stillEqual = referenceBytes[from + i] == compositeSubstring.byteAt(i); } - assertWithMessage("Substring must support byteAt() correctly").that(stillEqual).isTrue(); + assertTrue("Substring must support byteAt() correctly", stillEqual); ByteString literalSubstring = ByteString.copyFrom(referenceBytes, from, to - from); - assertWithMessage("Composite substring must equal a literal substring over the same bytes") - .that(literalSubstring) - .isEqualTo(compositeSubstring); - assertWithMessage("Literal substring must equal a composite substring over the same bytes") - .that(compositeSubstring) - .isEqualTo(literalSubstring); + assertEquals( + "Composite substring must equal a literal substring over the same bytes", + literalSubstring, + compositeSubstring); + assertEquals( + "Literal substring must equal a composite substring over the same bytes", + compositeSubstring, + literalSubstring); - assertWithMessage("We must get the same hashcodes for composite and literal substrings") - .that(literalSubstring.hashCode()) - .isEqualTo(compositeSubstring.hashCode()); + assertEquals( + "We must get the same hashcodes for composite and literal substrings", + literalSubstring.hashCode(), + compositeSubstring.hashCode()); - assertWithMessage("We can't be equal to a proper substring") - .that(compositeSubstring.equals(literalSubstring.substring(0, literalSubstring.size() - 1))) - .isFalse(); + assertFalse( + "We can't be equal to a proper substring", + compositeSubstring.equals(literalSubstring.substring(0, literalSubstring.size() - 1))); } - @Test public void testCopyFromList() { byte[] referenceBytes = getTestBytes(77748, 113344L); ByteString literalString = ByteString.copyFrom(referenceBytes); @@ -780,15 +695,13 @@ public class ByteStringTest { List pieces = makeConcretePieces(referenceBytes); ByteString listString = ByteString.copyFrom(pieces); - assertWithMessage("Composite string must be equal to literal string") - .that(literalString) - .isEqualTo(listString); - assertWithMessage("Composite string must have same hashcode as literal string") - .that(literalString.hashCode()) - .isEqualTo(listString.hashCode()); + assertEquals("Composite string must be equal to literal string", literalString, listString); + assertEquals( + "Composite string must have same hashcode as literal string", + literalString.hashCode(), + listString.hashCode()); } - @Test public void testConcat() { byte[] referenceBytes = getTestBytes(77748, 113344L); ByteString literalString = ByteString.copyFrom(referenceBytes); @@ -801,19 +714,18 @@ public class ByteStringTest { concatenatedString = concatenatedString.concat(iter.next()); } - assertWithMessage("Concatenated string must be equal to literal string") - .that(literalString) - .isEqualTo(concatenatedString); - assertWithMessage("Concatenated string must have same hashcode as literal string") - .that(literalString.hashCode()) - .isEqualTo(concatenatedString.hashCode()); + assertEquals( + "Concatenated string must be equal to literal string", literalString, concatenatedString); + assertEquals( + "Concatenated string must have same hashcode as literal string", + literalString.hashCode(), + concatenatedString.hashCode()); } /** * Test the Rope implementation can deal with Empty nodes, even though we guard against them. See * also {@link LiteralByteStringTest#testConcat_empty()}. */ - @Test public void testConcat_empty() { byte[] referenceBytes = getTestBytes(7748, 113344L); ByteString literalString = ByteString.copyFrom(referenceBytes); @@ -825,12 +737,11 @@ public class ByteStringTest { RopeByteString.newInstanceForTest(ByteString.EMPTY, literalString)); ByteString quintet = RopeByteString.newInstanceForTest(temp, ByteString.EMPTY); - assertWithMessage("String with concatenated nulls must equal simple concatenate") - .that(quintet) - .isEqualTo(duo); - assertWithMessage("String with concatenated nulls have same hashcode as simple concatenate") - .that(duo.hashCode()) - .isEqualTo(quintet.hashCode()); + assertEquals("String with concatenated nulls must equal simple concatenate", quintet, duo); + assertEquals( + "String with concatenated nulls have same hashcode as simple concatenate", + duo.hashCode(), + quintet.hashCode()); ByteString.ByteIterator duoIter = duo.iterator(); ByteString.ByteIterator quintetIter = quintet.iterator(); @@ -838,17 +749,17 @@ public class ByteStringTest { while (stillEqual && quintetIter.hasNext()) { stillEqual = (duoIter.nextByte() == quintetIter.nextByte()); } - assertWithMessage("We must get the same characters by iterating").that(stillEqual).isTrue(); - assertWithMessage("Iterator must be exhausted").that(duoIter.hasNext()).isFalse(); + assertTrue("We must get the same characters by iterating", stillEqual); + assertFalse("Iterator must be exhausted", duoIter.hasNext()); try { duoIter.nextByte(); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NoSuchElementException e) { // This is success } try { quintetIter.nextByte(); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NoSuchElementException e) { // This is success } @@ -860,47 +771,45 @@ public class ByteStringTest { // It is possible, using the testing factory method to create deeply nested // trees of empty leaves, to make a string that will fail this test. for (int i = 1; i < duo.size(); ++i) { - assertWithMessage("Substrings of size() < 2 must not be RopeByteStrings") - .that(duo.substring(i - 1, i) instanceof ByteString.LeafByteString) - .isTrue(); + assertTrue( + "Substrings of size() < 2 must not be RopeByteStrings", + duo.substring(i - 1, i) instanceof ByteString.LeafByteString); } for (int i = 1; i < quintet.size(); ++i) { - assertWithMessage("Substrings of size() < 2 must not be RopeByteStrings") - .that(quintet.substring(i - 1, i) instanceof ByteString.LeafByteString) - .isTrue(); + assertTrue( + "Substrings of size() < 2 must not be RopeByteStrings", + quintet.substring(i - 1, i) instanceof ByteString.LeafByteString); } } - @Test public void testStartsWith() { byte[] bytes = getTestBytes(1000, 1234L); ByteString string = ByteString.copyFrom(bytes); ByteString prefix = ByteString.copyFrom(bytes, 0, 500); ByteString suffix = ByteString.copyFrom(bytes, 400, 600); - assertThat(string.startsWith(ByteString.EMPTY)).isTrue(); - assertThat(string.startsWith(string)).isTrue(); - assertThat(string.startsWith(prefix)).isTrue(); - assertThat(string.startsWith(suffix)).isFalse(); - assertThat(prefix.startsWith(suffix)).isFalse(); - assertThat(suffix.startsWith(prefix)).isFalse(); - assertThat(ByteString.EMPTY.startsWith(prefix)).isFalse(); - assertThat(ByteString.EMPTY.startsWith(ByteString.EMPTY)).isTrue(); + assertTrue(string.startsWith(ByteString.EMPTY)); + assertTrue(string.startsWith(string)); + assertTrue(string.startsWith(prefix)); + assertFalse(string.startsWith(suffix)); + assertFalse(prefix.startsWith(suffix)); + assertFalse(suffix.startsWith(prefix)); + assertFalse(ByteString.EMPTY.startsWith(prefix)); + assertTrue(ByteString.EMPTY.startsWith(ByteString.EMPTY)); } - @Test public void testEndsWith() { byte[] bytes = getTestBytes(1000, 1234L); ByteString string = ByteString.copyFrom(bytes); ByteString prefix = ByteString.copyFrom(bytes, 0, 500); ByteString suffix = ByteString.copyFrom(bytes, 400, 600); - assertThat(string.endsWith(ByteString.EMPTY)).isTrue(); - assertThat(string.endsWith(string)).isTrue(); - assertThat(string.endsWith(suffix)).isTrue(); - assertThat(string.endsWith(prefix)).isFalse(); - assertThat(suffix.endsWith(prefix)).isFalse(); - assertThat(prefix.endsWith(suffix)).isFalse(); - assertThat(ByteString.EMPTY.endsWith(suffix)).isFalse(); - assertThat(ByteString.EMPTY.endsWith(ByteString.EMPTY)).isTrue(); + assertTrue(string.endsWith(ByteString.EMPTY)); + assertTrue(string.endsWith(string)); + assertTrue(string.endsWith(suffix)); + assertFalse(string.endsWith(prefix)); + assertFalse(suffix.endsWith(prefix)); + assertFalse(prefix.endsWith(suffix)); + assertFalse(ByteString.EMPTY.endsWith(suffix)); + assertTrue(ByteString.EMPTY.endsWith(ByteString.EMPTY)); } static List makeConcretePieces(byte[] referenceBytes) { @@ -923,7 +832,6 @@ public class ByteStringTest { return output.toByteArray(); } - @Test public void testWriteToOutputStream() throws Exception { // Choose a size large enough so when two ByteStrings are concatenated they // won't be merged into one byte array due to some optimizations. @@ -934,8 +842,8 @@ public class ByteStringTest { // Test LiteralByteString.writeTo(OutputStream,int,int) ByteString left = ByteString.wrap(data1); byte[] result = substringUsingWriteTo(left, 1, 1); - assertThat(result).hasLength(1); - assertThat(result[0]).isEqualTo((byte) 11); + assertEquals(1, result.length); + assertEquals((byte) 11, result[0]); byte[] data2 = new byte[dataSize]; Arrays.fill(data2, 0, data1.length, (byte) 2); @@ -944,28 +852,27 @@ public class ByteStringTest { ByteString root = left.concat(right); // Make sure we are actually testing a RopeByteString with a simple tree // structure. - assertThat(root.getTreeDepth()).isEqualTo(1); + assertEquals(1, root.getTreeDepth()); // Write parts of the left node. result = substringUsingWriteTo(root, 0, dataSize); - assertThat(result).hasLength(dataSize); - assertThat(result[0]).isEqualTo((byte) 1); - assertThat(result[dataSize - 1]).isEqualTo((byte) 1); + assertEquals(dataSize, result.length); + assertEquals((byte) 1, result[0]); + assertEquals((byte) 1, result[dataSize - 1]); // Write parts of the right node. result = substringUsingWriteTo(root, dataSize, dataSize); - assertThat(result).hasLength(dataSize); - assertThat(result[0]).isEqualTo((byte) 2); - assertThat(result[dataSize - 1]).isEqualTo((byte) 2); + assertEquals(dataSize, result.length); + assertEquals((byte) 2, result[0]); + assertEquals((byte) 2, result[dataSize - 1]); // Write a segment of bytes that runs across both nodes. result = substringUsingWriteTo(root, dataSize / 2, dataSize); - assertThat(result).hasLength(dataSize); - assertThat(result[0]).isEqualTo((byte) 1); - assertThat(result[dataSize - dataSize / 2 - 1]).isEqualTo((byte) 1); - assertThat(result[dataSize - dataSize / 2]).isEqualTo((byte) 2); - assertThat(result[dataSize - 1]).isEqualTo((byte) 2); + assertEquals(dataSize, result.length); + assertEquals((byte) 1, result[0]); + assertEquals((byte) 1, result[dataSize - dataSize / 2 - 1]); + assertEquals((byte) 2, result[dataSize - dataSize / 2]); + assertEquals((byte) 2, result[dataSize - 1]); } /** Tests ByteString uses Arrays based byte copier when running under Hotstop VM. */ - @Test public void testByteArrayCopier() throws Exception { if (Android.isOnAndroidDevice()) { return; @@ -973,9 +880,9 @@ public class ByteStringTest { Field field = ByteString.class.getDeclaredField("byteArrayCopier"); field.setAccessible(true); Object byteArrayCopier = field.get(null); - assertThat(byteArrayCopier).isNotNull(); - assertWithMessage(byteArrayCopier.toString()) - .that(byteArrayCopier.getClass().getSimpleName().endsWith("ArraysByteArrayCopier")) - .isTrue(); + assertNotNull(byteArrayCopier); + assertTrue( + byteArrayCopier.toString(), + byteArrayCopier.getClass().getSimpleName().endsWith("ArraysByteArrayCopier")); } } diff --git a/java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java b/java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java index a4e5e2ad7a07a850f6e1a6c93923d1e74b3fe2dd..96319d93c597f2ad61ad7e2c7931dc6749320d2f 100644 --- a/java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java +++ b/java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java @@ -1,13 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; import protobuf_unittest.UnittestProto.TestPackedTypes; import proto3_unittest.UnittestProto3; @@ -29,14 +52,14 @@ public final class CachedFieldSizeTest { // Serialize once to cache all field sizes. This will use the experimental runtime because // the proto has optimize_for = CODE_SIZE. - byte[] unused = message.toByteArray(); + message.toByteArray(); // Serialize individual submessages. This will use the generated implementation. If the // experimental runtime hasn't set the correct cached size, this will throw an exception. byte[] data2 = message.getProto2Child().toByteArray(); byte[] data3 = message.getProto3Child().toByteArray(); // Make sure the serialized data is correct. - assertThat(TestPackedTypes.parseFrom(data2)).isEqualTo(message.getProto2Child()); - assertThat(UnittestProto3.TestPackedTypes.parseFrom(data3)).isEqualTo(message.getProto3Child()); + assertEquals(message.getProto2Child(), TestPackedTypes.parseFrom(data2)); + assertEquals(message.getProto3Child(), UnittestProto3.TestPackedTypes.parseFrom(data3)); } } diff --git a/java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java b/java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java index 9a588213e9c3ab5f9b5df3f096c2e5693552087d..e276225e7ad996b4a00c797499227812721b899f 100644 --- a/java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java +++ b/java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java @@ -1,117 +1,126 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import proto2_test_check_utf8.TestCheckUtf8.BytesWrapper; import proto2_test_check_utf8.TestCheckUtf8.StringWrapper; import proto2_test_check_utf8_size.TestCheckUtf8Size.BytesWrapperSize; import proto2_test_check_utf8_size.TestCheckUtf8Size.StringWrapperSize; import java.io.ByteArrayInputStream; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Test that protos generated with file option java_string_check_utf8 do in fact perform appropriate * UTF-8 checks. + * + * @author jbaum@google.com (Jacob Butcher) */ -@RunWith(JUnit4.class) -public class CheckUtf8Test { +public class CheckUtf8Test extends TestCase { - private static final String UTF8_BYTE_STRING_TEXT = "some text π \uD83D\uDE00"; + private static final String UTF8_BYTE_STRING_TEXT = "some text"; private static final ByteString UTF8_BYTE_STRING = ByteString.copyFromUtf8(UTF8_BYTE_STRING_TEXT); private static final ByteString NON_UTF8_BYTE_STRING = ByteString.copyFrom(new byte[] {(byte) 0x80}); // A lone continuation byte. - @Test public void testBuildRequiredStringWithGoodUtf8() throws Exception { - assertThat(StringWrapper.newBuilder().setReqBytes(UTF8_BYTE_STRING).getReq()) - .isEqualTo(UTF8_BYTE_STRING_TEXT); + assertEquals( + UTF8_BYTE_STRING_TEXT, StringWrapper.newBuilder().setReqBytes(UTF8_BYTE_STRING).getReq()); } - @Test public void testParseRequiredStringWithGoodUtf8() throws Exception { ByteString serialized = BytesWrapper.newBuilder().setReq(UTF8_BYTE_STRING).build().toByteString(); - assertThat(StringWrapper.parseFrom(serialized).getReq()).isEqualTo(UTF8_BYTE_STRING_TEXT); + assertEquals(UTF8_BYTE_STRING_TEXT, StringWrapper.parser().parseFrom(serialized).getReq()); } - @Test public void testBuildRequiredStringWithBadUtf8() throws Exception { try { StringWrapper.newBuilder().setReqBytes(NON_UTF8_BYTE_STRING); - assertWithMessage("Expected IllegalArgumentException for non UTF-8 byte string.").fail(); + fail("Expected IllegalArgumentException for non UTF-8 byte string."); } catch (IllegalArgumentException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Byte string is not UTF-8."); + assertEquals("Byte string is not UTF-8.", exception.getMessage()); } } - @Test public void testBuildOptionalStringWithBadUtf8() throws Exception { try { StringWrapper.newBuilder().setOptBytes(NON_UTF8_BYTE_STRING); - assertWithMessage("Expected IllegalArgumentException for non UTF-8 byte string.").fail(); + fail("Expected IllegalArgumentException for non UTF-8 byte string."); } catch (IllegalArgumentException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Byte string is not UTF-8."); + assertEquals("Byte string is not UTF-8.", exception.getMessage()); } } - @Test public void testBuildRepeatedStringWithBadUtf8() throws Exception { try { StringWrapper.newBuilder().addRepBytes(NON_UTF8_BYTE_STRING); - assertWithMessage("Expected IllegalArgumentException for non UTF-8 byte string.").fail(); + fail("Expected IllegalArgumentException for non UTF-8 byte string."); } catch (IllegalArgumentException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Byte string is not UTF-8."); + assertEquals("Byte string is not UTF-8.", exception.getMessage()); } } - @Test public void testParseRequiredStringWithBadUtf8() throws Exception { byte[] serialized = BytesWrapper.newBuilder().setReq(NON_UTF8_BYTE_STRING).build().toByteArray(); assertParseBadUtf8(StringWrapper.getDefaultInstance(), serialized); } - @Test public void testBuildRequiredStringWithBadUtf8Size() throws Exception { try { StringWrapperSize.newBuilder().setReqBytes(NON_UTF8_BYTE_STRING); - assertWithMessage("Expected IllegalArgumentException for non UTF-8 byte string.").fail(); + fail("Expected IllegalArgumentException for non UTF-8 byte string."); } catch (IllegalArgumentException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Byte string is not UTF-8."); + assertEquals("Byte string is not UTF-8.", exception.getMessage()); } } - @Test public void testBuildOptionalStringWithBadUtf8Size() throws Exception { try { StringWrapperSize.newBuilder().setOptBytes(NON_UTF8_BYTE_STRING); - assertWithMessage("Expected IllegalArgumentException for non UTF-8 byte string.").fail(); + fail("Expected IllegalArgumentException for non UTF-8 byte string."); } catch (IllegalArgumentException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Byte string is not UTF-8."); + assertEquals("Byte string is not UTF-8.", exception.getMessage()); } } - @Test public void testBuildRepeatedStringWithBadUtf8Size() throws Exception { try { StringWrapperSize.newBuilder().addRepBytes(NON_UTF8_BYTE_STRING); - assertWithMessage("Expected IllegalArgumentException for non UTF-8 byte string.").fail(); + fail("Expected IllegalArgumentException for non UTF-8 byte string."); } catch (IllegalArgumentException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Byte string is not UTF-8."); + assertEquals("Byte string is not UTF-8.", exception.getMessage()); } } - @Test public void testParseRequiredStringWithBadUtf8Size() throws Exception { byte[] serialized = BytesWrapperSize.newBuilder().setReq(NON_UTF8_BYTE_STRING).build().toByteArray(); @@ -122,31 +131,27 @@ public class CheckUtf8Test { // Check combinations of (parser vs. builder) x (byte[] vs. InputStream) try { defaultInstance.getParserForType().parseFrom(data); - assertWithMessage("Expected InvalidProtocolBufferException for non UTF-8 byte string.") - .fail(); + fail("Expected InvalidProtocolBufferException for non UTF-8 byte string."); } catch (InvalidProtocolBufferException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Protocol message had invalid UTF-8."); + assertEquals("Protocol message had invalid UTF-8.", exception.getMessage()); } try { defaultInstance.newBuilderForType().mergeFrom(data); - assertWithMessage("Expected InvalidProtocolBufferException for non UTF-8 byte string.") - .fail(); + fail("Expected InvalidProtocolBufferException for non UTF-8 byte string."); } catch (InvalidProtocolBufferException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Protocol message had invalid UTF-8."); + assertEquals("Protocol message had invalid UTF-8.", exception.getMessage()); } try { defaultInstance.getParserForType().parseFrom(new ByteArrayInputStream(data)); - assertWithMessage("Expected InvalidProtocolBufferException for non UTF-8 byte string.") - .fail(); + fail("Expected InvalidProtocolBufferException for non UTF-8 byte string."); } catch (InvalidProtocolBufferException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Protocol message had invalid UTF-8."); + assertEquals("Protocol message had invalid UTF-8.", exception.getMessage()); } try { defaultInstance.newBuilderForType().mergeFrom(new ByteArrayInputStream(data)); - assertWithMessage("Expected InvalidProtocolBufferException for non UTF-8 byte string.") - .fail(); + fail("Expected InvalidProtocolBufferException for non UTF-8 byte string."); } catch (InvalidProtocolBufferException exception) { - assertThat(exception).hasMessageThat().isEqualTo("Protocol message had invalid UTF-8."); + assertEquals("Protocol message had invalid UTF-8.", exception.getMessage()); } } } diff --git a/java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java b/java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java index 192f20e8adfa7355bcc9a3d61c1a0adba3ef994a..a24b48b51e22a2878db9fcc843c49274d63bc2ab 100644 --- a/java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java +++ b/java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java @@ -1,13 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; import com.google.protobuf.testing.Proto2Testing.Proto2Message; import com.google.protobuf.testing.Proto3Testing.Proto3Message; @@ -34,14 +57,14 @@ public final class CodedAdapterTest { // Deserialize with BinaryReader and verify that the message matches the original. Proto3Message result = fromByteArray(expectedBytes, Proto3Message.class); - assertThat(result).isEqualTo(expected); + assertEquals(expected, result); // Now write it back out using BinaryWriter and verify the output length. byte[] actualBytes = toByteArray(result, expectedBytes.length); // Read back in the bytes and verify that it matches the original message. Proto3Message actual = Proto3Message.parseFrom(actualBytes); - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } @Test @@ -51,14 +74,14 @@ public final class CodedAdapterTest { // Deserialize with BinaryReader and verify that the message matches the original. Proto2Message result = fromByteArray(expectedBytes, Proto2Message.class); - assertThat(result).isEqualTo(expected); + assertEquals(expected, result); // Now write it back out using BinaryWriter and verify the output length. byte[] actualBytes = toByteArray(result, expectedBytes.length); // Read back in the bytes and verify that it matches the original message. Proto2Message actual = Proto2Message.parseFrom(actualBytes); - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } public static byte[] toByteArray(T msg, int size) throws Exception { @@ -67,7 +90,7 @@ public final class CodedAdapterTest { CodedOutputStreamWriter writer = CodedOutputStreamWriter.forCodedOutput(CodedOutputStream.newInstance(out)); schema.writeTo(msg, writer); - assertThat(writer.getTotalBytesWritten()).isEqualTo(out.length); + assertEquals(out.length, writer.getTotalBytesWritten()); return out; } diff --git a/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java b/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java index 2de3273e34cb67fde44f71ea967ced06d56f58a6..532052cdb35a4853a12cde8322a60e358808a085 100644 --- a/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java +++ b/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static org.junit.Assert.assertArrayEquals; import protobuf_unittest.UnittestProto.BoolMessage; import protobuf_unittest.UnittestProto.Int32Message; @@ -24,13 +45,14 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Unit test for {@link CodedInputStream}. */ -@RunWith(JUnit4.class) -public class CodedInputStreamTest { +/** + * Unit test for {@link CodedInputStream}. + * + * @author kenton@google.com Kenton Varda + */ +public class CodedInputStreamTest extends TestCase { private static final int DEFAULT_BLOCK_SIZE = 4096; @@ -157,8 +179,8 @@ public class CodedInputStreamTest { private void assertDataConsumed(String msg, byte[] data, CodedInputStream input) throws IOException { - assertWithMessage(msg).that(data).hasLength(input.getTotalBytesRead()); - assertWithMessage(msg).that(input.isAtEnd()).isTrue(); + assertEquals(msg, data.length, input.getTotalBytesRead()); + assertTrue(msg, input.isAtEnd()); } /** @@ -170,21 +192,19 @@ public class CodedInputStreamTest { // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { CodedInputStream input = inputType.newDecoder(data, blockSize); - assertWithMessage(inputType.name()).that(input.readRawVarint32()).isEqualTo((int) value); + assertEquals(inputType.name(), (int) value, input.readRawVarint32()); assertDataConsumed(inputType.name(), data, input); input = inputType.newDecoder(data, blockSize); - assertWithMessage(inputType.name()).that(input.readRawVarint64()).isEqualTo(value); + assertEquals(inputType.name(), value, input.readRawVarint64()); assertDataConsumed(inputType.name(), data, input); input = inputType.newDecoder(data, blockSize); - assertWithMessage(inputType.name()).that(input.readRawVarint64SlowPath()).isEqualTo(value); + assertEquals(inputType.name(), value, input.readRawVarint64SlowPath()); assertDataConsumed(inputType.name(), data, input); input = inputType.newDecoder(data, blockSize); - assertWithMessage(inputType.name()) - .that(input.skipField(WireFormat.WIRETYPE_VARINT)) - .isTrue(); + assertTrue(inputType.name(), input.skipField(WireFormat.WIRETYPE_VARINT)); assertDataConsumed(inputType.name(), data, input); } } @@ -195,8 +215,8 @@ public class CodedInputStreamTest { byte[] longerData = new byte[data.length + 1]; System.arraycopy(data, 0, longerData, 0, data.length); InputStream rawInput = new ByteArrayInputStream(longerData); - assertThat(CodedInputStream.readRawVarint32(rawInput)).isEqualTo((int) value); - assertThat(rawInput.available()).isEqualTo(1); + assertEquals((int) value, CodedInputStream.readRawVarint32(rawInput)); + assertEquals(1, rawInput.available()); } /** @@ -209,36 +229,29 @@ public class CodedInputStreamTest { try { CodedInputStream input = inputType.newDecoder(data); input.readRawVarint32(); - assertWithMessage("%s: Should have thrown an exception.", inputType.name()).fail(); + fail(inputType.name() + ": Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { - assertWithMessage(inputType.name()) - .that(e) - .hasMessageThat() - .isEqualTo(expected.getMessage()); + assertEquals(inputType.name(), expected.getMessage(), e.getMessage()); } try { CodedInputStream input = inputType.newDecoder(data); input.readRawVarint64(); - assertWithMessage("%s: Should have thrown an exception.", inputType.name()).fail(); + fail(inputType.name() + ": Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { - assertWithMessage(inputType.name()) - .that(e) - .hasMessageThat() - .isEqualTo(expected.getMessage()); + assertEquals(inputType.name(), expected.getMessage(), e.getMessage()); } } // Make sure we get the same error when reading direct from an InputStream. try { CodedInputStream.readRawVarint32(new ByteArrayInputStream(data)); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { - assertThat(e).hasMessageThat().isEqualTo(expected.getMessage()); + assertEquals(expected.getMessage(), e.getMessage()); } } /** Tests readRawVarint32() and readRawVarint64(). */ - @Test public void testReadVarint() throws Exception { assertReadVarint(bytes(0x00), 0); assertReadVarint(bytes(0x01), 1); @@ -296,8 +309,8 @@ public class CodedInputStreamTest { // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { CodedInputStream input = inputType.newDecoder(data, blockSize); - assertWithMessage(inputType.name()).that(input.readRawLittleEndian32()).isEqualTo(value); - assertWithMessage(inputType.name()).that(input.isAtEnd()).isTrue(); + assertEquals(inputType.name(), value, input.readRawLittleEndian32()); + assertTrue(inputType.name(), input.isAtEnd()); } } } @@ -311,14 +324,13 @@ public class CodedInputStreamTest { // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { CodedInputStream input = inputType.newDecoder(data, blockSize); - assertWithMessage(inputType.name()).that(input.readRawLittleEndian64()).isEqualTo(value); - assertWithMessage(inputType.name()).that(input.isAtEnd()).isTrue(); + assertEquals(inputType.name(), value, input.readRawLittleEndian64()); + assertTrue(inputType.name(), input.isAtEnd()); } } } /** Tests readRawLittleEndian32() and readRawLittleEndian64(). */ - @Test public void testReadLittleEndian() throws Exception { assertReadLittleEndian32(bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); assertReadLittleEndian32(bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); @@ -330,36 +342,34 @@ public class CodedInputStreamTest { } /** Test decodeZigZag32() and decodeZigZag64(). */ - @Test public void testDecodeZigZag() throws Exception { - assertThat(CodedInputStream.decodeZigZag32(0)).isEqualTo(0); - assertThat(CodedInputStream.decodeZigZag32(1)).isEqualTo(-1); - assertThat(CodedInputStream.decodeZigZag32(2)).isEqualTo(1); - assertThat(CodedInputStream.decodeZigZag32(3)).isEqualTo(-2); - assertThat(CodedInputStream.decodeZigZag32(0x7FFFFFFE)).isEqualTo(0x3FFFFFFF); - assertThat(CodedInputStream.decodeZigZag32(0x7FFFFFFF)).isEqualTo(0xC0000000); - assertThat(CodedInputStream.decodeZigZag32(0xFFFFFFFE)).isEqualTo(0x7FFFFFFF); - assertThat(CodedInputStream.decodeZigZag32(0xFFFFFFFF)).isEqualTo(0x80000000); - - assertThat(CodedInputStream.decodeZigZag64(0)).isEqualTo(0); - assertThat(CodedInputStream.decodeZigZag64(1)).isEqualTo(-1); - assertThat(CodedInputStream.decodeZigZag64(2)).isEqualTo(1); - assertThat(CodedInputStream.decodeZigZag64(3)).isEqualTo(-2); - assertThat(CodedInputStream.decodeZigZag64(0x000000007FFFFFFEL)).isEqualTo(0x000000003FFFFFFFL); - assertThat(CodedInputStream.decodeZigZag64(0x000000007FFFFFFFL)).isEqualTo(0xFFFFFFFFC0000000L); - assertThat(CodedInputStream.decodeZigZag64(0x00000000FFFFFFFEL)).isEqualTo(0x000000007FFFFFFFL); - assertThat(CodedInputStream.decodeZigZag64(0x00000000FFFFFFFFL)).isEqualTo(0xFFFFFFFF80000000L); - assertThat(CodedInputStream.decodeZigZag64(0xFFFFFFFFFFFFFFFEL)).isEqualTo(0x7FFFFFFFFFFFFFFFL); - assertThat(CodedInputStream.decodeZigZag64(0xFFFFFFFFFFFFFFFFL)).isEqualTo(0x8000000000000000L); + assertEquals(0, CodedInputStream.decodeZigZag32(0)); + assertEquals(-1, CodedInputStream.decodeZigZag32(1)); + assertEquals(1, CodedInputStream.decodeZigZag32(2)); + assertEquals(-2, CodedInputStream.decodeZigZag32(3)); + assertEquals(0x3FFFFFFF, CodedInputStream.decodeZigZag32(0x7FFFFFFE)); + assertEquals(0xC0000000, CodedInputStream.decodeZigZag32(0x7FFFFFFF)); + assertEquals(0x7FFFFFFF, CodedInputStream.decodeZigZag32(0xFFFFFFFE)); + assertEquals(0x80000000, CodedInputStream.decodeZigZag32(0xFFFFFFFF)); + + assertEquals(0, CodedInputStream.decodeZigZag64(0)); + assertEquals(-1, CodedInputStream.decodeZigZag64(1)); + assertEquals(1, CodedInputStream.decodeZigZag64(2)); + assertEquals(-2, CodedInputStream.decodeZigZag64(3)); + assertEquals(0x000000003FFFFFFFL, CodedInputStream.decodeZigZag64(0x000000007FFFFFFEL)); + assertEquals(0xFFFFFFFFC0000000L, CodedInputStream.decodeZigZag64(0x000000007FFFFFFFL)); + assertEquals(0x000000007FFFFFFFL, CodedInputStream.decodeZigZag64(0x00000000FFFFFFFEL)); + assertEquals(0xFFFFFFFF80000000L, CodedInputStream.decodeZigZag64(0x00000000FFFFFFFFL)); + assertEquals(0x7FFFFFFFFFFFFFFFL, CodedInputStream.decodeZigZag64(0xFFFFFFFFFFFFFFFEL)); + assertEquals(0x8000000000000000L, CodedInputStream.decodeZigZag64(0xFFFFFFFFFFFFFFFFL)); } /** Tests reading and parsing a whole message with every field type. */ - @Test public void testReadWholeMessage() throws Exception { TestAllTypes message = TestUtil.getAllSet(); byte[] rawBytes = message.toByteArray(); - assertThat(rawBytes).hasLength(message.getSerializedSize()); + assertEquals(rawBytes.length, message.getSerializedSize()); for (InputType inputType : InputType.values()) { // Try different block sizes. @@ -371,7 +381,6 @@ public class CodedInputStreamTest { } /** Tests skipField(). */ - @Test public void testSkipWholeMessage() throws Exception { TestAllTypes message = TestUtil.getAllSet(); byte[] rawBytes = message.toByteArray(); @@ -388,7 +397,7 @@ public class CodedInputStreamTest { int tag = input1.readTag(); // Ensure that the rest match. for (int i = 1; i < inputs.length; ++i) { - assertWithMessage(inputTypes[i].name()).that(inputs[i].readTag()).isEqualTo(tag); + assertEquals(inputTypes[i].name(), tag, inputs[i].readTag()); } if (tag == 0) { break; @@ -401,11 +410,11 @@ public class CodedInputStreamTest { } } + /** * Test that a bug in skipRawBytes() has been fixed: if the skip skips exactly up to a limit, this * should not break things. */ - @Test public void testSkipRawBytesBug() throws Exception { byte[] rawBytes = new byte[] {1, 2}; for (InputType inputType : InputType.values()) { @@ -413,7 +422,7 @@ public class CodedInputStreamTest { int limit = input.pushLimit(1); input.skipRawBytes(1); input.popLimit(limit); - assertWithMessage(inputType.name()).that(input.readRawByte()).isEqualTo(2); + assertEquals(inputType.name(), 2, input.readRawByte()); } } @@ -421,7 +430,6 @@ public class CodedInputStreamTest { * Test that a bug in skipRawBytes() has been fixed: if the skip skips past the end of a buffer * with a limit that has been set past the end of that buffer, this should not break things. */ - @Test public void testSkipRawBytesPastEndOfBufferWithLimit() throws Exception { byte[] rawBytes = new byte[] {1, 2, 3, 4, 5}; for (InputType inputType : InputType.values()) { @@ -429,12 +437,12 @@ public class CodedInputStreamTest { int limit = input.pushLimit(4); // In order to expose the bug we need to read at least one byte to prime the // buffer inside the CodedInputStream. - assertWithMessage(inputType.name()).that(input.readRawByte()).isEqualTo(1); + assertEquals(inputType.name(), 1, input.readRawByte()); // Skip to the end of the limit. input.skipRawBytes(3); - assertWithMessage(inputType.name()).that(input.isAtEnd()).isTrue(); + assertTrue(inputType.name(), input.isAtEnd()); input.popLimit(limit); - assertWithMessage(inputType.name()).that(input.readRawByte()).isEqualTo(5); + assertEquals(inputType.name(), 5, input.readRawByte()); } } @@ -442,17 +450,15 @@ public class CodedInputStreamTest { * Test that calling skipRawBytes (when not merging a message) actually skips from the underlying * inputstream, regardless of the buffer size used. */ - @Test public void testSkipRawBytesActuallySkips() throws Exception { SmallBlockInputStream bytes = new SmallBlockInputStream(new byte[] {1, 2, 3, 4, 5}, 3); CodedInputStream input = CodedInputStream.newInstance(bytes, 1); // Tiny buffer input.skipRawBytes(3); input.skipRawBytes(2); - assertThat(bytes.skipCalls).isEqualTo(2); - assertThat(bytes.readCalls).isEqualTo(0); + assertEquals(2, bytes.skipCalls); + assertEquals(0, bytes.readCalls); } - @Test public void testSkipHugeBlob() throws Exception { // Allocate and initialize a 1MB blob. int blobSize = 1 << 20; @@ -470,13 +476,11 @@ public class CodedInputStreamTest { } /** Skipping a huge blob should not allocate excessive memory, so there should be no limit */ - @Test public void testSkipMaliciouslyHugeBlob() throws Exception { InputStream is = new RepeatingInputStream(new byte[]{1}, Integer.MAX_VALUE); CodedInputStream.newInstance(is).skipRawBytes(Integer.MAX_VALUE); } - @Test public void testReadHugeBlob() throws Exception { // Allocate and initialize a 1MB blob. byte[] blob = new byte[1 << 20]; @@ -497,9 +501,7 @@ public class CodedInputStreamTest { // reading. TestAllTypes message2 = TestAllTypes.parseFrom(inputType.newDecoder(data)); - assertWithMessage(inputType.name()) - .that(message.getOptionalBytes()) - .isEqualTo(message2.getOptionalBytes()); + assertEquals(inputType.name(), message.getOptionalBytes(), message2.getOptionalBytes()); // Make sure all the other fields were parsed correctly. TestAllTypes message3 = @@ -510,24 +512,23 @@ public class CodedInputStreamTest { } } - @Test public void testReadMaliciouslyLargeBlob() throws Exception { ByteString.Output rawOutput = ByteString.newOutput(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(0x7FFFFFFF); + output.writeRawVarint32(tag); + output.writeRawVarint32(0x7FFFFFFF); output.writeRawBytes(new byte[32]); // Pad with a few random bytes. output.flush(); byte[] data = rawOutput.toByteString().toByteArray(); for (InputType inputType : InputType.values()) { CodedInputStream input = inputType.newDecoder(data); - assertThat(input.readTag()).isEqualTo(tag); + assertEquals(tag, input.readTag()); try { input.readBytes(); - assertWithMessage("%s: Should have thrown an exception!", inputType.name()).fail(); + fail(inputType.name() + ": Should have thrown an exception!"); } catch (InvalidProtocolBufferException e) { // success. } @@ -540,7 +541,6 @@ public class CodedInputStreamTest { * * @throws IOException */ - @Test public void testParseMessagesCloseTo2G() throws IOException { byte[] serializedMessage = getBigSerializedMessage(); // How many of these big messages do we need to take us near our 2G limit? @@ -549,7 +549,7 @@ public class CodedInputStreamTest { // returning our big serialized message 'count' times. InputStream is = new RepeatingInputStream(serializedMessage, count); // Parse should succeed! - TestAllTypes unused = TestAllTypes.parseFrom(is); + TestAllTypes.parseFrom(is); } /** @@ -558,7 +558,6 @@ public class CodedInputStreamTest { * * @throws IOException */ - @Test public void testParseMessagesOver2G() throws IOException { byte[] serializedMessage = getBigSerializedMessage(); // How many of these big messages do we need to take us near our 2G limit? @@ -570,9 +569,9 @@ public class CodedInputStreamTest { InputStream is = new RepeatingInputStream(serializedMessage, count); try { TestAllTypes.parseFrom(is); - assertWithMessage("Should have thrown an exception!").fail(); + fail("Should have thrown an exception!"); } catch (InvalidProtocolBufferException e) { - assertThat(e).hasMessageThat().contains("too large"); + assertTrue(e.getMessage().contains("too large")); } } @@ -624,15 +623,14 @@ public class CodedInputStreamTest { private void assertMessageDepth(String msg, TestRecursiveMessage message, int depth) { if (depth == 0) { - assertWithMessage(msg).that(message.hasA()).isFalse(); - assertWithMessage(msg).that(message.getI()).isEqualTo(5); + assertFalse(msg, message.hasA()); + assertEquals(msg, 5, message.getI()); } else { - assertWithMessage(msg).that(message.hasA()).isTrue(); + assertTrue(msg, message.hasA()); assertMessageDepth(msg, message.getA(), depth - 1); } } - @Test public void testMaliciousRecursion() throws Exception { byte[] data100 = makeRecursiveMessage(100).toByteArray(); byte[] data101 = makeRecursiveMessage(101).toByteArray(); @@ -643,7 +641,7 @@ public class CodedInputStreamTest { try { TestRecursiveMessage.parseFrom(inputType.newDecoder(data101)); - assertWithMessage("Should have thrown an exception!").fail(); + fail("Should have thrown an exception!"); } catch (InvalidProtocolBufferException e) { // success. } @@ -652,7 +650,7 @@ public class CodedInputStreamTest { input.setRecursionLimit(8); try { TestRecursiveMessage.parseFrom(input); - assertWithMessage("%s: Should have thrown an exception!", inputType.name()).fail(); + fail(inputType.name() + ": Should have thrown an exception!"); } catch (InvalidProtocolBufferException e) { // success. } @@ -660,12 +658,9 @@ public class CodedInputStreamTest { } private void checkSizeLimitExceeded(InvalidProtocolBufferException e) { - assertThat(e) - .hasMessageThat() - .isEqualTo(InvalidProtocolBufferException.sizeLimitExceeded().getMessage()); + assertEquals(InvalidProtocolBufferException.sizeLimitExceeded().getMessage(), e.getMessage()); } - @Test public void testSizeLimit() throws Exception { // NOTE: Size limit only applies to the stream-backed CIS. CodedInputStream input = @@ -675,46 +670,44 @@ public class CodedInputStreamTest { try { TestAllTypes.parseFrom(input); - assertWithMessage("Should have thrown an exception!").fail(); + fail("Should have thrown an exception!"); } catch (InvalidProtocolBufferException expected) { checkSizeLimitExceeded(expected); } } - @Test public void testResetSizeCounter() throws Exception { // NOTE: Size limit only applies to the stream-backed CIS. CodedInputStream input = CodedInputStream.newInstance(new SmallBlockInputStream(new byte[256], 8)); input.setSizeLimit(16); input.readRawBytes(16); - assertThat(input.getTotalBytesRead()).isEqualTo(16); + assertEquals(16, input.getTotalBytesRead()); try { input.readRawByte(); - assertWithMessage("Should have thrown an exception!").fail(); + fail("Should have thrown an exception!"); } catch (InvalidProtocolBufferException expected) { checkSizeLimitExceeded(expected); } input.resetSizeCounter(); - assertThat(input.getTotalBytesRead()).isEqualTo(0); + assertEquals(0, input.getTotalBytesRead()); input.readRawByte(); // No exception thrown. input.resetSizeCounter(); - assertThat(input.getTotalBytesRead()).isEqualTo(0); + assertEquals(0, input.getTotalBytesRead()); input.readRawBytes(16); - assertThat(input.getTotalBytesRead()).isEqualTo(16); + assertEquals(16, input.getTotalBytesRead()); input.resetSizeCounter(); try { input.readRawBytes(17); // Hits limit again. - assertWithMessage("Should have thrown an exception!").fail(); + fail("Should have thrown an exception!"); } catch (InvalidProtocolBufferException expected) { checkSizeLimitExceeded(expected); } } - @Test public void testRefillBufferWithCorrectSize() throws Exception { // NOTE: refillBuffer only applies to the stream-backed CIS. byte[] bytes = "123456789".getBytes("UTF-8"); @@ -722,11 +715,11 @@ public class CodedInputStreamTest { CodedOutputStream output = CodedOutputStream.newInstance(rawOutput, bytes.length); int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(bytes.length); + output.writeRawVarint32(tag); + output.writeRawVarint32(bytes.length); output.writeRawBytes(bytes); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(bytes.length); + output.writeRawVarint32(tag); + output.writeRawVarint32(bytes.length); output.writeRawBytes(bytes); output.writeRawByte(4); output.flush(); @@ -743,36 +736,34 @@ public class CodedInputStreamTest { input.readString(); try { input.readRawByte(); // Hits limit. - assertWithMessage("Should have thrown an exception!").fail(); + fail("Should have thrown an exception!"); } catch (InvalidProtocolBufferException expected) { checkSizeLimitExceeded(expected); } } } - @Test public void testIsAtEnd() throws Exception { CodedInputStream input = CodedInputStream.newInstance(new ByteArrayInputStream(new byte[5])); try { for (int i = 0; i < 5; i++) { - assertThat(input.isAtEnd()).isFalse(); + assertEquals(false, input.isAtEnd()); input.readRawByte(); } - assertThat(input.isAtEnd()).isTrue(); + assertEquals(true, input.isAtEnd()); } catch (Exception e) { throw new AssertionError("Catch exception in the testIsAtEnd", e); } } - @Test public void testCurrentLimitExceeded() throws Exception { byte[] bytes = "123456789".getBytes("UTF-8"); ByteArrayOutputStream rawOutput = new ByteArrayOutputStream(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput, bytes.length); int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(bytes.length); + output.writeRawVarint32(tag); + output.writeRawVarint32(bytes.length); output.writeRawBytes(bytes); output.flush(); @@ -785,15 +776,13 @@ public class CodedInputStreamTest { input.pushLimit(5); try { input.readString(); - assertWithMessage("Should have thrown an exception").fail(); + fail("Should have thrown an exception"); } catch (InvalidProtocolBufferException expected) { - assertThat(expected) - .hasMessageThat() - .isEqualTo(InvalidProtocolBufferException.truncatedMessage().getMessage()); + assertEquals( + expected.getMessage(), InvalidProtocolBufferException.truncatedMessage().getMessage()); } } - @Test public void testSizeLimitMultipleMessages() throws Exception { // NOTE: Size limit only applies to the stream-backed CIS. byte[] bytes = new byte[256]; @@ -805,15 +794,14 @@ public class CodedInputStreamTest { for (int i = 0; i < 256 / 16; i++) { byte[] message = input.readRawBytes(16); for (int j = 0; j < message.length; j++) { - assertThat(message[j] & 0xff).isEqualTo(i * 16 + j); + assertEquals(i * 16 + j, message[j] & 0xff); } - assertThat(input.getTotalBytesRead()).isEqualTo(16); + assertEquals(16, input.getTotalBytesRead()); input.resetSizeCounter(); - assertThat(input.getTotalBytesRead()).isEqualTo(0); + assertEquals(0, input.getTotalBytesRead()); } } - @Test public void testReadString() throws Exception { String lorem = "Lorem ipsum dolor sit amet "; StringBuilder builder = new StringBuilder(); @@ -826,21 +814,20 @@ public class CodedInputStreamTest { CodedOutputStream output = CodedOutputStream.newInstance(rawOutput, bytes.length); int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(bytes.length); + output.writeRawVarint32(tag); + output.writeRawVarint32(bytes.length); output.writeRawBytes(bytes); output.flush(); byte[] rawInput = rawOutput.toByteString().toByteArray(); for (InputType inputType : InputType.values()) { CodedInputStream input = inputType.newDecoder(rawInput); - assertWithMessage(inputType.name()).that(tag).isEqualTo(input.readTag()); + assertEquals(inputType.name(), tag, input.readTag()); String text = input.readString(); - assertWithMessage(inputType.name()).that(lorem).isEqualTo(text); + assertEquals(inputType.name(), lorem, text); } } - @Test public void testReadStringRequireUtf8() throws Exception { String lorem = "Lorem ipsum dolor sit amet "; StringBuilder builder = new StringBuilder(); @@ -853,17 +840,17 @@ public class CodedInputStreamTest { CodedOutputStream output = CodedOutputStream.newInstance(rawOutput, bytes.length); int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(bytes.length); + output.writeRawVarint32(tag); + output.writeRawVarint32(bytes.length); output.writeRawBytes(bytes); output.flush(); byte[] rawInput = rawOutput.toByteString().toByteArray(); for (InputType inputType : InputType.values()) { CodedInputStream input = inputType.newDecoder(rawInput); - assertWithMessage(inputType.name()).that(tag).isEqualTo(input.readTag()); + assertEquals(inputType.name(), tag, input.readTag()); String text = input.readStringRequireUtf8(); - assertWithMessage(inputType.name()).that(lorem).isEqualTo(text); + assertEquals(inputType.name(), lorem, text); } } @@ -871,23 +858,22 @@ public class CodedInputStreamTest { * Tests that if we readString invalid UTF-8 bytes, no exception is thrown. Instead, the invalid * bytes are replaced with the Unicode "replacement character" U+FFFD. */ - @Test public void testReadStringInvalidUtf8() throws Exception { ByteString.Output rawOutput = ByteString.newOutput(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(1); + output.writeRawVarint32(tag); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 0x80}); output.flush(); byte[] rawInput = rawOutput.toByteString().toByteArray(); for (InputType inputType : InputType.values()) { CodedInputStream input = inputType.newDecoder(rawInput); - assertWithMessage(inputType.name()).that(input.readTag()).isEqualTo(tag); + assertEquals(inputType.name(), tag, input.readTag()); String text = input.readString(); - assertWithMessage(inputType.name()).that(text.charAt(0)).isEqualTo(0xfffd); + assertEquals(inputType.name(), 0xfffd, text.charAt(0)); } } @@ -895,48 +881,43 @@ public class CodedInputStreamTest { * Tests that if we readStringRequireUtf8 invalid UTF-8 bytes, an InvalidProtocolBufferException * is thrown. */ - @Test public void testReadStringRequireUtf8InvalidUtf8() throws Exception { ByteString.Output rawOutput = ByteString.newOutput(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeUInt32NoTag(tag); - output.writeUInt32NoTag(1); + output.writeRawVarint32(tag); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 0x80}); output.flush(); byte[] rawInput = rawOutput.toByteString().toByteArray(); for (InputType inputType : InputType.values()) { CodedInputStream input = inputType.newDecoder(rawInput); - assertThat(input.readTag()).isEqualTo(tag); + assertEquals(tag, input.readTag()); try { input.readStringRequireUtf8(); - assertWithMessage("%s: Expected invalid UTF-8 exception.", inputType.name()).fail(); + fail(inputType.name() + ": Expected invalid UTF-8 exception."); } catch (InvalidProtocolBufferException exception) { - assertWithMessage(inputType.name()) - .that(exception) - .hasMessageThat() - .isEqualTo("Protocol message had invalid UTF-8."); + assertEquals( + inputType.name(), "Protocol message had invalid UTF-8.", exception.getMessage()); } } } - @Test public void testReadFromSlice() throws Exception { byte[] bytes = bytes(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); CodedInputStream in = CodedInputStream.newInstance(bytes, 3, 5); - assertThat(in.getTotalBytesRead()).isEqualTo(0); + assertEquals(0, in.getTotalBytesRead()); for (int i = 3; i < 8; i++) { - assertThat(in.readRawByte()).isEqualTo(i); - assertThat(in.getTotalBytesRead()).isEqualTo(i - 2); + assertEquals(i, in.readRawByte()); + assertEquals(i - 2, in.getTotalBytesRead()); } // eof - assertThat(in.readTag()).isEqualTo(0); - assertThat(in.getTotalBytesRead()).isEqualTo(5); + assertEquals(0, in.readTag()); + assertEquals(5, in.getTotalBytesRead()); } - @Test public void testInvalidTag() throws Exception { // Any tag number which corresponds to field number zero is invalid and // should throw InvalidProtocolBufferException. @@ -944,35 +925,34 @@ public class CodedInputStreamTest { for (int i = 0; i < 8; i++) { try { inputType.newDecoder(bytes(i)).readTag(); - assertWithMessage("%s: Should have thrown an exception.", inputType.name()).fail(); + fail(inputType.name() + ": Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { - assertWithMessage(inputType.name()) - .that(e) - .hasMessageThat() - .isEqualTo(InvalidProtocolBufferException.invalidTag().getMessage()); + assertEquals( + inputType.name(), + InvalidProtocolBufferException.invalidTag().getMessage(), + e.getMessage()); } } } } - @Test public void testReadByteArray() throws Exception { ByteString.Output rawOutput = ByteString.newOutput(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); // Zero-sized bytes field. - output.writeUInt32NoTag(0); + output.writeRawVarint32(0); // One one-byte bytes field - output.writeUInt32NoTag(1); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 23}); // Another one-byte bytes field - output.writeUInt32NoTag(1); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 45}); // A bytes field large enough that won't fit into the 4K buffer. final int bytesLength = 16 * 1024; byte[] bytes = new byte[bytesLength]; bytes[0] = (byte) 67; bytes[bytesLength - 1] = (byte) 89; - output.writeUInt32NoTag(bytesLength); + output.writeRawVarint32(bytesLength); output.writeRawBytes(bytes); output.flush(); @@ -982,21 +962,20 @@ public class CodedInputStreamTest { CodedInputStream inputStream = inputType.newDecoder(rawInput); byte[] result = inputStream.readByteArray(); - assertWithMessage(inputType.name()).that(result).isEmpty(); + assertEquals(inputType.name(), 0, result.length); result = inputStream.readByteArray(); - assertWithMessage(inputType.name()).that(result).hasLength(1); - assertWithMessage(inputType.name()).that(result[0]).isEqualTo((byte) 23); + assertEquals(inputType.name(), 1, result.length); + assertEquals(inputType.name(), (byte) 23, result[0]); result = inputStream.readByteArray(); - assertWithMessage(inputType.name()).that(result).hasLength(1); - assertWithMessage(inputType.name()).that(result[0]).isEqualTo((byte) 45); + assertEquals(inputType.name(), 1, result.length); + assertEquals(inputType.name(), (byte) 45, result[0]); result = inputStream.readByteArray(); - assertWithMessage(inputType.name()).that(result).hasLength(bytesLength); - assertWithMessage(inputType.name()).that(result[0]).isEqualTo((byte) 67); - assertWithMessage(inputType.name()).that(result[bytesLength - 1]).isEqualTo((byte) 89); + assertEquals(inputType.name(), bytesLength, result.length); + assertEquals(inputType.name(), (byte) 67, result[0]); + assertEquals(inputType.name(), (byte) 89, result[bytesLength - 1]); } } - @Test public void testReadLargeByteStringFromInputStream() throws Exception { byte[] bytes = new byte[1024 * 1024]; for (int i = 0; i < bytes.length; i++) { @@ -1004,7 +983,7 @@ public class CodedInputStreamTest { } ByteString.Output rawOutput = ByteString.newOutput(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - output.writeUInt32NoTag(bytes.length); + output.writeRawVarint32(bytes.length); output.writeRawBytes(bytes); output.flush(); byte[] data = rawOutput.toByteString().toByteArray(); @@ -1018,10 +997,9 @@ public class CodedInputStreamTest { } }); ByteString result = input.readBytes(); - assertThat(ByteString.copyFrom(bytes)).isEqualTo(result); + assertEquals(ByteString.copyFrom(bytes), result); } - @Test public void testReadLargeByteArrayFromInputStream() throws Exception { byte[] bytes = new byte[1024 * 1024]; for (int i = 0; i < bytes.length; i++) { @@ -1029,7 +1007,7 @@ public class CodedInputStreamTest { } ByteString.Output rawOutput = ByteString.newOutput(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); - output.writeUInt32NoTag(bytes.length); + output.writeRawVarint32(bytes.length); output.writeRawBytes(bytes); output.flush(); byte[] data = rawOutput.toByteString().toByteArray(); @@ -1043,27 +1021,26 @@ public class CodedInputStreamTest { } }); byte[] result = input.readByteArray(); - assertThat(Arrays.equals(bytes, result)).isTrue(); + assertTrue(Arrays.equals(bytes, result)); } - @Test public void testReadByteBuffer() throws Exception { ByteString.Output rawOutput = ByteString.newOutput(); CodedOutputStream output = CodedOutputStream.newInstance(rawOutput); // Zero-sized bytes field. - output.writeUInt32NoTag(0); + output.writeRawVarint32(0); // One one-byte bytes field - output.writeUInt32NoTag(1); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 23}); // Another one-byte bytes field - output.writeUInt32NoTag(1); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 45}); // A bytes field large enough that won't fit into the 4K buffer. final int bytesLength = 16 * 1024; byte[] bytes = new byte[bytesLength]; bytes[0] = (byte) 67; bytes[bytesLength - 1] = (byte) 89; - output.writeUInt32NoTag(bytesLength); + output.writeRawVarint32(bytesLength); output.writeRawBytes(bytes); output.flush(); @@ -1073,39 +1050,38 @@ public class CodedInputStreamTest { CodedInputStream inputStream = inputType.newDecoder(rawInput); ByteBuffer result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(0); + assertEquals(inputType.name(), 0, result.capacity()); result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 23); + assertEquals(inputType.name(), 1, result.capacity()); + assertEquals(inputType.name(), (byte) 23, result.get()); result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 45); + assertEquals(inputType.name(), 1, result.capacity()); + assertEquals(inputType.name(), (byte) 45, result.get()); result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(bytesLength); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 67); + assertEquals(inputType.name(), bytesLength, result.capacity()); + assertEquals(inputType.name(), (byte) 67, result.get()); result.position(bytesLength - 1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 89); + assertEquals(inputType.name(), (byte) 89, result.get()); } } - @Test public void testReadByteBufferAliasing() throws Exception { ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); CodedOutputStream output = CodedOutputStream.newInstance(byteArrayStream); // Zero-sized bytes field. - output.writeUInt32NoTag(0); + output.writeRawVarint32(0); // One one-byte bytes field - output.writeUInt32NoTag(1); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 23}); // Another one-byte bytes field - output.writeUInt32NoTag(1); + output.writeRawVarint32(1); output.writeRawBytes(new byte[] {(byte) 45}); // A bytes field large enough that won't fit into the 4K buffer. final int bytesLength = 16 * 1024; byte[] bytes = new byte[bytesLength]; bytes[0] = (byte) 67; bytes[bytesLength - 1] = (byte) 89; - output.writeUInt32NoTag(bytesLength); + output.writeRawVarint32(bytesLength); output.writeRawBytes(bytes); output.flush(); @@ -1122,85 +1098,50 @@ public class CodedInputStreamTest { // Without aliasing CodedInputStream inputStream = inputType.newDecoder(data); ByteBuffer result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(0); + assertEquals(inputType.name(), 0, result.capacity()); result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.array() != data).isTrue(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 23); + assertTrue(inputType.name(), result.array() != data); + assertEquals(inputType.name(), 1, result.capacity()); + assertEquals(inputType.name(), (byte) 23, result.get()); result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.array() != data).isTrue(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 45); + assertTrue(inputType.name(), result.array() != data); + assertEquals(inputType.name(), 1, result.capacity()); + assertEquals(inputType.name(), (byte) 45, result.get()); result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.array() != data).isTrue(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(bytesLength); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 67); + assertTrue(inputType.name(), result.array() != data); + assertEquals(inputType.name(), bytesLength, result.capacity()); + assertEquals(inputType.name(), (byte) 67, result.get()); result.position(bytesLength - 1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 89); + assertEquals(inputType.name(), (byte) 89, result.get()); // Enable aliasing inputStream = inputType.newDecoder(data, data.length); inputStream.enableAliasing(true); result = inputStream.readByteBuffer(); - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(0); + assertEquals(inputType.name(), 0, result.capacity()); result = inputStream.readByteBuffer(); if (result.hasArray()) { - assertWithMessage(inputType.name()).that(result.array() == data).isTrue(); + assertTrue(inputType.name(), result.array() == data); } - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 23); + assertEquals(inputType.name(), 1, result.capacity()); + assertEquals(inputType.name(), (byte) 23, result.get()); result = inputStream.readByteBuffer(); if (result.hasArray()) { - assertWithMessage(inputType.name()).that(result.array() == data).isTrue(); + assertTrue(inputType.name(), result.array() == data); } - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 45); + assertEquals(inputType.name(), 1, result.capacity()); + assertEquals(inputType.name(), (byte) 45, result.get()); result = inputStream.readByteBuffer(); if (result.hasArray()) { - assertWithMessage(inputType.name()).that(result.array() == data).isTrue(); + assertTrue(inputType.name(), result.array() == data); } - assertWithMessage(inputType.name()).that(result.capacity()).isEqualTo(bytesLength); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 67); + assertEquals(inputType.name(), bytesLength, result.capacity()); + assertEquals(inputType.name(), (byte) 67, result.get()); result.position(bytesLength - 1); - assertWithMessage(inputType.name()).that(result.get()).isEqualTo((byte) 89); - } - } - - @Test - public void testIterableByteBufferInputStreamReadBytesWithAlias() throws Exception { - ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); - CodedOutputStream output = CodedOutputStream.newInstance(byteArrayStream); - // A bytes field large enough that won't fit into the default block buffer. - // 4.5 is to test the case where the total size of input is not aligned with DEFAULT_BLOCK_SIZE. - final int bytesLength = DEFAULT_BLOCK_SIZE * 4 + (DEFAULT_BLOCK_SIZE / 2); - byte[] bytes = new byte[bytesLength]; - for (int i = 0; i < bytesLength; i++) { - bytes[i] = (byte) (i % 256); - } - output.writeByteArrayNoTag(bytes); - output.flush(); - - // Input data is split into multiple ByteBuffers so that a single bytes spans across them. - // CodedInputStream with aliasing will decode it as a consequent rope by wrapping ByteBuffers. - byte[] data = byteArrayStream.toByteArray(); - ArrayList input = new ArrayList<>(); - for (int i = 0; i < data.length; i += DEFAULT_BLOCK_SIZE) { - int rl = Math.min(DEFAULT_BLOCK_SIZE, data.length - i); - ByteBuffer rb = ByteBuffer.allocateDirect(rl); - rb.put(data, i, rl); - rb.flip(); - input.add(rb); - } - final CodedInputStream inputStream = CodedInputStream.newInstance(input, true); - inputStream.enableAliasing(true); - - ByteString result = inputStream.readBytes(); - for (int i = 0; i < bytesLength; i++) { - assertThat(result.byteAt(i)).isEqualTo((byte) (i % 256)); + assertEquals(inputType.name(), (byte) 89, result.get()); } } - @Test public void testCompatibleTypes() throws Exception { long data = 0x100000000L; Int64Message message = Int64Message.newBuilder().setData(data).build(); @@ -1210,16 +1151,15 @@ public class CodedInputStreamTest { // Test int64(long) is compatible with bool(boolean) BoolMessage msg2 = BoolMessage.parseFrom(inputStream); - assertThat(msg2.getData()).isTrue(); + assertTrue(msg2.getData()); // Test int64(long) is compatible with int32(int) inputStream = inputType.newDecoder(serialized); Int32Message msg3 = Int32Message.parseFrom(inputStream); - assertThat(msg3.getData()).isEqualTo((int) data); + assertEquals((int) data, msg3.getData()); } } - @Test public void testSkipInvalidVarint_FastPath() throws Exception { // Fast path: We have >= 10 bytes available. Ensure we properly recognize a non-ending varint. byte[] data = new byte[] {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0}; @@ -1227,14 +1167,13 @@ public class CodedInputStreamTest { try { CodedInputStream input = inputType.newDecoder(data); input.skipField(WireFormat.makeTag(1, WireFormat.WIRETYPE_VARINT)); - assertWithMessage("%s: Should have thrown an exception.", inputType.name()).fail(); + fail(inputType.name() + ": Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { // Expected } } } - @Test public void testSkipInvalidVarint_SlowPath() throws Exception { // Slow path: < 10 bytes available. Ensure we properly recognize a non-ending varint. byte[] data = new byte[] {-1, -1, -1, -1, -1, -1, -1, -1, -1}; @@ -1242,24 +1181,22 @@ public class CodedInputStreamTest { try { CodedInputStream input = inputType.newDecoder(data); input.skipField(WireFormat.makeTag(1, WireFormat.WIRETYPE_VARINT)); - assertWithMessage("%s: Should have thrown an exception.", inputType.name()).fail(); + fail(inputType.name() + ": Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { // Expected } } } - @Test public void testSkipPastEndOfByteArrayInput() throws Exception { try { CodedInputStream.newInstance(new ByteArrayInputStream(new byte[100])).skipRawBytes(101); - assertWithMessage("Should have thrown an exception").fail(); + fail(); } catch (InvalidProtocolBufferException e) { // Expected } } - - @Test + public void testMaliciousInputStream() throws Exception { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); CodedOutputStream codedOutputStream = CodedOutputStream.newInstance(outputStream); @@ -1273,75 +1210,45 @@ public class CodedInputStreamTest { return super.read(b, off, len); } }; - + // test ByteString - + CodedInputStream codedInputStream = CodedInputStream.newInstance(inputStream, 1); ByteString byteString = codedInputStream.readBytes(); - assertThat(byteString.byteAt(0)).isEqualTo(0x0); + assertEquals(0x0, byteString.byteAt(0)); maliciousCapture.get(1)[0] = 0x9; - assertThat(byteString.byteAt(0)).isEqualTo(0x0); - + assertEquals(0x0, byteString.byteAt(0)); + // test ByteBuffer - + inputStream.reset(); maliciousCapture.clear(); codedInputStream = CodedInputStream.newInstance(inputStream, 1); ByteBuffer byteBuffer = codedInputStream.readByteBuffer(); - assertThat(byteBuffer.get(0)).isEqualTo(0x0); + assertEquals(0x0, byteBuffer.get(0)); maliciousCapture.get(1)[0] = 0x9; - assertThat(byteBuffer.get(0)).isEqualTo(0x0); + assertEquals(0x0, byteBuffer.get(0)); + // test byte[] - + inputStream.reset(); maliciousCapture.clear(); codedInputStream = CodedInputStream.newInstance(inputStream, 1); byte[] byteArray = codedInputStream.readByteArray(); - assertThat(byteArray[0]).isEqualTo(0x0); + assertEquals(0x0, byteArray[0]); maliciousCapture.get(1)[0] = 0x9; - assertThat(byteArray[0]).isEqualTo(0x9); // MODIFICATION! Should we fix? + assertEquals(0x9, byteArray[0]); // MODIFICATION! Should we fix? // test rawBytes - + inputStream.reset(); maliciousCapture.clear(); codedInputStream = CodedInputStream.newInstance(inputStream, 1); int length = codedInputStream.readRawVarint32(); byteArray = codedInputStream.readRawBytes(length); - assertThat(byteArray[0]).isEqualTo(0x0); + assertEquals(0x0, byteArray[0]); maliciousCapture.get(1)[0] = 0x9; - assertThat(byteArray[0]).isEqualTo(0x9); // MODIFICATION! Should we fix? - } - - @Test - public void testInvalidInputYieldsInvalidProtocolBufferException_readTag() throws Exception { - byte[] input = new byte[] {0x0a, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x77}; - CodedInputStream inputStream = CodedInputStream.newInstance(input); - try { - inputStream.readTag(); - int size = inputStream.readRawVarint32(); - inputStream.pushLimit(size); - inputStream.readTag(); - assertWithMessage("Should have thrown an exception").fail(); - } catch (InvalidProtocolBufferException ex) { - // Expected. - } - } - - @Test - public void testInvalidInputYieldsInvalidProtocolBufferException_readBytes() throws Exception { - byte[] input = - new byte[] {0x0a, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x67, 0x1a, 0x1a}; - CodedInputStream inputStream = CodedInputStream.newInstance(input); - try { - inputStream.readTag(); - int size = inputStream.readRawVarint32(); - inputStream.pushLimit(size); - inputStream.readBytes(); - assertWithMessage("Should have thrown an exception").fail(); - } catch (InvalidProtocolBufferException ex) { - // Expected. - } + assertEquals(0x9, byteArray[0]); // MODIFICATION! Should we fix? } } diff --git a/java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java b/java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java index 3007c83a1f99de8c82721c237d2609f5dd2fd8d6..8dc3e4ce7a4aed4895ccbd7acdb12077b51add68 100644 --- a/java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java +++ b/java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java @@ -1,15 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import com.google.protobuf.CodedOutputStream.OutOfSpaceException; import protobuf_unittest.UnittestProto.SparseEnumMessage; import protobuf_unittest.UnittestProto.TestAllTypes; @@ -21,13 +41,14 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Unit test for {@link CodedOutputStream}. */ -@RunWith(JUnit4.class) -public class CodedOutputStreamTest { +import junit.framework.TestCase; + +/** + * Unit test for {@link CodedOutputStream}. + * + * @author kenton@google.com Kenton Varda + */ +public class CodedOutputStreamTest extends TestCase { private interface Coder { CodedOutputStream stream(); @@ -203,7 +224,6 @@ public class CodedOutputStreamTest { } /** Checks that invariants are maintained for varint round trip input and output. */ - @Test public void testVarintRoundTrips() throws Exception { for (OutputType outputType : OutputType.values()) { assertVarintRoundTrip(outputType, 0L); @@ -218,7 +238,6 @@ public class CodedOutputStreamTest { } /** Tests writeRawVarint32() and writeRawVarint64(). */ - @Test public void testWriteVarint() throws Exception { assertWriteVarint(bytes(0x00), 0); assertWriteVarint(bytes(0x01), 1); @@ -262,7 +281,6 @@ public class CodedOutputStreamTest { } /** Tests writeRawLittleEndian32() and writeRawLittleEndian64(). */ - @Test public void testWriteLittleEndian() throws Exception { assertWriteLittleEndian32(bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); assertWriteLittleEndian32(bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); @@ -274,61 +292,50 @@ public class CodedOutputStreamTest { } /** Test encodeZigZag32() and encodeZigZag64(). */ - @Test public void testEncodeZigZag() throws Exception { - assertThat(CodedOutputStream.encodeZigZag32(0)).isEqualTo(0); - assertThat(CodedOutputStream.encodeZigZag32(-1)).isEqualTo(1); - assertThat(CodedOutputStream.encodeZigZag32(1)).isEqualTo(2); - assertThat(CodedOutputStream.encodeZigZag32(-2)).isEqualTo(3); - assertThat(CodedOutputStream.encodeZigZag32(0x3FFFFFFF)).isEqualTo(0x7FFFFFFE); - assertThat(CodedOutputStream.encodeZigZag32(0xC0000000)).isEqualTo(0x7FFFFFFF); - assertThat(CodedOutputStream.encodeZigZag32(0x7FFFFFFF)).isEqualTo(0xFFFFFFFE); - assertThat(CodedOutputStream.encodeZigZag32(0x80000000)).isEqualTo(0xFFFFFFFF); - - assertThat(CodedOutputStream.encodeZigZag64(0)).isEqualTo(0); - assertThat(CodedOutputStream.encodeZigZag64(-1)).isEqualTo(1); - assertThat(CodedOutputStream.encodeZigZag64(1)).isEqualTo(2); - assertThat(CodedOutputStream.encodeZigZag64(-2)).isEqualTo(3); - assertThat(CodedOutputStream.encodeZigZag64(0x000000003FFFFFFFL)) - .isEqualTo(0x000000007FFFFFFEL); - assertThat(CodedOutputStream.encodeZigZag64(0xFFFFFFFFC0000000L)) - .isEqualTo(0x000000007FFFFFFFL); - assertThat(CodedOutputStream.encodeZigZag64(0x000000007FFFFFFFL)) - .isEqualTo(0x00000000FFFFFFFEL); - assertThat(CodedOutputStream.encodeZigZag64(0xFFFFFFFF80000000L)) - .isEqualTo(0x00000000FFFFFFFFL); - assertThat(CodedOutputStream.encodeZigZag64(0x7FFFFFFFFFFFFFFFL)) - .isEqualTo(0xFFFFFFFFFFFFFFFEL); - assertThat(CodedOutputStream.encodeZigZag64(0x8000000000000000L)) - .isEqualTo(0xFFFFFFFFFFFFFFFFL); + assertEquals(0, CodedOutputStream.encodeZigZag32(0)); + assertEquals(1, CodedOutputStream.encodeZigZag32(-1)); + assertEquals(2, CodedOutputStream.encodeZigZag32(1)); + assertEquals(3, CodedOutputStream.encodeZigZag32(-2)); + assertEquals(0x7FFFFFFE, CodedOutputStream.encodeZigZag32(0x3FFFFFFF)); + assertEquals(0x7FFFFFFF, CodedOutputStream.encodeZigZag32(0xC0000000)); + assertEquals(0xFFFFFFFE, CodedOutputStream.encodeZigZag32(0x7FFFFFFF)); + assertEquals(0xFFFFFFFF, CodedOutputStream.encodeZigZag32(0x80000000)); + + assertEquals(0, CodedOutputStream.encodeZigZag64(0)); + assertEquals(1, CodedOutputStream.encodeZigZag64(-1)); + assertEquals(2, CodedOutputStream.encodeZigZag64(1)); + assertEquals(3, CodedOutputStream.encodeZigZag64(-2)); + assertEquals(0x000000007FFFFFFEL, CodedOutputStream.encodeZigZag64(0x000000003FFFFFFFL)); + assertEquals(0x000000007FFFFFFFL, CodedOutputStream.encodeZigZag64(0xFFFFFFFFC0000000L)); + assertEquals(0x00000000FFFFFFFEL, CodedOutputStream.encodeZigZag64(0x000000007FFFFFFFL)); + assertEquals(0x00000000FFFFFFFFL, CodedOutputStream.encodeZigZag64(0xFFFFFFFF80000000L)); + assertEquals(0xFFFFFFFFFFFFFFFEL, CodedOutputStream.encodeZigZag64(0x7FFFFFFFFFFFFFFFL)); + assertEquals(0xFFFFFFFFFFFFFFFFL, CodedOutputStream.encodeZigZag64(0x8000000000000000L)); // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) // were chosen semi-randomly via keyboard bashing. - assertThat(CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(0))).isEqualTo(0); - assertThat(CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(1))).isEqualTo(1); - assertThat(CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(-1))).isEqualTo(-1); - assertThat(CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(14927))) - .isEqualTo(14927); - assertThat(CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(-3612))) - .isEqualTo(-3612); - - assertThat(CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(0))).isEqualTo(0); - assertThat(CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(1))).isEqualTo(1); - assertThat(CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-1))).isEqualTo(-1); - assertThat(CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(14927))) - .isEqualTo(14927); - assertThat(CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-3612))) - .isEqualTo(-3612); - - assertThat(CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(856912304801416L))) - .isEqualTo(856912304801416L); - assertThat( - CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-75123905439571256L))) - .isEqualTo(-75123905439571256L); + assertEquals(0, CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(0))); + assertEquals(1, CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(1))); + assertEquals(-1, CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(-1))); + assertEquals(14927, CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(14927))); + assertEquals(-3612, CodedOutputStream.encodeZigZag32(CodedInputStream.decodeZigZag32(-3612))); + + assertEquals(0, CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(0))); + assertEquals(1, CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(1))); + assertEquals(-1, CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-1))); + assertEquals(14927, CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(14927))); + assertEquals(-3612, CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-3612))); + + assertEquals( + 856912304801416L, + CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(856912304801416L))); + assertEquals( + -75123905439571256L, + CodedOutputStream.encodeZigZag64(CodedInputStream.decodeZigZag64(-75123905439571256L))); } /** Tests writing a whole message with every field type. */ - @Test public void testWriteWholeMessage() throws Exception { final byte[] expectedBytes = TestUtil.getGoldenMessage().toByteArray(); TestAllTypes message = TestUtil.getAllSet(); @@ -354,7 +361,6 @@ public class CodedOutputStreamTest { * Tests writing a whole message with every packed field type. Ensures the wire format of packed * fields is compatible with C++. */ - @Test public void testWriteWholePackedFieldsMessage() throws Exception { byte[] expectedBytes = TestUtil.getGoldenPackedFieldsMessage().toByteArray(); TestPackedTypes message = TestUtil.getPackedSet(); @@ -372,23 +378,21 @@ public class CodedOutputStreamTest { * Test writing a message containing a negative enum value. This used to fail because the size was * not properly computed as a sign-extended varint. */ - @Test public void testWriteMessageWithNegativeEnumValue() throws Exception { SparseEnumMessage message = SparseEnumMessage.newBuilder().setSparseEnum(TestSparseEnum.SPARSE_E).build(); - assertThat(message.getSparseEnum().getNumber()).isLessThan(0); + assertTrue(message.getSparseEnum().getNumber() < 0); for (OutputType outputType : OutputType.values()) { Coder coder = outputType.newCoder(message.getSerializedSize()); message.writeTo(coder.stream()); coder.stream().flush(); byte[] rawBytes = coder.toByteArray(); SparseEnumMessage message2 = SparseEnumMessage.parseFrom(rawBytes); - assertThat(message2.getSparseEnum()).isEqualTo(TestSparseEnum.SPARSE_E); + assertEquals(TestSparseEnum.SPARSE_E, message2.getSparseEnum()); } } /** Test getTotalBytesWritten() */ - @Test public void testGetTotalBytesWritten() throws Exception { Coder coder = OutputType.STREAM.newCoder(4 * 1024); @@ -398,27 +402,26 @@ public class CodedOutputStreamTest { for (int i = 0; i < 1024; ++i) { coder.stream().writeRawBytes(value, 0, value.length); } - assertThat(coder.stream().getTotalBytesWritten()).isEqualTo(value.length * 1024); + assertEquals(value.length * 1024, coder.stream().getTotalBytesWritten()); // Now write an encoded string. String string = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; // Ensure we take the slower fast path. - assertThat(CodedOutputStream.computeUInt32SizeNoTag(string.length())) - .isNotEqualTo( - CodedOutputStream.computeUInt32SizeNoTag(string.length() * Utf8.MAX_BYTES_PER_CHAR)); + assertTrue( + CodedOutputStream.computeUInt32SizeNoTag(string.length()) + != CodedOutputStream.computeUInt32SizeNoTag(string.length() * Utf8.MAX_BYTES_PER_CHAR)); coder.stream().writeStringNoTag(string); coder.stream().flush(); int stringSize = CodedOutputStream.computeStringSizeNoTag(string); // Verify that the total bytes written is correct - assertThat(coder.stream().getTotalBytesWritten()).isEqualTo((value.length * 1024) + stringSize); + assertEquals((value.length * 1024) + stringSize, coder.stream().getTotalBytesWritten()); } - // TODO: Write a comprehensive test suite for CodedOutputStream that covers more than just + // TODO(dweis): Write a comprehensive test suite for CodedOutputStream that covers more than just // this case. - @Test public void testWriteStringNoTag_fastpath() throws Exception { int bufferSize = 153; String threeBytesPer = "\u0981"; @@ -427,10 +430,10 @@ public class CodedOutputStreamTest { string += threeBytesPer; } // These checks ensure we will tickle the slower fast path. - assertThat(CodedOutputStream.computeUInt32SizeNoTag(string.length())).isEqualTo(1); - assertThat(CodedOutputStream.computeUInt32SizeNoTag(string.length() * Utf8.MAX_BYTES_PER_CHAR)) - .isEqualTo(2); - assertThat(bufferSize).isEqualTo(string.length() * Utf8.MAX_BYTES_PER_CHAR); + assertEquals(1, CodedOutputStream.computeUInt32SizeNoTag(string.length())); + assertEquals( + 2, CodedOutputStream.computeUInt32SizeNoTag(string.length() * Utf8.MAX_BYTES_PER_CHAR)); + assertEquals(bufferSize, string.length() * Utf8.MAX_BYTES_PER_CHAR); for (OutputType outputType : OutputType.values()) { Coder coder = outputType.newCoder(bufferSize + 2); @@ -439,7 +442,6 @@ public class CodedOutputStreamTest { } } - @Test public void testWriteToByteBuffer() throws Exception { final int bufferSize = 16 * 1024; ByteBuffer buffer = ByteBuffer.allocate(bufferSize); @@ -460,20 +462,19 @@ public class CodedOutputStreamTest { codedStream.flush(); // Check that data is correctly written to the ByteBuffer. - assertThat(buffer.remaining()).isEqualTo(0); + assertEquals(0, buffer.remaining()); buffer.flip(); for (int i = 0; i < length1; i++) { - assertThat(buffer.get()).isEqualTo((byte) 1); + assertEquals((byte) 1, buffer.get()); } for (int i = 0; i < length2; i++) { - assertThat(buffer.get()).isEqualTo((byte) 2); + assertEquals((byte) 2, buffer.get()); } for (int i = 0; i < length3; i++) { - assertThat(buffer.get()).isEqualTo((byte) 3); + assertEquals((byte) 3, buffer.get()); } } - @Test public void testWriteByteBuffer() throws Exception { byte[] value = "abcde".getBytes(Internal.UTF_8); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); @@ -483,33 +484,31 @@ public class CodedOutputStreamTest { // ByteBuffer's capacity() is 5. codedStream.writeRawBytes(byteBuffer); // The above call shouldn't affect the ByteBuffer's state. - assertThat(byteBuffer.position()).isEqualTo(0); - assertThat(byteBuffer.limit()).isEqualTo(1); + assertEquals(0, byteBuffer.position()); + assertEquals(1, byteBuffer.limit()); // The correct way to write part of an array using ByteBuffer. codedStream.writeRawBytes(ByteBuffer.wrap(value, 2, 1).slice()); codedStream.flush(); byte[] result = outputStream.toByteArray(); - assertThat(result).hasLength(6); + assertEquals(6, result.length); for (int i = 0; i < 5; i++) { - assertThat(value[i]).isEqualTo(result[i]); + assertEquals(value[i], result[i]); } - assertThat(value[2]).isEqualTo(result[5]); + assertEquals(value[2], result[5]); } - @Test public void testWriteByteArrayWithOffsets() throws Exception { byte[] fullArray = bytes(0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88); for (OutputType type : new OutputType[] {OutputType.ARRAY}) { Coder coder = type.newCoder(4); coder.stream().writeByteArrayNoTag(fullArray, 2, 2); assertEqualBytes(type, bytes(0x02, 0x33, 0x44), coder.toByteArray()); - assertThat(coder.stream().getTotalBytesWritten()).isEqualTo(3); + assertEquals(3, coder.stream().getTotalBytesWritten()); } } - @Test public void testSerializeUtf8_MultipleSmallWrites() throws Exception { final String source = "abcdefghijklmnopqrstuvwxyz"; @@ -534,7 +533,6 @@ public class CodedOutputStreamTest { } } - @Test public void testSerializeInvalidUtf8() throws Exception { String[] invalidStrings = new String[] { @@ -550,7 +548,7 @@ public class CodedOutputStreamTest { CodedOutputStream outputWithByteBuffer = CodedOutputStream.newInstance(ByteBuffer.allocate(10000)); for (String s : invalidStrings) { - // TODO: These should all fail; instead they are corrupting data. + // TODO(dweis): These should all fail; instead they are corrupting data. CodedOutputStream.computeStringSizeNoTag(s); outputWithStream.writeStringNoTag(s); outputWithArray.writeStringNoTag(s); @@ -558,9 +556,8 @@ public class CodedOutputStreamTest { } } - // TODO: This test can be deleted once we properly throw IOException while + // TODO(nathanmittler): This test can be deleted once we properly throw IOException while // encoding invalid UTF-8 strings. - @Test public void testSerializeInvalidUtf8FollowedByOutOfSpace() throws Exception { final int notEnoughBytes = 4; CodedOutputStream outputWithArray = CodedOutputStream.newInstance(new byte[notEnoughBytes]); @@ -570,25 +567,25 @@ public class CodedOutputStreamTest { String invalidString = newString(Character.MIN_HIGH_SURROGATE, 'f', 'o', 'o', 'b', 'a', 'r'); try { outputWithArray.writeStringNoTag(invalidString); - assertWithMessage("Expected OutOfSpaceException").fail(); + fail("Expected OutOfSpaceException"); } catch (OutOfSpaceException e) { - assertThat(e).hasCauseThat().isInstanceOf(IndexOutOfBoundsException.class); + assertTrue(e.getCause() instanceof IndexOutOfBoundsException); } try { outputWithByteBuffer.writeStringNoTag(invalidString); - assertWithMessage("Expected OutOfSpaceException").fail(); + fail("Expected OutOfSpaceException"); } catch (OutOfSpaceException e) { - assertThat(e).hasCauseThat().isInstanceOf(IndexOutOfBoundsException.class); + assertTrue(e.getCause() instanceof IndexOutOfBoundsException); } } /** Regression test for https://github.com/protocolbuffers/protobuf/issues/292 */ - @Test public void testCorrectExceptionThrowWhenEncodingStringsWithoutEnoughSpace() throws Exception { String testCase = "Foooooooo"; - assertThat(CodedOutputStream.computeUInt32SizeNoTag(testCase.length())) - .isEqualTo(CodedOutputStream.computeUInt32SizeNoTag(testCase.length() * 3)); - assertThat(CodedOutputStream.computeStringSize(1, testCase)).isEqualTo(11); + assertEquals( + CodedOutputStream.computeUInt32SizeNoTag(testCase.length()), + CodedOutputStream.computeUInt32SizeNoTag(testCase.length() * 3)); + assertEquals(11, CodedOutputStream.computeStringSize(1, testCase)); // Tag is one byte, varint describing string length is 1 byte, string length is 9 bytes. // An array of size 1 will cause a failure when trying to write the varint. for (OutputType outputType : @@ -602,14 +599,13 @@ public class CodedOutputStreamTest { Coder coder = outputType.newCoder(i); try { coder.stream().writeString(1, testCase); - assertWithMessage("Should have thrown an out of space exception").fail(); + fail("Should have thrown an out of space exception"); } catch (CodedOutputStream.OutOfSpaceException expected) { } } } } - @Test public void testDifferentStringLengths() throws Exception { // Test string serialization roundtrip using strings of the following lengths, // with ASCII and Unicode characters requiring different UTF-8 byte counts per @@ -635,7 +631,6 @@ public class CodedOutputStreamTest { } } - @Test public void testNioEncodersWithInitialOffsets() throws Exception { String value = "abc"; for (Coder coder : @@ -701,9 +696,10 @@ public class CodedOutputStreamTest { Coder coder = outputType.newCoder(testAllTypes.getSerializedSize()); testAllTypes.writeTo(coder.stream()); coder.stream().flush(); - assertWithMessage("OuputType: " + outputType) - .that(fullString) - .isEqualTo(TestAllTypes.parseFrom(coder.toByteArray()).getOptionalString()); + assertEquals( + "OuputType: " + outputType, + fullString, + TestAllTypes.parseFrom(coder.toByteArray()).getOptionalString()); } private static String fullString(char c, int length) { @@ -734,14 +730,13 @@ public class CodedOutputStreamTest { } private static void assertEqualBytes(OutputType outputType, byte[] a, byte[] b) { - assertWithMessage(outputType.name()).that(toList(a)).isEqualTo(toList(b)); + assertEquals(outputType.name(), toList(a), toList(b)); } /** * Writes the given value using writeRawVarint32() and writeRawVarint64() and checks that the * result matches the given bytes. */ - @SuppressWarnings("UnnecessaryLongToIntConversion") // Intentionally tests 32-bit int values. private static void assertWriteVarint(byte[] data, long value) throws Exception { for (OutputType outputType : OutputType.values()) { // Only test 32-bit write if the value fits into an int. @@ -752,7 +747,7 @@ public class CodedOutputStreamTest { assertEqualBytes(outputType, data, coder.toByteArray()); // Also try computing size. - assertThat(data).hasLength(CodedOutputStream.computeUInt32SizeNoTag((int) value)); + assertEquals(data.length, CodedOutputStream.computeUInt32SizeNoTag((int) value)); } { @@ -762,7 +757,7 @@ public class CodedOutputStreamTest { assertEqualBytes(outputType, data, coder.toByteArray()); // Also try computing size. - assertThat(data).hasLength(CodedOutputStream.computeUInt64SizeNoTag(value)); + assertEquals(data.length, CodedOutputStream.computeUInt64SizeNoTag(value)); } } @@ -797,11 +792,10 @@ public class CodedOutputStreamTest { coder.stream().writeUInt64NoTag(value); coder.stream().flush(); byte[] bytes = coder.toByteArray(); - assertWithMessage(outputType.name()) - .that(bytes) - .hasLength(CodedOutputStream.computeUInt64SizeNoTag(value)); + assertEquals( + outputType.name(), bytes.length, CodedOutputStream.computeUInt64SizeNoTag(value)); CodedInputStream input = CodedInputStream.newInstance(new ByteArrayInputStream(bytes)); - assertWithMessage(outputType.name()).that(input.readRawVarint64()).isEqualTo(value); + assertEquals(outputType.name(), value, input.readRawVarint64()); } if (value == (int) value) { @@ -809,11 +803,10 @@ public class CodedOutputStreamTest { coder.stream().writeUInt32NoTag((int) value); coder.stream().flush(); byte[] bytes = coder.toByteArray(); - assertWithMessage(outputType.name()) - .that(bytes) - .hasLength(CodedOutputStream.computeUInt32SizeNoTag((int) value)); + assertEquals( + outputType.name(), bytes.length, CodedOutputStream.computeUInt32SizeNoTag((int) value)); CodedInputStream input = CodedInputStream.newInstance(new ByteArrayInputStream(bytes)); - assertWithMessage(outputType.name()).that(input.readRawVarint32()).isEqualTo(value); + assertEquals(outputType.name(), value, input.readRawVarint32()); } } } diff --git a/java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java b/java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java index 38cc65102f0439fad064fe94382bce00da5a9b77..359d4d74c02be532c13a7d2a5f0e37972843bcfa 100644 --- a/java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java +++ b/java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java @@ -1,10 +1,3 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - package com.google.protobuf; import com.google.protobuf.Utf8.Processor; @@ -35,13 +28,12 @@ public class DecodeUtf8Test extends TestCase { public void testOneByte() throws Exception { int valid = 0; - ByteBuffer buffer = ByteBuffer.allocateDirect(1); for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) { - ByteString bs = ByteString.copyFrom(new byte[] {(byte) i}); - if (bs.isValidUtf8()) { - valid++; + ByteString bs = ByteString.copyFrom(new byte[] { (byte) i }); + if (!bs.isValidUtf8()) { + assertInvalid(bs.toByteArray()); } else { - assertInvalid(bs.toByteArray(), buffer); + valid++; } } assertEquals(IsValidUtf8TestUtil.EXPECTED_ONE_BYTE_ROUNDTRIPPABLE_COUNT, valid); @@ -49,14 +41,13 @@ public class DecodeUtf8Test extends TestCase { public void testTwoBytes() throws Exception { int valid = 0; - ByteBuffer buffer = ByteBuffer.allocateDirect(2); for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) { for (int j = Byte.MIN_VALUE; j <= Byte.MAX_VALUE; j++) { - ByteString bs = ByteString.copyFrom(new byte[] {(byte) i, (byte) j}); - if (bs.isValidUtf8()) { - valid++; + ByteString bs = ByteString.copyFrom(new byte[]{(byte) i, (byte) j}); + if (!bs.isValidUtf8()) { + assertInvalid(bs.toByteArray()); } else { - assertInvalid(bs.toByteArray(), buffer); + valid++; } } } @@ -64,30 +55,34 @@ public class DecodeUtf8Test extends TestCase { } public void testThreeBytes() throws Exception { - int count = 0; - int valid = 0; - ByteBuffer buffer = ByteBuffer.allocateDirect(3); - for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) { - for (int j = Byte.MIN_VALUE; j <= Byte.MAX_VALUE; j++) { - for (int k = Byte.MIN_VALUE; k <= Byte.MAX_VALUE; k++) { - byte[] bytes = new byte[] {(byte) i, (byte) j, (byte) k}; - ByteString bs = ByteString.copyFrom(bytes); - if (bs.isValidUtf8()) { - valid++; - } else { - assertInvalid(bytes, buffer); - } - count++; - if (count % 1000000L == 0) { - logger.info("Processed " + (count / 1000000L) + " million characters"); + // Travis' OOM killer doesn't like this test + if (System.getenv("TRAVIS") == null) { + int count = 0; + int valid = 0; + for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) { + for (int j = Byte.MIN_VALUE; j <= Byte.MAX_VALUE; j++) { + for (int k = Byte.MIN_VALUE; k <= Byte.MAX_VALUE; k++) { + byte[] bytes = new byte[]{(byte) i, (byte) j, (byte) k}; + ByteString bs = ByteString.copyFrom(bytes); + if (!bs.isValidUtf8()) { + assertInvalid(bytes); + } else { + valid++; + } + count++; + if (count % 1000000L == 0) { + logger.info("Processed " + (count / 1000000L) + " million characters"); + } } } } + assertEquals(IsValidUtf8TestUtil.EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT, valid); } - assertEquals(IsValidUtf8TestUtil.EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT, valid); } - /** Tests that round tripping of a sample of four byte permutations work. */ + /** + * Tests that round tripping of a sample of four byte permutations work. + */ public void testInvalid_4BytesSamples() throws Exception { // Bad trailing bytes assertInvalid(0xF0, 0xA4, 0xAD, 0x7F); @@ -104,7 +99,8 @@ public class DecodeUtf8Test extends TestCase { // German assertRoundTrips("Quizdeltagerne spiste jordb\u00e6r med fl\u00f8de, mens cirkusklovnen"); // Japanese - assertRoundTrips("\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c\u308b\u3092"); + assertRoundTrips( + "\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c\u308b\u3092"); // Hebrew assertRoundTrips( "\u05d3\u05d2 \u05e1\u05e7\u05e8\u05df \u05e9\u05d8 \u05d1\u05d9\u05dd " @@ -119,10 +115,9 @@ public class DecodeUtf8Test extends TestCase { assertRoundTrips( "\u8fd4\u56de\u94fe\u4e2d\u7684\u4e0b\u4e00\u4e2a\u4ee3\u7406\u9879\u9009\u62e9\u5668"); // Chinese with 4-byte chars - assertRoundTrips( - "\uD841\uDF0E\uD841\uDF31\uD841\uDF79\uD843\uDC53\uD843\uDC78" - + "\uD843\uDC96\uD843\uDCCF\uD843\uDCD5\uD843\uDD15\uD843\uDD7C\uD843\uDD7F" - + "\uD843\uDE0E\uD843\uDE0F\uD843\uDE77\uD843\uDE9D\uD843\uDEA2"); + assertRoundTrips("\uD841\uDF0E\uD841\uDF31\uD841\uDF79\uD843\uDC53\uD843\uDC78" + + "\uD843\uDC96\uD843\uDCCF\uD843\uDCD5\uD843\uDD15\uD843\uDD7C\uD843\uDD7F" + + "\uD843\uDE0E\uD843\uDE0F\uD843\uDE77\uD843\uDE9D\uD843\uDEA2"); // Mixed assertRoundTrips( "The quick brown \u3044\u308d\u306f\u306b\u307b\u3078\u8fd4\u56de\u94fe" @@ -137,7 +132,7 @@ public class DecodeUtf8Test extends TestCase { // Max overlong assertInvalid(0xc1, 0xbf); assertInvalid(0xe0, 0x9f, 0xbf); - assertInvalid(0xf0, 0x8f, 0xbf, 0xbf); + assertInvalid(0xf0 ,0x8f, 0xbf, 0xbf); // null overlong assertInvalid(0xc0, 0x80); @@ -173,7 +168,7 @@ public class DecodeUtf8Test extends TestCase { } public void testInvalidBufferSlice() throws Exception { - byte[] bytes = "The quick brown fox jumps over the lazy dog".getBytes(Internal.UTF_8); + byte[] bytes = "The quick brown fox jumps over the lazy dog".getBytes(Internal.UTF_8); assertInvalidSlice(bytes, bytes.length - 3, 4); assertInvalidSlice(bytes, bytes.length, 1); assertInvalidSlice(bytes, bytes.length + 1, 0); @@ -185,14 +180,10 @@ public class DecodeUtf8Test extends TestCase { for (int i = 0; i < bytesAsInt.length; i++) { bytes[i] = (byte) bytesAsInt[i]; } - assertInvalid(bytes, null); + assertInvalid(bytes); } - // Attempts to decode the byte array in several ways and asserts that it always generates an - // exception. Allocating a direct ByteBuffer is slow, so the caller can optionally provide a - // buffer to reuse. If buffer is non-null, it must be a direct-allocated ByteBuffer of the - // appropriate size. - private void assertInvalid(byte[] bytes, ByteBuffer buffer) throws Exception { + private void assertInvalid(byte[] bytes) throws Exception { try { UNSAFE_PROCESSOR.decodeUtf8(bytes, 0, bytes.length); fail(); @@ -206,37 +197,50 @@ public class DecodeUtf8Test extends TestCase { // Expected. } - if (buffer == null) { - buffer = ByteBuffer.allocateDirect(bytes.length); + ByteBuffer direct = ByteBuffer.allocateDirect(bytes.length); + direct.put(bytes); + direct.flip(); + try { + UNSAFE_PROCESSOR.decodeUtf8(direct, 0, bytes.length); + fail(); + } catch (InvalidProtocolBufferException e) { + // Expected. + } + try { + SAFE_PROCESSOR.decodeUtf8(direct, 0, bytes.length); + fail(); + } catch (InvalidProtocolBufferException e) { + // Expected. } - buffer.put(bytes); - buffer.flip(); + + ByteBuffer heap = ByteBuffer.allocate(bytes.length); + heap.put(bytes); + heap.flip(); try { - UNSAFE_PROCESSOR.decodeUtf8(buffer, 0, bytes.length); + UNSAFE_PROCESSOR.decodeUtf8(heap, 0, bytes.length); fail(); } catch (InvalidProtocolBufferException e) { // Expected. } try { - SAFE_PROCESSOR.decodeUtf8(buffer, 0, bytes.length); + SAFE_PROCESSOR.decodeUtf8(heap, 0, bytes.length); fail(); } catch (InvalidProtocolBufferException e) { // Expected. } - buffer.clear(); } private void assertInvalidSlice(byte[] bytes, int index, int size) throws Exception { try { UNSAFE_PROCESSOR.decodeUtf8(bytes, index, size); fail(); - } catch (IndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException e) { // Expected. } try { SAFE_PROCESSOR.decodeUtf8(bytes, index, size); fail(); - } catch (IndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException e) { // Expected. } @@ -246,13 +250,13 @@ public class DecodeUtf8Test extends TestCase { try { UNSAFE_PROCESSOR.decodeUtf8(direct, index, size); fail(); - } catch (IndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException e) { // Expected. } try { SAFE_PROCESSOR.decodeUtf8(direct, index, size); fail(); - } catch (IndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException e) { // Expected. } @@ -262,13 +266,13 @@ public class DecodeUtf8Test extends TestCase { try { UNSAFE_PROCESSOR.decodeUtf8(heap, index, size); fail(); - } catch (IndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException e) { // Expected. } try { SAFE_PROCESSOR.decodeUtf8(heap, index, size); fail(); - } catch (IndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException e) { // Expected. } } @@ -282,31 +286,25 @@ public class DecodeUtf8Test extends TestCase { if (size == -1) { size = bytes.length; } - assertDecode( - new String(bytes, index, size, Internal.UTF_8), + assertDecode(new String(bytes, index, size, Internal.UTF_8), UNSAFE_PROCESSOR.decodeUtf8(bytes, index, size)); - assertDecode( - new String(bytes, index, size, Internal.UTF_8), + assertDecode(new String(bytes, index, size, Internal.UTF_8), SAFE_PROCESSOR.decodeUtf8(bytes, index, size)); ByteBuffer direct = ByteBuffer.allocateDirect(bytes.length); direct.put(bytes); direct.flip(); - assertDecode( - new String(bytes, index, size, Internal.UTF_8), + assertDecode(new String(bytes, index, size, Internal.UTF_8), UNSAFE_PROCESSOR.decodeUtf8(direct, index, size)); - assertDecode( - new String(bytes, index, size, Internal.UTF_8), + assertDecode(new String(bytes, index, size, Internal.UTF_8), SAFE_PROCESSOR.decodeUtf8(direct, index, size)); ByteBuffer heap = ByteBuffer.allocate(bytes.length); heap.put(bytes); heap.flip(); - assertDecode( - new String(bytes, index, size, Internal.UTF_8), + assertDecode(new String(bytes, index, size, Internal.UTF_8), UNSAFE_PROCESSOR.decodeUtf8(heap, index, size)); - assertDecode( - new String(bytes, index, size, Internal.UTF_8), + assertDecode(new String(bytes, index, size, Internal.UTF_8), SAFE_PROCESSOR.decodeUtf8(heap, index, size)); } @@ -323,4 +321,5 @@ public class DecodeUtf8Test extends TestCase { } return codepoints; } + } diff --git a/java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java b/java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java index 1add511205274720eeab758964c272da6bc1a133..2addde8428301f32217ae3046fd37cbe25c9adf7 100644 --- a/java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java +++ b/java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java @@ -1,58 +1,76 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertWithMessage; - import protobuf_unittest.UnittestProto.TestDeprecatedFields; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Method; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Test field deprecation. */ -@RunWith(JUnit4.class) -public class DeprecatedFieldTest { - private final String[] deprecatedGetterNames = {"hasDeprecatedInt32", "getDeprecatedInt32"}; +/** + * Test field deprecation + * + * @author birdo@google.com (Roberto Scaramuzzi) + */ +public class DeprecatedFieldTest extends TestCase { + private String[] deprecatedGetterNames = {"hasDeprecatedInt32", "getDeprecatedInt32"}; - private final String[] deprecatedBuilderGetterNames = { + private String[] deprecatedBuilderGetterNames = { "hasDeprecatedInt32", "getDeprecatedInt32", "clearDeprecatedInt32" }; - private final String[] deprecatedBuilderSetterNames = {"setDeprecatedInt32"}; + private String[] deprecatedBuilderSetterNames = {"setDeprecatedInt32"}; - @Test public void testDeprecatedField() throws Exception { Class deprecatedFields = TestDeprecatedFields.class; Class deprecatedFieldsBuilder = TestDeprecatedFields.Builder.class; for (String name : deprecatedGetterNames) { Method method = deprecatedFields.getMethod(name); - assertWithMessage("Method %s should be deprecated", name).that(isDeprecated(method)).isTrue(); + assertTrue("Method " + name + " should be deprecated", isDeprecated(method)); } for (String name : deprecatedBuilderGetterNames) { Method method = deprecatedFieldsBuilder.getMethod(name); - assertWithMessage("Method %s should be deprecated", name).that(isDeprecated(method)).isTrue(); + assertTrue("Method " + name + " should be deprecated", isDeprecated(method)); } for (String name : deprecatedBuilderSetterNames) { Method method = deprecatedFieldsBuilder.getMethod(name, int.class); - assertWithMessage("Method %s should be deprecated", name).that(isDeprecated(method)).isTrue(); + assertTrue("Method " + name + " should be deprecated", isDeprecated(method)); } } - @Test public void testDeprecatedFieldInOneof() throws Exception { Class oneofCase = TestDeprecatedFields.OneofFieldsCase.class; String name = "DEPRECATED_INT32_IN_ONEOF"; java.lang.reflect.Field enumValue = oneofCase.getField(name); - assertWithMessage("Enum value %s should be deprecated.", name) - .that(isDeprecated(enumValue)) - .isTrue(); + assertTrue("Enum value " + name + " should be deprecated.", isDeprecated(enumValue)); } private boolean isDeprecated(AnnotatedElement annotated) { diff --git a/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java b/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java index aae4a4dd13889309a353fe9b41ee5674ba592503..74d42c67022dbb2137bab647c59c088593a0a778 100644 --- a/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java +++ b/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java @@ -1,22 +1,45 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; +import static junit.framework.TestCase.assertFalse; +import static junit.framework.TestCase.assertTrue; +import protobuf_unittest.NestedExtension; +import protobuf_unittest.NonNestedExtension; import com.google.protobuf.DescriptorProtos.DescriptorProto; -import com.google.protobuf.DescriptorProtos.Edition; import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; import com.google.protobuf.DescriptorProtos.EnumValueDescriptorProto; import com.google.protobuf.DescriptorProtos.FieldDescriptorProto; import com.google.protobuf.DescriptorProtos.FileDescriptorProto; -import com.google.protobuf.DescriptorProtos.FileOptions; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.DescriptorValidationException; import com.google.protobuf.Descriptors.EnumDescriptor; @@ -40,21 +63,19 @@ import protobuf_unittest.UnittestProto.TestExtremeDefaultValues; import protobuf_unittest.UnittestProto.TestJsonName; import protobuf_unittest.UnittestProto.TestMultipleExtensionRanges; import protobuf_unittest.UnittestProto.TestRequired; -import protobuf_unittest.UnittestProto.TestReservedEnumFields; import protobuf_unittest.UnittestProto.TestReservedFields; import protobuf_unittest.UnittestProto.TestService; -import protobuf_unittest.UnittestRetention; +import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import protobuf_unittest.NestedExtension; -import protobuf_unittest.NonNestedExtension; +import junit.framework.TestCase; -/** Unit test for {@link Descriptors}. */ -@RunWith(JUnit4.class) -public class DescriptorsTest { +/** + * Unit test for {@link Descriptors}. + * + * @author kenton@google.com Kenton Varda + */ +public class DescriptorsTest extends TestCase { // Regression test for bug where referencing a FieldDescriptor.Type value // before a FieldDescriptorProto.Type value would yield a @@ -62,160 +83,110 @@ public class DescriptorsTest { @SuppressWarnings("unused") private static final Object STATIC_INIT_TEST = FieldDescriptor.Type.BOOL; - @Test public void testFieldTypeEnumMapping() throws Exception { - assertThat(FieldDescriptor.Type.values()).hasLength(FieldDescriptorProto.Type.values().length); + assertEquals(FieldDescriptor.Type.values().length, FieldDescriptorProto.Type.values().length); for (FieldDescriptor.Type type : FieldDescriptor.Type.values()) { FieldDescriptorProto.Type protoType = type.toProto(); - assertThat(protoType.name()).isEqualTo("TYPE_" + type.name()); - assertThat(FieldDescriptor.Type.valueOf(protoType)).isEqualTo(type); + assertEquals("TYPE_" + type.name(), protoType.name()); + assertEquals(type, FieldDescriptor.Type.valueOf(protoType)); } } - @Test public void testFileDescriptor() throws Exception { FileDescriptor file = UnittestProto.getDescriptor(); - assertThat(file.getName()).isEqualTo("google/protobuf/unittest.proto"); - assertThat(file.getSyntax()).isEqualTo(Descriptors.FileDescriptor.Syntax.PROTO2); - assertThat(file.getPackage()).isEqualTo("protobuf_unittest"); - assertThat(file.getOptions().getJavaOuterClassname()).isEqualTo("UnittestProto"); - assertThat(file.toProto().getName()).isEqualTo("google/protobuf/unittest.proto"); + assertEquals("google/protobuf/unittest.proto", file.getName()); + assertEquals("protobuf_unittest", file.getPackage()); - assertThat(file.getDependencies()).containsExactly(UnittestImport.getDescriptor()); + assertEquals("UnittestProto", file.getOptions().getJavaOuterClassname()); + assertEquals("google/protobuf/unittest.proto", file.toProto().getName()); + + assertEquals(Arrays.asList(UnittestImport.getDescriptor()), file.getDependencies()); Descriptor messageType = TestAllTypes.getDescriptor(); - assertThat(file.getMessageTypes().get(0)).isEqualTo(messageType); - assertThat(file.findMessageTypeByName("TestAllTypes")).isEqualTo(messageType); - assertThat(file.findMessageTypeByName("NoSuchType")).isNull(); - assertThat(file.findMessageTypeByName("protobuf_unittest.TestAllTypes")).isNull(); + assertEquals(messageType, file.getMessageTypes().get(0)); + assertEquals(messageType, file.findMessageTypeByName("TestAllTypes")); + assertNull(file.findMessageTypeByName("NoSuchType")); + assertNull(file.findMessageTypeByName("protobuf_unittest.TestAllTypes")); for (int i = 0; i < file.getMessageTypes().size(); i++) { - assertThat(file.getMessageTypes().get(i).getIndex()).isEqualTo(i); + assertEquals(i, file.getMessageTypes().get(i).getIndex()); } EnumDescriptor enumType = ForeignEnum.getDescriptor(); - assertThat(file.getEnumTypes().get(0)).isEqualTo(enumType); - assertThat(file.findEnumTypeByName("ForeignEnum")).isEqualTo(enumType); - assertThat(file.findEnumTypeByName("NoSuchType")).isNull(); - assertThat(file.findEnumTypeByName("protobuf_unittest.ForeignEnum")).isNull(); - assertThat(UnittestImport.getDescriptor().getEnumTypes()) - .containsExactly(ImportEnum.getDescriptor(), ImportEnumForMap.getDescriptor()) - .inOrder(); + assertEquals(enumType, file.getEnumTypes().get(0)); + assertEquals(enumType, file.findEnumTypeByName("ForeignEnum")); + assertNull(file.findEnumTypeByName("NoSuchType")); + assertNull(file.findEnumTypeByName("protobuf_unittest.ForeignEnum")); + assertEquals( + Arrays.asList(ImportEnum.getDescriptor(), ImportEnumForMap.getDescriptor()), + UnittestImport.getDescriptor().getEnumTypes()); for (int i = 0; i < file.getEnumTypes().size(); i++) { - assertThat(file.getEnumTypes().get(i).getIndex()).isEqualTo(i); + assertEquals(i, file.getEnumTypes().get(i).getIndex()); } ServiceDescriptor service = TestService.getDescriptor(); - assertThat(file.getServices().get(0)).isEqualTo(service); - assertThat(file.findServiceByName("TestService")).isEqualTo(service); - assertThat(file.findServiceByName("NoSuchType")).isNull(); - assertThat(file.findServiceByName("protobuf_unittest.TestService")).isNull(); - assertThat(UnittestImport.getDescriptor().getServices()).isEqualTo(Collections.emptyList()); + assertEquals(service, file.getServices().get(0)); + assertEquals(service, file.findServiceByName("TestService")); + assertNull(file.findServiceByName("NoSuchType")); + assertNull(file.findServiceByName("protobuf_unittest.TestService")); + assertEquals(Collections.emptyList(), UnittestImport.getDescriptor().getServices()); for (int i = 0; i < file.getServices().size(); i++) { - assertThat(file.getServices().get(i).getIndex()).isEqualTo(i); + assertEquals(i, file.getServices().get(i).getIndex()); } FieldDescriptor extension = UnittestProto.optionalInt32Extension.getDescriptor(); - assertThat(file.getExtensions().get(0)).isEqualTo(extension); - assertThat(file.findExtensionByName("optional_int32_extension")).isEqualTo(extension); - assertThat(file.findExtensionByName("no_such_ext")).isNull(); - assertThat(file.findExtensionByName("protobuf_unittest.optional_int32_extension")).isNull(); - assertThat(UnittestImport.getDescriptor().getExtensions()).isEqualTo(Collections.emptyList()); + assertEquals(extension, file.getExtensions().get(0)); + assertEquals(extension, file.findExtensionByName("optional_int32_extension")); + assertNull(file.findExtensionByName("no_such_ext")); + assertNull(file.findExtensionByName("protobuf_unittest.optional_int32_extension")); + assertEquals(Collections.emptyList(), UnittestImport.getDescriptor().getExtensions()); for (int i = 0; i < file.getExtensions().size(); i++) { - assertThat(file.getExtensions().get(i).getIndex()).isEqualTo(i); + assertEquals(i, file.getExtensions().get(i).getIndex()); } } - @Test - public void testFileDescriptorGetSyntax() throws Exception { - FileDescriptorProto proto2 = FileDescriptorProto.newBuilder().setSyntax("proto2").build(); - FileDescriptor file2 = Descriptors.FileDescriptor.buildFrom(proto2, new FileDescriptor[0]); - assertThat(file2.getSyntax()).isEqualTo(Descriptors.FileDescriptor.Syntax.PROTO2); - - FileDescriptorProto proto3 = FileDescriptorProto.newBuilder().setSyntax("proto3").build(); - FileDescriptor file3 = Descriptors.FileDescriptor.buildFrom(proto3, new FileDescriptor[0]); - assertThat(file3.getSyntax()).isEqualTo(Descriptors.FileDescriptor.Syntax.PROTO3); - } - - @Test - public void testFileDescriptorCopyHeadingTo() throws Exception { - FileDescriptorProto.Builder protoBuilder = - FileDescriptorProto.newBuilder() - .setName("foo.proto") - .setPackage("foo.bar.baz") - .setSyntax("proto2") - .setOptions(FileOptions.newBuilder().setJavaPackage("foo.bar.baz").build()) - // Won't be copied. - .addMessageType(DescriptorProto.newBuilder().setName("Foo").build()); - FileDescriptor file2 = - Descriptors.FileDescriptor.buildFrom(protoBuilder.build(), new FileDescriptor[0]); - FileDescriptorProto.Builder protoBuilder2 = FileDescriptorProto.newBuilder(); - file2.copyHeadingTo(protoBuilder2); - FileDescriptorProto toProto2 = protoBuilder2.build(); - assertThat(toProto2.getName()).isEqualTo("foo.proto"); - assertThat(toProto2.getPackage()).isEqualTo("foo.bar.baz"); - assertThat(toProto2.getSyntax()).isEqualTo("proto2"); - assertThat(toProto2.getOptions().getJavaPackage()).isEqualTo("foo.bar.baz"); - assertThat(toProto2.getMessageTypeList()).isEmpty(); - - protoBuilder.setSyntax("proto3"); - FileDescriptor file3 = - Descriptors.FileDescriptor.buildFrom(protoBuilder.build(), new FileDescriptor[0]); - FileDescriptorProto.Builder protoBuilder3 = FileDescriptorProto.newBuilder(); - file3.copyHeadingTo(protoBuilder3); - FileDescriptorProto toProto3 = protoBuilder3.build(); - assertThat(toProto3.getName()).isEqualTo("foo.proto"); - assertThat(toProto3.getPackage()).isEqualTo("foo.bar.baz"); - assertThat(toProto3.getSyntax()).isEqualTo("proto3"); - assertThat(toProto2.getOptions().getJavaPackage()).isEqualTo("foo.bar.baz"); - assertThat(toProto3.getMessageTypeList()).isEmpty(); - } - - @Test public void testDescriptor() throws Exception { Descriptor messageType = TestAllTypes.getDescriptor(); Descriptor nestedType = TestAllTypes.NestedMessage.getDescriptor(); - assertThat(messageType.getName()).isEqualTo("TestAllTypes"); - assertThat(messageType.getFullName()).isEqualTo("protobuf_unittest.TestAllTypes"); - assertThat(messageType.getFile()).isEqualTo(UnittestProto.getDescriptor()); - assertThat(messageType.getContainingType()).isNull(); - assertThat(messageType.getOptions()) - .isEqualTo(DescriptorProtos.MessageOptions.getDefaultInstance()); - assertThat(messageType.toProto().getName()).isEqualTo("TestAllTypes"); + assertEquals("TestAllTypes", messageType.getName()); + assertEquals("protobuf_unittest.TestAllTypes", messageType.getFullName()); + assertEquals(UnittestProto.getDescriptor(), messageType.getFile()); + assertNull(messageType.getContainingType()); + assertEquals(DescriptorProtos.MessageOptions.getDefaultInstance(), messageType.getOptions()); + assertEquals("TestAllTypes", messageType.toProto().getName()); - assertThat(nestedType.getName()).isEqualTo("NestedMessage"); - assertThat(nestedType.getFullName()).isEqualTo("protobuf_unittest.TestAllTypes.NestedMessage"); - assertThat(nestedType.getFile()).isEqualTo(UnittestProto.getDescriptor()); - assertThat(nestedType.getContainingType()).isEqualTo(messageType); + assertEquals("NestedMessage", nestedType.getName()); + assertEquals("protobuf_unittest.TestAllTypes.NestedMessage", nestedType.getFullName()); + assertEquals(UnittestProto.getDescriptor(), nestedType.getFile()); + assertEquals(messageType, nestedType.getContainingType()); FieldDescriptor field = messageType.getFields().get(0); - assertThat(field.getName()).isEqualTo("optional_int32"); - assertThat(messageType.findFieldByName("optional_int32")).isEqualTo(field); - assertThat(messageType.findFieldByName("no_such_field")).isNull(); - assertThat(messageType.findFieldByNumber(1)).isEqualTo(field); - assertThat(messageType.findFieldByNumber(571283)).isNull(); + assertEquals("optional_int32", field.getName()); + assertEquals(field, messageType.findFieldByName("optional_int32")); + assertNull(messageType.findFieldByName("no_such_field")); + assertEquals(field, messageType.findFieldByNumber(1)); + assertNull(messageType.findFieldByNumber(571283)); for (int i = 0; i < messageType.getFields().size(); i++) { - assertThat(messageType.getFields().get(i).getIndex()).isEqualTo(i); + assertEquals(i, messageType.getFields().get(i).getIndex()); } - assertThat(messageType.getNestedTypes().get(0)).isEqualTo(nestedType); - assertThat(messageType.findNestedTypeByName("NestedMessage")).isEqualTo(nestedType); - assertThat(messageType.findNestedTypeByName("NoSuchType")).isNull(); + assertEquals(nestedType, messageType.getNestedTypes().get(0)); + assertEquals(nestedType, messageType.findNestedTypeByName("NestedMessage")); + assertNull(messageType.findNestedTypeByName("NoSuchType")); for (int i = 0; i < messageType.getNestedTypes().size(); i++) { - assertThat(messageType.getNestedTypes().get(i).getIndex()).isEqualTo(i); + assertEquals(i, messageType.getNestedTypes().get(i).getIndex()); } EnumDescriptor enumType = TestAllTypes.NestedEnum.getDescriptor(); - assertThat(messageType.getEnumTypes().get(0)).isEqualTo(enumType); - assertThat(messageType.findEnumTypeByName("NestedEnum")).isEqualTo(enumType); - assertThat(messageType.findEnumTypeByName("NoSuchType")).isNull(); + assertEquals(enumType, messageType.getEnumTypes().get(0)); + assertEquals(enumType, messageType.findEnumTypeByName("NestedEnum")); + assertNull(messageType.findEnumTypeByName("NoSuchType")); for (int i = 0; i < messageType.getEnumTypes().size(); i++) { - assertThat(messageType.getEnumTypes().get(i).getIndex()).isEqualTo(i); + assertEquals(i, messageType.getEnumTypes().get(i).getIndex()); } } - @Test public void testFieldDescriptor() throws Exception { Descriptor messageType = TestAllTypes.getDescriptor(); FieldDescriptor primitiveField = messageType.findFieldByName("optional_int32"); @@ -225,276 +196,143 @@ public class DescriptorsTest { FieldDescriptor extension = UnittestProto.optionalInt32Extension.getDescriptor(); FieldDescriptor nestedExtension = TestRequired.single.getDescriptor(); - assertThat(primitiveField.getName()).isEqualTo("optional_int32"); - assertThat(primitiveField.getFullName()) - .isEqualTo("protobuf_unittest.TestAllTypes.optional_int32"); - assertThat(primitiveField.getNumber()).isEqualTo(1); - assertThat(primitiveField.getContainingType()).isEqualTo(messageType); - assertThat(primitiveField.getFile()).isEqualTo(UnittestProto.getDescriptor()); - assertThat(primitiveField.getType()).isEqualTo(FieldDescriptor.Type.INT32); - assertThat(primitiveField.getJavaType()).isEqualTo(FieldDescriptor.JavaType.INT); - assertThat(primitiveField.getOptions()) - .isEqualTo(DescriptorProtos.FieldOptions.getDefaultInstance()); - assertThat(primitiveField.isExtension()).isFalse(); - assertThat(primitiveField.toProto().getName()).isEqualTo("optional_int32"); - - assertThat(enumField.getName()).isEqualTo("optional_nested_enum"); - assertThat(enumField.getType()).isEqualTo(FieldDescriptor.Type.ENUM); - assertThat(enumField.getJavaType()).isEqualTo(FieldDescriptor.JavaType.ENUM); - assertThat(enumField.getEnumType()).isEqualTo(TestAllTypes.NestedEnum.getDescriptor()); - - assertThat(messageField.getName()).isEqualTo("optional_foreign_message"); - assertThat(messageField.getType()).isEqualTo(FieldDescriptor.Type.MESSAGE); - assertThat(messageField.getJavaType()).isEqualTo(FieldDescriptor.JavaType.MESSAGE); - assertThat(messageField.getMessageType()).isEqualTo(ForeignMessage.getDescriptor()); - - assertThat(cordField.getName()).isEqualTo("optional_cord"); - assertThat(cordField.getType()).isEqualTo(FieldDescriptor.Type.STRING); - assertThat(cordField.getJavaType()).isEqualTo(FieldDescriptor.JavaType.STRING); - assertThat(cordField.getOptions().getCtype()) - .isEqualTo(DescriptorProtos.FieldOptions.CType.CORD); - - assertThat(extension.getName()).isEqualTo("optional_int32_extension"); - assertThat(extension.getFullName()).isEqualTo("protobuf_unittest.optional_int32_extension"); - assertThat(extension.getNumber()).isEqualTo(1); - assertThat(extension.getContainingType()).isEqualTo(TestAllExtensions.getDescriptor()); - assertThat(extension.getFile()).isEqualTo(UnittestProto.getDescriptor()); - assertThat(extension.getType()).isEqualTo(FieldDescriptor.Type.INT32); - assertThat(extension.getJavaType()).isEqualTo(FieldDescriptor.JavaType.INT); - assertThat(extension.getOptions()) - .isEqualTo(DescriptorProtos.FieldOptions.getDefaultInstance()); - assertThat(extension.isExtension()).isTrue(); - assertThat(extension.getExtensionScope()).isNull(); - assertThat(extension.toProto().getName()).isEqualTo("optional_int32_extension"); - - assertThat(nestedExtension.getName()).isEqualTo("single"); - assertThat(nestedExtension.getFullName()).isEqualTo("protobuf_unittest.TestRequired.single"); - assertThat(nestedExtension.getExtensionScope()).isEqualTo(TestRequired.getDescriptor()); + assertEquals("optional_int32", primitiveField.getName()); + assertEquals("protobuf_unittest.TestAllTypes.optional_int32", primitiveField.getFullName()); + assertEquals(1, primitiveField.getNumber()); + assertEquals(messageType, primitiveField.getContainingType()); + assertEquals(UnittestProto.getDescriptor(), primitiveField.getFile()); + assertEquals(FieldDescriptor.Type.INT32, primitiveField.getType()); + assertEquals(FieldDescriptor.JavaType.INT, primitiveField.getJavaType()); + assertEquals(DescriptorProtos.FieldOptions.getDefaultInstance(), primitiveField.getOptions()); + assertFalse(primitiveField.isExtension()); + assertEquals("optional_int32", primitiveField.toProto().getName()); + + assertEquals("optional_nested_enum", enumField.getName()); + assertEquals(FieldDescriptor.Type.ENUM, enumField.getType()); + assertEquals(FieldDescriptor.JavaType.ENUM, enumField.getJavaType()); + assertEquals(TestAllTypes.NestedEnum.getDescriptor(), enumField.getEnumType()); + + assertEquals("optional_foreign_message", messageField.getName()); + assertEquals(FieldDescriptor.Type.MESSAGE, messageField.getType()); + assertEquals(FieldDescriptor.JavaType.MESSAGE, messageField.getJavaType()); + assertEquals(ForeignMessage.getDescriptor(), messageField.getMessageType()); + + assertEquals("optional_cord", cordField.getName()); + assertEquals(FieldDescriptor.Type.STRING, cordField.getType()); + assertEquals(FieldDescriptor.JavaType.STRING, cordField.getJavaType()); + assertEquals(DescriptorProtos.FieldOptions.CType.CORD, cordField.getOptions().getCtype()); + + assertEquals("optional_int32_extension", extension.getName()); + assertEquals("protobuf_unittest.optional_int32_extension", extension.getFullName()); + assertEquals(1, extension.getNumber()); + assertEquals(TestAllExtensions.getDescriptor(), extension.getContainingType()); + assertEquals(UnittestProto.getDescriptor(), extension.getFile()); + assertEquals(FieldDescriptor.Type.INT32, extension.getType()); + assertEquals(FieldDescriptor.JavaType.INT, extension.getJavaType()); + assertEquals(DescriptorProtos.FieldOptions.getDefaultInstance(), extension.getOptions()); + assertTrue(extension.isExtension()); + assertEquals(null, extension.getExtensionScope()); + assertEquals("optional_int32_extension", extension.toProto().getName()); + + assertEquals("single", nestedExtension.getName()); + assertEquals("protobuf_unittest.TestRequired.single", nestedExtension.getFullName()); + assertEquals(TestRequired.getDescriptor(), nestedExtension.getExtensionScope()); } - @Test public void testFieldDescriptorLabel() throws Exception { FieldDescriptor requiredField = TestRequired.getDescriptor().findFieldByName("a"); FieldDescriptor optionalField = TestAllTypes.getDescriptor().findFieldByName("optional_int32"); FieldDescriptor repeatedField = TestAllTypes.getDescriptor().findFieldByName("repeated_int32"); - assertThat(requiredField.isRequired()).isTrue(); - assertThat(requiredField.isRepeated()).isFalse(); - assertThat(optionalField.isRequired()).isFalse(); - assertThat(optionalField.isRepeated()).isFalse(); - assertThat(repeatedField.isRequired()).isFalse(); - assertThat(repeatedField.isRepeated()).isTrue(); + assertTrue(requiredField.isRequired()); + assertFalse(requiredField.isRepeated()); + assertFalse(optionalField.isRequired()); + assertFalse(optionalField.isRepeated()); + assertFalse(repeatedField.isRequired()); + assertTrue(repeatedField.isRepeated()); } - @Test public void testFieldDescriptorJsonName() throws Exception { FieldDescriptor requiredField = TestRequired.getDescriptor().findFieldByName("a"); FieldDescriptor optionalField = TestAllTypes.getDescriptor().findFieldByName("optional_int32"); FieldDescriptor repeatedField = TestAllTypes.getDescriptor().findFieldByName("repeated_int32"); - assertThat(requiredField.getJsonName()).isEqualTo("a"); - assertThat(optionalField.getJsonName()).isEqualTo("optionalInt32"); - assertThat(repeatedField.getJsonName()).isEqualTo("repeatedInt32"); + assertEquals("a", requiredField.getJsonName()); + assertEquals("optionalInt32", optionalField.getJsonName()); + assertEquals("repeatedInt32", repeatedField.getJsonName()); } - @Test public void testFieldDescriptorDefault() throws Exception { Descriptor d = TestAllTypes.getDescriptor(); - assertThat(d.findFieldByName("optional_int32").hasDefaultValue()).isFalse(); - assertThat(d.findFieldByName("optional_int32").getDefaultValue()).isEqualTo(0); - assertThat(d.findFieldByName("default_int32").hasDefaultValue()).isTrue(); - assertThat(d.findFieldByName("default_int32").getDefaultValue()).isEqualTo(41); + assertFalse(d.findFieldByName("optional_int32").hasDefaultValue()); + assertEquals(0, d.findFieldByName("optional_int32").getDefaultValue()); + assertTrue(d.findFieldByName("default_int32").hasDefaultValue()); + assertEquals(41, d.findFieldByName("default_int32").getDefaultValue()); d = TestExtremeDefaultValues.getDescriptor(); - assertThat(d.findFieldByName("escaped_bytes").getDefaultValue()) - .isEqualTo( - ByteString.copyFrom( - "\0\001\007\b\f\n\r\t\013\\\'\"\u00fe".getBytes(Internal.ISO_8859_1))); - assertThat(d.findFieldByName("large_uint32").getDefaultValue()).isEqualTo(-1); - assertThat(d.findFieldByName("large_uint64").getDefaultValue()).isEqualTo(-1L); - } - - @Test - public void testFieldDescriptorLegacyEnumFieldTreatedAsClosed() throws Exception { - // Make an open enum definition. - FileDescriptorProto openEnumFile = - FileDescriptorProto.newBuilder() - .setName("open_enum.proto") - .setSyntax("proto3") - .addEnumType( - EnumDescriptorProto.newBuilder() - .setName("TestEnumOpen") - .addValue( - EnumValueDescriptorProto.newBuilder() - .setName("TestEnumOpen_VALUE0") - .setNumber(0) - .build()) - .build()) - .build(); - FileDescriptor openFileDescriptor = - Descriptors.FileDescriptor.buildFrom(openEnumFile, new FileDescriptor[0]); - EnumDescriptor openEnum = openFileDescriptor.getEnumTypes().get(0); - assertThat(openEnum.isClosed()).isFalse(); - - // Create a message that treats enum fields as closed. - FileDescriptorProto closedEnumFile = - FileDescriptorProto.newBuilder() - .setName("closed_enum_field.proto") - .addDependency("open_enum.proto") - .setSyntax("proto2") - .addEnumType( - EnumDescriptorProto.newBuilder() - .setName("TestEnum") - .addValue( - EnumValueDescriptorProto.newBuilder() - .setName("TestEnum_VALUE0") - .setNumber(0) - .build()) - .build()) - .addMessageType( - DescriptorProto.newBuilder() - .setName("TestClosedEnumField") - .addField( - FieldDescriptorProto.newBuilder() - .setName("int_field") - .setNumber(1) - .setType(FieldDescriptorProto.Type.TYPE_INT32) - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .build()) - .addField( - FieldDescriptorProto.newBuilder() - .setName("open_enum") - .setNumber(2) - .setType(FieldDescriptorProto.Type.TYPE_ENUM) - .setTypeName("TestEnumOpen") - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .build()) - .addField( - FieldDescriptorProto.newBuilder() - .setName("closed_enum") - .setNumber(3) - .setType(FieldDescriptorProto.Type.TYPE_ENUM) - .setTypeName("TestEnum") - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .build()) - .build()) - .build(); - Descriptor closedMessage = - Descriptors.FileDescriptor.buildFrom( - closedEnumFile, new FileDescriptor[] {openFileDescriptor}) - .getMessageTypes() - .get(0); - assertThat(closedMessage.findFieldByName("int_field").legacyEnumFieldTreatedAsClosed()) - .isFalse(); - - assertThat(closedMessage.findFieldByName("closed_enum").legacyEnumFieldTreatedAsClosed()) - .isTrue(); - assertThat(closedMessage.findFieldByName("open_enum").legacyEnumFieldTreatedAsClosed()) - .isTrue(); + assertEquals( + ByteString.copyFrom("\0\001\007\b\f\n\r\t\013\\\'\"\u00fe".getBytes(Internal.ISO_8859_1)), + d.findFieldByName("escaped_bytes").getDefaultValue()); + assertEquals(-1, d.findFieldByName("large_uint32").getDefaultValue()); + assertEquals(-1L, d.findFieldByName("large_uint64").getDefaultValue()); } - @Test - public void testFieldDescriptorLegacyEnumFieldTreatedAsOpen() throws Exception { - // Make an open enum definition and message that treats enum fields as open. - FileDescriptorProto openEnumFile = - FileDescriptorProto.newBuilder() - .setName("open_enum.proto") - .setSyntax("proto3") - .addEnumType( - EnumDescriptorProto.newBuilder() - .setName("TestEnumOpen") - .addValue( - EnumValueDescriptorProto.newBuilder() - .setName("TestEnumOpen_VALUE0") - .setNumber(0) - .build()) - .build()) - .addMessageType( - DescriptorProto.newBuilder() - .setName("TestOpenEnumField") - .addField( - FieldDescriptorProto.newBuilder() - .setName("int_field") - .setNumber(1) - .setType(FieldDescriptorProto.Type.TYPE_INT32) - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .build()) - .addField( - FieldDescriptorProto.newBuilder() - .setName("open_enum") - .setNumber(2) - .setType(FieldDescriptorProto.Type.TYPE_ENUM) - .setTypeName("TestEnumOpen") - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .build()) - .build()) - .build(); - FileDescriptor openEnumFileDescriptor = - Descriptors.FileDescriptor.buildFrom(openEnumFile, new FileDescriptor[0]); - Descriptor openMessage = openEnumFileDescriptor.getMessageTypes().get(0); - EnumDescriptor openEnum = openEnumFileDescriptor.findEnumTypeByName("TestEnumOpen"); - assertThat(openEnum.isClosed()).isFalse(); - assertThat(openMessage.findFieldByName("int_field").legacyEnumFieldTreatedAsClosed()).isFalse(); - assertThat(openMessage.findFieldByName("open_enum").legacyEnumFieldTreatedAsClosed()).isFalse(); - } - - @Test public void testEnumDescriptor() throws Exception { EnumDescriptor enumType = ForeignEnum.getDescriptor(); EnumDescriptor nestedType = TestAllTypes.NestedEnum.getDescriptor(); - assertThat(enumType.getName()).isEqualTo("ForeignEnum"); - assertThat(enumType.getFullName()).isEqualTo("protobuf_unittest.ForeignEnum"); - assertThat(enumType.getFile()).isEqualTo(UnittestProto.getDescriptor()); - assertThat(enumType.isClosed()).isTrue(); - assertThat(enumType.getContainingType()).isNull(); - assertThat(enumType.getOptions()).isEqualTo(DescriptorProtos.EnumOptions.getDefaultInstance()); + assertEquals("ForeignEnum", enumType.getName()); + assertEquals("protobuf_unittest.ForeignEnum", enumType.getFullName()); + assertEquals(UnittestProto.getDescriptor(), enumType.getFile()); + assertNull(enumType.getContainingType()); + assertEquals(DescriptorProtos.EnumOptions.getDefaultInstance(), enumType.getOptions()); - assertThat(nestedType.getName()).isEqualTo("NestedEnum"); - assertThat(nestedType.getFullName()).isEqualTo("protobuf_unittest.TestAllTypes.NestedEnum"); - assertThat(nestedType.getFile()).isEqualTo(UnittestProto.getDescriptor()); - assertThat(nestedType.getContainingType()).isEqualTo(TestAllTypes.getDescriptor()); + assertEquals("NestedEnum", nestedType.getName()); + assertEquals("protobuf_unittest.TestAllTypes.NestedEnum", nestedType.getFullName()); + assertEquals(UnittestProto.getDescriptor(), nestedType.getFile()); + assertEquals(TestAllTypes.getDescriptor(), nestedType.getContainingType()); EnumValueDescriptor value = ForeignEnum.FOREIGN_FOO.getValueDescriptor(); - assertThat(enumType.getValues().get(0)).isEqualTo(value); - assertThat(value.getName()).isEqualTo("FOREIGN_FOO"); - assertThat(value.toString()).isEqualTo("FOREIGN_FOO"); - assertThat(value.getNumber()).isEqualTo(4); - assertThat(enumType.findValueByName("FOREIGN_FOO")).isEqualTo(value); - assertThat(enumType.findValueByNumber(4)).isEqualTo(value); - assertThat(enumType.findValueByName("NO_SUCH_VALUE")).isNull(); + assertEquals(value, enumType.getValues().get(0)); + assertEquals("FOREIGN_FOO", value.getName()); + assertEquals("FOREIGN_FOO", value.toString()); + assertEquals(4, value.getNumber()); + assertEquals(value, enumType.findValueByName("FOREIGN_FOO")); + assertEquals(value, enumType.findValueByNumber(4)); + assertNull(enumType.findValueByName("NO_SUCH_VALUE")); for (int i = 0; i < enumType.getValues().size(); i++) { - assertThat(enumType.getValues().get(i).getIndex()).isEqualTo(i); + assertEquals(i, enumType.getValues().get(i).getIndex()); } } - @Test public void testServiceDescriptor() throws Exception { ServiceDescriptor service = TestService.getDescriptor(); - assertThat(service.getName()).isEqualTo("TestService"); - assertThat(service.getFullName()).isEqualTo("protobuf_unittest.TestService"); - assertThat(service.getFile()).isEqualTo(UnittestProto.getDescriptor()); + assertEquals("TestService", service.getName()); + assertEquals("protobuf_unittest.TestService", service.getFullName()); + assertEquals(UnittestProto.getDescriptor(), service.getFile()); + MethodDescriptor fooMethod = service.getMethods().get(0); - assertThat(fooMethod.getName()).isEqualTo("Foo"); - assertThat(fooMethod.getInputType()).isEqualTo(UnittestProto.FooRequest.getDescriptor()); - assertThat(fooMethod.getOutputType()).isEqualTo(UnittestProto.FooResponse.getDescriptor()); - assertThat(service.findMethodByName("Foo")).isEqualTo(fooMethod); + assertEquals("Foo", fooMethod.getName()); + assertEquals(UnittestProto.FooRequest.getDescriptor(), fooMethod.getInputType()); + assertEquals(UnittestProto.FooResponse.getDescriptor(), fooMethod.getOutputType()); + assertEquals(fooMethod, service.findMethodByName("Foo")); MethodDescriptor barMethod = service.getMethods().get(1); - assertThat(barMethod.getName()).isEqualTo("Bar"); - assertThat(barMethod.getInputType()).isEqualTo(UnittestProto.BarRequest.getDescriptor()); - assertThat(barMethod.getOutputType()).isEqualTo(UnittestProto.BarResponse.getDescriptor()); - assertThat(service.findMethodByName("Bar")).isEqualTo(barMethod); + assertEquals("Bar", barMethod.getName()); + assertEquals(UnittestProto.BarRequest.getDescriptor(), barMethod.getInputType()); + assertEquals(UnittestProto.BarResponse.getDescriptor(), barMethod.getOutputType()); + assertEquals(barMethod, service.findMethodByName("Bar")); - assertThat(service.findMethodByName("NoSuchMethod")).isNull(); + + assertNull(service.findMethodByName("NoSuchMethod")); for (int i = 0; i < service.getMethods().size(); i++) { - assertThat(service.getMethods().get(i).getIndex()).isEqualTo(i); + assertEquals(i, service.getMethods().get(i).getIndex()); } } - @Test + public void testCustomOptions() throws Exception { // Get the descriptor indirectly from a dependent proto class. This is to // ensure that when a proto class is loaded, custom options defined in its @@ -504,91 +342,80 @@ public class DescriptorsTest { .findFieldByName("field") .getMessageType(); - assertThat(descriptor.getOptions().hasExtension(UnittestCustomOptions.messageOpt1)).isTrue(); - assertThat(descriptor.getOptions().getExtension(UnittestCustomOptions.messageOpt1)) - .isEqualTo(Integer.valueOf(-56)); + assertTrue(descriptor.getOptions().hasExtension(UnittestCustomOptions.messageOpt1)); + assertEquals( + Integer.valueOf(-56), + descriptor.getOptions().getExtension(UnittestCustomOptions.messageOpt1)); FieldDescriptor field = descriptor.findFieldByName("field1"); - assertThat(field).isNotNull(); + assertNotNull(field); - assertThat(field.getOptions().hasExtension(UnittestCustomOptions.fieldOpt1)).isTrue(); - assertThat(field.getOptions().getExtension(UnittestCustomOptions.fieldOpt1)) - .isEqualTo(Long.valueOf(8765432109L)); + assertTrue(field.getOptions().hasExtension(UnittestCustomOptions.fieldOpt1)); + assertEquals( + Long.valueOf(8765432109L), + field.getOptions().getExtension(UnittestCustomOptions.fieldOpt1)); OneofDescriptor oneof = descriptor.getOneofs().get(0); - assertThat(oneof).isNotNull(); + assertNotNull(oneof); - assertThat(oneof.getOptions().hasExtension(UnittestCustomOptions.oneofOpt1)).isTrue(); - assertThat(oneof.getOptions().getExtension(UnittestCustomOptions.oneofOpt1)) - .isEqualTo(Integer.valueOf(-99)); + assertTrue(oneof.getOptions().hasExtension(UnittestCustomOptions.oneofOpt1)); + assertEquals( + Integer.valueOf(-99), oneof.getOptions().getExtension(UnittestCustomOptions.oneofOpt1)); EnumDescriptor enumType = UnittestCustomOptions.TestMessageWithCustomOptions.AnEnum.getDescriptor(); - assertThat(enumType.getOptions().hasExtension(UnittestCustomOptions.enumOpt1)).isTrue(); - assertThat(enumType.getOptions().getExtension(UnittestCustomOptions.enumOpt1)) - .isEqualTo(Integer.valueOf(-789)); + assertTrue(enumType.getOptions().hasExtension(UnittestCustomOptions.enumOpt1)); + assertEquals( + Integer.valueOf(-789), enumType.getOptions().getExtension(UnittestCustomOptions.enumOpt1)); ServiceDescriptor service = UnittestCustomOptions.TestServiceWithCustomOptions.getDescriptor(); - assertThat(service.getOptions().hasExtension(UnittestCustomOptions.serviceOpt1)).isTrue(); - assertThat(service.getOptions().getExtension(UnittestCustomOptions.serviceOpt1)) - .isEqualTo(Long.valueOf(-9876543210L)); + assertTrue(service.getOptions().hasExtension(UnittestCustomOptions.serviceOpt1)); + assertEquals( + Long.valueOf(-9876543210L), + service.getOptions().getExtension(UnittestCustomOptions.serviceOpt1)); MethodDescriptor method = service.findMethodByName("Foo"); - assertThat(method).isNotNull(); + assertNotNull(method); - assertThat(method.getOptions().hasExtension(UnittestCustomOptions.methodOpt1)).isTrue(); - assertThat(method.getOptions().getExtension(UnittestCustomOptions.methodOpt1)) - .isEqualTo(UnittestCustomOptions.MethodOpt1.METHODOPT1_VAL2); - } - - @Test - public void testOptionRetention() throws Exception { - // Verify that options with RETENTION_SOURCE are stripped from the - // generated descriptors. - FileOptions options = UnittestRetention.getDescriptor().getOptions(); - assertThat(options.hasExtension(UnittestRetention.plainOption)).isTrue(); - assertThat(options.hasExtension(UnittestRetention.runtimeRetentionOption)).isTrue(); - assertThat(options.hasExtension(UnittestRetention.sourceRetentionOption)).isFalse(); + assertTrue(method.getOptions().hasExtension(UnittestCustomOptions.methodOpt1)); + assertEquals( + UnittestCustomOptions.MethodOpt1.METHODOPT1_VAL2, + method.getOptions().getExtension(UnittestCustomOptions.methodOpt1)); } /** Test that the FieldDescriptor.Type enum is the same as the WireFormat.FieldType enum. */ - @Test public void testFieldTypeTablesMatch() throws Exception { FieldDescriptor.Type[] values1 = FieldDescriptor.Type.values(); WireFormat.FieldType[] values2 = WireFormat.FieldType.values(); - assertThat(values1).hasLength(values2.length); + assertEquals(values1.length, values2.length); for (int i = 0; i < values1.length; i++) { - assertThat(values1[i].toString()).isEqualTo(values2[i].toString()); + assertEquals(values1[i].toString(), values2[i].toString()); } } /** Test that the FieldDescriptor.JavaType enum is the same as the WireFormat.JavaType enum. */ - @Test public void testJavaTypeTablesMatch() throws Exception { FieldDescriptor.JavaType[] values1 = FieldDescriptor.JavaType.values(); WireFormat.JavaType[] values2 = WireFormat.JavaType.values(); - assertThat(values1).hasLength(values2.length); + assertEquals(values1.length, values2.length); for (int i = 0; i < values1.length; i++) { - assertThat(values1[i].toString()).isEqualTo(values2[i].toString()); + assertEquals(values1[i].toString(), values2[i].toString()); } } - @Test public void testEnormousDescriptor() throws Exception { // The descriptor for this file is larger than 64k, yet it did not cause // a compiler error due to an over-long string literal. - assertThat(UnittestEnormousDescriptor.getDescriptor().toProto().getSerializedSize()) - .isGreaterThan(65536); + assertTrue(UnittestEnormousDescriptor.getDescriptor().toProto().getSerializedSize() > 65536); } /** Tests that the DescriptorValidationException works as intended. */ - @Test public void testDescriptorValidatorException() throws Exception { FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() @@ -608,40 +435,14 @@ public class DescriptorsTest { .build(); try { Descriptors.FileDescriptor.buildFrom(fileDescriptorProto, new FileDescriptor[0]); - assertWithMessage("DescriptorValidationException expected").fail(); + fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { // Expected; check that the error message contains some useful hints - assertThat(e).hasMessageThat().contains("foo"); - assertThat(e).hasMessageThat().contains("Foo"); - assertThat(e).hasMessageThat().contains("invalid"); - assertThat(e).hasCauseThat().isInstanceOf(NumberFormatException.class); - assertThat(e).hasCauseThat().hasMessageThat().contains("invalid"); - } - } - - /** Tests that parsing an unknown enum throws an exception */ - @Test - public void testParseUnknownEnum() { - FieldDescriptorProto.Builder field = - FieldDescriptorProto.newBuilder() - .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) - .setTypeName("UnknownEnum") - .setType(FieldDescriptorProto.Type.TYPE_ENUM) - .setName("bar") - .setNumber(1); - DescriptorProto.Builder messageType = - DescriptorProto.newBuilder().setName("Foo").addField(field); - FileDescriptorProto fooProto = - FileDescriptorProto.newBuilder() - .setName("foo.proto") - .addDependency("bar.proto") - .addMessageType(messageType) - .build(); - try { - Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[0], true); - assertWithMessage("DescriptorValidationException expected").fail(); - } catch (DescriptorValidationException expected) { - assertThat(expected.getMessage()).contains("\"UnknownEnum\" is not an enum type."); + assertTrue(e.getMessage().indexOf("foo") != -1); + assertTrue(e.getMessage().indexOf("Foo") != -1); + assertTrue(e.getMessage().indexOf("invalid") != -1); + assertTrue(e.getCause() instanceof NumberFormatException); + assertTrue(e.getCause().getMessage().indexOf("invalid") != -1); } } @@ -649,7 +450,6 @@ public class DescriptorsTest { * Tests the translate/crosslink for an example where a message field's name and type name are the * same. */ - @Test public void testDescriptorComplexCrosslink() throws Exception { FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() @@ -681,26 +481,25 @@ public class DescriptorsTest { FileDescriptor file = Descriptors.FileDescriptor.buildFrom(fileDescriptorProto, new FileDescriptor[0]); // verify resulting descriptors - assertThat(file).isNotNull(); + assertNotNull(file); List msglist = file.getMessageTypes(); - assertThat(msglist).isNotNull(); - assertThat(msglist).hasSize(2); + assertNotNull(msglist); + assertTrue(msglist.size() == 2); boolean barFound = false; for (Descriptor desc : msglist) { if (desc.getName().equals("Bar")) { barFound = true; - assertThat(desc.getFields()).isNotNull(); + assertNotNull(desc.getFields()); List fieldlist = desc.getFields(); - assertThat(fieldlist).isNotNull(); - assertThat(fieldlist).hasSize(1); - assertThat(fieldlist.get(0).getType()).isSameInstanceAs(FieldDescriptor.Type.MESSAGE); - assertThat(fieldlist.get(0).getMessageType().getName().equals("Foo")).isTrue(); + assertNotNull(fieldlist); + assertTrue(fieldlist.size() == 1); + assertTrue(fieldlist.get(0).getType() == FieldDescriptor.Type.MESSAGE); + assertTrue(fieldlist.get(0).getMessageType().getName().equals("Foo")); } } - assertThat(barFound).isTrue(); + assertTrue(barFound); } - @Test public void testDependencyOrder() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder().setName("foo.proto").build(); FileDescriptorProto barProto = @@ -718,13 +517,10 @@ public class DescriptorsTest { Descriptors.FileDescriptor.buildFrom(barProto, new FileDescriptor[] {fooFile}); // Items in the FileDescriptor array can be in any order. - FileDescriptor unused1 = - Descriptors.FileDescriptor.buildFrom(bazProto, new FileDescriptor[] {fooFile, barFile}); - FileDescriptor unused2 = - Descriptors.FileDescriptor.buildFrom(bazProto, new FileDescriptor[] {barFile, fooFile}); + Descriptors.FileDescriptor.buildFrom(bazProto, new FileDescriptor[] {fooFile, barFile}); + Descriptors.FileDescriptor.buildFrom(bazProto, new FileDescriptor[] {barFile, fooFile}); } - @Test public void testInvalidPublicDependency() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder().setName("foo.proto").build(); FileDescriptorProto barProto = @@ -736,13 +532,12 @@ public class DescriptorsTest { FileDescriptor fooFile = Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[0]); try { Descriptors.FileDescriptor.buildFrom(barProto, new FileDescriptor[] {fooFile}); - assertWithMessage("DescriptorValidationException expected").fail(); + fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { - assertThat(e).hasMessageThat().contains("Invalid public dependency index."); + assertTrue(e.getMessage().indexOf("Invalid public dependency index.") != -1); } } - @Test public void testUnknownFieldsDenied() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() @@ -760,14 +555,13 @@ public class DescriptorsTest { try { Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[0]); - assertWithMessage("DescriptorValidationException expected").fail(); + fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { - assertThat(e).hasMessageThat().contains("Bar"); - assertThat(e).hasMessageThat().contains("is not defined"); + assertTrue(e.getMessage().indexOf("Bar") != -1); + assertTrue(e.getMessage().indexOf("is not defined") != -1); } } - @Test public void testUnknownFieldsAllowed() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() @@ -783,11 +577,9 @@ public class DescriptorsTest { .setName("bar") .setNumber(1))) .build(); - FileDescriptor unused = - Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[0], true); + Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[0], true); } - @Test public void testHiddenDependency() throws Exception { FileDescriptorProto barProto = FileDescriptorProto.newBuilder() @@ -818,16 +610,14 @@ public class DescriptorsTest { Descriptors.FileDescriptor.buildFrom(forwardProto, new FileDescriptor[] {barFile}); try { - FileDescriptor unused = - Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[] {forwardFile}); - assertWithMessage("DescriptorValidationException expected").fail(); + Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[] {forwardFile}); + fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { - assertThat(e).hasMessageThat().contains("Bar"); - assertThat(e).hasMessageThat().contains("is not defined"); + assertTrue(e.getMessage().indexOf("Bar") != -1); + assertTrue(e.getMessage().indexOf("is not defined") != -1); } } - @Test public void testPublicDependency() throws Exception { FileDescriptorProto barProto = FileDescriptorProto.newBuilder() @@ -857,12 +647,10 @@ public class DescriptorsTest { FileDescriptor barFile = Descriptors.FileDescriptor.buildFrom(barProto, new FileDescriptor[0]); FileDescriptor forwardFile = Descriptors.FileDescriptor.buildFrom(forwardProto, new FileDescriptor[] {barFile}); - FileDescriptor unused = - Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[] {forwardFile}); + Descriptors.FileDescriptor.buildFrom(fooProto, new FileDescriptor[] {forwardFile}); } /** Tests the translate/crosslink for an example with a more complex namespace referencing. */ - @Test public void testComplexNamespacePublicDependency() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() @@ -893,92 +681,73 @@ public class DescriptorsTest { FileDescriptor barFile = Descriptors.FileDescriptor.buildFrom(barProto, new FileDescriptor[] {fooFile}); // verify resulting descriptors - assertThat(barFile).isNotNull(); + assertNotNull(barFile); List msglist = barFile.getMessageTypes(); - assertThat(msglist).isNotNull(); - assertThat(msglist).hasSize(1); + assertNotNull(msglist); + assertTrue(msglist.size() == 1); Descriptor desc = msglist.get(0); if (desc.getName().equals("MyMessage")) { - assertThat(desc.getFields()).isNotNull(); + assertNotNull(desc.getFields()); List fieldlist = desc.getFields(); - assertThat(fieldlist).isNotNull(); - assertThat(fieldlist).hasSize(1); + assertNotNull(fieldlist); + assertTrue(fieldlist.size() == 1); FieldDescriptor field = fieldlist.get(0); - assertThat(field.getType()).isSameInstanceAs(FieldDescriptor.Type.ENUM); - assertThat(field.getEnumType().getName().equals("MyEnum")).isTrue(); - assertThat(field.getEnumType().getFile().getName().equals("bar.proto")).isTrue(); - assertThat(field.getEnumType().getFile().getPackage().equals("a.b.c.d.bar.shared")).isTrue(); + assertTrue(field.getType() == FieldDescriptor.Type.ENUM); + assertTrue(field.getEnumType().getName().equals("MyEnum")); + assertTrue(field.getEnumType().getFile().getName().equals("bar.proto")); + assertTrue(field.getEnumType().getFile().getPackage().equals("a.b.c.d.bar.shared")); } } - @Test public void testOneofDescriptor() throws Exception { Descriptor messageType = TestAllTypes.getDescriptor(); FieldDescriptor field = messageType.findFieldByName("oneof_nested_message"); OneofDescriptor oneofDescriptor = field.getContainingOneof(); - assertThat(oneofDescriptor).isNotNull(); - assertThat(messageType.getOneofs().get(0)).isSameInstanceAs(oneofDescriptor); - assertThat(oneofDescriptor.getName()).isEqualTo("oneof_field"); + assertNotNull(oneofDescriptor); + assertSame(oneofDescriptor, messageType.getOneofs().get(0)); + assertEquals("oneof_field", oneofDescriptor.getName()); - assertThat(oneofDescriptor.getFieldCount()).isEqualTo(7); - assertThat(field).isSameInstanceAs(oneofDescriptor.getField(1)); + assertEquals(4, oneofDescriptor.getFieldCount()); + assertSame(oneofDescriptor.getField(1), field); - assertThat(oneofDescriptor.getFields()).hasSize(7); - assertThat(field).isEqualTo(oneofDescriptor.getFields().get(1)); + assertEquals(4, oneofDescriptor.getFields().size()); + assertEquals(oneofDescriptor.getFields().get(1), field); } - @Test public void testMessageDescriptorExtensions() throws Exception { - assertThat(TestAllTypes.getDescriptor().isExtendable()).isFalse(); - assertThat(TestAllExtensions.getDescriptor().isExtendable()).isTrue(); - assertThat(TestMultipleExtensionRanges.getDescriptor().isExtendable()).isTrue(); - - assertThat(TestAllTypes.getDescriptor().isExtensionNumber(3)).isFalse(); - assertThat(TestAllExtensions.getDescriptor().isExtensionNumber(3)).isTrue(); - assertThat(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(42)).isTrue(); - assertThat(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(43)).isFalse(); - assertThat(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(4142)).isFalse(); - assertThat(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(4143)).isTrue(); + assertFalse(TestAllTypes.getDescriptor().isExtendable()); + assertTrue(TestAllExtensions.getDescriptor().isExtendable()); + assertTrue(TestMultipleExtensionRanges.getDescriptor().isExtendable()); + + assertFalse(TestAllTypes.getDescriptor().isExtensionNumber(3)); + assertTrue(TestAllExtensions.getDescriptor().isExtensionNumber(3)); + assertTrue(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(42)); + assertFalse(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(43)); + assertFalse(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(4142)); + assertTrue(TestMultipleExtensionRanges.getDescriptor().isExtensionNumber(4143)); } - @Test public void testReservedFields() { Descriptor d = TestReservedFields.getDescriptor(); - assertThat(d.isReservedNumber(2)).isTrue(); - assertThat(d.isReservedNumber(8)).isFalse(); - assertThat(d.isReservedNumber(9)).isTrue(); - assertThat(d.isReservedNumber(10)).isTrue(); - assertThat(d.isReservedNumber(11)).isTrue(); - assertThat(d.isReservedNumber(12)).isFalse(); - assertThat(d.isReservedName("foo")).isFalse(); - assertThat(d.isReservedName("bar")).isTrue(); - assertThat(d.isReservedName("baz")).isTrue(); + assertTrue(d.isReservedNumber(2)); + assertFalse(d.isReservedNumber(8)); + assertTrue(d.isReservedNumber(9)); + assertTrue(d.isReservedNumber(10)); + assertTrue(d.isReservedNumber(11)); + assertFalse(d.isReservedNumber(12)); + assertFalse(d.isReservedName("foo")); + assertTrue(d.isReservedName("bar")); + assertTrue(d.isReservedName("baz")); } - @Test - public void testReservedEnumFields() { - EnumDescriptor d = TestReservedEnumFields.getDescriptor(); - assertThat(d.isReservedNumber(2)).isTrue(); - assertThat(d.isReservedNumber(8)).isFalse(); - assertThat(d.isReservedNumber(9)).isTrue(); - assertThat(d.isReservedNumber(10)).isTrue(); - assertThat(d.isReservedNumber(11)).isTrue(); - assertThat(d.isReservedNumber(12)).isFalse(); - assertThat(d.isReservedName("foo")).isFalse(); - assertThat(d.isReservedName("bar")).isTrue(); - assertThat(d.isReservedName("baz")).isTrue(); - } - - @Test public void testToString() { - assertThat( - UnittestProto.TestAllTypes.getDescriptor() - .findFieldByNumber(UnittestProto.TestAllTypes.OPTIONAL_UINT64_FIELD_NUMBER) - .toString()) - .isEqualTo("protobuf_unittest.TestAllTypes.optional_uint64"); + assertEquals( + "protobuf_unittest.TestAllTypes.optional_uint64", + UnittestProto.TestAllTypes.getDescriptor() + .findFieldByNumber(UnittestProto.TestAllTypes.OPTIONAL_UINT64_FIELD_NUMBER) + .toString()); } - @Test public void testPackedEnumField() throws Exception { FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() @@ -1003,45 +772,36 @@ public class DescriptorsTest { .build()) .build()) .build(); - FileDescriptor unused = - Descriptors.FileDescriptor.buildFrom(fileDescriptorProto, new FileDescriptor[0]); + Descriptors.FileDescriptor.buildFrom(fileDescriptorProto, new FileDescriptor[0]); } - @Test public void testFieldJsonName() throws Exception { Descriptor d = TestJsonName.getDescriptor(); - assertThat(d.getFields()).hasSize(7); - assertThat(d.getFields().get(0).getJsonName()).isEqualTo("fieldName1"); - assertThat(d.getFields().get(1).getJsonName()).isEqualTo("fieldName2"); - assertThat(d.getFields().get(2).getJsonName()).isEqualTo("FieldName3"); - assertThat(d.getFields().get(3).getJsonName()).isEqualTo("FieldName4"); - assertThat(d.getFields().get(4).getJsonName()).isEqualTo("FIELDNAME5"); - assertThat(d.getFields().get(5).getJsonName()).isEqualTo("@type"); - assertThat(d.getFields().get(6).getJsonName()).isEqualTo("fieldname7"); + assertEquals(6, d.getFields().size()); + assertEquals("fieldName1", d.getFields().get(0).getJsonName()); + assertEquals("fieldName2", d.getFields().get(1).getJsonName()); + assertEquals("FieldName3", d.getFields().get(2).getJsonName()); + assertEquals("FieldName4", d.getFields().get(3).getJsonName()); + assertEquals("FIELDNAME5", d.getFields().get(4).getJsonName()); + assertEquals("@type", d.getFields().get(5).getJsonName()); } - @Test public void testExtensionRenamesKeywords() { - assertThat(NonNestedExtension.if_).isInstanceOf(GeneratedMessage.GeneratedExtension.class); - assertThat(NestedExtension.MyNestedExtension.default_) - .isInstanceOf(GeneratedMessage.GeneratedExtension.class); + assertTrue(NonNestedExtension.if_ instanceof GeneratedMessage.GeneratedExtension); + assertTrue( + NestedExtension.MyNestedExtension.default_ + instanceof GeneratedMessage.GeneratedExtension); NonNestedExtension.MessageToBeExtended msg = NonNestedExtension.MessageToBeExtended.newBuilder() .setExtension(NonNestedExtension.if_, "!fi") .build(); - assertThat(msg.getExtension(NonNestedExtension.if_)).isEqualTo("!fi"); + assertEquals("!fi", msg.getExtension(NonNestedExtension.if_)); msg = NonNestedExtension.MessageToBeExtended.newBuilder() .setExtension(NestedExtension.MyNestedExtension.default_, 8) .build(); - assertThat(msg.getExtension(NestedExtension.MyNestedExtension.default_).intValue()) - .isEqualTo(8); - } - - @Test - public void testDefaultDescriptorExtensionRange() throws Exception { - assertThat(new Descriptor("default").isExtensionNumber(1)).isTrue(); + assertEquals(8, msg.getExtension(NestedExtension.MyNestedExtension.default_).intValue()); } } diff --git a/java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java b/java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java index 1004de8d97430410cd3901ae8685709e65fb062c..01a96ba550e065d2321359b1a0fa9f543e6c4934 100644 --- a/java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java +++ b/java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java @@ -1,13 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.assertEquals; import protobuf_unittest.UnittestProto; import proto3_unittest.UnittestProto3; @@ -60,12 +83,12 @@ public class DiscardUnknownFieldsTest { // Use DiscardUnknownFieldsParser to parse the first payload. int oldLimit = input.pushLimit(messageSize); Message parsed = DiscardUnknownFieldsParser.wrap(message.getParserForType()).parseFrom(input); - assertWithMessage(message.getClass().getName()).that(parsed.getSerializedSize()).isEqualTo(0); + assertEquals(message.getClass().getName(), 0, parsed.getSerializedSize()); input.popLimit(oldLimit); // Use the normal parser to parse the remaining payload should have unknown fields preserved. parsed = message.getParserForType().parseFrom(input); - assertWithMessage(message.getClass().getName()).that(parsed.toByteString()).isEqualTo(payload); + assertEquals(message.getClass().getName(), payload, parsed.toByteString()); } /** @@ -76,20 +99,20 @@ public class DiscardUnknownFieldsTest { throws Exception { UnknownFieldSet unknownFields = UnknownFieldSet.newBuilder().mergeFrom(payload).build(); Message built = message.newBuilderForType().setUnknownFields(unknownFields).build(); - assertWithMessage(message.getClass().getName()).that(built.toByteString()).isEqualTo(payload); + assertEquals(message.getClass().getName(), payload, built.toByteString()); } private static void assertUnknownFieldsPreserved(MessageLite message) throws Exception { MessageLite parsed = message.getParserForType().parseFrom(payload); - assertWithMessage(message.getClass().getName()).that(parsed.toByteString()).isEqualTo(payload); + assertEquals(message.getClass().getName(), payload, parsed.toByteString()); parsed = message.newBuilderForType().mergeFrom(payload).build(); - assertWithMessage(message.getClass().getName()).that(parsed.toByteString()).isEqualTo(payload); + assertEquals(message.getClass().getName(), payload, parsed.toByteString()); } private static void assertUnknownFieldsExplicitlyDiscarded(Message message) throws Exception { Message parsed = DiscardUnknownFieldsParser.wrap(message.getParserForType()).parseFrom(payload); - assertWithMessage(message.getClass().getName()).that(parsed.getSerializedSize()).isEqualTo(0); + assertEquals(message.getClass().getName(), 0, parsed.getSerializedSize()); } private static final ByteString payload = diff --git a/java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java b/java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java index c3fb3c9cb2e66283ae52b9089e3c345c20da7ef2..019b5a14444f5a617228cdfd1f3d471c18d4e85e 100644 --- a/java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java +++ b/java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java @@ -1,50 +1,68 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static java.util.Arrays.asList; import com.google.protobuf.Internal.DoubleList; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Iterator; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests for {@link DoubleArrayList}. */ -@RunWith(JUnit4.class) -public class DoubleArrayListTest { +/** + * Tests for {@link DoubleArrayList}. + * + * @author dweis@google.com (Daniel Weis) + */ +public class DoubleArrayListTest extends TestCase { private static final DoubleArrayList UNARY_LIST = newImmutableDoubleArrayList(1); private static final DoubleArrayList TERTIARY_LIST = newImmutableDoubleArrayList(1, 2, 3); private DoubleArrayList list; - @Before - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { list = new DoubleArrayList(); } - @Test public void testEmptyListReturnsSameInstance() { - assertThat(DoubleArrayList.emptyList()).isSameInstanceAs(DoubleArrayList.emptyList()); + assertSame(DoubleArrayList.emptyList(), DoubleArrayList.emptyList()); } - @Test public void testEmptyListIsImmutable() { assertImmutable(DoubleArrayList.emptyList()); } - @Test public void testMakeImmutable() { list.addDouble(3); list.addDouble(4); @@ -54,20 +72,19 @@ public class DoubleArrayListTest { assertImmutable(list); } - @Test public void testModificationWithIteration() { list.addAll(asList(1D, 2D, 3D, 4D)); Iterator iterator = list.iterator(); - assertThat(list).hasSize(4); - assertThat((double) list.get(0)).isEqualTo(1D); - assertThat((double) iterator.next()).isEqualTo(1D); + assertEquals(4, list.size()); + assertEquals(1D, (double) list.get(0), 0.0); + assertEquals(1D, (double) iterator.next(), 0.0); list.set(0, 1D); - assertThat((double) iterator.next()).isEqualTo(2D); + assertEquals(2D, (double) iterator.next(), 0.0); list.remove(0); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } @@ -76,211 +93,191 @@ public class DoubleArrayListTest { list.add(0, 0D); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } } - @Test public void testGet() { - assertThat((double) TERTIARY_LIST.get(0)).isEqualTo(1D); - assertThat((double) TERTIARY_LIST.get(1)).isEqualTo(2D); - assertThat((double) TERTIARY_LIST.get(2)).isEqualTo(3D); + assertEquals(1D, (double) TERTIARY_LIST.get(0), 0.0); + assertEquals(2D, (double) TERTIARY_LIST.get(1), 0.0); + assertEquals(3D, (double) TERTIARY_LIST.get(2), 0.0); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testGetDouble() { - assertThat(TERTIARY_LIST.getDouble(0)).isEqualTo(1D); - assertThat(TERTIARY_LIST.getDouble(1)).isEqualTo(2D); - assertThat(TERTIARY_LIST.getDouble(2)).isEqualTo(3D); + assertEquals(1D, TERTIARY_LIST.getDouble(0), 0.0); + assertEquals(2D, TERTIARY_LIST.getDouble(1), 0.0); + assertEquals(3D, TERTIARY_LIST.getDouble(2), 0.0); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testIndexOf_nullElement() { - assertThat(TERTIARY_LIST.indexOf(null)).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(null)); } - @Test public void testIndexOf_incompatibleElementType() { - assertThat(TERTIARY_LIST.indexOf(new Object())).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(new Object())); } - @Test public void testIndexOf_notInList() { - assertThat(UNARY_LIST.indexOf(2D)).isEqualTo(-1); + assertEquals(-1, UNARY_LIST.indexOf(2D)); } - @Test public void testIndexOf_notInListWithDuplicates() { DoubleArrayList listWithDupes = newImmutableDoubleArrayList(1D, 1D); - assertThat(listWithDupes.indexOf(2D)).isEqualTo(-1); + assertEquals(-1, listWithDupes.indexOf(2D)); } - @Test public void testIndexOf_inList() { - assertThat(TERTIARY_LIST.indexOf(2D)).isEqualTo(1); + assertEquals(1, TERTIARY_LIST.indexOf(2D)); } - @Test public void testIndexOf_inListWithDuplicates_matchAtHead() { DoubleArrayList listWithDupes = newImmutableDoubleArrayList(1D, 1D, 2D); - assertThat(listWithDupes.indexOf(1D)).isEqualTo(0); + assertEquals(0, listWithDupes.indexOf(1D)); } - @Test public void testIndexOf_inListWithDuplicates_matchMidList() { DoubleArrayList listWithDupes = newImmutableDoubleArrayList(2D, 1D, 1D, 2D); - assertThat(listWithDupes.indexOf(1D)).isEqualTo(1); + assertEquals(1, listWithDupes.indexOf(1D)); } - @Test public void testContains_nullElement() { - assertThat(TERTIARY_LIST).doesNotContain(null); + assertEquals(false, TERTIARY_LIST.contains(null)); } - @Test public void testContains_incompatibleElementType() { - assertThat(TERTIARY_LIST).doesNotContain(new Object()); + assertEquals(false, TERTIARY_LIST.contains(new Object())); } - @Test public void testContains_notInList() { - assertThat(UNARY_LIST).doesNotContain(2D); + assertEquals(false, UNARY_LIST.contains(2D)); } - @Test public void testContains_notInListWithDuplicates() { DoubleArrayList listWithDupes = newImmutableDoubleArrayList(1D, 1D); - assertThat(listWithDupes).doesNotContain(2D); + assertEquals(false, listWithDupes.contains(2D)); } - @Test public void testContains_inList() { - assertThat(TERTIARY_LIST).contains(2D); + assertEquals(true, TERTIARY_LIST.contains(2D)); } - @Test public void testContains_inListWithDuplicates_matchAtHead() { DoubleArrayList listWithDupes = newImmutableDoubleArrayList(1D, 1D, 2D); - assertThat(listWithDupes).contains(1D); + assertEquals(true, listWithDupes.contains(1D)); } - @Test public void testContains_inListWithDuplicates_matchMidList() { DoubleArrayList listWithDupes = newImmutableDoubleArrayList(2D, 1D, 1D, 2D); - assertThat(listWithDupes).contains(1D); + assertEquals(true, listWithDupes.contains(1D)); } - @Test public void testSize() { - assertThat(DoubleArrayList.emptyList()).isEmpty(); - assertThat(UNARY_LIST).hasSize(1); - assertThat(TERTIARY_LIST).hasSize(3); + assertEquals(0, DoubleArrayList.emptyList().size()); + assertEquals(1, UNARY_LIST.size()); + assertEquals(3, TERTIARY_LIST.size()); list.addDouble(3); list.addDouble(4); list.addDouble(6); list.addDouble(8); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); list.remove(0); - assertThat(list).hasSize(3); + assertEquals(3, list.size()); list.add(17D); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); } - @Test public void testSet() { list.addDouble(2); list.addDouble(4); - assertThat((double) list.set(0, 3D)).isEqualTo(2D); - assertThat(list.getDouble(0)).isEqualTo(3D); + assertEquals(2D, (double) list.set(0, 3D), 0.0); + assertEquals(3D, list.getDouble(0), 0.0); - assertThat((double) list.set(1, 0D)).isEqualTo(4D); - assertThat(list.getDouble(1)).isEqualTo(0D); + assertEquals(4D, (double) list.set(1, 0D), 0.0); + assertEquals(0D, list.getDouble(1), 0.0); try { list.set(-1, 0D); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.set(2, 0D); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testSetDouble() { list.addDouble(1); list.addDouble(3); - assertThat(list.setDouble(0, 0)).isEqualTo(1D); - assertThat(list.getDouble(0)).isEqualTo(0D); + assertEquals(1D, list.setDouble(0, 0), 0.0); + assertEquals(0D, list.getDouble(0), 0.0); - assertThat(list.setDouble(1, 0)).isEqualTo(3D); - assertThat(list.getDouble(1)).isEqualTo(0D); + assertEquals(3D, list.setDouble(1, 0), 0.0); + assertEquals(0D, list.getDouble(1), 0.0); try { list.setDouble(-1, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.setDouble(2, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testAdd() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.add(2D)).isTrue(); - assertThat(list).containsExactly(2D); + assertTrue(list.add(2D)); + assertEquals(asList(2D), list); - assertThat(list.add(3D)).isTrue(); + assertTrue(list.add(3D)); list.add(0, 4D); - assertThat(list).containsExactly(4D, 2D, 3D).inOrder(); + assertEquals(asList(4D, 2D, 3D), list); list.add(0, 1D); list.add(0, 0D); @@ -288,7 +285,7 @@ public class DoubleArrayListTest { for (int i = 0; i < 6; i++) { list.add(Double.valueOf(5 + i)); } - assertThat(list).containsExactly(0D, 1D, 4D, 2D, 3D, 5D, 6D, 7D, 8D, 9D, 10D).inOrder(); + assertEquals(asList(0D, 1D, 4D, 2D, 3D, 5D, 6D, 7D, 8D, 9D, 10D), list); try { list.add(-1, 5D); @@ -303,100 +300,92 @@ public class DoubleArrayListTest { } } - @Test public void testAddDouble() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); list.addDouble(2); - assertThat(list).containsExactly(2D); + assertEquals(asList(2D), list); list.addDouble(3); - assertThat(list).containsExactly(2D, 3D).inOrder(); + assertEquals(asList(2D, 3D), list); } - @Test public void testAddAll() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.addAll(Collections.singleton(1D))).isTrue(); - assertThat(list).hasSize(1); - assertThat((double) list.get(0)).isEqualTo(1D); - assertThat(list.getDouble(0)).isEqualTo(1D); + assertTrue(list.addAll(Collections.singleton(1D))); + assertEquals(1, list.size()); + assertEquals(1D, (double) list.get(0), 0.0); + assertEquals(1D, list.getDouble(0), 0.0); - assertThat(list.addAll(asList(2D, 3D, 4D, 5D, 6D))).isTrue(); - assertThat(list).containsExactly(1D, 2D, 3D, 4D, 5D, 6D).inOrder(); + assertTrue(list.addAll(asList(2D, 3D, 4D, 5D, 6D))); + assertEquals(asList(1D, 2D, 3D, 4D, 5D, 6D), list); - assertThat(list.addAll(TERTIARY_LIST)).isTrue(); - assertThat(list).containsExactly(1D, 2D, 3D, 4D, 5D, 6D, 1D, 2D, 3D).inOrder(); + assertTrue(list.addAll(TERTIARY_LIST)); + assertEquals(asList(1D, 2D, 3D, 4D, 5D, 6D, 1D, 2D, 3D), list); - assertThat(list.addAll(Collections.emptyList())).isFalse(); - assertThat(list.addAll(DoubleArrayList.emptyList())).isFalse(); + assertFalse(list.addAll(Collections.emptyList())); + assertFalse(list.addAll(DoubleArrayList.emptyList())); } - @Test public void testEquals() { DoubleArrayList list1 = new DoubleArrayList(); DoubleArrayList list2 = new DoubleArrayList(); list1.addDouble(Double.longBitsToDouble(0x7ff0000000000001L)); list2.addDouble(Double.longBitsToDouble(0x7ff0000000000002L)); - assertThat(list1).isEqualTo(list2); + assertEquals(list1, list2); } - @Test public void testRemove() { list.addAll(TERTIARY_LIST); - assertThat((double) list.remove(0)).isEqualTo(1D); - assertThat(list).containsExactly(2D, 3D).inOrder(); + assertEquals(1D, (double) list.remove(0), 0.0); + assertEquals(asList(2D, 3D), list); - assertThat(list.remove(Double.valueOf(3))).isTrue(); - assertThat(list).containsExactly(2D); + assertTrue(list.remove(Double.valueOf(3))); + assertEquals(asList(2D), list); - assertThat(list.remove(Double.valueOf(3))).isFalse(); - assertThat(list).containsExactly(2D); + assertFalse(list.remove(Double.valueOf(3))); + assertEquals(asList(2D), list); - assertThat((double) list.remove(0)).isEqualTo(2D); - assertThat(list).isEmpty(); + assertEquals(2D, (double) list.remove(0), 0.0); + assertEquals(asList(), list); try { list.remove(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.remove(0); - assertWithMessage("expected exception").fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testRemoveEnd_listAtCapacity() { DoubleList toRemove = DoubleArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addDouble(3); toRemove.remove(0); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } - @Test public void testRemove_listAtCapacity() { DoubleList toRemove = DoubleArrayList.emptyList().mutableCopyWithCapacity(2); toRemove.addDouble(3); toRemove.addDouble(4); toRemove.remove(0); - assertThat(toRemove).hasSize(1); - assertThat((double) toRemove.get(0)).isEqualTo(4D); + assertEquals(1, toRemove.size()); + assertEquals(4D, (double) toRemove.get(0)); } - @Test public void testSublistRemoveEndOfCapacity() { DoubleList toRemove = DoubleArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addDouble(3); toRemove.subList(0, 1).clear(); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } private void assertImmutable(DoubleList list) { @@ -406,147 +395,147 @@ public class DoubleArrayListTest { try { list.add(1D); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.add(0, 1D); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.singletonList(1D)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(new DoubleArrayList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.singleton(1D)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addDouble(0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.clear(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.singleton(1D)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.singleton(1D)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, 0D); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.setDouble(0, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } diff --git a/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java b/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java index ad634e92b1708d3b69255cfc305c6fb41a6367fb..fe37ea808746a6e2c294c04546c7b34916ba6096 100644 --- a/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java +++ b/java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java @@ -1,40 +1,54 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; - import com.google.protobuf.Descriptors.EnumDescriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.Descriptors.OneofDescriptor; -import dynamicmessagetest.DynamicMessageTestProto.EmptyMessage; -import dynamicmessagetest.DynamicMessageTestProto.MessageWithMapFields; -import protobuf_unittest.UnittestMset.TestMessageSetExtension2; import protobuf_unittest.UnittestProto; import protobuf_unittest.UnittestProto.TestAllExtensions; import protobuf_unittest.UnittestProto.TestAllTypes; import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage; import protobuf_unittest.UnittestProto.TestEmptyMessage; import protobuf_unittest.UnittestProto.TestPackedTypes; -import proto2_wireformat_unittest.UnittestMsetWireFormat.TestMessageSet; -import java.util.ArrayList; -import org.junit.Test; -import org.junit.function.ThrowingRunnable; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import java.util.Arrays; +import junit.framework.TestCase; /** * Unit test for {@link DynamicMessage}. See also {@link MessageTest}, which tests some {@link * DynamicMessage} functionality. + * + * @author kenton@google.com Kenton Varda */ -@RunWith(JUnit4.class) -public class DynamicMessageTest { +public class DynamicMessageTest extends TestCase { TestUtil.ReflectionTester reflectionTester = new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null); @@ -44,7 +58,6 @@ public class DynamicMessageTest { TestUtil.ReflectionTester packedReflectionTester = new TestUtil.ReflectionTester(TestPackedTypes.getDescriptor(), null); - @Test public void testDynamicMessageAccessors() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); reflectionTester.setAllFieldsViaReflection(builder); @@ -52,12 +65,11 @@ public class DynamicMessageTest { reflectionTester.assertAllFieldsSetViaReflection(message); } - @Test public void testSettersAfterBuild() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); Message firstMessage = builder.build(); // double build() - Message unused = builder.build(); + builder.build(); // clear() after build() builder.clear(); // setters after build() @@ -72,7 +84,6 @@ public class DynamicMessageTest { reflectionTester.assertClearViaReflection(firstMessage); } - @Test public void testUnknownFields() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestEmptyMessage.getDescriptor()); builder.setUnknownFields( @@ -81,25 +92,23 @@ public class DynamicMessageTest { .addField(2, UnknownFieldSet.Field.newBuilder().addFixed32(1).build()) .build()); Message message = builder.build(); - assertThat(builder.getUnknownFields().asMap()).hasSize(2); + assertEquals(2, message.getUnknownFields().asMap().size()); // clone() with unknown fields Message.Builder newBuilder = builder.clone(); - assertThat(newBuilder.getUnknownFields().asMap()).hasSize(2); + assertEquals(2, newBuilder.getUnknownFields().asMap().size()); // clear() with unknown fields newBuilder.clear(); - assertThat(newBuilder.getUnknownFields().asMap()).isEmpty(); + assertTrue(newBuilder.getUnknownFields().asMap().isEmpty()); // serialize/parse with unknown fields newBuilder.mergeFrom(message.toByteString()); - assertThat(newBuilder.getUnknownFields().asMap()).hasSize(2); + assertEquals(2, newBuilder.getUnknownFields().asMap().size()); } - @Test public void testDynamicMessageSettersRejectNull() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); reflectionTester.assertReflectionSettersRejectNull(builder); } - @Test public void testDynamicMessageExtensionAccessors() throws Exception { // We don't need to extensively test DynamicMessage's handling of // extensions because, frankly, it doesn't do anything special with them. @@ -110,13 +119,11 @@ public class DynamicMessageTest { extensionsReflectionTester.assertAllFieldsSetViaReflection(message); } - @Test public void testDynamicMessageExtensionSettersRejectNull() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestAllExtensions.getDescriptor()); extensionsReflectionTester.assertReflectionSettersRejectNull(builder); } - @Test public void testDynamicMessageRepeatedSetters() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); reflectionTester.setAllFieldsViaReflection(builder); @@ -125,13 +132,11 @@ public class DynamicMessageTest { reflectionTester.assertRepeatedFieldsModifiedViaReflection(message); } - @Test public void testDynamicMessageRepeatedSettersRejectNull() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); reflectionTester.assertReflectionRepeatedSettersRejectNull(builder); } - @Test public void testDynamicMessageDefaults() throws Exception { reflectionTester.assertClearViaReflection( DynamicMessage.getDefaultInstance(TestAllTypes.getDescriptor())); @@ -139,7 +144,6 @@ public class DynamicMessageTest { DynamicMessage.newBuilder(TestAllTypes.getDescriptor()).build()); } - @Test public void testDynamicMessageSerializedSize() throws Exception { TestAllTypes message = TestUtil.getAllSet(); @@ -147,10 +151,9 @@ public class DynamicMessageTest { reflectionTester.setAllFieldsViaReflection(dynamicBuilder); Message dynamicMessage = dynamicBuilder.build(); - assertThat(message.getSerializedSize()).isEqualTo(dynamicMessage.getSerializedSize()); + assertEquals(message.getSerializedSize(), dynamicMessage.getSerializedSize()); } - @Test public void testDynamicMessageSerialization() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); reflectionTester.setAllFieldsViaReflection(builder); @@ -162,10 +165,9 @@ public class DynamicMessageTest { TestUtil.assertAllFieldsSet(message2); // In fact, the serialized forms should be exactly the same, byte-for-byte. - assertThat(rawBytes).isEqualTo(TestUtil.getAllSet().toByteString()); + assertEquals(TestUtil.getAllSet().toByteString(), rawBytes); } - @Test public void testDynamicMessageParsing() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -181,7 +183,6 @@ public class DynamicMessageTest { reflectionTester.assertAllFieldsSetViaReflection(message3); } - @Test public void testDynamicMessageExtensionParsing() throws Exception { ByteString rawBytes = TestUtil.getAllExtensionsSet().toByteString(); Message message = @@ -195,7 +196,6 @@ public class DynamicMessageTest { extensionsReflectionTester.assertAllFieldsSetViaReflection(message2); } - @Test public void testDynamicMessagePackedSerialization() throws Exception { Message.Builder builder = DynamicMessage.newBuilder(TestPackedTypes.getDescriptor()); packedReflectionTester.setPackedFieldsViaReflection(builder); @@ -207,23 +207,9 @@ public class DynamicMessageTest { TestUtil.assertPackedFieldsSet(message2); // In fact, the serialized forms should be exactly the same, byte-for-byte. - assertThat(rawBytes).isEqualTo(TestUtil.getPackedSet().toByteString()); - } - - @Test - public void testDynamicMessagePackedEmptySerialization() throws Exception { - Message message = - DynamicMessage.newBuilder(TestPackedTypes.getDescriptor()) - .setField( - TestPackedTypes.getDescriptor() - .findFieldByNumber(TestPackedTypes.PACKED_INT64_FIELD_NUMBER), - new ArrayList()) - .build(); - - assertThat(message.toByteString()).isEqualTo(ByteString.EMPTY); + assertEquals(TestUtil.getPackedSet().toByteString(), rawBytes); } - @Test public void testDynamicMessagePackedParsing() throws Exception { TestPackedTypes.Builder builder = TestPackedTypes.newBuilder(); TestUtil.setPackedFields(builder); @@ -239,7 +225,6 @@ public class DynamicMessageTest { packedReflectionTester.assertPackedFieldsSetViaReflection(message3); } - @Test public void testGetBuilderForExtensionField() { DynamicMessage.Builder builder = DynamicMessage.newBuilder(TestAllExtensions.getDescriptor()); Message.Builder fieldBuilder = @@ -248,10 +233,9 @@ public class DynamicMessageTest { FieldDescriptor field = NestedMessage.getDescriptor().findFieldByNumber(NestedMessage.BB_FIELD_NUMBER); fieldBuilder.setField(field, expected); - assertThat(fieldBuilder.build().getField(field)).isEqualTo(expected); + assertEquals(expected, fieldBuilder.build().getField(field)); } - @Test public void testDynamicMessageCopy() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -263,15 +247,14 @@ public class DynamicMessageTest { // Test oneof behavior FieldDescriptor bytesField = TestAllTypes.getDescriptor().findFieldByName("oneof_bytes"); FieldDescriptor uint32Field = TestAllTypes.getDescriptor().findFieldByName("oneof_uint32"); - assertThat(copy.hasField(bytesField)).isTrue(); - assertThat(copy.hasField(uint32Field)).isFalse(); + assertTrue(copy.hasField(bytesField)); + assertFalse(copy.hasField(uint32Field)); DynamicMessage copy2 = DynamicMessage.newBuilder(message).setField(uint32Field, 123).build(); - assertThat(copy2.hasField(bytesField)).isFalse(); - assertThat(copy2.hasField(uint32Field)).isTrue(); - assertThat(copy2.getField(uint32Field)).isEqualTo(123); + assertFalse(copy2.hasField(bytesField)); + assertTrue(copy2.hasField(uint32Field)); + assertEquals(123, copy2.getField(uint32Field)); } - @Test public void testToBuilder() throws Exception { DynamicMessage.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); reflectionTester.setAllFieldsViaReflection(builder); @@ -287,42 +270,41 @@ public class DynamicMessageTest { DynamicMessage derived = message.toBuilder().build(); reflectionTester.assertAllFieldsSetViaReflection(derived); - assertThat(derived.getUnknownFields().getField(unknownFieldNum).getVarintList()) - .containsExactly(unknownFieldVal); + assertEquals( + Arrays.asList(unknownFieldVal), + derived.getUnknownFields().getField(unknownFieldNum).getVarintList()); } - @Test public void testDynamicOneofMessage() throws Exception { DynamicMessage.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); OneofDescriptor oneof = TestAllTypes.getDescriptor().getOneofs().get(0); - assertThat(builder.hasOneof(oneof)).isFalse(); - assertThat(builder.getOneofFieldDescriptor(oneof)).isNull(); + assertFalse(builder.hasOneof(oneof)); + assertSame(null, builder.getOneofFieldDescriptor(oneof)); reflectionTester.setAllFieldsViaReflection(builder); - assertThat(builder.hasOneof(oneof)).isTrue(); + assertTrue(builder.hasOneof(oneof)); FieldDescriptor field = oneof.getField(3); - assertThat(builder.getOneofFieldDescriptor(oneof)).isSameInstanceAs(field); + assertSame(field, builder.getOneofFieldDescriptor(oneof)); DynamicMessage message = builder.buildPartial(); - assertThat(message.hasOneof(oneof)).isTrue(); + assertTrue(message.hasOneof(oneof)); DynamicMessage.Builder mergedBuilder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); FieldDescriptor mergedField = oneof.getField(0); mergedBuilder.setField(mergedField, 123); - assertThat(mergedBuilder.hasField(mergedField)).isTrue(); + assertTrue(mergedBuilder.hasField(mergedField)); mergedBuilder.mergeFrom(message); - assertThat(mergedBuilder.hasField(field)).isTrue(); - assertThat(mergedBuilder.hasField(mergedField)).isFalse(); + assertTrue(mergedBuilder.hasField(field)); + assertFalse(mergedBuilder.hasField(mergedField)); builder.clearOneof(oneof); - assertThat(builder.getOneofFieldDescriptor(oneof)).isNull(); + assertSame(null, builder.getOneofFieldDescriptor(oneof)); message = builder.build(); - assertThat(message.getOneofFieldDescriptor(oneof)).isNull(); + assertSame(null, message.getOneofFieldDescriptor(oneof)); } // Regression test for a bug that makes setField() not work for repeated // enum fields. - @Test public void testSettersForRepeatedEnumField() throws Exception { DynamicMessage.Builder builder = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); FieldDescriptor repeatedEnumField = @@ -330,90 +312,6 @@ public class DynamicMessageTest { EnumDescriptor enumDescriptor = TestAllTypes.NestedEnum.getDescriptor(); builder.setField(repeatedEnumField, enumDescriptor.getValues()); DynamicMessage message = builder.build(); - assertThat(message.getField(repeatedEnumField)).isEqualTo(enumDescriptor.getValues()); - } - - @Test - public void testBuilderGetFieldBuilder_mapField_throwsUnsupportedOperationException() { - final DynamicMessage.Builder builder = - DynamicMessage.newBuilder(MessageWithMapFields.getDescriptor()); - final FieldDescriptor mapField = - MessageWithMapFields.getDescriptor().findFieldByName("string_message_map"); - - Message.Builder entryBuilder = builder.newBuilderForField(mapField); - entryBuilder.setField(entryBuilder.getDescriptorForType().findFieldByNumber(1), "foo"); - entryBuilder.setField( - entryBuilder.getDescriptorForType().findFieldByNumber(2), - EmptyMessage.getDefaultInstance()); - builder.addRepeatedField(mapField, entryBuilder.build()); - - assertThrows( - UnsupportedOperationException.class, - new ThrowingRunnable() { - @Override - public void run() throws Throwable { - builder.getFieldBuilder(mapField); - } - }); - } - - @Test - public void testBuilderGetRepeatedFieldBuilder_mapField_throwsUnsupportedOperationException() { - final DynamicMessage.Builder builder = - DynamicMessage.newBuilder(MessageWithMapFields.getDescriptor()); - final FieldDescriptor mapField = - MessageWithMapFields.getDescriptor().findFieldByName("string_message_map"); - - Message.Builder entryBuilder = builder.newBuilderForField(mapField); - entryBuilder.setField(entryBuilder.getDescriptorForType().findFieldByNumber(1), "foo"); - entryBuilder.setField( - entryBuilder.getDescriptorForType().findFieldByNumber(2), - EmptyMessage.getDefaultInstance()); - builder.addRepeatedField(mapField, entryBuilder.build()); - - assertThrows( - UnsupportedOperationException.class, - new ThrowingRunnable() { - @Override - public void run() throws Throwable { - builder.getFieldBuilder(mapField); - } - }); - } - - @Test - public void serialize_lazyFieldInMessageSet() throws Exception { - ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); - extensionRegistry.add(TestMessageSetExtension2.messageSetExtension); - TestMessageSetExtension2 messageSetExtension = - TestMessageSetExtension2.newBuilder().setStr("foo").build(); - // This is a valid serialization of the above message. - ByteString suboptimallySerializedMessageSetExtension = - messageSetExtension.toByteString().concat(messageSetExtension.toByteString()); - DynamicMessage expectedMessage = - DynamicMessage.newBuilder(TestMessageSet.getDescriptor()) - .setField( - TestMessageSetExtension2.messageSetExtension.getDescriptor(), messageSetExtension) - .build(); - // Constructed with a LazyField, for whom roundtripping the serialized form will shorten the - // encoded form. - // In particular, this checks matching between lazy field encoding size. - DynamicMessage complicatedlyBuiltMessage = - DynamicMessage.newBuilder(TestMessageSet.getDescriptor()) - .setField( - TestMessageSetExtension2.messageSetExtension.getDescriptor(), - new LazyField( - DynamicMessage.getDefaultInstance(TestMessageSetExtension2.getDescriptor()), - extensionRegistry, - suboptimallySerializedMessageSetExtension)) - .build(); - - DynamicMessage roundtrippedMessage = - DynamicMessage.newBuilder(TestMessageSet.getDescriptor()) - .mergeFrom(complicatedlyBuiltMessage.toByteString(), extensionRegistry) - .build(); - - assertThat(complicatedlyBuiltMessage).isEqualTo(expectedMessage); - assertThat(roundtrippedMessage).isEqualTo(expectedMessage); + assertEquals(enumDescriptor.getValues(), message.getField(repeatedEnumField)); } } diff --git a/java/core/src/test/java/com/google/protobuf/EnumTest.java b/java/core/src/test/java/com/google/protobuf/EnumTest.java index b4326a596de19f795dfbc71c7ff5f2e7e10df59f..80c176a771318c39fcc2b58646ba9f204c1b0f2d 100644 --- a/java/core/src/test/java/com/google/protobuf/EnumTest.java +++ b/java/core/src/test/java/com/google/protobuf/EnumTest.java @@ -1,62 +1,76 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import com.google.protobuf.UnittestLite.ForeignEnumLite; import com.google.protobuf.UnittestLite.TestAllTypesLite; import protobuf_unittest.UnittestProto.ForeignEnum; import protobuf_unittest.UnittestProto.TestAllTypes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -@RunWith(JUnit4.class) -public class EnumTest { +public class EnumTest extends TestCase { - @Test public void testForNumber() { ForeignEnum e = ForeignEnum.forNumber(ForeignEnum.FOREIGN_BAR.getNumber()); - assertThat(e).isEqualTo(ForeignEnum.FOREIGN_BAR); + assertEquals(ForeignEnum.FOREIGN_BAR, e); e = ForeignEnum.forNumber(1000); - assertThat(e).isNull(); + assertNull(e); } - @Test public void testForNumber_oneof() { TestAllTypes.OneofFieldCase e = TestAllTypes.OneofFieldCase.forNumber( TestAllTypes.OneofFieldCase.ONEOF_NESTED_MESSAGE.getNumber()); - assertThat(e).isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_NESTED_MESSAGE); + assertEquals(TestAllTypes.OneofFieldCase.ONEOF_NESTED_MESSAGE, e); e = TestAllTypes.OneofFieldCase.forNumber(1000); - assertThat(e).isNull(); + assertNull(e); } - @Test public void testForNumberLite() { ForeignEnumLite e = ForeignEnumLite.forNumber(ForeignEnumLite.FOREIGN_LITE_BAR.getNumber()); - assertThat(e).isEqualTo(ForeignEnumLite.FOREIGN_LITE_BAR); + assertEquals(ForeignEnumLite.FOREIGN_LITE_BAR, e); e = ForeignEnumLite.forNumber(1000); - assertThat(e).isNull(); + assertNull(e); } - @Test public void testForNumberLite_oneof() { TestAllTypesLite.OneofFieldCase e = TestAllTypesLite.OneofFieldCase.forNumber( TestAllTypesLite.OneofFieldCase.ONEOF_NESTED_MESSAGE.getNumber()); - assertThat(e).isEqualTo(TestAllTypesLite.OneofFieldCase.ONEOF_NESTED_MESSAGE); + assertEquals(TestAllTypesLite.OneofFieldCase.ONEOF_NESTED_MESSAGE, e); e = TestAllTypesLite.OneofFieldCase.forNumber(1000); - assertThat(e).isNull(); + assertNull(e); } } diff --git a/java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java b/java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java index a1b80b39d43e63b583086153aa42eed4c16c5b95..60c8609cf42d45c03741feb26eb8f96b3f187e39 100644 --- a/java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java +++ b/java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java b/java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java index ee9f52b6b661c2cf6db72edc3d2ed657295efaa0..05aaa67521f273e008bbf0bf59138cb4d6f556ce 100644 --- a/java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java +++ b/java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java b/java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java index 594d68630570008940ed888b2a9c0f939d77dc81..3ef93ac9f855a88c0e97c6d99f862795affb50d3 100644 --- a/java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java +++ b/java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java b/java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java index 198796a96f4d607cf49f02b3341e5766aea2d829..70466ba2e7ac3f17575c893033ba818523b33c4d 100644 --- a/java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java +++ b/java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java @@ -1,23 +1,43 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - -import com.google.common.collect.ImmutableSet; -import com.google.common.reflect.ClassPath; import protobuf_unittest.NonNestedExtension; import protobuf_unittest.NonNestedExtensionLite; -import java.io.IOException; import java.lang.reflect.Method; -import java.net.URL; import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -34,8 +54,9 @@ import org.junit.Ignore; *

      The test mechanism employed here is based on the pattern in {@code * com.google.common.util.concurrent.AbstractFutureFallbackAtomicHelperTest} * - *

      This test is temporarily disabled while we figure out how to fix the class loading used for - * testing lite functionality. + *

      This test is temporarily disabled due to what appears to be a subtle change to class loading + * behavior in Java 11. That seems to have broken the way the test uses a custom ClassLoader to + * exercise Lite functionality. */ @SuppressWarnings("JUnit4ClassUsedInJUnit3") @Ignore @@ -64,21 +85,21 @@ public class ExtensionRegistryFactoryTest extends TestCase { public void testCreate() { ExtensionRegistryLite registry = ExtensionRegistryFactory.create(); - assertThat(registry.getClass()).isEqualTo(ExtensionRegistry.class); + assertEquals(registry.getClass(), ExtensionRegistry.class); } @Override public void testEmpty() { ExtensionRegistryLite emptyRegistry = ExtensionRegistryFactory.createEmpty(); - assertThat(emptyRegistry.getClass()).isEqualTo(ExtensionRegistry.class); - assertThat(emptyRegistry).isEqualTo(ExtensionRegistry.EMPTY_REGISTRY); + assertEquals(emptyRegistry.getClass(), ExtensionRegistry.class); + assertEquals(emptyRegistry, ExtensionRegistry.EMPTY_REGISTRY); } @Override public void testIsFullRegistry() { ExtensionRegistryLite registry = ExtensionRegistryFactory.create(); - assertThat(ExtensionRegistryFactory.isFullRegistry(registry)).isTrue(); + assertTrue(ExtensionRegistryFactory.isFullRegistry(registry)); } @Override @@ -94,24 +115,25 @@ public class ExtensionRegistryFactoryTest extends TestCase { ExtensionRegistry fullRegistry1 = (ExtensionRegistry) registry1; ExtensionRegistry fullRegistry2 = (ExtensionRegistry) registry2; - assertWithMessage("Test is using a non-lite extension") - .that(NonNestedExtensionLite.nonNestedExtensionLite.getClass()) - .isInstanceOf(GeneratedMessageLite.GeneratedExtension.class); - assertWithMessage("Extension is not registered in masqueraded full registry") - .that(fullRegistry1.findImmutableExtensionByName("protobuf_unittest.nonNestedExtension")) - .isNull(); + assertTrue( + "Test is using a non-lite extension", + GeneratedMessageLite.GeneratedExtension.class.isAssignableFrom( + NonNestedExtensionLite.nonNestedExtensionLite.getClass())); + assertNull( + "Extension is not registered in masqueraded full registry", + fullRegistry1.findImmutableExtensionByName("protobuf_unittest.nonNestedExtension")); GeneratedMessageLite.GeneratedExtension extension = registry1.findLiteExtensionByNumber( NonNestedExtensionLite.MessageLiteToBeExtended.getDefaultInstance(), 1); - assertWithMessage("Extension registered in lite registry").that(extension).isNotNull(); - - assertWithMessage("Test is using a non-lite extension") - .that(Extension.class.isAssignableFrom(NonNestedExtension.nonNestedExtension.getClass())) - .isTrue(); - assertWithMessage("Extension is registered in masqueraded full registry") - .that(fullRegistry2.findImmutableExtensionByName("protobuf_unittest.nonNestedExtension")) - .isNotNull(); + assertNotNull("Extension registered in lite registry", extension); + + assertTrue( + "Test is using a non-lite extension", + Extension.class.isAssignableFrom(NonNestedExtension.nonNestedExtension.getClass())); + assertNotNull( + "Extension is registered in masqueraded full registry", + fullRegistry2.findImmutableExtensionByName("protobuf_unittest.nonNestedExtension")); } @Override @@ -119,24 +141,24 @@ public class ExtensionRegistryFactoryTest extends TestCase { ExtensionRegistryLite registry1 = ExtensionRegistryLite.newInstance().getUnmodifiable(); try { NonNestedExtensionLite.registerAllExtensions(registry1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException expected) { } try { registry1.add(NonNestedExtensionLite.nonNestedExtensionLite); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException expected) { } ExtensionRegistryLite registry2 = ExtensionRegistryLite.newInstance().getUnmodifiable(); try { NonNestedExtension.registerAllExtensions((ExtensionRegistry) registry2); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException expected) { } try { registry2.add(NonNestedExtension.nonNestedExtension); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException expected) { } } @@ -149,21 +171,21 @@ public class ExtensionRegistryFactoryTest extends TestCase { public void testCreate() { ExtensionRegistryLite registry = ExtensionRegistryFactory.create(); - assertThat(registry.getClass()).isEqualTo(ExtensionRegistryLite.class); + assertEquals(registry.getClass(), ExtensionRegistryLite.class); } @Override public void testEmpty() { ExtensionRegistryLite emptyRegistry = ExtensionRegistryFactory.createEmpty(); - assertThat(emptyRegistry.getClass()).isEqualTo(ExtensionRegistryLite.class); - assertThat(emptyRegistry).isEqualTo(ExtensionRegistryLite.EMPTY_REGISTRY_LITE); + assertEquals(emptyRegistry.getClass(), ExtensionRegistryLite.class); + assertEquals(emptyRegistry, ExtensionRegistryLite.EMPTY_REGISTRY_LITE); } @Override public void testIsFullRegistry() { ExtensionRegistryLite registry = ExtensionRegistryFactory.create(); - assertThat(ExtensionRegistryFactory.isFullRegistry(registry)).isFalse(); + assertFalse(ExtensionRegistryFactory.isFullRegistry(registry)); } @Override @@ -174,7 +196,7 @@ public class ExtensionRegistryFactoryTest extends TestCase { extension = registry.findLiteExtensionByNumber( NonNestedExtensionLite.MessageLiteToBeExtended.getDefaultInstance(), 1); - assertWithMessage("Extension is registered in Lite registry").that(extension).isNotNull(); + assertNotNull("Extension is registered in Lite registry", extension); } @Override @@ -182,7 +204,7 @@ public class ExtensionRegistryFactoryTest extends TestCase { ExtensionRegistryLite registry = ExtensionRegistryLite.newInstance().getUnmodifiable(); try { NonNestedExtensionLite.registerAllExtensions(registry); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException expected) { } } @@ -230,27 +252,19 @@ public class ExtensionRegistryFactoryTest extends TestCase { * determine the Lite/non-Lite runtime. */ private static ClassLoader getLiteOnlyClassLoader() { - - ImmutableSet classes = ImmutableSet.of(); - try { - classes = ClassPath.from(ExtensionRegistryFactoryTest.class.getClassLoader()).getAllClasses(); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - URL[] urls = new URL[classes.size()]; - int i = 0; - for (ClassPath.ClassInfo classInfo : classes) { - urls[i++] = classInfo.url(); - } - final ImmutableSet classNamesNotInLite = - ImmutableSet.of( - ExtensionRegistryFactory.FULL_REGISTRY_CLASS_NAME, - ExtensionRegistry.EXTENSION_CLASS_NAME); + ClassLoader testClassLoader = ExtensionRegistryFactoryTest.class.getClassLoader(); + final Set classNamesNotInLite = + Collections.unmodifiableSet( + new HashSet( + Arrays.asList( + ExtensionRegistryFactory.FULL_REGISTRY_CLASS_NAME, + ExtensionRegistry.EXTENSION_CLASS_NAME))); // Construct a URLClassLoader delegating to the system ClassLoader, and looking up classes // in jar files based on the URLs already configured for this test's UrlClassLoader. // Certain classes throw a ClassNotFoundException by design. - return new URLClassLoader(urls, ClassLoader.getSystemClassLoader()) { + return new URLClassLoader( + ((URLClassLoader) testClassLoader).getURLs(), ClassLoader.getSystemClassLoader()) { @Override public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { if (classNamesNotInLite.contains(name)) { diff --git a/java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java b/java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java index 8981ab8af2625263850234808c2f3c37c384bc5b..a1c98c0cef8e1fddf4d26dfe3727ae5ab65210d5 100644 --- a/java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java +++ b/java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.EnumDescriptor; import com.google.protobuf.Descriptors.EnumValueDescriptor; @@ -19,15 +40,12 @@ import com.google.protobuf.FieldPresenceTestProto.TestOptionalFieldsOnly; import com.google.protobuf.FieldPresenceTestProto.TestRepeatedFieldsOnly; import com.google.protobuf.testing.proto.TestProto3Optional; import protobuf_unittest.UnittestProto; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Unit tests for protos that doesn't support field presence test for optional non-message fields. */ -@RunWith(JUnit4.class) -public class FieldPresenceTest { +public class FieldPresenceTest extends TestCase { private static boolean hasMethod(Class clazz, String name) { try { if (clazz.getMethod(name) != null) { @@ -42,18 +60,12 @@ public class FieldPresenceTest { private static void assertHasMethodRemoved( Class classWithFieldPresence, Class classWithoutFieldPresence, String camelName) { - assertThat(hasMethod(classWithFieldPresence, "get" + camelName)).isTrue(); - assertThat(hasMethod(classWithFieldPresence, "has" + camelName)).isTrue(); - assertThat(hasMethod(classWithoutFieldPresence, "get" + camelName)).isTrue(); - assertThat(hasMethod(classWithoutFieldPresence, "has" + camelName)).isFalse(); + assertTrue(hasMethod(classWithFieldPresence, "get" + camelName)); + assertTrue(hasMethod(classWithFieldPresence, "has" + camelName)); + assertTrue(hasMethod(classWithoutFieldPresence, "get" + camelName)); + assertFalse(hasMethod(classWithoutFieldPresence, "has" + camelName)); } - private static void assertHasMethodExisting(Class clazz, String camelName) { - assertThat(hasMethod(clazz, "get" + camelName)).isTrue(); - assertThat(hasMethod(clazz, "has" + camelName)).isTrue(); - } - - @Test public void testHasMethod() { // Optional non-message fields don't have a hasFoo() method generated. assertHasMethodRemoved(UnittestProto.TestAllTypes.class, TestAllTypes.class, "OptionalInt32"); @@ -72,120 +84,116 @@ public class FieldPresenceTest { UnittestProto.TestAllTypes.Builder.class, TestAllTypes.Builder.class, "OptionalNestedEnum"); // message fields still have the hasFoo() method generated. - assertThat(TestAllTypes.getDefaultInstance().hasOptionalNestedMessage()).isFalse(); - assertThat(TestAllTypes.newBuilder().hasOptionalNestedMessage()).isFalse(); - - // oneof fields support hasFoo() methods for non-message types. - assertHasMethodExisting(TestAllTypes.class, "OneofUint32"); - assertHasMethodExisting(TestAllTypes.class, "OneofString"); - assertHasMethodExisting(TestAllTypes.class, "OneofBytes"); - assertThat(TestAllTypes.getDefaultInstance().hasOneofNestedMessage()).isFalse(); - assertThat(TestAllTypes.newBuilder().hasOneofNestedMessage()).isFalse(); - - assertHasMethodExisting(TestAllTypes.Builder.class, "OneofUint32"); - assertHasMethodExisting(TestAllTypes.Builder.class, "OneofString"); - assertHasMethodExisting(TestAllTypes.Builder.class, "OneofBytes"); + assertFalse(TestAllTypes.getDefaultInstance().hasOptionalNestedMessage()); + assertFalse(TestAllTypes.newBuilder().hasOptionalNestedMessage()); + + // oneof fields don't have hasFoo() methods for non-message types. + assertHasMethodRemoved(UnittestProto.TestAllTypes.class, TestAllTypes.class, "OneofUint32"); + assertHasMethodRemoved(UnittestProto.TestAllTypes.class, TestAllTypes.class, "OneofString"); + assertHasMethodRemoved(UnittestProto.TestAllTypes.class, TestAllTypes.class, "OneofBytes"); + assertFalse(TestAllTypes.getDefaultInstance().hasOneofNestedMessage()); + assertFalse(TestAllTypes.newBuilder().hasOneofNestedMessage()); + + assertHasMethodRemoved( + UnittestProto.TestAllTypes.Builder.class, TestAllTypes.Builder.class, "OneofUint32"); + assertHasMethodRemoved( + UnittestProto.TestAllTypes.Builder.class, TestAllTypes.Builder.class, "OneofString"); + assertHasMethodRemoved( + UnittestProto.TestAllTypes.Builder.class, TestAllTypes.Builder.class, "OneofBytes"); } - @Test public void testHasMethodForProto3Optional() throws Exception { - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalInt32()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalInt64()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalUint32()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalUint64()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalSint32()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalSint64()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalFixed32()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalFixed64()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalFloat()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalDouble()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalBool()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalString()).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().hasOptionalBytes()).isFalse(); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalInt32()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalInt64()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalUint32()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalUint64()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalSint32()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalSint64()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalFixed32()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalFixed64()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalFloat()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalDouble()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalBool()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalString()); + assertFalse(TestProto3Optional.getDefaultInstance().hasOptionalBytes()); TestProto3Optional.Builder builder = TestProto3Optional.newBuilder().setOptionalInt32(0); - assertThat(builder.hasOptionalInt32()).isTrue(); - assertThat(builder.build().hasOptionalInt32()).isTrue(); + assertTrue(builder.hasOptionalInt32()); + assertTrue(builder.build().hasOptionalInt32()); TestProto3Optional.Builder otherBuilder = TestProto3Optional.newBuilder().setOptionalInt32(1); otherBuilder.mergeFrom(builder.build()); - assertThat(otherBuilder.hasOptionalInt32()).isTrue(); - assertThat(otherBuilder.getOptionalInt32()).isEqualTo(0); + assertTrue(otherBuilder.hasOptionalInt32()); + assertEquals(0, otherBuilder.getOptionalInt32()); TestProto3Optional.Builder builder3 = TestProto3Optional.newBuilder().setOptionalNestedEnumValue(5); - assertThat(builder3.hasOptionalNestedEnum()).isTrue(); + assertTrue(builder3.hasOptionalNestedEnum()); TestProto3Optional.Builder builder4 = TestProto3Optional.newBuilder().setOptionalNestedEnum(TestProto3Optional.NestedEnum.FOO); - assertThat(builder4.hasOptionalNestedEnum()).isTrue(); + assertTrue(builder4.hasOptionalNestedEnum()); TestProto3Optional proto = TestProto3Optional.parseFrom(builder.build().toByteArray()); - assertThat(proto.hasOptionalInt32()).isTrue(); - assertThat(proto.toBuilder().hasOptionalInt32()).isTrue(); + assertTrue(proto.hasOptionalInt32()); + assertTrue(proto.toBuilder().hasOptionalInt32()); } private static void assertProto3OptionalReflection(String name) throws Exception { FieldDescriptor fieldDescriptor = TestProto3Optional.getDescriptor().findFieldByName(name); OneofDescriptor oneofDescriptor = fieldDescriptor.getContainingOneof(); - assertThat(fieldDescriptor.getContainingOneof()).isNotNull(); - assertThat(fieldDescriptor.hasOptionalKeyword()).isTrue(); - assertThat(fieldDescriptor.hasPresence()).isTrue(); + assertNotNull(fieldDescriptor.getContainingOneof()); + assertTrue(fieldDescriptor.hasOptionalKeyword()); + assertTrue(fieldDescriptor.hasPresence()); - assertThat(TestProto3Optional.getDefaultInstance().hasOneof(oneofDescriptor)).isFalse(); - assertThat(TestProto3Optional.getDefaultInstance().getOneofFieldDescriptor(oneofDescriptor)) - .isNull(); + assertFalse(TestProto3Optional.getDefaultInstance().hasOneof(oneofDescriptor)); + assertNull(TestProto3Optional.getDefaultInstance().getOneofFieldDescriptor(oneofDescriptor)); TestProto3Optional.Builder builder = TestProto3Optional.newBuilder(); builder.setField(fieldDescriptor, fieldDescriptor.getDefaultValue()); - assertThat(builder.hasField(fieldDescriptor)).isTrue(); - assertThat(builder.getField(fieldDescriptor)).isEqualTo(fieldDescriptor.getDefaultValue()); - assertThat(builder.build().hasField(fieldDescriptor)).isTrue(); - assertThat(builder.build().getField(fieldDescriptor)) - .isEqualTo(fieldDescriptor.getDefaultValue()); - assertThat(builder.hasOneof(oneofDescriptor)).isTrue(); - assertThat(builder.getOneofFieldDescriptor(oneofDescriptor)).isEqualTo(fieldDescriptor); - assertThat(builder.build().hasOneof(oneofDescriptor)).isTrue(); - assertThat(builder.build().getOneofFieldDescriptor(oneofDescriptor)).isEqualTo(fieldDescriptor); + assertTrue(builder.hasField(fieldDescriptor)); + assertEquals(fieldDescriptor.getDefaultValue(), builder.getField(fieldDescriptor)); + assertTrue(builder.build().hasField(fieldDescriptor)); + assertEquals(fieldDescriptor.getDefaultValue(), builder.build().getField(fieldDescriptor)); + assertTrue(builder.hasOneof(oneofDescriptor)); + assertEquals(fieldDescriptor, builder.getOneofFieldDescriptor(oneofDescriptor)); + assertTrue(builder.build().hasOneof(oneofDescriptor)); + assertEquals(fieldDescriptor, builder.build().getOneofFieldDescriptor(oneofDescriptor)); TestProto3Optional.Builder otherBuilder = TestProto3Optional.newBuilder(); otherBuilder.mergeFrom(builder.build()); - assertThat(otherBuilder.hasField(fieldDescriptor)).isTrue(); - assertThat(otherBuilder.getField(fieldDescriptor)).isEqualTo(fieldDescriptor.getDefaultValue()); + assertTrue(otherBuilder.hasField(fieldDescriptor)); + assertEquals(fieldDescriptor.getDefaultValue(), otherBuilder.getField(fieldDescriptor)); TestProto3Optional proto = TestProto3Optional.parseFrom(builder.build().toByteArray()); - assertThat(proto.hasField(fieldDescriptor)).isTrue(); - assertThat(proto.toBuilder().hasField(fieldDescriptor)).isTrue(); + assertTrue(proto.hasField(fieldDescriptor)); + assertTrue(proto.toBuilder().hasField(fieldDescriptor)); DynamicMessage.Builder dynamicBuilder = DynamicMessage.newBuilder(TestProto3Optional.getDescriptor()); dynamicBuilder.setField(fieldDescriptor, fieldDescriptor.getDefaultValue()); - assertThat(dynamicBuilder.hasField(fieldDescriptor)).isTrue(); - assertThat(dynamicBuilder.getField(fieldDescriptor)) - .isEqualTo(fieldDescriptor.getDefaultValue()); - assertThat(dynamicBuilder.build().hasField(fieldDescriptor)).isTrue(); - assertThat(dynamicBuilder.build().getField(fieldDescriptor)) - .isEqualTo(fieldDescriptor.getDefaultValue()); - assertThat(dynamicBuilder.hasOneof(oneofDescriptor)).isTrue(); - assertThat(dynamicBuilder.getOneofFieldDescriptor(oneofDescriptor)).isEqualTo(fieldDescriptor); - assertThat(dynamicBuilder.build().hasOneof(oneofDescriptor)).isTrue(); - assertThat(dynamicBuilder.build().getOneofFieldDescriptor(oneofDescriptor)) - .isEqualTo(fieldDescriptor); + assertTrue(dynamicBuilder.hasField(fieldDescriptor)); + assertEquals(fieldDescriptor.getDefaultValue(), dynamicBuilder.getField(fieldDescriptor)); + assertTrue(dynamicBuilder.build().hasField(fieldDescriptor)); + assertEquals( + fieldDescriptor.getDefaultValue(), dynamicBuilder.build().getField(fieldDescriptor)); + assertTrue(dynamicBuilder.hasOneof(oneofDescriptor)); + assertEquals(fieldDescriptor, dynamicBuilder.getOneofFieldDescriptor(oneofDescriptor)); + assertTrue(dynamicBuilder.build().hasOneof(oneofDescriptor)); + assertEquals(fieldDescriptor, dynamicBuilder.build().getOneofFieldDescriptor(oneofDescriptor)); DynamicMessage.Builder otherDynamicBuilder = DynamicMessage.newBuilder(TestProto3Optional.getDescriptor()); otherDynamicBuilder.mergeFrom(dynamicBuilder.build()); - assertThat(otherDynamicBuilder.hasField(fieldDescriptor)).isTrue(); - assertThat(otherDynamicBuilder.getField(fieldDescriptor)) - .isEqualTo(fieldDescriptor.getDefaultValue()); + assertTrue(otherDynamicBuilder.hasField(fieldDescriptor)); + assertEquals(fieldDescriptor.getDefaultValue(), otherDynamicBuilder.getField(fieldDescriptor)); DynamicMessage dynamicProto = DynamicMessage.parseFrom(TestProto3Optional.getDescriptor(), builder.build().toByteArray()); - assertThat(dynamicProto.hasField(fieldDescriptor)).isTrue(); - assertThat(dynamicProto.toBuilder().hasField(fieldDescriptor)).isTrue(); + assertTrue(dynamicProto.hasField(fieldDescriptor)); + assertTrue(dynamicProto.toBuilder().hasField(fieldDescriptor)); } - @Test public void testProto3Optional_reflection() throws Exception { assertProto3OptionalReflection("optional_int32"); assertProto3OptionalReflection("optional_int64"); @@ -202,7 +210,6 @@ public class FieldPresenceTest { assertProto3OptionalReflection("optional_bytes"); } - @Test public void testOneofEquals() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestAllTypes message1 = builder.build(); @@ -210,31 +217,29 @@ public class FieldPresenceTest { // messages should be different when check with oneof case. builder.setOneofUint32(0); TestAllTypes message2 = builder.build(); - assertThat(message1.equals(message2)).isFalse(); + assertFalse(message1.equals(message2)); } - @Test public void testLazyField() throws Exception { // Test default constructed message. TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestAllTypes message = builder.build(); - assertThat(message.hasOptionalLazyMessage()).isFalse(); - assertThat(message.getSerializedSize()).isEqualTo(0); - assertThat(message.toByteString()).isEqualTo(ByteString.EMPTY); + assertFalse(message.hasOptionalLazyMessage()); + assertEquals(0, message.getSerializedSize()); + assertEquals(ByteString.EMPTY, message.toByteString()); // Set default instance to the field. builder.setOptionalLazyMessage(TestAllTypes.NestedMessage.getDefaultInstance()); message = builder.build(); - assertThat(message.hasOptionalLazyMessage()).isTrue(); - assertThat(message.getSerializedSize()).isEqualTo(2); + assertTrue(message.hasOptionalLazyMessage()); + assertEquals(2, message.getSerializedSize()); // Test parse zero-length from wire sets the presence. TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteString()); - assertThat(parsed.hasOptionalLazyMessage()).isTrue(); - assertThat(parsed.getOptionalLazyMessage()).isEqualTo(message.getOptionalLazyMessage()); + assertTrue(parsed.hasOptionalLazyMessage()); + assertEquals(message.getOptionalLazyMessage(), parsed.getOptionalLazyMessage()); } - @Test public void testFieldPresence() { // Optional non-message fields set to their default value are treated the // same way as not set. @@ -246,7 +251,7 @@ public class FieldPresenceTest { builder.setOptionalBytes(ByteString.EMPTY); builder.setOptionalNestedEnum(TestAllTypes.NestedEnum.FOO); TestAllTypes message = builder.build(); - assertThat(message.getSerializedSize()).isEqualTo(0); + assertEquals(0, message.getSerializedSize()); // mergeFrom() will ignore such fields. TestAllTypes.Builder a = TestAllTypes.newBuilder(); @@ -261,20 +266,19 @@ public class FieldPresenceTest { b.setOptionalNestedEnum(TestAllTypes.NestedEnum.FOO); a.mergeFrom(b.build()); message = a.build(); - assertThat(message.getOptionalInt32()).isEqualTo(1); - assertThat(message.getOptionalString()).isEqualTo("x"); - assertThat(message.getOptionalBytes()).isEqualTo(ByteString.copyFromUtf8("y")); - assertThat(message.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.BAR); + assertEquals(1, message.getOptionalInt32()); + assertEquals("x", message.getOptionalString()); + assertEquals(ByteString.copyFromUtf8("y"), message.getOptionalBytes()); + assertEquals(TestAllTypes.NestedEnum.BAR, message.getOptionalNestedEnum()); // equals()/hashCode() should produce the same results. TestAllTypes empty = TestAllTypes.getDefaultInstance(); message = builder.build(); - assertThat(empty).isEqualTo(message); - assertThat(message).isEqualTo(empty); - assertThat(message.hashCode()).isEqualTo(empty.hashCode()); + assertEquals(message, empty); + assertEquals(empty, message); + assertEquals(empty.hashCode(), message.hashCode()); } - @Test public void testFieldPresenceByReflection() { Descriptor descriptor = TestAllTypes.getDescriptor(); FieldDescriptor optionalInt32Field = descriptor.findFieldByName("optional_int32"); @@ -284,11 +288,11 @@ public class FieldPresenceTest { // Field not present. TestAllTypes message = TestAllTypes.getDefaultInstance(); - assertThat(message.hasField(optionalInt32Field)).isFalse(); - assertThat(message.hasField(optionalStringField)).isFalse(); - assertThat(message.hasField(optionalBytesField)).isFalse(); - assertThat(message.hasField(optionalNestedEnumField)).isFalse(); - assertThat(message.getAllFields()).isEmpty(); + assertFalse(message.hasField(optionalInt32Field)); + assertFalse(message.hasField(optionalStringField)); + assertFalse(message.hasField(optionalBytesField)); + assertFalse(message.hasField(optionalNestedEnumField)); + assertEquals(0, message.getAllFields().size()); // Field set to default value is seen as not present. message = @@ -298,11 +302,11 @@ public class FieldPresenceTest { .setOptionalBytes(ByteString.EMPTY) .setOptionalNestedEnum(TestAllTypes.NestedEnum.FOO) .build(); - assertThat(message.hasField(optionalInt32Field)).isFalse(); - assertThat(message.hasField(optionalStringField)).isFalse(); - assertThat(message.hasField(optionalBytesField)).isFalse(); - assertThat(message.hasField(optionalNestedEnumField)).isFalse(); - assertThat(message.getAllFields()).isEmpty(); + assertFalse(message.hasField(optionalInt32Field)); + assertFalse(message.hasField(optionalStringField)); + assertFalse(message.hasField(optionalBytesField)); + assertFalse(message.hasField(optionalNestedEnumField)); + assertEquals(0, message.getAllFields().size()); // Field set to non-default value is seen as present. message = @@ -312,14 +316,13 @@ public class FieldPresenceTest { .setOptionalBytes(ByteString.copyFromUtf8("y")) .setOptionalNestedEnum(TestAllTypes.NestedEnum.BAR) .build(); - assertThat(message.hasField(optionalInt32Field)).isTrue(); - assertThat(message.hasField(optionalStringField)).isTrue(); - assertThat(message.hasField(optionalBytesField)).isTrue(); - assertThat(message.hasField(optionalNestedEnumField)).isTrue(); - assertThat(message.getAllFields()).hasSize(4); + assertTrue(message.hasField(optionalInt32Field)); + assertTrue(message.hasField(optionalStringField)); + assertTrue(message.hasField(optionalBytesField)); + assertTrue(message.hasField(optionalNestedEnumField)); + assertEquals(4, message.getAllFields().size()); } - @Test public void testFieldPresenceDynamicMessage() { Descriptor descriptor = TestAllTypes.getDescriptor(); FieldDescriptor optionalInt32Field = descriptor.findFieldByName("optional_int32"); @@ -333,11 +336,11 @@ public class FieldPresenceTest { DynamicMessage defaultInstance = DynamicMessage.getDefaultInstance(descriptor); // Field not present. DynamicMessage message = defaultInstance.newBuilderForType().build(); - assertThat(message.hasField(optionalInt32Field)).isFalse(); - assertThat(message.hasField(optionalStringField)).isFalse(); - assertThat(message.hasField(optionalBytesField)).isFalse(); - assertThat(message.hasField(optionalNestedEnumField)).isFalse(); - assertThat(message.getAllFields()).isEmpty(); + assertFalse(message.hasField(optionalInt32Field)); + assertFalse(message.hasField(optionalStringField)); + assertFalse(message.hasField(optionalBytesField)); + assertFalse(message.hasField(optionalNestedEnumField)); + assertEquals(0, message.getAllFields().size()); // Field set to non-default value is seen as present. message = @@ -348,11 +351,11 @@ public class FieldPresenceTest { .setField(optionalBytesField, ByteString.copyFromUtf8("y")) .setField(optionalNestedEnumField, nonDefaultEnumValueDescriptor) .build(); - assertThat(message.hasField(optionalInt32Field)).isTrue(); - assertThat(message.hasField(optionalStringField)).isTrue(); - assertThat(message.hasField(optionalBytesField)).isTrue(); - assertThat(message.hasField(optionalNestedEnumField)).isTrue(); - assertThat(message.getAllFields()).hasSize(4); + assertTrue(message.hasField(optionalInt32Field)); + assertTrue(message.hasField(optionalStringField)); + assertTrue(message.hasField(optionalBytesField)); + assertTrue(message.hasField(optionalNestedEnumField)); + assertEquals(4, message.getAllFields().size()); // Field set to default value is seen as not present. message = @@ -363,38 +366,36 @@ public class FieldPresenceTest { .setField(optionalBytesField, ByteString.EMPTY) .setField(optionalNestedEnumField, defaultEnumValueDescriptor) .build(); - assertThat(message.hasField(optionalInt32Field)).isFalse(); - assertThat(message.hasField(optionalStringField)).isFalse(); - assertThat(message.hasField(optionalBytesField)).isFalse(); - assertThat(message.hasField(optionalNestedEnumField)).isFalse(); - assertThat(message.getAllFields()).isEmpty(); + assertFalse(message.hasField(optionalInt32Field)); + assertFalse(message.hasField(optionalStringField)); + assertFalse(message.hasField(optionalBytesField)); + assertFalse(message.hasField(optionalNestedEnumField)); + assertEquals(0, message.getAllFields().size()); } - @Test public void testMessageField() { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - assertThat(builder.hasOptionalNestedMessage()).isFalse(); - assertThat(builder.build().hasOptionalNestedMessage()).isFalse(); + assertFalse(builder.hasOptionalNestedMessage()); + assertFalse(builder.build().hasOptionalNestedMessage()); TestAllTypes.NestedMessage.Builder nestedBuilder = builder.getOptionalNestedMessageBuilder(); - assertThat(builder.hasOptionalNestedMessage()).isTrue(); - assertThat(builder.build().hasOptionalNestedMessage()).isTrue(); + assertTrue(builder.hasOptionalNestedMessage()); + assertTrue(builder.build().hasOptionalNestedMessage()); nestedBuilder.setValue(1); - assertThat(builder.build().getOptionalNestedMessage().getValue()).isEqualTo(1); + assertEquals(1, builder.build().getOptionalNestedMessage().getValue()); builder.clearOptionalNestedMessage(); - assertThat(builder.hasOptionalNestedMessage()).isFalse(); - assertThat(builder.build().hasOptionalNestedMessage()).isFalse(); + assertFalse(builder.hasOptionalNestedMessage()); + assertFalse(builder.build().hasOptionalNestedMessage()); // Unlike non-message fields, if we set a message field to its default value (i.e., // default instance), the field should be seen as present. builder.setOptionalNestedMessage(TestAllTypes.NestedMessage.getDefaultInstance()); - assertThat(builder.hasOptionalNestedMessage()).isTrue(); - assertThat(builder.build().hasOptionalNestedMessage()).isTrue(); + assertTrue(builder.hasOptionalNestedMessage()); + assertTrue(builder.build().hasOptionalNestedMessage()); } - @Test public void testSerializeAndParse() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.setOptionalInt32(1234); @@ -406,21 +407,20 @@ public class FieldPresenceTest { ByteString data = builder.build().toByteString(); TestAllTypes message = TestAllTypes.parseFrom(data); - assertThat(message.getOptionalInt32()).isEqualTo(1234); - assertThat(message.getOptionalString()).isEqualTo("hello"); + assertEquals(1234, message.getOptionalInt32()); + assertEquals("hello", message.getOptionalString()); // Fields not set will have the default value. - assertThat(message.getOptionalBytes()).isEqualTo(ByteString.EMPTY); - assertThat(message.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.FOO); + assertEquals(ByteString.EMPTY, message.getOptionalBytes()); + assertEquals(TestAllTypes.NestedEnum.FOO, message.getOptionalNestedEnum()); // The message field is set despite that it's set with a default instance. - assertThat(message.hasOptionalNestedMessage()).isTrue(); - assertThat(message.getOptionalNestedMessage().getValue()).isEqualTo(0); + assertTrue(message.hasOptionalNestedMessage()); + assertEquals(0, message.getOptionalNestedMessage().getValue()); // The oneof field set to its default value is also present. - assertThat(message.getOneofFieldCase()).isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_INT32); + assertEquals(TestAllTypes.OneofFieldCase.ONEOF_INT32, message.getOneofFieldCase()); } // Regression test for b/16173397 // Make sure we haven't screwed up the code generation for repeated fields. - @Test public void testRepeatedFields() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.setOptionalInt32(1234); @@ -432,49 +432,49 @@ public class FieldPresenceTest { ByteString data = builder.build().toByteString(); TestOptionalFieldsOnly optionalOnlyMessage = TestOptionalFieldsOnly.parseFrom(data); - assertThat(optionalOnlyMessage.getOptionalInt32()).isEqualTo(1234); - assertThat(optionalOnlyMessage.getOptionalString()).isEqualTo("hello"); - assertThat(optionalOnlyMessage.hasOptionalNestedMessage()).isTrue(); - assertThat(optionalOnlyMessage.getOptionalNestedMessage().getValue()).isEqualTo(0); + assertEquals(1234, optionalOnlyMessage.getOptionalInt32()); + assertEquals("hello", optionalOnlyMessage.getOptionalString()); + assertTrue(optionalOnlyMessage.hasOptionalNestedMessage()); + assertEquals(0, optionalOnlyMessage.getOptionalNestedMessage().getValue()); TestRepeatedFieldsOnly repeatedOnlyMessage = TestRepeatedFieldsOnly.parseFrom(data); - assertThat(repeatedOnlyMessage.getRepeatedInt32Count()).isEqualTo(1); - assertThat(repeatedOnlyMessage.getRepeatedInt32(0)).isEqualTo(4321); - assertThat(repeatedOnlyMessage.getRepeatedStringCount()).isEqualTo(1); - assertThat(repeatedOnlyMessage.getRepeatedString(0)).isEqualTo("world"); - assertThat(repeatedOnlyMessage.getRepeatedNestedMessageCount()).isEqualTo(1); - assertThat(repeatedOnlyMessage.getRepeatedNestedMessage(0).getValue()).isEqualTo(0); + assertEquals(1, repeatedOnlyMessage.getRepeatedInt32Count()); + assertEquals(4321, repeatedOnlyMessage.getRepeatedInt32(0)); + assertEquals(1, repeatedOnlyMessage.getRepeatedStringCount()); + assertEquals("world", repeatedOnlyMessage.getRepeatedString(0)); + assertEquals(1, repeatedOnlyMessage.getRepeatedNestedMessageCount()); + assertEquals(0, repeatedOnlyMessage.getRepeatedNestedMessage(0).getValue()); } - @Test public void testIsInitialized() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); // Test optional proto2 message fields. UnittestProto.TestRequired.Builder proto2Builder = builder.getOptionalProto2MessageBuilder(); - assertThat(builder.isInitialized()).isFalse(); - assertThat(builder.buildPartial().isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); + assertFalse(builder.buildPartial().isInitialized()); proto2Builder.setA(1).setB(2).setC(3); - assertThat(builder.isInitialized()).isTrue(); - assertThat(builder.buildPartial().isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); + assertTrue(builder.buildPartial().isInitialized()); // Test oneof proto2 message fields. proto2Builder = builder.getOneofProto2MessageBuilder(); - assertThat(builder.isInitialized()).isFalse(); - assertThat(builder.buildPartial().isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); + assertFalse(builder.buildPartial().isInitialized()); proto2Builder.setA(1).setB(2).setC(3); - assertThat(builder.isInitialized()).isTrue(); - assertThat(builder.buildPartial().isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); + assertTrue(builder.buildPartial().isInitialized()); // Test repeated proto2 message fields. proto2Builder = builder.addRepeatedProto2MessageBuilder(); - assertThat(builder.isInitialized()).isFalse(); - assertThat(builder.buildPartial().isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); + assertFalse(builder.buildPartial().isInitialized()); proto2Builder.setA(1).setB(2).setC(3); - assertThat(builder.isInitialized()).isTrue(); - assertThat(builder.buildPartial().isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); + assertTrue(builder.buildPartial().isInitialized()); } + } diff --git a/java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java b/java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java index d289c82994e8d1de2e201ee868ddb4ca63cab16d..091ac5bb784ed181723c108b60f04e4033400c2e 100644 --- a/java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java +++ b/java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java @@ -1,50 +1,68 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static java.util.Arrays.asList; import com.google.protobuf.Internal.FloatList; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Iterator; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests for {@link FloatArrayList}. */ -@RunWith(JUnit4.class) -public class FloatArrayListTest { +/** + * Tests for {@link FloatArrayList}. + * + * @author dweis@google.com (Daniel Weis) + */ +public class FloatArrayListTest extends TestCase { private static final FloatArrayList UNARY_LIST = newImmutableFloatArrayList(1); private static final FloatArrayList TERTIARY_LIST = newImmutableFloatArrayList(1, 2, 3); private FloatArrayList list; - @Before - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { list = new FloatArrayList(); } - @Test public void testEmptyListReturnsSameInstance() { - assertThat(FloatArrayList.emptyList()).isSameInstanceAs(FloatArrayList.emptyList()); + assertSame(FloatArrayList.emptyList(), FloatArrayList.emptyList()); } - @Test public void testEmptyListIsImmutable() { assertImmutable(FloatArrayList.emptyList()); } - @Test public void testMakeImmutable() { list.addFloat(3); list.addFloat(4); @@ -54,20 +72,19 @@ public class FloatArrayListTest { assertImmutable(list); } - @Test public void testModificationWithIteration() { list.addAll(asList(1F, 2F, 3F, 4F)); Iterator iterator = list.iterator(); - assertThat(list).hasSize(4); - assertThat((float) list.get(0)).isEqualTo(1F); - assertThat((float) iterator.next()).isEqualTo(1F); + assertEquals(4, list.size()); + assertEquals(1F, (float) list.get(0), 0.0f); + assertEquals(1F, (float) iterator.next(), 0.0f); list.set(0, 1F); - assertThat((float) iterator.next()).isEqualTo(2F); + assertEquals(2F, (float) iterator.next(), 0.0f); list.remove(0); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } @@ -76,211 +93,191 @@ public class FloatArrayListTest { list.add(0, 0F); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } } - @Test public void testGet() { - assertThat((float) TERTIARY_LIST.get(0)).isEqualTo(1F); - assertThat((float) TERTIARY_LIST.get(1)).isEqualTo(2F); - assertThat((float) TERTIARY_LIST.get(2)).isEqualTo(3F); + assertEquals(1F, (float) TERTIARY_LIST.get(0), 0.0f); + assertEquals(2F, (float) TERTIARY_LIST.get(1), 0.0f); + assertEquals(3F, (float) TERTIARY_LIST.get(2), 0.0f); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testGetFloat() { - assertThat(TERTIARY_LIST.getFloat(0)).isEqualTo(1F); - assertThat(TERTIARY_LIST.getFloat(1)).isEqualTo(2F); - assertThat(TERTIARY_LIST.getFloat(2)).isEqualTo(3F); + assertEquals(1F, TERTIARY_LIST.getFloat(0), 0.0f); + assertEquals(2F, TERTIARY_LIST.getFloat(1), 0.0f); + assertEquals(3F, TERTIARY_LIST.getFloat(2), 0.0f); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testIndexOf_nullElement() { - assertThat(TERTIARY_LIST.indexOf(null)).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(null)); } - @Test public void testIndexOf_incompatibleElementType() { - assertThat(TERTIARY_LIST.indexOf(new Object())).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(new Object())); } - @Test public void testIndexOf_notInList() { - assertThat(UNARY_LIST.indexOf(2F)).isEqualTo(-1); + assertEquals(-1, UNARY_LIST.indexOf(2F)); } - @Test public void testIndexOf_notInListWithDuplicates() { FloatArrayList listWithDupes = newImmutableFloatArrayList(1F, 1F); - assertThat(listWithDupes.indexOf(2F)).isEqualTo(-1); + assertEquals(-1, listWithDupes.indexOf(2F)); } - @Test public void testIndexOf_inList() { - assertThat(TERTIARY_LIST.indexOf(2F)).isEqualTo(1); + assertEquals(1, TERTIARY_LIST.indexOf(2F)); } - @Test public void testIndexOf_inListWithDuplicates_matchAtHead() { FloatArrayList listWithDupes = newImmutableFloatArrayList(1F, 1F, 2F); - assertThat(listWithDupes.indexOf(1F)).isEqualTo(0); + assertEquals(0, listWithDupes.indexOf(1F)); } - @Test public void testIndexOf_inListWithDuplicates_matchMidList() { FloatArrayList listWithDupes = newImmutableFloatArrayList(2F, 1F, 1F, 2F); - assertThat(listWithDupes.indexOf(1F)).isEqualTo(1); + assertEquals(1, listWithDupes.indexOf(1F)); } - @Test public void testContains_nullElement() { - assertThat(TERTIARY_LIST).doesNotContain(null); + assertEquals(false, TERTIARY_LIST.contains(null)); } - @Test public void testContains_incompatibleElementType() { - assertThat(TERTIARY_LIST).doesNotContain(new Object()); + assertEquals(false, TERTIARY_LIST.contains(new Object())); } - @Test public void testContains_notInList() { - assertThat(UNARY_LIST).doesNotContain(2F); + assertEquals(false, UNARY_LIST.contains(2F)); } - @Test public void testContains_notInListWithDuplicates() { FloatArrayList listWithDupes = newImmutableFloatArrayList(1F, 1F); - assertThat(listWithDupes).doesNotContain(2F); + assertEquals(false, listWithDupes.contains(2F)); } - @Test public void testContains_inList() { - assertThat(TERTIARY_LIST).contains(2F); + assertEquals(true, TERTIARY_LIST.contains(2F)); } - @Test public void testContains_inListWithDuplicates_matchAtHead() { FloatArrayList listWithDupes = newImmutableFloatArrayList(1F, 1F, 2F); - assertThat(listWithDupes).contains(1F); + assertEquals(true, listWithDupes.contains(1F)); } - @Test public void testContains_inListWithDuplicates_matchMidList() { FloatArrayList listWithDupes = newImmutableFloatArrayList(2F, 1F, 1F, 2F); - assertThat(listWithDupes).contains(1F); + assertEquals(true, listWithDupes.contains(1F)); } - @Test public void testSize() { - assertThat(FloatArrayList.emptyList()).isEmpty(); - assertThat(UNARY_LIST).hasSize(1); - assertThat(TERTIARY_LIST).hasSize(3); + assertEquals(0, FloatArrayList.emptyList().size()); + assertEquals(1, UNARY_LIST.size()); + assertEquals(3, TERTIARY_LIST.size()); list.addFloat(3); list.addFloat(4); list.addFloat(6); list.addFloat(8); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); list.remove(0); - assertThat(list).hasSize(3); + assertEquals(3, list.size()); list.add(17F); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); } - @Test public void testSet() { list.addFloat(2); list.addFloat(4); - assertThat((float) list.set(0, 3F)).isEqualTo(2F); - assertThat(list.getFloat(0)).isEqualTo(3F); + assertEquals(2F, (float) list.set(0, 3F), 0.0f); + assertEquals(3F, list.getFloat(0), 0.0f); - assertThat((float) list.set(1, 0F)).isEqualTo(4F); - assertThat(list.getFloat(1)).isEqualTo(0F); + assertEquals(4F, (float) list.set(1, 0F), 0.0f); + assertEquals(0F, list.getFloat(1), 0.0f); try { list.set(-1, 0F); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.set(2, 0F); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testSetFloat() { list.addFloat(1); list.addFloat(3); - assertThat(list.setFloat(0, 0)).isEqualTo(1F); - assertThat(list.getFloat(0)).isEqualTo(0F); + assertEquals(1F, list.setFloat(0, 0), 0.0f); + assertEquals(0F, list.getFloat(0), 0.0f); - assertThat(list.setFloat(1, 0)).isEqualTo(3F); - assertThat(list.getFloat(1)).isEqualTo(0F); + assertEquals(3F, list.setFloat(1, 0), 0.0f); + assertEquals(0F, list.getFloat(1), 0.0f); try { list.setFloat(-1, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.setFloat(2, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testAdd() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.add(2F)).isTrue(); - assertThat(list).containsExactly(2F); + assertTrue(list.add(2F)); + assertEquals(asList(2F), list); - assertThat(list.add(3F)).isTrue(); + assertTrue(list.add(3F)); list.add(0, 4F); - assertThat(list).containsExactly(4F, 2F, 3F).inOrder(); + assertEquals(asList(4F, 2F, 3F), list); list.add(0, 1F); list.add(0, 0F); @@ -288,7 +285,7 @@ public class FloatArrayListTest { for (int i = 0; i < 6; i++) { list.add(Float.valueOf(5 + i)); } - assertThat(list).containsExactly(0F, 1F, 4F, 2F, 3F, 5F, 6F, 7F, 8F, 9F, 10F).inOrder(); + assertEquals(asList(0F, 1F, 4F, 2F, 3F, 5F, 6F, 7F, 8F, 9F, 10F), list); try { list.add(-1, 5F); @@ -303,100 +300,92 @@ public class FloatArrayListTest { } } - @Test public void testAddFloat() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); list.addFloat(2); - assertThat(list).containsExactly(2F); + assertEquals(asList(2F), list); list.addFloat(3); - assertThat(list).containsExactly(2F, 3F).inOrder(); + assertEquals(asList(2F, 3F), list); } - @Test public void testAddAll() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.addAll(Collections.singleton(1F))).isTrue(); - assertThat(list).hasSize(1); - assertThat((float) list.get(0)).isEqualTo(1F); - assertThat(list.getFloat(0)).isEqualTo(1F); + assertTrue(list.addAll(Collections.singleton(1F))); + assertEquals(1, list.size()); + assertEquals(1F, (float) list.get(0), 0.0f); + assertEquals(1F, list.getFloat(0), 0.0f); - assertThat(list.addAll(asList(2F, 3F, 4F, 5F, 6F))).isTrue(); - assertThat(list).containsExactly(1F, 2F, 3F, 4F, 5F, 6F).inOrder(); + assertTrue(list.addAll(asList(2F, 3F, 4F, 5F, 6F))); + assertEquals(asList(1F, 2F, 3F, 4F, 5F, 6F), list); - assertThat(list.addAll(TERTIARY_LIST)).isTrue(); - assertThat(list).containsExactly(1F, 2F, 3F, 4F, 5F, 6F, 1F, 2F, 3F).inOrder(); + assertTrue(list.addAll(TERTIARY_LIST)); + assertEquals(asList(1F, 2F, 3F, 4F, 5F, 6F, 1F, 2F, 3F), list); - assertThat(list.addAll(Collections.emptyList())).isFalse(); - assertThat(list.addAll(FloatArrayList.emptyList())).isFalse(); + assertFalse(list.addAll(Collections.emptyList())); + assertFalse(list.addAll(FloatArrayList.emptyList())); } - @Test public void testEquals() { FloatArrayList list1 = new FloatArrayList(); FloatArrayList list2 = new FloatArrayList(); list1.addFloat(Float.intBitsToFloat(0xff800001)); list2.addFloat(Float.intBitsToFloat(0xff800002)); - assertThat(list1).isEqualTo(list2); + assertEquals(list1, list2); } - @Test public void testRemove() { list.addAll(TERTIARY_LIST); - assertThat((float) list.remove(0)).isEqualTo(1F); - assertThat(list).containsExactly(2F, 3F).inOrder(); + assertEquals(1F, (float) list.remove(0), 0.0f); + assertEquals(asList(2F, 3F), list); - assertThat(list.remove(Float.valueOf(3))).isTrue(); - assertThat(list).containsExactly(2F); + assertTrue(list.remove(Float.valueOf(3))); + assertEquals(asList(2F), list); - assertThat(list.remove(Float.valueOf(3))).isFalse(); - assertThat(list).containsExactly(2F); + assertFalse(list.remove(Float.valueOf(3))); + assertEquals(asList(2F), list); - assertThat((float) list.remove(0)).isEqualTo(2F); - assertThat(list).isEmpty(); + assertEquals(2F, (float) list.remove(0), 0.0f); + assertEquals(asList(), list); try { list.remove(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.remove(0); - assertWithMessage("expected exception").fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testRemoveEnd_listAtCapacity() { FloatList toRemove = FloatArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addFloat(3); toRemove.remove(0); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } - @Test public void testRemove_listAtCapacity() { FloatList toRemove = FloatArrayList.emptyList().mutableCopyWithCapacity(2); toRemove.addFloat(3); toRemove.addFloat(4); toRemove.remove(0); - assertThat(toRemove).hasSize(1); - assertThat((float) toRemove.get(0)).isEqualTo(4F); + assertEquals(1, toRemove.size()); + assertEquals(4F, (float) toRemove.get(0)); } - @Test public void testSublistRemoveEndOfCapacity() { FloatList toRemove = FloatArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addFloat(3); toRemove.subList(0, 1).clear(); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } private void assertImmutable(FloatList list) { @@ -406,147 +395,147 @@ public class FloatArrayListTest { try { list.add(1F); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.add(0, 1F); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.singletonList(1F)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(new FloatArrayList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.singleton(1F)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addFloat(0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.clear(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.singleton(1F)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.singleton(1F)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, 0F); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.setFloat(0, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } diff --git a/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java b/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java index dbe3072fb7de3cafc4cd4fcd7f55c72af36a14cb..9261a361220884114c06ae0f6499f3f9ed00ef39 100644 --- a/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java +++ b/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java @@ -1,15 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.test.UnittestImport; @@ -42,49 +62,29 @@ import protobuf_unittest.UnittestProto.TestPackedTypes; import protobuf_unittest.UnittestProto.TestUnpackedTypes; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; -import org.junit.After; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Unit test for generated messages and generated code. See also {@link MessageTest}, which tests * some generated message functionality. + * + * @author kenton@google.com Kenton Varda */ -@SuppressWarnings({"ProtoBuilderReturnValueIgnored", "ReturnValueIgnored"}) -@RunWith(JUnit4.class) -public class GeneratedMessageTest { - - private static final TestOneof2 EXPECTED_MERGED_MESSAGE = - TestOneof2.newBuilder() - .setFooMessage(TestOneof2.NestedMessage.newBuilder().addCorgeInt(1).addCorgeInt(2)) - .build(); - - private static final TestOneof2 MESSAGE_TO_MERGE_FROM = - TestOneof2.newBuilder() - .setFooMessage(TestOneof2.NestedMessage.newBuilder().addCorgeInt(2)) - .build(); - - private static final FieldDescriptor NESTED_MESSAGE_BB_FIELD = - UnittestProto.TestAllTypes.NestedMessage.getDescriptor().findFieldByName("bb"); - +public class GeneratedMessageTest extends TestCase { TestUtil.ReflectionTester reflectionTester = new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null); - @After + @Override public void tearDown() { GeneratedMessageV3.setAlwaysUseFieldBuildersForTesting(false); } - @Test public void testGetFieldBuilderForExtensionField() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); Message.Builder fieldBuilder = @@ -93,17 +93,18 @@ public class GeneratedMessageTest { FieldDescriptor field = NestedMessage.getDescriptor().findFieldByNumber(NestedMessage.BB_FIELD_NUMBER); fieldBuilder.setField(field, expected); - assertThat(builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()); // fieldBuilder still updates the builder after builder build() has been called. expected += 100; fieldBuilder.setField(field, expected); - assertThat(builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()); } - @Test public void testGetFieldBuilderWithExistingMessage() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); builder.setExtension( @@ -115,17 +116,18 @@ public class GeneratedMessageTest { FieldDescriptor field = NestedMessage.getDescriptor().findFieldByNumber(NestedMessage.BB_FIELD_NUMBER); fieldBuilder.setField(field, expected); - assertThat(builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()); // fieldBuilder still updates the builder after builder build() has been called. expected += 100; fieldBuilder.setField(field, expected); - assertThat(builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()); } - @Test public void testGetFieldBuilderWithExistingBuilder() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); NestedMessage.Builder nestedMessageBuilder = NestedMessage.newBuilder().setBb(123); @@ -137,23 +139,25 @@ public class GeneratedMessageTest { FieldDescriptor field = NestedMessage.getDescriptor().findFieldByNumber(NestedMessage.BB_FIELD_NUMBER); fieldBuilder.setField(field, expected); - assertThat(builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()); // Existing nestedMessageBuilder will also update builder. expected += 100; nestedMessageBuilder.setBb(expected); - assertThat(builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()); // fieldBuilder still updates the builder. expected += 100; fieldBuilder.setField(field, expected); - assertThat(builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.optionalNestedMessageExtension).getBb()); } - @Test public void testGetRepeatedFieldBuilderForExtensionField() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); builder.addExtension( @@ -166,19 +170,18 @@ public class GeneratedMessageTest { FieldDescriptor field = NestedMessage.getDescriptor().findFieldByNumber(NestedMessage.BB_FIELD_NUMBER); fieldBuilder.setField(field, expected); - assertThat( - builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()); // fieldBuilder still updates the builder after builder build() has been called. expected += 100; fieldBuilder.setField(field, expected); - assertThat( - builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()); } - @Test public void testGetRepeatedFieldBuilderForExistingBuilder() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); NestedMessage.Builder nestedMessageBuilder = NestedMessage.newBuilder().setBb(123); @@ -191,61 +194,59 @@ public class GeneratedMessageTest { FieldDescriptor field = NestedMessage.getDescriptor().findFieldByNumber(NestedMessage.BB_FIELD_NUMBER); fieldBuilder.setField(field, expected); - assertThat( - builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()); // Existing nestedMessageBuilder will also update builder. expected += 100; nestedMessageBuilder.setBb(expected); - assertThat( - builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()); // fieldBuilder still updates the builder. expected += 100; fieldBuilder.setField(field, expected); - assertThat( - builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()) - .isEqualTo(expected); + assertEquals( + expected, + builder.build().getExtension(UnittestProto.repeatedNestedMessageExtension, 0).getBb()); } - @Test public void testGetExtensionFieldOutOfBound() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); try { builder.getRepeatedField(UnittestProto.repeatedNestedMessageExtension.getDescriptor(), 0); - assertWithMessage("Expected IndexOutOfBoundsException to be thrown").fail(); + fail("Expected IndexOutOfBoundsException to be thrown"); } catch (IndexOutOfBoundsException expected) { } try { builder.getExtension(UnittestProto.repeatedNestedMessageExtension, 0); - assertWithMessage("Expected IndexOutOfBoundsException to be thrown").fail(); + fail("Expected IndexOutOfBoundsException to be thrown"); } catch (IndexOutOfBoundsException expected) { } TestAllExtensions extensionsMessage = builder.build(); try { extensionsMessage.getRepeatedField( UnittestProto.repeatedNestedMessageExtension.getDescriptor(), 0); - assertWithMessage("Expected IndexOutOfBoundsException to be thrown").fail(); + fail("Expected IndexOutOfBoundsException to be thrown"); } catch (IndexOutOfBoundsException expected) { } try { extensionsMessage.getExtension(UnittestProto.repeatedNestedMessageExtension, 0); - assertWithMessage("Expected IndexOutOfBoundsException to be thrown").fail(); + fail("Expected IndexOutOfBoundsException to be thrown"); } catch (IndexOutOfBoundsException expected) { } } - @Test public void testDefaultInstance() throws Exception { - assertThat(TestAllTypes.getDefaultInstance()) - .isSameInstanceAs(TestAllTypes.getDefaultInstance().getDefaultInstanceForType()); - assertThat(TestAllTypes.getDefaultInstance()) - .isSameInstanceAs(TestAllTypes.newBuilder().getDefaultInstanceForType()); + assertSame( + TestAllTypes.getDefaultInstance(), + TestAllTypes.getDefaultInstance().getDefaultInstanceForType()); + assertSame( + TestAllTypes.getDefaultInstance(), TestAllTypes.newBuilder().getDefaultInstanceForType()); } - @Test public void testMessageOrBuilder() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -253,7 +254,6 @@ public class GeneratedMessageTest { TestUtil.assertAllFieldsSet(message); } - @Test public void testUsingBuilderMultipleTimes() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); // primitive field scalar and repeated @@ -268,12 +268,12 @@ public class GeneratedMessageTest { TestAllTypes value1 = builder.build(); - assertThat(value1.getOptionalSfixed64()).isEqualTo(100); - assertThat(value1.getRepeatedInt32(0)).isEqualTo(100); - assertThat(value1.getOptionalImportEnum()).isEqualTo(UnittestImport.ImportEnum.IMPORT_BAR); - assertThat(value1.getRepeatedImportEnum(0)).isEqualTo(UnittestImport.ImportEnum.IMPORT_BAR); - assertThat(value1.getOptionalForeignMessage().getC()).isEqualTo(1); - assertThat(value1.getRepeatedForeignMessage(0).getC()).isEqualTo(1); + assertEquals(100, value1.getOptionalSfixed64()); + assertEquals(100, value1.getRepeatedInt32(0)); + assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, value1.getOptionalImportEnum()); + assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, value1.getRepeatedImportEnum(0)); + assertEquals(1, value1.getOptionalForeignMessage().getC()); + assertEquals(1, value1.getRepeatedForeignMessage(0).getC()); // Make sure that builder didn't update previously created values builder.setOptionalSfixed64(200); @@ -286,23 +286,22 @@ public class GeneratedMessageTest { TestAllTypes value2 = builder.build(); // Make sure value1 didn't change. - assertThat(value1.getOptionalSfixed64()).isEqualTo(100); - assertThat(value1.getRepeatedInt32(0)).isEqualTo(100); - assertThat(value1.getOptionalImportEnum()).isEqualTo(UnittestImport.ImportEnum.IMPORT_BAR); - assertThat(value1.getRepeatedImportEnum(0)).isEqualTo(UnittestImport.ImportEnum.IMPORT_BAR); - assertThat(value1.getOptionalForeignMessage().getC()).isEqualTo(1); - assertThat(value1.getRepeatedForeignMessage(0).getC()).isEqualTo(1); + assertEquals(100, value1.getOptionalSfixed64()); + assertEquals(100, value1.getRepeatedInt32(0)); + assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, value1.getOptionalImportEnum()); + assertEquals(UnittestImport.ImportEnum.IMPORT_BAR, value1.getRepeatedImportEnum(0)); + assertEquals(1, value1.getOptionalForeignMessage().getC()); + assertEquals(1, value1.getRepeatedForeignMessage(0).getC()); // Make sure value2 is correct - assertThat(value2.getOptionalSfixed64()).isEqualTo(200); - assertThat(value2.getRepeatedInt32(0)).isEqualTo(200); - assertThat(value2.getOptionalImportEnum()).isEqualTo(UnittestImport.ImportEnum.IMPORT_FOO); - assertThat(value2.getRepeatedImportEnum(0)).isEqualTo(UnittestImport.ImportEnum.IMPORT_FOO); - assertThat(value2.getOptionalForeignMessage().getC()).isEqualTo(2); - assertThat(value2.getRepeatedForeignMessage(0).getC()).isEqualTo(2); + assertEquals(200, value2.getOptionalSfixed64()); + assertEquals(200, value2.getRepeatedInt32(0)); + assertEquals(UnittestImport.ImportEnum.IMPORT_FOO, value2.getOptionalImportEnum()); + assertEquals(UnittestImport.ImportEnum.IMPORT_FOO, value2.getRepeatedImportEnum(0)); + assertEquals(2, value2.getOptionalForeignMessage().getC()); + assertEquals(2, value2.getRepeatedForeignMessage(0).getC()); } - @Test public void testProtosShareRepeatedArraysIfDidntChange() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.addRepeatedInt32(100); @@ -311,12 +310,10 @@ public class GeneratedMessageTest { TestAllTypes value1 = builder.build(); TestAllTypes value2 = value1.toBuilder().build(); - assertThat(value1.getRepeatedInt32List()).isSameInstanceAs(value2.getRepeatedInt32List()); - assertThat(value1.getRepeatedForeignMessageList()) - .isSameInstanceAs(value2.getRepeatedForeignMessageList()); + assertSame(value1.getRepeatedInt32List(), value2.getRepeatedInt32List()); + assertSame(value1.getRepeatedForeignMessageList(), value2.getRepeatedForeignMessageList()); } - @Test public void testRepeatedArraysAreImmutable() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.addRepeatedInt32(100); @@ -334,9 +331,8 @@ public class GeneratedMessageTest { assertIsUnmodifiable(value.getRepeatedFloatList()); } - @Test public void testParsedMessagesAreImmutable() throws Exception { - TestAllTypes value = TestAllTypes.parseFrom(TestUtil.getAllSet().toByteString()); + TestAllTypes value = TestAllTypes.parser().parseFrom(TestUtil.getAllSet().toByteString()); assertIsUnmodifiable(value.getRepeatedInt32List()); assertIsUnmodifiable(value.getRepeatedInt64List()); assertIsUnmodifiable(value.getRepeatedUint32List()); @@ -367,79 +363,77 @@ public class GeneratedMessageTest { } else { try { list.clear(); - assertWithMessage("List wasn't immutable").fail(); + fail("List wasn't immutable"); } catch (UnsupportedOperationException e) { // good } } } - @Test public void testSettersRejectNull() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); try { builder.setOptionalString(null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.setOptionalBytes(null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.setOptionalNestedMessage((TestAllTypes.NestedMessage) null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.setOptionalNestedMessage((TestAllTypes.NestedMessage.Builder) null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.setOptionalNestedEnum(null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addRepeatedString(null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addRepeatedBytes(null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addRepeatedNestedMessage((TestAllTypes.NestedMessage) null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addRepeatedNestedMessage((TestAllTypes.NestedMessage.Builder) null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addRepeatedNestedEnum(null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } } - @Test public void testRepeatedSetters() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -448,7 +442,6 @@ public class GeneratedMessageTest { TestUtil.assertRepeatedFieldsModified(message); } - @Test public void testRepeatedSettersRejectNull() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); @@ -456,7 +449,7 @@ public class GeneratedMessageTest { builder.addRepeatedString("two"); try { builder.setRepeatedString(1, null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } @@ -465,7 +458,7 @@ public class GeneratedMessageTest { builder.addRepeatedBytes(TestUtil.toBytes("two")); try { builder.setRepeatedBytes(1, null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } @@ -474,13 +467,13 @@ public class GeneratedMessageTest { builder.addRepeatedNestedMessage(TestAllTypes.NestedMessage.newBuilder().setBb(456).build()); try { builder.setRepeatedNestedMessage(1, (TestAllTypes.NestedMessage) null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.setRepeatedNestedMessage(1, (TestAllTypes.NestedMessage.Builder) null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } @@ -489,13 +482,12 @@ public class GeneratedMessageTest { builder.addRepeatedNestedEnum(TestAllTypes.NestedEnum.BAR); try { builder.setRepeatedNestedEnum(1, null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } } - @Test public void testRepeatedAppend() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); @@ -506,48 +498,45 @@ public class GeneratedMessageTest { builder.addAllRepeatedForeignMessage(Arrays.asList(foreignMessage)); TestAllTypes message = builder.build(); - assertThat(Arrays.asList(1, 2, 3, 4)).isEqualTo(message.getRepeatedInt32List()); - assertThat(Arrays.asList(ForeignEnum.FOREIGN_BAZ)) - .isEqualTo(message.getRepeatedForeignEnumList()); - assertThat(message.getRepeatedForeignMessageCount()).isEqualTo(1); - assertThat(message.getRepeatedForeignMessage(0).getC()).isEqualTo(12); + assertEquals(message.getRepeatedInt32List(), Arrays.asList(1, 2, 3, 4)); + assertEquals(message.getRepeatedForeignEnumList(), Arrays.asList(ForeignEnum.FOREIGN_BAZ)); + assertEquals(1, message.getRepeatedForeignMessageCount()); + assertEquals(12, message.getRepeatedForeignMessage(0).getC()); } - @Test public void testRepeatedAppendRejectsNull() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); ForeignMessage foreignMessage = ForeignMessage.newBuilder().setC(12).build(); try { builder.addAllRepeatedForeignMessage(Arrays.asList(foreignMessage, (ForeignMessage) null)); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addAllRepeatedForeignEnum(Arrays.asList(ForeignEnum.FOREIGN_BAZ, null)); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addAllRepeatedString(Arrays.asList("one", null)); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } try { builder.addAllRepeatedBytes(Arrays.asList(TestUtil.toBytes("one"), null)); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } } - @Test public void testRepeatedAppendIterateOnlyOnce() throws Exception { // Create a Iterable that can only be iterated once. Iterable stringIterable = @@ -565,31 +554,29 @@ public class GeneratedMessageTest { }; TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.addAllRepeatedString(stringIterable); - assertThat(builder.getRepeatedStringCount()).isEqualTo(3); - assertThat(builder.getRepeatedString(0)).isEqualTo("one"); - assertThat(builder.getRepeatedString(1)).isEqualTo("two"); - assertThat(builder.getRepeatedString(2)).isEqualTo("three"); + assertEquals(3, builder.getRepeatedStringCount()); + assertEquals("one", builder.getRepeatedString(0)); + assertEquals("two", builder.getRepeatedString(1)); + assertEquals("three", builder.getRepeatedString(2)); try { builder.addAllRepeatedString(stringIterable); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (IllegalStateException e) { // We expect this exception. } } - @Test public void testMergeFromOtherRejectsNull() throws Exception { try { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.mergeFrom((TestAllTypes) null); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (NullPointerException e) { // We expect this exception. } } - @Test public void testSettingForeignMessageUsingBuilder() throws Exception { TestAllTypes message = TestAllTypes.newBuilder() @@ -601,11 +588,10 @@ public class GeneratedMessageTest { // Create expected version passing foreign message instance explicitly. .setOptionalForeignMessage(ForeignMessage.newBuilder().setC(123).build()) .build(); - // TODO: Upgrade to using real #equals method once implemented - assertThat(message.toString()).isEqualTo(expectedMessage.toString()); + // TODO(ngd): Upgrade to using real #equals method once implemented + assertEquals(expectedMessage.toString(), message.toString()); } - @Test public void testSettingRepeatedForeignMessageUsingBuilder() throws Exception { TestAllTypes message = TestAllTypes.newBuilder() @@ -617,26 +603,24 @@ public class GeneratedMessageTest { // Create expected version passing foreign message instance explicitly. .addRepeatedForeignMessage(ForeignMessage.newBuilder().setC(456).build()) .build(); - assertThat(message.toString()).isEqualTo(expectedMessage.toString()); + assertEquals(expectedMessage.toString(), message.toString()); } - @Test public void testDefaults() throws Exception { TestUtil.assertClear(TestAllTypes.getDefaultInstance()); TestUtil.assertClear(TestAllTypes.newBuilder().build()); TestExtremeDefaultValues message = TestExtremeDefaultValues.getDefaultInstance(); - assertThat(message.getUtf8String()).isEqualTo("\u1234"); - assertThat(message.getInfDouble()).isEqualTo(Double.POSITIVE_INFINITY); - assertThat(message.getNegInfDouble()).isEqualTo(Double.NEGATIVE_INFINITY); - assertThat(Double.isNaN(message.getNanDouble())).isTrue(); - assertThat(message.getInfFloat()).isEqualTo(Float.POSITIVE_INFINITY); - assertThat(message.getNegInfFloat()).isEqualTo(Float.NEGATIVE_INFINITY); - assertThat(Float.isNaN(message.getNanFloat())).isTrue(); - assertThat(message.getCppTrigraph()).isEqualTo("? ? ?? ?? ??? ??/ ??-"); + assertEquals("\u1234", message.getUtf8String()); + assertEquals(Double.POSITIVE_INFINITY, message.getInfDouble(), 0.0); + assertEquals(Double.NEGATIVE_INFINITY, message.getNegInfDouble(), 0.0); + assertTrue(Double.isNaN(message.getNanDouble())); + assertEquals(Float.POSITIVE_INFINITY, message.getInfFloat(), 0.0f); + assertEquals(Float.NEGATIVE_INFINITY, message.getNegInfFloat(), 0.0f); + assertTrue(Float.isNaN(message.getNanFloat())); + assertEquals("? ? ?? ?? ??? ??/ ??-", message.getCppTrigraph()); } - @Test public void testClear() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.assertClear(builder); @@ -645,7 +629,6 @@ public class GeneratedMessageTest { TestUtil.assertClear(builder); } - @Test public void testReflectionGetters() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -655,7 +638,6 @@ public class GeneratedMessageTest { reflectionTester.assertAllFieldsSetViaReflection(message); } - @Test public void testReflectionSetters() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); reflectionTester.setAllFieldsViaReflection(builder); @@ -665,13 +647,11 @@ public class GeneratedMessageTest { TestUtil.assertAllFieldsSet(message); } - @Test public void testReflectionSettersRejectNull() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); reflectionTester.assertReflectionSettersRejectNull(builder); } - @Test public void testReflectionRepeatedSetters() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); reflectionTester.setAllFieldsViaReflection(builder); @@ -682,69 +662,61 @@ public class GeneratedMessageTest { TestUtil.assertRepeatedFieldsModified(message); } - @Test public void testReflectionRepeatedSettersRejectNull() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); reflectionTester.assertReflectionRepeatedSettersRejectNull(builder); } - @Test public void testReflectionDefaults() throws Exception { reflectionTester.assertClearViaReflection(TestAllTypes.getDefaultInstance()); reflectionTester.assertClearViaReflection(TestAllTypes.newBuilder().build()); } - @Test public void testReflectionGetOneof() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); reflectionTester.setAllFieldsViaReflection(builder); Descriptors.OneofDescriptor oneof = TestAllTypes.getDescriptor().getOneofs().get(0); Descriptors.FieldDescriptor field = TestAllTypes.getDescriptor().findFieldByName("oneof_bytes"); - assertThat(field).isSameInstanceAs(builder.getOneofFieldDescriptor(oneof)); + assertSame(field, builder.getOneofFieldDescriptor(oneof)); TestAllTypes message = builder.build(); - assertThat(field).isSameInstanceAs(message.getOneofFieldDescriptor(oneof)); + assertSame(field, message.getOneofFieldDescriptor(oneof)); } - @Test public void testReflectionClearOneof() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); reflectionTester.setAllFieldsViaReflection(builder); Descriptors.OneofDescriptor oneof = TestAllTypes.getDescriptor().getOneofs().get(0); Descriptors.FieldDescriptor field = TestAllTypes.getDescriptor().findFieldByName("oneof_bytes"); - assertThat(builder.hasOneof(oneof)).isTrue(); - assertThat(builder.hasField(field)).isTrue(); + assertTrue(builder.hasOneof(oneof)); + assertTrue(builder.hasField(field)); builder.clearOneof(oneof); - assertThat(builder.hasOneof(oneof)).isFalse(); - assertThat(builder.hasField(field)).isFalse(); + assertFalse(builder.hasOneof(oneof)); + assertFalse(builder.hasField(field)); } - @Test public void testEnumInterface() throws Exception { - assertThat(TestAllTypes.getDefaultInstance().getDefaultNestedEnum()) - .isInstanceOf(ProtocolMessageEnum.class); + assertTrue( + TestAllTypes.getDefaultInstance().getDefaultNestedEnum() instanceof ProtocolMessageEnum); } - @Test public void testEnumMap() throws Exception { Internal.EnumLiteMap map = ForeignEnum.internalGetValueMap(); for (ForeignEnum value : ForeignEnum.values()) { - assertThat(map.findValueByNumber(value.getNumber())).isEqualTo(value); + assertEquals(value, map.findValueByNumber(value.getNumber())); } - assertThat(map.findValueByNumber(12345) == null).isTrue(); + assertTrue(map.findValueByNumber(12345) == null); } - @Test public void testParsePackedToUnpacked() throws Exception { TestUnpackedTypes.Builder builder = TestUnpackedTypes.newBuilder(); TestUnpackedTypes message = builder.mergeFrom(TestUtil.getPackedSet().toByteString()).build(); TestUtil.assertUnpackedFieldsSet(message); } - @Test public void testParseUnpackedToPacked() throws Exception { TestPackedTypes.Builder builder = TestPackedTypes.newBuilder(); TestPackedTypes message = builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build(); @@ -758,7 +730,6 @@ public class GeneratedMessageTest { new TestUtil.ReflectionTester( TestAllExtensions.getDescriptor(), TestUtil.getFullExtensionRegistry()); - @Test public void testExtensionMessageOrBuilder() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); TestUtil.setAllExtensions(builder); @@ -766,7 +737,6 @@ public class GeneratedMessageTest { TestUtil.assertAllExtensionsSet(message); } - @Test public void testGetBuilderForExtensionField() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); Message.Builder fieldBuilder = @@ -775,22 +745,21 @@ public class GeneratedMessageTest { FieldDescriptor field = NestedMessage.getDescriptor().findFieldByNumber(NestedMessage.BB_FIELD_NUMBER); fieldBuilder.setField(field, expected); - assertThat(fieldBuilder.build().getField(field)).isEqualTo(expected); + assertEquals(expected, fieldBuilder.build().getField(field)); } - @Test + public void testGetBuilderForNonMessageExtensionField() { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); try { // This should throw an exception because the extension field is not a message. builder.newBuilderForField(UnittestProto.optionalInt32Extension.getDescriptor()); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // This exception is expected. } } - @Test public void testExtensionRepeatedSetters() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); TestUtil.setAllExtensions(builder); @@ -799,29 +768,26 @@ public class GeneratedMessageTest { TestUtil.assertRepeatedExtensionsModified(message); } - @Test public void testExtensionDefaults() throws Exception { TestUtil.assertExtensionsClear(TestAllExtensions.getDefaultInstance()); TestUtil.assertExtensionsClear(TestAllExtensions.newBuilder().build()); } - @Test public void testUnsetRepeatedExtensionGetField() { TestAllExtensions message = TestAllExtensions.getDefaultInstance(); Object value; value = message.getField(UnittestProto.repeatedStringExtension.getDescriptor()); - assertThat(value instanceof List).isTrue(); - assertThat(((List) value).isEmpty()).isTrue(); + assertTrue(value instanceof List); + assertTrue(((List) value).isEmpty()); assertIsUnmodifiable((List) value); value = message.getField(UnittestProto.repeatedNestedMessageExtension.getDescriptor()); - assertThat(value instanceof List).isTrue(); - assertThat(((List) value).isEmpty()).isTrue(); + assertTrue(value instanceof List); + assertTrue(((List) value).isEmpty()); assertIsUnmodifiable((List) value); } - @Test public void testExtensionReflectionGetters() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); TestUtil.setAllExtensions(builder); @@ -831,7 +797,6 @@ public class GeneratedMessageTest { extensionsReflectionTester.assertAllFieldsSetViaReflection(message); } - @Test public void testExtensionReflectionSetters() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); extensionsReflectionTester.setAllFieldsViaReflection(builder); @@ -841,13 +806,11 @@ public class GeneratedMessageTest { TestUtil.assertAllExtensionsSet(message); } - @Test public void testExtensionReflectionSettersRejectNull() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); extensionsReflectionTester.assertReflectionSettersRejectNull(builder); } - @Test public void testExtensionReflectionRepeatedSetters() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); extensionsReflectionTester.setAllFieldsViaReflection(builder); @@ -858,51 +821,45 @@ public class GeneratedMessageTest { TestUtil.assertRepeatedExtensionsModified(message); } - @Test public void testExtensionReflectionRepeatedSettersRejectNull() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); extensionsReflectionTester.assertReflectionRepeatedSettersRejectNull(builder); } - @Test public void testExtensionReflectionDefaults() throws Exception { extensionsReflectionTester.assertClearViaReflection(TestAllExtensions.getDefaultInstance()); extensionsReflectionTester.assertClearViaReflection(TestAllExtensions.newBuilder().build()); } - @Test public void testClearExtension() throws Exception { // clearExtension() is not actually used in TestUtil, so try it manually. - assertThat( - TestAllExtensions.newBuilder() - .setExtension(UnittestProto.optionalInt32Extension, 1) - .clearExtension(UnittestProto.optionalInt32Extension) - .hasExtension(UnittestProto.optionalInt32Extension)) - .isFalse(); - assertThat( - TestAllExtensions.newBuilder() - .addExtension(UnittestProto.repeatedInt32Extension, 1) - .clearExtension(UnittestProto.repeatedInt32Extension) - .getExtensionCount(UnittestProto.repeatedInt32Extension)) - .isEqualTo(0); - } - - @Test + assertFalse( + TestAllExtensions.newBuilder() + .setExtension(UnittestProto.optionalInt32Extension, 1) + .clearExtension(UnittestProto.optionalInt32Extension) + .hasExtension(UnittestProto.optionalInt32Extension)); + assertEquals( + 0, + TestAllExtensions.newBuilder() + .addExtension(UnittestProto.repeatedInt32Extension, 1) + .clearExtension(UnittestProto.repeatedInt32Extension) + .getExtensionCount(UnittestProto.repeatedInt32Extension)); + } + public void testExtensionCopy() throws Exception { TestAllExtensions original = TestUtil.getAllExtensionsSet(); TestAllExtensions copy = TestAllExtensions.newBuilder(original).build(); TestUtil.assertAllExtensionsSet(copy); } - @Test public void testExtensionMergeFrom() throws Exception { TestAllExtensions original = TestAllExtensions.newBuilder() .setExtension(UnittestProto.optionalInt32Extension, 1) .build(); TestAllExtensions merged = TestAllExtensions.newBuilder().mergeFrom(original).build(); - assertThat(merged.hasExtension(UnittestProto.optionalInt32Extension)).isTrue(); - assertThat((int) merged.getExtension(UnittestProto.optionalInt32Extension)).isEqualTo(1); + assertTrue(merged.hasExtension(UnittestProto.optionalInt32Extension)); + assertEquals(1, (int) merged.getExtension(UnittestProto.optionalInt32Extension)); } // ================================================================= @@ -912,18 +869,16 @@ public class GeneratedMessageTest { // This test needs to be put before any other access to MultipleFilesTestProto // or messages defined in multiple_files_test.proto because the class loading // order affects initialization process of custom options. - @Test public void testEnumValueOptionsInMultipleFilesMode() throws Exception { - assertThat( - EnumWithNoOuter.FOO - .getValueDescriptor() - .getOptions() - .getExtension(MultipleFilesTestProto.enumValueOption) - .intValue()) - .isEqualTo(12345); + assertEquals( + 12345, + EnumWithNoOuter.FOO + .getValueDescriptor() + .getOptions() + .getExtension(MultipleFilesTestProto.enumValueOption) + .intValue()); } - @Test public void testMultipleFilesOption() throws Exception { // We mostly just want to check that things compile. MessageWithNoOuter message = @@ -933,60 +888,56 @@ public class GeneratedMessageTest { .setNestedEnum(MessageWithNoOuter.NestedEnum.BAZ) .setForeignEnum(EnumWithNoOuter.BAR) .build(); - assertThat(MessageWithNoOuter.parseFrom(message.toByteString())).isEqualTo(message); + assertEquals(message, MessageWithNoOuter.parseFrom(message.toByteString())); - assertThat(MessageWithNoOuter.getDescriptor().getFile()) - .isEqualTo(MultipleFilesTestProto.getDescriptor()); + assertEquals( + MultipleFilesTestProto.getDescriptor(), MessageWithNoOuter.getDescriptor().getFile()); Descriptors.FieldDescriptor field = MessageWithNoOuter.getDescriptor().findFieldByName("foreign_enum"); - assertThat(message.getField(field)).isEqualTo(EnumWithNoOuter.BAR.getValueDescriptor()); + assertEquals(EnumWithNoOuter.BAR.getValueDescriptor(), message.getField(field)); - assertThat(ServiceWithNoOuter.getDescriptor().getFile()) - .isEqualTo(MultipleFilesTestProto.getDescriptor()); + assertEquals( + MultipleFilesTestProto.getDescriptor(), ServiceWithNoOuter.getDescriptor().getFile()); - assertThat( - TestAllExtensions.getDefaultInstance() - .hasExtension(MultipleFilesTestProto.extensionWithOuter)) - .isFalse(); + assertFalse( + TestAllExtensions.getDefaultInstance() + .hasExtension(MultipleFilesTestProto.extensionWithOuter)); } - @Test public void testOptionalFieldWithRequiredSubfieldsOptimizedForSize() throws Exception { TestOptionalOptimizedForSize message = TestOptionalOptimizedForSize.getDefaultInstance(); - assertThat(message.isInitialized()).isTrue(); + assertTrue(message.isInitialized()); message = TestOptionalOptimizedForSize.newBuilder() .setO(TestRequiredOptimizedForSize.newBuilder().buildPartial()) .buildPartial(); - assertThat(message.isInitialized()).isFalse(); + assertFalse(message.isInitialized()); message = TestOptionalOptimizedForSize.newBuilder() .setO(TestRequiredOptimizedForSize.newBuilder().setX(5).buildPartial()) .buildPartial(); - assertThat(message.isInitialized()).isTrue(); + assertTrue(message.isInitialized()); } - @Test public void testUninitializedExtensionInOptimizedForSize() throws Exception { TestOptimizedForSize.Builder builder = TestOptimizedForSize.newBuilder(); builder.setExtension( TestOptimizedForSize.testExtension2, TestRequiredOptimizedForSize.newBuilder().buildPartial()); - assertThat(builder.isInitialized()).isFalse(); - assertThat(builder.buildPartial().isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); + assertFalse(builder.buildPartial().isInitialized()); builder = TestOptimizedForSize.newBuilder(); builder.setExtension( TestOptimizedForSize.testExtension2, TestRequiredOptimizedForSize.newBuilder().setX(10).buildPartial()); - assertThat(builder.isInitialized()).isTrue(); - assertThat(builder.buildPartial().isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); + assertTrue(builder.buildPartial().isInitialized()); } - @Test public void testToBuilder() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); @@ -995,57 +946,56 @@ public class GeneratedMessageTest { TestUtil.assertAllFieldsSet(message.toBuilder().build()); } - @Test public void testFieldConstantValues() throws Exception { - assertThat(TestAllTypes.NestedMessage.BB_FIELD_NUMBER).isEqualTo(1); - assertThat(TestAllTypes.OPTIONAL_INT32_FIELD_NUMBER).isEqualTo(1); - assertThat(TestAllTypes.OPTIONALGROUP_FIELD_NUMBER).isEqualTo(16); - assertThat(TestAllTypes.OPTIONAL_NESTED_MESSAGE_FIELD_NUMBER).isEqualTo(18); - assertThat(TestAllTypes.OPTIONAL_NESTED_ENUM_FIELD_NUMBER).isEqualTo(21); - assertThat(TestAllTypes.REPEATED_INT32_FIELD_NUMBER).isEqualTo(31); - assertThat(TestAllTypes.REPEATEDGROUP_FIELD_NUMBER).isEqualTo(46); - assertThat(TestAllTypes.REPEATED_NESTED_MESSAGE_FIELD_NUMBER).isEqualTo(48); - assertThat(TestAllTypes.REPEATED_NESTED_ENUM_FIELD_NUMBER).isEqualTo(51); - } - - @Test + assertEquals(TestAllTypes.NestedMessage.BB_FIELD_NUMBER, 1); + assertEquals(TestAllTypes.OPTIONAL_INT32_FIELD_NUMBER, 1); + assertEquals(TestAllTypes.OPTIONALGROUP_FIELD_NUMBER, 16); + assertEquals(TestAllTypes.OPTIONAL_NESTED_MESSAGE_FIELD_NUMBER, 18); + assertEquals(TestAllTypes.OPTIONAL_NESTED_ENUM_FIELD_NUMBER, 21); + assertEquals(TestAllTypes.REPEATED_INT32_FIELD_NUMBER, 31); + assertEquals(TestAllTypes.REPEATEDGROUP_FIELD_NUMBER, 46); + assertEquals(TestAllTypes.REPEATED_NESTED_MESSAGE_FIELD_NUMBER, 48); + assertEquals(TestAllTypes.REPEATED_NESTED_ENUM_FIELD_NUMBER, 51); + } + public void testExtensionConstantValues() throws Exception { - assertThat(UnittestProto.TestRequired.SINGLE_FIELD_NUMBER).isEqualTo(1000); - assertThat(UnittestProto.TestRequired.MULTI_FIELD_NUMBER).isEqualTo(1001); - assertThat(UnittestProto.OPTIONAL_INT32_EXTENSION_FIELD_NUMBER).isEqualTo(1); - assertThat(UnittestProto.OPTIONALGROUP_EXTENSION_FIELD_NUMBER).isEqualTo(16); - assertThat(UnittestProto.OPTIONAL_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER).isEqualTo(18); - assertThat(UnittestProto.OPTIONAL_NESTED_ENUM_EXTENSION_FIELD_NUMBER).isEqualTo(21); - assertThat(UnittestProto.REPEATED_INT32_EXTENSION_FIELD_NUMBER).isEqualTo(31); - assertThat(UnittestProto.REPEATEDGROUP_EXTENSION_FIELD_NUMBER).isEqualTo(46); - assertThat(UnittestProto.REPEATED_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER).isEqualTo(48); - assertThat(UnittestProto.REPEATED_NESTED_ENUM_EXTENSION_FIELD_NUMBER).isEqualTo(51); - } - - @Test + assertEquals(UnittestProto.TestRequired.SINGLE_FIELD_NUMBER, 1000); + assertEquals(UnittestProto.TestRequired.MULTI_FIELD_NUMBER, 1001); + assertEquals(UnittestProto.OPTIONAL_INT32_EXTENSION_FIELD_NUMBER, 1); + assertEquals(UnittestProto.OPTIONALGROUP_EXTENSION_FIELD_NUMBER, 16); + assertEquals(UnittestProto.OPTIONAL_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER, 18); + assertEquals(UnittestProto.OPTIONAL_NESTED_ENUM_EXTENSION_FIELD_NUMBER, 21); + assertEquals(UnittestProto.REPEATED_INT32_EXTENSION_FIELD_NUMBER, 31); + assertEquals(UnittestProto.REPEATEDGROUP_EXTENSION_FIELD_NUMBER, 46); + assertEquals(UnittestProto.REPEATED_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER, 48); + assertEquals(UnittestProto.REPEATED_NESTED_ENUM_EXTENSION_FIELD_NUMBER, 51); + } + public void testRecursiveMessageDefaultInstance() throws Exception { UnittestProto.TestRecursiveMessage message = UnittestProto.TestRecursiveMessage.getDefaultInstance(); - assertThat(message).isNotNull(); - assertThat(message.getA()).isEqualTo(message); + assertTrue(message != null); + assertNotNull(message.getA()); + assertTrue(message.getA().equals(message)); } - @Test public void testSerialize() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestUtil.setAllFields(builder); TestAllTypes expected = builder.build(); - try (ObjectOutputStream out = new ObjectOutputStream(baos)) { + ObjectOutputStream out = new ObjectOutputStream(baos); + try { out.writeObject(expected); + } finally { + out.close(); } ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream in = new ObjectInputStream(bais); TestAllTypes actual = (TestAllTypes) in.readObject(); - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } - @Test public void testSerializePartial() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TestAllTypes.Builder builder = TestAllTypes.newBuilder(); @@ -1059,10 +1009,9 @@ public class GeneratedMessageTest { ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream in = new ObjectInputStream(bais); TestAllTypes actual = (TestAllTypes) in.readObject(); - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } - @Test public void testDeserializeWithoutClassField() throws Exception { // serialized form for version <=3.6.0 // just includes messageClassName and asBytes @@ -1085,10 +1034,9 @@ public class GeneratedMessageTest { ByteArrayInputStream bais = new ByteArrayInputStream(int32ValueBytes); ObjectInputStream in = new ObjectInputStream(bais); Int32Value int32Value = (Int32Value) in.readObject(); - assertThat(int32Value.getValue()).isEqualTo(123); + assertEquals(123, int32Value.getValue()); } - @Test public void testDeserializeWithClassField() throws Exception { // serialized form for version > 3.6.0 // includes messageClass, messageClassName (for compatibility), and asBytes @@ -1122,36 +1070,31 @@ public class GeneratedMessageTest { ByteArrayInputStream bais = new ByteArrayInputStream(int32ValueBytes); ObjectInputStream in = new ObjectInputStream(bais); Int32Value int32Value = (Int32Value) in.readObject(); - assertThat(int32Value.getValue()).isEqualTo(123); + assertEquals(123, int32Value.getValue()); } - @Test public void testEnumValues() { - assertThat(TestAllTypes.NestedEnum.BAR.getNumber()) - .isEqualTo(TestAllTypes.NestedEnum.BAR_VALUE); - assertThat(TestAllTypes.NestedEnum.BAZ.getNumber()) - .isEqualTo(TestAllTypes.NestedEnum.BAZ_VALUE); - assertThat(TestAllTypes.NestedEnum.FOO.getNumber()) - .isEqualTo(TestAllTypes.NestedEnum.FOO_VALUE); + assertEquals(TestAllTypes.NestedEnum.BAR_VALUE, TestAllTypes.NestedEnum.BAR.getNumber()); + assertEquals(TestAllTypes.NestedEnum.BAZ_VALUE, TestAllTypes.NestedEnum.BAZ.getNumber()); + assertEquals(TestAllTypes.NestedEnum.FOO_VALUE, TestAllTypes.NestedEnum.FOO.getNumber()); } - @Test public void testNonNestedExtensionInitialization() { - assertThat(NonNestedExtension.nonNestedExtension.getMessageDefaultInstance()) - .isInstanceOf(MyNonNestedExtension.class); - assertThat(NonNestedExtension.nonNestedExtension.getDescriptor().getName()) - .isEqualTo("nonNestedExtension"); + assertTrue( + NonNestedExtension.nonNestedExtension.getMessageDefaultInstance() + instanceof MyNonNestedExtension); + assertEquals( + "nonNestedExtension", NonNestedExtension.nonNestedExtension.getDescriptor().getName()); } - @Test public void testNestedExtensionInitialization() { - assertThat(MyNestedExtension.recursiveExtension.getMessageDefaultInstance()) - .isInstanceOf(MessageToBeExtended.class); - assertThat(MyNestedExtension.recursiveExtension.getDescriptor().getName()) - .isEqualTo("recursiveExtension"); + assertTrue( + MyNestedExtension.recursiveExtension.getMessageDefaultInstance() + instanceof MessageToBeExtended); + assertEquals( + "recursiveExtension", MyNestedExtension.recursiveExtension.getDescriptor().getName()); } - @Test public void testInvalidations() throws Exception { GeneratedMessageV3.setAlwaysUseFieldBuildersForTesting(true); TestAllTypes.NestedMessage nestedMessage1 = TestAllTypes.NestedMessage.newBuilder().build(); @@ -1170,7 +1113,7 @@ public class GeneratedMessageTest { builder.addRepeatedInt32(1); builder.addRepeatedNestedEnum(TestAllTypes.NestedEnum.BAR); builder.addRepeatedNestedMessage(nestedMessage1); - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + assertEquals(0, mockParent.getInvalidationCount()); // Now tell it we want changes and make sure it's only fired once // And do this for each flavor @@ -1179,40 +1122,39 @@ public class GeneratedMessageTest { builder.buildPartial(); builder.setOptionalInt32(2); builder.setOptionalInt32(3); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); + assertEquals(1, mockParent.getInvalidationCount()); // enum single builder.buildPartial(); builder.setOptionalNestedEnum(TestAllTypes.NestedEnum.BAZ); builder.setOptionalNestedEnum(TestAllTypes.NestedEnum.BAR); - assertThat(mockParent.getInvalidationCount()).isEqualTo(2); + assertEquals(2, mockParent.getInvalidationCount()); // message single builder.buildPartial(); builder.setOptionalNestedMessage(nestedMessage2); builder.setOptionalNestedMessage(nestedMessage1); - assertThat(mockParent.getInvalidationCount()).isEqualTo(3); + assertEquals(3, mockParent.getInvalidationCount()); // primitive repeated builder.buildPartial(); builder.addRepeatedInt32(2); builder.addRepeatedInt32(3); - assertThat(mockParent.getInvalidationCount()).isEqualTo(4); + assertEquals(4, mockParent.getInvalidationCount()); // enum repeated builder.buildPartial(); builder.addRepeatedNestedEnum(TestAllTypes.NestedEnum.BAZ); builder.addRepeatedNestedEnum(TestAllTypes.NestedEnum.BAZ); - assertThat(mockParent.getInvalidationCount()).isEqualTo(5); + assertEquals(5, mockParent.getInvalidationCount()); // message repeated builder.buildPartial(); builder.addRepeatedNestedMessage(nestedMessage2); builder.addRepeatedNestedMessage(nestedMessage1); - assertThat(mockParent.getInvalidationCount()).isEqualTo(6); + assertEquals(6, mockParent.getInvalidationCount()); } - @Test public void testInvalidations_Extensions() throws Exception { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); @@ -1224,46 +1166,43 @@ public class GeneratedMessageTest { builder.addExtension(UnittestProto.repeatedInt32Extension, 1); builder.setExtension(UnittestProto.repeatedInt32Extension, 0, 2); builder.clearExtension(UnittestProto.repeatedInt32Extension); - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + assertEquals(0, mockParent.getInvalidationCount()); // Now tell it we want changes and make sure it's only fired once builder.buildPartial(); builder.addExtension(UnittestProto.repeatedInt32Extension, 2); builder.addExtension(UnittestProto.repeatedInt32Extension, 3); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); + assertEquals(1, mockParent.getInvalidationCount()); builder.buildPartial(); builder.setExtension(UnittestProto.repeatedInt32Extension, 0, 4); builder.setExtension(UnittestProto.repeatedInt32Extension, 1, 5); - assertThat(mockParent.getInvalidationCount()).isEqualTo(2); + assertEquals(2, mockParent.getInvalidationCount()); builder.buildPartial(); builder.clearExtension(UnittestProto.repeatedInt32Extension); builder.clearExtension(UnittestProto.repeatedInt32Extension); - assertThat(mockParent.getInvalidationCount()).isEqualTo(3); + assertEquals(3, mockParent.getInvalidationCount()); } - @Test public void testBaseMessageOrBuilder() { // Mostly just makes sure the base interface exists and has some methods. TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TestAllTypes message = builder.buildPartial(); TestAllTypesOrBuilder messageAsInterface = (TestAllTypesOrBuilder) message; - assertThat(messageAsInterface.getDefaultBool()).isEqualTo(messageAsInterface.getDefaultBool()); - assertThat(messageAsInterface.getOptionalDouble()) - .isEqualTo(messageAsInterface.getOptionalDouble()); + assertEquals(messageAsInterface.getDefaultBool(), messageAsInterface.getDefaultBool()); + assertEquals( + messageAsInterface.getOptionalDouble(), messageAsInterface.getOptionalDouble(), 0.0); } - @Test public void testMessageOrBuilderGetters() { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); // single fields - assertThat(ForeignMessage.getDefaultInstance()) - .isSameInstanceAs(builder.getOptionalForeignMessageOrBuilder()); + assertSame(ForeignMessage.getDefaultInstance(), builder.getOptionalForeignMessageOrBuilder()); ForeignMessage.Builder subBuilder = builder.getOptionalForeignMessageBuilder(); - assertThat(subBuilder).isSameInstanceAs(builder.getOptionalForeignMessageOrBuilder()); + assertSame(subBuilder, builder.getOptionalForeignMessageOrBuilder()); // repeated fields ForeignMessage m0 = ForeignMessage.newBuilder().buildPartial(); @@ -1272,23 +1211,22 @@ public class GeneratedMessageTest { builder.addRepeatedForeignMessage(m0); builder.addRepeatedForeignMessage(m1); builder.addRepeatedForeignMessage(m2); - assertThat(m0).isSameInstanceAs(builder.getRepeatedForeignMessageOrBuilder(0)); - assertThat(m1).isSameInstanceAs(builder.getRepeatedForeignMessageOrBuilder(1)); - assertThat(m2).isSameInstanceAs(builder.getRepeatedForeignMessageOrBuilder(2)); + assertSame(m0, builder.getRepeatedForeignMessageOrBuilder(0)); + assertSame(m1, builder.getRepeatedForeignMessageOrBuilder(1)); + assertSame(m2, builder.getRepeatedForeignMessageOrBuilder(2)); ForeignMessage.Builder b0 = builder.getRepeatedForeignMessageBuilder(0); ForeignMessage.Builder b1 = builder.getRepeatedForeignMessageBuilder(1); - assertThat(b0).isSameInstanceAs(builder.getRepeatedForeignMessageOrBuilder(0)); - assertThat(b1).isSameInstanceAs(builder.getRepeatedForeignMessageOrBuilder(1)); - assertThat(m2).isSameInstanceAs(builder.getRepeatedForeignMessageOrBuilder(2)); + assertSame(b0, builder.getRepeatedForeignMessageOrBuilder(0)); + assertSame(b1, builder.getRepeatedForeignMessageOrBuilder(1)); + assertSame(m2, builder.getRepeatedForeignMessageOrBuilder(2)); List messageOrBuilderList = builder.getRepeatedForeignMessageOrBuilderList(); - assertThat(b0).isSameInstanceAs(messageOrBuilderList.get(0)); - assertThat(b1).isSameInstanceAs(messageOrBuilderList.get(1)); - assertThat(m2).isSameInstanceAs(messageOrBuilderList.get(2)); + assertSame(b0, messageOrBuilderList.get(0)); + assertSame(b1, messageOrBuilderList.get(1)); + assertSame(m2, messageOrBuilderList.get(2)); } - @Test public void testGetFieldBuilder() { Descriptor descriptor = TestAllTypes.getDescriptor(); @@ -1303,7 +1241,9 @@ public class GeneratedMessageTest { builder1 .newBuilderForField(fieldDescriptor) .mergeFrom((Message) builder1.getField(fieldDescriptor)); - fieldBuilder1.setField(NESTED_MESSAGE_BB_FIELD, 1); + FieldDescriptor subFieldDescriptor1 = + fieldBuilder1.getDescriptorForType().findFieldByName("bb"); + fieldBuilder1.setField(subFieldDescriptor1, 1); builder1.setField(fieldDescriptor, fieldBuilder1.build()); // Mutate foreign message @@ -1332,7 +1272,9 @@ public class GeneratedMessageTest { // Mutate nested message TestAllTypes.Builder builder2 = TestAllTypes.newBuilder(); Message.Builder fieldBuilder2 = builder2.getFieldBuilder(fieldDescriptor); - fieldBuilder2.setField(NESTED_MESSAGE_BB_FIELD, 1); + FieldDescriptor subFieldDescriptor2 = + fieldBuilder2.getDescriptorForType().findFieldByName("bb"); + fieldBuilder2.setField(subFieldDescriptor2, 1); builder2.setField(fieldDescriptor, fieldBuilder2.build()); // Mutate foreign message @@ -1358,10 +1300,9 @@ public class GeneratedMessageTest { Message newMessage2 = builder2.build(); // These two messages should be equal. - assertThat(newMessage1).isEqualTo(newMessage2); + assertEquals(newMessage1, newMessage2); } - @Test public void testGetFieldBuilderWithInitializedValue() { Descriptor descriptor = TestAllTypes.getDescriptor(); FieldDescriptor fieldDescriptor = descriptor.findFieldByName("optional_nested_message"); @@ -1370,7 +1311,7 @@ public class GeneratedMessageTest { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); NestedMessage.Builder fieldBuilder = (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); - assertThat(fieldBuilder.getBb()).isEqualTo(0); + assertEquals(0, fieldBuilder.getBb()); // Setting field value with new field builder instance. builder = TestAllTypes.newBuilder(); @@ -1379,42 +1320,41 @@ public class GeneratedMessageTest { // Then get the field builder instance by getFieldBuilder(). fieldBuilder = (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); // It should contain new value. - assertThat(fieldBuilder.getBb()).isEqualTo(2); + assertEquals(2, fieldBuilder.getBb()); // These two builder should be equal. - assertThat(fieldBuilder).isSameInstanceAs(newFieldBuilder); + assertSame(fieldBuilder, newFieldBuilder); } - @Test public void testGetFieldBuilderNotSupportedException() { Descriptor descriptor = TestAllTypes.getDescriptor(); TestAllTypes.Builder builder = TestAllTypes.newBuilder(); try { builder.getFieldBuilder(descriptor.findFieldByName("optional_int32")); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getFieldBuilder(descriptor.findFieldByName("optional_nested_enum")); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getFieldBuilder(descriptor.findFieldByName("repeated_int32")); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getFieldBuilder(descriptor.findFieldByName("repeated_nested_enum")); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getFieldBuilder(descriptor.findFieldByName("repeated_nested_message")); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } @@ -1423,223 +1363,217 @@ public class GeneratedMessageTest { // Test that when the default outer class name conflicts with another type // defined in the proto the compiler will append a suffix to avoid the // conflict. - @Test public void testConflictingOuterClassName() { // We just need to make sure we can refer to the outer class with the // expected name. There is nothing else to test. OuterClassNameTestOuterClass.OuterClassNameTest message = OuterClassNameTestOuterClass.OuterClassNameTest.newBuilder().build(); - assertThat(message.getDescriptorForType()) - .isSameInstanceAs(OuterClassNameTestOuterClass.OuterClassNameTest.getDescriptor()); + assertTrue( + message.getDescriptorForType() + == OuterClassNameTestOuterClass.OuterClassNameTest.getDescriptor()); OuterClassNameTest2OuterClass.TestMessage2.NestedMessage.OuterClassNameTest2 message2 = OuterClassNameTest2OuterClass.TestMessage2.NestedMessage.OuterClassNameTest2.newBuilder() .build(); - assertThat(message2.getSerializedSize()).isEqualTo(0); + assertEquals(0, message2.getSerializedSize()); OuterClassNameTest3OuterClass.TestMessage3.NestedMessage.OuterClassNameTest3 enumValue = OuterClassNameTest3OuterClass.TestMessage3.NestedMessage.OuterClassNameTest3.DUMMY_VALUE; - assertThat(enumValue.getNumber()).isEqualTo(1); + assertEquals(1, enumValue.getNumber()); } // ================================================================= // oneof generated code test - @Test public void testOneofEnumCase() throws Exception { TestOneof2 message = TestOneof2.newBuilder().setFooInt(123).setFooString("foo").setFooCord("bar").build(); TestUtil.assertAtMostOneFieldSetOneof(message); } - @Test public void testClearOneof() throws Exception { TestOneof2.Builder builder = TestOneof2.newBuilder().setFooInt(123); - assertThat(builder.getFooCase()).isEqualTo(TestOneof2.FooCase.FOO_INT); + assertEquals(TestOneof2.FooCase.FOO_INT, builder.getFooCase()); builder.clearFoo(); - assertThat(builder.getFooCase()).isEqualTo(TestOneof2.FooCase.FOO_NOT_SET); + assertEquals(TestOneof2.FooCase.FOO_NOT_SET, builder.getFooCase()); } - @Test public void testSetOneofClearsOthers() throws Exception { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestOneof2 message = builder.setFooInt(123).setFooString("foo").buildPartial(); - assertThat(message.hasFooString()).isTrue(); + assertTrue(message.hasFooString()); TestUtil.assertAtMostOneFieldSetOneof(message); message = builder.setFooCord("bar").buildPartial(); - assertThat(message.hasFooCord()).isTrue(); + assertTrue(message.hasFooCord()); TestUtil.assertAtMostOneFieldSetOneof(message); message = builder.setFooStringPiece("baz").buildPartial(); - assertThat(message.hasFooStringPiece()).isTrue(); + assertTrue(message.hasFooStringPiece()); TestUtil.assertAtMostOneFieldSetOneof(message); - message = builder.setFooBytes(TestUtil.toBytes("moo")).buildPartial(); - assertThat(message.hasFooBytes()).isTrue(); + message = builder.setFooBytes(TestUtil.toBytes("qux")).buildPartial(); + assertTrue(message.hasFooBytes()); TestUtil.assertAtMostOneFieldSetOneof(message); message = builder.setFooEnum(TestOneof2.NestedEnum.FOO).buildPartial(); - assertThat(message.hasFooEnum()).isTrue(); + assertTrue(message.hasFooEnum()); TestUtil.assertAtMostOneFieldSetOneof(message); message = builder - .setFooMessage(TestOneof2.NestedMessage.newBuilder().setMooInt(234).build()) + .setFooMessage(TestOneof2.NestedMessage.newBuilder().setQuxInt(234).build()) .buildPartial(); - assertThat(message.hasFooMessage()).isTrue(); + assertTrue(message.hasFooMessage()); TestUtil.assertAtMostOneFieldSetOneof(message); message = builder.setFooInt(123).buildPartial(); - assertThat(message.hasFooInt()).isTrue(); + assertTrue(message.hasFooInt()); TestUtil.assertAtMostOneFieldSetOneof(message); } - @Test public void testOneofTypes() throws Exception { // Primitive { TestOneof2.Builder builder = TestOneof2.newBuilder(); - assertThat(builder.getFooInt()).isEqualTo(0); - assertThat(builder.hasFooInt()).isFalse(); - assertThat(builder.setFooInt(123).hasFooInt()).isTrue(); - assertThat(builder.getFooInt()).isEqualTo(123); + assertEquals(builder.getFooInt(), 0); + assertFalse(builder.hasFooInt()); + assertTrue(builder.setFooInt(123).hasFooInt()); + assertEquals(builder.getFooInt(), 123); TestOneof2 message = builder.buildPartial(); - assertThat(message.hasFooInt()).isTrue(); - assertThat(message.getFooInt()).isEqualTo(123); + assertTrue(message.hasFooInt()); + assertEquals(message.getFooInt(), 123); - assertThat(builder.clearFooInt().hasFooInt()).isFalse(); + assertFalse(builder.clearFooInt().hasFooInt()); TestOneof2 message2 = builder.build(); - assertThat(message2.hasFooInt()).isFalse(); - assertThat(message2.getFooInt()).isEqualTo(0); + assertFalse(message2.hasFooInt()); + assertEquals(0, message2.getFooInt()); } // Enum { TestOneof2.Builder builder = TestOneof2.newBuilder(); - assertThat(builder.getFooEnum()).isEqualTo(TestOneof2.NestedEnum.FOO); - assertThat(builder.setFooEnum(TestOneof2.NestedEnum.BAR).hasFooEnum()).isTrue(); - assertThat(builder.getFooEnum()).isEqualTo(TestOneof2.NestedEnum.BAR); + assertEquals(TestOneof2.NestedEnum.FOO, builder.getFooEnum()); + assertTrue(builder.setFooEnum(TestOneof2.NestedEnum.BAR).hasFooEnum()); + assertEquals(TestOneof2.NestedEnum.BAR, builder.getFooEnum()); TestOneof2 message = builder.buildPartial(); - assertThat(message.hasFooEnum()).isTrue(); - assertThat(message.getFooEnum()).isEqualTo(TestOneof2.NestedEnum.BAR); + assertTrue(message.hasFooEnum()); + assertEquals(TestOneof2.NestedEnum.BAR, message.getFooEnum()); - assertThat(builder.clearFooEnum().hasFooEnum()).isFalse(); + assertFalse(builder.clearFooEnum().hasFooEnum()); TestOneof2 message2 = builder.build(); - assertThat(message2.hasFooEnum()).isFalse(); - assertThat(message2.getFooEnum()).isEqualTo(TestOneof2.NestedEnum.FOO); + assertFalse(message2.hasFooEnum()); + assertEquals(TestOneof2.NestedEnum.FOO, message2.getFooEnum()); } // String { TestOneof2.Builder builder = TestOneof2.newBuilder(); - assertThat(builder.getFooString()).isEmpty(); + assertEquals("", builder.getFooString()); builder.setFooString("foo"); - assertThat(builder.hasFooString()).isTrue(); - assertThat(builder.getFooString()).isEqualTo("foo"); + assertTrue(builder.hasFooString()); + assertEquals("foo", builder.getFooString()); TestOneof2 message = builder.buildPartial(); - assertThat(message.hasFooString()).isTrue(); - assertThat(message.getFooString()).isEqualTo("foo"); - assertThat(TestUtil.toBytes("foo")).isEqualTo(message.getFooStringBytes()); + assertTrue(message.hasFooString()); + assertEquals("foo", message.getFooString()); + assertEquals(message.getFooStringBytes(), TestUtil.toBytes("foo")); - assertThat(builder.clearFooString().hasFooString()).isFalse(); + assertFalse(builder.clearFooString().hasFooString()); TestOneof2 message2 = builder.buildPartial(); - assertThat(message2.hasFooString()).isFalse(); - assertThat(message2.getFooString()).isEmpty(); - assertThat(message2.getFooStringBytes()).isEqualTo(TestUtil.toBytes("")); + assertFalse(message2.hasFooString()); + assertEquals("", message2.getFooString()); + assertEquals(message2.getFooStringBytes(), TestUtil.toBytes("")); // Get method should not change the oneof value. builder.setFooInt(123); - assertThat(builder.getFooString()).isEmpty(); - assertThat(builder.getFooStringBytes()).isEqualTo(TestUtil.toBytes("")); - assertThat(builder.getFooInt()).isEqualTo(123); + assertEquals("", builder.getFooString()); + assertEquals(builder.getFooStringBytes(), TestUtil.toBytes("")); + assertEquals(123, builder.getFooInt()); message = builder.build(); - assertThat(message.getFooString()).isEmpty(); - assertThat(TestUtil.toBytes("")).isEqualTo(message.getFooStringBytes()); - assertThat(message.getFooInt()).isEqualTo(123); + assertEquals("", message.getFooString()); + assertEquals(message.getFooStringBytes(), TestUtil.toBytes("")); + assertEquals(123, message.getFooInt()); } // Cord { TestOneof2.Builder builder = TestOneof2.newBuilder(); - assertThat(builder.getFooCord()).isEmpty(); + assertEquals("", builder.getFooCord()); builder.setFooCord("foo"); - assertThat(builder.hasFooCord()).isTrue(); - assertThat(builder.getFooCord()).isEqualTo("foo"); + assertTrue(builder.hasFooCord()); + assertEquals("foo", builder.getFooCord()); TestOneof2 message = builder.buildPartial(); - assertThat(message.hasFooCord()).isTrue(); - assertThat(message.getFooCord()).isEqualTo("foo"); - assertThat(TestUtil.toBytes("foo")).isEqualTo(message.getFooCordBytes()); + assertTrue(message.hasFooCord()); + assertEquals("foo", message.getFooCord()); + assertEquals(message.getFooCordBytes(), TestUtil.toBytes("foo")); - assertThat(builder.clearFooCord().hasFooCord()).isFalse(); + assertFalse(builder.clearFooCord().hasFooCord()); TestOneof2 message2 = builder.build(); - assertThat(message2.hasFooCord()).isFalse(); - assertThat(message2.getFooCord()).isEmpty(); - assertThat(message2.getFooCordBytes()).isEqualTo(TestUtil.toBytes("")); + assertFalse(message2.hasFooCord()); + assertEquals("", message2.getFooCord()); + assertEquals(message2.getFooCordBytes(), TestUtil.toBytes("")); } // StringPiece { TestOneof2.Builder builder = TestOneof2.newBuilder(); - assertThat(builder.getFooStringPiece()).isEmpty(); + assertEquals("", builder.getFooStringPiece()); builder.setFooStringPiece("foo"); - assertThat(builder.hasFooStringPiece()).isTrue(); - assertThat(builder.getFooStringPiece()).isEqualTo("foo"); + assertTrue(builder.hasFooStringPiece()); + assertEquals("foo", builder.getFooStringPiece()); TestOneof2 message = builder.buildPartial(); - assertThat(message.hasFooStringPiece()).isTrue(); - assertThat(message.getFooStringPiece()).isEqualTo("foo"); - assertThat(TestUtil.toBytes("foo")).isEqualTo(message.getFooStringPieceBytes()); + assertTrue(message.hasFooStringPiece()); + assertEquals("foo", message.getFooStringPiece()); + assertEquals(message.getFooStringPieceBytes(), TestUtil.toBytes("foo")); - assertThat(builder.clearFooStringPiece().hasFooStringPiece()).isFalse(); + assertFalse(builder.clearFooStringPiece().hasFooStringPiece()); TestOneof2 message2 = builder.build(); - assertThat(message2.hasFooStringPiece()).isFalse(); - assertThat(message2.getFooStringPiece()).isEmpty(); - assertThat(message2.getFooStringPieceBytes()).isEqualTo(TestUtil.toBytes("")); + assertFalse(message2.hasFooStringPiece()); + assertEquals("", message2.getFooStringPiece()); + assertEquals(message2.getFooStringPieceBytes(), TestUtil.toBytes("")); } // Message { // set TestOneof2.Builder builder = TestOneof2.newBuilder(); - assertThat(builder.getFooMessage().getMooInt()).isEqualTo(0); - builder.setFooMessage(TestOneof2.NestedMessage.newBuilder().setMooInt(234).build()); - assertThat(builder.hasFooMessage()).isTrue(); - assertThat(builder.getFooMessage().getMooInt()).isEqualTo(234); + assertEquals(0, builder.getFooMessage().getQuxInt()); + builder.setFooMessage(TestOneof2.NestedMessage.newBuilder().setQuxInt(234).build()); + assertTrue(builder.hasFooMessage()); + assertEquals(234, builder.getFooMessage().getQuxInt()); TestOneof2 message = builder.buildPartial(); - assertThat(message.hasFooMessage()).isTrue(); - assertThat(message.getFooMessage().getMooInt()).isEqualTo(234); + assertTrue(message.hasFooMessage()); + assertEquals(234, message.getFooMessage().getQuxInt()); // clear - assertThat(builder.clearFooMessage().hasFooString()).isFalse(); + assertFalse(builder.clearFooMessage().hasFooString()); message = builder.build(); - assertThat(message.hasFooMessage()).isFalse(); - assertThat(message.getFooMessage().getMooInt()).isEqualTo(0); + assertFalse(message.hasFooMessage()); + assertEquals(0, message.getFooMessage().getQuxInt()); // nested builder builder = TestOneof2.newBuilder(); - assertThat(builder.getFooMessageOrBuilder()) - .isSameInstanceAs(TestOneof2.NestedMessage.getDefaultInstance()); - assertThat(builder.hasFooMessage()).isFalse(); - builder.getFooMessageBuilder().setMooInt(123); - assertThat(builder.hasFooMessage()).isTrue(); - assertThat(builder.getFooMessage().getMooInt()).isEqualTo(123); + assertSame(builder.getFooMessageOrBuilder(), TestOneof2.NestedMessage.getDefaultInstance()); + assertFalse(builder.hasFooMessage()); + builder.getFooMessageBuilder().setQuxInt(123); + assertTrue(builder.hasFooMessage()); + assertEquals(123, builder.getFooMessage().getQuxInt()); message = builder.build(); - assertThat(message.hasFooMessage()).isTrue(); - assertThat(message.getFooMessage().getMooInt()).isEqualTo(123); + assertTrue(message.hasFooMessage()); + assertEquals(123, message.getFooMessage().getQuxInt()); } // LazyMessage is tested in LazyMessageLiteTest.java } - @Test - public void testOneofMergeNonMessage() throws Exception { + public void testOneofMerge() throws Exception { // Primitive Type { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestOneof2 message = builder.setFooInt(123).build(); TestOneof2 message2 = TestOneof2.newBuilder().mergeFrom(message).build(); - assertThat(message2.hasFooInt()).isTrue(); - assertThat(message2.getFooInt()).isEqualTo(123); + assertTrue(message2.hasFooInt()); + assertEquals(123, message2.getFooInt()); } // String @@ -1647,8 +1581,8 @@ public class GeneratedMessageTest { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestOneof2 message = builder.setFooString("foo").build(); TestOneof2 message2 = TestOneof2.newBuilder().mergeFrom(message).build(); - assertThat(message2.hasFooString()).isTrue(); - assertThat(message2.getFooString()).isEqualTo("foo"); + assertTrue(message2.hasFooString()); + assertEquals("foo", message2.getFooString()); } // Enum @@ -1656,45 +1590,23 @@ public class GeneratedMessageTest { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestOneof2 message = builder.setFooEnum(TestOneof2.NestedEnum.BAR).build(); TestOneof2 message2 = TestOneof2.newBuilder().mergeFrom(message).build(); - assertThat(message2.hasFooEnum()).isTrue(); - assertThat(message2.getFooEnum()).isEqualTo(TestOneof2.NestedEnum.BAR); + assertTrue(message2.hasFooEnum()); + assertEquals(TestOneof2.NestedEnum.BAR, message2.getFooEnum()); } - } - - @Test - public void testOneofMergeMessage_mergeIntoNewBuilder() { - TestOneof2.Builder builder = TestOneof2.newBuilder(); - TestOneof2 message = - builder.setFooMessage(TestOneof2.NestedMessage.newBuilder().setMooInt(234).build()).build(); - TestOneof2 message2 = TestOneof2.newBuilder().mergeFrom(message).build(); - assertThat(message2.hasFooMessage()).isTrue(); - assertThat(message2.getFooMessage().getMooInt()).isEqualTo(234); - } - - @Test - public void testOneofMergeMessage_mergeWithGetMessageBuilder() { - TestOneof2.Builder builder = TestOneof2.newBuilder(); - builder.getFooMessageBuilder().addCorgeInt(1); - assertThat(builder.mergeFrom(MESSAGE_TO_MERGE_FROM).build()).isEqualTo(EXPECTED_MERGED_MESSAGE); - } - @Test - public void testOneofMergeMessage_mergeIntoMessageBuiltWithGetMessageBuilder() { - TestOneof2.Builder builder = TestOneof2.newBuilder(); - builder.getFooMessageBuilder().addCorgeInt(1); - TestOneof2 message = builder.build(); - assertThat(message.toBuilder().mergeFrom(MESSAGE_TO_MERGE_FROM).build()) - .isEqualTo(EXPECTED_MERGED_MESSAGE); - } - - @Test - public void testOneofMergeMessage_mergeWithoutGetMessageBuilder() { - TestOneof2.Builder builder = - TestOneof2.newBuilder().setFooMessage(TestOneof2.NestedMessage.newBuilder().addCorgeInt(1)); - assertThat(builder.mergeFrom(MESSAGE_TO_MERGE_FROM).build()).isEqualTo(EXPECTED_MERGED_MESSAGE); + // Message + { + TestOneof2.Builder builder = TestOneof2.newBuilder(); + TestOneof2 message = + builder + .setFooMessage(TestOneof2.NestedMessage.newBuilder().setQuxInt(234).build()) + .build(); + TestOneof2 message2 = TestOneof2.newBuilder().mergeFrom(message).build(); + assertTrue(message2.hasFooMessage()); + assertEquals(234, message2.getFooMessage().getQuxInt()); + } } - @Test public void testOneofSerialization() throws Exception { // Primitive Type { @@ -1702,8 +1614,8 @@ public class GeneratedMessageTest { TestOneof2 message = builder.setFooInt(123).build(); ByteString serialized = message.toByteString(); TestOneof2 message2 = TestOneof2.parseFrom(serialized); - assertThat(message2.hasFooInt()).isTrue(); - assertThat(message2.getFooInt()).isEqualTo(123); + assertTrue(message2.hasFooInt()); + assertEquals(123, message2.getFooInt()); } // String @@ -1712,8 +1624,8 @@ public class GeneratedMessageTest { TestOneof2 message = builder.setFooString("foo").build(); ByteString serialized = message.toByteString(); TestOneof2 message2 = TestOneof2.parseFrom(serialized); - assertThat(message2.hasFooString()).isTrue(); - assertThat(message2.getFooString()).isEqualTo("foo"); + assertTrue(message2.hasFooString()); + assertEquals("foo", message2.getFooString()); } // Enum @@ -1722,8 +1634,8 @@ public class GeneratedMessageTest { TestOneof2 message = builder.setFooEnum(TestOneof2.NestedEnum.BAR).build(); ByteString serialized = message.toByteString(); TestOneof2 message2 = TestOneof2.parseFrom(serialized); - assertThat(message2.hasFooEnum()).isTrue(); - assertThat(message2.getFooEnum()).isEqualTo(TestOneof2.NestedEnum.BAR); + assertTrue(message2.hasFooEnum()); + assertEquals(TestOneof2.NestedEnum.BAR, message2.getFooEnum()); } // Message @@ -1731,63 +1643,26 @@ public class GeneratedMessageTest { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestOneof2 message = builder - .setFooMessage(TestOneof2.NestedMessage.newBuilder().setMooInt(234).build()) + .setFooMessage(TestOneof2.NestedMessage.newBuilder().setQuxInt(234).build()) .build(); ByteString serialized = message.toByteString(); TestOneof2 message2 = TestOneof2.parseFrom(serialized); - assertThat(message2.hasFooMessage()).isTrue(); - assertThat(message2.getFooMessage().getMooInt()).isEqualTo(234); + assertTrue(message2.hasFooMessage()); + assertEquals(234, message2.getFooMessage().getQuxInt()); } } - @Test public void testOneofNestedBuilderOnChangePropagation() { NestedTestAllTypes.Builder parentBuilder = NestedTestAllTypes.newBuilder(); TestAllTypes.Builder builder = parentBuilder.getPayloadBuilder(); builder.getOneofNestedMessageBuilder(); - assertThat(builder.hasOneofNestedMessage()).isTrue(); - assertThat(parentBuilder.hasPayload()).isTrue(); + assertTrue(builder.hasOneofNestedMessage()); + assertTrue(parentBuilder.hasPayload()); NestedTestAllTypes message = parentBuilder.build(); - assertThat(message.hasPayload()).isTrue(); - assertThat(message.getPayload().hasOneofNestedMessage()).isTrue(); - } - - @Test - public void testOneofParseFailurePropagatesUnderlyingException() { - final byte[] bytes = TestOneof2.newBuilder().setFooInt(123).build().toByteArray(); - final IOException injectedException = new IOException("oh no"); - CodedInputStream failingInputStream = - CodedInputStream.newInstance( - new InputStream() { - boolean first = true; - - @Override - public int read(byte[] b, int off, int len) throws IOException { - if (!first) { - throw injectedException; - } - first = false; - System.arraycopy(bytes, 0, b, off, len); - return len; - } - - @Override - public int read() { - throw new UnsupportedOperationException(); - } - }, - bytes.length - 1); - TestOneof2.Builder builder = TestOneof2.newBuilder(); - - try { - builder.mergeFrom(failingInputStream, ExtensionRegistry.getEmptyRegistry()); - assertWithMessage("Expected mergeFrom to fail").fail(); - } catch (IOException e) { - assertThat(e).isSameInstanceAs(injectedException); - } + assertTrue(message.hasPayload()); + assertTrue(message.getPayload().hasOneofNestedMessage()); } - @Test public void testGetRepeatedFieldBuilder() { Descriptor descriptor = TestAllTypes.getDescriptor(); @@ -1799,7 +1674,9 @@ public class GeneratedMessageTest { // Mutate nested message TestAllTypes.Builder builder1 = TestAllTypes.newBuilder(); Message.Builder fieldBuilder1 = builder1.newBuilderForField(fieldDescriptor); - fieldBuilder1.setField(NESTED_MESSAGE_BB_FIELD, 1); + FieldDescriptor subFieldDescriptor1 = + fieldBuilder1.getDescriptorForType().findFieldByName("bb"); + fieldBuilder1.setField(subFieldDescriptor1, 1); builder1.addRepeatedField(fieldDescriptor, fieldBuilder1.build()); // Mutate foreign message @@ -1823,7 +1700,9 @@ public class GeneratedMessageTest { TestAllTypes.Builder builder2 = TestAllTypes.newBuilder(); builder2.addRepeatedNestedMessageBuilder(); Message.Builder fieldBuilder2 = builder2.getRepeatedFieldBuilder(fieldDescriptor, 0); - fieldBuilder2.setField(NESTED_MESSAGE_BB_FIELD, 1); + FieldDescriptor subFieldDescriptor2 = + fieldBuilder2.getDescriptorForType().findFieldByName("bb"); + fieldBuilder2.setField(subFieldDescriptor2, 1); // Mutate foreign message Message.Builder foreignFieldBuilder2 = builder2.newBuilderForField(foreignFieldDescriptor); @@ -1842,10 +1721,9 @@ public class GeneratedMessageTest { Message newMessage2 = builder2.build(); // These two messages should be equal. - assertThat(newMessage1).isEqualTo(newMessage2); + assertEquals(newMessage1, newMessage2); } - @Test public void testGetRepeatedFieldBuilderWithInitializedValue() { Descriptor descriptor = TestAllTypes.getDescriptor(); FieldDescriptor fieldDescriptor = descriptor.findFieldByName("repeated_nested_message"); @@ -1855,7 +1733,7 @@ public class GeneratedMessageTest { builder.addRepeatedNestedMessageBuilder(); NestedMessage.Builder fieldBuilder = (NestedMessage.Builder) builder.getRepeatedFieldBuilder(fieldDescriptor, 0); - assertThat(fieldBuilder.getBb()).isEqualTo(0); + assertEquals(0, fieldBuilder.getBb()); // Setting field value with new field builder instance. builder = TestAllTypes.newBuilder(); @@ -1864,139 +1742,43 @@ public class GeneratedMessageTest { // Then get the field builder instance by getRepeatedFieldBuilder(). fieldBuilder = (NestedMessage.Builder) builder.getRepeatedFieldBuilder(fieldDescriptor, 0); // It should contain new value. - assertThat(fieldBuilder.getBb()).isEqualTo(2); + assertEquals(2, fieldBuilder.getBb()); // These two builder should be equal. - assertThat(fieldBuilder).isSameInstanceAs(newFieldBuilder); + assertSame(fieldBuilder, newFieldBuilder); } - @Test public void testGetRepeatedFieldBuilderNotSupportedException() { Descriptor descriptor = TestAllTypes.getDescriptor(); TestAllTypes.Builder builder = TestAllTypes.newBuilder(); try { builder.getRepeatedFieldBuilder(descriptor.findFieldByName("repeated_int32"), 0); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getRepeatedFieldBuilder(descriptor.findFieldByName("repeated_nested_enum"), 0); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getRepeatedFieldBuilder(descriptor.findFieldByName("optional_int32"), 0); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getRepeatedFieldBuilder(descriptor.findFieldByName("optional_nested_enum"), 0); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } try { builder.getRepeatedFieldBuilder(descriptor.findFieldByName("optional_nested_message"), 0); - assertWithMessage("Exception was not thrown").fail(); + fail("Exception was not thrown"); } catch (UnsupportedOperationException e) { // We expect this exception. } } - - private static final FieldDescriptor OPTIONAL_NESTED_MESSAGE_EXTENSION = - UnittestProto.getDescriptor().findExtensionByName("optional_nested_message_extension"); - private static final FieldDescriptor REPEATED_NESTED_MESSAGE_EXTENSION = - UnittestProto.getDescriptor().findExtensionByName("repeated_nested_message_extension"); - // A compile-time check that TestAllExtensions.Builder does in fact extend - // GeneratedMessageV3.ExtendableBuilder. The tests below assume that it does. - static { - @SuppressWarnings("unused") - Class> ignored = - TestAllExtensions.Builder.class; - } - - @Test - public void - extendableBuilder_extensionFieldContainingBuilder_setRepeatedFieldOverwritesElement() { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - builder.addRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, NestedMessage.getDefaultInstance()); - // Calling getRepeatedFieldBuilder and ignoring the returned Builder should have no - // externally-visible effect, but internally it sets the stored field element to a builder. - builder.getRepeatedFieldBuilder(REPEATED_NESTED_MESSAGE_EXTENSION, 0); - - NestedMessage setNestedMessage = NestedMessage.newBuilder().setBb(100).build(); - builder.setRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, 0, setNestedMessage); - - assertThat(builder.getRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, 0)) - .isEqualTo(setNestedMessage); - } - - @Test - public void extendableBuilder_extensionFieldContainingBuilder_addRepeatedFieldAppendsToField() { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - builder.addRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, NestedMessage.getDefaultInstance()); - // Calling getRepeatedFieldBuilder and ignoring the returned Builder should have no - // externally-visible effect, but internally it sets the stored field element to a builder. - builder.getRepeatedFieldBuilder(REPEATED_NESTED_MESSAGE_EXTENSION, 0); - - builder.addRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, NestedMessage.getDefaultInstance()); - - assertThat((List) builder.getField(REPEATED_NESTED_MESSAGE_EXTENSION)).hasSize(2); - } - - @Test - public void extendableBuilder_mergeFrom_optionalField_changesReflectedInExistingBuilder() { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - Message.Builder nestedMessageBuilder = - builder.getFieldBuilder(OPTIONAL_NESTED_MESSAGE_EXTENSION); - - builder.mergeFrom( - TestAllExtensions.newBuilder() - .setField(OPTIONAL_NESTED_MESSAGE_EXTENSION, NestedMessage.newBuilder().setBb(100)) - .build()); - - assertThat(nestedMessageBuilder.getField(NESTED_MESSAGE_BB_FIELD)).isEqualTo(100); - } - - @Test - public void extendableBuilder_mergeFrom_optionalField_doesNotInvalidateExistingBuilder() { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - Message.Builder nestedMessageBuilder = - builder.getFieldBuilder(OPTIONAL_NESTED_MESSAGE_EXTENSION); - - builder.mergeFrom( - TestAllExtensions.newBuilder() - .setField(OPTIONAL_NESTED_MESSAGE_EXTENSION, NestedMessage.newBuilder().setBb(100)) - .build()); - - // Changes to nestedMessageBuilder should still be reflected in the parent builder. - nestedMessageBuilder.setField(NESTED_MESSAGE_BB_FIELD, 200); - - assertThat(builder.build()) - .isEqualTo( - TestAllExtensions.newBuilder() - .setField(OPTIONAL_NESTED_MESSAGE_EXTENSION, NestedMessage.newBuilder().setBb(200)) - .build()); - } - - @Test - public void extendableBuilder_mergeFrom_repeatedField_doesNotInvalidateExistingBuilder() { - TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - builder.addRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, NestedMessage.getDefaultInstance()); - Message.Builder nestedMessageBuilder = - builder.getRepeatedFieldBuilder(REPEATED_NESTED_MESSAGE_EXTENSION, 0); - - builder.mergeFrom( - TestAllExtensions.newBuilder() - .addRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, NestedMessage.getDefaultInstance()) - .build()); - - // Changes to nestedMessageBuilder should still be reflected in the parent builder. - nestedMessageBuilder.setField(NESTED_MESSAGE_BB_FIELD, 100); - - assertThat(builder.getRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, 0)) - .isEqualTo(NestedMessage.newBuilder().setBb(100).build()); - } } diff --git a/java/core/src/test/java/com/google/protobuf/IntArrayListTest.java b/java/core/src/test/java/com/google/protobuf/IntArrayListTest.java index 8432075dd2224505022cee49729afe0316d3e0af..2ad94f83de732169609468533fa7d78e019d0014 100644 --- a/java/core/src/test/java/com/google/protobuf/IntArrayListTest.java +++ b/java/core/src/test/java/com/google/protobuf/IntArrayListTest.java @@ -1,50 +1,68 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static java.util.Arrays.asList; import com.google.protobuf.Internal.IntList; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Iterator; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests for {@link IntArrayList}. */ -@RunWith(JUnit4.class) -public class IntArrayListTest { +/** + * Tests for {@link IntArrayList}. + * + * @author dweis@google.com (Daniel Weis) + */ +public class IntArrayListTest extends TestCase { private static final IntArrayList UNARY_LIST = newImmutableIntArrayList(1); private static final IntArrayList TERTIARY_LIST = newImmutableIntArrayList(1, 2, 3); private IntArrayList list; - @Before - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { list = new IntArrayList(); } - @Test public void testEmptyListReturnsSameInstance() { - assertThat(IntArrayList.emptyList()).isSameInstanceAs(IntArrayList.emptyList()); + assertSame(IntArrayList.emptyList(), IntArrayList.emptyList()); } - @Test public void testEmptyListIsImmutable() { assertImmutable(IntArrayList.emptyList()); } - @Test public void testMakeImmutable() { list.addInt(3); list.addInt(4); @@ -54,20 +72,19 @@ public class IntArrayListTest { assertImmutable(list); } - @Test public void testModificationWithIteration() { list.addAll(asList(1, 2, 3, 4)); Iterator iterator = list.iterator(); - assertThat(list).hasSize(4); - assertThat((int) list.get(0)).isEqualTo(1); - assertThat((int) iterator.next()).isEqualTo(1); + assertEquals(4, list.size()); + assertEquals(1, (int) list.get(0)); + assertEquals(1, (int) iterator.next()); list.set(0, 1); - assertThat((int) iterator.next()).isEqualTo(2); + assertEquals(2, (int) iterator.next()); list.remove(0); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } @@ -76,211 +93,191 @@ public class IntArrayListTest { list.add(0, 0); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } } - @Test public void testGet() { - assertThat((int) TERTIARY_LIST.get(0)).isEqualTo(1); - assertThat((int) TERTIARY_LIST.get(1)).isEqualTo(2); - assertThat((int) TERTIARY_LIST.get(2)).isEqualTo(3); + assertEquals(1, (int) TERTIARY_LIST.get(0)); + assertEquals(2, (int) TERTIARY_LIST.get(1)); + assertEquals(3, (int) TERTIARY_LIST.get(2)); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testGetInt() { - assertThat(TERTIARY_LIST.getInt(0)).isEqualTo(1); - assertThat(TERTIARY_LIST.getInt(1)).isEqualTo(2); - assertThat(TERTIARY_LIST.getInt(2)).isEqualTo(3); + assertEquals(1, TERTIARY_LIST.getInt(0)); + assertEquals(2, TERTIARY_LIST.getInt(1)); + assertEquals(3, TERTIARY_LIST.getInt(2)); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testIndexOf_nullElement() { - assertThat(TERTIARY_LIST.indexOf(null)).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(null)); } - @Test public void testIndexOf_incompatibleElementType() { - assertThat(TERTIARY_LIST.indexOf(new Object())).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(new Object())); } - @Test public void testIndexOf_notInList() { - assertThat(UNARY_LIST.indexOf(2)).isEqualTo(-1); + assertEquals(-1, UNARY_LIST.indexOf(2)); } - @Test public void testIndexOf_notInListWithDuplicates() { IntArrayList listWithDupes = newImmutableIntArrayList(1, 1); - assertThat(listWithDupes.indexOf(2)).isEqualTo(-1); + assertEquals(-1, listWithDupes.indexOf(2)); } - @Test public void testIndexOf_inList() { - assertThat(TERTIARY_LIST.indexOf(2)).isEqualTo(1); + assertEquals(1, TERTIARY_LIST.indexOf(2)); } - @Test public void testIndexOf_inListWithDuplicates_matchAtHead() { IntArrayList listWithDupes = newImmutableIntArrayList(1, 1, 2); - assertThat(listWithDupes.indexOf(1)).isEqualTo(0); + assertEquals(0, listWithDupes.indexOf(1)); } - @Test public void testIndexOf_inListWithDuplicates_matchMidList() { IntArrayList listWithDupes = newImmutableIntArrayList(2, 1, 1, 2); - assertThat(listWithDupes.indexOf(1)).isEqualTo(1); + assertEquals(1, listWithDupes.indexOf(1)); } - @Test public void testContains_nullElement() { - assertThat(TERTIARY_LIST).doesNotContain(null); + assertEquals(false, TERTIARY_LIST.contains(null)); } - @Test public void testContains_incompatibleElementType() { - assertThat(TERTIARY_LIST).doesNotContain(new Object()); + assertEquals(false, TERTIARY_LIST.contains(new Object())); } - @Test public void testContains_notInList() { - assertThat(UNARY_LIST).doesNotContain(2); + assertEquals(false, UNARY_LIST.contains(2)); } - @Test public void testContains_notInListWithDuplicates() { IntArrayList listWithDupes = newImmutableIntArrayList(1, 1); - assertThat(listWithDupes).doesNotContain(2); + assertEquals(false, listWithDupes.contains(2)); } - @Test public void testContains_inList() { - assertThat(TERTIARY_LIST).contains(2); + assertEquals(true, TERTIARY_LIST.contains(2)); } - @Test public void testContains_inListWithDuplicates_matchAtHead() { IntArrayList listWithDupes = newImmutableIntArrayList(1, 1, 2); - assertThat(listWithDupes).contains(1); + assertEquals(true, listWithDupes.contains(1)); } - @Test public void testContains_inListWithDuplicates_matchMidList() { IntArrayList listWithDupes = newImmutableIntArrayList(2, 1, 1, 2); - assertThat(listWithDupes).contains(1); + assertEquals(true, listWithDupes.contains(1)); } - @Test public void testSize() { - assertThat(IntArrayList.emptyList()).isEmpty(); - assertThat(UNARY_LIST).hasSize(1); - assertThat(TERTIARY_LIST).hasSize(3); + assertEquals(0, IntArrayList.emptyList().size()); + assertEquals(1, UNARY_LIST.size()); + assertEquals(3, TERTIARY_LIST.size()); list.addInt(3); list.addInt(4); list.addInt(6); list.addInt(8); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); list.remove(0); - assertThat(list).hasSize(3); + assertEquals(3, list.size()); list.add(17); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); } - @Test public void testSet() { list.addInt(2); list.addInt(4); - assertThat((int) list.set(0, 3)).isEqualTo(2); - assertThat(list.getInt(0)).isEqualTo(3); + assertEquals(2, (int) list.set(0, 3)); + assertEquals(3, list.getInt(0)); - assertThat((int) list.set(1, 0)).isEqualTo(4); - assertThat(list.getInt(1)).isEqualTo(0); + assertEquals(4, (int) list.set(1, 0)); + assertEquals(0, list.getInt(1)); try { list.set(-1, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.set(2, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testSetInt() { list.addInt(1); list.addInt(3); - assertThat(list.setInt(0, 0)).isEqualTo(1); - assertThat(list.getInt(0)).isEqualTo(0); + assertEquals(1, list.setInt(0, 0)); + assertEquals(0, list.getInt(0)); - assertThat(list.setInt(1, 0)).isEqualTo(3); - assertThat(list.getInt(1)).isEqualTo(0); + assertEquals(3, list.setInt(1, 0)); + assertEquals(0, list.getInt(1)); try { list.setInt(-1, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.setInt(2, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testAdd() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.add(2)).isTrue(); - assertThat(list).containsExactly(2); + assertTrue(list.add(2)); + assertEquals(asList(2), list); - assertThat(list.add(3)).isTrue(); + assertTrue(list.add(3)); list.add(0, 4); - assertThat(list).containsExactly(4, 2, 3).inOrder(); + assertEquals(asList(4, 2, 3), list); list.add(0, 1); list.add(0, 0); @@ -288,7 +285,7 @@ public class IntArrayListTest { for (int i = 0; i < 6; i++) { list.add(Integer.valueOf(5 + i)); } - assertThat(list).containsExactly(0, 1, 4, 2, 3, 5, 6, 7, 8, 9, 10).inOrder(); + assertEquals(asList(0, 1, 4, 2, 3, 5, 6, 7, 8, 9, 10), list); try { list.add(-1, 5); @@ -303,98 +300,90 @@ public class IntArrayListTest { } } - @Test public void testAddInt() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); list.addInt(2); - assertThat(list).containsExactly(2); + assertEquals(asList(2), list); list.addInt(3); - assertThat(list).containsExactly(2, 3).inOrder(); + assertEquals(asList(2, 3), list); } - @Test public void testAddAll() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.addAll(Collections.singleton(1))).isTrue(); - assertThat(list).hasSize(1); - assertThat((int) list.get(0)).isEqualTo(1); - assertThat(list.getInt(0)).isEqualTo(1); + assertTrue(list.addAll(Collections.singleton(1))); + assertEquals(1, list.size()); + assertEquals(1, (int) list.get(0)); + assertEquals(1, list.getInt(0)); - assertThat(list.addAll(asList(2, 3, 4, 5, 6))).isTrue(); - assertThat(list).containsExactly(1, 2, 3, 4, 5, 6).inOrder(); + assertTrue(list.addAll(asList(2, 3, 4, 5, 6))); + assertEquals(asList(1, 2, 3, 4, 5, 6), list); - assertThat(list.addAll(TERTIARY_LIST)).isTrue(); - assertThat(list).containsExactly(1, 2, 3, 4, 5, 6, 1, 2, 3).inOrder(); + assertTrue(list.addAll(TERTIARY_LIST)); + assertEquals(asList(1, 2, 3, 4, 5, 6, 1, 2, 3), list); - assertThat(list.addAll(Collections.emptyList())).isFalse(); - assertThat(list.addAll(IntArrayList.emptyList())).isFalse(); + assertFalse(list.addAll(Collections.emptyList())); + assertFalse(list.addAll(IntArrayList.emptyList())); } - @Test public void testEquals() { IntArrayList list1 = new IntArrayList(); IntArrayList list2 = new IntArrayList(); - assertThat(list1).isEqualTo(list2); + assertEquals(list1, list2); } - @Test public void testRemove() { list.addAll(TERTIARY_LIST); - assertThat((int) list.remove(0)).isEqualTo(1); - assertThat(list).containsExactly(2, 3).inOrder(); + assertEquals(1, (int) list.remove(0)); + assertEquals(asList(2, 3), list); - assertThat(list.remove(Integer.valueOf(3))).isTrue(); - assertThat(list).containsExactly(2); + assertTrue(list.remove(Integer.valueOf(3))); + assertEquals(asList(2), list); - assertThat(list.remove(Integer.valueOf(3))).isFalse(); - assertThat(list).containsExactly(2); + assertFalse(list.remove(Integer.valueOf(3))); + assertEquals(asList(2), list); - assertThat((int) list.remove(0)).isEqualTo(2); - assertThat(list).isEmpty(); + assertEquals(2, (int) list.remove(0)); + assertEquals(asList(), list); try { list.remove(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.remove(0); - assertWithMessage("expected exception").fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testRemoveEnd_listAtCapacity() { IntList toRemove = IntArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addInt(3); toRemove.remove(0); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } - @Test public void testRemove_listAtCapacity() { IntList toRemove = IntArrayList.emptyList().mutableCopyWithCapacity(2); toRemove.addInt(3); toRemove.addInt(4); toRemove.remove(0); - assertThat(toRemove).hasSize(1); - assertThat((int) toRemove.get(0)).isEqualTo(4); + assertEquals(1, toRemove.size()); + assertEquals(4, (int) toRemove.get(0)); } - @Test public void testSublistRemoveEndOfCapacity() { IntList toRemove = IntArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addInt(3); toRemove.subList(0, 1).clear(); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } private void assertImmutable(IntList list) { @@ -404,147 +393,147 @@ public class IntArrayListTest { try { list.add(1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.add(0, 1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.singletonList(1)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(new IntArrayList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.singleton(1)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addInt(0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.clear(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.singleton(1)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.singleton(1)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.setInt(0, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } diff --git a/java/core/src/test/java/com/google/protobuf/InvalidProtocolBufferExceptionTest.java b/java/core/src/test/java/com/google/protobuf/InvalidProtocolBufferExceptionTest.java deleted file mode 100644 index 655f06cf425e3a70328951868072237dbd2c6ce8..0000000000000000000000000000000000000000 --- a/java/core/src/test/java/com/google/protobuf/InvalidProtocolBufferExceptionTest.java +++ /dev/null @@ -1,26 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import static com.google.common.truth.Truth.assertThat; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class InvalidProtocolBufferExceptionTest { - - @Test - public void testWrapRuntimeException() { - ArrayIndexOutOfBoundsException root = new ArrayIndexOutOfBoundsException(); - InvalidProtocolBufferException wrapper = new InvalidProtocolBufferException(root); - assertThat(wrapper).hasCauseThat().isEqualTo(root); - } - -} diff --git a/java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java b/java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java index 6bfec1d2b611fa38dc31e98b936c3118b68e69fe..6a737f16217d62f15dd14b94e9bfac8d236567bf 100644 --- a/java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java +++ b/java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java @@ -1,26 +1,45 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; import static com.google.protobuf.IsValidUtf8TestUtil.DIRECT_NIO_FACTORY; import static com.google.protobuf.IsValidUtf8TestUtil.EXPECTED_ONE_BYTE_ROUNDTRIPPABLE_COUNT; import static com.google.protobuf.IsValidUtf8TestUtil.EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT; import static com.google.protobuf.IsValidUtf8TestUtil.HEAP_NIO_FACTORY; import static com.google.protobuf.IsValidUtf8TestUtil.LITERAL_FACTORY; -import static com.google.protobuf.IsValidUtf8TestUtil.ROPE_FACTORY; import static com.google.protobuf.IsValidUtf8TestUtil.testBytes; import com.google.protobuf.IsValidUtf8TestUtil.ByteStringFactory; import com.google.protobuf.IsValidUtf8TestUtil.Shard; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Tests cases for {@link ByteString#isValidUtf8()}. This includes three brute force tests that @@ -30,34 +49,33 @@ import org.junit.runners.JUnit4; * sequence that will round trip when converted to a String and then back to bytes and will return * false for any sequence that will not round trip. See also {@link IsValidUtf8FourByteTest}. It * also includes some other more targeted tests. + * + * @author jonp@google.com (Jon Perlow) + * @author martinrb@google.com (Martin Buchholz) */ -@RunWith(JUnit4.class) -public class IsValidUtf8Test { +public class IsValidUtf8Test extends TestCase { /** Tests that round tripping of all two byte permutations work. */ - @Test public void testIsValidUtf8_1Byte() { testBytes(LITERAL_FACTORY, 1, EXPECTED_ONE_BYTE_ROUNDTRIPPABLE_COUNT); testBytes(HEAP_NIO_FACTORY, 1, EXPECTED_ONE_BYTE_ROUNDTRIPPABLE_COUNT); testBytes(DIRECT_NIO_FACTORY, 1, EXPECTED_ONE_BYTE_ROUNDTRIPPABLE_COUNT); - testBytes(ROPE_FACTORY, 1, EXPECTED_ONE_BYTE_ROUNDTRIPPABLE_COUNT); } /** Tests that round tripping of all two byte permutations work. */ - @Test public void testIsValidUtf8_2Bytes() { testBytes(LITERAL_FACTORY, 2, IsValidUtf8TestUtil.EXPECTED_TWO_BYTE_ROUNDTRIPPABLE_COUNT); testBytes(HEAP_NIO_FACTORY, 2, IsValidUtf8TestUtil.EXPECTED_TWO_BYTE_ROUNDTRIPPABLE_COUNT); testBytes(DIRECT_NIO_FACTORY, 2, IsValidUtf8TestUtil.EXPECTED_TWO_BYTE_ROUNDTRIPPABLE_COUNT); - testBytes(ROPE_FACTORY, 2, IsValidUtf8TestUtil.EXPECTED_TWO_BYTE_ROUNDTRIPPABLE_COUNT); } /** Tests that round tripping of all three byte permutations work. */ - @Test public void testIsValidUtf8_3Bytes() { - testBytes(LITERAL_FACTORY, 3, EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT); - testBytes(HEAP_NIO_FACTORY, 3, EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT); - testBytes(DIRECT_NIO_FACTORY, 3, EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT); - testBytes(ROPE_FACTORY, 3, EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT); + // Travis' OOM killer doesn't like this test + if (System.getenv("TRAVIS") == null) { + testBytes(LITERAL_FACTORY, 3, EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT); + testBytes(HEAP_NIO_FACTORY, 3, EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT); + testBytes(DIRECT_NIO_FACTORY, 3, EXPECTED_THREE_BYTE_ROUNDTRIPPABLE_COUNT); + } } /** @@ -65,7 +83,6 @@ public class IsValidUtf8Test { * prohibitively expensive to test for automated runs; {@link IsValidUtf8FourByteTest} is used for * full coverage. This method tests specific four-byte cases. */ - @Test public void testIsValidUtf8_4BytesSamples() { // Valid 4 byte. assertValidUtf8(0xF0, 0xA4, 0xAD, 0xA2); @@ -80,40 +97,29 @@ public class IsValidUtf8Test { } /** Tests some hard-coded test cases. */ - @Test public void testSomeSequences() { // Empty - assertThat(asBytes("").isValidUtf8()).isTrue(); + assertTrue(asBytes("").isValidUtf8()); // One-byte characters, including control characters - assertThat(asBytes("\u0000abc\u007f").isValidUtf8()).isTrue(); + assertTrue(asBytes("\u0000abc\u007f").isValidUtf8()); // Two-byte characters - assertThat(asBytes("\u00a2\u00a2").isValidUtf8()).isTrue(); + assertTrue(asBytes("\u00a2\u00a2").isValidUtf8()); // Three-byte characters - assertThat(asBytes("\u020ac\u020ac").isValidUtf8()).isTrue(); + assertTrue(asBytes("\u020ac\u020ac").isValidUtf8()); // Four-byte characters - assertThat(asBytes("\u024B62\u024B62").isValidUtf8()).isTrue(); + assertTrue(asBytes("\u024B62\u024B62").isValidUtf8()); // Mixed string - assertThat(asBytes("a\u020ac\u00a2b\\u024B62u020acc\u00a2de\u024B62").isValidUtf8()).isTrue(); + assertTrue(asBytes("a\u020ac\u00a2b\\u024B62u020acc\u00a2de\u024B62").isValidUtf8()); // Not a valid string assertInvalidUtf8(-1, 0, -1, 0); } - @Test - public void testShardsHaveExpectedRoundTrippables() { - // A sanity check. - int actual = 0; - for (Shard shard : IsValidUtf8TestUtil.FOUR_BYTE_SHARDS) { - actual = (int) (actual + shard.expected); - } - assertThat(actual).isEqualTo(IsValidUtf8TestUtil.EXPECTED_FOUR_BYTE_ROUNDTRIPPABLE_COUNT); - } - private byte[] toByteArray(int... bytes) { byte[] realBytes = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { @@ -124,12 +130,12 @@ public class IsValidUtf8Test { private void assertValidUtf8(ByteStringFactory factory, int[] bytes, boolean not) { byte[] realBytes = toByteArray(bytes); - assertThat(not ^ Utf8.isValidUtf8(realBytes)).isTrue(); - assertThat(not ^ Utf8.isValidUtf8(realBytes, 0, bytes.length)).isTrue(); + assertTrue(not ^ Utf8.isValidUtf8(realBytes)); + assertTrue(not ^ Utf8.isValidUtf8(realBytes, 0, bytes.length)); ByteString leaf = factory.newByteString(realBytes); ByteString sub = leaf.substring(0, bytes.length); - assertThat(not ^ leaf.isValidUtf8()).isTrue(); - assertThat(not ^ sub.isValidUtf8()).isTrue(); + assertTrue(not ^ leaf.isValidUtf8()); + assertTrue(not ^ sub.isValidUtf8()); ByteString[] ropes = { RopeByteString.newInstanceForTest(ByteString.EMPTY, leaf), RopeByteString.newInstanceForTest(ByteString.EMPTY, sub), @@ -138,7 +144,7 @@ public class IsValidUtf8Test { RopeByteString.newInstanceForTest(sub, leaf) }; for (ByteString rope : ropes) { - assertThat(not ^ rope.isValidUtf8()).isTrue(); + assertTrue(not ^ rope.isValidUtf8()); } } @@ -146,17 +152,24 @@ public class IsValidUtf8Test { assertValidUtf8(LITERAL_FACTORY, bytes, false); assertValidUtf8(HEAP_NIO_FACTORY, bytes, false); assertValidUtf8(DIRECT_NIO_FACTORY, bytes, false); - assertValidUtf8(ROPE_FACTORY, bytes, false); } private void assertInvalidUtf8(int... bytes) { assertValidUtf8(LITERAL_FACTORY, bytes, true); assertValidUtf8(HEAP_NIO_FACTORY, bytes, true); assertValidUtf8(DIRECT_NIO_FACTORY, bytes, true); - assertValidUtf8(ROPE_FACTORY, bytes, true); } private static ByteString asBytes(String s) { return ByteString.copyFromUtf8(s); } + + public void testShardsHaveExpectedRoundTrippables() { + // A sanity check. + int actual = 0; + for (Shard shard : IsValidUtf8TestUtil.FOUR_BYTE_SHARDS) { + actual = (int) (actual + shard.expected); + } + assertEquals(IsValidUtf8TestUtil.EXPECTED_FOUR_BYTE_ROUNDTRIPPABLE_COUNT, actual); + } } diff --git a/java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java b/java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java index d0c33de293b2a390be44928c035bfccf76fed47a..67d2f5961d304be48704e4a3cf5273d734424a8f 100644 --- a/java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java +++ b/java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java @@ -1,21 +1,53 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.lang.ref.SoftReference; import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CharsetEncoder; +import java.nio.charset.CoderResult; +import java.nio.charset.CodingErrorAction; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; +import java.util.logging.Logger; /** * Shared testing code for {@link IsValidUtf8Test} and {@link IsValidUtf8FourByteTest}. @@ -24,6 +56,8 @@ import java.util.Random; * @author martinrb@google.com (Martin Buchholz) */ final class IsValidUtf8TestUtil { + private static Logger logger = Logger.getLogger(IsValidUtf8TestUtil.class.getName()); + private IsValidUtf8TestUtil() {} static interface ByteStringFactory { @@ -46,7 +80,8 @@ final class IsValidUtf8TestUtil { } }; - private static final ThreadLocal> directBuffer = new ThreadLocal<>(); + private static ThreadLocal> directBuffer = + new ThreadLocal>(); /** * Factory for direct {@link ByteBuffer} instances. To reduce direct memory usage, this uses a @@ -71,29 +106,6 @@ final class IsValidUtf8TestUtil { } }; - static final ByteStringFactory ROPE_FACTORY = - new ByteStringFactory() { - // Seed the random number generator with 0 so that the tests are deterministic. - private final Random random = new Random(0); - - @Override - public ByteString newByteString(byte[] bytes) { - // We split the byte array into three pieces (some possibly empty) by choosing two random - // cut points i and j. - int i = random.nextInt(bytes.length); - int j = random.nextInt(bytes.length); - if (j < i) { - int tmp = i; - i = j; - j = tmp; - } - return RopeByteString.newInstanceForTest( - ByteString.wrap(bytes, 0, i), - RopeByteString.newInstanceForTest( - ByteString.wrap(bytes, i, j - i), ByteString.wrap(bytes, j, bytes.length - j))); - } - }; - // 128 - [chars 0x0000 to 0x007f] static final long ONE_BYTE_ROUNDTRIPPABLE_CHARACTERS = 0x007f - 0x0000 + 1; @@ -159,7 +171,7 @@ final class IsValidUtf8TestUtil { final long expected; public Shard(long index, long start, long lim, long expected) { - assertThat(start).isLessThan(lim); + assertTrue(start < lim); this.index = index; this.start = start; this.lim = lim; @@ -204,11 +216,11 @@ final class IsValidUtf8TestUtil { generateFourByteShards(128, FOUR_BYTE_SHARDS_EXPECTED_ROUNTRIPPABLES); private static List generateFourByteShards(int numShards, long[] expected) { - assertThat(expected).hasLength(numShards); - List shards = new ArrayList<>(numShards); + assertEquals(numShards, expected.length); + List shards = new ArrayList(numShards); long lim = 1L << 32; long increment = lim / numShards; - assertThat(lim % numShards).isEqualTo(0); + assertTrue(lim % numShards == 0); for (int i = 0; i < numShards; i++) { shards.add(new Shard(i, increment * i, increment * (i + 1), expected[i])); } @@ -239,11 +251,13 @@ final class IsValidUtf8TestUtil { */ static void testBytes( ByteStringFactory factory, int numBytes, long expectedCount, long start, long lim) { + Random rnd = new Random(); byte[] bytes = new byte[numBytes]; if (lim == -1) { lim = 1L << (numBytes * 8); } + long count = 0; long countRoundTripped = 0; for (long byteChar = start; byteChar < lim; byteChar++) { long tmpByteChar = byteChar; @@ -261,14 +275,166 @@ final class IsValidUtf8TestUtil { outputFailure(byteChar, bytes, bytesReencoded); } - // Check agreement with Utf8.isValidUtf8. - assertThat(Utf8.isValidUtf8(bytes)).isEqualTo(isRoundTrippable); + // Check agreement with static Utf8 methods. + assertEquals(isRoundTrippable, Utf8.isValidUtf8(bytes)); + assertEquals(isRoundTrippable, Utf8.isValidUtf8(bytes, 0, numBytes)); + + try { + assertEquals(s, Utf8.decodeUtf8(bytes, 0, numBytes)); + } catch (InvalidProtocolBufferException e) { + if (isRoundTrippable) { + System.out.println("Could not decode utf-8"); + outputFailure(byteChar, bytes, bytesReencoded); + } + } + + // Test partial sequences. + // Partition numBytes into three segments (not necessarily non-empty). + int i = rnd.nextInt(numBytes); + int j = rnd.nextInt(numBytes); + if (j < i) { + int tmp = i; + i = j; + j = tmp; + } + int state1 = Utf8.partialIsValidUtf8(Utf8.COMPLETE, bytes, 0, i); + int state2 = Utf8.partialIsValidUtf8(state1, bytes, i, j); + int state3 = Utf8.partialIsValidUtf8(state2, bytes, j, numBytes); + if (isRoundTrippable != (state3 == Utf8.COMPLETE)) { + System.out.printf("state=%04x %04x %04x i=%d j=%d%n", state1, state2, state3, i, j); + outputFailure(byteChar, bytes, bytesReencoded); + } + assertEquals(isRoundTrippable, (state3 == Utf8.COMPLETE)); + + // Test ropes built out of small partial sequences + ByteString rope = + RopeByteString.newInstanceForTest( + bs.substring(0, i), + RopeByteString.newInstanceForTest(bs.substring(i, j), bs.substring(j, numBytes))); + assertSame(RopeByteString.class, rope.getClass()); + + ByteString[] byteStrings = {bs, bs.substring(0, numBytes), rope}; + for (ByteString x : byteStrings) { + assertEquals(isRoundTrippable, x.isValidUtf8()); + assertEquals(state3, x.partialIsValidUtf8(Utf8.COMPLETE, 0, numBytes)); + + assertEquals(state1, x.partialIsValidUtf8(Utf8.COMPLETE, 0, i)); + assertEquals(state1, x.substring(0, i).partialIsValidUtf8(Utf8.COMPLETE, 0, i)); + assertEquals(state2, x.partialIsValidUtf8(state1, i, j - i)); + assertEquals(state2, x.substring(i, j).partialIsValidUtf8(state1, 0, j - i)); + assertEquals(state3, x.partialIsValidUtf8(state2, j, numBytes - j)); + assertEquals(state3, x.substring(j, numBytes).partialIsValidUtf8(state2, 0, numBytes - j)); + } + + // ByteString reduplication should not affect its UTF-8 validity. + ByteString ropeADope = RopeByteString.newInstanceForTest(bs, bs.substring(0, numBytes)); + assertEquals(isRoundTrippable, ropeADope.isValidUtf8()); + + if (isRoundTrippable) { + countRoundTripped++; + } + count++; + if (byteChar != 0 && byteChar % 1000000L == 0) { + logger.info("Processed " + (byteChar / 1000000L) + " million characters"); + } + } + logger.info("Round tripped " + countRoundTripped + " of " + count); + assertEquals(expectedCount, countRoundTripped); + } + + /** + * Variation of {@link #testBytes} that does less allocation using the low-level encoders/decoders + * directly. Checked in because it's useful for debugging when trying to process bytes faster, but + * since it doesn't use the actual String class, it's possible for incompatibilities to develop + * (although unlikely). + * + * @param factory the factory for {@link ByteString} instances. + * @param numBytes the number of bytes in the byte array + * @param expectedCount the expected number of roundtrippable permutations + * @param start the starting bytes encoded as a long as big-endian + * @param lim the limit of bytes to process encoded as a long as big-endian, or -1 to mean the max + * limit for numBytes + */ + static void testBytesUsingByteBuffers( + ByteStringFactory factory, int numBytes, long expectedCount, long start, long lim) { + CharsetDecoder decoder = + Internal.UTF_8 + .newDecoder() + .onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE); + CharsetEncoder encoder = + Internal.UTF_8 + .newEncoder() + .onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE); + byte[] bytes = new byte[numBytes]; + int maxChars = (int) (decoder.maxCharsPerByte() * numBytes) + 1; + char[] charsDecoded = new char[(int) (decoder.maxCharsPerByte() * numBytes) + 1]; + int maxBytes = (int) (encoder.maxBytesPerChar() * maxChars) + 1; + byte[] bytesReencoded = new byte[maxBytes]; + + ByteBuffer bb = ByteBuffer.wrap(bytes); + CharBuffer cb = CharBuffer.wrap(charsDecoded); + ByteBuffer bbReencoded = ByteBuffer.wrap(bytesReencoded); + if (lim == -1) { + lim = 1L << (numBytes * 8); + } + long count = 0; + long countRoundTripped = 0; + for (long byteChar = start; byteChar < lim; byteChar++) { + bb.rewind(); + bb.limit(bytes.length); + cb.rewind(); + cb.limit(charsDecoded.length); + bbReencoded.rewind(); + bbReencoded.limit(bytesReencoded.length); + encoder.reset(); + decoder.reset(); + long tmpByteChar = byteChar; + for (int i = 0; i < bytes.length; i++) { + bytes[bytes.length - i - 1] = (byte) tmpByteChar; + tmpByteChar = tmpByteChar >> 8; + } + boolean isRoundTrippable = factory.newByteString(bytes).isValidUtf8(); + CoderResult result = decoder.decode(bb, cb, true); + assertFalse(result.isError()); + result = decoder.flush(cb); + assertFalse(result.isError()); + + int charLen = cb.position(); + cb.rewind(); + cb.limit(charLen); + result = encoder.encode(cb, bbReencoded, true); + assertFalse(result.isError()); + result = encoder.flush(bbReencoded); + assertFalse(result.isError()); + + boolean bytesEqual = true; + int bytesLen = bbReencoded.position(); + if (bytesLen != numBytes) { + bytesEqual = false; + } else { + for (int i = 0; i < numBytes; i++) { + if (bytes[i] != bytesReencoded[i]) { + bytesEqual = false; + break; + } + } + } + if (bytesEqual != isRoundTrippable) { + outputFailure(byteChar, bytes, bytesReencoded, bytesLen); + } + count++; if (isRoundTrippable) { countRoundTripped++; } + if (byteChar != 0 && byteChar % 1000000 == 0) { + logger.info("Processed " + (byteChar / 1000000) + " million characters"); + } } - assertThat(countRoundTripped).isEqualTo(expectedCount); + logger.info("Round tripped " + countRoundTripped + " of " + count); + assertEquals(expectedCount, countRoundTripped); } private static void outputFailure(long byteChar, byte[] bytes, byte[] after) { @@ -276,8 +442,10 @@ final class IsValidUtf8TestUtil { } private static void outputFailure(long byteChar, byte[] bytes, byte[] after, int len) { - assertWithMessage("Failure: (%s) %s => %s", - Long.toHexString(byteChar), toHexString(bytes), toHexString(after, len)).fail(); + fail( + String.format( + "Failure: (%s) %s => %s", + Long.toHexString(byteChar), toHexString(bytes), toHexString(after, len))); } private static String toHexString(byte[] b) { diff --git a/java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java b/java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java index ed8c3a51d6bcfee9307eadb78ee5c2e9141adb32..8c13acae42993bc62580721f767c5a611f8090b4 100644 --- a/java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java +++ b/java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java @@ -1,45 +1,65 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; import static protobuf_unittest.UnittestProto.optionalInt32Extension; import protobuf_unittest.UnittestProto.TestAllExtensions; import protobuf_unittest.UnittestProto.TestAllTypes; import java.io.IOException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Unit test for {@link LazyFieldLite}. */ -@RunWith(JUnit4.class) -public class LazyFieldLiteTest { +/** + * Unit test for {@link LazyFieldLite}. + * + * @author xiangl@google.com (Xiang Li) + */ +public class LazyFieldLiteTest extends TestCase { - @Test public void testGetValue() { MessageLite message = TestUtil.getAllSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); - assertThat(message).isEqualTo(lazyField.getValue(TestAllTypes.getDefaultInstance())); + assertEquals(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); changeValue(lazyField); assertNotEqual(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); } - @Test public void testGetValueEx() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); - assertThat(message).isEqualTo(lazyField.getValue(TestAllExtensions.getDefaultInstance())); + assertEquals(message, lazyField.getValue(TestAllExtensions.getDefaultInstance())); changeValue(lazyField); assertNotEqual(message, lazyField.getValue(TestAllExtensions.getDefaultInstance())); } - @Test public void testSetValue() { MessageLite message = TestUtil.getAllSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); @@ -47,10 +67,9 @@ public class LazyFieldLiteTest { assertNotEqual(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); message = lazyField.getValue(TestAllTypes.getDefaultInstance()); changeValue(lazyField); - assertThat(message).isEqualTo(lazyField.getValue(TestAllTypes.getDefaultInstance())); + assertEquals(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); } - @Test public void testSetValueEx() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); @@ -58,46 +77,41 @@ public class LazyFieldLiteTest { assertNotEqual(message, lazyField.getValue(TestAllExtensions.getDefaultInstance())); MessageLite value = lazyField.getValue(TestAllExtensions.getDefaultInstance()); changeValue(lazyField); - assertThat(value).isEqualTo(lazyField.getValue(TestAllExtensions.getDefaultInstance())); + assertEquals(value, lazyField.getValue(TestAllExtensions.getDefaultInstance())); } - @Test public void testGetSerializedSize() { MessageLite message = TestUtil.getAllSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); - assertThat(message.getSerializedSize()).isEqualTo(lazyField.getSerializedSize()); + assertEquals(message.getSerializedSize(), lazyField.getSerializedSize()); changeValue(lazyField); assertNotEqual(message.getSerializedSize(), lazyField.getSerializedSize()); } - @Test public void testGetSerializedSizeEx() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); - assertThat(message.getSerializedSize()).isEqualTo(lazyField.getSerializedSize()); + assertEquals(message.getSerializedSize(), lazyField.getSerializedSize()); changeValue(lazyField); assertNotEqual(message.getSerializedSize(), lazyField.getSerializedSize()); } - @Test public void testGetByteString() { MessageLite message = TestUtil.getAllSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); - assertThat(message.toByteString()).isEqualTo(lazyField.toByteString()); + assertEquals(message.toByteString(), lazyField.toByteString()); changeValue(lazyField); assertNotEqual(message.toByteString(), lazyField.toByteString()); } - @Test public void testGetByteStringEx() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyFieldLite lazyField = createLazyFieldLiteFromMessage(message); - assertThat(message.toByteString()).isEqualTo(lazyField.toByteString()); + assertEquals(message.toByteString(), lazyField.toByteString()); changeValue(lazyField); assertNotEqual(message.toByteString(), lazyField.toByteString()); } - @Test public void testMergeExtensions() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyFieldLite original = createLazyFieldLiteFromMessage(message); @@ -105,29 +119,25 @@ public class LazyFieldLiteTest { merged.merge(original); TestAllExtensions value = (TestAllExtensions) merged.getValue(TestAllExtensions.getDefaultInstance()); - assertThat(message).isEqualTo(value); + assertEquals(message, value); } - @Test public void testEmptyLazyField() throws Exception { LazyFieldLite field = new LazyFieldLite(); - assertThat(field.getSerializedSize()).isEqualTo(0); - assertThat(field.toByteString()).isEqualTo(ByteString.EMPTY); + assertEquals(0, field.getSerializedSize()); + assertEquals(ByteString.EMPTY, field.toByteString()); } - @Test public void testInvalidProto() throws Exception { // Silently fails and uses the default instance. LazyFieldLite field = new LazyFieldLite(TestUtil.getExtensionRegistry(), ByteString.copyFromUtf8("invalid")); - assertThat( - field.getValue(TestAllTypes.getDefaultInstance())) - .isEqualTo(TestAllTypes.getDefaultInstance()); - assertThat(field.getSerializedSize()).isEqualTo(0); - assertThat(field.toByteString()).isEqualTo(ByteString.EMPTY); + assertEquals( + TestAllTypes.getDefaultInstance(), field.getValue(TestAllTypes.getDefaultInstance())); + assertEquals(0, field.getSerializedSize()); + assertEquals(ByteString.EMPTY, field.toByteString()); } - @Test public void testMergeBeforeParsing() throws Exception { TestAllTypes message1 = TestAllTypes.newBuilder().setOptionalInt32(1).build(); LazyFieldLite field1 = createLazyFieldLiteFromMessage(message1); @@ -137,10 +147,9 @@ public class LazyFieldLiteTest { field1.merge(field2); TestAllTypes expected = TestAllTypes.newBuilder().setOptionalInt32(1).setOptionalInt64(2).build(); - assertThat(field1.getValue(TestAllTypes.getDefaultInstance())).isEqualTo(expected); + assertEquals(expected, field1.getValue(TestAllTypes.getDefaultInstance())); } - @Test public void testMergeOneNotParsed() throws Exception { // Test a few different paths that involve one message that was not parsed. TestAllTypes message1 = TestAllTypes.newBuilder().setOptionalInt32(1).build(); @@ -152,17 +161,16 @@ public class LazyFieldLiteTest { field1.getValue(TestAllTypes.getDefaultInstance()); // Force parsing. LazyFieldLite field2 = createLazyFieldLiteFromMessage(message2); field1.merge(field2); - assertThat(field1.getValue(TestAllTypes.getDefaultInstance())).isEqualTo(expected); + assertEquals(expected, field1.getValue(TestAllTypes.getDefaultInstance())); // Now reverse which one is parsed first. field1 = LazyFieldLite.fromValue(message1); field2 = createLazyFieldLiteFromMessage(message2); field2.getValue(TestAllTypes.getDefaultInstance()); // Force parsing. field1.merge(field2); - assertThat(field1.getValue(TestAllTypes.getDefaultInstance())).isEqualTo(expected); + assertEquals(expected, field1.getValue(TestAllTypes.getDefaultInstance())); } - @Test public void testMergeInvalid() throws Exception { // Test a few different paths that involve one message that was not parsed. TestAllTypes message = TestAllTypes.newBuilder().setOptionalInt32(1).build(); @@ -172,10 +180,9 @@ public class LazyFieldLiteTest { invalid.merge(valid); // We swallow the exception and just use the set field. - assertThat(invalid.getValue(TestAllTypes.getDefaultInstance())).isEqualTo(message); + assertEquals(message, invalid.getValue(TestAllTypes.getDefaultInstance())); } - @Test public void testMergeKeepsExtensionsWhenPossible() throws Exception { // In this test we attempt to only use the empty registry, which will strip out all extensions // when serializing and then parsing. We verify that each code path will attempt to not @@ -183,38 +190,35 @@ public class LazyFieldLiteTest { // extensionRegistry. TestAllExtensions messageWithExtensions = TestAllExtensions.newBuilder().setExtension(optionalInt32Extension, 42).build(); - TestAllExtensions emptyMessage = TestAllExtensions.getDefaultInstance(); + TestAllExtensions emptyMessage = TestAllExtensions.newBuilder().build(); ExtensionRegistryLite emptyRegistry = ExtensionRegistryLite.getEmptyRegistry(); LazyFieldLite field = LazyFieldLite.fromValue(messageWithExtensions); field.merge(createLazyFieldLiteFromMessage(emptyRegistry, emptyMessage)); - assertThat(field.getValue(TestAllExtensions.getDefaultInstance())) - .isEqualTo(messageWithExtensions); + assertEquals(messageWithExtensions, field.getValue(TestAllExtensions.getDefaultInstance())); // Now reverse the order of the merging. field = createLazyFieldLiteFromMessage(emptyRegistry, emptyMessage); field.merge(LazyFieldLite.fromValue(messageWithExtensions)); - assertThat(field.getValue(TestAllExtensions.getDefaultInstance())) - .isEqualTo(messageWithExtensions); + assertEquals(messageWithExtensions, field.getValue(TestAllExtensions.getDefaultInstance())); // Now try parsing the empty field first. field = LazyFieldLite.fromValue(messageWithExtensions); LazyFieldLite other = createLazyFieldLiteFromMessage(emptyRegistry, emptyMessage); other.getValue(TestAllExtensions.getDefaultInstance()); // Force parsing. field.merge(other); - assertThat(field.getValue(TestAllExtensions.getDefaultInstance())) - .isEqualTo(messageWithExtensions); + assertEquals(messageWithExtensions, field.getValue(TestAllExtensions.getDefaultInstance())); // And again reverse. field = createLazyFieldLiteFromMessage(emptyRegistry, emptyMessage); field.getValue(TestAllExtensions.getDefaultInstance()); // Force parsing. other = LazyFieldLite.fromValue(messageWithExtensions); field.merge(other); - assertThat(field.getValue(TestAllExtensions.getDefaultInstance())) - .isEqualTo(messageWithExtensions); + assertEquals(messageWithExtensions, field.getValue(TestAllExtensions.getDefaultInstance())); } + // Help methods. private LazyFieldLite createLazyFieldLiteFromMessage(MessageLite message) { @@ -235,7 +239,7 @@ public class LazyFieldLiteTest { } private void assertNotEqual(Object unexpected, Object actual) { - assertThat(unexpected).isNotSameInstanceAs(actual); - assertThat((unexpected != null && unexpected.equals(actual))).isFalse(); + assertFalse(unexpected == actual || (unexpected != null && unexpected.equals(actual))); } + } diff --git a/java/core/src/test/java/com/google/protobuf/LazyFieldTest.java b/java/core/src/test/java/com/google/protobuf/LazyFieldTest.java index de2fc8a9e160d2bcf87605b340fe243b718047d4..a3901e91b9bdb275561428d233c1ec17cf7fcf49 100644 --- a/java/core/src/test/java/com/google/protobuf/LazyFieldTest.java +++ b/java/core/src/test/java/com/google/protobuf/LazyFieldTest.java @@ -1,85 +1,100 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import protobuf_unittest.UnittestProto.TestAllExtensions; import protobuf_unittest.UnittestProto.TestAllTypes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Unit test for {@link LazyField}. */ -@RunWith(JUnit4.class) -public class LazyFieldTest { +import junit.framework.TestCase; - @Test +/** + * Unit test for {@link LazyField}. + * + * @author xiangl@google.com (Xiang Li) + */ +public class LazyFieldTest extends TestCase { public void testHashCode() { MessageLite message = TestUtil.getAllSet(); LazyField lazyField = createLazyFieldFromMessage(message); - assertThat(message.hashCode()).isEqualTo(lazyField.hashCode()); + assertEquals(message.hashCode(), lazyField.hashCode()); lazyField.getValue(); - assertThat(message.hashCode()).isEqualTo(lazyField.hashCode()); + assertEquals(message.hashCode(), lazyField.hashCode()); changeValue(lazyField); // make sure two messages have different hash code assertNotEqual(message.hashCode(), lazyField.hashCode()); } - @Test public void testHashCodeEx() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyField lazyField = createLazyFieldFromMessage(message); - assertThat(message.hashCode()).isEqualTo(lazyField.hashCode()); + assertEquals(message.hashCode(), lazyField.hashCode()); lazyField.getValue(); - assertThat(message.hashCode()).isEqualTo(lazyField.hashCode()); + assertEquals(message.hashCode(), lazyField.hashCode()); changeValue(lazyField); // make sure two messages have different hash code assertNotEqual(message.hashCode(), lazyField.hashCode()); } - @Test public void testGetValue() { MessageLite message = TestUtil.getAllSet(); LazyField lazyField = createLazyFieldFromMessage(message); - assertThat(message).isEqualTo(lazyField.getValue()); + assertEquals(message, lazyField.getValue()); changeValue(lazyField); assertNotEqual(message, lazyField.getValue()); } - @Test public void testGetValueEx() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyField lazyField = createLazyFieldFromMessage(message); - assertThat(message).isEqualTo(lazyField.getValue()); + assertEquals(message, lazyField.getValue()); changeValue(lazyField); assertNotEqual(message, lazyField.getValue()); } - @Test public void testEqualsObject() { MessageLite message = TestUtil.getAllSet(); LazyField lazyField = createLazyFieldFromMessage(message); - assertThat(lazyField).isEqualTo(message); + assertTrue(lazyField.equals(message)); changeValue(lazyField); - assertThat(lazyField).isNotEqualTo(message); - assertThat(message).isNotEqualTo(lazyField.getValue()); + assertFalse(lazyField.equals(message)); + assertFalse(message.equals(lazyField.getValue())); } - @Test - @SuppressWarnings("TruthIncompatibleType") // LazyField.equals() is not symmetric + @SuppressWarnings("EqualsIncompatibleType") // LazyField.equals() is not symmetric public void testEqualsObjectEx() throws Exception { TestAllExtensions message = TestUtil.getAllExtensionsSet(); LazyField lazyField = createLazyFieldFromMessage(message); - assertThat(lazyField).isEqualTo(message); + assertTrue(lazyField.equals(message)); changeValue(lazyField); - assertThat(lazyField).isNotEqualTo(message); - assertThat(message).isNotEqualTo(lazyField.getValue()); + assertFalse(lazyField.equals(message)); + assertFalse(message.equals(lazyField.getValue())); } // Help methods. @@ -98,7 +113,6 @@ public class LazyFieldTest { } private void assertNotEqual(Object unexpected, Object actual) { - assertThat(unexpected).isNotSameInstanceAs(actual); - assertThat((unexpected != null && unexpected.equals(actual))).isFalse(); + assertFalse(unexpected == actual || (unexpected != null && unexpected.equals(actual))); } } diff --git a/java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java b/java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java index e29bb25129e0f2423688c96e1ec6c6efddf396aa..c5880d50657ad458c164b5483ebabda99f3adce0 100644 --- a/java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java +++ b/java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java @@ -1,29 +1,59 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import protobuf_unittest.LazyFieldsLite.LazyExtension; import protobuf_unittest.LazyFieldsLite.LazyInnerMessageLite; import protobuf_unittest.LazyFieldsLite.LazyMessageLite; import protobuf_unittest.LazyFieldsLite.LazyNestedInnerMessageLite; import java.util.ArrayList; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; + +/** + * Unit test for messages with lazy fields. + * + * @author niwasaki@google.com (Naoki Iwasaki) + */ +public class LazyMessageLiteTest extends TestCase { + + @Override + protected void setUp() throws Exception { + super.setUp(); + } -/** Unit test for messages with lazy fields. */ -@RunWith(JUnit4.class) -public class LazyMessageLiteTest { + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } - @Test public void testSetValues() { LazyNestedInnerMessageLite nested = LazyNestedInnerMessageLite.newBuilder().setNum(3).build(); LazyInnerMessageLite inner = @@ -36,28 +66,24 @@ public class LazyMessageLiteTest { .setOneofInner(inner) .build(); - assertThat(outer.getNum()).isEqualTo(1); - assertThat(outer.getNumWithDefault()).isEqualTo(421); - - assertThat(outer.getInner().getNum()).isEqualTo(2); - assertThat(outer.getInner().getNumWithDefault()).isEqualTo(42); + assertEquals(1, outer.getNum()); + assertEquals(421, outer.getNumWithDefault()); - assertThat(outer.getInner().getNum()).isEqualTo(2); - assertThat(outer.getInner().getNumWithDefault()).isEqualTo(42); + assertEquals(2, outer.getInner().getNum()); + assertEquals(42, outer.getInner().getNumWithDefault()); - assertThat(outer.getInner().getNested().getNum()).isEqualTo(3); - assertThat(outer.getInner().getNested().getNumWithDefault()).isEqualTo(4); + assertEquals(3, outer.getInner().getNested().getNum()); + assertEquals(4, outer.getInner().getNested().getNumWithDefault()); - assertThat(outer.hasOneofNum()).isFalse(); - assertThat(outer.hasOneofInner()).isTrue(); + assertFalse(outer.hasOneofNum()); + assertTrue(outer.hasOneofInner()); - assertThat(outer.getOneofInner().getNum()).isEqualTo(2); - assertThat(outer.getOneofInner().getNumWithDefault()).isEqualTo(42); - assertThat(outer.getOneofInner().getNested().getNum()).isEqualTo(3); - assertThat(outer.getOneofInner().getNested().getNumWithDefault()).isEqualTo(4); + assertEquals(2, outer.getOneofInner().getNum()); + assertEquals(42, outer.getOneofInner().getNumWithDefault()); + assertEquals(3, outer.getOneofInner().getNested().getNum()); + assertEquals(4, outer.getOneofInner().getNested().getNumWithDefault()); } - @Test public void testSetRepeatedValues() { LazyMessageLite outer = LazyMessageLite.newBuilder() @@ -66,13 +92,12 @@ public class LazyMessageLiteTest { .addRepeatedInner(LazyInnerMessageLite.newBuilder().setNum(122)) .build(); - assertThat(outer.getNum()).isEqualTo(1); - assertThat(outer.getRepeatedInnerCount()).isEqualTo(2); - assertThat(outer.getRepeatedInner(0).getNum()).isEqualTo(119); - assertThat(outer.getRepeatedInner(1).getNum()).isEqualTo(122); + assertEquals(1, outer.getNum()); + assertEquals(2, outer.getRepeatedInnerCount()); + assertEquals(119, outer.getRepeatedInner(0).getNum()); + assertEquals(122, outer.getRepeatedInner(1).getNum()); } - @Test public void testRepeatedMutability() throws Exception { LazyMessageLite outer = LazyMessageLite.newBuilder() @@ -80,17 +105,14 @@ public class LazyMessageLiteTest { .addRepeatedInner(LazyInnerMessageLite.newBuilder().setNum(122)) .build(); - outer = - LazyMessageLite.parseFrom(outer.toByteArray(), - ExtensionRegistryLite.getEmptyRegistry()); + outer = LazyMessageLite.parseFrom(outer.toByteArray()); try { outer.getRepeatedInnerList().set(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException expected) { } } - @Test public void testAddAll() { ArrayList inners = new ArrayList<>(); int count = 4; @@ -100,53 +122,51 @@ public class LazyMessageLiteTest { } LazyMessageLite outer = LazyMessageLite.newBuilder().addAllRepeatedInner(inners).build(); - assertThat(outer.getRepeatedInnerCount()).isEqualTo(count); + assertEquals(count, outer.getRepeatedInnerCount()); for (int i = 0; i < count; i++) { - assertThat(outer.getRepeatedInner(i).getNum()).isEqualTo(i); + assertEquals(i, outer.getRepeatedInner(i).getNum()); } } - @Test public void testGetDefaultValues() { LazyMessageLite outer = LazyMessageLite.getDefaultInstance(); - assertThat(outer.getNum()).isEqualTo(0); - assertThat(outer.getNumWithDefault()).isEqualTo(421); + assertEquals(0, outer.getNum()); + assertEquals(421, outer.getNumWithDefault()); - assertThat(outer.getInner().getNum()).isEqualTo(0); - assertThat(outer.getInner().getNumWithDefault()).isEqualTo(42); + assertEquals(0, outer.getInner().getNum()); + assertEquals(42, outer.getInner().getNumWithDefault()); - assertThat(outer.getInner().getNested().getNum()).isEqualTo(0); - assertThat(outer.getInner().getNested().getNumWithDefault()).isEqualTo(4); + assertEquals(0, outer.getInner().getNested().getNum()); + assertEquals(4, outer.getInner().getNested().getNumWithDefault()); - assertThat(outer.getOneofNum()).isEqualTo(0); + assertEquals(0, outer.getOneofNum()); - assertThat(outer.getOneofInner().getNum()).isEqualTo(0); - assertThat(outer.getOneofInner().getNumWithDefault()).isEqualTo(42); - assertThat(outer.getOneofInner().getNested().getNum()).isEqualTo(0); - assertThat(outer.getOneofInner().getNested().getNumWithDefault()).isEqualTo(4); + assertEquals(0, outer.getOneofInner().getNum()); + assertEquals(42, outer.getOneofInner().getNumWithDefault()); + assertEquals(0, outer.getOneofInner().getNested().getNum()); + assertEquals(4, outer.getOneofInner().getNested().getNumWithDefault()); } - @Test public void testClearValues() { LazyInnerMessageLite inner = LazyInnerMessageLite.newBuilder().setNum(115).build(); LazyMessageLite.Builder outerBuilder = LazyMessageLite.newBuilder(); - assertThat(outerBuilder.build().getNum()).isEqualTo(0); + assertEquals(0, outerBuilder.build().getNum()); // Set/Clear num outerBuilder.setNum(100); - assertThat(outerBuilder.build().getNum()).isEqualTo(100); - assertThat(outerBuilder.build().getNumWithDefault()).isEqualTo(421); - assertThat(outerBuilder.build().hasInner()).isFalse(); + assertEquals(100, outerBuilder.build().getNum()); + assertEquals(421, outerBuilder.build().getNumWithDefault()); + assertFalse(outerBuilder.build().hasInner()); outerBuilder.clearNum(); - assertThat(outerBuilder.build().getNum()).isEqualTo(0); - assertThat(outerBuilder.build().getNumWithDefault()).isEqualTo(421); - assertThat(outerBuilder.build().hasInner()).isFalse(); + assertEquals(0, outerBuilder.build().getNum()); + assertEquals(421, outerBuilder.build().getNumWithDefault()); + assertFalse(outerBuilder.build().hasInner()); // Set/Clear all outerBuilder @@ -157,29 +177,28 @@ public class LazyMessageLiteTest { .setOneofInner(LazyInnerMessageLite.newBuilder().setNum(123)); LazyMessageLite outer = outerBuilder.build(); - assertThat(outer.getNum()).isEqualTo(100); - assertThat(outer.getNumWithDefault()).isEqualTo(421); - assertThat(outer.hasInner()).isTrue(); - assertThat(outer.getInner().getNum()).isEqualTo(115); - assertThat(outer.getRepeatedInnerCount()).isEqualTo(2); - assertThat(outer.getRepeatedInner(0).getNum()).isEqualTo(119); - assertThat(outer.getRepeatedInner(1).getNum()).isEqualTo(122); - assertThat(outer.hasOneofInner()).isTrue(); - assertThat(outer.getOneofInner().getNum()).isEqualTo(123); + assertEquals(100, outer.getNum()); + assertEquals(421, outer.getNumWithDefault()); + assertTrue(outer.hasInner()); + assertEquals(115, outer.getInner().getNum()); + assertEquals(2, outer.getRepeatedInnerCount()); + assertEquals(119, outer.getRepeatedInner(0).getNum()); + assertEquals(122, outer.getRepeatedInner(1).getNum()); + assertTrue(outer.hasOneofInner()); + assertEquals(123, outer.getOneofInner().getNum()); outerBuilder.clear(); outer = outerBuilder.build(); - assertThat(outer.getNum()).isEqualTo(0); - assertThat(outer.getNumWithDefault()).isEqualTo(421); - assertThat(outer.hasInner()).isFalse(); - assertThat(outer.getRepeatedInnerCount()).isEqualTo(0); - assertThat(outer.hasOneofInner()).isFalse(); - assertThat(outer.getOneofInner().getNum()).isEqualTo(0); + assertEquals(0, outer.getNum()); + assertEquals(421, outer.getNumWithDefault()); + assertFalse(outer.hasInner()); + assertEquals(0, outer.getRepeatedInnerCount()); + assertFalse(outer.hasOneofInner()); + assertEquals(0, outer.getOneofInner().getNum()); } - @Test public void testMergeValues() { LazyMessageLite outerBase = LazyMessageLite.newBuilder().setNumWithDefault(122).build(); @@ -192,15 +211,14 @@ public class LazyMessageLiteTest { .build(); LazyMessageLite merged = LazyMessageLite.newBuilder(outerBase).mergeFrom(outerMerging).build(); - assertThat(merged.getNum()).isEqualTo(119); - assertThat(merged.getNumWithDefault()).isEqualTo(122); - assertThat(merged.getInner().getNum()).isEqualTo(115); - assertThat(merged.getInner().getNumWithDefault()).isEqualTo(42); - assertThat(merged.getOneofInner().getNum()).isEqualTo(115); - assertThat(merged.getOneofInner().getNumWithDefault()).isEqualTo(42); + assertEquals(119, merged.getNum()); + assertEquals(122, merged.getNumWithDefault()); + assertEquals(115, merged.getInner().getNum()); + assertEquals(42, merged.getInner().getNumWithDefault()); + assertEquals(115, merged.getOneofInner().getNum()); + assertEquals(42, merged.getOneofInner().getNumWithDefault()); } - @Test public void testMergeDefaultValues() { LazyInnerMessageLite innerBase = LazyInnerMessageLite.newBuilder().setNum(115).build(); LazyMessageLite outerBase = @@ -215,33 +233,31 @@ public class LazyMessageLiteTest { LazyMessageLite merged = LazyMessageLite.newBuilder(outerBase).mergeFrom(outerMerging).build(); // Merging default-instance shouldn't overwrite values in the base message. - assertThat(merged.getNum()).isEqualTo(119); - assertThat(merged.getNumWithDefault()).isEqualTo(122); - assertThat(merged.getInner().getNum()).isEqualTo(115); - assertThat(merged.getInner().getNumWithDefault()).isEqualTo(42); - assertThat(merged.getOneofInner().getNum()).isEqualTo(115); - assertThat(merged.getOneofInner().getNumWithDefault()).isEqualTo(42); + assertEquals(119, merged.getNum()); + assertEquals(122, merged.getNumWithDefault()); + assertEquals(115, merged.getInner().getNum()); + assertEquals(42, merged.getInner().getNumWithDefault()); + assertEquals(115, merged.getOneofInner().getNum()); + assertEquals(42, merged.getOneofInner().getNumWithDefault()); } // Regression test for b/28198805. - @Test public void testMergeOneofMessages() throws Exception { LazyInnerMessageLite inner = LazyInnerMessageLite.getDefaultInstance(); LazyMessageLite outer = LazyMessageLite.newBuilder().setOneofInner(inner).build(); ByteString data1 = outer.toByteString(); // The following should not alter the content of the 'outer' message. - LazyMessageLite.Builder merged = outer.toBuilder(); + LazyMessageLite.Builder merged = LazyMessageLite.newBuilder().mergeFrom(outer); LazyInnerMessageLite anotherInner = LazyInnerMessageLite.newBuilder().setNum(12345).build(); merged.setOneofInner(anotherInner); // Check that the 'outer' stays the same. ByteString data2 = outer.toByteString(); - assertThat(data1).isEqualTo(data2); - assertThat(outer.getOneofInner().getNum()).isEqualTo(0); + assertEquals(data1, data2); + assertEquals(0, outer.getOneofInner().getNum()); } - @Test public void testSerialize() throws InvalidProtocolBufferException { LazyNestedInnerMessageLite nested = LazyNestedInnerMessageLite.newBuilder().setNum(3).build(); LazyInnerMessageLite inner = @@ -250,42 +266,40 @@ public class LazyMessageLiteTest { LazyMessageLite.newBuilder().setNum(1).setInner(inner).setOneofInner(inner).build(); ByteString bytes = outer.toByteString(); - assertThat(bytes.size()).isEqualTo(outer.getSerializedSize()); + assertEquals(bytes.size(), outer.getSerializedSize()); - LazyMessageLite deserialized = - LazyMessageLite.parseFrom(bytes, ExtensionRegistryLite.getEmptyRegistry()); + LazyMessageLite deserialized = LazyMessageLite.parseFrom(bytes); - assertThat(deserialized.getNum()).isEqualTo(1); - assertThat(deserialized.getNumWithDefault()).isEqualTo(421); + assertEquals(1, deserialized.getNum()); + assertEquals(421, deserialized.getNumWithDefault()); - assertThat(deserialized.getInner().getNum()).isEqualTo(2); - assertThat(deserialized.getInner().getNumWithDefault()).isEqualTo(42); + assertEquals(2, deserialized.getInner().getNum()); + assertEquals(42, deserialized.getInner().getNumWithDefault()); - assertThat(deserialized.getInner().getNested().getNum()).isEqualTo(3); - assertThat(deserialized.getInner().getNested().getNumWithDefault()).isEqualTo(4); + assertEquals(3, deserialized.getInner().getNested().getNum()); + assertEquals(4, deserialized.getInner().getNested().getNumWithDefault()); - assertThat(deserialized.getOneofInner().getNum()).isEqualTo(2); - assertThat(deserialized.getOneofInner().getNumWithDefault()).isEqualTo(42); - assertThat(deserialized.getOneofInner().getNested().getNum()).isEqualTo(3); - assertThat(deserialized.getOneofInner().getNested().getNumWithDefault()).isEqualTo(4); + assertEquals(2, deserialized.getOneofInner().getNum()); + assertEquals(42, deserialized.getOneofInner().getNumWithDefault()); + assertEquals(3, deserialized.getOneofInner().getNested().getNum()); + assertEquals(4, deserialized.getOneofInner().getNested().getNumWithDefault()); - assertThat(deserialized.toByteString()).isEqualTo(bytes); + assertEquals(bytes, deserialized.toByteString()); } - @Test public void testExtensions() throws Exception { LazyInnerMessageLite.Builder innerBuilder = LazyInnerMessageLite.newBuilder(); innerBuilder.setExtension( LazyExtension.extension, LazyExtension.newBuilder().setName("name").build()); - assertThat(innerBuilder.hasExtension(LazyExtension.extension)).isTrue(); - assertThat(innerBuilder.getExtension(LazyExtension.extension).getName()).isEqualTo("name"); + assertTrue(innerBuilder.hasExtension(LazyExtension.extension)); + assertEquals("name", innerBuilder.getExtension(LazyExtension.extension).getName()); LazyInnerMessageLite innerMessage = innerBuilder.build(); - assertThat(innerMessage.hasExtension(LazyExtension.extension)).isTrue(); - assertThat(innerMessage.getExtension(LazyExtension.extension).getName()).isEqualTo("name"); + assertTrue(innerMessage.hasExtension(LazyExtension.extension)); + assertEquals("name", innerMessage.getExtension(LazyExtension.extension).getName()); LazyMessageLite lite = LazyMessageLite.newBuilder().setInner(innerMessage).build(); - assertThat(lite.getInner().hasExtension(LazyExtension.extension)).isTrue(); - assertThat(lite.getInner().getExtension(LazyExtension.extension).getName()).isEqualTo("name"); + assertTrue(lite.getInner().hasExtension(LazyExtension.extension)); + assertEquals("name", lite.getInner().getExtension(LazyExtension.extension).getName()); } } diff --git a/java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java b/java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java index 9b9d710cf8d789df52df674ab9857d1d1a7f2aec..24d0038b3d4f20511448d713eddc34157ede3e7f 100644 --- a/java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java +++ b/java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static java.util.Arrays.asList; import java.util.ArrayList; @@ -16,13 +37,14 @@ import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Iterator; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests for {@link LazyStringArrayList}. */ -@RunWith(JUnit4.class) -public class LazyStringArrayListTest { +/** + * Tests for {@link LazyStringArrayList}. + * + * @author jonp@google.com (Jon Perlow) + */ +public class LazyStringArrayListTest extends TestCase { private static final String STRING_A = "A"; private static final String STRING_B = "B"; @@ -32,56 +54,53 @@ public class LazyStringArrayListTest { private static final ByteString BYTE_STRING_B = ByteString.copyFromUtf8("B"); private static final ByteString BYTE_STRING_C = ByteString.copyFromUtf8("C"); - @Test public void testJustStrings() { LazyStringArrayList list = new LazyStringArrayList(); list.add(STRING_A); list.add(STRING_B); list.add(STRING_C); - assertThat(list).hasSize(3); - assertThat(list.get(0)).isSameInstanceAs(STRING_A); - assertThat(list.get(1)).isSameInstanceAs(STRING_B); - assertThat(list.get(2)).isSameInstanceAs(STRING_C); + assertEquals(3, list.size()); + assertSame(STRING_A, list.get(0)); + assertSame(STRING_B, list.get(1)); + assertSame(STRING_C, list.get(2)); list.set(1, STRING_C); - assertThat(list.get(1)).isSameInstanceAs(STRING_C); + assertSame(STRING_C, list.get(1)); list.remove(1); - assertThat(list.get(0)).isSameInstanceAs(STRING_A); - assertThat(list.get(1)).isSameInstanceAs(STRING_C); + assertSame(STRING_A, list.get(0)); + assertSame(STRING_C, list.get(1)); List byteStringList = list.asByteStringList(); - assertThat(byteStringList.get(0)).isEqualTo(BYTE_STRING_A); - assertThat(byteStringList.get(1)).isEqualTo(BYTE_STRING_C); + assertEquals(BYTE_STRING_A, byteStringList.get(0)); + assertEquals(BYTE_STRING_C, byteStringList.get(1)); // Underlying list should be transformed. - assertThat(byteStringList.get(0)).isSameInstanceAs(list.getByteString(0)); - assertThat(byteStringList.get(1)).isSameInstanceAs(list.getByteString(1)); + assertSame(byteStringList.get(0), list.getByteString(0)); + assertSame(byteStringList.get(1), list.getByteString(1)); } - @Test public void testJustByteString() { LazyStringArrayList list = new LazyStringArrayList(); list.add(BYTE_STRING_A); list.add(BYTE_STRING_B); list.add(BYTE_STRING_C); - assertThat(list).hasSize(3); - assertThat(list.getByteString(0)).isSameInstanceAs(BYTE_STRING_A); - assertThat(list.getByteString(1)).isSameInstanceAs(BYTE_STRING_B); - assertThat(list.getByteString(2)).isSameInstanceAs(BYTE_STRING_C); + assertEquals(3, list.size()); + assertSame(BYTE_STRING_A, list.getByteString(0)); + assertSame(BYTE_STRING_B, list.getByteString(1)); + assertSame(BYTE_STRING_C, list.getByteString(2)); list.remove(1); - assertThat(list.getByteString(0)).isSameInstanceAs(BYTE_STRING_A); - assertThat(list.getByteString(1)).isSameInstanceAs(BYTE_STRING_C); + assertSame(BYTE_STRING_A, list.getByteString(0)); + assertSame(BYTE_STRING_C, list.getByteString(1)); List byteStringList = list.asByteStringList(); - assertThat(byteStringList.get(0)).isSameInstanceAs(BYTE_STRING_A); - assertThat(byteStringList.get(1)).isSameInstanceAs(BYTE_STRING_C); + assertSame(BYTE_STRING_A, byteStringList.get(0)); + assertSame(BYTE_STRING_C, byteStringList.get(1)); } - @Test public void testConversionBackAndForth() { LazyStringArrayList list = new LazyStringArrayList(); list.add(STRING_A); @@ -89,34 +108,33 @@ public class LazyStringArrayListTest { list.add(BYTE_STRING_C); // String a should be the same because it was originally a string - assertThat(list.get(0)).isSameInstanceAs(STRING_A); + assertSame(STRING_A, list.get(0)); // String b and c should be different because the string has to be computed // from the ByteString String bPrime = list.get(1); - assertThat(bPrime).isNotSameInstanceAs(STRING_B); - assertThat(bPrime).isEqualTo(STRING_B); + assertNotSame(STRING_B, bPrime); + assertEquals(STRING_B, bPrime); String cPrime = list.get(2); - assertThat(cPrime).isNotSameInstanceAs(STRING_C); - assertThat(cPrime).isEqualTo(STRING_C); + assertNotSame(STRING_C, cPrime); + assertEquals(STRING_C, cPrime); // String c and c should stay the same once cached. - assertThat(list.get(1)).isSameInstanceAs(bPrime); - assertThat(list.get(2)).isSameInstanceAs(cPrime); + assertSame(bPrime, list.get(1)); + assertSame(cPrime, list.get(2)); // ByteString needs to be computed from string for both a and b ByteString aPrimeByteString = list.getByteString(0); - assertThat(aPrimeByteString).isEqualTo(BYTE_STRING_A); + assertEquals(BYTE_STRING_A, aPrimeByteString); ByteString bPrimeByteString = list.getByteString(1); - assertThat(bPrimeByteString).isNotSameInstanceAs(BYTE_STRING_B); - assertThat(list.getByteString(1)).isEqualTo(BYTE_STRING_B); + assertNotSame(BYTE_STRING_B, bPrimeByteString); + assertEquals(BYTE_STRING_B, list.getByteString(1)); // Once cached, ByteString should stay cached. - assertThat(list.getByteString(0)).isSameInstanceAs(aPrimeByteString); - assertThat(list.getByteString(1)).isSameInstanceAs(bPrimeByteString); + assertSame(aPrimeByteString, list.getByteString(0)); + assertSame(bPrimeByteString, list.getByteString(1)); } - @Test public void testCopyConstructorCopiesByReference() { LazyStringArrayList list1 = new LazyStringArrayList(); list1.add(STRING_A); @@ -124,27 +142,25 @@ public class LazyStringArrayListTest { list1.add(BYTE_STRING_C); LazyStringArrayList list2 = new LazyStringArrayList(list1); - assertThat(list2).hasSize(3); - assertThat(list2.get(0)).isSameInstanceAs(STRING_A); - assertThat(list2.getByteString(1)).isSameInstanceAs(BYTE_STRING_B); - assertThat(list2.getByteString(2)).isSameInstanceAs(BYTE_STRING_C); + assertEquals(3, list2.size()); + assertSame(STRING_A, list2.get(0)); + assertSame(BYTE_STRING_B, list2.getByteString(1)); + assertSame(BYTE_STRING_C, list2.getByteString(2)); } - @Test public void testListCopyConstructor() { - List list1 = new ArrayList<>(); + List list1 = new ArrayList(); list1.add(STRING_A); list1.add(STRING_B); list1.add(STRING_C); LazyStringArrayList list2 = new LazyStringArrayList(list1); - assertThat(list2).hasSize(3); - assertThat(list2.get(0)).isSameInstanceAs(STRING_A); - assertThat(list2.get(1)).isSameInstanceAs(STRING_B); - assertThat(list2.get(2)).isSameInstanceAs(STRING_C); + assertEquals(3, list2.size()); + assertSame(STRING_A, list2.get(0)); + assertSame(STRING_B, list2.get(1)); + assertSame(STRING_C, list2.get(2)); } - @Test public void testAddAllCopiesByReferenceIfPossible() { LazyStringArrayList list1 = new LazyStringArrayList(); list1.add(STRING_A); @@ -154,20 +170,19 @@ public class LazyStringArrayListTest { LazyStringArrayList list2 = new LazyStringArrayList(); list2.addAll(list1); - assertThat(list2).hasSize(3); - assertThat(list2.get(0)).isSameInstanceAs(STRING_A); - assertThat(list2.getByteString(1)).isSameInstanceAs(BYTE_STRING_B); - assertThat(list2.getByteString(2)).isSameInstanceAs(BYTE_STRING_C); + assertEquals(3, list2.size()); + assertSame(STRING_A, list2.get(0)); + assertSame(BYTE_STRING_B, list2.getByteString(1)); + assertSame(BYTE_STRING_C, list2.getByteString(2)); } - @Test public void testModificationWithIteration() { LazyStringArrayList list = new LazyStringArrayList(); list.addAll(asList(STRING_A, STRING_B, STRING_C)); Iterator iterator = list.iterator(); - assertThat(list).hasSize(3); - assertThat(list.get(0)).isEqualTo(STRING_A); - assertThat(iterator.next()).isSameInstanceAs(STRING_A); + assertEquals(3, list.size()); + assertEquals(STRING_A, list.get(0)); + assertEquals(STRING_A, iterator.next()); // Does not structurally modify. iterator = list.iterator(); @@ -177,7 +192,7 @@ public class LazyStringArrayListTest { list.remove(0); try { iterator.next(); - assertWithMessage("expected exception").fail();; + fail(); } catch (ConcurrentModificationException e) { // expected } @@ -186,13 +201,12 @@ public class LazyStringArrayListTest { list.add(0, STRING_C); try { iterator.next(); - assertWithMessage("expected exception").fail();; + fail(); } catch (ConcurrentModificationException e) { // expected } } - @Test public void testMakeImmutable() { LazyStringArrayList list = new LazyStringArrayList(); list.add(STRING_A); @@ -206,55 +220,54 @@ public class LazyStringArrayListTest { try { list.add(BYTE_STRING_A.toByteArray()); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.add(BYTE_STRING_A); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAllByteArray(Collections.singletonList(BYTE_STRING_A.toByteArray())); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAllByteString(asList(BYTE_STRING_A)); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.mergeFrom(new LazyStringArrayList()); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, BYTE_STRING_A.toByteArray()); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, BYTE_STRING_A); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } } - @Test public void testImmutabilityPropagation() { LazyStringArrayList list = new LazyStringArrayList(); list.add(STRING_A); @@ -268,80 +281,81 @@ public class LazyStringArrayListTest { assertGenericListImmutable(byteArrayList, byteArrayList.get(0)); } + @SuppressWarnings("unchecked") private static void assertGenericListImmutable(List list, T value) { try { list.add(value); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.add(0, value); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(asList(value)); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, asList(value)); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.clear(); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(0); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(value); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(asList(value)); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(asList()); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(asList()); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, value); - assertWithMessage("expected exception").fail();; + fail(); } catch (UnsupportedOperationException e) { // expected } diff --git a/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java b/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java index 966e6eefb779c7afe41187a2e9ea6e3c59c212fb..18c9c74ec327ec204b22182cde5985966f8449ed 100644 --- a/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java +++ b/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java @@ -1,27 +1,45 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import protobuf_unittest.UnittestProto; import java.io.IOException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** - * Tests to make sure the lazy conversion of UTF8-encoded byte arrays to strings works - * correctly. + * Tests to make sure the lazy conversion of UTF8-encoded byte arrays to strings works correctly. + * + * @author jonp@google.com (Jon Perlow) */ -@RunWith(JUnit4.class) -public class LazyStringEndToEndTest { +public class LazyStringEndToEndTest extends TestCase { private static final ByteString TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8 = ByteString.copyFrom( @@ -32,8 +50,9 @@ public class LazyStringEndToEndTest { private ByteString encodedTestAllTypes; - @Before - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { + super.setUp(); this.encodedTestAllTypes = UnittestProto.TestAllTypes.newBuilder() .setOptionalString("foo") @@ -44,34 +63,27 @@ public class LazyStringEndToEndTest { } /** Tests that an invalid UTF8 string will roundtrip through a parse and serialization. */ - @Test public void testParseAndSerialize() throws InvalidProtocolBufferException { UnittestProto.TestAllTypes tV2 = - UnittestProto.TestAllTypes.parseFrom( - TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, - ExtensionRegistryLite.getEmptyRegistry()); + UnittestProto.TestAllTypes.parseFrom(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8); ByteString bytes = tV2.toByteString(); - assertThat(bytes).isEqualTo(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8); + assertEquals(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, bytes); - String unused = tV2.getOptionalString(); + tV2.getOptionalString(); bytes = tV2.toByteString(); - assertThat(bytes).isEqualTo(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8); + assertEquals(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, bytes); } - @Test public void testParseAndWrite() throws IOException { UnittestProto.TestAllTypes tV2 = - UnittestProto.TestAllTypes.parseFrom( - TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, - ExtensionRegistryLite.getEmptyRegistry()); + UnittestProto.TestAllTypes.parseFrom(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8); byte[] sink = new byte[TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8.size()]; CodedOutputStream outputStream = CodedOutputStream.newInstance(sink); tV2.writeTo(outputStream); outputStream.flush(); - assertThat(ByteString.copyFrom(sink)).isEqualTo(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8); + assertEquals(TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, ByteString.copyFrom(sink)); } - @Test public void testCaching() { String a = "a"; String b = "b"; @@ -84,33 +96,30 @@ public class LazyStringEndToEndTest { .build(); // String should be the one we passed it. - assertThat(proto.getOptionalString()).isSameInstanceAs(a); - assertThat(proto.getRepeatedString(0)).isSameInstanceAs(b); - assertThat(proto.getRepeatedString(1)).isSameInstanceAs(c); + assertSame(a, proto.getOptionalString()); + assertSame(b, proto.getRepeatedString(0)); + assertSame(c, proto.getRepeatedString(1)); // Ensure serialization keeps strings cached. - ByteString unused = proto.toByteString(); + proto.toByteString(); // And now the string should stay cached. - assertThat(proto.getOptionalString()).isSameInstanceAs(a); - assertThat(proto.getRepeatedString(0)).isSameInstanceAs(b); - assertThat(proto.getRepeatedString(1)).isSameInstanceAs(c); + assertSame(a, proto.getOptionalString()); + assertSame(b, proto.getRepeatedString(0)); + assertSame(c, proto.getRepeatedString(1)); } - @Test public void testNoStringCachingIfOnlyBytesAccessed() throws Exception { - UnittestProto.TestAllTypes proto = - UnittestProto.TestAllTypes.parseFrom( - encodedTestAllTypes, ExtensionRegistryLite.getEmptyRegistry()); + UnittestProto.TestAllTypes proto = UnittestProto.TestAllTypes.parseFrom(encodedTestAllTypes); ByteString optional = proto.getOptionalStringBytes(); - assertThat(proto.getOptionalStringBytes()).isSameInstanceAs(optional); - assertThat(proto.toBuilder().getOptionalStringBytes()).isSameInstanceAs(optional); + assertSame(optional, proto.getOptionalStringBytes()); + assertSame(optional, proto.toBuilder().getOptionalStringBytes()); ByteString repeated0 = proto.getRepeatedStringBytes(0); ByteString repeated1 = proto.getRepeatedStringBytes(1); - assertThat(proto.getRepeatedStringBytes(0)).isSameInstanceAs(repeated0); - assertThat(proto.getRepeatedStringBytes(1)).isSameInstanceAs(repeated1); - assertThat(proto.toBuilder().getRepeatedStringBytes(0)).isSameInstanceAs(repeated0); - assertThat(proto.toBuilder().getRepeatedStringBytes(1)).isSameInstanceAs(repeated1); + assertSame(repeated0, proto.getRepeatedStringBytes(0)); + assertSame(repeated1, proto.getRepeatedStringBytes(1)); + assertSame(repeated0, proto.toBuilder().getRepeatedStringBytes(0)); + assertSame(repeated1, proto.toBuilder().getRepeatedStringBytes(1)); } } diff --git a/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java b/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java index 3e3126aa2541c5be3f4d68823b0610dd69dd53e8..1270ef06ee4daea40af7230b1fcaca8d1fab8263 100644 --- a/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java +++ b/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java @@ -1,19 +1,43 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import junit.framework.TestCase; import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Bar; import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.BarPrime; import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Foo; import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.TestOneofEquals; import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.TestRecursiveOneof; +import junit.framework.TestCase; + /** * Test generate equal and hash methods for the lite runtime. * @@ -96,6 +120,6 @@ public class LiteEqualsAndHashTest extends TestCase { public void testRecursiveHashcode() { // This tests that we don't infinite loop. - int unused = TestRecursiveOneof.getDefaultInstance().hashCode(); + TestRecursiveOneof.getDefaultInstance().hashCode(); } } diff --git a/java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java b/java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java index eef5d668f24787beaeeb37157309ac89951fc368..4177a47e67f288ecd66e0073799111c1a2167b19 100644 --- a/java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java +++ b/java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java @@ -1,14 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -23,18 +45,16 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.List; import java.util.NoSuchElementException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Test {@code LiteralByteString} by setting up a reference string in {@link #setUp()}. This class * is designed to be extended for testing extensions of {@code LiteralByteString} such as {@code * BoundedByteString}, see {@link BoundedByteStringTest}. + * + * @author carlanton@google.com (Carl Haverl) */ -@RunWith(JUnit4.class) -public class LiteralByteStringTest { +public class LiteralByteStringTest extends TestCase { protected static final String UTF_8 = "UTF-8"; protected String classUnderTest; @@ -42,56 +62,48 @@ public class LiteralByteStringTest { protected ByteString stringUnderTest; protected int expectedHashCode; - @Before - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { classUnderTest = "LiteralByteString"; referenceBytes = ByteStringTest.getTestBytes(1234, 11337766L); stringUnderTest = ByteString.copyFrom(referenceBytes); expectedHashCode = 331161852; } - @Test public void testExpectedType() { String actualClassName = getActualClassName(stringUnderTest); - assertWithMessage("%s should match type exactly", classUnderTest) - .that(classUnderTest) - .isEqualTo(actualClassName); + assertEquals(classUnderTest + " should match type exactly", classUnderTest, actualClassName); } protected String getActualClassName(Object object) { return object.getClass().getSimpleName(); } - @Test public void testByteAt() { boolean stillEqual = true; for (int i = 0; stillEqual && i < referenceBytes.length; ++i) { stillEqual = (referenceBytes[i] == stringUnderTest.byteAt(i)); } - assertWithMessage("%s must capture the right bytes", classUnderTest).that(stillEqual).isTrue(); + assertTrue(classUnderTest + " must capture the right bytes", stillEqual); } - @Test public void testByteIterator() { boolean stillEqual = true; ByteString.ByteIterator iter = stringUnderTest.iterator(); for (int i = 0; stillEqual && i < referenceBytes.length; ++i) { stillEqual = (iter.hasNext() && referenceBytes[i] == iter.nextByte()); } - assertWithMessage("%s must capture the right bytes", classUnderTest).that(stillEqual).isTrue(); - assertWithMessage("%s must have exhausted the iterator", classUnderTest) - .that(iter.hasNext()) - .isFalse(); + assertTrue(classUnderTest + " must capture the right bytes", stillEqual); + assertFalse(classUnderTest + " must have exhausted the iterator", iter.hasNext()); try { iter.nextByte(); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NoSuchElementException e) { // This is success } } - @Test public void testByteIterable() { boolean stillEqual = true; int j = 0; @@ -99,36 +111,25 @@ public class LiteralByteStringTest { stillEqual = (referenceBytes[j] == quantum); ++j; } - assertWithMessage("%s must capture the right bytes as Bytes", classUnderTest) - .that(stillEqual) - .isTrue(); - assertWithMessage("%s iterable character count", classUnderTest) - .that(referenceBytes) - .hasLength(j); + assertTrue(classUnderTest + " must capture the right bytes as Bytes", stillEqual); + assertEquals(classUnderTest + " iterable character count", referenceBytes.length, j); } - @Test public void testSize() { - assertWithMessage("%s must have the expected size", classUnderTest) - .that(referenceBytes.length) - .isEqualTo(stringUnderTest.size()); + assertEquals( + classUnderTest + " must have the expected size", + referenceBytes.length, + stringUnderTest.size()); } - @Test public void testGetTreeDepth() { - assertWithMessage("%s must have depth 0", classUnderTest) - .that(stringUnderTest.getTreeDepth()) - .isEqualTo(0); + assertEquals(classUnderTest + " must have depth 0", 0, stringUnderTest.getTreeDepth()); } - @Test public void testIsBalanced() { - assertWithMessage("%s is technically balanced", classUnderTest) - .that(stringUnderTest.isBalanced()) - .isTrue(); + assertTrue(classUnderTest + " is technically balanced", stringUnderTest.isBalanced()); } - @Test public void testCopyTo_ByteArrayOffsetLength() { int destinationOffset = 50; int length = 100; @@ -139,12 +140,9 @@ public class LiteralByteStringTest { for (int i = 0; stillEqual && i < length; ++i) { stillEqual = referenceBytes[i + sourceOffset] == destination[i + destinationOffset]; } - assertWithMessage("%s.copyTo(4 arg) must give the expected bytes", classUnderTest) - .that(stillEqual) - .isTrue(); + assertTrue(classUnderTest + ".copyTo(4 arg) must give the expected bytes", stillEqual); } - @Test public void testCopyTo_ByteArrayOffsetLengthErrors() { int destinationOffset = 50; int length = 100; @@ -154,9 +152,7 @@ public class LiteralByteStringTest { // Copy one too many bytes stringUnderTest.copyTo( destination, stringUnderTest.size() + 1 - length, destinationOffset, length); - assertWithMessage( - "Should have thrown an exception when copying too many bytes of a %s", classUnderTest) - .fail(); + fail("Should have thrown an exception when copying too many bytes of a " + classUnderTest); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -164,10 +160,9 @@ public class LiteralByteStringTest { try { // Copy with illegal negative sourceOffset stringUnderTest.copyTo(destination, -1, destinationOffset, length); - assertWithMessage( - "Should have thrown an exception when given a negative sourceOffset in %s", - classUnderTest) - .fail(); + fail( + "Should have thrown an exception when given a negative sourceOffset in " + + classUnderTest); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -175,10 +170,9 @@ public class LiteralByteStringTest { try { // Copy with illegal negative destinationOffset stringUnderTest.copyTo(destination, 0, -1, length); - assertWithMessage( - "Should have thrown an exception when given a negative destinationOffset in %s", - classUnderTest) - .fail(); + fail( + "Should have thrown an exception when given a negative destinationOffset in " + + classUnderTest); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -186,9 +180,7 @@ public class LiteralByteStringTest { try { // Copy with illegal negative size stringUnderTest.copyTo(destination, 0, 0, -1); - assertWithMessage( - "Should have thrown an exception when given a negative size in %s", classUnderTest) - .fail(); + fail("Should have thrown an exception when given a negative size in " + classUnderTest); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -196,10 +188,9 @@ public class LiteralByteStringTest { try { // Copy with illegal too-large sourceOffset stringUnderTest.copyTo(destination, 2 * stringUnderTest.size(), 0, length); - assertWithMessage( - "Should have thrown an exception when the destinationOffset is too large in %s", - classUnderTest) - .fail(); + fail( + "Should have thrown an exception when the destinationOffset is too large in " + + classUnderTest); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -207,33 +198,27 @@ public class LiteralByteStringTest { try { // Copy with illegal too-large destinationOffset stringUnderTest.copyTo(destination, 0, 2 * destination.length, length); - assertWithMessage( - "Should have thrown an exception when the destinationOffset is too large in %s", - classUnderTest) - .fail(); + fail( + "Should have thrown an exception when the destinationOffset is too large in " + + classUnderTest); } catch (IndexOutOfBoundsException expected) { // This is success } } - @Test public void testCopyTo_ByteBuffer() { ByteBuffer myBuffer = ByteBuffer.allocate(referenceBytes.length); stringUnderTest.copyTo(myBuffer); - assertWithMessage("%s.copyTo(ByteBuffer) must give back the same bytes", classUnderTest) - .that(Arrays.equals(referenceBytes, myBuffer.array())) - .isTrue(); + assertTrue( + classUnderTest + ".copyTo(ByteBuffer) must give back the same bytes", + Arrays.equals(referenceBytes, myBuffer.array())); } - @Test public void testMarkSupported() { InputStream stream = stringUnderTest.newInput(); - assertWithMessage("%s.newInput() must support marking", classUnderTest) - .that(stream.markSupported()) - .isTrue(); + assertTrue(classUnderTest + ".newInput() must support marking", stream.markSupported()); } - @Test public void testMarkAndReset() throws IOException { int fraction = stringUnderTest.size() / 3; @@ -242,17 +227,16 @@ public class LiteralByteStringTest { skipFully(stream, fraction); // Skip a large fraction, but not all. int available = stream.available(); - assertWithMessage( - "%s: after skipping to the 'middle', half the bytes are available", classUnderTest) - .that((stringUnderTest.size() - fraction) == available) - .isTrue(); + assertTrue( + classUnderTest + ": after skipping to the 'middle', half the bytes are available", + (stringUnderTest.size() - fraction) == available); stream.reset(); skipFully(stream, stringUnderTest.size()); // Skip to the end. available = stream.available(); - assertWithMessage("%s: after skipping to the end, no more bytes are available", classUnderTest) - .that(0 == available) - .isTrue(); + assertTrue( + classUnderTest + ": after skipping to the end, no more bytes are available", + 0 == available); } /** @@ -288,55 +272,50 @@ public class LiteralByteStringTest { } } - @Test public void testAsReadOnlyByteBuffer() { ByteBuffer byteBuffer = stringUnderTest.asReadOnlyByteBuffer(); byte[] roundTripBytes = new byte[referenceBytes.length]; - assertThat(byteBuffer.remaining() == referenceBytes.length).isTrue(); - assertThat(byteBuffer.isReadOnly()).isTrue(); + assertTrue(byteBuffer.remaining() == referenceBytes.length); + assertTrue(byteBuffer.isReadOnly()); byteBuffer.get(roundTripBytes); - assertWithMessage("%s.asReadOnlyByteBuffer() must give back the same bytes", classUnderTest) - .that(Arrays.equals(referenceBytes, roundTripBytes)) - .isTrue(); + assertTrue( + classUnderTest + ".asReadOnlyByteBuffer() must give back the same bytes", + Arrays.equals(referenceBytes, roundTripBytes)); } - @Test public void testAsReadOnlyByteBufferList() { List byteBuffers = stringUnderTest.asReadOnlyByteBufferList(); int bytesSeen = 0; byte[] roundTripBytes = new byte[referenceBytes.length]; for (ByteBuffer byteBuffer : byteBuffers) { int thisLength = byteBuffer.remaining(); - assertThat(byteBuffer.isReadOnly()).isTrue(); - assertThat(bytesSeen + thisLength <= referenceBytes.length).isTrue(); + assertTrue(byteBuffer.isReadOnly()); + assertTrue(bytesSeen + thisLength <= referenceBytes.length); byteBuffer.get(roundTripBytes, bytesSeen, thisLength); bytesSeen += thisLength; } - assertThat(bytesSeen == referenceBytes.length).isTrue(); - assertWithMessage("%s.asReadOnlyByteBufferTest() must give back the same bytes", classUnderTest) - .that(Arrays.equals(referenceBytes, roundTripBytes)) - .isTrue(); + assertTrue(bytesSeen == referenceBytes.length); + assertTrue( + classUnderTest + ".asReadOnlyByteBufferTest() must give back the same bytes", + Arrays.equals(referenceBytes, roundTripBytes)); } - @Test public void testToByteArray() { byte[] roundTripBytes = stringUnderTest.toByteArray(); - assertWithMessage("%s.toByteArray() must give back the same bytes", classUnderTest) - .that(Arrays.equals(referenceBytes, roundTripBytes)) - .isTrue(); + assertTrue( + classUnderTest + ".toByteArray() must give back the same bytes", + Arrays.equals(referenceBytes, roundTripBytes)); } - @Test public void testWriteTo() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); stringUnderTest.writeTo(bos); byte[] roundTripBytes = bos.toByteArray(); - assertWithMessage("%s.writeTo() must give back the same bytes", classUnderTest) - .that(Arrays.equals(referenceBytes, roundTripBytes)) - .isTrue(); + assertTrue( + classUnderTest + ".writeTo() must give back the same bytes", + Arrays.equals(referenceBytes, roundTripBytes)); } - @Test public void testWriteToShouldNotExposeInternalBufferToOutputStream() throws IOException { OutputStream os = new OutputStream() { @@ -352,12 +331,11 @@ public class LiteralByteStringTest { }; stringUnderTest.writeTo(os); - assertWithMessage("%s.writeTo() must not grant access to underlying array", classUnderTest) - .that(Arrays.equals(referenceBytes, stringUnderTest.toByteArray())) - .isTrue(); + assertTrue( + classUnderTest + ".writeTo() must not grant access to underlying array", + Arrays.equals(referenceBytes, stringUnderTest.toByteArray())); } - @Test public void testWriteToInternalShouldExposeInternalBufferToOutputStream() throws IOException { OutputStream os = new OutputStream() { @@ -374,12 +352,11 @@ public class LiteralByteStringTest { stringUnderTest.writeToInternal(os, 0, stringUnderTest.size()); byte[] allZeros = new byte[stringUnderTest.size()]; - assertWithMessage("%s.writeToInternal() must grant access to underlying array", classUnderTest) - .that(Arrays.equals(allZeros, stringUnderTest.toByteArray())) - .isTrue(); + assertTrue( + classUnderTest + ".writeToInternal() must grant access to underlying array", + Arrays.equals(allZeros, stringUnderTest.toByteArray())); } - @Test public void testWriteToShouldExposeInternalBufferToByteOutput() throws IOException { ByteOutput out = new ByteOutput() { @@ -411,240 +388,197 @@ public class LiteralByteStringTest { stringUnderTest.writeTo(out); byte[] allZeros = new byte[stringUnderTest.size()]; - assertWithMessage("%s.writeToInternal() must grant access to underlying array", classUnderTest) - .that(Arrays.equals(allZeros, stringUnderTest.toByteArray())) - .isTrue(); + assertTrue( + classUnderTest + ".writeToInternal() must grant access to underlying array", + Arrays.equals(allZeros, stringUnderTest.toByteArray())); } - @Test public void testNewOutput() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteString.Output output = ByteString.newOutput(); stringUnderTest.writeTo(output); - assertWithMessage("Output Size returns correct result") - .that(output.size()) - .isEqualTo(stringUnderTest.size()); + assertEquals("Output Size returns correct result", output.size(), stringUnderTest.size()); output.writeTo(bos); - assertWithMessage("Output.writeTo() must give back the same bytes") - .that(Arrays.equals(referenceBytes, bos.toByteArray())) - .isTrue(); + assertTrue( + "Output.writeTo() must give back the same bytes", + Arrays.equals(referenceBytes, bos.toByteArray())); // write the output stream to itself! This should cause it to double output.writeTo(output); - assertWithMessage("Writing an output stream to itself is successful") - .that(stringUnderTest.concat(stringUnderTest)) - .isEqualTo(output.toByteString()); + assertEquals( + "Writing an output stream to itself is successful", + stringUnderTest.concat(stringUnderTest), + output.toByteString()); output.reset(); - assertWithMessage("Output.reset() resets the output").that(output.size()).isEqualTo(0); - assertWithMessage("Output.reset() resets the output") - .that(output.toByteString()) - .isEqualTo(ByteString.EMPTY); + assertEquals("Output.reset() resets the output", 0, output.size()); + assertEquals("Output.reset() resets the output", ByteString.EMPTY, output.toByteString()); } - @Test public void testToString() throws UnsupportedEncodingException { String testString = "I love unicode \u1234\u5678 characters"; ByteString unicode = ByteString.wrap(testString.getBytes(Internal.UTF_8)); String roundTripString = unicode.toString(UTF_8); - assertWithMessage("%s unicode must match", classUnderTest) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(classUnderTest + " unicode must match", testString, roundTripString); } - @Test public void testCharsetToString() { String testString = "I love unicode \u1234\u5678 characters"; ByteString unicode = ByteString.wrap(testString.getBytes(Internal.UTF_8)); String roundTripString = unicode.toString(Internal.UTF_8); - assertWithMessage("%s unicode must match", classUnderTest) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(classUnderTest + " unicode must match", testString, roundTripString); } - @Test public void testToString_returnsCanonicalEmptyString() { - assertWithMessage("%s must be the same string references", classUnderTest) - .that(ByteString.EMPTY.toString(Internal.UTF_8)) - .isSameInstanceAs(ByteString.wrap(new byte[] {}).toString(Internal.UTF_8)); + assertSame( + classUnderTest + " must be the same string references", + ByteString.EMPTY.toString(Internal.UTF_8), + ByteString.wrap(new byte[] {}).toString(Internal.UTF_8)); } - @Test public void testToString_raisesException() { try { ByteString.EMPTY.toString("invalid"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UnsupportedEncodingException expected) { // This is success } try { ByteString.wrap(referenceBytes).toString("invalid"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UnsupportedEncodingException expected) { // This is success } } - @Test - @SuppressWarnings("SelfEquals") public void testEquals() { - assertWithMessage("%s must not equal null", classUnderTest) - .that(stringUnderTest) - .isNotEqualTo(null); - assertWithMessage("%s must equal self", classUnderTest) - .that(stringUnderTest.equals(stringUnderTest)) - .isTrue(); - assertWithMessage("%s must not equal the empty string", classUnderTest) - .that(stringUnderTest) - .isNotEqualTo(ByteString.EMPTY); - assertWithMessage("%s empty strings must be equal", classUnderTest) - .that(ByteString.wrap(new byte[] {})) - .isEqualTo(stringUnderTest.substring(55, 55)); - assertWithMessage("%s must equal another string with the same value", classUnderTest) - .that(stringUnderTest) - .isEqualTo(ByteString.wrap(referenceBytes)); + assertEquals(classUnderTest + " must not equal null", false, stringUnderTest.equals(null)); + assertEquals(classUnderTest + " must equal self", stringUnderTest, stringUnderTest); + assertFalse( + classUnderTest + " must not equal the empty string", + stringUnderTest.equals(ByteString.EMPTY)); + assertEquals( + classUnderTest + " empty strings must be equal", + ByteString.wrap(new byte[] {}), + stringUnderTest.substring(55, 55)); + assertEquals( + classUnderTest + " must equal another string with the same value", + stringUnderTest, + ByteString.wrap(referenceBytes)); byte[] mungedBytes = new byte[referenceBytes.length]; System.arraycopy(referenceBytes, 0, mungedBytes, 0, referenceBytes.length); mungedBytes[mungedBytes.length - 5] = (byte) (mungedBytes[mungedBytes.length - 5] ^ 0xFF); - assertWithMessage("%s must not equal every string with the same length", classUnderTest) - .that(stringUnderTest) - .isNotEqualTo(ByteString.wrap(mungedBytes)); + assertFalse( + classUnderTest + " must not equal every string with the same length", + stringUnderTest.equals(ByteString.wrap(mungedBytes))); } - @Test public void testHashCode() { int hash = stringUnderTest.hashCode(); - assertWithMessage("%s must have expected hashCode", classUnderTest) - .that(hash) - .isEqualTo(expectedHashCode); + assertEquals(classUnderTest + " must have expected hashCode", expectedHashCode, hash); } - @Test public void testPeekCachedHashCode() { - assertWithMessage("%s.peekCachedHashCode() should return zero at first", classUnderTest) - .that(stringUnderTest.peekCachedHashCode()) - .isEqualTo(0); - int unused = stringUnderTest.hashCode(); - assertWithMessage("%s.peekCachedHashCode should return zero at first", classUnderTest) - .that(stringUnderTest.peekCachedHashCode()) - .isEqualTo(expectedHashCode); + assertEquals( + classUnderTest + ".peekCachedHashCode() should return zero at first", + 0, + stringUnderTest.peekCachedHashCode()); + stringUnderTest.hashCode(); + assertEquals( + classUnderTest + ".peekCachedHashCode should return zero at first", + expectedHashCode, + stringUnderTest.peekCachedHashCode()); } - @Test public void testPartialHash() { // partialHash() is more strenuously tested elsewhere by testing hashes of substrings. // This test would fail if the expected hash were 1. It's not. int hash = stringUnderTest.partialHash(stringUnderTest.size(), 0, stringUnderTest.size()); - assertWithMessage("%s.partialHash() must yield expected hashCode", classUnderTest) - .that(hash) - .isEqualTo(expectedHashCode); + assertEquals( + classUnderTest + ".partialHash() must yield expected hashCode", expectedHashCode, hash); } - @Test public void testNewInput() throws IOException { InputStream input = stringUnderTest.newInput(); - assertWithMessage("InputStream.available() returns correct value") - .that(stringUnderTest.size()) - .isEqualTo(input.available()); + assertEquals( + "InputStream.available() returns correct value", stringUnderTest.size(), input.available()); boolean stillEqual = true; for (byte referenceByte : referenceBytes) { int expectedInt = (referenceByte & 0xFF); stillEqual = (expectedInt == input.read()); } - assertWithMessage("InputStream.available() returns correct value") - .that(input.available()) - .isEqualTo(0); - assertWithMessage("%s must give the same bytes from the InputStream", classUnderTest) - .that(stillEqual) - .isTrue(); - assertWithMessage("%s InputStream must now be exhausted", classUnderTest) - .that(input.read()) - .isEqualTo(-1); - } - - @Test + assertEquals("InputStream.available() returns correct value", 0, input.available()); + assertTrue(classUnderTest + " must give the same bytes from the InputStream", stillEqual); + assertEquals(classUnderTest + " InputStream must now be exhausted", -1, input.read()); + } + public void testNewInput_readZeroBytes() throws IOException { InputStream input = stringUnderTest.newInput(); - assertWithMessage( - "%s InputStream.read() returns 0 when told to read 0 bytes and not at EOF", - classUnderTest) - .that(input.read(new byte[0])) - .isEqualTo(0); + assertEquals( + classUnderTest + " InputStream.read() returns 0 when told to read 0 bytes and not at EOF", + 0, + input.read(new byte[0])); input.skip(input.available()); - assertWithMessage( - "%s InputStream.read() returns -1 when told to read 0 bytes at EOF", classUnderTest) - .that(input.read(new byte[0])) - .isEqualTo(-1); + assertEquals( + classUnderTest + " InputStream.read() returns -1 when told to read 0 bytes at EOF", + -1, + input.read(new byte[0])); } - @Test public void testNewInput_skip() throws IOException { InputStream input = stringUnderTest.newInput(); int stringSize = stringUnderTest.size(); int nearEndIndex = stringSize * 2 / 3; long skipped1 = input.skip(nearEndIndex); - assertWithMessage("InputStream.skip()").that(skipped1).isEqualTo(nearEndIndex); - assertWithMessage("InputStream.available()") - .that(input.available()) - .isEqualTo(stringSize - skipped1); - assertWithMessage("InputStream.mark() is available").that(input.markSupported()).isTrue(); + assertEquals("InputStream.skip()", skipped1, nearEndIndex); + assertEquals("InputStream.available()", stringSize - skipped1, input.available()); + assertTrue("InputStream.mark() is available", input.markSupported()); input.mark(0); - assertWithMessage("InputStream.skip(), read()") - .that(stringUnderTest.byteAt(nearEndIndex) & 0xFF) - .isEqualTo(input.read()); - assertWithMessage("InputStream.available()") - .that(input.available()) - .isEqualTo(stringSize - skipped1 - 1); + assertEquals( + "InputStream.skip(), read()", stringUnderTest.byteAt(nearEndIndex) & 0xFF, input.read()); + assertEquals("InputStream.available()", stringSize - skipped1 - 1, input.available()); long skipped2 = input.skip(stringSize); - assertWithMessage("InputStream.skip() incomplete") - .that(skipped2) - .isEqualTo(stringSize - skipped1 - 1); - assertWithMessage("InputStream.skip(), no more input").that(input.available()).isEqualTo(0); - assertWithMessage("InputStream.skip(), no more input").that(input.read()).isEqualTo(-1); + assertEquals("InputStream.skip() incomplete", skipped2, stringSize - skipped1 - 1); + assertEquals("InputStream.skip(), no more input", 0, input.available()); + assertEquals("InputStream.skip(), no more input", -1, input.read()); assertThat(input.skip(1)).isEqualTo(0); assertThat(input.read(new byte[1], /* off= */ 0, /*len=*/ 0)).isEqualTo(-1); input.reset(); - assertWithMessage("InputStream.reset() succeeded") - .that(input.available()) - .isEqualTo(stringSize - skipped1); - assertWithMessage("InputStream.reset(), read()") - .that(input.read()) - .isEqualTo(stringUnderTest.byteAt(nearEndIndex) & 0xFF); + assertEquals("InputStream.reset() succeeded", stringSize - skipped1, input.available()); + assertEquals( + "InputStream.reset(), read()", stringUnderTest.byteAt(nearEndIndex) & 0xFF, input.read()); } - @Test public void testNewCodedInput() throws IOException { CodedInputStream cis = stringUnderTest.newCodedInput(); byte[] roundTripBytes = cis.readRawBytes(referenceBytes.length); - assertWithMessage("%s must give the same bytes back from the CodedInputStream", classUnderTest) - .that(Arrays.equals(referenceBytes, roundTripBytes)) - .isTrue(); - assertWithMessage(" %s CodedInputStream must now be exhausted", classUnderTest) - .that(cis.isAtEnd()) - .isTrue(); + assertTrue( + classUnderTest + " must give the same bytes back from the CodedInputStream", + Arrays.equals(referenceBytes, roundTripBytes)); + assertTrue(classUnderTest + " CodedInputStream must now be exhausted", cis.isAtEnd()); } /** * Make sure we keep things simple when concatenating with empty. See also {@link * ByteStringTest#testConcat_empty()}. */ - @Test public void testConcat_empty() { - assertWithMessage("%s concatenated with empty must give %s ", classUnderTest, classUnderTest) - .that(stringUnderTest.concat(ByteString.EMPTY)) - .isSameInstanceAs(stringUnderTest); - assertWithMessage("empty concatenated with %s must give %s", classUnderTest, classUnderTest) - .that(ByteString.EMPTY.concat(stringUnderTest)) - .isSameInstanceAs(stringUnderTest); + assertSame( + classUnderTest + " concatenated with empty must give " + classUnderTest, + stringUnderTest.concat(ByteString.EMPTY), + stringUnderTest); + assertSame( + "empty concatenated with " + classUnderTest + " must give " + classUnderTest, + ByteString.EMPTY.concat(stringUnderTest), + stringUnderTest); } - @Test public void testJavaSerialization() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(out); @@ -654,7 +588,7 @@ public class LiteralByteStringTest { InputStream in = new ByteArrayInputStream(pickled); ObjectInputStream ois = new ObjectInputStream(in); Object o = ois.readObject(); - assertWithMessage("Didn't get a ByteString back").that(o).isInstanceOf(ByteString.class); - assertWithMessage("Should get an equal ByteString back").that(o).isEqualTo(stringUnderTest); + assertTrue("Didn't get a ByteString back", o instanceof ByteString); + assertEquals("Should get an equal ByteString back", stringUnderTest, o); } } diff --git a/java/core/src/test/java/com/google/protobuf/LongArrayListTest.java b/java/core/src/test/java/com/google/protobuf/LongArrayListTest.java index 2531b7a1cf4790bf4ddeef26318403f22c70bc93..d6fbaf9d9506c4c1a5f41abdabcb0d402da4bb1f 100644 --- a/java/core/src/test/java/com/google/protobuf/LongArrayListTest.java +++ b/java/core/src/test/java/com/google/protobuf/LongArrayListTest.java @@ -1,50 +1,68 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static java.util.Arrays.asList; import com.google.protobuf.Internal.LongList; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Iterator; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests for {@link LongArrayList}. */ -@RunWith(JUnit4.class) -public class LongArrayListTest { +/** + * Tests for {@link LongArrayList}. + * + * @author dweis@google.com (Daniel Weis) + */ +public class LongArrayListTest extends TestCase { private static final LongArrayList UNARY_LIST = newImmutableLongArrayList(1); private static final LongArrayList TERTIARY_LIST = newImmutableLongArrayList(1, 2, 3); private LongArrayList list; - @Before - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { list = new LongArrayList(); } - @Test public void testEmptyListReturnsSameInstance() { - assertThat(LongArrayList.emptyList()).isSameInstanceAs(LongArrayList.emptyList()); + assertSame(LongArrayList.emptyList(), LongArrayList.emptyList()); } - @Test public void testEmptyListIsImmutable() { assertImmutable(LongArrayList.emptyList()); } - @Test public void testMakeImmutable() { list.addLong(3); list.addLong(4); @@ -54,20 +72,19 @@ public class LongArrayListTest { assertImmutable(list); } - @Test public void testModificationWithIteration() { list.addAll(asList(1L, 2L, 3L, 4L)); Iterator iterator = list.iterator(); - assertThat(list).hasSize(4); - assertThat((long) list.get(0)).isEqualTo(1L); - assertThat((long) iterator.next()).isEqualTo(1L); + assertEquals(4, list.size()); + assertEquals(1L, (long) list.get(0)); + assertEquals(1L, (long) iterator.next()); list.set(0, 1L); - assertThat((long) iterator.next()).isEqualTo(2L); + assertEquals(2L, (long) iterator.next()); list.remove(0); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } @@ -76,211 +93,191 @@ public class LongArrayListTest { list.add(0, 0L); try { iterator.next(); - assertWithMessage("expected exception").fail(); + fail(); } catch (ConcurrentModificationException e) { // expected } } - @Test public void testGet() { - assertThat((long) TERTIARY_LIST.get(0)).isEqualTo(1L); - assertThat((long) TERTIARY_LIST.get(1)).isEqualTo(2L); - assertThat((long) TERTIARY_LIST.get(2)).isEqualTo(3L); + assertEquals(1L, (long) TERTIARY_LIST.get(0)); + assertEquals(2L, (long) TERTIARY_LIST.get(1)); + assertEquals(3L, (long) TERTIARY_LIST.get(2)); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testGetLong() { - assertThat(TERTIARY_LIST.getLong(0)).isEqualTo(1L); - assertThat(TERTIARY_LIST.getLong(1)).isEqualTo(2L); - assertThat(TERTIARY_LIST.getLong(2)).isEqualTo(3L); + assertEquals(1L, TERTIARY_LIST.getLong(0)); + assertEquals(2L, TERTIARY_LIST.getLong(1)); + assertEquals(3L, TERTIARY_LIST.getLong(2)); try { TERTIARY_LIST.get(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { TERTIARY_LIST.get(3); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testIndexOf_nullElement() { - assertThat(TERTIARY_LIST.indexOf(null)).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(null)); } - @Test public void testIndexOf_incompatibleElementType() { - assertThat(TERTIARY_LIST.indexOf(new Object())).isEqualTo(-1); + assertEquals(-1, TERTIARY_LIST.indexOf(new Object())); } - @Test public void testIndexOf_notInList() { - assertThat(UNARY_LIST.indexOf(2L)).isEqualTo(-1); + assertEquals(-1, UNARY_LIST.indexOf(2L)); } - @Test public void testIndexOf_notInListWithDuplicates() { LongArrayList listWithDupes = newImmutableLongArrayList(1L, 1L); - assertThat(listWithDupes.indexOf(2L)).isEqualTo(-1); + assertEquals(-1, listWithDupes.indexOf(2L)); } - @Test public void testIndexOf_inList() { - assertThat(TERTIARY_LIST.indexOf(2L)).isEqualTo(1); + assertEquals(1, TERTIARY_LIST.indexOf(2L)); } - @Test public void testIndexOf_inListWithDuplicates_matchAtHead() { LongArrayList listWithDupes = newImmutableLongArrayList(1L, 1L, 2L); - assertThat(listWithDupes.indexOf(1L)).isEqualTo(0); + assertEquals(0, listWithDupes.indexOf(1L)); } - @Test public void testIndexOf_inListWithDuplicates_matchMidList() { LongArrayList listWithDupes = newImmutableLongArrayList(2L, 1L, 1L, 2L); - assertThat(listWithDupes.indexOf(1L)).isEqualTo(1); + assertEquals(1, listWithDupes.indexOf(1L)); } - @Test public void testContains_nullElement() { - assertThat(TERTIARY_LIST).doesNotContain(null); + assertEquals(false, TERTIARY_LIST.contains(null)); } - @Test public void testContains_incompatibleElementType() { - assertThat(TERTIARY_LIST).doesNotContain(new Object()); + assertEquals(false, TERTIARY_LIST.contains(new Object())); } - @Test public void testContains_notInList() { - assertThat(UNARY_LIST).doesNotContain(2L); + assertEquals(false, UNARY_LIST.contains(2L)); } - @Test public void testContains_notInListWithDuplicates() { LongArrayList listWithDupes = newImmutableLongArrayList(1L, 1L); - assertThat(listWithDupes).doesNotContain(2L); + assertEquals(false, listWithDupes.contains(2L)); } - @Test public void testContains_inList() { - assertThat(TERTIARY_LIST).contains(2L); + assertEquals(true, TERTIARY_LIST.contains(2L)); } - @Test public void testContains_inListWithDuplicates_matchAtHead() { LongArrayList listWithDupes = newImmutableLongArrayList(1L, 1L, 2L); - assertThat(listWithDupes).contains(1L); + assertEquals(true, listWithDupes.contains(1L)); } - @Test public void testContains_inListWithDuplicates_matchMidList() { LongArrayList listWithDupes = newImmutableLongArrayList(2L, 1L, 1L, 2L); - assertThat(listWithDupes).contains(1L); + assertEquals(true, listWithDupes.contains(1L)); } - @Test public void testSize() { - assertThat(LongArrayList.emptyList()).isEmpty(); - assertThat(UNARY_LIST).hasSize(1); - assertThat(TERTIARY_LIST).hasSize(3); + assertEquals(0, LongArrayList.emptyList().size()); + assertEquals(1, UNARY_LIST.size()); + assertEquals(3, TERTIARY_LIST.size()); list.addLong(3); list.addLong(4); list.addLong(6); list.addLong(8); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); list.remove(0); - assertThat(list).hasSize(3); + assertEquals(3, list.size()); list.add(17L); - assertThat(list).hasSize(4); + assertEquals(4, list.size()); } - @Test public void testSet() { list.addLong(2); list.addLong(4); - assertThat((long) list.set(0, 3L)).isEqualTo(2L); - assertThat(list.getLong(0)).isEqualTo(3L); + assertEquals(2L, (long) list.set(0, 3L)); + assertEquals(3L, list.getLong(0)); - assertThat((long) list.set(1, 0L)).isEqualTo(4L); - assertThat(list.getLong(1)).isEqualTo(0L); + assertEquals(4L, (long) list.set(1, 0L)); + assertEquals(0L, list.getLong(1)); try { list.set(-1, 0L); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.set(2, 0L); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testSetLong() { list.addLong(1); list.addLong(3); - assertThat(list.setLong(0, 0)).isEqualTo(1L); - assertThat(list.getLong(0)).isEqualTo(0L); + assertEquals(1L, list.setLong(0, 0)); + assertEquals(0L, list.getLong(0)); - assertThat(list.setLong(1, 0)).isEqualTo(3L); - assertThat(list.getLong(1)).isEqualTo(0L); + assertEquals(3L, list.setLong(1, 0)); + assertEquals(0L, list.getLong(1)); try { list.setLong(-1, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.setLong(2, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testAdd() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.add(2L)).isTrue(); - assertThat(list).containsExactly(2L); + assertTrue(list.add(2L)); + assertEquals(asList(2L), list); - assertThat(list.add(3L)).isTrue(); + assertTrue(list.add(3L)); list.add(0, 4L); - assertThat(list).containsExactly(4L, 2L, 3L).inOrder(); + assertEquals(asList(4L, 2L, 3L), list); list.add(0, 1L); list.add(0, 0L); @@ -288,7 +285,7 @@ public class LongArrayListTest { for (int i = 0; i < 6; i++) { list.add(Long.valueOf(5 + i)); } - assertThat(list).containsExactly(0L, 1L, 4L, 2L, 3L, 5L, 6L, 7L, 8L, 9L, 10L).inOrder(); + assertEquals(asList(0L, 1L, 4L, 2L, 3L, 5L, 6L, 7L, 8L, 9L, 10L), list); try { list.add(-1, 5L); @@ -303,98 +300,90 @@ public class LongArrayListTest { } } - @Test public void testAddLong() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); list.addLong(2); - assertThat(list).containsExactly(2L); + assertEquals(asList(2L), list); list.addLong(3); - assertThat(list).containsExactly(2L, 3L).inOrder(); + assertEquals(asList(2L, 3L), list); } - @Test public void testAddAll() { - assertThat(list).isEmpty(); + assertEquals(0, list.size()); - assertThat(list.addAll(Collections.singleton(1L))).isTrue(); - assertThat(list).hasSize(1); - assertThat((long) list.get(0)).isEqualTo(1L); - assertThat(list.getLong(0)).isEqualTo(1L); + assertTrue(list.addAll(Collections.singleton(1L))); + assertEquals(1, list.size()); + assertEquals(1L, (long) list.get(0)); + assertEquals(1L, list.getLong(0)); - assertThat(list.addAll(asList(2L, 3L, 4L, 5L, 6L))).isTrue(); - assertThat(list).containsExactly(1L, 2L, 3L, 4L, 5L, 6L).inOrder(); + assertTrue(list.addAll(asList(2L, 3L, 4L, 5L, 6L))); + assertEquals(asList(1L, 2L, 3L, 4L, 5L, 6L), list); - assertThat(list.addAll(TERTIARY_LIST)).isTrue(); - assertThat(list).containsExactly(1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L).inOrder(); + assertTrue(list.addAll(TERTIARY_LIST)); + assertEquals(asList(1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L), list); - assertThat(list.addAll(Collections.emptyList())).isFalse(); - assertThat(list.addAll(LongArrayList.emptyList())).isFalse(); + assertFalse(list.addAll(Collections.emptyList())); + assertFalse(list.addAll(LongArrayList.emptyList())); } - @Test public void testEquals() { LongArrayList list1 = new LongArrayList(); LongArrayList list2 = new LongArrayList(); - assertThat(list1).isEqualTo(list2); + assertEquals(list1, list2); } - @Test public void testRemove() { list.addAll(TERTIARY_LIST); - assertThat((long) list.remove(0)).isEqualTo(1L); - assertThat(list).containsExactly(2L, 3L).inOrder(); + assertEquals(1L, (long) list.remove(0)); + assertEquals(asList(2L, 3L), list); - assertThat(list.remove(Long.valueOf(3))).isTrue(); - assertThat(list).containsExactly(2L); + assertTrue(list.remove(Long.valueOf(3))); + assertEquals(asList(2L), list); - assertThat(list.remove(Long.valueOf(3))).isFalse(); - assertThat(list).containsExactly(2L); + assertFalse(list.remove(Long.valueOf(3))); + assertEquals(asList(2L), list); - assertThat((long) list.remove(0)).isEqualTo(2L); - assertThat(list).isEmpty(); + assertEquals(2L, (long) list.remove(0)); + assertEquals(asList(), list); try { list.remove(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IndexOutOfBoundsException e) { // expected } try { list.remove(0); - assertWithMessage("expected exception").fail(); } catch (IndexOutOfBoundsException e) { // expected } } - @Test public void testRemoveEnd_listAtCapacity() { LongList toRemove = LongArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addLong(3); toRemove.remove(0); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } - @Test public void testRemove_listAtCapacity() { LongList toRemove = LongArrayList.emptyList().mutableCopyWithCapacity(2); toRemove.addLong(3); toRemove.addLong(4); toRemove.remove(0); - assertThat(toRemove).hasSize(1); - assertThat((long) toRemove.get(0)).isEqualTo(4L); + assertEquals(1, toRemove.size()); + assertEquals(4L, (long) toRemove.get(0)); } - @Test public void testSublistRemoveEndOfCapacity() { LongList toRemove = LongArrayList.emptyList().mutableCopyWithCapacity(1); toRemove.addLong(3); toRemove.subList(0, 1).clear(); - assertThat(toRemove).isEmpty(); + assertEquals(0, toRemove.size()); } private void assertImmutable(LongList list) { @@ -404,147 +393,147 @@ public class LongArrayListTest { try { list.add(1L); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.add(0, 1L); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(Collections.singletonList(1L)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(new LongArrayList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.singleton(1L)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addAll(0, Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.addLong(0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.clear(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(1); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(Collections.singleton(1L)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.removeAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.emptyList()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(Collections.singleton(1L)); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.retainAll(UNARY_LIST); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.set(0, 0L); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { list.setLong(0, 0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } diff --git a/java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java b/java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java index 543ace89846514b885a11519582d49c00e632f00..9994ad067a1ec6a188044413e6f3f7905ae5596e 100644 --- a/java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java +++ b/java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java @@ -1,16 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; -import static org.junit.Assert.fail; - import map_lite_test.MapForProto2TestProto.BizarroTestMap; import map_lite_test.MapForProto2TestProto.TestMap; import map_lite_test.MapForProto2TestProto.TestMap.MessageValue; @@ -19,16 +38,13 @@ import map_lite_test.MapForProto2TestProto.TestUnknownEnumValue; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; -import java.util.LinkedHashMap; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Unit tests for map fields. */ -@RunWith(JUnit4.class) -public final class MapForProto2LiteTest { +public final class MapForProto2LiteTest extends TestCase { private void setMapValues(TestMap.Builder builder) { builder @@ -52,7 +68,6 @@ public final class MapForProto2LiteTest { .putStringToInt32Field("3", 33); } - @Test public void testSetMapValues() { TestMap.Builder mapBuilder = TestMap.newBuilder(); setMapValues(mapBuilder); @@ -71,35 +86,35 @@ public final class MapForProto2LiteTest { } private void assertMapValuesSet(TestMap message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(11); - assertThat(message.getInt32ToInt32FieldMap().get(2).intValue()).isEqualTo(22); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); + assertEquals(3, message.getInt32ToInt32FieldMap().size()); + assertEquals(11, message.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(22, message.getInt32ToInt32FieldMap().get(2).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(3).intValue()); - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "11"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(2, "22"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); + assertEquals(3, message.getInt32ToStringFieldMap().size()); + assertEquals("11", message.getInt32ToStringFieldMap().get(1)); + assertEquals("22", message.getInt32ToStringFieldMap().get(2)); + assertEquals("33", message.getInt32ToStringFieldMap().get(3)); - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("11")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(2, TestUtil.toBytes("22")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); + assertEquals(3, message.getInt32ToBytesFieldMap().size()); + assertEquals(TestUtil.toBytes("11"), message.getInt32ToBytesFieldMap().get(1)); + assertEquals(TestUtil.toBytes("22"), message.getInt32ToBytesFieldMap().get(2)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesFieldMap().get(3)); - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.FOO); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(2, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); + assertEquals(3, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.FOO, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(2)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumFieldMap().get(3)); - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(11); - assertThat(message.getInt32ToMessageFieldMap().get(2).getValue()).isEqualTo(22); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); + assertEquals(3, message.getInt32ToMessageFieldMap().size()); + assertEquals(11, message.getInt32ToMessageFieldMap().get(1).getValue()); + assertEquals(22, message.getInt32ToMessageFieldMap().get(2).getValue()); + assertEquals(33, message.getInt32ToMessageFieldMap().get(3).getValue()); - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(11); - assertThat(message.getStringToInt32FieldMap().get("2").intValue()).isEqualTo(22); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); + assertEquals(3, message.getStringToInt32FieldMap().size()); + assertEquals(11, message.getStringToInt32FieldMap().get("1").intValue()); + assertEquals(22, message.getStringToInt32FieldMap().get("2").intValue()); + assertEquals(33, message.getStringToInt32FieldMap().get("3").intValue()); } private void updateMapValues(TestMap.Builder builder) { @@ -124,7 +139,6 @@ public final class MapForProto2LiteTest { .putStringToInt32Field("4", 44); } - @Test public void testUpdateMapValues() { TestMap.Builder mapBuilder = TestMap.newBuilder(); setMapValues(mapBuilder); @@ -138,53 +152,52 @@ public final class MapForProto2LiteTest { } private void assertMapValuesUpdated(TestMap message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(111); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); - assertThat(message.getInt32ToInt32FieldMap().get(4).intValue()).isEqualTo(44); + assertEquals(3, message.getInt32ToInt32FieldMap().size()); + assertEquals(111, message.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(3).intValue()); + assertEquals(44, message.getInt32ToInt32FieldMap().get(4).intValue()); - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "111"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(4, "44"); + assertEquals(3, message.getInt32ToStringFieldMap().size()); + assertEquals("111", message.getInt32ToStringFieldMap().get(1)); + assertEquals("33", message.getInt32ToStringFieldMap().get(3)); + assertEquals("44", message.getInt32ToStringFieldMap().get(4)); - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("111")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(4, TestUtil.toBytes("44")); + assertEquals(3, message.getInt32ToBytesFieldMap().size()); + assertEquals(TestUtil.toBytes("111"), message.getInt32ToBytesFieldMap().get(1)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesFieldMap().get(3)); + assertEquals(TestUtil.toBytes("44"), message.getInt32ToBytesFieldMap().get(4)); - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(4, TestMap.EnumValue.QUX); + assertEquals(3, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumFieldMap().get(3)); + assertEquals(TestMap.EnumValue.QUX, message.getInt32ToEnumFieldMap().get(4)); - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(111); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); - assertThat(message.getInt32ToMessageFieldMap().get(4).getValue()).isEqualTo(44); + assertEquals(3, message.getInt32ToMessageFieldMap().size()); + assertEquals(111, message.getInt32ToMessageFieldMap().get(1).getValue()); + assertEquals(33, message.getInt32ToMessageFieldMap().get(3).getValue()); + assertEquals(44, message.getInt32ToMessageFieldMap().get(4).getValue()); - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(111); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); - assertThat(message.getStringToInt32FieldMap().get("4").intValue()).isEqualTo(44); + assertEquals(3, message.getStringToInt32FieldMap().size()); + assertEquals(111, message.getStringToInt32FieldMap().get("1").intValue()); + assertEquals(33, message.getStringToInt32FieldMap().get("3").intValue()); + assertEquals(44, message.getStringToInt32FieldMap().get("4").intValue()); } private void assertMapValuesCleared(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToStringFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToBytesFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToEnumFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToMessageFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getStringToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(0); - } - - @Test + assertEquals(0, testMapOrBuilder.getInt32ToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToStringField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(0, testMapOrBuilder.getStringToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getStringToInt32FieldCount()); + } + public void testSanityCopyOnWrite() throws InvalidProtocolBufferException { // Since builders are implemented as a thin wrapper around a message // instance, we attempt to verify that we can't cause the builder to modify @@ -193,16 +206,15 @@ public final class MapForProto2LiteTest { TestMap.Builder builder = TestMap.newBuilder(); TestMap message = builder.build(); builder.putInt32ToInt32Field(1, 2); - assertThat(message.getInt32ToInt32FieldMap()).isEmpty(); + assertTrue(message.getInt32ToInt32FieldMap().isEmpty()); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), message.getInt32ToInt32FieldMap()); + assertEquals(newMap(1, 2), builder.getInt32ToInt32FieldMap()); builder.putInt32ToInt32Field(2, 3); - assertThat(message.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2, 2, 3)); + assertEquals(newMap(1, 2), message.getInt32ToInt32FieldMap()); + assertEquals(newMap(1, 2, 2, 3), builder.getInt32ToInt32FieldMap()); } - @Test public void testGetMapIsImmutable() { TestMap.Builder builder = TestMap.newBuilder(); assertMapsAreImmutable(builder); @@ -214,70 +226,69 @@ public final class MapForProto2LiteTest { } private void assertMapsAreImmutable(TestMapOrBuilder testMapOrBuilder) { - assertImmutable(testMapOrBuilder.getInt32ToInt32FieldMap(), 1, 2); - assertImmutable(testMapOrBuilder.getInt32ToStringFieldMap(), 1, "2"); - assertImmutable(testMapOrBuilder.getInt32ToBytesFieldMap(), 1, TestUtil.toBytes("2")); - assertImmutable(testMapOrBuilder.getInt32ToEnumFieldMap(), 1, TestMap.EnumValue.FOO); + assertImmutable(testMapOrBuilder.getInt32ToInt32Field(), 1, 2); + assertImmutable(testMapOrBuilder.getInt32ToStringField(), 1, "2"); + assertImmutable(testMapOrBuilder.getInt32ToBytesField(), 1, TestUtil.toBytes("2")); + assertImmutable(testMapOrBuilder.getInt32ToEnumField(), 1, TestMap.EnumValue.FOO); assertImmutable( - testMapOrBuilder.getInt32ToMessageFieldMap(), 1, MessageValue.getDefaultInstance()); - assertImmutable(testMapOrBuilder.getStringToInt32FieldMap(), "1", 2); + testMapOrBuilder.getInt32ToMessageField(), 1, MessageValue.getDefaultInstance()); + assertImmutable(testMapOrBuilder.getStringToInt32Field(), "1", 2); } private void assertImmutable(Map map, K key, V value) { try { map.put(key, value); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } if (!map.isEmpty()) { try { map.entrySet().remove(map.entrySet().iterator().next()); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } } - @Test public void testMutableMapLifecycle() { TestMap.Builder builder = TestMap.newBuilder().putInt32ToInt32Field(1, 2); - assertThat(builder.build().getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32FieldMap()); + assertEquals(newMap(1, 2), builder.getInt32ToInt32FieldMap()); builder.putInt32ToInt32Field(2, 3); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2, 2, 3)); + assertEquals(newMap(1, 2, 2, 3), builder.getInt32ToInt32FieldMap()); builder.putInt32ToEnumField(1, TestMap.EnumValue.BAR); - assertThat(builder.build().getInt32ToEnumFieldMap()) - .isEqualTo(newMap(1, TestMap.EnumValue.BAR)); - assertThat(builder.getInt32ToEnumFieldMap()).isEqualTo(newMap(1, TestMap.EnumValue.BAR)); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.build().getInt32ToEnumFieldMap()); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.getInt32ToEnumFieldMap()); builder.putInt32ToEnumField(2, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumFieldMap()) - .isEqualTo(newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO)); + assertEquals( + newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO), + builder.getInt32ToEnumFieldMap()); builder.putInt32ToStringField(1, "1"); - assertThat(builder.build().getInt32ToStringFieldMap()).isEqualTo(newMap(1, "1")); - assertThat(builder.getInt32ToStringFieldMap()).isEqualTo(newMap(1, "1")); + assertEquals(newMap(1, "1"), builder.build().getInt32ToStringFieldMap()); + assertEquals(newMap(1, "1"), builder.getInt32ToStringFieldMap()); builder.putInt32ToStringField(2, "2"); - assertThat(builder.getInt32ToStringFieldMap()).isEqualTo(newMap(1, "1", 2, "2")); + assertEquals(newMap(1, "1", 2, "2"), builder.getInt32ToStringFieldMap()); builder.putInt32ToMessageField(1, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.build().getInt32ToMessageFieldMap()) - .isEqualTo(newMap(1, TestMap.MessageValue.getDefaultInstance())); - assertThat(builder.getInt32ToMessageFieldMap()) - .isEqualTo(newMap(1, TestMap.MessageValue.getDefaultInstance())); + assertEquals( + newMap(1, TestMap.MessageValue.getDefaultInstance()), + builder.build().getInt32ToMessageFieldMap()); + assertEquals( + newMap(1, TestMap.MessageValue.getDefaultInstance()), builder.getInt32ToMessageFieldMap()); builder.putInt32ToMessageField(2, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.getInt32ToMessageFieldMap()) - .isEqualTo( - newMap( - 1, - TestMap.MessageValue.getDefaultInstance(), - 2, - TestMap.MessageValue.getDefaultInstance())); + assertEquals( + newMap( + 1, + TestMap.MessageValue.getDefaultInstance(), + 2, + TestMap.MessageValue.getDefaultInstance()), + builder.getInt32ToMessageFieldMap()); } - @Test public void testGettersAndSetters() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); TestMap message = builder.build(); @@ -300,7 +311,6 @@ public final class MapForProto2LiteTest { assertMapValuesCleared(message); } - @Test public void testPutAll() throws Exception { TestMap.Builder sourceBuilder = TestMap.newBuilder(); setMapValues(sourceBuilder); @@ -312,78 +322,65 @@ public final class MapForProto2LiteTest { assertMapValuesSet(destination.build()); } - @Test - public void testPutChecksNullKey() throws Exception { - TestMap.Builder builder = TestMap.newBuilder(); - - try { - builder.putStringToInt32Field(null, 1); - assertWithMessage("expected exception").fail(); - } catch (NullPointerException expected) { - } - } - - @Test - public void testPutChecksNullValues() throws Exception { + public void testPutChecksNullKeysAndValues() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); try { builder.putInt32ToStringField(1, null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToBytesField(1, null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToEnumField(1, null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToMessageField(1, null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putStringToInt32Field(null, 1); - assertWithMessage("Expected NullPointerException").fail();; + fail(); } catch (NullPointerException e) { // expected. } } - @Test public void testSerializeAndParse() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); TestMap message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesSet(message); builder = message.toBuilder(); updateMapValues(builder); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesUpdated(message); builder = message.toBuilder(); builder.clear(); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesCleared(message); } @@ -392,44 +389,42 @@ public final class MapForProto2LiteTest { CodedOutputStream output = CodedOutputStream.newInstance(byteArrayOutputStream); bizarroMap.writeTo(output); output.flush(); - return TestMap.parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); + return TestMap.parser().parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); } - @Test public void testParseError() throws Exception { ByteString bytes = TestUtil.toBytes("SOME BYTES"); String stringKey = "a string key"; TestMap map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToInt32Field(5, bytes).build()); - assertThat(map.getInt32ToInt32FieldOrDefault(5, -1)).isEqualTo(0); + assertEquals(0, map.getInt32ToInt32FieldOrDefault(5, -1)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToStringField(stringKey, 5).build()); - assertThat(map.getInt32ToStringFieldOrDefault(0, null)).isEmpty(); + assertEquals("", map.getInt32ToStringFieldOrDefault(0, null)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToBytesField(stringKey, 5).build()); - assertThat(ByteString.EMPTY).isEqualTo(map.getInt32ToBytesFieldOrDefault(0, null)); + assertEquals(map.getInt32ToBytesFieldOrDefault(0, null), ByteString.EMPTY); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToEnumField(stringKey, bytes).build()); - assertThat(map.getInt32ToEnumFieldOrDefault(0, null)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, map.getInt32ToEnumFieldOrDefault(0, null)); try { tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToMessageField(stringKey, bytes).build()); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { - assertThat(expected.getUnfinishedMessage()).isInstanceOf(TestMap.class); + assertTrue(expected.getUnfinishedMessage() instanceof TestMap); map = (TestMap) expected.getUnfinishedMessage(); - assertThat(map.getInt32ToMessageFieldMap()).isEmpty(); + assertTrue(map.getInt32ToMessageFieldMap().isEmpty()); } map = tryParseTestMap( BizarroTestMap.newBuilder().putStringToInt32Field(stringKey, bytes).build()); - assertThat(map.getStringToInt32FieldOrDefault(stringKey, -1)).isEqualTo(0); + assertEquals(0, map.getStringToInt32FieldOrDefault(stringKey, -1)); } - @Test public void testMergeFrom() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); @@ -440,7 +435,6 @@ public final class MapForProto2LiteTest { assertMapValuesSet(other.build()); } - @Test public void testEqualsAndHashCode() throws Exception { // Test that generated equals() and hashCode() will disregard the order // of map entries when comparing/hashing map fields. @@ -461,18 +455,17 @@ public final class MapForProto2LiteTest { .putInt32ToInt32Field(3, 4); TestMap m2 = b2.build(); - assertThat(m2).isEqualTo(m1); - assertThat(m2.hashCode()).isEqualTo(m1.hashCode()); + assertEquals(m1, m2); + assertEquals(m1.hashCode(), m2.hashCode()); // Make sure we did compare map fields. b2.putInt32ToInt32Field(1, 0); m2 = b2.build(); - assertThat(m1.equals(m2)).isFalse(); + assertFalse(m1.equals(m2)); // Don't check m1.hashCode() != m2.hashCode() because it's not guaranteed // to be different. } - @Test public void testUnknownEnumValues() throws Exception { ByteString data = TestUnknownEnumValue.newBuilder() @@ -481,30 +474,27 @@ public final class MapForProto2LiteTest { .build() .toByteString(); - TestMap message = TestMap.parseFrom(data, ExtensionRegistryLite.getEmptyRegistry()); + TestMap message = TestMap.parseFrom(data); // Entries with unknown enum values will be stored into UnknownFieldSet so // there is only one entry in the map. - assertThat(message.getInt32ToEnumFieldMap()).hasSize(1); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); + assertEquals(1, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); // Serializing and parsing should preserve the unknown entry. data = message.toByteString(); - TestUnknownEnumValue messageWithUnknownEnums = - TestUnknownEnumValue.parseFrom(data, ExtensionRegistryLite.getEmptyRegistry()); - assertThat(messageWithUnknownEnums.getInt32ToInt32FieldMap()).hasSize(2); - assertThat(messageWithUnknownEnums.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(1); - assertThat(messageWithUnknownEnums.getInt32ToInt32FieldMap().get(2).intValue()) - .isEqualTo(54321); + TestUnknownEnumValue messageWithUnknownEnums = TestUnknownEnumValue.parseFrom(data); + assertEquals(2, messageWithUnknownEnums.getInt32ToInt32FieldMap().size()); + assertEquals(1, messageWithUnknownEnums.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(54321, messageWithUnknownEnums.getInt32ToInt32FieldMap().get(2).intValue()); } - @Test public void testIterationOrder() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); TestMap message = builder.build(); - assertThat(new ArrayList(message.getStringToInt32FieldMap().keySet())) - .containsExactly("1", "2", "3") - .inOrder(); + assertEquals( + Arrays.asList("1", "2", "3"), + new ArrayList(message.getStringToInt32FieldMap().keySet())); } private static Map newMap(K key1, V value1) { @@ -520,18 +510,16 @@ public final class MapForProto2LiteTest { return map; } - @Test public void testGetMap() { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); TestMap message = builder.build(); - assertThat(message.getStringToInt32FieldMap()).isEqualTo(message.getStringToInt32FieldMap()); - assertThat(message.getInt32ToBytesFieldMap()).isEqualTo(message.getInt32ToBytesFieldMap()); - assertThat(message.getInt32ToEnumFieldMap()).isEqualTo(message.getInt32ToEnumFieldMap()); - assertThat(message.getInt32ToMessageFieldMap()).isEqualTo(message.getInt32ToMessageFieldMap()); + assertEquals(message.getStringToInt32FieldMap(), message.getStringToInt32FieldMap()); + assertEquals(message.getInt32ToBytesFieldMap(), message.getInt32ToBytesFieldMap()); + assertEquals(message.getInt32ToEnumFieldMap(), message.getInt32ToEnumFieldMap()); + assertEquals(message.getInt32ToMessageFieldMap(), message.getInt32ToMessageFieldMap()); } - @Test public void testContains() { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); @@ -540,38 +528,37 @@ public final class MapForProto2LiteTest { } private void assertMapContainsSetValues(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.containsInt32ToInt32Field(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToStringField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToBytesField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToEnumField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToMessageField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsStringToInt32Field("1")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("2")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("3")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("-1")).isFalse(); - } - - @Test + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(1)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(2)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(3)); + assertFalse(testMapOrBuilder.containsInt32ToInt32Field(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToStringField(1)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(2)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(3)); + assertFalse(testMapOrBuilder.containsInt32ToStringField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToBytesField(1)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(2)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(3)); + assertFalse(testMapOrBuilder.containsInt32ToBytesField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToEnumField(1)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(2)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(3)); + assertFalse(testMapOrBuilder.containsInt32ToEnumField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToMessageField(1)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(2)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(3)); + assertFalse(testMapOrBuilder.containsInt32ToMessageField(-1)); + + assertTrue(testMapOrBuilder.containsStringToInt32Field("1")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("2")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("3")); + assertFalse(testMapOrBuilder.containsStringToInt32Field("-1")); + } + public void testCount() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -583,24 +570,23 @@ public final class MapForProto2LiteTest { assertMapCounts(3, message); builder = message.toBuilder().putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); - assertThat(builder.build().getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); + assertEquals(4, builder.build().getInt32ToInt32FieldCount()); // already present - should be unchanged builder.putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); } private void assertMapCounts(int expectedCount, TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(expectedCount); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getStringToInt32FieldCount()); } - @Test public void testGetOrDefault() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -610,38 +596,34 @@ public final class MapForProto2LiteTest { } public void doTestGetOrDefault(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)); + assertEquals(-11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)); - assertThat(testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")).isEqualTo("11"); - assertWithMessage("-11") - .that(testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)) - .isNull(); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")); + assertNull("-11", testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)) - .isEqualTo(TestUtil.toBytes("11")); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)).isNull(); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)) - .isEqualTo(TestMap.EnumValue.FOO); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)).isNull(); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)).isNull(); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)); + assertEquals(-11, testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)); try { testMapOrBuilder.getStringToInt32FieldOrDefault(null, -11); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testGetOrThrow() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -651,100 +633,100 @@ public final class MapForProto2LiteTest { } public void doTestGetOrThrow(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)); try { testMapOrBuilder.getInt32ToInt32FieldOrThrow(-1); - assertWithMessage("Expected IllegalArgumentException").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToStringFieldOrThrow(-1); - assertWithMessage("Expected IllegalArgumentException").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToBytesFieldOrThrow(-1); - assertWithMessage("Expected IllegalArgumentException").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToEnumFieldOrThrow(-1); - assertWithMessage("Expected IllegalArgumentException").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToMessageFieldOrThrow(-1); - assertWithMessage("Expected IllegalArgumentException").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrThrow("1")); try { testMapOrBuilder.getStringToInt32FieldOrThrow("-1"); - assertWithMessage("Expected IllegalArgumentException").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } try { testMapOrBuilder.getStringToInt32FieldOrThrow(null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testPut() { TestMap.Builder builder = TestMap.newBuilder(); builder.putInt32ToInt32Field(1, 11); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); builder.putInt32ToStringField(1, "a"); - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("a"); + assertEquals("a", builder.getInt32ToStringFieldOrThrow(1)); try { builder.putInt32ToStringField(1, null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToBytesField(1, TestUtil.toBytes("11")); - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); try { builder.putInt32ToBytesField(1, null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToEnumField(1, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); try { builder.putInt32ToEnumField(1, null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putStringToInt32Field("a", 1); - assertThat(builder.getStringToInt32FieldOrThrow("a")).isEqualTo(1); + assertEquals(1, builder.getStringToInt32FieldOrThrow("a")); try { builder.putStringToInt32Field(null, -1); } catch (NullPointerException e) { @@ -752,95 +734,44 @@ public final class MapForProto2LiteTest { } } - @Test public void testRemove() { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToInt32Field(1); - assertThat(builder.getInt32ToInt32FieldOrDefault(1, -1)).isEqualTo(-1); + assertEquals(-1, builder.getInt32ToInt32FieldOrDefault(1, -1)); } - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", builder.getInt32ToStringFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToStringField(1); - assertThat(builder.getInt32ToStringFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToStringFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToBytesField(1); - assertThat(builder.getInt32ToBytesFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToBytesFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToEnumField(1); - assertThat(builder.getInt32ToEnumFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToEnumFieldOrDefault(1, null)); } - assertThat(builder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, builder.getStringToInt32FieldOrThrow("1")); for (int times = 0; times < 2; times++) { builder.removeStringToInt32Field("1"); - assertThat(builder.getStringToInt32FieldOrDefault("1", -1)).isEqualTo(-1); + assertEquals(-1, builder.getStringToInt32FieldOrDefault("1", -1)); } try { builder.removeStringToInt32Field(null); - assertWithMessage("Expected NullPointerException").fail(); + fail(); } catch (NullPointerException e) { // expected } } - - @Test - public void testPutAllWithNullStringKey() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - // order preserving map used here to help test rollback - Map data = new LinkedHashMap<>(); - data.put(7, "foo"); - data.put(null, "bar"); - data.put(9, "baz"); - try { - sourceBuilder.putAllInt32ToStringField(data); - fail("allowed null string key"); - } catch (NullPointerException expected) { - // Verify rollback of previously added values. - // They all go in or none do. - assertThat(sourceBuilder.getInt32ToStringFieldMap()).isEmpty(); - } - } - - @Test - public void testPutAllWithNullStringValue() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - // order preserving map used here to help test rollback - Map data = new LinkedHashMap<>(); - data.put(7, "foo"); - data.put(8, "bar"); - data.put(9, null); - try { - sourceBuilder.putAllInt32ToStringField(data); - fail("allowed null string value"); - } catch (NullPointerException expected) { - // Verify rollback of previously added values. - // They all go in or none do. - assertThat(sourceBuilder.getInt32ToStringFieldMap()).isEmpty(); - } - } - - @Test - public void testPutNullStringValue() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - try { - sourceBuilder.putInt32ToStringField(8, null); - fail("allowed null string value"); - } catch (NullPointerException expected) { - } - } - } diff --git a/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java b/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java index 09f473e12911f947784d1d137162cc61d977cb98..b995802b4f0cbd7c1677648f74d695f74f5b7ff6 100644 --- a/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java +++ b/java/core/src/test/java/com/google/protobuf/MapForProto2Test.java @@ -1,17 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; - import com.google.protobuf.Descriptors.FieldDescriptor; import map_test.MapForProto2TestProto.BizarroTestMap; import map_test.MapForProto2TestProto.ReservedAsMapField; @@ -22,48 +40,42 @@ import map_test.MapForProto2TestProto.TestMap.MessageWithRequiredFields; import map_test.MapForProto2TestProto.TestMapOrBuilder; import map_test.MapForProto2TestProto.TestRecursiveMap; import map_test.MapForProto2TestProto.TestUnknownEnumValue; -import map_test.Message1; -import map_test.RedactAllTypes; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; -import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.TreeMap; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Unit tests for map fields in proto2 protos. */ -@RunWith(JUnit4.class) -public class MapForProto2Test { +public class MapForProto2Test extends TestCase { private void setMapValuesUsingMutableMap(TestMap.Builder builder) { builder.getMutableInt32ToInt32Field().put(1, 11); builder.getMutableInt32ToInt32Field().put(2, 22); builder.getMutableInt32ToInt32Field().put(3, 33); - + // builder.getMutableInt32ToStringField().put(1, "11"); builder.getMutableInt32ToStringField().put(2, "22"); builder.getMutableInt32ToStringField().put(3, "33"); - + // builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("11")); builder.getMutableInt32ToBytesField().put(2, TestUtil.toBytes("22")); builder.getMutableInt32ToBytesField().put(3, TestUtil.toBytes("33")); - + // builder.getMutableInt32ToEnumField().put(1, TestMap.EnumValue.FOO); builder.getMutableInt32ToEnumField().put(2, TestMap.EnumValue.BAR); builder.getMutableInt32ToEnumField().put(3, TestMap.EnumValue.BAZ); - + // builder.getMutableInt32ToMessageField().put( 1, MessageValue.newBuilder().setValue(11).build()); builder.getMutableInt32ToMessageField().put( 2, MessageValue.newBuilder().setValue(22).build()); builder.getMutableInt32ToMessageField().put( 3, MessageValue.newBuilder().setValue(33).build()); - + // builder.getMutableStringToInt32Field().put("1", 11); builder.getMutableStringToInt32Field().put("2", 22); builder.getMutableStringToInt32Field().put("3", 33); @@ -91,7 +103,6 @@ public class MapForProto2Test { .putStringToInt32Field("3", 33); } - @Test public void testSetMapValues() { TestMap.Builder usingMutableMapBuilder = TestMap.newBuilder(); setMapValuesUsingMutableMap(usingMutableMapBuilder); @@ -103,7 +114,7 @@ public class MapForProto2Test { TestMap usingAccessors = usingAccessorsBuilder.build(); assertMapValuesSet(usingAccessors); - assertThat(usingAccessors).isEqualTo(usingMutableMap); + assertEquals(usingAccessors, usingMutableMap); } private void copyMapValues(TestMap source, TestMap.Builder destination) { @@ -117,60 +128,60 @@ public class MapForProto2Test { } private void assertMapValuesSet(TestMapOrBuilder message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(11); - assertThat(message.getInt32ToInt32FieldMap().get(2).intValue()).isEqualTo(22); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); - - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "11"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(2, "22"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); - - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("11")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(2, TestUtil.toBytes("22")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); - - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.FOO); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(2, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); - - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(11); - assertThat(message.getInt32ToMessageFieldMap().get(2).getValue()).isEqualTo(22); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); - - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(11); - assertThat(message.getStringToInt32FieldMap().get("2").intValue()).isEqualTo(22); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); + assertEquals(3, message.getInt32ToInt32Field().size()); + assertEquals(11, message.getInt32ToInt32Field().get(1).intValue()); + assertEquals(22, message.getInt32ToInt32Field().get(2).intValue()); + assertEquals(33, message.getInt32ToInt32Field().get(3).intValue()); + + assertEquals(3, message.getInt32ToStringField().size()); + assertEquals("11", message.getInt32ToStringField().get(1)); + assertEquals("22", message.getInt32ToStringField().get(2)); + assertEquals("33", message.getInt32ToStringField().get(3)); + + assertEquals(3, message.getInt32ToBytesField().size()); + assertEquals(TestUtil.toBytes("11"), message.getInt32ToBytesField().get(1)); + assertEquals(TestUtil.toBytes("22"), message.getInt32ToBytesField().get(2)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesField().get(3)); + + assertEquals(3, message.getInt32ToEnumField().size()); + assertEquals(TestMap.EnumValue.FOO, message.getInt32ToEnumField().get(1)); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumField().get(2)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumField().get(3)); + + assertEquals(3, message.getInt32ToMessageField().size()); + assertEquals(11, message.getInt32ToMessageField().get(1).getValue()); + assertEquals(22, message.getInt32ToMessageField().get(2).getValue()); + assertEquals(33, message.getInt32ToMessageField().get(3).getValue()); + + assertEquals(3, message.getStringToInt32Field().size()); + assertEquals(11, message.getStringToInt32Field().get("1").intValue()); + assertEquals(22, message.getStringToInt32Field().get("2").intValue()); + assertEquals(33, message.getStringToInt32Field().get("3").intValue()); } private void updateMapValuesUsingMutableMap(TestMap.Builder builder) { builder.getMutableInt32ToInt32Field().put(1, 111); builder.getMutableInt32ToInt32Field().remove(2); builder.getMutableInt32ToInt32Field().put(4, 44); - + // builder.getMutableInt32ToStringField().put(1, "111"); builder.getMutableInt32ToStringField().remove(2); builder.getMutableInt32ToStringField().put(4, "44"); - + // builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("111")); builder.getMutableInt32ToBytesField().remove(2); builder.getMutableInt32ToBytesField().put(4, TestUtil.toBytes("44")); - + // builder.getMutableInt32ToEnumField().put(1, TestMap.EnumValue.BAR); builder.getMutableInt32ToEnumField().remove(2); builder.getMutableInt32ToEnumField().put(4, TestMap.EnumValue.QUX); - + // builder.getMutableInt32ToMessageField().put( 1, MessageValue.newBuilder().setValue(111).build()); builder.getMutableInt32ToMessageField().remove(2); builder.getMutableInt32ToMessageField().put( 4, MessageValue.newBuilder().setValue(44).build()); - + // builder.getMutableStringToInt32Field().put("1", 111); builder.getMutableStringToInt32Field().remove("2"); builder.getMutableStringToInt32Field().put("4", 44); @@ -198,7 +209,6 @@ public class MapForProto2Test { .putStringToInt32Field("4", 44); } - @Test public void testUpdateMapValues() { TestMap.Builder usingMutableMapBuilder = TestMap.newBuilder(); setMapValuesUsingMutableMap(usingMutableMapBuilder); @@ -210,8 +220,8 @@ public class MapForProto2Test { TestMap usingAccessors = usingAccessorsBuilder.build(); assertMapValuesSet(usingAccessors); - assertThat(usingAccessors).isEqualTo(usingMutableMap); - + assertEquals(usingAccessors, usingMutableMap); + // usingMutableMapBuilder = usingMutableMap.toBuilder(); updateMapValuesUsingMutableMap(usingMutableMapBuilder); usingMutableMap = usingMutableMapBuilder.build(); @@ -222,57 +232,56 @@ public class MapForProto2Test { usingAccessors = usingAccessorsBuilder.build(); assertMapValuesUpdated(usingAccessors); - assertThat(usingAccessors).isEqualTo(usingMutableMap); + assertEquals(usingAccessors, usingMutableMap); } private void assertMapValuesUpdated(TestMap message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(111); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); - assertThat(message.getInt32ToInt32FieldMap().get(4).intValue()).isEqualTo(44); - - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "111"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(4, "44"); - - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("111")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(4, TestUtil.toBytes("44")); - - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(4, TestMap.EnumValue.QUX); - - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(111); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); - assertThat(message.getInt32ToMessageFieldMap().get(4).getValue()).isEqualTo(44); - - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(111); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); - assertThat(message.getStringToInt32FieldMap().get("4").intValue()).isEqualTo(44); + assertEquals(3, message.getInt32ToInt32FieldMap().size()); + assertEquals(111, message.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(3).intValue()); + assertEquals(44, message.getInt32ToInt32FieldMap().get(4).intValue()); + + assertEquals(3, message.getInt32ToStringFieldMap().size()); + assertEquals("111", message.getInt32ToStringFieldMap().get(1)); + assertEquals("33", message.getInt32ToStringFieldMap().get(3)); + assertEquals("44", message.getInt32ToStringFieldMap().get(4)); + + assertEquals(3, message.getInt32ToBytesFieldMap().size()); + assertEquals(TestUtil.toBytes("111"), message.getInt32ToBytesFieldMap().get(1)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesFieldMap().get(3)); + assertEquals(TestUtil.toBytes("44"), message.getInt32ToBytesFieldMap().get(4)); + + assertEquals(3, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumFieldMap().get(3)); + assertEquals(TestMap.EnumValue.QUX, message.getInt32ToEnumFieldMap().get(4)); + + assertEquals(3, message.getInt32ToMessageFieldMap().size()); + assertEquals(111, message.getInt32ToMessageFieldMap().get(1).getValue()); + assertEquals(33, message.getInt32ToMessageFieldMap().get(3).getValue()); + assertEquals(44, message.getInt32ToMessageFieldMap().get(4).getValue()); + + assertEquals(3, message.getStringToInt32FieldMap().size()); + assertEquals(111, message.getStringToInt32FieldMap().get("1").intValue()); + assertEquals(33, message.getStringToInt32FieldMap().get("3").intValue()); + assertEquals(44, message.getStringToInt32FieldMap().get("4").intValue()); } private void assertMapValuesCleared(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToStringFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToBytesFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToEnumFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToMessageFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getStringToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(0); + assertEquals(0, testMapOrBuilder.getInt32ToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToStringField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(0, testMapOrBuilder.getStringToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getStringToInt32FieldCount()); } - @Test public void testGetMapIsImmutable() { TestMap.Builder builder = TestMap.newBuilder(); assertMapsAreImmutable(builder); @@ -284,136 +293,140 @@ public class MapForProto2Test { } private void assertMapsAreImmutable(TestMapOrBuilder testMapOrBuilder) { - assertImmutable(testMapOrBuilder.getInt32ToInt32FieldMap(), 1, 2); - assertImmutable(testMapOrBuilder.getInt32ToStringFieldMap(), 1, "2"); - assertImmutable(testMapOrBuilder.getInt32ToBytesFieldMap(), 1, TestUtil.toBytes("2")); - assertImmutable(testMapOrBuilder.getInt32ToEnumFieldMap(), 1, TestMap.EnumValue.FOO); + assertImmutable(testMapOrBuilder.getInt32ToInt32Field(), 1, 2); + assertImmutable(testMapOrBuilder.getInt32ToStringField(), 1, "2"); + assertImmutable(testMapOrBuilder.getInt32ToBytesField(), 1, TestUtil.toBytes("2")); + assertImmutable(testMapOrBuilder.getInt32ToEnumField(), 1, TestMap.EnumValue.FOO); assertImmutable( - testMapOrBuilder.getInt32ToMessageFieldMap(), 1, MessageValue.getDefaultInstance()); - assertImmutable(testMapOrBuilder.getStringToInt32FieldMap(), "1", 2); + testMapOrBuilder.getInt32ToMessageField(), 1, MessageValue.getDefaultInstance()); + assertImmutable(testMapOrBuilder.getStringToInt32Field(), "1", 2); } private void assertImmutable(Map map, K key, V value) { try { map.put(key, value); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } - @Test public void testMutableMapLifecycle() { TestMap.Builder builder = TestMap.newBuilder(); Map intMap = builder.getMutableInt32ToInt32Field(); intMap.put(1, 2); - assertThat(builder.build().getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32Field()); try { intMap.put(2, 3); - assertWithMessage("expected exception intMap").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(builder.getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.getInt32ToInt32Field()); builder.getMutableInt32ToInt32Field().put(2, 3); - assertThat(builder.getInt32ToInt32Field()).isEqualTo(newMap(1, 2, 2, 3)); - + assertEquals(newMap(1, 2, 2, 3), builder.getInt32ToInt32Field()); + // Map enumMap = builder.getMutableInt32ToEnumField(); enumMap.put(1, TestMap.EnumValue.BAR); - assertThat(builder.build().getInt32ToEnumField()) - .isEqualTo(newMap(1, TestMap.EnumValue.BAR)); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.build().getInt32ToEnumField()); try { enumMap.put(2, TestMap.EnumValue.FOO); - assertWithMessage("expected exception enumMap").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(builder.getInt32ToEnumField()).isEqualTo(newMap(1, TestMap.EnumValue.BAR)); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.getInt32ToEnumField()); builder.getMutableInt32ToEnumField().put(2, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumField()) - .isEqualTo(newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO)); - + assertEquals( + newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO), + builder.getInt32ToEnumField()); + // Map stringMap = builder.getMutableInt32ToStringField(); stringMap.put(1, "1"); - assertThat(builder.build().getInt32ToStringField()).isEqualTo(newMap(1, "1")); + assertEquals(newMap(1, "1"), builder.build().getInt32ToStringField()); try { stringMap.put(2, "2"); - assertWithMessage("expected exception stringMap").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(builder.getInt32ToStringField()).isEqualTo(newMap(1, "1")); + assertEquals(newMap(1, "1"), builder.getInt32ToStringField()); builder.getMutableInt32ToStringField().put(2, "2"); - assertThat(builder.getInt32ToStringField()).isEqualTo(newMap(1, "1", 2, "2")); - - // Message maps are handled differently, and don't freeze old mutable collections. + assertEquals( + newMap(1, "1", 2, "2"), + builder.getInt32ToStringField()); + // Map messageMap = builder.getMutableInt32ToMessageField(); messageMap.put(1, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.build().getInt32ToMessageField()) - .isEqualTo(newMap(1, TestMap.MessageValue.getDefaultInstance())); - // Mutations on old mutable maps don't affect the builder state. - messageMap.put(2, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.getInt32ToMessageField()).isEqualTo( - newMap(1, TestMap.MessageValue.getDefaultInstance())); - builder.putInt32ToMessageField(2, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.getInt32ToMessageField()).isEqualTo( + assertEquals(newMap(1, TestMap.MessageValue.getDefaultInstance()), + builder.build().getInt32ToMessageField()); + try { + messageMap.put(2, TestMap.MessageValue.getDefaultInstance()); + fail(); + } catch (UnsupportedOperationException e) { + // expected + } + assertEquals(newMap(1, TestMap.MessageValue.getDefaultInstance()), + builder.getInt32ToMessageField()); + builder.getMutableInt32ToMessageField().put(2, TestMap.MessageValue.getDefaultInstance()); + assertEquals( newMap(1, TestMap.MessageValue.getDefaultInstance(), - 2, TestMap.MessageValue.getDefaultInstance())); + 2, TestMap.MessageValue.getDefaultInstance()), + builder.getInt32ToMessageField()); } - - @Test + // public void testMutableMapLifecycle_collections() { TestMap.Builder builder = TestMap.newBuilder(); Map intMap = builder.getMutableInt32ToInt32Field(); intMap.put(1, 2); - assertThat(builder.build().getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32Field()); try { intMap.remove(2); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.entrySet().remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.entrySet().iterator().remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.keySet().remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.values().remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.values().iterator().remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(intMap).isEqualTo(newMap(1, 2)); - assertThat(builder.getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); - assertThat(builder.build().getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), intMap); + assertEquals(newMap(1, 2), builder.getInt32ToInt32Field()); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32Field()); } - + // private static Map newMap(K key1, V value1) { Map map = new HashMap(); map.put(key1, value1); return map; } - + // private static Map newMap(K key1, V value1, K key2, V value2) { Map map = new HashMap(); map.put(key1, value1); @@ -421,7 +434,6 @@ public class MapForProto2Test { return map; } - @Test public void testGettersAndSetters() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); TestMap message = builder.build(); @@ -444,7 +456,6 @@ public class MapForProto2Test { assertMapValuesCleared(message); } - @Test public void testPutAll() throws Exception { TestMap.Builder sourceBuilder = TestMap.newBuilder(); setMapValuesUsingAccessors(sourceBuilder); @@ -455,74 +466,68 @@ public class MapForProto2Test { copyMapValues(source, destination); assertMapValuesSet(destination.build()); - assertThat(destination.getInt32ToEnumFieldCount()).isEqualTo(3); + assertEquals(3, destination.getInt32ToEnumFieldCount()); } - @Test - public void testPutChecksNullValues() throws Exception { + public void testPutChecksNullKeysAndValues() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); try { - builder.putInt32ToBytesField(1, null); - assertWithMessage("expected exception").fail(); + builder.putInt32ToStringField(1, null); + fail(); } catch (NullPointerException e) { // expected. } try { - builder.putInt32ToEnumField(1, null); - assertWithMessage("expected exception").fail(); + builder.putInt32ToBytesField(1, null); + fail(); } catch (NullPointerException e) { // expected. } try { - builder.putInt32ToMessageField(1, null); - assertWithMessage("expected exception").fail(); + builder.putInt32ToEnumField(1, null); + fail(); } catch (NullPointerException e) { // expected. } try { - builder.putStringToInt32Field(null, 1); - assertWithMessage("expected exception").fail(); + builder.putInt32ToMessageField(1, null); + fail(); } catch (NullPointerException e) { // expected. } - } - - @Test - public void testPutChecksNullKey() throws Exception { - TestMap.Builder builder = TestMap.newBuilder(); try { builder.putStringToInt32Field(null, 1); - assertWithMessage("expected exception").fail(); - } catch (NullPointerException expected) { + fail(); + } catch (NullPointerException e) { + // expected. } } - @Test public void testSerializeAndParse() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); TestMap message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesSet(message); builder = message.toBuilder(); updateMapValuesUsingAccessors(builder); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesUpdated(message); builder = message.toBuilder(); builder.clear(); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesCleared(message); } @@ -531,44 +536,42 @@ public class MapForProto2Test { CodedOutputStream output = CodedOutputStream.newInstance(byteArrayOutputStream); bizarroMap.writeTo(output); output.flush(); - return TestMap.parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); + return TestMap.parser().parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); } - @Test public void testParseError() throws Exception { ByteString bytes = TestUtil.toBytes("SOME BYTES"); String stringKey = "a string key"; TestMap map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToInt32Field(5, bytes).build()); - assertThat(map.getInt32ToInt32FieldOrDefault(5, -1)).isEqualTo(0); + assertEquals(0, map.getInt32ToInt32FieldOrDefault(5, -1)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToStringField(stringKey, 5).build()); - assertThat(map.getInt32ToStringFieldOrDefault(0, null)).isEmpty(); + assertEquals("", map.getInt32ToStringFieldOrDefault(0, null)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToBytesField(stringKey, 5).build()); - assertThat(ByteString.EMPTY).isEqualTo(map.getInt32ToBytesFieldOrDefault(0, null)); + assertEquals(map.getInt32ToBytesFieldOrDefault(0, null), ByteString.EMPTY); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToEnumField(stringKey, bytes).build()); - assertThat(map.getInt32ToEnumFieldOrDefault(0, null)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, map.getInt32ToEnumFieldOrDefault(0, null)); try { tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToMessageField(stringKey, bytes).build()); - assertWithMessage("expected exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { - assertThat(expected.getUnfinishedMessage()).isInstanceOf(TestMap.class); + assertTrue(expected.getUnfinishedMessage() instanceof TestMap); map = (TestMap) expected.getUnfinishedMessage(); - assertThat(map.getInt32ToMessageFieldMap()).isEmpty(); + assertTrue(map.getInt32ToMessageFieldMap().isEmpty()); } map = tryParseTestMap( BizarroTestMap.newBuilder().putStringToInt32Field(stringKey, bytes).build()); - assertThat(map.getStringToInt32FieldOrDefault(stringKey, -1)).isEqualTo(0); + assertEquals(0, map.getStringToInt32FieldOrDefault(stringKey, -1)); } - @Test public void testMergeFrom() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -579,7 +582,6 @@ public class MapForProto2Test { assertMapValuesSet(other.build()); } - @Test public void testEqualsAndHashCode() throws Exception { // Test that generated equals() and hashCode() will disregard the order // of map entries when comparing/hashing map fields. @@ -598,17 +600,18 @@ public class MapForProto2Test { b2.putInt32ToInt32Field(3, 4); TestMap m2 = b2.build(); - assertThat(m2).isEqualTo(m1); - assertThat(m2.hashCode()).isEqualTo(m1.hashCode()); + assertEquals(m1, m2); + assertEquals(m1.hashCode(), m2.hashCode()); // Make sure we did compare map fields. b2.putInt32ToInt32Field(1, 0); m2 = b2.build(); - assertThat(m1.equals(m2)).isFalse(); + assertFalse(m1.equals(m2)); // Don't check m1.hashCode() != m2.hashCode() because it's not guaranteed // to be different. } + // The following methods are used to test reflection API. private static FieldDescriptor f(String name) { @@ -633,16 +636,16 @@ public class MapForProto2Test { Message mapEntry = (Message) entry; Object key = getFieldValue(mapEntry, "key"); Object value = getFieldValue(mapEntry, "value"); - assertThat(values.containsKey(key)).isTrue(); - assertThat(values.get(key)).isEqualTo(value); + assertTrue(values.containsKey(key)); + assertEquals(value, values.get(key)); } - assertThat(message.getRepeatedFieldCount(field)).isEqualTo(values.size()); + assertEquals(values.size(), message.getRepeatedFieldCount(field)); for (int i = 0; i < message.getRepeatedFieldCount(field); i++) { Message mapEntry = (Message) message.getRepeatedField(field, i); Object key = getFieldValue(mapEntry, "key"); Object value = getFieldValue(mapEntry, "value"); - assertThat(values.containsKey(key)).isTrue(); - assertThat(values.get(key)).isEqualTo(value); + assertTrue(values.containsKey(key)); + assertEquals(value, values.get(key)); } } @@ -657,7 +660,7 @@ public class MapForProto2Test { } private static void setMapValues(Message.Builder builder, String name, Map values) { - List entryList = new ArrayList<>(); + List entryList = new ArrayList(); for (Map.Entry entry : values.entrySet()) { entryList.add(newMapEntry(builder, name, entry.getKey(), entry.getValue())); } @@ -666,13 +669,12 @@ public class MapForProto2Test { } private static Map mapForValues(K key1, V value1, K key2, V value2) { - Map map = new HashMap<>(); + Map map = new HashMap(); map.put(key1, value1); map.put(key2, value2); return map; } - @Test public void testReflectionApi() throws Exception { // In reflection API, map fields are just repeated message fields. TestMap.Builder builder = @@ -696,8 +698,8 @@ public class MapForProto2Test { builder.clearField(f("int32_to_int32_field")); builder.clearField(f("int32_to_message_field")); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap()).isEmpty(); - assertThat(message.getInt32ToMessageFieldMap()).isEmpty(); + assertEquals(0, message.getInt32ToInt32FieldMap().size()); + assertEquals(0, message.getInt32ToMessageFieldMap().size()); // Test setField() setMapValues(builder, "int32_to_int32_field", mapForValues(11, 22, 33, 44)); @@ -708,10 +710,10 @@ public class MapForProto2Test { 111, MessageValue.newBuilder().setValue(222).build(), 333, MessageValue.newBuilder().setValue(444).build())); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(11).intValue()).isEqualTo(22); - assertThat(message.getInt32ToInt32FieldMap().get(33).intValue()).isEqualTo(44); - assertThat(message.getInt32ToMessageFieldMap().get(111).getValue()).isEqualTo(222); - assertThat(message.getInt32ToMessageFieldMap().get(333).getValue()).isEqualTo(444); + assertEquals(22, message.getInt32ToInt32FieldMap().get(11).intValue()); + assertEquals(44, message.getInt32ToInt32FieldMap().get(33).intValue()); + assertEquals(222, message.getInt32ToMessageFieldMap().get(111).getValue()); + assertEquals(444, message.getInt32ToMessageFieldMap().get(333).getValue()); // Test addRepeatedField builder.addRepeatedField( @@ -724,8 +726,8 @@ public class MapForProto2Test { 555, MessageValue.newBuilder().setValue(666).build())); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(55).intValue()).isEqualTo(66); - assertThat(message.getInt32ToMessageFieldMap().get(555).getValue()).isEqualTo(666); + assertEquals(66, message.getInt32ToInt32FieldMap().get(55).intValue()); + assertEquals(666, message.getInt32ToMessageFieldMap().get(555).getValue()); // Test addRepeatedField (overriding existing values) builder.addRepeatedField( @@ -738,8 +740,8 @@ public class MapForProto2Test { 555, MessageValue.newBuilder().setValue(555).build())); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(55).intValue()).isEqualTo(55); - assertThat(message.getInt32ToMessageFieldMap().get(555).getValue()).isEqualTo(555); + assertEquals(55, message.getInt32ToInt32FieldMap().get(55).intValue()); + assertEquals(555, message.getInt32ToMessageFieldMap().get(555).getValue()); // Test setRepeatedField for (int i = 0; i < builder.getRepeatedFieldCount(f("int32_to_int32_field")); i++) { @@ -753,13 +755,12 @@ public class MapForProto2Test { builder.setRepeatedField(f("int32_to_int32_field"), i, mapEntryBuilder.build()); } message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(22).intValue()).isEqualTo(11); - assertThat(message.getInt32ToInt32FieldMap().get(44).intValue()).isEqualTo(33); - assertThat(message.getInt32ToInt32FieldMap().get(55).intValue()).isEqualTo(55); + assertEquals(11, message.getInt32ToInt32FieldMap().get(22).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(44).intValue()); + assertEquals(55, message.getInt32ToInt32FieldMap().get(55).intValue()); } // See additional coverage in TextFormatTest.java. - @Test public void testTextFormat() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -774,7 +775,6 @@ public class MapForProto2Test { assertMapValuesSet(message); } - @Test public void testDynamicMessage() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -782,18 +782,14 @@ public class MapForProto2Test { Message dynamicDefaultInstance = DynamicMessage.getDefaultInstance(TestMap.getDescriptor()); Message dynamicMessage = - dynamicDefaultInstance - .newBuilderForType() - .mergeFrom(message.toByteString(), ExtensionRegistry.getEmptyRegistry()) - .build(); + dynamicDefaultInstance.newBuilderForType().mergeFrom(message.toByteString()).build(); - assertThat(dynamicMessage).isEqualTo(message); - assertThat(dynamicMessage.hashCode()).isEqualTo(message.hashCode()); + assertEquals(message, dynamicMessage); + assertEquals(message.hashCode(), dynamicMessage.hashCode()); } // Check that DynamicMessage handles map field serialization the same way as generated code // regarding unset key and value field in a map entry. - @Test public void testDynamicMessageUnsetKeyAndValue() throws Exception { FieldDescriptor field = f("int32_to_int32_field"); @@ -804,12 +800,11 @@ public class MapForProto2Test { Message message = builder.build(); ByteString bytes = message.toByteString(); // Parse it back to the same generated type. - Message generatedMessage = TestMap.parseFrom(bytes, ExtensionRegistry.getEmptyRegistry()); + Message generatedMessage = TestMap.parseFrom(bytes); // Assert the serialized bytes are equivalent. - assertThat(bytes).isEqualTo(generatedMessage.toByteString()); + assertEquals(generatedMessage.toByteString(), bytes); } - @Test public void testReflectionEqualsAndHashCode() throws Exception { // Test that generated equals() and hashCode() will disregard the order // of map entries when comparing/hashing map fields. @@ -830,80 +825,69 @@ public class MapForProto2Test { b2.addRepeatedField(field, newMapEntry(b2, "int32_to_int32_field", 3, 4)); Message m2 = b2.build(); - assertThat(m2).isEqualTo(m1); - assertThat(m2.hashCode()).isEqualTo(m1.hashCode()); + assertEquals(m1, m2); + assertEquals(m1.hashCode(), m2.hashCode()); // Make sure we did compare map fields. b2.setRepeatedField(field, 0, newMapEntry(b1, "int32_to_int32_field", 0, 0)); m2 = b2.build(); - assertThat(m1.equals(m2)).isFalse(); + assertFalse(m1.equals(m2)); // Don't check m1.hashCode() != m2.hashCode() because it's not guaranteed // to be different. } - @Test public void testUnknownEnumValues() throws Exception { - TestUnknownEnumValue builder = - TestUnknownEnumValue.newBuilder() - .putInt32ToInt32Field(1, 1) - .putInt32ToInt32Field(2, 54321) - .build(); - ByteString data = builder.toByteString(); - - TestMap message = TestMap.parseFrom(data, ExtensionRegistry.getEmptyRegistry()); + TestUnknownEnumValue.Builder builder = + TestUnknownEnumValue.newBuilder().putInt32ToInt32Field(1, 1).putInt32ToInt32Field(2, 54321); + ByteString data = builder.build().toByteString(); + + TestMap message = TestMap.parseFrom(data); // Entries with unknown enum values will be stored into UnknownFieldSet so // there is only one entry in the map. - assertThat(message.getInt32ToEnumFieldMap()).hasSize(1); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); + assertEquals(1, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); // UnknownFieldSet should not be empty. - assertThat(message.getUnknownFields().asMap()).isNotEmpty(); + assertFalse(message.getUnknownFields().asMap().isEmpty()); // Serializing and parsing should preserve the unknown entry. data = message.toByteString(); - TestUnknownEnumValue messageWithUnknownEnums = - TestUnknownEnumValue.parseFrom(data, ExtensionRegistry.getEmptyRegistry()); - assertThat(messageWithUnknownEnums.getInt32ToInt32FieldMap()).hasSize(2); - assertThat(messageWithUnknownEnums.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(1); - assertThat(messageWithUnknownEnums.getInt32ToInt32FieldMap().get(2).intValue()) - .isEqualTo(54321); + TestUnknownEnumValue messageWithUnknownEnums = TestUnknownEnumValue.parseFrom(data); + assertEquals(2, messageWithUnknownEnums.getInt32ToInt32FieldMap().size()); + assertEquals(1, messageWithUnknownEnums.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(54321, messageWithUnknownEnums.getInt32ToInt32FieldMap().get(2).intValue()); } - @Test public void testRequiredMessage() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); builder.putRequiredMessageMap(0, MessageWithRequiredFields.newBuilder().buildPartial()); TestMap message = builder.buildPartial(); - assertThat(message.isInitialized()).isFalse(); + assertFalse(message.isInitialized()); builder.putRequiredMessageMap(0, MessageWithRequiredFields.newBuilder().setValue(1).build()); message = builder.build(); - assertThat(message.isInitialized()).isTrue(); + assertTrue(message.isInitialized()); } - @Test public void testRecursiveMap() throws Exception { TestRecursiveMap.Builder builder = TestRecursiveMap.newBuilder(); builder.putRecursiveMapField(1, TestRecursiveMap.newBuilder().setValue(2).build()); builder.putRecursiveMapField(3, TestRecursiveMap.newBuilder().setValue(4).build()); ByteString data = builder.build().toByteString(); - TestRecursiveMap message = - TestRecursiveMap.parseFrom(data, ExtensionRegistry.getEmptyRegistry()); - assertThat(message.getRecursiveMapFieldMap().get(1).getValue()).isEqualTo(2); - assertThat(message.getRecursiveMapFieldMap().get(3).getValue()).isEqualTo(4); + TestRecursiveMap message = TestRecursiveMap.parseFrom(data); + assertEquals(2, message.getRecursiveMapField().get(1).getValue()); + assertEquals(4, message.getRecursiveMapField().get(3).getValue()); } - @Test public void testIterationOrder() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); TestMap message = builder.build(); - assertThat(new ArrayList(message.getStringToInt32FieldMap().keySet())) - .containsExactly("1", "2", "3") - .inOrder(); + assertEquals( + Arrays.asList("1", "2", "3"), + new ArrayList(message.getStringToInt32FieldMap().keySet())); } - @Test public void testContains() { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -912,38 +896,37 @@ public class MapForProto2Test { } private void assertMapContainsSetValues(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.containsInt32ToInt32Field(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToStringField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToBytesField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToEnumField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToMessageField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsStringToInt32Field("1")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("2")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("3")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("-1")).isFalse(); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(1)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(2)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(3)); + assertFalse(testMapOrBuilder.containsInt32ToInt32Field(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToStringField(1)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(2)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(3)); + assertFalse(testMapOrBuilder.containsInt32ToStringField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToBytesField(1)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(2)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(3)); + assertFalse(testMapOrBuilder.containsInt32ToBytesField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToEnumField(1)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(2)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(3)); + assertFalse(testMapOrBuilder.containsInt32ToEnumField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToMessageField(1)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(2)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(3)); + assertFalse(testMapOrBuilder.containsInt32ToMessageField(-1)); + + assertTrue(testMapOrBuilder.containsStringToInt32Field("1")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("2")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("3")); + assertFalse(testMapOrBuilder.containsStringToInt32Field("-1")); } - @Test public void testCount() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -955,24 +938,23 @@ public class MapForProto2Test { assertMapCounts(3, message); builder = message.toBuilder().putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); - assertThat(builder.build().getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); + assertEquals(4, builder.build().getInt32ToInt32FieldCount()); // already present - should be unchanged builder.putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); } private void assertMapCounts(int expectedCount, TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(expectedCount); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getStringToInt32FieldCount()); } - @Test public void testGetOrDefault() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -982,38 +964,34 @@ public class MapForProto2Test { } public void doTestGetOrDefault(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)); + assertEquals(-11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)); - assertThat(testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")).isEqualTo("11"); - assertWithMessage("-11") - .that(testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)) - .isNull(); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")); + assertNull("-11", testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)) - .isEqualTo(TestUtil.toBytes("11")); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)).isNull(); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)) - .isEqualTo(TestMap.EnumValue.FOO); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)).isNull(); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)).isNull(); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)); + assertEquals(-11, testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)); try { testMapOrBuilder.getStringToInt32FieldOrDefault(null, -11); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testGetOrThrow() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -1023,100 +1001,100 @@ public class MapForProto2Test { } public void doTestGetOrThrow(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)); try { testMapOrBuilder.getInt32ToInt32FieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToStringFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToBytesFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToEnumFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToMessageFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrThrow("1")); try { testMapOrBuilder.getStringToInt32FieldOrThrow("-1"); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } try { testMapOrBuilder.getStringToInt32FieldOrThrow(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testPut() { TestMap.Builder builder = TestMap.newBuilder(); builder.putInt32ToInt32Field(1, 11); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); builder.putInt32ToStringField(1, "a"); - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("a"); + assertEquals("a", builder.getInt32ToStringFieldOrThrow(1)); try { builder.putInt32ToStringField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToBytesField(1, TestUtil.toBytes("11")); - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); try { builder.putInt32ToBytesField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToEnumField(1, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); try { builder.putInt32ToEnumField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putStringToInt32Field("a", 1); - assertThat(builder.getStringToInt32FieldOrThrow("a")).isEqualTo(1); + assertEquals(1, builder.getStringToInt32FieldOrThrow("a")); try { builder.putStringToInt32Field(null, -1); } catch (NullPointerException e) { @@ -1124,129 +1102,79 @@ public class MapForProto2Test { } } - @Test public void testRemove() { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToInt32Field(1); - assertThat(builder.getInt32ToInt32FieldOrDefault(1, -1)).isEqualTo(-1); + assertEquals(-1, builder.getInt32ToInt32FieldOrDefault(1, -1)); } - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", builder.getInt32ToStringFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToStringField(1); - assertThat(builder.getInt32ToStringFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToStringFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToBytesField(1); - assertThat(builder.getInt32ToBytesFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToBytesFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToEnumField(1); - assertThat(builder.getInt32ToEnumFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToEnumFieldOrDefault(1, null)); } - assertThat(builder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, builder.getStringToInt32FieldOrThrow("1")); for (int times = 0; times < 2; times++) { builder.removeStringToInt32Field("1"); - assertThat(builder.getStringToInt32FieldOrDefault("1", -1)).isEqualTo(-1); + assertEquals(-1, builder.getStringToInt32FieldOrDefault("1", -1)); } try { builder.removeStringToInt32Field(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } // Regression test for b/20494788 - @Test public void testMapInitializationOrder() throws Exception { - assertThat(RedactAllTypes.getDefaultInstance().getDescriptorForType().getName()) - .isEqualTo("RedactAllTypes"); - - Message1.Builder builder = Message1.newBuilder(); + assertEquals( + "RedactAllTypes", + map_test.RedactAllTypes.getDefaultInstance() + .getDescriptorForType() + .getName()); + + map_test.Message1.Builder builder = + map_test.Message1.newBuilder(); builder.putMapField("key", true); - Message1 message = builder.build(); + map_test.Message1 message = builder.build(); Message mapEntry = (Message) message.getRepeatedField( message.getDescriptorForType().findFieldByName("map_field"), 0); - assertThat(mapEntry.getAllFields()).hasSize(2); + assertEquals(2, mapEntry.getAllFields().size()); } - @Test public void testReservedWordsFieldNames() { - ReservedAsMapField unused1 = ReservedAsMapField.getDefaultInstance(); - ReservedAsMapFieldWithEnumValue unused2 = ReservedAsMapFieldWithEnumValue.getDefaultInstance(); + ReservedAsMapField.newBuilder().build(); + ReservedAsMapFieldWithEnumValue.newBuilder().build(); } - @Test public void testGetMap() { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); assertMapValuesSet(builder); TestMap message = builder.build(); - assertThat(message.getStringToInt32FieldMap()).isEqualTo(message.getStringToInt32FieldMap()); - assertThat(message.getInt32ToBytesFieldMap()).isEqualTo(message.getInt32ToBytesFieldMap()); - assertThat(message.getInt32ToEnumFieldMap()).isEqualTo(message.getInt32ToEnumFieldMap()); - assertThat(message.getInt32ToMessageFieldMap()).isEqualTo(message.getInt32ToMessageFieldMap()); - } - - @Test - public void testPutAllWithNullStringValue() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - // order preserving map used here to help test rollback - Map data = new TreeMap<>(); - data.put(7, "foo"); - data.put(8, "bar"); - data.put(9, null); - try { - sourceBuilder.putAllInt32ToStringField(data); - fail("allowed null string value"); - } catch (NullPointerException expected) { - // Verify rollback of previously added values. - // They all go in or none do. - assertThat(sourceBuilder.getInt32ToStringFieldMap()).isEmpty(); - } - } - - @Test - public void testPutAllWithNullStringKey() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - // order preserving map used here to help test rollback - Map data = new LinkedHashMap<>(); - data.put(7, "foo"); - data.put(null, "bar"); - data.put(9, "baz"); - try { - sourceBuilder.putAllInt32ToStringField(data); - fail("allowed null string key"); - } catch (NullPointerException expected) { - // Verify rollback of previously added values. - // They all go in or none do. - assertThat(sourceBuilder.getInt32ToStringFieldMap()).isEmpty(); - } - } - - @Test - public void testPutNullStringValue() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - try { - sourceBuilder.putInt32ToStringField(8, null); - fail("allowed null string value"); - } catch (NullPointerException expected) { - assertNotNull(expected.getMessage()); - } + assertEquals(message.getStringToInt32FieldMap(), message.getStringToInt32FieldMap()); + assertEquals(message.getInt32ToBytesFieldMap(), message.getInt32ToBytesFieldMap()); + assertEquals(message.getInt32ToEnumFieldMap(), message.getInt32ToEnumFieldMap()); + assertEquals(message.getInt32ToMessageFieldMap(), message.getInt32ToMessageFieldMap()); } } diff --git a/java/core/src/test/java/com/google/protobuf/MapLiteTest.java b/java/core/src/test/java/com/google/protobuf/MapLiteTest.java index 58f73ec35e7f677e318578f3025d0f8790c3794a..40bb7893b313f55e707ce0c7851e3da210068828 100644 --- a/java/core/src/test/java/com/google/protobuf/MapLiteTest.java +++ b/java/core/src/test/java/com/google/protobuf/MapLiteTest.java @@ -1,14 +1,36 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.assertArrayEquals; import map_lite_test.MapTestProto.BizarroTestMap; import map_lite_test.MapTestProto.TestMap; @@ -17,15 +39,13 @@ import map_lite_test.MapTestProto.TestMapOrBuilder; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Unit tests for map fields. */ -@RunWith(JUnit4.class) -public final class MapLiteTest { +public final class MapLiteTest extends TestCase { private void setMapValues(TestMap.Builder builder) { builder @@ -49,7 +69,6 @@ public final class MapLiteTest { .putStringToInt32Field("3", 33); } - @Test public void testSetMapValues() { TestMap.Builder usingMutableMapBuilder = TestMap.newBuilder(); setMapValues(usingMutableMapBuilder); @@ -60,7 +79,7 @@ public final class MapLiteTest { setMapValues(usingAccessorsBuilder); TestMap usingAccessors = usingAccessorsBuilder.build(); assertMapValuesSet(usingAccessors); - assertThat(usingMutableMap).isEqualTo(usingAccessors); + assertEquals(usingAccessors, usingMutableMap); } private void copyMapValues(TestMap source, TestMap.Builder destination) { @@ -74,35 +93,35 @@ public final class MapLiteTest { } private void assertMapValuesSet(TestMap message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(11); - assertThat(message.getInt32ToInt32FieldMap().get(2).intValue()).isEqualTo(22); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); + assertEquals(3, message.getInt32ToInt32FieldMap().size()); + assertEquals(11, message.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(22, message.getInt32ToInt32FieldMap().get(2).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(3).intValue()); - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "11"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(2, "22"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); + assertEquals(3, message.getInt32ToStringFieldMap().size()); + assertEquals("11", message.getInt32ToStringFieldMap().get(1)); + assertEquals("22", message.getInt32ToStringFieldMap().get(2)); + assertEquals("33", message.getInt32ToStringFieldMap().get(3)); - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("11")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(2, TestUtil.toBytes("22")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); + assertEquals(3, message.getInt32ToBytesFieldMap().size()); + assertEquals(TestUtil.toBytes("11"), message.getInt32ToBytesFieldMap().get(1)); + assertEquals(TestUtil.toBytes("22"), message.getInt32ToBytesFieldMap().get(2)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesFieldMap().get(3)); - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.FOO); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(2, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); + assertEquals(3, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.FOO, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(2)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumFieldMap().get(3)); - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(11); - assertThat(message.getInt32ToMessageFieldMap().get(2).getValue()).isEqualTo(22); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); + assertEquals(3, message.getInt32ToMessageFieldMap().size()); + assertEquals(11, message.getInt32ToMessageFieldMap().get(1).getValue()); + assertEquals(22, message.getInt32ToMessageFieldMap().get(2).getValue()); + assertEquals(33, message.getInt32ToMessageFieldMap().get(3).getValue()); - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(11); - assertThat(message.getStringToInt32FieldMap().get("2").intValue()).isEqualTo(22); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); + assertEquals(3, message.getStringToInt32FieldMap().size()); + assertEquals(11, message.getStringToInt32FieldMap().get("1").intValue()); + assertEquals(22, message.getStringToInt32FieldMap().get("2").intValue()); + assertEquals(33, message.getStringToInt32FieldMap().get("3").intValue()); } private void updateMapValues(TestMap.Builder builder) { @@ -127,7 +146,6 @@ public final class MapLiteTest { .putStringToInt32Field("4", 44); } - @Test public void testUpdateMapValues() { TestMap.Builder mapBuilder = TestMap.newBuilder(); setMapValues(mapBuilder); @@ -141,53 +159,52 @@ public final class MapLiteTest { } private void assertMapValuesUpdated(TestMap message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(111); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); - assertThat(message.getInt32ToInt32FieldMap().get(4).intValue()).isEqualTo(44); + assertEquals(3, message.getInt32ToInt32FieldMap().size()); + assertEquals(111, message.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(3).intValue()); + assertEquals(44, message.getInt32ToInt32FieldMap().get(4).intValue()); - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "111"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(4, "44"); + assertEquals(3, message.getInt32ToStringFieldMap().size()); + assertEquals("111", message.getInt32ToStringFieldMap().get(1)); + assertEquals("33", message.getInt32ToStringFieldMap().get(3)); + assertEquals("44", message.getInt32ToStringFieldMap().get(4)); - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("111")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(4, TestUtil.toBytes("44")); + assertEquals(3, message.getInt32ToBytesFieldMap().size()); + assertEquals(TestUtil.toBytes("111"), message.getInt32ToBytesFieldMap().get(1)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesFieldMap().get(3)); + assertEquals(TestUtil.toBytes("44"), message.getInt32ToBytesFieldMap().get(4)); - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(4, TestMap.EnumValue.QUX); + assertEquals(3, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumFieldMap().get(3)); + assertEquals(TestMap.EnumValue.QUX, message.getInt32ToEnumFieldMap().get(4)); - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(111); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); - assertThat(message.getInt32ToMessageFieldMap().get(4).getValue()).isEqualTo(44); + assertEquals(3, message.getInt32ToMessageFieldMap().size()); + assertEquals(111, message.getInt32ToMessageFieldMap().get(1).getValue()); + assertEquals(33, message.getInt32ToMessageFieldMap().get(3).getValue()); + assertEquals(44, message.getInt32ToMessageFieldMap().get(4).getValue()); - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(111); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); - assertThat(message.getStringToInt32FieldMap().get("4").intValue()).isEqualTo(44); + assertEquals(3, message.getStringToInt32FieldMap().size()); + assertEquals(111, message.getStringToInt32FieldMap().get("1").intValue()); + assertEquals(33, message.getStringToInt32FieldMap().get("3").intValue()); + assertEquals(44, message.getStringToInt32FieldMap().get("4").intValue()); } private void assertMapValuesCleared(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToStringFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToBytesFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToEnumFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToMessageFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getStringToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(0); - } - - @Test + assertEquals(0, testMapOrBuilder.getInt32ToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToStringField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(0, testMapOrBuilder.getStringToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getStringToInt32FieldCount()); + } + public void testSanityCopyOnWrite() throws InvalidProtocolBufferException { // Since builders are implemented as a thin wrapper around a message // instance, we attempt to verify that we can't cause the builder to modify @@ -196,15 +213,14 @@ public final class MapLiteTest { TestMap.Builder builder = TestMap.newBuilder(); TestMap message = builder.build(); builder.putInt32ToInt32Field(1, 2); - assertThat(message.getInt32ToInt32FieldMap()).isEmpty(); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); + assertTrue(message.getInt32ToInt32FieldMap().isEmpty()); + assertEquals(newMap(1, 2), builder.getInt32ToInt32FieldMap()); message = builder.build(); builder.putInt32ToInt32Field(2, 3); - assertThat(message.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2, 2, 3)); + assertEquals(newMap(1, 2), message.getInt32ToInt32FieldMap()); + assertEquals(newMap(1, 2, 2, 3), builder.getInt32ToInt32FieldMap()); } - @Test public void testGetMapIsImmutable() { TestMap.Builder builder = TestMap.newBuilder(); assertMapsAreImmutable(builder); @@ -216,77 +232,75 @@ public final class MapLiteTest { } private void assertMapsAreImmutable(TestMapOrBuilder testMapOrBuilder) { - assertImmutable(testMapOrBuilder.getInt32ToInt32FieldMap(), 1, 2); - assertImmutable(testMapOrBuilder.getInt32ToStringFieldMap(), 1, "2"); - assertImmutable(testMapOrBuilder.getInt32ToBytesFieldMap(), 1, TestUtil.toBytes("2")); - assertImmutable(testMapOrBuilder.getInt32ToEnumFieldMap(), 1, TestMap.EnumValue.FOO); + assertImmutable(testMapOrBuilder.getInt32ToInt32Field(), 1, 2); + assertImmutable(testMapOrBuilder.getInt32ToStringField(), 1, "2"); + assertImmutable(testMapOrBuilder.getInt32ToBytesField(), 1, TestUtil.toBytes("2")); + assertImmutable(testMapOrBuilder.getInt32ToEnumField(), 1, TestMap.EnumValue.FOO); assertImmutable( - testMapOrBuilder.getInt32ToMessageFieldMap(), 1, MessageValue.getDefaultInstance()); - assertImmutable(testMapOrBuilder.getStringToInt32FieldMap(), "1", 2); + testMapOrBuilder.getInt32ToMessageField(), 1, MessageValue.getDefaultInstance()); + assertImmutable(testMapOrBuilder.getStringToInt32Field(), "1", 2); } private void assertImmutable(Map map, K key, V value) { try { map.put(key, value); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } if (!map.isEmpty()) { try { map.entrySet().remove(map.entrySet().iterator().next()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } } - @Test public void testMapFieldClear() { TestMap.Builder builder = TestMap.newBuilder().putInt32ToInt32Field(1, 2); builder.clearInt32ToInt32Field(); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(0); + assertEquals(0, builder.getInt32ToInt32FieldCount()); } - @Test public void testMutableMapLifecycle() { TestMap.Builder builder = TestMap.newBuilder().putInt32ToInt32Field(1, 2); - assertThat(builder.build().getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32FieldMap()); + assertEquals(newMap(1, 2), builder.getInt32ToInt32FieldMap()); builder.putInt32ToInt32Field(2, 3); - assertThat(builder.getInt32ToInt32FieldMap()).isEqualTo(newMap(1, 2, 2, 3)); + assertEquals(newMap(1, 2, 2, 3), builder.getInt32ToInt32FieldMap()); builder.putInt32ToEnumField(1, TestMap.EnumValue.BAR); - assertThat(builder.build().getInt32ToEnumFieldMap()) - .isEqualTo(newMap(1, TestMap.EnumValue.BAR)); - assertThat(builder.getInt32ToEnumFieldMap()).isEqualTo(newMap(1, TestMap.EnumValue.BAR)); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.build().getInt32ToEnumFieldMap()); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.getInt32ToEnumFieldMap()); builder.putInt32ToEnumField(2, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumFieldMap()) - .isEqualTo(newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO)); + assertEquals( + newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO), + builder.getInt32ToEnumFieldMap()); builder.putInt32ToStringField(1, "1"); - assertThat(builder.build().getInt32ToStringFieldMap()).isEqualTo(newMap(1, "1")); - assertThat(builder.getInt32ToStringFieldMap()).isEqualTo(newMap(1, "1")); + assertEquals(newMap(1, "1"), builder.build().getInt32ToStringFieldMap()); + assertEquals(newMap(1, "1"), builder.getInt32ToStringFieldMap()); builder.putInt32ToStringField(2, "2"); - assertThat(builder.getInt32ToStringFieldMap()).isEqualTo(newMap(1, "1", 2, "2")); + assertEquals(newMap(1, "1", 2, "2"), builder.getInt32ToStringFieldMap()); builder.putInt32ToMessageField(1, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.build().getInt32ToMessageFieldMap()) - .isEqualTo(newMap(1, TestMap.MessageValue.getDefaultInstance())); - assertThat(builder.getInt32ToMessageFieldMap()) - .isEqualTo(newMap(1, TestMap.MessageValue.getDefaultInstance())); + assertEquals( + newMap(1, TestMap.MessageValue.getDefaultInstance()), + builder.build().getInt32ToMessageFieldMap()); + assertEquals( + newMap(1, TestMap.MessageValue.getDefaultInstance()), builder.getInt32ToMessageFieldMap()); builder.putInt32ToMessageField(2, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.getInt32ToMessageFieldMap()) - .isEqualTo( - newMap( - 1, - TestMap.MessageValue.getDefaultInstance(), - 2, - TestMap.MessageValue.getDefaultInstance())); + assertEquals( + newMap( + 1, + TestMap.MessageValue.getDefaultInstance(), + 2, + TestMap.MessageValue.getDefaultInstance()), + builder.getInt32ToMessageFieldMap()); } - @Test public void testGettersAndSetters() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); TestMap message = builder.build(); @@ -309,7 +323,6 @@ public final class MapLiteTest { assertMapValuesCleared(message); } - @Test public void testPutAll() throws Exception { TestMap.Builder sourceBuilder = TestMap.newBuilder(); setMapValues(sourceBuilder); @@ -321,7 +334,6 @@ public final class MapLiteTest { assertMapValuesSet(destination.build()); } - @Test public void testPutAllForUnknownEnumValues() throws Exception { TestMap.Builder sourceBuilder = TestMap.newBuilder() @@ -334,89 +346,85 @@ public final class MapLiteTest { destinationBuilder.putAllInt32ToEnumFieldValue(source.getInt32ToEnumFieldValueMap()); TestMap destination = destinationBuilder.build(); - assertThat(destination.getInt32ToEnumFieldValueMap().get(0).intValue()).isEqualTo(0); - assertThat(destination.getInt32ToEnumFieldValueMap().get(1).intValue()).isEqualTo(1); - assertThat(destination.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); - assertThat(destination.getInt32ToEnumFieldCount()).isEqualTo(3); + assertEquals(0, destination.getInt32ToEnumFieldValueMap().get(0).intValue()); + assertEquals(1, destination.getInt32ToEnumFieldValueMap().get(1).intValue()); + assertEquals(1000, destination.getInt32ToEnumFieldValueMap().get(2).intValue()); + assertEquals(3, destination.getInt32ToEnumFieldCount()); } - @Test public void testPutForUnknownEnumValues() throws Exception { - TestMap builder = + TestMap.Builder builder = TestMap.newBuilder() .putInt32ToEnumFieldValue(0, 0) .putInt32ToEnumFieldValue(1, 1) - .putInt32ToEnumFieldValue(2, 1000) - .build(); // unknown value. - TestMap message = builder; + .putInt32ToEnumFieldValue(2, 1000); // unknown value. + TestMap message = builder.build(); - assertThat(message.getInt32ToEnumFieldValueOrThrow(0)).isEqualTo(0); - assertThat(message.getInt32ToEnumFieldValueOrThrow(1)).isEqualTo(1); - assertThat(message.getInt32ToEnumFieldValueOrThrow(2)).isEqualTo(1000); - assertThat(message.getInt32ToEnumFieldCount()).isEqualTo(3); + assertEquals(0, message.getInt32ToEnumFieldValueOrThrow(0)); + assertEquals(1, message.getInt32ToEnumFieldValueOrThrow(1)); + assertEquals(1000, message.getInt32ToEnumFieldValueOrThrow(2)); + assertEquals(3, message.getInt32ToEnumFieldCount()); } - @Test public void testPutChecksNullKeysAndValues() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); try { builder.putInt32ToStringField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToBytesField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToEnumField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToMessageField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putStringToInt32Field(null, 1); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } } - @Test public void testSerializeAndParse() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); TestMap message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesSet(message); builder = message.toBuilder(); updateMapValues(builder); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesUpdated(message); builder = message.toBuilder(); builder.clear(); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesCleared(message); } @@ -425,44 +433,42 @@ public final class MapLiteTest { CodedOutputStream output = CodedOutputStream.newInstance(byteArrayOutputStream); bizarroMap.writeTo(output); output.flush(); - return TestMap.parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); + return TestMap.parser().parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); } - @Test public void testParseError() throws Exception { ByteString bytes = TestUtil.toBytes("SOME BYTES"); String stringKey = "a string key"; TestMap map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToInt32Field(5, bytes).build()); - assertThat(map.getInt32ToInt32FieldOrDefault(5, -1)).isEqualTo(0); + assertEquals(0, map.getInt32ToInt32FieldOrDefault(5, -1)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToStringField(stringKey, 5).build()); - assertThat(map.getInt32ToStringFieldOrDefault(0, null)).isEmpty(); + assertEquals("", map.getInt32ToStringFieldOrDefault(0, null)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToBytesField(stringKey, 5).build()); - assertThat(ByteString.EMPTY).isEqualTo(map.getInt32ToBytesFieldOrDefault(0, null)); + assertEquals(map.getInt32ToBytesFieldOrDefault(0, null), ByteString.EMPTY); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToEnumField(stringKey, bytes).build()); - assertThat(map.getInt32ToEnumFieldOrDefault(0, null)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, map.getInt32ToEnumFieldOrDefault(0, null)); try { tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToMessageField(stringKey, bytes).build()); - assertWithMessage("expected exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { - assertThat(expected.getUnfinishedMessage()).isInstanceOf(TestMap.class); + assertTrue(expected.getUnfinishedMessage() instanceof TestMap); map = (TestMap) expected.getUnfinishedMessage(); - assertThat(map.getInt32ToMessageFieldMap()).isEmpty(); + assertTrue(map.getInt32ToMessageFieldMap().isEmpty()); } map = tryParseTestMap( BizarroTestMap.newBuilder().putStringToInt32Field(stringKey, bytes).build()); - assertThat(map.getStringToInt32FieldOrDefault(stringKey, -1)).isEqualTo(0); + assertEquals(0, map.getStringToInt32FieldOrDefault(stringKey, -1)); } - @Test public void testMergeFrom() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); @@ -473,20 +479,18 @@ public final class MapLiteTest { assertMapValuesSet(other.build()); } - @Test public void testEqualsAndHashCode() throws Exception { // Test that generated equals() and hashCode() will disregard the order // of map entries when comparing/hashing map fields. // We can't control the order of elements in a HashMap. The best we can do // here is to add elements in different order. - TestMap b1 = + TestMap.Builder b1 = TestMap.newBuilder() .putInt32ToInt32Field(1, 2) .putInt32ToInt32Field(3, 4) - .putInt32ToInt32Field(5, 6) - .build(); - TestMap m1 = b1; + .putInt32ToInt32Field(5, 6); + TestMap m1 = b1.build(); TestMap.Builder b2 = TestMap.newBuilder() @@ -495,13 +499,13 @@ public final class MapLiteTest { .putInt32ToInt32Field(3, 4); TestMap m2 = b2.build(); - assertThat(m2).isEqualTo(m1); - assertThat(m2.hashCode()).isEqualTo(m1.hashCode()); + assertEquals(m1, m2); + assertEquals(m1.hashCode(), m2.hashCode()); // Make sure we did compare map fields. b2.putInt32ToInt32Field(1, 0); m2 = b2.build(); - assertThat(m1.equals(m2)).isFalse(); + assertFalse(m1.equals(m2)); // Don't check m1.hashCode() != m2.hashCode() because it's not guaranteed // to be different. @@ -509,12 +513,10 @@ public final class MapLiteTest { // equals() should return false. b2.removeInt32ToInt32Field(1); m2 = b2.build(); - assertThat(m1.equals(m2)).isFalse(); - assertThat(m2.equals(m1)).isFalse(); + assertFalse(m1.equals(m2)); + assertFalse(m2.equals(m1)); } - @Test - @SuppressWarnings("ProtoNewBuilderMergeFrom") public void testUnknownEnumValues() throws Exception { TestMap.Builder builder = TestMap.newBuilder() @@ -523,60 +525,55 @@ public final class MapLiteTest { .putInt32ToEnumFieldValue(2, 1000); // unknown value. TestMap message = builder.build(); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(0, TestMap.EnumValue.FOO); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(2, TestMap.EnumValue.UNRECOGNIZED); + assertEquals(TestMap.EnumValue.FOO, message.getInt32ToEnumFieldMap().get(0)); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.UNRECOGNIZED, message.getInt32ToEnumFieldMap().get(2)); builder.putAllInt32ToEnumFieldValue(newMap(2, 1000)); // unknown value. message = builder.build(); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(2, TestMap.EnumValue.UNRECOGNIZED); + assertEquals(TestMap.EnumValue.UNRECOGNIZED, message.getInt32ToEnumFieldMap().get(2)); // Unknown enum values should be preserved after: // 1. Serialization and parsing. // 2. toBuild(). // 3. mergeFrom(). - message = TestMap.parseFrom(message.toByteString(), ExtensionRegistryLite.getEmptyRegistry()); - assertThat(message.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); + message = TestMap.parseFrom(message.toByteString()); + assertEquals(1000, message.getInt32ToEnumFieldValueMap().get(2).intValue()); builder = message.toBuilder(); - assertThat(builder.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); + assertEquals(1000, builder.getInt32ToEnumFieldValueMap().get(2).intValue()); builder = TestMap.newBuilder().mergeFrom(message); - assertThat(builder.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); + assertEquals(1000, builder.getInt32ToEnumFieldValueMap().get(2).intValue()); // hashCode()/equals() should take unknown enum values into account. builder.putAllInt32ToEnumFieldValue(newMap(2, 1001)); TestMap message2 = builder.build(); - assertThat(message.hashCode()).isNotEqualTo(message2.hashCode()); - assertThat(message.equals(message2)).isFalse(); + assertFalse(message.hashCode() == message2.hashCode()); + assertFalse(message.equals(message2)); // Unknown values will be converted to UNRECOGNIZED so the resulted enum map // should be the same. - assertThat(message.getInt32ToEnumFieldMap()).isEqualTo(message2.getInt32ToEnumFieldMap()); + assertEquals(message2.getInt32ToEnumFieldMap(), message.getInt32ToEnumFieldMap()); } - @Test public void testIterationOrder() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); TestMap message = builder.build(); - assertThat(new ArrayList<>(message.getStringToInt32FieldMap().keySet())) - .containsExactly("1", "2", "3") - .inOrder(); + assertEquals( + Arrays.asList("1", "2", "3"), new ArrayList<>(message.getStringToInt32FieldMap().keySet())); } - @Test public void testGetMap() { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); TestMap message = builder.build(); - assertThat(message.getStringToInt32FieldMap()).isEqualTo(message.getStringToInt32FieldMap()); - assertThat(message.getInt32ToBytesFieldMap()).isEqualTo(message.getInt32ToBytesFieldMap()); - assertThat(message.getInt32ToEnumFieldMap()).isEqualTo(message.getInt32ToEnumFieldMap()); - assertThat(message.getInt32ToEnumFieldValueMap()) - .isEqualTo(message.getInt32ToEnumFieldValueMap()); - assertThat(message.getInt32ToMessageFieldMap()).isEqualTo(message.getInt32ToMessageFieldMap()); + assertEquals(message.getStringToInt32FieldMap(), message.getStringToInt32FieldMap()); + assertEquals(message.getInt32ToBytesFieldMap(), message.getInt32ToBytesFieldMap()); + assertEquals(message.getInt32ToEnumFieldMap(), message.getInt32ToEnumFieldMap()); + assertEquals(message.getInt32ToEnumFieldValueMap(), message.getInt32ToEnumFieldValueMap()); + assertEquals(message.getInt32ToMessageFieldMap(), message.getInt32ToMessageFieldMap()); } - @Test public void testContains() { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); @@ -585,38 +582,37 @@ public final class MapLiteTest { } private void assertMapContainsSetValues(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.containsInt32ToInt32Field(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToStringField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToBytesField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToEnumField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToMessageField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsStringToInt32Field("1")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("2")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("3")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("-1")).isFalse(); - } - - @Test + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(1)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(2)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(3)); + assertFalse(testMapOrBuilder.containsInt32ToInt32Field(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToStringField(1)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(2)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(3)); + assertFalse(testMapOrBuilder.containsInt32ToStringField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToBytesField(1)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(2)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(3)); + assertFalse(testMapOrBuilder.containsInt32ToBytesField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToEnumField(1)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(2)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(3)); + assertFalse(testMapOrBuilder.containsInt32ToEnumField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToMessageField(1)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(2)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(3)); + assertFalse(testMapOrBuilder.containsInt32ToMessageField(-1)); + + assertTrue(testMapOrBuilder.containsStringToInt32Field("1")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("2")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("3")); + assertFalse(testMapOrBuilder.containsStringToInt32Field("-1")); + } + public void testCount() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -628,24 +624,23 @@ public final class MapLiteTest { assertMapCounts(3, message); builder = message.toBuilder().putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); - assertThat(builder.build().getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); + assertEquals(4, builder.build().getInt32ToInt32FieldCount()); // already present - should be unchanged builder.putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); } private void assertMapCounts(int expectedCount, TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(expectedCount); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getStringToInt32FieldCount()); } - @Test public void testGetOrDefault() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -655,42 +650,39 @@ public final class MapLiteTest { } public void doTestGetOrDefault(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)); + assertEquals(-11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)); - assertThat(testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")).isEqualTo("11"); - assertWithMessage("-11") - .that(testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)) - .isNull(); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")); + assertNull("-11", testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)) - .isEqualTo(TestUtil.toBytes("11")); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)).isNull(); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)) - .isEqualTo(TestMap.EnumValue.FOO); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)).isNull(); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(2, -1)) - .isEqualTo(TestMap.EnumValue.BAR.getNumber()); - assertThat(testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(-1000, -1)).isEqualTo(-1); + assertEquals( + TestMap.EnumValue.BAR.getNumber(), + testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(2, -1)); + assertEquals(-1, testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(-1000, -1)); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)).isNull(); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)); + assertEquals(-11, testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)); try { testMapOrBuilder.getStringToInt32FieldOrDefault(null, -11); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testGetOrThrow() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -700,109 +692,109 @@ public final class MapLiteTest { } public void doTestGetOrThrow(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)); try { testMapOrBuilder.getInt32ToInt32FieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToStringFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToBytesFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToEnumFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToEnumFieldValueOrThrow(2)) - .isEqualTo(TestMap.EnumValue.BAR.getNumber()); + assertEquals( + TestMap.EnumValue.BAR.getNumber(), testMapOrBuilder.getInt32ToEnumFieldValueOrThrow(2)); try { testMapOrBuilder.getInt32ToEnumFieldValueOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToMessageFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrThrow("1")); try { testMapOrBuilder.getStringToInt32FieldOrThrow("-1"); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } try { testMapOrBuilder.getStringToInt32FieldOrThrow(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testPut() { TestMap.Builder builder = TestMap.newBuilder(); builder.putInt32ToInt32Field(1, 11); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); builder.putInt32ToStringField(1, "a"); - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("a"); + assertEquals("a", builder.getInt32ToStringFieldOrThrow(1)); try { builder.putInt32ToStringField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToBytesField(1, TestUtil.toBytes("11")); - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); try { builder.putInt32ToBytesField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToEnumField(1, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); try { builder.putInt32ToEnumField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putStringToInt32Field("a", 1); - assertThat(builder.getStringToInt32FieldOrThrow("a")).isEqualTo(1); + assertEquals(1, builder.getStringToInt32FieldOrThrow("a")); try { builder.putStringToInt32Field(null, -1); } catch (NullPointerException e) { @@ -810,43 +802,42 @@ public final class MapLiteTest { } } - @Test public void testRemove() { TestMap.Builder builder = TestMap.newBuilder(); setMapValues(builder); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToInt32Field(1); - assertThat(builder.getInt32ToInt32FieldOrDefault(1, -1)).isEqualTo(-1); + assertEquals(-1, builder.getInt32ToInt32FieldOrDefault(1, -1)); } - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", builder.getInt32ToStringFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToStringField(1); - assertThat(builder.getInt32ToStringFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToStringFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToBytesField(1); - assertThat(builder.getInt32ToBytesFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToBytesFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToEnumField(1); - assertThat(builder.getInt32ToEnumFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToEnumFieldOrDefault(1, null)); } - assertThat(builder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, builder.getStringToInt32FieldOrThrow("1")); for (int times = 0; times < 2; times++) { builder.removeStringToInt32Field("1"); - assertThat(builder.getStringToInt32FieldOrDefault("1", -1)).isEqualTo(-1); + assertEquals(-1, builder.getStringToInt32FieldOrDefault("1", -1)); } try { builder.removeStringToInt32Field(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } @@ -865,41 +856,40 @@ public final class MapLiteTest { return map; } - @Test public void testMap_withNulls() { TestMap.Builder builder = TestMap.newBuilder(); try { builder.putStringToInt32Field(null, 3); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putAllStringToInt32Field(newMap(null, 3, "hi", 4)); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putInt32ToMessageField(3, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putAllInt32ToMessageField( MapLiteTest.newMap(4, null, 5, null)); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putAllInt32ToMessageField(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } - assertThat(builder.build().toByteArray()).isEqualTo(new byte[0]); + assertArrayEquals(new byte[0], builder.build().toByteArray()); } } diff --git a/java/core/src/test/java/com/google/protobuf/MapTest.java b/java/core/src/test/java/com/google/protobuf/MapTest.java index 7058d4316893c51276c892275669cde1973c4470..f3458dd2359531dc2578a8c3bbe052d5a11c0815 100644 --- a/java/core/src/test/java/com/google/protobuf/MapTest.java +++ b/java/core/src/test/java/com/google/protobuf/MapTest.java @@ -1,23 +1,42 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertArrayEquals; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.EnumDescriptor; import com.google.protobuf.Descriptors.EnumValueDescriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import map_test.MapTestProto.BizarroTestMap; -import map_test.MapTestProto.MapContainer; import map_test.MapTestProto.ReservedAsMapField; import map_test.MapTestProto.ReservedAsMapFieldWithEnumValue; import map_test.MapTestProto.TestMap; @@ -27,42 +46,39 @@ import map_test.MapTestProto.TestOnChangeEventPropagation; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.TreeMap; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Unit tests for map fields. */ -@RunWith(JUnit4.class) -public class MapTest { +public class MapTest extends TestCase { private void setMapValuesUsingMutableMap(TestMap.Builder builder) { builder.getMutableInt32ToInt32Field().put(1, 11); builder.getMutableInt32ToInt32Field().put(2, 22); builder.getMutableInt32ToInt32Field().put(3, 33); - + // builder.getMutableInt32ToStringField().put(1, "11"); builder.getMutableInt32ToStringField().put(2, "22"); builder.getMutableInt32ToStringField().put(3, "33"); - + // builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("11")); builder.getMutableInt32ToBytesField().put(2, TestUtil.toBytes("22")); builder.getMutableInt32ToBytesField().put(3, TestUtil.toBytes("33")); - + // builder.getMutableInt32ToEnumField().put(1, TestMap.EnumValue.FOO); builder.getMutableInt32ToEnumField().put(2, TestMap.EnumValue.BAR); builder.getMutableInt32ToEnumField().put(3, TestMap.EnumValue.BAZ); - + // builder.getMutableInt32ToMessageField().put( 1, MessageValue.newBuilder().setValue(11).build()); builder.getMutableInt32ToMessageField().put( 2, MessageValue.newBuilder().setValue(22).build()); builder.getMutableInt32ToMessageField().put( 3, MessageValue.newBuilder().setValue(33).build()); - + // builder.getMutableStringToInt32Field().put("1", 11); builder.getMutableStringToInt32Field().put("2", 22); builder.getMutableStringToInt32Field().put("3", 33); @@ -90,7 +106,6 @@ public class MapTest { .putStringToInt32Field("3", 33); } - @Test public void testSetMapValues() { TestMap.Builder usingMutableMapBuilder = TestMap.newBuilder(); setMapValuesUsingMutableMap(usingMutableMapBuilder); @@ -102,7 +117,7 @@ public class MapTest { TestMap usingAccessors = usingAccessorsBuilder.build(); assertMapValuesSet(usingAccessors); - assertThat(usingAccessors).isEqualTo(usingMutableMap); + assertEquals(usingAccessors, usingMutableMap); } private void copyMapValues(TestMap source, TestMap.Builder destination) { @@ -116,60 +131,60 @@ public class MapTest { } private void assertMapValuesSet(TestMap message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(11); - assertThat(message.getInt32ToInt32FieldMap().get(2).intValue()).isEqualTo(22); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); + assertEquals(3, message.getInt32ToInt32FieldMap().size()); + assertEquals(11, message.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(22, message.getInt32ToInt32FieldMap().get(2).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(3).intValue()); - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "11"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(2, "22"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); + assertEquals(3, message.getInt32ToStringFieldMap().size()); + assertEquals("11", message.getInt32ToStringFieldMap().get(1)); + assertEquals("22", message.getInt32ToStringFieldMap().get(2)); + assertEquals("33", message.getInt32ToStringFieldMap().get(3)); - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("11")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(2, TestUtil.toBytes("22")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); + assertEquals(3, message.getInt32ToBytesFieldMap().size()); + assertEquals(TestUtil.toBytes("11"), message.getInt32ToBytesFieldMap().get(1)); + assertEquals(TestUtil.toBytes("22"), message.getInt32ToBytesFieldMap().get(2)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesFieldMap().get(3)); - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.FOO); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(2, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); + assertEquals(3, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.FOO, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(2)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumFieldMap().get(3)); - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(11); - assertThat(message.getInt32ToMessageFieldMap().get(2).getValue()).isEqualTo(22); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); + assertEquals(3, message.getInt32ToMessageFieldMap().size()); + assertEquals(11, message.getInt32ToMessageFieldMap().get(1).getValue()); + assertEquals(22, message.getInt32ToMessageFieldMap().get(2).getValue()); + assertEquals(33, message.getInt32ToMessageFieldMap().get(3).getValue()); - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(11); - assertThat(message.getStringToInt32FieldMap().get("2").intValue()).isEqualTo(22); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); + assertEquals(3, message.getStringToInt32FieldMap().size()); + assertEquals(11, message.getStringToInt32FieldMap().get("1").intValue()); + assertEquals(22, message.getStringToInt32FieldMap().get("2").intValue()); + assertEquals(33, message.getStringToInt32FieldMap().get("3").intValue()); } private void updateMapValuesUsingMutableMap(TestMap.Builder builder) { builder.getMutableInt32ToInt32Field().put(1, 111); builder.getMutableInt32ToInt32Field().remove(2); builder.getMutableInt32ToInt32Field().put(4, 44); - + // builder.getMutableInt32ToStringField().put(1, "111"); builder.getMutableInt32ToStringField().remove(2); builder.getMutableInt32ToStringField().put(4, "44"); - + // builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("111")); builder.getMutableInt32ToBytesField().remove(2); builder.getMutableInt32ToBytesField().put(4, TestUtil.toBytes("44")); - + // builder.getMutableInt32ToEnumField().put(1, TestMap.EnumValue.BAR); builder.getMutableInt32ToEnumField().remove(2); builder.getMutableInt32ToEnumField().put(4, TestMap.EnumValue.QUX); - + // builder.getMutableInt32ToMessageField().put( 1, MessageValue.newBuilder().setValue(111).build()); builder.getMutableInt32ToMessageField().remove(2); builder.getMutableInt32ToMessageField().put( 4, MessageValue.newBuilder().setValue(44).build()); - + // builder.getMutableStringToInt32Field().put("1", 111); builder.getMutableStringToInt32Field().remove("2"); builder.getMutableStringToInt32Field().put("4", 44); @@ -197,7 +212,6 @@ public class MapTest { .putStringToInt32Field("4", 44); } - @Test public void testUpdateMapValues() { TestMap.Builder usingMutableMapBuilder = TestMap.newBuilder(); setMapValuesUsingMutableMap(usingMutableMapBuilder); @@ -209,8 +223,8 @@ public class MapTest { TestMap usingAccessors = usingAccessorsBuilder.build(); assertMapValuesSet(usingAccessors); - assertThat(usingAccessors).isEqualTo(usingMutableMap); - + assertEquals(usingAccessors, usingMutableMap); + // usingMutableMapBuilder = usingMutableMap.toBuilder(); updateMapValuesUsingMutableMap(usingMutableMapBuilder); usingMutableMap = usingMutableMapBuilder.build(); @@ -221,57 +235,56 @@ public class MapTest { usingAccessors = usingAccessorsBuilder.build(); assertMapValuesUpdated(usingAccessors); - assertThat(usingAccessors).isEqualTo(usingMutableMap); + assertEquals(usingAccessors, usingMutableMap); } private void assertMapValuesUpdated(TestMap message) { - assertThat(message.getInt32ToInt32FieldMap()).hasSize(3); - assertThat(message.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(111); - assertThat(message.getInt32ToInt32FieldMap().get(3).intValue()).isEqualTo(33); - assertThat(message.getInt32ToInt32FieldMap().get(4).intValue()).isEqualTo(44); + assertEquals(3, message.getInt32ToInt32FieldMap().size()); + assertEquals(111, message.getInt32ToInt32FieldMap().get(1).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(3).intValue()); + assertEquals(44, message.getInt32ToInt32FieldMap().get(4).intValue()); - assertThat(message.getInt32ToStringFieldMap()).hasSize(3); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(1, "111"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(3, "33"); - assertThat(message.getInt32ToStringFieldMap()).containsEntry(4, "44"); + assertEquals(3, message.getInt32ToStringFieldMap().size()); + assertEquals("111", message.getInt32ToStringFieldMap().get(1)); + assertEquals("33", message.getInt32ToStringFieldMap().get(3)); + assertEquals("44", message.getInt32ToStringFieldMap().get(4)); - assertThat(message.getInt32ToBytesFieldMap()).hasSize(3); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(1, TestUtil.toBytes("111")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(3, TestUtil.toBytes("33")); - assertThat(message.getInt32ToBytesFieldMap()).containsEntry(4, TestUtil.toBytes("44")); + assertEquals(3, message.getInt32ToBytesFieldMap().size()); + assertEquals(TestUtil.toBytes("111"), message.getInt32ToBytesFieldMap().get(1)); + assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesFieldMap().get(3)); + assertEquals(TestUtil.toBytes("44"), message.getInt32ToBytesFieldMap().get(4)); - assertThat(message.getInt32ToEnumFieldMap()).hasSize(3); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(3, TestMap.EnumValue.BAZ); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(4, TestMap.EnumValue.QUX); + assertEquals(3, message.getInt32ToEnumFieldMap().size()); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.BAZ, message.getInt32ToEnumFieldMap().get(3)); + assertEquals(TestMap.EnumValue.QUX, message.getInt32ToEnumFieldMap().get(4)); - assertThat(message.getInt32ToMessageFieldMap()).hasSize(3); - assertThat(message.getInt32ToMessageFieldMap().get(1).getValue()).isEqualTo(111); - assertThat(message.getInt32ToMessageFieldMap().get(3).getValue()).isEqualTo(33); - assertThat(message.getInt32ToMessageFieldMap().get(4).getValue()).isEqualTo(44); + assertEquals(3, message.getInt32ToMessageFieldMap().size()); + assertEquals(111, message.getInt32ToMessageFieldMap().get(1).getValue()); + assertEquals(33, message.getInt32ToMessageFieldMap().get(3).getValue()); + assertEquals(44, message.getInt32ToMessageFieldMap().get(4).getValue()); - assertThat(message.getStringToInt32FieldMap()).hasSize(3); - assertThat(message.getStringToInt32FieldMap().get("1").intValue()).isEqualTo(111); - assertThat(message.getStringToInt32FieldMap().get("3").intValue()).isEqualTo(33); - assertThat(message.getStringToInt32FieldMap().get("4").intValue()).isEqualTo(44); + assertEquals(3, message.getStringToInt32FieldMap().size()); + assertEquals(111, message.getStringToInt32FieldMap().get("1").intValue()); + assertEquals(33, message.getStringToInt32FieldMap().get("3").intValue()); + assertEquals(44, message.getStringToInt32FieldMap().get("4").intValue()); } private void assertMapValuesCleared(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToStringFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToBytesFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToEnumFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getInt32ToMessageFieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(0); - assertThat(testMapOrBuilder.getStringToInt32FieldMap()).isEmpty(); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(0); - } - - @Test + assertEquals(0, testMapOrBuilder.getInt32ToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToStringField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageField().size()); + assertEquals(0, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(0, testMapOrBuilder.getStringToInt32Field().size()); + assertEquals(0, testMapOrBuilder.getStringToInt32FieldCount()); + } + public void testGetMapIsImmutable() { TestMap.Builder builder = TestMap.newBuilder(); assertMapsAreImmutable(builder); @@ -283,131 +296,134 @@ public class MapTest { } private void assertMapsAreImmutable(TestMapOrBuilder testMapOrBuilder) { - assertImmutable(testMapOrBuilder.getInt32ToInt32FieldMap(), 1, 2); - assertImmutable(testMapOrBuilder.getInt32ToStringFieldMap(), 1, "2"); - assertImmutable(testMapOrBuilder.getInt32ToBytesFieldMap(), 1, TestUtil.toBytes("2")); - assertImmutable(testMapOrBuilder.getInt32ToEnumFieldMap(), 1, TestMap.EnumValue.FOO); + assertImmutable(testMapOrBuilder.getInt32ToInt32Field(), 1, 2); + assertImmutable(testMapOrBuilder.getInt32ToStringField(), 1, "2"); + assertImmutable(testMapOrBuilder.getInt32ToBytesField(), 1, TestUtil.toBytes("2")); + assertImmutable(testMapOrBuilder.getInt32ToEnumField(), 1, TestMap.EnumValue.FOO); assertImmutable( - testMapOrBuilder.getInt32ToMessageFieldMap(), 1, MessageValue.getDefaultInstance()); - assertImmutable(testMapOrBuilder.getStringToInt32FieldMap(), "1", 2); + testMapOrBuilder.getInt32ToMessageField(), 1, MessageValue.getDefaultInstance()); + assertImmutable(testMapOrBuilder.getStringToInt32Field(), "1", 2); } private void assertImmutable(Map map, K key, V value) { try { map.put(key, value); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } - @Test public void testMutableMapLifecycle() { TestMap.Builder builder = TestMap.newBuilder(); Map intMap = builder.getMutableInt32ToInt32Field(); intMap.put(1, 2); - assertThat(builder.build().getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32Field()); try { intMap.put(2, 3); - assertWithMessage("expected exception intMap").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(builder.getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.getInt32ToInt32Field()); builder.getMutableInt32ToInt32Field().put(2, 3); - assertThat(builder.getInt32ToInt32Field()).isEqualTo(newMap(1, 2, 2, 3)); - + assertEquals(newMap(1, 2, 2, 3), builder.getInt32ToInt32Field()); + // Map enumMap = builder.getMutableInt32ToEnumField(); enumMap.put(1, TestMap.EnumValue.BAR); - assertThat(builder.build().getInt32ToEnumField()) - .isEqualTo(newMap(1, TestMap.EnumValue.BAR)); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.build().getInt32ToEnumField()); try { enumMap.put(2, TestMap.EnumValue.FOO); - assertWithMessage("expected exception enumMap").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(builder.getInt32ToEnumField()).isEqualTo(newMap(1, TestMap.EnumValue.BAR)); + assertEquals(newMap(1, TestMap.EnumValue.BAR), builder.getInt32ToEnumField()); builder.getMutableInt32ToEnumField().put(2, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumField()).isEqualTo( - newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO)); - + assertEquals( + newMap(1, TestMap.EnumValue.BAR, 2, TestMap.EnumValue.FOO), + builder.getInt32ToEnumField()); + // Map stringMap = builder.getMutableInt32ToStringField(); stringMap.put(1, "1"); - assertThat(builder.build().getInt32ToStringField()).isEqualTo(newMap(1, "1")); + assertEquals(newMap(1, "1"), builder.build().getInt32ToStringField()); try { stringMap.put(2, "2"); - assertWithMessage("expected exception stringMap").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(builder.getInt32ToStringField()).isEqualTo(newMap(1, "1")); + assertEquals(newMap(1, "1"), builder.getInt32ToStringField()); builder.putInt32ToStringField(2, "2"); - assertThat(builder.getInt32ToStringField()).isEqualTo(newMap(1, "1", 2, "2")); - - // Message maps are handled differently, and don't freeze old mutable collections. + assertEquals( + newMap(1, "1", 2, "2"), + builder.getInt32ToStringField()); + // Map messageMap = builder.getMutableInt32ToMessageField(); messageMap.put(1, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.build().getInt32ToMessageField()) - .isEqualTo(newMap(1, TestMap.MessageValue.getDefaultInstance())); - // Mutations on old mutable maps don't affect the builder state. - messageMap.put(2, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.getInt32ToMessageField()).isEqualTo( - newMap(1, TestMap.MessageValue.getDefaultInstance())); + assertEquals(newMap(1, TestMap.MessageValue.getDefaultInstance()), + builder.build().getInt32ToMessageField()); + try { + messageMap.put(2, TestMap.MessageValue.getDefaultInstance()); + fail(); + } catch (UnsupportedOperationException e) { + // expected + } + assertEquals(newMap(1, TestMap.MessageValue.getDefaultInstance()), + builder.getInt32ToMessageField()); builder.putInt32ToMessageField(2, TestMap.MessageValue.getDefaultInstance()); - assertThat(builder.getInt32ToMessageField()).isEqualTo( + assertEquals( newMap(1, TestMap.MessageValue.getDefaultInstance(), - 2, TestMap.MessageValue.getDefaultInstance())); + 2, TestMap.MessageValue.getDefaultInstance()), + builder.getInt32ToMessageField()); } - - @Test + // public void testMutableMapLifecycle_collections() { TestMap.Builder builder = TestMap.newBuilder(); Map intMap = builder.getMutableInt32ToInt32Field(); intMap.put(1, 2); - assertThat(builder.build().getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32Field()); try { intMap.remove(2); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.entrySet().remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.entrySet().iterator().remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.keySet().remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.values().remove(new Object()); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { intMap.values().iterator().remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(intMap).isEqualTo(newMap(1, 2)); - assertThat(builder.getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); - assertThat(builder.build().getInt32ToInt32Field()).isEqualTo(newMap(1, 2)); + assertEquals(newMap(1, 2), intMap); + assertEquals(newMap(1, 2), builder.getInt32ToInt32Field()); + assertEquals(newMap(1, 2), builder.build().getInt32ToInt32Field()); } - @Test public void testGettersAndSetters() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); TestMap message = builder.build(); @@ -430,7 +446,6 @@ public class MapTest { assertMapValuesCleared(message); } - @Test public void testPutAll() throws Exception { TestMap.Builder sourceBuilder = TestMap.newBuilder(); setMapValuesUsingAccessors(sourceBuilder); @@ -442,38 +457,6 @@ public class MapTest { assertMapValuesSet(destination.build()); } - @Test - public void testPutAllWithNullStringValue() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - // order preserving map used here to help test rollback - Map data = new TreeMap<>(); - data.put(7, "foo"); - data.put(8, "bar"); - data.put(9, null); - try { - sourceBuilder.putAllInt32ToStringField(data); - fail("allowed null string value"); - } catch (NullPointerException expected) { - // Verify rollback of previously added values. - // They all go in or none do. - assertThat(sourceBuilder.getInt32ToStringFieldMap()).isEmpty(); - } - } - - @Test - public void testPutNullStringValue() throws Exception { - TestMap.Builder sourceBuilder = TestMap.newBuilder(); - - try { - sourceBuilder.putInt32ToStringField(8, null); - fail("allowed null string value"); - } catch (NullPointerException expected) { - assertNotNull(expected.getMessage()); - } - } - - @Test public void testPutAllForUnknownEnumValues() throws Exception { TestMap source = TestMap.newBuilder() @@ -489,13 +472,12 @@ public class MapTest { .putAllInt32ToEnumFieldValue(source.getInt32ToEnumFieldValueMap()) .build(); - assertThat(destination.getInt32ToEnumFieldValueMap().get(0).intValue()).isEqualTo(0); - assertThat(destination.getInt32ToEnumFieldValueMap().get(1).intValue()).isEqualTo(1); - assertThat(destination.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); - assertThat(destination.getInt32ToEnumFieldCount()).isEqualTo(3); + assertEquals(0, destination.getInt32ToEnumFieldValueMap().get(0).intValue()); + assertEquals(1, destination.getInt32ToEnumFieldValueMap().get(1).intValue()); + assertEquals(1000, destination.getInt32ToEnumFieldValueMap().get(2).intValue()); + assertEquals(3, destination.getInt32ToEnumFieldCount()); } - @Test public void testPutForUnknownEnumValues() throws Exception { TestMap message = TestMap.newBuilder() @@ -503,89 +485,71 @@ public class MapTest { .putInt32ToEnumFieldValue(1, 1) .putInt32ToEnumFieldValue(2, 1000) // unknown value. .build(); - assertThat(message.getInt32ToEnumFieldValueOrThrow(0)).isEqualTo(0); - assertThat(message.getInt32ToEnumFieldValueOrThrow(1)).isEqualTo(1); - assertThat(message.getInt32ToEnumFieldValueOrThrow(2)).isEqualTo(1000); - assertThat(message.getInt32ToEnumFieldCount()).isEqualTo(3); + assertEquals(0, message.getInt32ToEnumFieldValueOrThrow(0)); + assertEquals(1, message.getInt32ToEnumFieldValueOrThrow(1)); + assertEquals(1000, message.getInt32ToEnumFieldValueOrThrow(2)); + assertEquals(3, message.getInt32ToEnumFieldCount()); } - @Test public void testPutChecksNullKeysAndValues() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); try { builder.putInt32ToStringField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToBytesField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToEnumField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putInt32ToMessageField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } try { builder.putStringToInt32Field(null, 1); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected. } } - @Test - public void testPutBuilderIfAbsent() { - TestMap.Builder builder = TestMap.newBuilder(); - MessageValue.Builder subBuilder = builder.putInt32ToMessageFieldBuilderIfAbsent(1); - - assertThat(builder.putInt32ToMessageFieldBuilderIfAbsent(1)).isSameInstanceAs(subBuilder); - - subBuilder.setValue(11); - assertThat(builder.getInt32ToMessageFieldOrThrow(1).getValue()).isEqualTo(11); - builder.putInt32ToMessageFieldBuilderIfAbsent(1).setValue(22); - assertThat(builder.getInt32ToMessageFieldOrThrow(1).getValue()).isEqualTo(22); - - builder.putInt32ToMessageField(2, MessageValue.newBuilder().setValue(33).build()); - assertThat(builder.putInt32ToMessageFieldBuilderIfAbsent(2).getValue()).isEqualTo(33); - } - - @Test public void testSerializeAndParse() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); TestMap message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesSet(message); builder = message.toBuilder(); updateMapValuesUsingAccessors(builder); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesUpdated(message); builder = message.toBuilder(); builder.clear(); message = builder.build(); - assertThat(message.toByteString().size()).isEqualTo(message.getSerializedSize()); - message = TestMap.parseFrom(message.toByteString()); + assertEquals(message.getSerializedSize(), message.toByteString().size()); + message = TestMap.parser().parseFrom(message.toByteString()); assertMapValuesCleared(message); } @@ -594,44 +558,42 @@ public class MapTest { CodedOutputStream output = CodedOutputStream.newInstance(byteArrayOutputStream); bizarroMap.writeTo(output); output.flush(); - return TestMap.parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); + return TestMap.parser().parseFrom(ByteString.copyFrom(byteArrayOutputStream.toByteArray())); } - @Test public void testParseError() throws Exception { ByteString bytes = TestUtil.toBytes("SOME BYTES"); String stringKey = "a string key"; TestMap map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToInt32Field(5, bytes).build()); - assertThat(map.getInt32ToInt32FieldOrDefault(5, -1)).isEqualTo(0); + assertEquals(0, map.getInt32ToInt32FieldOrDefault(5, -1)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToStringField(stringKey, 5).build()); - assertThat(map.getInt32ToStringFieldOrDefault(0, null)).isEmpty(); + assertEquals("", map.getInt32ToStringFieldOrDefault(0, null)); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToBytesField(stringKey, 5).build()); - assertThat(ByteString.EMPTY).isEqualTo(map.getInt32ToBytesFieldOrDefault(0, null)); + assertEquals(map.getInt32ToBytesFieldOrDefault(0, null), ByteString.EMPTY); map = tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToEnumField(stringKey, bytes).build()); - assertThat(map.getInt32ToEnumFieldOrDefault(0, null)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, map.getInt32ToEnumFieldOrDefault(0, null)); try { tryParseTestMap(BizarroTestMap.newBuilder().putInt32ToMessageField(stringKey, bytes).build()); - assertWithMessage("expected exception").fail(); + fail(); } catch (InvalidProtocolBufferException expected) { - assertThat(expected.getUnfinishedMessage()).isInstanceOf(TestMap.class); + assertTrue(expected.getUnfinishedMessage() instanceof TestMap); map = (TestMap) expected.getUnfinishedMessage(); - assertThat(map.getInt32ToMessageFieldMap()).isEmpty(); + assertTrue(map.getInt32ToMessageFieldMap().isEmpty()); } map = tryParseTestMap( BizarroTestMap.newBuilder().putStringToInt32Field(stringKey, bytes).build()); - assertThat(map.getStringToInt32FieldOrDefault(stringKey, -1)).isEqualTo(0); + assertEquals(0, map.getStringToInt32FieldOrDefault(stringKey, -1)); } - @Test public void testMergeFrom() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -642,7 +604,6 @@ public class MapTest { assertMapValuesSet(other.build()); } - @Test public void testEqualsAndHashCode() throws Exception { // Test that generated equals() and hashCode() will disregard the order // of map entries when comparing/hashing map fields. @@ -663,13 +624,13 @@ public class MapTest { .putInt32ToInt32Field(3, 4); TestMap m2 = b2.build(); - assertThat(m2).isEqualTo(m1); - assertThat(m2.hashCode()).isEqualTo(m1.hashCode()); + assertEquals(m1, m2); + assertEquals(m1.hashCode(), m2.hashCode()); // Make sure we did compare map fields. b2.putInt32ToInt32Field(1, 0); m2 = b2.build(); - assertThat(m1.equals(m2)).isFalse(); + assertFalse(m1.equals(m2)); // Don't check m1.hashCode() != m2.hashCode() because it's not guaranteed // to be different. @@ -677,25 +638,22 @@ public class MapTest { // equals() should return false. b2.removeInt32ToInt32Field(1); m2 = b2.build(); - assertThat(m1.equals(m2)).isFalse(); - assertThat(m2.equals(m1)).isFalse(); + assertFalse(m1.equals(m2)); + assertFalse(m2.equals(m1)); } - @Test public void testNestedBuilderOnChangeEventPropagation() { TestOnChangeEventPropagation.Builder parent = TestOnChangeEventPropagation.newBuilder(); parent.getOptionalMessageBuilder().putInt32ToInt32Field(1, 2); TestOnChangeEventPropagation message = parent.build(); - assertThat(message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()) - .isEqualTo(2); + assertEquals(2, message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()); // Make a change using nested builder. parent.getOptionalMessageBuilder().putInt32ToInt32Field(1, 3); // Should be able to observe the change. message = parent.build(); - assertThat(message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()) - .isEqualTo(3); + assertEquals(3, message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()); // Make another change using mergeFrom() TestMap other = TestMap.newBuilder().putInt32ToInt32Field(1, 4).build(); @@ -703,18 +661,16 @@ public class MapTest { // Should be able to observe the change. message = parent.build(); - assertThat(message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()) - .isEqualTo(4); + assertEquals(4, message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()); // Make yet another change by clearing the nested builder. parent.getOptionalMessageBuilder().clear(); // Should be able to observe the change. message = parent.build(); - assertThat(message.getOptionalMessage().getInt32ToInt32FieldMap()).isEmpty(); + assertEquals(0, message.getOptionalMessage().getInt32ToInt32FieldMap().size()); } - @Test public void testNestedBuilderOnChangeEventPropagationReflection() { FieldDescriptor intMapField = f("int32_to_int32_field"); // Create an outer message builder with nested builder. @@ -729,7 +685,7 @@ public class MapTest { // Should be able to observe the change. TestOnChangeEventPropagation message = parentBuilder.build(); - assertThat(message.getOptionalMessage().getInt32ToInt32FieldMap()).hasSize(1); + assertEquals(1, message.getOptionalMessage().getInt32ToInt32FieldMap().size()); // Change the entry value. entryBuilder.putInt32ToInt32Field(1, 4); @@ -738,8 +694,7 @@ public class MapTest { // Should be able to observe the change. message = parentBuilder.build(); - assertThat(message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()) - .isEqualTo(4); + assertEquals(4, message.getOptionalMessage().getInt32ToInt32FieldMap().get(1).intValue()); // Clear the nested builder. testMapBuilder = parentBuilder.getOptionalMessageBuilder(); @@ -747,7 +702,7 @@ public class MapTest { // Should be able to observe the change. message = parentBuilder.build(); - assertThat(message.getOptionalMessage().getInt32ToInt32FieldMap()).isEmpty(); + assertEquals(0, message.getOptionalMessage().getInt32ToInt32FieldMap().size()); } // The following methods are used to test reflection API. @@ -774,16 +729,16 @@ public class MapTest { Message mapEntry = (Message) entry; Object key = getFieldValue(mapEntry, "key"); Object value = getFieldValue(mapEntry, "value"); - assertThat(values.containsKey(key)).isTrue(); - assertThat(values.get(key)).isEqualTo(value); + assertTrue(values.containsKey(key)); + assertEquals(value, values.get(key)); } - assertThat(message.getRepeatedFieldCount(field)).isEqualTo(values.size()); + assertEquals(values.size(), message.getRepeatedFieldCount(field)); for (int i = 0; i < message.getRepeatedFieldCount(field); i++) { Message mapEntry = (Message) message.getRepeatedField(field, i); Object key = getFieldValue(mapEntry, "key"); Object value = getFieldValue(mapEntry, "value"); - assertThat(values.containsKey(key)).isTrue(); - assertThat(values.get(key)).isEqualTo(value); + assertTrue(values.containsKey(key)); + assertEquals(value, values.get(key)); } } @@ -813,7 +768,6 @@ public class MapTest { return map; } - @Test public void testReflectionApi() throws Exception { // In reflection API, map fields are just repeated message fields. TestMap.Builder builder = @@ -837,8 +791,8 @@ public class MapTest { builder.clearField(f("int32_to_int32_field")); builder.clearField(f("int32_to_message_field")); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap()).isEmpty(); - assertThat(message.getInt32ToMessageFieldMap()).isEmpty(); + assertEquals(0, message.getInt32ToInt32FieldMap().size()); + assertEquals(0, message.getInt32ToMessageFieldMap().size()); // Test setField() setMapValues(builder, "int32_to_int32_field", mapForValues(11, 22, 33, 44)); @@ -849,10 +803,10 @@ public class MapTest { 111, MessageValue.newBuilder().setValue(222).build(), 333, MessageValue.newBuilder().setValue(444).build())); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(11).intValue()).isEqualTo(22); - assertThat(message.getInt32ToInt32FieldMap().get(33).intValue()).isEqualTo(44); - assertThat(message.getInt32ToMessageFieldMap().get(111).getValue()).isEqualTo(222); - assertThat(message.getInt32ToMessageFieldMap().get(333).getValue()).isEqualTo(444); + assertEquals(22, message.getInt32ToInt32FieldMap().get(11).intValue()); + assertEquals(44, message.getInt32ToInt32FieldMap().get(33).intValue()); + assertEquals(222, message.getInt32ToMessageFieldMap().get(111).getValue()); + assertEquals(444, message.getInt32ToMessageFieldMap().get(333).getValue()); // Test addRepeatedField builder.addRepeatedField( @@ -865,8 +819,8 @@ public class MapTest { 555, MessageValue.newBuilder().setValue(666).build())); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(55).intValue()).isEqualTo(66); - assertThat(message.getInt32ToMessageFieldMap().get(555).getValue()).isEqualTo(666); + assertEquals(66, message.getInt32ToInt32FieldMap().get(55).intValue()); + assertEquals(666, message.getInt32ToMessageFieldMap().get(555).getValue()); // Test addRepeatedField (overriding existing values) builder.addRepeatedField( @@ -879,8 +833,8 @@ public class MapTest { 555, MessageValue.newBuilder().setValue(555).build())); message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(55).intValue()).isEqualTo(55); - assertThat(message.getInt32ToMessageFieldMap().get(555).getValue()).isEqualTo(555); + assertEquals(55, message.getInt32ToInt32FieldMap().get(55).intValue()); + assertEquals(555, message.getInt32ToMessageFieldMap().get(555).getValue()); // Test setRepeatedField for (int i = 0; i < builder.getRepeatedFieldCount(f("int32_to_int32_field")); i++) { @@ -894,13 +848,12 @@ public class MapTest { builder.setRepeatedField(f("int32_to_int32_field"), i, mapEntryBuilder.build()); } message = builder.build(); - assertThat(message.getInt32ToInt32FieldMap().get(22).intValue()).isEqualTo(11); - assertThat(message.getInt32ToInt32FieldMap().get(44).intValue()).isEqualTo(33); - assertThat(message.getInt32ToInt32FieldMap().get(55).intValue()).isEqualTo(55); + assertEquals(11, message.getInt32ToInt32FieldMap().get(22).intValue()); + assertEquals(33, message.getInt32ToInt32FieldMap().get(44).intValue()); + assertEquals(55, message.getInt32ToInt32FieldMap().get(55).intValue()); } // See additional coverage in TextFormatTest.java. - @Test public void testTextFormat() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -915,7 +868,6 @@ public class MapTest { assertMapValuesSet(message); } - @Test public void testDynamicMessage() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -923,18 +875,14 @@ public class MapTest { Message dynamicDefaultInstance = DynamicMessage.getDefaultInstance(TestMap.getDescriptor()); Message dynamicMessage = - dynamicDefaultInstance - .newBuilderForType() - .mergeFrom(message.toByteString(), ExtensionRegistry.getEmptyRegistry()) - .build(); + dynamicDefaultInstance.newBuilderForType().mergeFrom(message.toByteString()).build(); - assertThat(dynamicMessage).isEqualTo(message); - assertThat(dynamicMessage.hashCode()).isEqualTo(message.hashCode()); + assertEquals(message, dynamicMessage); + assertEquals(message.hashCode(), dynamicMessage.hashCode()); } // Check that DynamicMessage handles map field serialization the same way as generated code // regarding unset key and value field in a map entry. - @Test public void testDynamicMessageUnsetKeyAndValue() throws Exception { FieldDescriptor field = f("int32_to_int32_field"); @@ -945,12 +893,11 @@ public class MapTest { Message message = builder.build(); ByteString bytes = message.toByteString(); // Parse it back to the same generated type. - Message generatedMessage = TestMap.parseFrom(bytes, ExtensionRegistry.getEmptyRegistry()); + Message generatedMessage = TestMap.parseFrom(bytes); // Assert the serialized bytes are equivalent. - assertThat(bytes).isEqualTo(generatedMessage.toByteString()); + assertEquals(generatedMessage.toByteString(), bytes); } - @Test public void testReflectionEqualsAndHashCode() throws Exception { // Test that generated equals() and hashCode() will disregard the order // of map entries when comparing/hashing map fields. @@ -971,19 +918,17 @@ public class MapTest { b2.addRepeatedField(field, newMapEntry(b2, "int32_to_int32_field", 3, 4)); Message m2 = b2.build(); - assertThat(m2).isEqualTo(m1); - assertThat(m2.hashCode()).isEqualTo(m1.hashCode()); + assertEquals(m1, m2); + assertEquals(m1.hashCode(), m2.hashCode()); // Make sure we did compare map fields. b2.setRepeatedField(field, 0, newMapEntry(b1, "int32_to_int32_field", 0, 0)); m2 = b2.build(); - assertThat(m1).isNotEqualTo(m2); + assertFalse(m1.equals(m2)); // Don't check m1.hashCode() != m2.hashCode() because it's not guaranteed // to be different. } - @Test - @SuppressWarnings("ProtoNewBuilderMergeFrom") public void testUnknownEnumValues() throws Exception { TestMap.Builder builder = TestMap.newBuilder() @@ -994,33 +939,32 @@ public class MapTest { 2, 1000)); // unknown value. TestMap message = builder.build(); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(0, TestMap.EnumValue.FOO); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(1, TestMap.EnumValue.BAR); - assertThat(message.getInt32ToEnumFieldMap()).containsEntry(2, TestMap.EnumValue.UNRECOGNIZED); - assertThat(message.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); + assertEquals(TestMap.EnumValue.FOO, message.getInt32ToEnumFieldMap().get(0)); + assertEquals(TestMap.EnumValue.BAR, message.getInt32ToEnumFieldMap().get(1)); + assertEquals(TestMap.EnumValue.UNRECOGNIZED, message.getInt32ToEnumFieldMap().get(2)); + assertEquals(1000, message.getInt32ToEnumFieldValueMap().get(2).intValue()); // Unknown enum values should be preserved after: // 1. Serialization and parsing. // 2. toBuild(). // 3. mergeFrom(). - message = TestMap.parseFrom(message.toByteString(), ExtensionRegistry.getEmptyRegistry()); - assertThat(message.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); + message = TestMap.parseFrom(message.toByteString()); + assertEquals(1000, message.getInt32ToEnumFieldValueMap().get(2).intValue()); builder = message.toBuilder(); - assertThat(builder.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); + assertEquals(1000, builder.getInt32ToEnumFieldValueMap().get(2).intValue()); builder = TestMap.newBuilder().mergeFrom(message); - assertThat(builder.getInt32ToEnumFieldValueMap().get(2).intValue()).isEqualTo(1000); + assertEquals(1000, builder.getInt32ToEnumFieldValueMap().get(2).intValue()); // hashCode()/equals() should take unknown enum values into account. builder.putAllInt32ToEnumFieldValue(newMap(2, 1001)); TestMap message2 = builder.build(); - assertThat(message.hashCode()).isNotEqualTo(message2.hashCode()); - assertThat(message.equals(message2)).isFalse(); + assertFalse(message.hashCode() == message2.hashCode()); + assertFalse(message.equals(message2)); // Unknown values will be converted to UNRECOGNIZED so the resulted enum map // should be the same. - assertThat(message.getInt32ToEnumFieldMap()).isEqualTo(message2.getInt32ToEnumFieldMap()); + assertEquals(message2.getInt32ToEnumFieldMap(), message.getInt32ToEnumFieldMap()); } - @Test public void testUnknownEnumValuesInReflectionApi() throws Exception { Descriptor descriptor = TestMap.getDescriptor(); EnumDescriptor enumDescriptor = TestMap.EnumValue.getDescriptor(); @@ -1039,7 +983,7 @@ public class MapTest { Message mapEntry = (Message) builder.getRepeatedField(field, i); int key = ((Integer) getFieldValue(mapEntry, "key")).intValue(); int value = ((EnumValueDescriptor) getFieldValue(mapEntry, "value")).getNumber(); - assertThat(value).isEqualTo(data.get(key).intValue()); + assertEquals(data.get(key).intValue(), value); Message.Builder mapEntryBuilder = mapEntry.toBuilder(); // Increase the value by 1. setFieldValue( @@ -1050,35 +994,30 @@ public class MapTest { // Verify that enum values have been successfully updated. TestMap message = builder.build(); for (Map.Entry entry : message.getInt32ToEnumFieldValueMap().entrySet()) { - assertThat(entry.getValue().intValue()).isEqualTo(data.get(entry.getKey()) + 1); + assertEquals(data.get(entry.getKey()) + 1, entry.getValue().intValue()); } } - @Test public void testIterationOrder() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); TestMap message = builder.build(); - assertThat(new ArrayList<>(message.getStringToInt32FieldMap().keySet())) - .containsExactly("1", "2", "3") - .inOrder(); + assertEquals( + Arrays.asList("1", "2", "3"), new ArrayList<>(message.getStringToInt32FieldMap().keySet())); } - @Test public void testGetMap() { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); TestMap message = builder.build(); - assertThat(message.getStringToInt32FieldMap()).isEqualTo(message.getStringToInt32FieldMap()); - assertThat(message.getInt32ToBytesFieldMap()).isEqualTo(message.getInt32ToBytesFieldMap()); - assertThat(message.getInt32ToEnumFieldMap()).isEqualTo(message.getInt32ToEnumFieldMap()); - assertThat(message.getInt32ToEnumFieldValueMap()) - .isEqualTo(message.getInt32ToEnumFieldValueMap()); - assertThat(message.getInt32ToMessageFieldMap()).isEqualTo(message.getInt32ToMessageFieldMap()); + assertEquals(message.getStringToInt32FieldMap(), message.getStringToInt32FieldMap()); + assertEquals(message.getInt32ToBytesFieldMap(), message.getInt32ToBytesFieldMap()); + assertEquals(message.getInt32ToEnumFieldMap(), message.getInt32ToEnumFieldMap()); + assertEquals(message.getInt32ToEnumFieldValueMap(), message.getInt32ToEnumFieldValueMap()); + assertEquals(message.getInt32ToMessageFieldMap(), message.getInt32ToMessageFieldMap()); } - @Test public void testContains() { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); @@ -1087,38 +1026,37 @@ public class MapTest { } private void assertMapContainsSetValues(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.containsInt32ToInt32Field(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToInt32Field(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToStringField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToStringField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToBytesField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToBytesField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToEnumField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToEnumField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsInt32ToMessageField(1)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(2)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(3)).isTrue(); - assertThat(testMapOrBuilder.containsInt32ToMessageField(-1)).isFalse(); - - assertThat(testMapOrBuilder.containsStringToInt32Field("1")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("2")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("3")).isTrue(); - assertThat(testMapOrBuilder.containsStringToInt32Field("-1")).isFalse(); - } - - @Test + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(1)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(2)); + assertTrue(testMapOrBuilder.containsInt32ToInt32Field(3)); + assertFalse(testMapOrBuilder.containsInt32ToInt32Field(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToStringField(1)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(2)); + assertTrue(testMapOrBuilder.containsInt32ToStringField(3)); + assertFalse(testMapOrBuilder.containsInt32ToStringField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToBytesField(1)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(2)); + assertTrue(testMapOrBuilder.containsInt32ToBytesField(3)); + assertFalse(testMapOrBuilder.containsInt32ToBytesField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToEnumField(1)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(2)); + assertTrue(testMapOrBuilder.containsInt32ToEnumField(3)); + assertFalse(testMapOrBuilder.containsInt32ToEnumField(-1)); + + assertTrue(testMapOrBuilder.containsInt32ToMessageField(1)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(2)); + assertTrue(testMapOrBuilder.containsInt32ToMessageField(3)); + assertFalse(testMapOrBuilder.containsInt32ToMessageField(-1)); + + assertTrue(testMapOrBuilder.containsStringToInt32Field("1")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("2")); + assertTrue(testMapOrBuilder.containsStringToInt32Field("3")); + assertFalse(testMapOrBuilder.containsStringToInt32Field("-1")); + } + public void testCount() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -1130,24 +1068,23 @@ public class MapTest { assertMapCounts(3, message); builder = message.toBuilder().putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); - assertThat(builder.build().getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); + assertEquals(4, builder.build().getInt32ToInt32FieldCount()); // already present - should be unchanged builder.putInt32ToInt32Field(4, 44); - assertThat(builder.getInt32ToInt32FieldCount()).isEqualTo(4); + assertEquals(4, builder.getInt32ToInt32FieldCount()); } private void assertMapCounts(int expectedCount, TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToStringFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToBytesFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToEnumFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getInt32ToMessageFieldCount()).isEqualTo(expectedCount); - assertThat(testMapOrBuilder.getStringToInt32FieldCount()).isEqualTo(expectedCount); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToInt32FieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToStringFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToBytesFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToEnumFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getInt32ToMessageFieldCount()); + assertEquals(expectedCount, testMapOrBuilder.getStringToInt32FieldCount()); } - @Test public void testGetOrDefault() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -1157,42 +1094,39 @@ public class MapTest { } public void doTestGetOrDefault(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(1, -11)); + assertEquals(-11, testMapOrBuilder.getInt32ToInt32FieldOrDefault(-1, -11)); - assertThat(testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")).isEqualTo("11"); - assertWithMessage("-11") - .that(testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)) - .isNull(); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrDefault(1, "-11")); + assertNull("-11", testMapOrBuilder.getInt32ToStringFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)) - .isEqualTo(TestUtil.toBytes("11")); - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)).isNull(); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToBytesFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)) - .isEqualTo(TestMap.EnumValue.FOO); - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)).isNull(); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToEnumFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(2, -1)) - .isEqualTo(TestMap.EnumValue.BAR.getNumber()); - assertThat(testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(-1000, -1)).isEqualTo(-1); + assertEquals( + TestMap.EnumValue.BAR.getNumber(), + testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(2, -1)); + assertEquals(-1, testMapOrBuilder.getInt32ToEnumFieldValueOrDefault(-1000, -1)); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)).isNull(); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrDefault(1, null)); + assertNull(testMapOrBuilder.getInt32ToMessageFieldOrDefault(-1, null)); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)).isEqualTo(11); - assertThat(testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)).isEqualTo(-11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrDefault("1", -11)); + assertEquals(-11, testMapOrBuilder.getStringToInt32FieldOrDefault("-1", -11)); try { testMapOrBuilder.getStringToInt32FieldOrDefault(null, -11); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testGetOrThrow() { TestMap.Builder builder = TestMap.newBuilder(); assertMapCounts(0, builder); @@ -1202,116 +1136,115 @@ public class MapTest { } public void doTestGetOrThrow(TestMapOrBuilder testMapOrBuilder) { - assertThat(testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getInt32ToInt32FieldOrThrow(1)); try { testMapOrBuilder.getInt32ToInt32FieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", testMapOrBuilder.getInt32ToStringFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToStringFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), testMapOrBuilder.getInt32ToBytesFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToBytesFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, testMapOrBuilder.getInt32ToEnumFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToEnumFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToEnumFieldValueOrThrow(2)) - .isEqualTo(TestMap.EnumValue.BAR.getNumber()); + assertEquals( + TestMap.EnumValue.BAR.getNumber(), testMapOrBuilder.getInt32ToEnumFieldValueOrThrow(2)); try { testMapOrBuilder.getInt32ToEnumFieldValueOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)) - .isEqualTo(MessageValue.newBuilder().setValue(11).build()); + assertEquals( + MessageValue.newBuilder().setValue(11).build(), + testMapOrBuilder.getInt32ToMessageFieldOrThrow(1)); try { testMapOrBuilder.getInt32ToMessageFieldOrThrow(-1); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } - assertThat(testMapOrBuilder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, testMapOrBuilder.getStringToInt32FieldOrThrow("1")); try { testMapOrBuilder.getStringToInt32FieldOrThrow("-1"); - assertWithMessage("expected exception").fail(); + fail(); } catch (IllegalArgumentException e) { // expected } try { testMapOrBuilder.getStringToInt32FieldOrThrow(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testPut() { TestMap.Builder builder = TestMap.newBuilder(); builder.putInt32ToInt32Field(1, 11); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); builder.putInt32ToStringField(1, "a"); - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("a"); + assertEquals("a", builder.getInt32ToStringFieldOrThrow(1)); try { builder.putInt32ToStringField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToBytesField(1, TestUtil.toBytes("11")); - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); try { builder.putInt32ToBytesField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToEnumField(1, TestMap.EnumValue.FOO); - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); try { builder.putInt32ToEnumField(1, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } builder.putInt32ToEnumFieldValue(1, TestMap.EnumValue.BAR.getNumber()); - assertThat(builder.getInt32ToEnumFieldValueOrThrow(1)) - .isEqualTo(TestMap.EnumValue.BAR.getNumber()); + assertEquals(TestMap.EnumValue.BAR.getNumber(), builder.getInt32ToEnumFieldValueOrThrow(1)); builder.putInt32ToEnumFieldValue(1, -1); - assertThat(builder.getInt32ToEnumFieldValueOrThrow(1)).isEqualTo(-1); - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.UNRECOGNIZED); + assertEquals(-1, builder.getInt32ToEnumFieldValueOrThrow(1)); + assertEquals(TestMap.EnumValue.UNRECOGNIZED, builder.getInt32ToEnumFieldOrThrow(1)); builder.putStringToInt32Field("a", 1); - assertThat(builder.getStringToInt32FieldOrThrow("a")).isEqualTo(1); + assertEquals(1, builder.getStringToInt32FieldOrThrow("a")); try { builder.putStringToInt32Field(null, -1); } catch (NullPointerException e) { @@ -1319,56 +1252,53 @@ public class MapTest { } } - @Test public void testRemove() { TestMap.Builder builder = TestMap.newBuilder(); setMapValuesUsingAccessors(builder); - assertThat(builder.getInt32ToInt32FieldOrThrow(1)).isEqualTo(11); + assertEquals(11, builder.getInt32ToInt32FieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToInt32Field(1); - assertThat(builder.getInt32ToInt32FieldOrDefault(1, -1)).isEqualTo(-1); + assertEquals(-1, builder.getInt32ToInt32FieldOrDefault(1, -1)); } - assertThat(builder.getInt32ToStringFieldOrThrow(1)).isEqualTo("11"); + assertEquals("11", builder.getInt32ToStringFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToStringField(1); - assertThat(builder.getInt32ToStringFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToStringFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToBytesFieldOrThrow(1)).isEqualTo(TestUtil.toBytes("11")); + assertEquals(TestUtil.toBytes("11"), builder.getInt32ToBytesFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToBytesField(1); - assertThat(builder.getInt32ToBytesFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToBytesFieldOrDefault(1, null)); } - assertThat(builder.getInt32ToEnumFieldOrThrow(1)).isEqualTo(TestMap.EnumValue.FOO); + assertEquals(TestMap.EnumValue.FOO, builder.getInt32ToEnumFieldOrThrow(1)); for (int times = 0; times < 2; times++) { builder.removeInt32ToEnumField(1); - assertThat(builder.getInt32ToEnumFieldOrDefault(1, null)).isNull(); + assertNull(builder.getInt32ToEnumFieldOrDefault(1, null)); } - assertThat(builder.getStringToInt32FieldOrThrow("1")).isEqualTo(11); + assertEquals(11, builder.getStringToInt32FieldOrThrow("1")); for (int times = 0; times < 2; times++) { builder.removeStringToInt32Field("1"); - assertThat(builder.getStringToInt32FieldOrDefault("1", -1)).isEqualTo(-1); + assertEquals(-1, builder.getStringToInt32FieldOrDefault("1", -1)); } try { builder.removeStringToInt32Field(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException e) { // expected } } - @Test public void testReservedWordsFieldNames() { - ReservedAsMapField unused1 = ReservedAsMapField.getDefaultInstance(); - ReservedAsMapFieldWithEnumValue unused2 = ReservedAsMapFieldWithEnumValue.getDefaultInstance(); + ReservedAsMapField.newBuilder().build(); + ReservedAsMapFieldWithEnumValue.newBuilder().build(); } - @Test - public void testDeterministicSerialization() throws Exception { + public void testDeterministicSerialziation() throws Exception { TestMap.Builder builder = TestMap.newBuilder(); // int32->int32 builder.putInt32ToInt32Field(5, 1); @@ -1433,17 +1363,16 @@ public class MapTest { int64Keys.add(readMapLongKey(input)); break; default: - assertWithMessage("Unexpected fields.").fail(); + fail("Unexpected fields."); } input.popLimit(oldLimit); } - assertThat(int32Keys).containsExactly(-2, 0, 1, 4, 5).inOrder(); - assertThat(uint32Keys).containsExactly(-2, 0, 1, 4, 5).inOrder(); - assertThat(int64Keys).containsExactly(-2L, 0L, 1L, 4L, 5L).inOrder(); - assertThat(stringKeys).containsExactly("", "bar", "baz", "foo", "hello", "world").inOrder(); + assertEquals(Arrays.asList(-2, 0, 1, 4, 5), int32Keys); + assertEquals(Arrays.asList(-2, 0, 1, 4, 5), uint32Keys); + assertEquals(Arrays.asList(-2L, 0L, 1L, 4L, 5L), int64Keys); + assertEquals(Arrays.asList("", "bar", "baz", "foo", "hello", "world"), stringKeys); } - @Test public void testInitFromPartialDynamicMessage() { FieldDescriptor fieldDescriptor = TestMap.getDescriptor().findFieldByNumber(TestMap.INT32_TO_MESSAGE_FIELD_FIELD_NUMBER); @@ -1460,11 +1389,11 @@ public class MapTest { .build()) .build(); TestMap message = TestMap.newBuilder().mergeFrom(dynamicMessage).build(); - assertThat(message.getInt32ToMessageFieldMap()) - .containsEntry(10, TestMap.MessageValue.newBuilder().setValue(10).build()); + assertEquals( + TestMap.MessageValue.newBuilder().setValue(10).build(), + message.getInt32ToMessageFieldMap().get(10)); } - @Test public void testInitFromFullyDynamicMessage() { FieldDescriptor fieldDescriptor = TestMap.getDescriptor().findFieldByNumber(TestMap.INT32_TO_MESSAGE_FIELD_FIELD_NUMBER); @@ -1486,37 +1415,38 @@ public class MapTest { .build()) .build(); TestMap message = TestMap.newBuilder().mergeFrom(dynamicMessage).build(); - assertThat(message.getInt32ToMessageFieldMap()) - .containsEntry(10, TestMap.MessageValue.newBuilder().setValue(10).build()); + assertEquals( + TestMap.MessageValue.newBuilder().setValue(10).build(), + message.getInt32ToMessageFieldMap().get(10)); } private int readMapIntegerKey(CodedInputStream input) throws IOException { int tag = input.readTag(); - assertThat(tag).isEqualTo(WireFormat.makeTag(1, WireFormat.WIRETYPE_VARINT)); + assertEquals(WireFormat.makeTag(1, WireFormat.WIRETYPE_VARINT), tag); int ret = input.readInt32(); // skip the value field. input.skipField(input.readTag()); - assertThat(input.isAtEnd()).isTrue(); + assertTrue(input.isAtEnd()); return ret; } private long readMapLongKey(CodedInputStream input) throws IOException { int tag = input.readTag(); - assertThat(tag).isEqualTo(WireFormat.makeTag(1, WireFormat.WIRETYPE_VARINT)); + assertEquals(WireFormat.makeTag(1, WireFormat.WIRETYPE_VARINT), tag); long ret = input.readInt64(); // skip the value field. input.skipField(input.readTag()); - assertThat(input.isAtEnd()).isTrue(); + assertTrue(input.isAtEnd()); return ret; } private String readMapStringKey(CodedInputStream input) throws IOException { int tag = input.readTag(); - assertThat(tag).isEqualTo(WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED)); + assertEquals(WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED), tag); String ret = input.readString(); // skip the value field. input.skipField(input.readTag()); - assertThat(input.isAtEnd()).isTrue(); + assertTrue(input.isAtEnd()); return ret; } @@ -1541,55 +1471,39 @@ public class MapTest { return map; } - @Test public void testMap_withNulls() { TestMap.Builder builder = TestMap.newBuilder(); try { builder.putStringToInt32Field(null, 3); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putAllStringToInt32Field(newMap(null, 3, "hi", 4)); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putInt32ToMessageField(3, null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putAllInt32ToMessageField(MapTest.newMap(4, null, 5, null)); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } try { builder.putAllInt32ToMessageField(null); - assertWithMessage("expected exception").fail(); + fail(); } catch (NullPointerException expected) { } - assertThat(builder.build().toByteArray()).isEqualTo(new byte[0]); - } - - @Test - // https://github.com/protocolbuffers/protobuf/issues/9785 - public void testContainer() { - FieldDescriptor field = MapContainer.getDescriptor().findFieldByName("my_map"); - Descriptor entryDescriptor = field.getMessageType(); - FieldDescriptor valueDescriptor = entryDescriptor.findFieldByName("value"); - Message.Builder builder = MapContainer.newBuilder().newBuilderForField(field); - try { - builder.setField(valueDescriptor, null); - fail("Allowed null field value"); - } catch (NullPointerException expected) { - assertThat(expected).hasMessageThat().isNotNull(); - } + assertArrayEquals(new byte[0], builder.build().toByteArray()); } } diff --git a/java/core/src/test/java/com/google/protobuf/MessageTest.java b/java/core/src/test/java/com/google/protobuf/MessageTest.java index e3b4d05cb1d9ddae50f774f66ab12e55217270c6..760511b635f2f767d2ecd3273b50d750f448de2c 100644 --- a/java/core/src/test/java/com/google/protobuf/MessageTest.java +++ b/java/core/src/test/java/com/google/protobuf/MessageTest.java @@ -1,28 +1,49 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import protobuf_unittest.UnittestProto.ForeignMessage; import protobuf_unittest.UnittestProto.TestAllExtensions; import protobuf_unittest.UnittestProto.TestAllTypes; import protobuf_unittest.UnittestProto.TestRequired; import protobuf_unittest.UnittestProto.TestRequiredForeign; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Misc. unit tests for message operations that apply to both generated and dynamic messages. */ -@RunWith(JUnit4.class) -public class MessageTest { +import junit.framework.TestCase; + +/** + * Misc. unit tests for message operations that apply to both generated and dynamic messages. + * + * @author kenton@google.com Kenton Varda + */ +public class MessageTest extends TestCase { // ================================================================= // Message-merging tests. @@ -53,45 +74,41 @@ public class MessageTest { + "repeated_string: \"qux\"\n" + "repeated_string: \"bar\"\n"; - @Test public void testParsingWithNullExtensionRegistry() throws Exception { try { TestAllTypes.parseFrom(new byte[] {}, null); - assertWithMessage("Expected exception").fail(); + fail(); } catch (NullPointerException expected) { } } - @Test public void testMergeFrom() throws Exception { TestAllTypes result = TestAllTypes.newBuilder(MERGE_DEST).mergeFrom(MERGE_SOURCE).build(); - assertThat(result.toString()).isEqualTo(MERGE_RESULT_TEXT); + assertEquals(MERGE_RESULT_TEXT, result.toString()); } /** * Test merging a DynamicMessage into a GeneratedMessage. As long as they have the same * descriptor, this should work, but it is an entirely different code path. */ - @Test public void testMergeFromDynamic() throws Exception { TestAllTypes result = TestAllTypes.newBuilder(MERGE_DEST) .mergeFrom(DynamicMessage.newBuilder(MERGE_SOURCE).build()) .build(); - assertThat(result.toString()).isEqualTo(MERGE_RESULT_TEXT); + assertEquals(MERGE_RESULT_TEXT, result.toString()); } /** Test merging two DynamicMessages. */ - @Test public void testDynamicMergeFrom() throws Exception { DynamicMessage result = DynamicMessage.newBuilder(MERGE_DEST) .mergeFrom(DynamicMessage.newBuilder(MERGE_SOURCE).build()) .build(); - assertThat(result.toString()).isEqualTo(MERGE_RESULT_TEXT); + assertEquals(MERGE_RESULT_TEXT, result.toString()); } // ================================================================= @@ -101,111 +118,103 @@ public class MessageTest { private static final TestRequired TEST_REQUIRED_INITIALIZED = TestRequired.newBuilder().setA(1).setB(2).setC(3).build(); - @Test public void testRequired() throws Exception { TestRequired.Builder builder = TestRequired.newBuilder(); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setA(1); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setB(1); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setC(1); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); } - @Test public void testRequiredForeign() throws Exception { TestRequiredForeign.Builder builder = TestRequiredForeign.newBuilder(); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); builder.setOptionalMessage(TEST_REQUIRED_UNINITIALIZED); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setOptionalMessage(TEST_REQUIRED_INITIALIZED); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); builder.addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setRepeatedMessage(0, TEST_REQUIRED_INITIALIZED); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); } - @Test public void testRequiredExtension() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); builder.setExtension(TestRequired.single, TEST_REQUIRED_UNINITIALIZED); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setExtension(TestRequired.single, TEST_REQUIRED_INITIALIZED); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); builder.addExtension(TestRequired.multi, TEST_REQUIRED_UNINITIALIZED); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setExtension(TestRequired.multi, 0, TEST_REQUIRED_INITIALIZED); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); } - @Test public void testRequiredDynamic() throws Exception { Descriptors.Descriptor descriptor = TestRequired.getDescriptor(); DynamicMessage.Builder builder = DynamicMessage.newBuilder(descriptor); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setField(descriptor.findFieldByName("a"), 1); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setField(descriptor.findFieldByName("b"), 1); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setField(descriptor.findFieldByName("c"), 1); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); } - @Test public void testRequiredDynamicForeign() throws Exception { Descriptors.Descriptor descriptor = TestRequiredForeign.getDescriptor(); DynamicMessage.Builder builder = DynamicMessage.newBuilder(descriptor); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); builder.setField(descriptor.findFieldByName("optional_message"), TEST_REQUIRED_UNINITIALIZED); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setField(descriptor.findFieldByName("optional_message"), TEST_REQUIRED_INITIALIZED); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); builder.addRepeatedField( descriptor.findFieldByName("repeated_message"), TEST_REQUIRED_UNINITIALIZED); - assertThat(builder.isInitialized()).isFalse(); + assertFalse(builder.isInitialized()); builder.setRepeatedField( descriptor.findFieldByName("repeated_message"), 0, TEST_REQUIRED_INITIALIZED); - assertThat(builder.isInitialized()).isTrue(); + assertTrue(builder.isInitialized()); } - @Test public void testUninitializedException() throws Exception { try { TestRequired.newBuilder().build(); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UninitializedMessageException e) { - assertThat(e).hasMessageThat().isEqualTo("Message missing required fields: a, b, c"); + assertEquals("Message missing required fields: a, b, c", e.getMessage()); } } - @Test public void testBuildPartial() throws Exception { // We're mostly testing that no exception is thrown. TestRequired message = TestRequired.newBuilder().buildPartial(); - assertThat(message.isInitialized()).isFalse(); + assertFalse(message.isInitialized()); } - @Test public void testNestedUninitializedException() throws Exception { try { TestRequiredForeign.newBuilder() @@ -213,25 +222,23 @@ public class MessageTest { .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) .build(); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UninitializedMessageException e) { - assertThat(e) - .hasMessageThat() - .isEqualTo( - "Message missing required fields: " - + "optional_message.a, " - + "optional_message.b, " - + "optional_message.c, " - + "repeated_message[0].a, " - + "repeated_message[0].b, " - + "repeated_message[0].c, " - + "repeated_message[1].a, " - + "repeated_message[1].b, " - + "repeated_message[1].c"); + assertEquals( + "Message missing required fields: " + + "optional_message.a, " + + "optional_message.b, " + + "optional_message.c, " + + "repeated_message[0].a, " + + "repeated_message[0].b, " + + "repeated_message[0].c, " + + "repeated_message[1].a, " + + "repeated_message[1].b, " + + "repeated_message[1].c", + e.getMessage()); } } - @Test public void testBuildNestedPartial() throws Exception { // We're mostly testing that no exception is thrown. TestRequiredForeign message = @@ -240,20 +247,18 @@ public class MessageTest { .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) .addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED) .buildPartial(); - assertThat(message.isInitialized()).isFalse(); + assertFalse(message.isInitialized()); } - @Test public void testParseUnititialized() throws Exception { try { TestRequired.parseFrom(ByteString.EMPTY); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { - assertThat(e).hasMessageThat().isEqualTo("Message missing required fields: a, b, c"); + assertEquals("Message missing required fields: a, b, c", e.getMessage()); } } - @Test public void testParseNestedUnititialized() throws Exception { ByteString data = TestRequiredForeign.newBuilder() @@ -265,73 +270,66 @@ public class MessageTest { try { TestRequiredForeign.parseFrom(data); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { - assertThat(e) - .hasMessageThat() - .isEqualTo( - "Message missing required fields: " - + "optional_message.a, " - + "optional_message.b, " - + "optional_message.c, " - + "repeated_message[0].a, " - + "repeated_message[0].b, " - + "repeated_message[0].c, " - + "repeated_message[1].a, " - + "repeated_message[1].b, " - + "repeated_message[1].c"); + assertEquals( + "Message missing required fields: " + + "optional_message.a, " + + "optional_message.b, " + + "optional_message.c, " + + "repeated_message[0].a, " + + "repeated_message[0].b, " + + "repeated_message[0].c, " + + "repeated_message[1].a, " + + "repeated_message[1].b, " + + "repeated_message[1].c", + e.getMessage()); } } - @Test public void testDynamicUninitializedException() throws Exception { try { DynamicMessage.newBuilder(TestRequired.getDescriptor()).build(); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UninitializedMessageException e) { - assertThat(e).hasMessageThat().isEqualTo("Message missing required fields: a, b, c"); + assertEquals("Message missing required fields: a, b, c", e.getMessage()); } } - @Test public void testDynamicBuildPartial() throws Exception { // We're mostly testing that no exception is thrown. DynamicMessage message = DynamicMessage.newBuilder(TestRequired.getDescriptor()).buildPartial(); - assertThat(message.isInitialized()).isFalse(); + assertFalse(message.isInitialized()); } - @Test public void testDynamicParseUnititialized() throws Exception { try { Descriptors.Descriptor descriptor = TestRequired.getDescriptor(); DynamicMessage.parseFrom(descriptor, ByteString.EMPTY); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (InvalidProtocolBufferException e) { - assertThat(e).hasMessageThat().isEqualTo("Message missing required fields: a, b, c"); + assertEquals("Message missing required fields: a, b, c", e.getMessage()); } } /** Test reading unset repeated message from DynamicMessage. */ - @Test public void testDynamicRepeatedMessageNull() throws Exception { - Descriptors.Descriptor unused = TestRequired.getDescriptor(); + TestRequired.getDescriptor(); DynamicMessage result = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()) .mergeFrom(DynamicMessage.newBuilder(MERGE_SOURCE).build()) .build(); - assertThat( - result.getField( - result.getDescriptorForType().findFieldByName("repeated_foreign_message"))) - .isInstanceOf(List.class); - assertThat( - result.getRepeatedFieldCount( - result.getDescriptorForType().findFieldByName("repeated_foreign_message"))) - .isEqualTo(0); + assertTrue( + result.getField(result.getDescriptorForType().findFieldByName("repeated_foreign_message")) + instanceof List); + assertEquals( + 0, + result.getRepeatedFieldCount( + result.getDescriptorForType().findFieldByName("repeated_foreign_message"))); } /** Test reading repeated message from DynamicMessage. */ - @Test public void testDynamicRepeatedMessageNotNull() throws Exception { TestAllTypes repeatedNested = TestAllTypes.newBuilder() @@ -342,49 +340,18 @@ public class MessageTest { .addRepeatedForeignMessage(ForeignMessage.getDefaultInstance()) .addRepeatedForeignMessage(ForeignMessage.getDefaultInstance()) .build(); - Descriptors.Descriptor unused = TestRequired.getDescriptor(); + TestRequired.getDescriptor(); DynamicMessage result = DynamicMessage.newBuilder(TestAllTypes.getDescriptor()) .mergeFrom(DynamicMessage.newBuilder(repeatedNested).build()) .build(); - assertThat( - result.getField( - result.getDescriptorForType().findFieldByName("repeated_foreign_message"))) - .isInstanceOf(List.class); - assertThat( - result.getRepeatedFieldCount( - result.getDescriptorForType().findFieldByName("repeated_foreign_message"))) - .isEqualTo(2); - } - - @Test - public void testPreservesFloatingPointNegative0() throws Exception { - proto3_unittest.UnittestProto3.TestAllTypes message = - proto3_unittest.UnittestProto3.TestAllTypes.newBuilder() - .setOptionalFloat(-0.0f) - .setOptionalDouble(-0.0) - .build(); - assertThat( - proto3_unittest.UnittestProto3.TestAllTypes.parseFrom( - message.toByteString(), ExtensionRegistry.getEmptyRegistry())) - .isEqualTo(message); - } - - @Test - public void testNegative0FloatingPointEquality() throws Exception { - // Like Double#equals and Float#equals, we treat -0.0 as not being equal to +0.0 even though - // IEEE 754 mandates that they are equivalent. This test asserts that behavior. - proto3_unittest.UnittestProto3.TestAllTypes message1 = - proto3_unittest.UnittestProto3.TestAllTypes.newBuilder() - .setOptionalFloat(-0.0f) - .setOptionalDouble(-0.0) - .build(); - proto3_unittest.UnittestProto3.TestAllTypes message2 = - proto3_unittest.UnittestProto3.TestAllTypes.newBuilder() - .setOptionalFloat(0.0f) - .setOptionalDouble(0.0) - .build(); - assertThat(message1).isNotEqualTo(message2); + assertTrue( + result.getField(result.getDescriptorForType().findFieldByName("repeated_foreign_message")) + instanceof List); + assertEquals( + 2, + result.getRepeatedFieldCount( + result.getDescriptorForType().findFieldByName("repeated_foreign_message"))); } } diff --git a/java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java b/java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java index 39e0b5dba40baa3d7e7ba25f1342a009bc704935..1af3f93c86b8e6857a32cb7067f58f302245f34f 100644 --- a/java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java +++ b/java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java @@ -1,53 +1,50 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import protobuf_unittest.Engine; -import protobuf_unittest.TimingBelt; import protobuf_unittest.Vehicle; import protobuf_unittest.Wheel; import java.util.ArrayList; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Test cases that exercise end-to-end use cases involving {@link SingleFieldBuilder} and {@link * RepeatedFieldBuilder}. + * + * @author jonp@google.com (Jon Perlow) */ -@RunWith(JUnit4.class) -public class NestedBuildersTest { - - @Test - public void test3LayerPropagationWithIntermediateClear() { - Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); - vehicleBuilder.getEngineBuilder().getTimingBeltBuilder(); - - // This step detaches the TimingBelt.Builder (though it leaves a SingleFieldBuilder in place) - vehicleBuilder.getEngineBuilder().clear(); - - // These steps build the middle and top level messages, it used to leave the vestigial - // TimingBelt.Builder in a state where further changes didn't propagate anymore - Object unused = vehicleBuilder.getEngineBuilder().build(); - unused = vehicleBuilder.build(); - - TimingBelt expected = TimingBelt.newBuilder().setNumberOfTeeth(124).build(); - vehicleBuilder.getEngineBuilder().setTimingBelt(expected); - // Testing that b/254158939 is fixed. It used to be that the setTimingBelt call above didn't - // propagate a change notification and the call below would return a stale version of the timing - // belt. - assertThat(vehicleBuilder.getEngine().getTimingBelt()).isEqualTo(expected); - } +public class NestedBuildersTest extends TestCase { - @Test public void testMessagesAndBuilders() { Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); vehicleBuilder.addWheelBuilder().setRadius(4).setWidth(1); @@ -57,13 +54,13 @@ public class NestedBuildersTest { vehicleBuilder.getEngineBuilder().setLiters(10); Vehicle vehicle = vehicleBuilder.build(); - assertThat(vehicle.getWheelCount()).isEqualTo(4); + assertEquals(4, vehicle.getWheelCount()); for (int i = 0; i < 4; i++) { Wheel wheel = vehicle.getWheel(i); - assertThat(wheel.getRadius()).isEqualTo(4); - assertThat(wheel.getWidth()).isEqualTo(i + 1); + assertEquals(4, wheel.getRadius()); + assertEquals(i + 1, wheel.getWidth()); } - assertThat(vehicle.getEngine().getLiters()).isEqualTo(10); + assertEquals(10, vehicle.getEngine().getLiters()); for (int i = 0; i < 4; i++) { vehicleBuilder.getWheelBuilder(i).setRadius(5).setWidth(i + 10); @@ -73,17 +70,16 @@ public class NestedBuildersTest { vehicle = vehicleBuilder.build(); for (int i = 0; i < 4; i++) { Wheel wheel = vehicle.getWheel(i); - assertThat(wheel.getRadius()).isEqualTo(5); - assertThat(wheel.getWidth()).isEqualTo(i + 10); + assertEquals(5, wheel.getRadius()); + assertEquals(i + 10, wheel.getWidth()); } - assertThat(vehicle.getEngine().getLiters()).isEqualTo(20); - assertThat(vehicle.hasEngine()).isTrue(); + assertEquals(20, vehicle.getEngine().getLiters()); + assertTrue(vehicle.hasEngine()); engineBuilder.setLiters(50); - assertThat(vehicleBuilder.getEngine().getLiters()).isEqualTo(50); + assertEquals(50, vehicleBuilder.getEngine().getLiters()); } - @Test public void testMessagesAreCached() { Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); vehicleBuilder.addWheelBuilder().setRadius(1).setWidth(2); @@ -94,7 +90,7 @@ public class NestedBuildersTest { // Make sure messages are cached. List wheels = new ArrayList(vehicleBuilder.getWheelList()); for (int i = 0; i < wheels.size(); i++) { - assertThat(wheels.get(i)).isSameInstanceAs(vehicleBuilder.getWheel(i)); + assertSame(wheels.get(i), vehicleBuilder.getWheel(i)); } // Now get builders and check they didn't change. @@ -102,7 +98,7 @@ public class NestedBuildersTest { vehicleBuilder.getWheel(i); } for (int i = 0; i < wheels.size(); i++) { - assertThat(wheels.get(i)).isSameInstanceAs(vehicleBuilder.getWheel(i)); + assertSame(wheels.get(i), vehicleBuilder.getWheel(i)); } // Change just one @@ -111,36 +107,33 @@ public class NestedBuildersTest { // Now get wheels and check that only that one changed for (int i = 0; i < wheels.size(); i++) { if (i < 3) { - assertThat(wheels.get(i)).isSameInstanceAs(vehicleBuilder.getWheel(i)); + assertSame(wheels.get(i), vehicleBuilder.getWheel(i)); } else { - assertThat(wheels.get(i)).isNotSameInstanceAs(vehicleBuilder.getWheel(i)); + assertNotSame(wheels.get(i), vehicleBuilder.getWheel(i)); } } } - @Test public void testRemove_WithNestedBuilders() { Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); vehicleBuilder.addWheelBuilder().setRadius(1).setWidth(1); vehicleBuilder.addWheelBuilder().setRadius(2).setWidth(2); vehicleBuilder.removeWheel(0); - assertThat(vehicleBuilder.getWheelCount()).isEqualTo(1); - assertThat(vehicleBuilder.getWheel(0).getRadius()).isEqualTo(2); + assertEquals(1, vehicleBuilder.getWheelCount()); + assertEquals(2, vehicleBuilder.getWheel(0).getRadius()); } - @Test public void testRemove_WithNestedMessages() { Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); vehicleBuilder.addWheel(Wheel.newBuilder().setRadius(1).setWidth(1)); vehicleBuilder.addWheel(Wheel.newBuilder().setRadius(2).setWidth(2)); vehicleBuilder.removeWheel(0); - assertThat(vehicleBuilder.getWheelCount()).isEqualTo(1); - assertThat(vehicleBuilder.getWheel(0).getRadius()).isEqualTo(2); + assertEquals(1, vehicleBuilder.getWheelCount()); + assertEquals(2, vehicleBuilder.getWheel(0).getRadius()); } - @Test public void testMerge() { Vehicle vehicle1 = Vehicle.newBuilder() @@ -150,17 +143,16 @@ public class NestedBuildersTest { Vehicle vehicle2 = Vehicle.newBuilder().mergeFrom(vehicle1).build(); // List should be the same -- no allocation - assertThat(vehicle1.getWheelList()).isSameInstanceAs(vehicle2.getWheelList()); + assertSame(vehicle1.getWheelList(), vehicle2.getWheelList()); Vehicle vehicle3 = vehicle1.toBuilder().build(); - assertThat(vehicle1.getWheelList()).isSameInstanceAs(vehicle3.getWheelList()); + assertSame(vehicle1.getWheelList(), vehicle3.getWheelList()); } - @Test public void testGettingBuilderMarksFieldAsHaving() { Vehicle.Builder vehicleBuilder = Vehicle.newBuilder(); vehicleBuilder.getEngineBuilder(); Vehicle vehicle = vehicleBuilder.buildPartial(); - assertThat(vehicle.hasEngine()).isTrue(); + assertTrue(vehicle.hasEngine()); } } diff --git a/java/core/src/test/java/com/google/protobuf/NioByteStringTest.java b/java/core/src/test/java/com/google/protobuf/NioByteStringTest.java index aa4523a450522033a8bc8c3cdd5ab65626e692f3..489bb7c10283c862d29bfb532c2756ad188993b5 100644 --- a/java/core/src/test/java/com/google/protobuf/NioByteStringTest.java +++ b/java/core/src/test/java/com/google/protobuf/NioByteStringTest.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static com.google.protobuf.Internal.UTF_8; import java.io.ByteArrayInputStream; @@ -25,13 +46,10 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.List; import java.util.NoSuchElementException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Tests for {@link NioByteString}. */ -@RunWith(JUnit4.class) -public class NioByteStringTest { +public class NioByteStringTest extends TestCase { private static final ByteString EMPTY = new NioByteString(ByteBuffer.wrap(new byte[0])); private static final String CLASSNAME = NioByteString.class.getSimpleName(); private static final byte[] BYTES = ByteStringTest.getTestBytes(1234, 11337766L); @@ -40,12 +58,9 @@ public class NioByteStringTest { private final ByteBuffer backingBuffer = ByteBuffer.wrap(BYTES.clone()); private final ByteString testString = new NioByteString(backingBuffer); - @Test public void testExpectedType() { String actualClassName = getActualClassName(testString); - assertWithMessage("%s should match type exactly", CLASSNAME) - .that(CLASSNAME) - .isEqualTo(actualClassName); + assertEquals(CLASSNAME + " should match type exactly", CLASSNAME, actualClassName); } protected String getActualClassName(Object object) { @@ -54,36 +69,31 @@ public class NioByteStringTest { return actualClassName; } - @Test public void testByteAt() { boolean stillEqual = true; for (int i = 0; stillEqual && i < BYTES.length; ++i) { stillEqual = (BYTES[i] == testString.byteAt(i)); } - assertWithMessage("%s must capture the right bytes", CLASSNAME).that(stillEqual).isTrue(); + assertTrue(CLASSNAME + " must capture the right bytes", stillEqual); } - @Test public void testByteIterator() { boolean stillEqual = true; ByteString.ByteIterator iter = testString.iterator(); for (int i = 0; stillEqual && i < BYTES.length; ++i) { stillEqual = (iter.hasNext() && BYTES[i] == iter.nextByte()); } - assertWithMessage("%s must capture the right bytes", CLASSNAME).that(stillEqual).isTrue(); - assertWithMessage("%s must have exhausted the iterator", CLASSNAME) - .that(iter.hasNext()) - .isFalse(); + assertTrue(CLASSNAME + " must capture the right bytes", stillEqual); + assertFalse(CLASSNAME + " must have exhausted the iterator", iter.hasNext()); try { iter.nextByte(); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NoSuchElementException e) { // This is success } } - @Test public void testByteIterable() { boolean stillEqual = true; int j = 0; @@ -91,34 +101,22 @@ public class NioByteStringTest { stillEqual = (BYTES[j] == quantum); ++j; } - assertWithMessage("%s must capture the right bytes as Bytes", CLASSNAME) - .that(stillEqual) - .isTrue(); - assertWithMessage("%s iterable character count", CLASSNAME).that(BYTES).hasLength(j); + assertTrue(CLASSNAME + " must capture the right bytes as Bytes", stillEqual); + assertEquals(CLASSNAME + " iterable character count", BYTES.length, j); } - @Test public void testSize() { - assertWithMessage("%s must have the expected size", CLASSNAME) - .that(BYTES) - .hasLength(testString.size()); + assertEquals(CLASSNAME + " must have the expected size", BYTES.length, testString.size()); } - @Test public void testGetTreeDepth() { - assertWithMessage("%s must have depth 0", CLASSNAME) - .that(testString.getTreeDepth()) - .isEqualTo(0); + assertEquals(CLASSNAME + " must have depth 0", 0, testString.getTreeDepth()); } - @Test public void testIsBalanced() { - assertWithMessage("%s is technically balanced", CLASSNAME) - .that(testString.isBalanced()) - .isTrue(); + assertTrue(CLASSNAME + " is technically balanced", testString.isBalanced()); } - @Test public void testCopyTo_ByteArrayOffsetLength() { int destinationOffset = 50; int length = 100; @@ -129,12 +127,9 @@ public class NioByteStringTest { for (int i = 0; stillEqual && i < length; ++i) { stillEqual = BYTES[i + sourceOffset] == destination[i + destinationOffset]; } - assertWithMessage("%s.copyTo(4 arg) must give the expected bytes", CLASSNAME) - .that(stillEqual) - .isTrue(); + assertTrue(CLASSNAME + ".copyTo(4 arg) must give the expected bytes", stillEqual); } - @Test public void testCopyTo_ByteArrayOffsetLengthErrors() { int destinationOffset = 50; int length = 100; @@ -143,9 +138,7 @@ public class NioByteStringTest { try { // Copy one too many bytes testString.copyTo(destination, testString.size() + 1 - length, destinationOffset, length); - assertWithMessage( - "Should have thrown an exception when copying too many bytes of a %s", CLASSNAME) - .fail(); + fail("Should have thrown an exception when copying too many bytes of a " + CLASSNAME); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -153,10 +146,7 @@ public class NioByteStringTest { try { // Copy with illegal negative sourceOffset testString.copyTo(destination, -1, destinationOffset, length); - assertWithMessage( - "Should have thrown an exception when given a negative sourceOffset in %s ", - CLASSNAME) - .fail(); + fail("Should have thrown an exception when given a negative sourceOffset in " + CLASSNAME); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -164,10 +154,9 @@ public class NioByteStringTest { try { // Copy with illegal negative destinationOffset testString.copyTo(destination, 0, -1, length); - assertWithMessage( - "Should have thrown an exception when given a negative destinationOffset in %s", - CLASSNAME) - .fail(); + fail( + "Should have thrown an exception when given a negative destinationOffset in " + + CLASSNAME); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -175,9 +164,7 @@ public class NioByteStringTest { try { // Copy with illegal negative size testString.copyTo(destination, 0, 0, -1); - assertWithMessage( - "Should have thrown an exception when given a negative size in %s", CLASSNAME) - .fail(); + fail("Should have thrown an exception when given a negative size in " + CLASSNAME); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -185,10 +172,9 @@ public class NioByteStringTest { try { // Copy with illegal too-large sourceOffset testString.copyTo(destination, 2 * testString.size(), 0, length); - assertWithMessage( - "Should have thrown an exception when the destinationOffset is too large in %s", - CLASSNAME) - .fail(); + fail( + "Should have thrown an exception when the destinationOffset is too large in " + + CLASSNAME); } catch (IndexOutOfBoundsException expected) { // This is success } @@ -196,38 +182,33 @@ public class NioByteStringTest { try { // Copy with illegal too-large destinationOffset testString.copyTo(destination, 0, 2 * destination.length, length); - assertWithMessage( - "Should have thrown an exception when the destinationOffset is too large in %s", - CLASSNAME) - .fail(); + fail( + "Should have thrown an exception when the destinationOffset is too large in " + + CLASSNAME); } catch (IndexOutOfBoundsException expected) { // This is success } } - @Test public void testCopyTo_ByteBuffer() { // Same length. ByteBuffer myBuffer = ByteBuffer.allocate(BYTES.length); testString.copyTo(myBuffer); myBuffer.flip(); - assertWithMessage("%s.copyTo(ByteBuffer) must give back the same bytes", CLASSNAME) - .that(backingBuffer) - .isEqualTo(myBuffer); + assertEquals( + CLASSNAME + ".copyTo(ByteBuffer) must give back the same bytes", backingBuffer, myBuffer); // Target buffer bigger than required. myBuffer = ByteBuffer.allocate(testString.size() + 1); testString.copyTo(myBuffer); myBuffer.flip(); - assertThat(backingBuffer).isEqualTo(myBuffer); + assertEquals(backingBuffer, myBuffer); // Target buffer has no space. myBuffer = ByteBuffer.allocate(0); try { testString.copyTo(myBuffer); - assertWithMessage( - "Should have thrown an exception when target ByteBuffer has insufficient capacity") - .fail(); + fail("Should have thrown an exception when target ByteBuffer has insufficient capacity"); } catch (BufferOverflowException e) { // Expected. } @@ -236,23 +217,17 @@ public class NioByteStringTest { myBuffer = ByteBuffer.allocate(1); try { testString.copyTo(myBuffer); - assertWithMessage( - "Should have thrown an exception when target ByteBuffer has insufficient capacity") - .fail(); + fail("Should have thrown an exception when target ByteBuffer has insufficient capacity"); } catch (BufferOverflowException e) { // Expected. } } - @Test public void testMarkSupported() { InputStream stream = testString.newInput(); - assertWithMessage("%s.newInput() must support marking", CLASSNAME) - .that(stream.markSupported()) - .isTrue(); + assertTrue(CLASSNAME + ".newInput() must support marking", stream.markSupported()); } - @Test public void testMarkAndReset() throws IOException { int fraction = testString.size() / 3; @@ -260,18 +235,21 @@ public class NioByteStringTest { stream.mark(testString.size()); // First, mark() the end. skipFully(stream, fraction); // Skip a large fraction, but not all. - assertWithMessage("%s: after skipping to the 'middle', half the bytes are available", CLASSNAME) - .that((testString.size() - fraction)) - .isEqualTo(stream.available()); + assertEquals( + CLASSNAME + ": after skipping to the 'middle', half the bytes are available", + (testString.size() - fraction), + stream.available()); stream.reset(); - assertWithMessage("%s: after resetting, all bytes are available", CLASSNAME) - .that(testString.size()) - .isEqualTo(stream.available()); + assertEquals( + CLASSNAME + ": after resetting, all bytes are available", + testString.size(), + stream.available()); skipFully(stream, testString.size()); // Skip to the end. - assertWithMessage("%s: after skipping to the end, no more bytes are available", CLASSNAME) - .that(stream.available()) - .isEqualTo(0); + assertEquals( + CLASSNAME + ": after skipping to the end, no more bytes are available", + 0, + stream.available()); } /** @@ -307,55 +285,50 @@ public class NioByteStringTest { } } - @Test public void testAsReadOnlyByteBuffer() { ByteBuffer byteBuffer = testString.asReadOnlyByteBuffer(); byte[] roundTripBytes = new byte[BYTES.length]; - assertThat(byteBuffer.remaining() == BYTES.length).isTrue(); - assertThat(byteBuffer.isReadOnly()).isTrue(); + assertTrue(byteBuffer.remaining() == BYTES.length); + assertTrue(byteBuffer.isReadOnly()); byteBuffer.get(roundTripBytes); - assertWithMessage("%s.asReadOnlyByteBuffer() must give back the same bytes", CLASSNAME) - .that(Arrays.equals(BYTES, roundTripBytes)) - .isTrue(); + assertTrue( + CLASSNAME + ".asReadOnlyByteBuffer() must give back the same bytes", + Arrays.equals(BYTES, roundTripBytes)); } - @Test public void testAsReadOnlyByteBufferList() { List byteBuffers = testString.asReadOnlyByteBufferList(); int bytesSeen = 0; byte[] roundTripBytes = new byte[BYTES.length]; for (ByteBuffer byteBuffer : byteBuffers) { int thisLength = byteBuffer.remaining(); - assertThat(byteBuffer.isReadOnly()).isTrue(); - assertThat(bytesSeen + thisLength <= BYTES.length).isTrue(); + assertTrue(byteBuffer.isReadOnly()); + assertTrue(bytesSeen + thisLength <= BYTES.length); byteBuffer.get(roundTripBytes, bytesSeen, thisLength); bytesSeen += thisLength; } - assertThat(BYTES).hasLength(bytesSeen); - assertWithMessage("%s.asReadOnlyByteBufferTest() must give back the same bytes", CLASSNAME) - .that(Arrays.equals(BYTES, roundTripBytes)) - .isTrue(); + assertTrue(bytesSeen == BYTES.length); + assertTrue( + CLASSNAME + ".asReadOnlyByteBufferTest() must give back the same bytes", + Arrays.equals(BYTES, roundTripBytes)); } - @Test public void testToByteArray() { byte[] roundTripBytes = testString.toByteArray(); - assertWithMessage("%s.toByteArray() must give back the same bytes", CLASSNAME) - .that(Arrays.equals(BYTES, roundTripBytes)) - .isTrue(); + assertTrue( + CLASSNAME + ".toByteArray() must give back the same bytes", + Arrays.equals(BYTES, roundTripBytes)); } - @Test public void testWriteTo() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); testString.writeTo(bos); byte[] roundTripBytes = bos.toByteArray(); - assertWithMessage("%s.writeTo() must give back the same bytes", CLASSNAME) - .that(Arrays.equals(BYTES, roundTripBytes)) - .isTrue(); + assertTrue( + CLASSNAME + ".writeTo() must give back the same bytes", + Arrays.equals(BYTES, roundTripBytes)); } - @Test public void testWriteToShouldNotExposeInternalBufferToOutputStream() throws IOException { OutputStream os = new OutputStream() { @@ -372,12 +345,11 @@ public class NioByteStringTest { byte[] original = Arrays.copyOf(BYTES, BYTES.length); testString.writeTo(os); - assertWithMessage("%s.writeTo() must NOT grant access to underlying buffer", CLASSNAME) - .that(Arrays.equals(original, BYTES)) - .isTrue(); + assertTrue( + CLASSNAME + ".writeTo() must NOT grant access to underlying buffer", + Arrays.equals(original, BYTES)); } - @Test public void testWriteToInternalShouldExposeInternalBufferToOutputStream() throws IOException { OutputStream os = new OutputStream() { @@ -394,12 +366,11 @@ public class NioByteStringTest { testString.writeToInternal(os, 0, testString.size()); byte[] allZeros = new byte[testString.size()]; - assertWithMessage("%s.writeToInternal() must grant access to underlying buffer", CLASSNAME) - .that(Arrays.equals(allZeros, backingBuffer.array())) - .isTrue(); + assertTrue( + CLASSNAME + ".writeToInternal() must grant access to underlying buffer", + Arrays.equals(allZeros, backingBuffer.array())); } - @Test public void testWriteToShouldExposeInternalBufferToByteOutput() throws IOException { ByteOutput out = new ByteOutput() { @@ -432,157 +403,128 @@ public class NioByteStringTest { testString.writeTo(out); byte[] allZeros = new byte[testString.size()]; - assertWithMessage("%s.writeTo() must grant access to underlying buffer", CLASSNAME) - .that(Arrays.equals(allZeros, backingBuffer.array())) - .isTrue(); + assertTrue( + CLASSNAME + ".writeTo() must grant access to underlying buffer", + Arrays.equals(allZeros, backingBuffer.array())); } - @Test public void testNewOutput() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteString.Output output = ByteString.newOutput(); testString.writeTo(output); - assertWithMessage("Output Size returns correct result") - .that(output.size()) - .isEqualTo(testString.size()); + assertEquals("Output Size returns correct result", output.size(), testString.size()); output.writeTo(bos); - assertWithMessage("Output.writeTo() must give back the same bytes") - .that(Arrays.equals(BYTES, bos.toByteArray())) - .isTrue(); + assertTrue( + "Output.writeTo() must give back the same bytes", Arrays.equals(BYTES, bos.toByteArray())); // write the output stream to itself! This should cause it to double output.writeTo(output); - assertWithMessage("Writing an output stream to itself is successful") - .that(testString.concat(testString)) - .isEqualTo(output.toByteString()); + assertEquals( + "Writing an output stream to itself is successful", + testString.concat(testString), + output.toByteString()); output.reset(); - assertWithMessage("Output.reset() resets the output").that(output.size()).isEqualTo(0); - assertWithMessage("Output.reset() resets the output") - .that(output.toByteString()) - .isEqualTo(EMPTY); + assertEquals("Output.reset() resets the output", 0, output.size()); + assertEquals("Output.reset() resets the output", EMPTY, output.toByteString()); } - @Test public void testToString() { String testString = "I love unicode \u1234\u5678 characters"; ByteString unicode = forString(testString); String roundTripString = unicode.toString(UTF_8); - assertWithMessage("%s unicode must match", CLASSNAME) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(CLASSNAME + " unicode must match", testString, roundTripString); } - @Test public void testCharsetToString() { String testString = "I love unicode \u1234\u5678 characters"; ByteString unicode = forString(testString); String roundTripString = unicode.toString(UTF_8); - assertWithMessage("%s unicode must match", CLASSNAME) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(CLASSNAME + " unicode must match", testString, roundTripString); } - @Test public void testToString_returnsCanonicalEmptyString() { - assertWithMessage("%s must be the same string references", CLASSNAME) - .that(EMPTY.toString(UTF_8)) - .isSameInstanceAs(new NioByteString(ByteBuffer.wrap(new byte[0])).toString(UTF_8)); + assertSame( + CLASSNAME + " must be the same string references", + EMPTY.toString(UTF_8), + new NioByteString(ByteBuffer.wrap(new byte[0])).toString(UTF_8)); } - @Test public void testToString_raisesException() { try { EMPTY.toString("invalid"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UnsupportedEncodingException expected) { // This is success } try { testString.toString("invalid"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UnsupportedEncodingException expected) { // This is success } } - @Test - @SuppressWarnings("TruthSelfEquals") public void testEquals() { - assertWithMessage("%s must not equal null", CLASSNAME).that(testString).isNotEqualTo(null); - assertWithMessage("%s must equal self", CLASSNAME).that(testString).isEqualTo(testString); - assertWithMessage("%s must not equal the empty string", CLASSNAME) - .that(testString) - .isNotEqualTo(EMPTY); - assertWithMessage("%s empty strings must be equal", CLASSNAME) - .that(EMPTY) - .isEqualTo(testString.substring(55, 55)); - assertWithMessage("%s must equal another string with the same value", CLASSNAME) - .that(testString) - .isEqualTo(new NioByteString(backingBuffer)); + assertEquals(CLASSNAME + " must not equal null", false, testString.equals(null)); + assertEquals(CLASSNAME + " must equal self", testString, testString); + assertFalse(CLASSNAME + " must not equal the empty string", testString.equals(EMPTY)); + assertEquals(CLASSNAME + " empty strings must be equal", EMPTY, testString.substring(55, 55)); + assertEquals( + CLASSNAME + " must equal another string with the same value", + testString, + new NioByteString(backingBuffer)); byte[] mungedBytes = mungedBytes(); - assertWithMessage("%s must not equal every string with the same length", CLASSNAME) - .that(testString.equals(new NioByteString(ByteBuffer.wrap(mungedBytes)))) - .isFalse(); + assertFalse( + CLASSNAME + " must not equal every string with the same length", + testString.equals(new NioByteString(ByteBuffer.wrap(mungedBytes)))); } - @Test public void testEqualsLiteralByteString() { ByteString literal = ByteString.copyFrom(BYTES); - assertWithMessage("%s must equal LiteralByteString with same value", CLASSNAME) - .that(literal) - .isEqualTo(testString); - assertWithMessage("%s must equal LiteralByteString with same value", CLASSNAME) - .that(testString) - .isEqualTo(literal); - assertWithMessage("%s must not equal the empty string", CLASSNAME) - .that(testString) - .isNotEqualTo(ByteString.EMPTY); - assertWithMessage("%s empty strings must be equal", CLASSNAME) - .that(ByteString.EMPTY) - .isEqualTo(testString.substring(55, 55)); + assertEquals(CLASSNAME + " must equal LiteralByteString with same value", literal, testString); + assertEquals(CLASSNAME + " must equal LiteralByteString with same value", testString, literal); + assertFalse( + CLASSNAME + " must not equal the empty string", testString.equals(ByteString.EMPTY)); + assertEquals( + CLASSNAME + " empty strings must be equal", ByteString.EMPTY, testString.substring(55, 55)); literal = ByteString.copyFrom(mungedBytes()); - assertWithMessage("%s must not equal every LiteralByteString with the same length", CLASSNAME) - .that(testString) - .isNotEqualTo(literal); - assertWithMessage("%s must not equal every LiteralByteString with the same length", CLASSNAME) - .that(literal) - .isNotEqualTo(testString); + assertFalse( + CLASSNAME + " must not equal every LiteralByteString with the same length", + testString.equals(literal)); + assertFalse( + CLASSNAME + " must not equal every LiteralByteString with the same length", + literal.equals(testString)); } - @Test public void testEqualsRopeByteString() { ByteString p1 = ByteString.copyFrom(BYTES, 0, 5); ByteString p2 = ByteString.copyFrom(BYTES, 5, BYTES.length - 5); ByteString rope = p1.concat(p2); - assertWithMessage("%s must equal RopeByteString with same value", CLASSNAME) - .that(rope) - .isEqualTo(testString); - assertWithMessage("%s must equal RopeByteString with same value", CLASSNAME) - .that(testString) - .isEqualTo(rope); - assertWithMessage("%s must not equal the empty string", CLASSNAME) - .that(testString) - .isNotEqualTo(ByteString.EMPTY.concat(ByteString.EMPTY)); - assertWithMessage("%s empty strings must be equal", CLASSNAME) - .that(ByteString.EMPTY.concat(ByteString.EMPTY)) - .isEqualTo(testString.substring(55, 55)); + assertEquals(CLASSNAME + " must equal RopeByteString with same value", rope, testString); + assertEquals(CLASSNAME + " must equal RopeByteString with same value", testString, rope); + assertFalse( + CLASSNAME + " must not equal the empty string", + testString.equals(ByteString.EMPTY.concat(ByteString.EMPTY))); + assertEquals( + CLASSNAME + " empty strings must be equal", + ByteString.EMPTY.concat(ByteString.EMPTY), + testString.substring(55, 55)); byte[] mungedBytes = mungedBytes(); p1 = ByteString.copyFrom(mungedBytes, 0, 5); p2 = ByteString.copyFrom(mungedBytes, 5, mungedBytes.length - 5); rope = p1.concat(p2); - assertWithMessage("%s must not equal every RopeByteString with the same length", CLASSNAME) - .that(testString) - .isNotEqualTo(rope); - - assertWithMessage("%s must not equal every RopeByteString with the same length", CLASSNAME) - .that(rope) - .isNotEqualTo(testString); + assertFalse( + CLASSNAME + " must not equal every RopeByteString with the same length", + testString.equals(rope)); + assertFalse( + CLASSNAME + " must not equal every RopeByteString with the same length", + rope.equals(testString)); } private byte[] mungedBytes() { @@ -592,118 +534,91 @@ public class NioByteStringTest { return mungedBytes; } - @Test public void testHashCode() { int hash = testString.hashCode(); - assertWithMessage("%s must have expected hashCode", CLASSNAME) - .that(hash) - .isEqualTo(EXPECTED_HASH); + assertEquals(CLASSNAME + " must have expected hashCode", EXPECTED_HASH, hash); } - @Test public void testPeekCachedHashCode() { ByteString newString = new NioByteString(backingBuffer); - assertWithMessage("%s.peekCachedHashCode() should return zero at first", CLASSNAME) - .that(newString.peekCachedHashCode()) - .isEqualTo(0); - int unused = newString.hashCode(); - assertWithMessage("%s.peekCachedHashCode should return zero at first", CLASSNAME) - .that(newString.peekCachedHashCode()) - .isEqualTo(EXPECTED_HASH); + assertEquals( + CLASSNAME + ".peekCachedHashCode() should return zero at first", + 0, + newString.peekCachedHashCode()); + newString.hashCode(); + assertEquals( + CLASSNAME + ".peekCachedHashCode should return zero at first", + EXPECTED_HASH, + newString.peekCachedHashCode()); } - @Test public void testPartialHash() { // partialHash() is more strenuously tested elsewhere by testing hashes of substrings. // This test would fail if the expected hash were 1. It's not. int hash = testString.partialHash(testString.size(), 0, testString.size()); - assertWithMessage("%s.partialHash() must yield expected hashCode", CLASSNAME) - .that(hash) - .isEqualTo(EXPECTED_HASH); + assertEquals(CLASSNAME + ".partialHash() must yield expected hashCode", EXPECTED_HASH, hash); } - @Test public void testNewInput() throws IOException { InputStream input = testString.newInput(); - assertWithMessage("InputStream.available() returns correct value") - .that(testString.size()) - .isEqualTo(input.available()); + assertEquals( + "InputStream.available() returns correct value", testString.size(), input.available()); boolean stillEqual = true; for (byte referenceByte : BYTES) { int expectedInt = (referenceByte & 0xFF); stillEqual = (expectedInt == input.read()); } - assertWithMessage("InputStream.available() returns correct value") - .that(input.available()) - .isEqualTo(0); - assertWithMessage("%s must give the same bytes from the InputStream", CLASSNAME) - .that(stillEqual) - .isTrue(); - assertWithMessage("%s InputStream must now be exhausted", CLASSNAME) - .that(input.read()) - .isEqualTo(-1); - } - - @Test + assertEquals("InputStream.available() returns correct value", 0, input.available()); + assertTrue(CLASSNAME + " must give the same bytes from the InputStream", stillEqual); + assertEquals(CLASSNAME + " InputStream must now be exhausted", -1, input.read()); + } + public void testNewInput_skip() throws IOException { InputStream input = testString.newInput(); int stringSize = testString.size(); int nearEndIndex = stringSize * 2 / 3; long skipped1 = input.skip(nearEndIndex); - assertWithMessage("InputStream.skip()").that(skipped1).isEqualTo(nearEndIndex); - assertWithMessage("InputStream.available()") - .that(input.available()) - .isEqualTo(stringSize - skipped1); - assertWithMessage("InputStream.mark() is available").that(input.markSupported()).isTrue(); + assertEquals("InputStream.skip()", skipped1, nearEndIndex); + assertEquals("InputStream.available()", stringSize - skipped1, input.available()); + assertTrue("InputStream.mark() is available", input.markSupported()); input.mark(0); - assertWithMessage("InputStream.skip(), read()") - .that(input.read()) - .isEqualTo(testString.byteAt(nearEndIndex) & 0xFF); - assertWithMessage("InputStream.available()") - .that(input.available()) - .isEqualTo(stringSize - skipped1 - 1); + assertEquals( + "InputStream.skip(), read()", testString.byteAt(nearEndIndex) & 0xFF, input.read()); + assertEquals("InputStream.available()", stringSize - skipped1 - 1, input.available()); long skipped2 = input.skip(stringSize); - assertWithMessage("InputStream.skip() incomplete") - .that(skipped2) - .isEqualTo(stringSize - skipped1 - 1); - assertWithMessage("InputStream.skip(), no more input").that(input.available()).isEqualTo(0); - assertWithMessage("InputStream.skip(), no more input").that(input.read()).isEqualTo(-1); + assertEquals("InputStream.skip() incomplete", skipped2, stringSize - skipped1 - 1); + assertEquals("InputStream.skip(), no more input", 0, input.available()); + assertEquals("InputStream.skip(), no more input", -1, input.read()); input.reset(); - assertWithMessage("InputStream.reset() succeeded") - .that(input.available()) - .isEqualTo(stringSize - skipped1); - assertWithMessage("InputStream.reset(), read()") - .that(input.read()) - .isEqualTo(testString.byteAt(nearEndIndex) & 0xFF); + assertEquals("InputStream.reset() succeeded", stringSize - skipped1, input.available()); + assertEquals( + "InputStream.reset(), read()", testString.byteAt(nearEndIndex) & 0xFF, input.read()); } - @Test public void testNewCodedInput() throws IOException { CodedInputStream cis = testString.newCodedInput(); byte[] roundTripBytes = cis.readRawBytes(BYTES.length); - assertWithMessage("%s must give the same bytes back from the CodedInputStream", CLASSNAME) - .that(Arrays.equals(BYTES, roundTripBytes)) - .isTrue(); - assertWithMessage("%s CodedInputStream must now be exhausted", CLASSNAME) - .that(cis.isAtEnd()) - .isTrue(); + assertTrue( + CLASSNAME + " must give the same bytes back from the CodedInputStream", + Arrays.equals(BYTES, roundTripBytes)); + assertTrue(CLASSNAME + " CodedInputStream must now be exhausted", cis.isAtEnd()); } /** * Make sure we keep things simple when concatenating with empty. See also {@link * ByteStringTest#testConcat_empty()}. */ - @Test public void testConcat_empty() { - assertWithMessage("%s concatenated with empty must give %s", CLASSNAME, CLASSNAME) - .that(testString.concat(EMPTY)) - .isSameInstanceAs(testString); - assertWithMessage("empty concatenated with %s must give %s", CLASSNAME, CLASSNAME) - .that(EMPTY.concat(testString)) - .isSameInstanceAs(testString); + assertSame( + CLASSNAME + " concatenated with empty must give " + CLASSNAME, + testString.concat(EMPTY), + testString); + assertSame( + "empty concatenated with " + CLASSNAME + " must give " + CLASSNAME, + EMPTY.concat(testString), + testString); } - @Test public void testJavaSerialization() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(out); @@ -713,8 +628,8 @@ public class NioByteStringTest { InputStream in = new ByteArrayInputStream(pickled); ObjectInputStream ois = new ObjectInputStream(in); Object o = ois.readObject(); - assertWithMessage("Didn't get a ByteString back").that(o).isInstanceOf(ByteString.class); - assertWithMessage("Should get an equal ByteString back").that(o).isEqualTo(testString); + assertTrue("Didn't get a ByteString back", o instanceof ByteString); + assertEquals("Should get an equal ByteString back", testString, o); } private static ByteString forString(String str) { diff --git a/java/core/src/test/java/com/google/protobuf/PackedFieldTest.java b/java/core/src/test/java/com/google/protobuf/PackedFieldTest.java index 619e355d3105581d6535f79ef4d5d4a5f8aa4275..2397d2ebc354c09843bde205e611a6c071c04856 100644 --- a/java/core/src/test/java/com/google/protobuf/PackedFieldTest.java +++ b/java/core/src/test/java/com/google/protobuf/PackedFieldTest.java @@ -1,24 +1,42 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import com.google.protobuf.PackedFieldTestProto.TestAllTypes; import com.google.protobuf.PackedFieldTestProto.TestAllTypes.NestedEnum; import com.google.protobuf.PackedFieldTestProto.TestUnpackedTypes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Tests primitive repeated fields in proto3 are packed in wire format. */ -@RunWith(JUnit4.class) -public class PackedFieldTest { +public class PackedFieldTest extends TestCase { static final ByteString expectedPackedRawBytes = ByteString.copyFrom( new byte[] { @@ -173,34 +191,29 @@ public class PackedFieldTest { 0x01, // repeated nested enum }); - @Test public void testPackedGeneratedMessage() throws Exception { TestAllTypes message = TestAllTypes.parseFrom(expectedPackedRawBytes); - assertThat(message.toByteString()).isEqualTo(expectedPackedRawBytes); + assertEquals(expectedPackedRawBytes, message.toByteString()); } - @Test public void testPackedDynamicMessageSerialize() throws Exception { DynamicMessage message = DynamicMessage.parseFrom(TestAllTypes.getDescriptor(), expectedPackedRawBytes); - assertThat(message.toByteString()).isEqualTo(expectedPackedRawBytes); + assertEquals(expectedPackedRawBytes, message.toByteString()); } - @Test public void testUnpackedGeneratedMessage() throws Exception { TestUnpackedTypes message = TestUnpackedTypes.parseFrom(expectedUnpackedRawBytes); - assertThat(message.toByteString()).isEqualTo(expectedUnpackedRawBytes); + assertEquals(expectedUnpackedRawBytes, message.toByteString()); } - @Test public void testUnPackedDynamicMessageSerialize() throws Exception { DynamicMessage message = DynamicMessage.parseFrom(TestUnpackedTypes.getDescriptor(), expectedUnpackedRawBytes); - assertThat(message.toByteString()).isEqualTo(expectedUnpackedRawBytes); + assertEquals(expectedUnpackedRawBytes, message.toByteString()); } // Make sure we haven't screwed up the code generation for packing fields by default. - @Test public void testPackedSerialization() throws Exception { TestAllTypes message = TestAllTypes.newBuilder() @@ -212,7 +225,7 @@ public class PackedFieldTest { while (!in.isAtEnd()) { int tag = in.readTag(); - assertThat(WireFormat.getTagWireType(tag)).isEqualTo(WireFormat.WIRETYPE_LENGTH_DELIMITED); + assertEquals(WireFormat.WIRETYPE_LENGTH_DELIMITED, WireFormat.getTagWireType(tag)); in.skipField(tag); } } diff --git a/java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java b/java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java index 688f92e634722a56897f5f070ffc1a9e4029d541..4e63ee76ae2d1696c9748cd0590f39e7e6ffd240 100644 --- a/java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java +++ b/java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java @@ -1,13 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import com.google.protobuf.DescriptorProtos.DescriptorProto; @@ -195,11 +220,11 @@ public class ParseExceptionsTest { public void messageBuilder_mergeDelimitedFrom_InputStream_malformed() throws Exception { byte[] body = new byte[80]; CodedOutputStream cos = CodedOutputStream.newInstance(body); - cos.writeUInt32NoTag(90); // Greater than bytes in stream + cos.writeRawVarint32(90); // Greater than bytes in stream cos.writeTag(DescriptorProto.ENUM_TYPE_FIELD_NUMBER, WireFormat.WIRETYPE_LENGTH_DELIMITED); - cos.writeUInt32NoTag(98); // Nested message with size larger than parent + cos.writeRawVarint32(98); // Nested message with size larger than parent cos.writeTag(1000, WireFormat.WIRETYPE_LENGTH_DELIMITED); - cos.writeUInt32NoTag(100); // Unknown field with size larger than parent + cos.writeRawVarint32(100); // Unknown field with size larger than parent ByteArrayInputStream bais = new ByteArrayInputStream(body); try { DescriptorProto.parseDelimitedFrom(bais); @@ -225,8 +250,9 @@ public class ParseExceptionsTest { private void verifyExceptions(ParseTester parseTester) { // No exception try { - assertThat(parseTester.parse(new ByteArrayInputStream(serializedProto))) - .isEqualTo(DescriptorProto.getDescriptor().toProto()); + assertEquals( + DescriptorProto.getDescriptor().toProto(), + parseTester.parse(new ByteArrayInputStream(serializedProto))); } catch (IOException e) { fail("No exception expected: " + e); } @@ -237,7 +263,7 @@ public class ParseExceptionsTest { parseTester.parse(broken(new ByteArrayInputStream(serializedProto))); fail("IOException expected but not thrown"); } catch (IOException e) { - assertThat(e).isNotInstanceOf(InvalidProtocolBufferException.class); + assertFalse(e instanceof InvalidProtocolBufferException); } // InvalidProtocolBufferException @@ -249,7 +275,7 @@ public class ParseExceptionsTest { parseTester.parse(new ByteArrayInputStream(serializedProto)); fail("InvalidProtocolBufferException expected but not thrown"); } catch (IOException e) { - assertThat(e).isInstanceOf(InvalidProtocolBufferException.class); + assertTrue(e instanceof InvalidProtocolBufferException); } } diff --git a/java/core/src/test/java/com/google/protobuf/ParserLiteTest.java b/java/core/src/test/java/com/google/protobuf/ParserLiteTest.java index 60256465f3a81bb9ea124db2236da3b4f20cbdce..eb2dc3dd24b04f2820294a179edab613f8733436 100644 --- a/java/core/src/test/java/com/google/protobuf/ParserLiteTest.java +++ b/java/core/src/test/java/com/google/protobuf/ParserLiteTest.java @@ -1,32 +1,44 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - -import com.google.protobuf.UnittestLite.TestAllExtensionsLite; import com.google.protobuf.UnittestLite.TestAllTypesLite; -import com.google.protobuf.UnittestLite.TestMergeExceptionLite; import com.google.protobuf.UnittestLite.TestPackedExtensionsLite; import com.google.protobuf.UnittestLite.TestParsingMergeLite; -import protobuf_unittest.MapLiteUnittest; -import protobuf_unittest.MapLiteUnittest.TestRequiredLite; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class ParserLiteTest { +import junit.framework.TestCase; +public class ParserLiteTest extends TestCase { private void assertRoundTripEquals(MessageLite message, ExtensionRegistryLite registry) throws Exception { final byte[] data = message.toByteArray(); @@ -34,16 +46,15 @@ public class ParserLiteTest { final int length = data.length; final int padding = 30; Parser parser = message.getParserForType(); - assertThat(message).isEqualTo(parser.parseFrom(data, registry)); - assertThat(message) - .isEqualTo( - parser.parseFrom( - generatePaddingArray(data, offset, padding), offset, length, registry)); - assertThat(message).isEqualTo(parser.parseFrom(message.toByteString(), registry)); - assertThat(message).isEqualTo(parser.parseFrom(new ByteArrayInputStream(data), registry)); - assertThat(message).isEqualTo(parser.parseFrom(CodedInputStream.newInstance(data), registry)); - assertThat(message) - .isEqualTo(parser.parseFrom(message.toByteString().asReadOnlyByteBuffer(), registry)); + assertEquals(message, parser.parseFrom(data, registry)); + assertEquals( + message, + parser.parseFrom(generatePaddingArray(data, offset, padding), offset, length, registry)); + assertEquals(message, parser.parseFrom(message.toByteString(), registry)); + assertEquals(message, parser.parseFrom(new ByteArrayInputStream(data), registry)); + assertEquals(message, parser.parseFrom(CodedInputStream.newInstance(data), registry)); + assertEquals( + message, parser.parseFrom(message.toByteString().asReadOnlyByteBuffer(), registry)); } @SuppressWarnings("unchecked") @@ -54,13 +65,13 @@ public class ParserLiteTest { final int padding = 30; Parser parser = (Parser) message.getParserForType(); - assertThat(message).isEqualTo(parser.parseFrom(data)); - assertThat(message) - .isEqualTo(parser.parseFrom(generatePaddingArray(data, offset, padding), offset, length)); - assertThat(message).isEqualTo(parser.parseFrom(message.toByteString())); - assertThat(message).isEqualTo(parser.parseFrom(new ByteArrayInputStream(data))); - assertThat(message).isEqualTo(parser.parseFrom(CodedInputStream.newInstance(data))); - assertThat(message).isEqualTo(parser.parseFrom(message.toByteString().asReadOnlyByteBuffer())); + assertEquals(message, parser.parseFrom(data)); + assertEquals( + message, parser.parseFrom(generatePaddingArray(data, offset, padding), offset, length)); + assertEquals(message, parser.parseFrom(message.toByteString())); + assertEquals(message, parser.parseFrom(new ByteArrayInputStream(data))); + assertEquals(message, parser.parseFrom(CodedInputStream.newInstance(data))); + assertEquals(message, parser.parseFrom(message.toByteString().asReadOnlyByteBuffer())); } private byte[] generatePaddingArray(byte[] data, int offset, int padding) { @@ -69,25 +80,21 @@ public class ParserLiteTest { return result; } - @Test public void testParseExtensionsLite() throws Exception { assertRoundTripEquals( TestUtilLite.getAllLiteExtensionsSet(), TestUtilLite.getExtensionRegistryLite()); } - @Test public void testParsePacked() throws Exception { assertRoundTripEquals(TestUtil.getPackedSet()); assertRoundTripEquals(TestUtil.getPackedExtensionsSet(), TestUtil.getExtensionRegistry()); } - @Test public void testParsePackedLite() throws Exception { assertRoundTripEquals( TestUtilLite.getLitePackedExtensionsSet(), TestUtilLite.getExtensionRegistryLite()); } - @Test public void testParseDelimitedToLite() throws Exception { // Write MessageLite with packed extension fields. TestPackedExtensionsLite packedMessage = TestUtilLite.getLitePackedExtensionsSet(); @@ -96,26 +103,25 @@ public class ParserLiteTest { packedMessage.writeDelimitedTo(output); InputStream input = new ByteArrayInputStream(output.toByteArray()); - assertThat(packedMessage) - .isEqualTo( - packedMessage - .getParserForType() - .parseDelimitedFrom(input, TestUtilLite.getExtensionRegistryLite())); - assertThat(packedMessage) - .isEqualTo( - packedMessage - .getParserForType() - .parseDelimitedFrom(input, TestUtilLite.getExtensionRegistryLite())); + assertEquals( + packedMessage, + packedMessage + .getParserForType() + .parseDelimitedFrom(input, TestUtilLite.getExtensionRegistryLite())); + assertEquals( + packedMessage, + packedMessage + .getParserForType() + .parseDelimitedFrom(input, TestUtilLite.getExtensionRegistryLite())); } /** Helper method for {@link #testParsingMergeLite()}. */ private void assertMessageMerged(TestAllTypesLite allTypes) throws Exception { - assertThat(allTypes.getOptionalInt32()).isEqualTo(3); - assertThat(allTypes.getOptionalInt64()).isEqualTo(2); - assertThat(allTypes.getOptionalString()).isEqualTo("hello"); + assertEquals(3, allTypes.getOptionalInt32()); + assertEquals(2, allTypes.getOptionalInt64()); + assertEquals("hello", allTypes.getOptionalString()); } - @Test public void testParsingMergeLite() throws Exception { // Build messages. TestAllTypesLite.Builder builder = TestAllTypesLite.newBuilder(); @@ -169,7 +175,7 @@ public class ParserLiteTest { // Parse TestParsingMergeLite. ExtensionRegistryLite registry = ExtensionRegistryLite.newInstance(); UnittestLite.registerAllExtensions(registry); - TestParsingMergeLite parsingMerge = TestParsingMergeLite.parseFrom(data, registry); + TestParsingMergeLite parsingMerge = TestParsingMergeLite.parser().parseFrom(data, registry); // Required and optional fields should be merged. assertMessageMerged(parsingMerge.getRequiredAllTypes()); @@ -178,74 +184,8 @@ public class ParserLiteTest { assertMessageMerged(parsingMerge.getExtension(TestParsingMergeLite.optionalExt)); // Repeated fields should not be merged. - assertThat(parsingMerge.getRepeatedAllTypesCount()).isEqualTo(3); - assertThat(parsingMerge.getRepeatedGroupCount()).isEqualTo(3); - assertThat(parsingMerge.getExtensionCount(TestParsingMergeLite.repeatedExt)).isEqualTo(3); - } - - @Test - public void testExceptionWhenMergingExtendedMessagesMissingRequiredFieldsLite() { - // create a TestMergeExceptionLite message (missing required fields) that looks like - // all_extensions { - // [TestRequiredLite.single] { - // } - // } - TestMergeExceptionLite.Builder message = TestMergeExceptionLite.newBuilder(); - message.setAllExtensions( - TestAllExtensionsLite.newBuilder() - .setExtension(TestRequiredLite.single, TestRequiredLite.newBuilder().buildPartial()) - .buildPartial()); - ByteString byteString = message.buildPartial().toByteString(); - - // duplicate the bytestring to make the `all_extensions` field repeat twice, so that it will - // need merging when parsing back - ByteString duplicatedByteString = byteString.concat(byteString); - - byte[] bytes = duplicatedByteString.toByteArray(); - ExtensionRegistryLite registry = ExtensionRegistryLite.newInstance(); - MapLiteUnittest.registerAllExtensions(registry); - - // `parseFrom` should throw InvalidProtocolBufferException, not UninitializedMessageException, - // for each of the 5 possible input types: - - // parseFrom(ByteString) - try { - TestMergeExceptionLite.parseFrom(duplicatedByteString, registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(ByteArray) - try { - TestMergeExceptionLite.parseFrom(bytes, registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(InputStream) - try { - TestMergeExceptionLite.parseFrom(new ByteArrayInputStream(bytes), registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(CodedInputStream) - try { - TestMergeExceptionLite.parseFrom(CodedInputStream.newInstance(bytes), registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(ByteBuffer) - try { - TestMergeExceptionLite.parseFrom(duplicatedByteString.asReadOnlyByteBuffer(), registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } + assertEquals(3, parsingMerge.getRepeatedAllTypesCount()); + assertEquals(3, parsingMerge.getRepeatedGroupCount()); + assertEquals(3, parsingMerge.getExtensionCount(TestParsingMergeLite.repeatedExt)); } } diff --git a/java/core/src/test/java/com/google/protobuf/ParserTest.java b/java/core/src/test/java/com/google/protobuf/ParserTest.java index bf899283e3ef98784595506e4cd4d62daa7f44a8..983caec76946a640f1d960882d17d03101c6de40 100644 --- a/java/core/src/test/java/com/google/protobuf/ParserTest.java +++ b/java/core/src/test/java/com/google/protobuf/ParserTest.java @@ -1,15 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import protobuf_unittest.UnittestOptimizeFor; import protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize; import protobuf_unittest.UnittestOptimizeFor.TestRequiredOptimizedForSize; @@ -17,7 +37,6 @@ import protobuf_unittest.UnittestProto; import protobuf_unittest.UnittestProto.ForeignMessage; import protobuf_unittest.UnittestProto.TestAllTypes; import protobuf_unittest.UnittestProto.TestEmptyMessage; -import protobuf_unittest.UnittestProto.TestMergeException; import protobuf_unittest.UnittestProto.TestParsingMerge; import protobuf_unittest.UnittestProto.TestRequired; import java.io.ByteArrayInputStream; @@ -25,18 +44,17 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Unit test for {@link Parser}. */ -@RunWith(JUnit4.class) -public class ParserTest { - - @Test +import junit.framework.TestCase; + +/** + * Unit test for {@link Parser}. + * + * @author liujisi@google.com (Pherl Liu) + */ +public class ParserTest extends TestCase { public void testGeneratedMessageParserSingleton() throws Exception { for (int i = 0; i < 10; i++) { - assertThat(TestUtil.getAllSet().getParserForType()).isEqualTo(TestAllTypes.parser()); + assertEquals(TestAllTypes.parser(), TestUtil.getAllSet().getParserForType()); } } @@ -77,9 +95,9 @@ public class ParserTest { private void assertMessageEquals(MessageLite expected, MessageLite actual) throws Exception { if (expected instanceof Message) { - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } else { - assertThat(actual.toByteString()).isEqualTo(expected.toByteString()); + assertEquals(expected.toByteString(), actual.toByteString()); } } @@ -89,12 +107,11 @@ public class ParserTest { return result; } - @Test public void testNormalMessage() throws Exception { assertRoundTripEquals(TestUtil.getAllSet()); } - @Test + public void testParsePartial() throws Exception { assertParsePartial(TestRequired.parser(), TestRequired.newBuilder().setA(1).buildPartial()); } @@ -105,16 +122,15 @@ public class ParserTest { // parsePartialFrom should pass. byte[] data = partialMessage.toByteArray(); - assertThat(parser.parsePartialFrom(data)).isEqualTo(partialMessage); - assertThat(parser.parsePartialFrom(partialMessage.toByteString())).isEqualTo(partialMessage); - assertThat(parser.parsePartialFrom(new ByteArrayInputStream(data))).isEqualTo(partialMessage); - assertThat(parser.parsePartialFrom(CodedInputStream.newInstance(data))) - .isEqualTo(partialMessage); + assertEquals(partialMessage, parser.parsePartialFrom(data)); + assertEquals(partialMessage, parser.parsePartialFrom(partialMessage.toByteString())); + assertEquals(partialMessage, parser.parsePartialFrom(new ByteArrayInputStream(data))); + assertEquals(partialMessage, parser.parsePartialFrom(CodedInputStream.newInstance(data))); // parseFrom(ByteArray) try { parser.parseFrom(partialMessage.toByteArray()); - assertWithMessage(errorString).fail(); + fail(errorString); } catch (InvalidProtocolBufferException e) { // pass. } @@ -122,7 +138,7 @@ public class ParserTest { // parseFrom(ByteString) try { parser.parseFrom(partialMessage.toByteString()); - assertWithMessage(errorString).fail(); + fail(errorString); } catch (InvalidProtocolBufferException e) { // pass. } @@ -130,7 +146,7 @@ public class ParserTest { // parseFrom(InputStream) try { parser.parseFrom(new ByteArrayInputStream(partialMessage.toByteArray())); - assertWithMessage(errorString).fail(); + fail(errorString); } catch (IOException e) { // pass. } @@ -138,24 +154,21 @@ public class ParserTest { // parseFrom(CodedInputStream) try { parser.parseFrom(CodedInputStream.newInstance(partialMessage.toByteArray())); - assertWithMessage(errorString).fail(); + fail(errorString); } catch (IOException e) { // pass. } } - @Test public void testParseExtensions() throws Exception { assertRoundTripEquals(TestUtil.getAllExtensionsSet(), TestUtil.getExtensionRegistry()); } - @Test public void testParsePacked() throws Exception { assertRoundTripEquals(TestUtil.getPackedSet()); assertRoundTripEquals(TestUtil.getPackedExtensionsSet(), TestUtil.getExtensionRegistry()); } - @Test public void testParseDelimitedTo() throws Exception { // Write normal Message. TestAllTypes normalMessage = TestUtil.getAllSet(); @@ -168,14 +181,14 @@ public class ParserTest { assertMessageEquals(normalMessage, normalMessage.getParserForType().parseDelimitedFrom(input)); } - @Test public void testParseUnknownFields() throws Exception { // All fields will be treated as unknown fields in emptyMessage. - TestEmptyMessage emptyMessage = TestEmptyMessage.parseFrom(TestUtil.getAllSet().toByteString()); - assertThat(emptyMessage.toByteString()).isEqualTo(TestUtil.getAllSet().toByteString()); + TestEmptyMessage emptyMessage = + TestEmptyMessage.parser().parseFrom(TestUtil.getAllSet().toByteString()); + assertEquals(TestUtil.getAllSet().toByteString(), emptyMessage.toByteString()); } - @Test + public void testOptimizeForSize() throws Exception { TestOptimizedForSize.Builder builder = TestOptimizedForSize.newBuilder(); builder.setI(12).setMsg(ForeignMessage.newBuilder().setC(34).build()); @@ -193,12 +206,11 @@ public class ParserTest { /** Helper method for {@link #testParsingMerge()}. */ private void assertMessageMerged(TestAllTypes allTypes) throws Exception { - assertThat(allTypes.getOptionalInt32()).isEqualTo(3); - assertThat(allTypes.getOptionalInt64()).isEqualTo(2); - assertThat(allTypes.getOptionalString()).isEqualTo("hello"); + assertEquals(3, allTypes.getOptionalInt32()); + assertEquals(2, allTypes.getOptionalInt64()); + assertEquals("hello", allTypes.getOptionalString()); } - @Test public void testParsingMerge() throws Exception { // Build messages. TestAllTypes.Builder builder = TestAllTypes.newBuilder(); @@ -252,7 +264,7 @@ public class ParserTest { // Parse TestParsingMerge. ExtensionRegistry registry = ExtensionRegistry.newInstance(); UnittestProto.registerAllExtensions(registry); - TestParsingMerge parsingMerge = TestParsingMerge.parseFrom(data, registry); + TestParsingMerge parsingMerge = TestParsingMerge.parser().parseFrom(data, registry); // Required and optional fields should be merged. assertMessageMerged(parsingMerge.getRequiredAllTypes()); @@ -261,77 +273,11 @@ public class ParserTest { assertMessageMerged(parsingMerge.getExtension(TestParsingMerge.optionalExt)); // Repeated fields should not be merged. - assertThat(parsingMerge.getRepeatedAllTypesCount()).isEqualTo(3); - assertThat(parsingMerge.getRepeatedGroupCount()).isEqualTo(3); - assertThat(parsingMerge.getExtensionCount(TestParsingMerge.repeatedExt)).isEqualTo(3); - } - - @Test - public void testExceptionWhenMergingExtendedMessagesMissingRequiredFields() { - // create a TestMergeException message (missing required fields) that looks like - // all_extensions { - // [TestRequired.single] { - // } - // } - TestMergeException.Builder message = TestMergeException.newBuilder(); - message - .getAllExtensionsBuilder() - .setExtension(TestRequired.single, TestRequired.newBuilder().buildPartial()); - ByteString byteString = message.buildPartial().toByteString(); - - // duplicate the bytestring to make the `all_extensions` field repeat twice, so that it will - // need merging when parsing back - ByteString duplicatedByteString = byteString.concat(byteString); - - byte[] bytes = duplicatedByteString.toByteArray(); - ExtensionRegistry registry = ExtensionRegistry.newInstance(); - UnittestProto.registerAllExtensions(registry); - - // `parseFrom` should throw InvalidProtocolBufferException, not UninitializedMessageException, - // for each of the 5 possible input types: - - // parseFrom(ByteString) - try { - TestMergeException.parseFrom(duplicatedByteString, registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(ByteArray) - try { - TestMergeException.parseFrom(bytes, registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(InputStream) - try { - TestMergeException.parseFrom(new ByteArrayInputStream(bytes), registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(CodedInputStream) - try { - TestMergeException.parseFrom(CodedInputStream.newInstance(bytes), registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } - - // parseFrom(ByteBuffer) - try { - TestMergeException.parseFrom(duplicatedByteString.asReadOnlyByteBuffer(), registry); - assertWithMessage("Expected InvalidProtocolBufferException").fail(); - } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InvalidProtocolBufferException.class); - } + assertEquals(3, parsingMerge.getRepeatedAllTypesCount()); + assertEquals(3, parsingMerge.getRepeatedGroupCount()); + assertEquals(3, parsingMerge.getExtensionCount(TestParsingMerge.repeatedExt)); } - @Test public void testParseDelimitedFrom_firstByteInterrupted_preservesCause() { try { TestAllTypes.parseDelimitedFrom( @@ -341,13 +287,12 @@ public class ParserTest { throw new InterruptedIOException(); } }); - assertWithMessage("Expected InterruptedIOException").fail(); + fail("Expected InterruptedIOException"); } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InterruptedIOException.class); + assertEquals(InterruptedIOException.class, e.getClass()); } } - @Test public void testParseDelimitedFrom_secondByteInterrupted_preservesCause() { try { TestAllTypes.parseDelimitedFrom( @@ -366,9 +311,9 @@ public class ParserTest { } } }); - assertWithMessage("Expected InterruptedIOException").fail(); + fail("Expected InterruptedIOException"); } catch (Exception e) { - assertThat(e.getClass()).isEqualTo(InterruptedIOException.class); + assertEquals(InterruptedIOException.class, e.getClass()); } } } diff --git a/java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java b/java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java index b0aad24e1f2273ec44fdae64256d31bde8e301d7..dfda4b3cbdd9d372b91f5d6728f3e3e517d6b84c 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java +++ b/java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java @@ -1,14 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; import com.google.protobuf.testing.Proto2Testing; import com.google.protobuf.testing.Proto2Testing.Proto2Message; @@ -29,6 +53,7 @@ public class Proto2ExtensionLookupSchemaTest { public void setup() { TestSchemas.registerGenericProto2Schemas(); + Protobuf.getInstance().schemaFor(Proto2MessageWithExtensions.class); data = new Proto2MessageFactory(10, 20, 1, 1).newMessage().toByteArray(); extensionRegistry = ExtensionRegistry.newInstance(); Proto2Testing.registerAllExtensions(extensionRegistry); @@ -42,14 +67,14 @@ public class Proto2ExtensionLookupSchemaTest { Proto2MessageWithExtensions message = ExperimentalSerializationUtil.fromByteArray( data, Proto2MessageWithExtensions.class, extensionRegistry); - assertThat(message).isEqualTo(base); + assertEquals(base, message); Proto2MessageWithExtensions roundtripMessage = ExperimentalSerializationUtil.fromByteArray( ExperimentalSerializationUtil.toByteArray(message), Proto2MessageWithExtensions.class, extensionRegistry); - assertThat(roundtripMessage).isEqualTo(base); + assertEquals(base, roundtripMessage); } @Test @@ -57,7 +82,7 @@ public class Proto2ExtensionLookupSchemaTest { // Use unknown fields to hold invalid enum values. UnknownFieldSetLite unknowns = UnknownFieldSetLite.newInstance(); final int outOfRange = 1000; - assertThat(TestEnum.forNumber(outOfRange)).isNull(); + assertNull(TestEnum.forNumber(outOfRange)); unknowns.storeField( WireFormat.makeTag(Proto2Message.FIELD_ENUM_13_FIELD_NUMBER, WireFormat.WIRETYPE_VARINT), (long) outOfRange); @@ -100,17 +125,17 @@ public class Proto2ExtensionLookupSchemaTest { Proto2MessageWithExtensions parsed = ExperimentalSerializationUtil.fromByteArray( output, Proto2MessageWithExtensions.class, extensionRegistry); - assertWithMessage("out-of-range singular enum should not be in message") - .that(parsed.hasExtension(Proto2Testing.fieldEnum13)) - .isFalse(); + assertFalse( + "out-of-range singular enum should not be in message", + parsed.hasExtension(Proto2Testing.fieldEnum13)); { List singularEnum = parsed .getUnknownFields() .getField(Proto2Message.FIELD_ENUM_13_FIELD_NUMBER) .getVarintList(); - assertThat(singularEnum).hasSize(1); - assertThat(singularEnum.get(0)).isEqualTo((Long) (long) outOfRange); + assertEquals(1, singularEnum.size()); + assertEquals((Long) (long) outOfRange, singularEnum.get(0)); } { List repeatedEnum = @@ -118,8 +143,8 @@ public class Proto2ExtensionLookupSchemaTest { .getUnknownFields() .getField(Proto2Message.FIELD_ENUM_LIST_30_FIELD_NUMBER) .getVarintList(); - assertThat(repeatedEnum).hasSize(1); - assertThat(repeatedEnum.get(0)).isEqualTo((Long) (long) outOfRange); + assertEquals(1, repeatedEnum.size()); + assertEquals((Long) (long) outOfRange, repeatedEnum.get(0)); } { List packedRepeatedEnum = @@ -127,18 +152,20 @@ public class Proto2ExtensionLookupSchemaTest { .getUnknownFields() .getField(Proto2Message.FIELD_ENUM_LIST_PACKED_44_FIELD_NUMBER) .getVarintList(); - assertThat(packedRepeatedEnum).hasSize(1); - assertThat(packedRepeatedEnum.get(0)).isEqualTo((Long) (long) outOfRange); + assertEquals(1, packedRepeatedEnum.size()); + assertEquals((Long) (long) outOfRange, packedRepeatedEnum.get(0)); } - assertWithMessage("out-of-range repeated enum should not be in message") - .that(parsed.getExtension(Proto2Testing.fieldEnumList30).size()) - .isEqualTo(2); - assertThat(parsed.getExtension(Proto2Testing.fieldEnumList30, 0)).isEqualTo(TestEnum.ONE); - assertThat(parsed.getExtension(Proto2Testing.fieldEnumList30, 1)).isEqualTo(TestEnum.TWO); - assertWithMessage("out-of-range packed repeated enum should not be in message") - .that(parsed.getExtension(Proto2Testing.fieldEnumListPacked44).size()) - .isEqualTo(2); - assertThat(parsed.getExtension(Proto2Testing.fieldEnumListPacked44, 0)).isEqualTo(TestEnum.ONE); - assertThat(parsed.getExtension(Proto2Testing.fieldEnumListPacked44, 1)).isEqualTo(TestEnum.TWO); + assertEquals( + "out-of-range repeated enum should not be in message", + 2, + parsed.getExtension(Proto2Testing.fieldEnumList30).size()); + assertEquals(TestEnum.ONE, parsed.getExtension(Proto2Testing.fieldEnumList30, 0)); + assertEquals(TestEnum.TWO, parsed.getExtension(Proto2Testing.fieldEnumList30, 1)); + assertEquals( + "out-of-range packed repeated enum should not be in message", + 2, + parsed.getExtension(Proto2Testing.fieldEnumListPacked44).size()); + assertEquals(TestEnum.ONE, parsed.getExtension(Proto2Testing.fieldEnumListPacked44, 0)); + assertEquals(TestEnum.TWO, parsed.getExtension(Proto2Testing.fieldEnumListPacked44, 1)); } } diff --git a/java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java b/java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java index 0fef4cc48f863d2533c8be49feb46dc107db9063..8242f847ee5f7a476c4446c28d48f4334f2c0d76 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java +++ b/java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java b/java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java index 6d146ad4a53e7b8752e2e9e0cd3f1938e872f270..b5c61ed9985324afcd7c08c65a2e261addc87a8c 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java +++ b/java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java b/java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java index 08e8e23104cfb33794b528f735f71fd154155cd0..2da349424edc3737394b635e02ca87e5c68d8556 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java +++ b/java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java b/java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java index 13920cac3d6f4a22e31528a649d75b226cd93499..098e7fe1829b6d917179f931ef6fe00498381a64 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java +++ b/java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java b/java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java index 394c612f3dba6bec565e45443bb4b7b971f97888..57ac0695e4c308c240d4ea5a401f05fd33d6df9d 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java +++ b/java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java @@ -1,25 +1,43 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import com.google.protobuf.Descriptors.FieldDescriptor; import protobuf_unittest.UnittestProto; import protobuf_unittest.UnittestProto.TestAllExtensions; import protobuf_unittest.UnittestProto.TestAllTypes; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** Unit tests for proto2 that treats unknown enum values as unknown fields. */ -@RunWith(JUnit4.class) -public class Proto2UnknownEnumValueTest { +public class Proto2UnknownEnumValueTest extends TestCase { FieldDescriptor singularField = TestAllTypes.getDescriptor().findFieldByName("optional_nested_enum"); FieldDescriptor repeatedField = @@ -46,47 +64,48 @@ public class Proto2UnknownEnumValueTest { return builder.build().toByteArray(); } - @Test public void testUnknownEnumValues() throws Exception { TestAllTypes message = TestAllTypes.parseFrom(payload); // Known enum values should be preserved. - assertThat(message.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.BAR); - assertThat(message.getRepeatedNestedEnumList().size()).isEqualTo(2); - assertThat(message.getRepeatedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.FOO); - assertThat(message.getRepeatedNestedEnum(1)).isEqualTo(TestAllTypes.NestedEnum.BAZ); + assertEquals(TestAllTypes.NestedEnum.BAR, message.getOptionalNestedEnum()); + assertEquals(2, message.getRepeatedNestedEnumList().size()); + assertEquals(TestAllTypes.NestedEnum.FOO, message.getRepeatedNestedEnum(0)); + assertEquals(TestAllTypes.NestedEnum.BAZ, message.getRepeatedNestedEnum(1)); // Unknown enum values should be found in UnknownFieldSet. UnknownFieldSet unknown = message.getUnknownFields(); - assertThat(unknown.getField(singularField.getNumber()).getVarintList().get(0).longValue()) - .isEqualTo(1901); - assertThat(unknown.getField(repeatedField.getNumber()).getVarintList().get(0).longValue()) - .isEqualTo(1902); - assertThat(unknown.getField(repeatedField.getNumber()).getVarintList().get(1).longValue()) - .isEqualTo(1903); + assertEquals( + 1901, unknown.getField(singularField.getNumber()).getVarintList().get(0).longValue()); + assertEquals( + 1902, unknown.getField(repeatedField.getNumber()).getVarintList().get(0).longValue()); + assertEquals( + 1903, unknown.getField(repeatedField.getNumber()).getVarintList().get(1).longValue()); } - @Test public void testExtensionUnknownEnumValues() throws Exception { ExtensionRegistry registry = ExtensionRegistry.newInstance(); UnittestProto.registerAllExtensions(registry); TestAllExtensions message = TestAllExtensions.parseFrom(payload, registry); - assertThat(message.getExtension(UnittestProto.optionalNestedEnumExtension)) - .isEqualTo(TestAllTypes.NestedEnum.BAR); - assertThat(message.getExtension(UnittestProto.repeatedNestedEnumExtension).size()).isEqualTo(2); - assertThat(message.getExtension(UnittestProto.repeatedNestedEnumExtension, 0)) - .isEqualTo(TestAllTypes.NestedEnum.FOO); - assertThat(message.getExtension(UnittestProto.repeatedNestedEnumExtension, 1)) - .isEqualTo(TestAllTypes.NestedEnum.BAZ); + assertEquals( + TestAllTypes.NestedEnum.BAR, + message.getExtension(UnittestProto.optionalNestedEnumExtension)); + assertEquals(2, message.getExtension(UnittestProto.repeatedNestedEnumExtension).size()); + assertEquals( + TestAllTypes.NestedEnum.FOO, + message.getExtension(UnittestProto.repeatedNestedEnumExtension, 0)); + assertEquals( + TestAllTypes.NestedEnum.BAZ, + message.getExtension(UnittestProto.repeatedNestedEnumExtension, 1)); // Unknown enum values should be found in UnknownFieldSet. UnknownFieldSet unknown = message.getUnknownFields(); - assertThat(unknown.getField(singularField.getNumber()).getVarintList().get(0).longValue()) - .isEqualTo(1901); - assertThat(unknown.getField(repeatedField.getNumber()).getVarintList().get(0).longValue()) - .isEqualTo(1902); - assertThat(unknown.getField(repeatedField.getNumber()).getVarintList().get(1).longValue()) - .isEqualTo(1903); + assertEquals( + 1901, unknown.getField(singularField.getNumber()).getVarintList().get(0).longValue()); + assertEquals( + 1902, unknown.getField(repeatedField.getNumber()).getVarintList().get(0).longValue()); + assertEquals( + 1903, unknown.getField(repeatedField.getNumber()).getVarintList().get(1).longValue()); } } diff --git a/java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java b/java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java index c41d38877c4b31e47bb088811e8647150f6b7949..ac9d6df70ebae44544fa2f19d52dc6934437811f 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java +++ b/java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java b/java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java index 68888688b6717a954c6034cf2fcc3009b2c1cf18..33d5fe0fccae7e30813b053715a4498b96ff3f53 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java +++ b/java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java b/java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java index c46162e6e467c711c8fc91252d37983d607debc8..2f6947da4f7467c51e5459814709b9940818261f 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java +++ b/java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java b/java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java index c30ce3132bca62679e9acb3282fbb989d4b553a0..5cd145be74a517939f48781be037c31e295e1921 100644 --- a/java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java +++ b/java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java b/java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java index 9d43f4f9064d3b371f9d6d98e2b33752ec6c75c8..67b2881a436d8a64ad788adee38b5586fd313b41 100644 --- a/java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java +++ b/java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java b/java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java index 8cc552713eef78bb6c8dca0fb66dfcb135332624..c42813c8080b6613395fda7970541b8f5440599d 100644 --- a/java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java +++ b/java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java @@ -1,83 +1,99 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import protobuf_unittest.UnittestProto.TestAllTypes; import protobuf_unittest.UnittestProto.TestAllTypesOrBuilder; import java.util.Collections; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Tests for {@link RepeatedFieldBuilderV3}. This tests basic functionality. More extensive testing is * provided via other tests that exercise the builder. + * + * @author jonp@google.com (Jon Perlow) */ -@RunWith(JUnit4.class) -public class RepeatedFieldBuilderV3Test { +public class RepeatedFieldBuilderV3Test extends TestCase { - @Test public void testBasicUse() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); RepeatedFieldBuilderV3 builder = newRepeatedFieldBuilderV3(mockParent); builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(0).build()); builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(1).build()); - assertThat(builder.getMessage(0).getOptionalInt32()).isEqualTo(0); - assertThat(builder.getMessage(1).getOptionalInt32()).isEqualTo(1); + assertEquals(0, builder.getMessage(0).getOptionalInt32()); + assertEquals(1, builder.getMessage(1).getOptionalInt32()); List list = builder.build(); - assertThat(list).hasSize(2); - assertThat(list.get(0).getOptionalInt32()).isEqualTo(0); - assertThat(list.get(1).getOptionalInt32()).isEqualTo(1); + assertEquals(2, list.size()); + assertEquals(0, list.get(0).getOptionalInt32()); + assertEquals(1, list.get(1).getOptionalInt32()); assertIsUnmodifiable(list); // Make sure it doesn't change. List list2 = builder.build(); - assertThat(list).isSameInstanceAs(list2); - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + assertSame(list, list2); + assertEquals(0, mockParent.getInvalidationCount()); } - @Test public void testGoingBackAndForth() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); RepeatedFieldBuilderV3 builder = newRepeatedFieldBuilderV3(mockParent); builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(0).build()); builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(1).build()); - assertThat(builder.getMessage(0).getOptionalInt32()).isEqualTo(0); - assertThat(builder.getMessage(1).getOptionalInt32()).isEqualTo(1); + assertEquals(0, builder.getMessage(0).getOptionalInt32()); + assertEquals(1, builder.getMessage(1).getOptionalInt32()); // Convert to list List list = builder.build(); - assertThat(list).hasSize(2); - assertThat(list.get(0).getOptionalInt32()).isEqualTo(0); - assertThat(list.get(1).getOptionalInt32()).isEqualTo(1); + assertEquals(2, list.size()); + assertEquals(0, list.get(0).getOptionalInt32()); + assertEquals(1, list.get(1).getOptionalInt32()); assertIsUnmodifiable(list); // Update 0th item - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + assertEquals(0, mockParent.getInvalidationCount()); builder.getBuilder(0).setOptionalString("foo"); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); + assertEquals(1, mockParent.getInvalidationCount()); list = builder.build(); - assertThat(list).hasSize(2); - assertThat(list.get(0).getOptionalInt32()).isEqualTo(0); - assertThat(list.get(0).getOptionalString()).isEqualTo("foo"); - assertThat(list.get(1).getOptionalInt32()).isEqualTo(1); + assertEquals(2, list.size()); + assertEquals(0, list.get(0).getOptionalInt32()); + assertEquals("foo", list.get(0).getOptionalString()); + assertEquals(1, list.get(1).getOptionalInt32()); assertIsUnmodifiable(list); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); + assertEquals(1, mockParent.getInvalidationCount()); } - @Test public void testVariousMethods() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); RepeatedFieldBuilderV3 builder = @@ -87,64 +103,63 @@ public class RepeatedFieldBuilderV3Test { builder.addBuilder(0, TestAllTypes.getDefaultInstance()).setOptionalInt32(0); builder.addBuilder(TestAllTypes.getDefaultInstance()).setOptionalInt32(3); - assertThat(builder.getMessage(0).getOptionalInt32()).isEqualTo(0); - assertThat(builder.getMessage(1).getOptionalInt32()).isEqualTo(1); - assertThat(builder.getMessage(2).getOptionalInt32()).isEqualTo(2); - assertThat(builder.getMessage(3).getOptionalInt32()).isEqualTo(3); + assertEquals(0, builder.getMessage(0).getOptionalInt32()); + assertEquals(1, builder.getMessage(1).getOptionalInt32()); + assertEquals(2, builder.getMessage(2).getOptionalInt32()); + assertEquals(3, builder.getMessage(3).getOptionalInt32()); - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + assertEquals(0, mockParent.getInvalidationCount()); List messages = builder.build(); - assertThat(messages).hasSize(4); - assertThat(messages).isSameInstanceAs(builder.build()); // expect same list + assertEquals(4, messages.size()); + assertSame(messages, builder.build()); // expect same list // Remove a message. builder.remove(2); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); - assertThat(builder.getCount()).isEqualTo(3); - assertThat(builder.getMessage(0).getOptionalInt32()).isEqualTo(0); - assertThat(builder.getMessage(1).getOptionalInt32()).isEqualTo(1); - assertThat(builder.getMessage(2).getOptionalInt32()).isEqualTo(3); + assertEquals(1, mockParent.getInvalidationCount()); + assertEquals(3, builder.getCount()); + assertEquals(0, builder.getMessage(0).getOptionalInt32()); + assertEquals(1, builder.getMessage(1).getOptionalInt32()); + assertEquals(3, builder.getMessage(2).getOptionalInt32()); // Remove a builder. builder.remove(0); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); - assertThat(builder.getCount()).isEqualTo(2); - assertThat(builder.getMessage(0).getOptionalInt32()).isEqualTo(1); - assertThat(builder.getMessage(1).getOptionalInt32()).isEqualTo(3); + assertEquals(1, mockParent.getInvalidationCount()); + assertEquals(2, builder.getCount()); + assertEquals(1, builder.getMessage(0).getOptionalInt32()); + assertEquals(3, builder.getMessage(1).getOptionalInt32()); // Test clear. builder.clear(); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); - assertThat(builder.getCount()).isEqualTo(0); - assertThat(builder.isEmpty()).isTrue(); + assertEquals(1, mockParent.getInvalidationCount()); + assertEquals(0, builder.getCount()); + assertTrue(builder.isEmpty()); } - @Test public void testLists() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); RepeatedFieldBuilderV3 builder = newRepeatedFieldBuilderV3(mockParent); builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(1).build()); builder.addMessage(0, TestAllTypes.newBuilder().setOptionalInt32(0).build()); - assertThat(builder.getMessage(0).getOptionalInt32()).isEqualTo(0); - assertThat(builder.getMessage(1).getOptionalInt32()).isEqualTo(1); + assertEquals(0, builder.getMessage(0).getOptionalInt32()); + assertEquals(1, builder.getMessage(1).getOptionalInt32()); // Use list of builders. List builders = builder.getBuilderList(); - assertThat(builders.get(0).getOptionalInt32()).isEqualTo(0); - assertThat(builders.get(1).getOptionalInt32()).isEqualTo(1); + assertEquals(0, builders.get(0).getOptionalInt32()); + assertEquals(1, builders.get(1).getOptionalInt32()); builders.get(0).setOptionalInt32(10); builders.get(1).setOptionalInt32(11); // Use list of protos List protos = builder.getMessageList(); - assertThat(protos.get(0).getOptionalInt32()).isEqualTo(10); - assertThat(protos.get(1).getOptionalInt32()).isEqualTo(11); + assertEquals(10, protos.get(0).getOptionalInt32()); + assertEquals(11, protos.get(1).getOptionalInt32()); // Add an item to the builders and verify it's updated in both builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(12).build()); - assertThat(builders).hasSize(3); - assertThat(protos).hasSize(3); + assertEquals(3, builders.size()); + assertEquals(3, protos.size()); } private void assertIsUnmodifiable(List list) { @@ -153,7 +168,7 @@ public class RepeatedFieldBuilderV3Test { } else { try { list.clear(); - assertWithMessage("List wasn't immutable").fail(); + fail("List wasn't immutable"); } catch (UnsupportedOperationException e) { // good } @@ -161,7 +176,7 @@ public class RepeatedFieldBuilderV3Test { } private RepeatedFieldBuilderV3 - newRepeatedFieldBuilderV3(AbstractMessage.BuilderParent parent) { + newRepeatedFieldBuilderV3(GeneratedMessage.BuilderParent parent) { return new RepeatedFieldBuilderV3( Collections.emptyList(), false, parent, false); } diff --git a/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java b/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java index 832f0bd3cab2ad7f371ca2594c7d9045fe31744a..d7262161ddb6c952c85d30019854d110788219e1 100644 --- a/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java +++ b/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java @@ -1,31 +1,48 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertWithMessage; - import java.io.UnsupportedEncodingException; import java.util.Iterator; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; /** * This class tests {@link RopeByteString#substring(int, int)} by inheriting the tests from {@link * LiteralByteStringTest}. Only a couple of methods are overridden. + * + * @author carlanton@google.com (Carl Haverl) */ -@RunWith(JUnit4.class) public class RopeByteStringSubstringTest extends LiteralByteStringTest { @Override - @Before - public void setUp() throws Exception { + protected void setUp() throws Exception { classUnderTest = "RopeByteString"; byte[] sourceBytes = ByteStringTest.getTestBytes(22341, 22337766L); Iterator iter = ByteStringTest.makeConcretePieces(sourceBytes).iterator(); @@ -43,15 +60,12 @@ public class RopeByteStringSubstringTest extends LiteralByteStringTest { } @Override - @Test public void testGetTreeDepth() { - assertWithMessage("%s must have the expected tree depth", classUnderTest) - .that(stringUnderTest.getTreeDepth()) - .isEqualTo(3); + assertEquals( + classUnderTest + " must have the expected tree depth", 3, stringUnderTest.getTreeDepth()); } @Override - @Test public void testToString() throws UnsupportedEncodingException { String sourceString = "I love unicode \u1234\u5678 characters"; ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); @@ -70,24 +84,21 @@ public class RopeByteStringSubstringTest extends LiteralByteStringTest { testString = testString.substring(2, testString.length() - 6); unicode = unicode.substring(2, unicode.size() - 6); - assertWithMessage("%s from string must have the expected type", classUnderTest) - .that(classUnderTest) - .isEqualTo(getActualClassName(unicode)); + assertEquals( + classUnderTest + " from string must have the expected type", + classUnderTest, + getActualClassName(unicode)); String roundTripString = unicode.toString(UTF_8); - assertWithMessage("%s unicode bytes must match", classUnderTest) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(classUnderTest + " unicode bytes must match", testString, roundTripString); ByteString flatString = ByteString.copyFromUtf8(testString); - assertWithMessage("%s string must equal the flat string", classUnderTest) - .that(flatString) - .isEqualTo(unicode); - assertWithMessage("%s string must must have same hashCode as the flat string", classUnderTest) - .that(flatString.hashCode()) - .isEqualTo(unicode.hashCode()); + assertEquals(classUnderTest + " string must equal the flat string", flatString, unicode); + assertEquals( + classUnderTest + " string must must have same hashCode as the flat string", + flatString.hashCode(), + unicode.hashCode()); } @Override - @Test public void testCharsetToString() { String sourceString = "I love unicode \u1234\u5678 characters"; ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); @@ -106,19 +117,17 @@ public class RopeByteStringSubstringTest extends LiteralByteStringTest { testString = testString.substring(2, testString.length() - 6); unicode = unicode.substring(2, unicode.size() - 6); - assertWithMessage("%s from string must have the expected type", classUnderTest) - .that(classUnderTest) - .isEqualTo(getActualClassName(unicode)); + assertEquals( + classUnderTest + " from string must have the expected type", + classUnderTest, + getActualClassName(unicode)); String roundTripString = unicode.toString(Internal.UTF_8); - assertWithMessage("%s unicode bytes must match", classUnderTest) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(classUnderTest + " unicode bytes must match", testString, roundTripString); ByteString flatString = ByteString.copyFromUtf8(testString); - assertWithMessage("%s string must equal the flat string", classUnderTest) - .that(flatString) - .isEqualTo(unicode); - assertWithMessage("%s string must must have same hashCode as the flat string", classUnderTest) - .that(flatString.hashCode()) - .isEqualTo(unicode.hashCode()); + assertEquals(classUnderTest + " string must equal the flat string", flatString, unicode); + assertEquals( + classUnderTest + " string must must have same hashCode as the flat string", + flatString.hashCode(), + unicode.hashCode()); } } diff --git a/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java b/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java index 57b9b11ccd3ee3085410e82f6cbe6dc705209ed0..46c2d8678a47b0bb98d42073783fb423d8ee7209 100644 --- a/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java +++ b/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java @@ -1,15 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -18,10 +38,6 @@ import java.io.ObjectOutputStream; import java.io.UnsupportedEncodingException; import java.util.Arrays; import java.util.Iterator; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; /** * This class tests {@link RopeByteString} by inheriting the tests from {@link @@ -29,13 +45,13 @@ import org.junit.runners.JUnit4; * *

      A full test of the result of {@link RopeByteString#substring(int, int)} is found in the * separate class {@link RopeByteStringSubstringTest}. + * + * @author carlanton@google.com (Carl Haverl) */ -@RunWith(JUnit4.class) public class RopeByteStringTest extends LiteralByteStringTest { @Override - @Before - public void setUp() throws Exception { + protected void setUp() throws Exception { classUnderTest = "RopeByteString"; referenceBytes = ByteStringTest.getTestBytes(22341, 22337766L); Iterator iter = ByteStringTest.makeConcretePieces(referenceBytes).iterator(); @@ -46,32 +62,28 @@ public class RopeByteStringTest extends LiteralByteStringTest { expectedHashCode = -1214197238; } - @Test public void testMinLength() { // minLength should match the Fibonacci sequence int a = 1; int b = 1; int i; for (i = 0; a > 0; i++) { - assertThat(a).isEqualTo(RopeByteString.minLength(i)); + assertEquals(a, RopeByteString.minLength(i)); int c = a + b; a = b; b = c; } - assertThat(RopeByteString.minLength(i)).isEqualTo(Integer.MAX_VALUE); - assertThat(RopeByteString.minLength(i + 1)).isEqualTo(Integer.MAX_VALUE); - assertThat(RopeByteString.minLengthByDepth).hasLength(i + 1); + assertEquals(Integer.MAX_VALUE, RopeByteString.minLength(i)); + assertEquals(Integer.MAX_VALUE, RopeByteString.minLength(i + 1)); + assertEquals(i + 1, RopeByteString.minLengthByDepth.length); } @Override - @Test public void testGetTreeDepth() { - assertWithMessage("%s must have the expected tree depth", classUnderTest) - .that(stringUnderTest.getTreeDepth()) - .isEqualTo(4); + assertEquals( + classUnderTest + " must have the expected tree depth", 4, stringUnderTest.getTreeDepth()); } - @Test public void testBalance() { int numberOfPieces = 10000; int pieceSize = 64; @@ -83,26 +95,25 @@ public class RopeByteStringTest extends LiteralByteStringTest { concatenated = concatenated.concat(ByteString.copyFrom(testBytes, i * pieceSize, pieceSize)); } - assertWithMessage("%s from string must have the expected type", classUnderTest) - .that(classUnderTest) - .isEqualTo(getActualClassName(concatenated)); - assertWithMessage("%s underlying bytes must match after balancing", classUnderTest) - .that(Arrays.equals(testBytes, concatenated.toByteArray())) - .isTrue(); + assertEquals( + classUnderTest + " from string must have the expected type", + classUnderTest, + getActualClassName(concatenated)); + assertTrue( + classUnderTest + " underlying bytes must match after balancing", + Arrays.equals(testBytes, concatenated.toByteArray())); ByteString testString = ByteString.copyFrom(testBytes); - assertWithMessage("%s balanced string must equal flat string", classUnderTest) - .that(testString) - .isEqualTo(concatenated); - assertWithMessage("%s flat string must equal balanced string", classUnderTest) - .that(concatenated) - .isEqualTo(testString); - assertWithMessage("%s balanced string must have same hash code as flat string", classUnderTest) - .that(testString.hashCode()) - .isEqualTo(concatenated.hashCode()); + assertEquals( + classUnderTest + " balanced string must equal flat string", testString, concatenated); + assertEquals( + classUnderTest + " flat string must equal balanced string", concatenated, testString); + assertEquals( + classUnderTest + " balanced string must have same hash code as flat string", + testString.hashCode(), + concatenated.hashCode()); } @Override - @Test public void testToString() throws UnsupportedEncodingException { String sourceString = "I love unicode \u1234\u5678 characters"; ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); @@ -117,24 +128,21 @@ public class RopeByteStringTest extends LiteralByteStringTest { } String testString = builder.toString(); - assertWithMessage("%s from string must have the expected type", classUnderTest) - .that(classUnderTest) - .isEqualTo(getActualClassName(unicode)); + assertEquals( + classUnderTest + " from string must have the expected type", + classUnderTest, + getActualClassName(unicode)); String roundTripString = unicode.toString(UTF_8); - assertWithMessage("%s unicode bytes must match", classUnderTest) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(classUnderTest + " unicode bytes must match", testString, roundTripString); ByteString flatString = ByteString.copyFromUtf8(testString); - assertWithMessage("%s string must equal the flat string", classUnderTest) - .that(flatString) - .isEqualTo(unicode); - assertWithMessage("%s string must must have same hashCode as the flat string", classUnderTest) - .that(flatString.hashCode()) - .isEqualTo(unicode.hashCode()); + assertEquals(classUnderTest + " string must equal the flat string", flatString, unicode); + assertEquals( + classUnderTest + " string must must have same hashCode as the flat string", + flatString.hashCode(), + unicode.hashCode()); } @Override - @Test public void testCharsetToString() { String sourceString = "I love unicode \u1234\u5678 characters"; ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); @@ -149,39 +157,36 @@ public class RopeByteStringTest extends LiteralByteStringTest { } String testString = builder.toString(); - assertWithMessage("%s from string must have the expected type", classUnderTest) - .that(classUnderTest) - .isEqualTo(getActualClassName(unicode)); + assertEquals( + classUnderTest + " from string must have the expected type", + classUnderTest, + getActualClassName(unicode)); String roundTripString = unicode.toString(Internal.UTF_8); - assertWithMessage("%s unicode bytes must match", classUnderTest) - .that(testString) - .isEqualTo(roundTripString); + assertEquals(classUnderTest + " unicode bytes must match", testString, roundTripString); ByteString flatString = ByteString.copyFromUtf8(testString); - assertWithMessage("%s string must equal the flat string", classUnderTest) - .that(flatString) - .isEqualTo(unicode); - assertWithMessage("%s string must must have same hashCode as the flat string", classUnderTest) - .that(flatString.hashCode()) - .isEqualTo(unicode.hashCode()); + assertEquals(classUnderTest + " string must equal the flat string", flatString, unicode); + assertEquals( + classUnderTest + " string must must have same hashCode as the flat string", + flatString.hashCode(), + unicode.hashCode()); } @Override - @Test public void testToString_returnsCanonicalEmptyString() { RopeByteString ropeByteString = RopeByteString.newInstanceForTest(ByteString.EMPTY, ByteString.EMPTY); - assertWithMessage("%s must be the same string references", classUnderTest) - .that(ByteString.EMPTY.toString(Internal.UTF_8)) - .isSameInstanceAs(ropeByteString.toString(Internal.UTF_8)); + assertSame( + classUnderTest + " must be the same string references", + ByteString.EMPTY.toString(Internal.UTF_8), + ropeByteString.toString(Internal.UTF_8)); } @Override - @Test public void testToString_raisesException() { try { ByteString byteString = RopeByteString.newInstanceForTest(ByteString.EMPTY, ByteString.EMPTY); byteString.toString("invalid"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UnsupportedEncodingException expected) { // This is success } @@ -191,14 +196,13 @@ public class RopeByteStringTest extends LiteralByteStringTest { RopeByteString.concatenate( ByteString.copyFromUtf8("foo"), ByteString.copyFromUtf8("bar")); byteString.toString("invalid"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (UnsupportedEncodingException expected) { // This is success } } @Override - @Test public void testJavaSerialization() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(out); @@ -208,7 +212,7 @@ public class RopeByteStringTest extends LiteralByteStringTest { InputStream in = new ByteArrayInputStream(pickled); ObjectInputStream ois = new ObjectInputStream(in); Object o = ois.readObject(); - assertWithMessage("Didn't get a ByteString back").that(o).isInstanceOf(ByteString.class); - assertWithMessage("Should get an equal ByteString back").that(o).isEqualTo(stringUnderTest); + assertTrue("Didn't get a ByteString back", o instanceof ByteString); + assertEquals("Should get an equal ByteString back", stringUnderTest, o); } } diff --git a/java/core/src/test/java/com/google/protobuf/ServiceTest.java b/java/core/src/test/java/com/google/protobuf/ServiceTest.java index b12051bd0c7f33b77f72ef39e435b4e8a00dd4d0..1592433c2f3105eb4faf13481e041a4895e45f3a 100644 --- a/java/core/src/test/java/com/google/protobuf/ServiceTest.java +++ b/java/core/src/test/java/com/google/protobuf/ServiceTest.java @@ -1,17 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.MethodDescriptor; import protobuf_unittest.MessageWithNoOuter; @@ -25,161 +43,178 @@ import protobuf_unittest.UnittestProto.TestService; import protobuf_unittest.no_generic_services_test.UnittestNoGenericServices; import java.util.HashSet; import java.util.Set; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.InOrder; -import org.mockito.Mockito; - -@RunWith(JUnit4.class) -public class ServiceTest { +import junit.framework.TestCase; +import org.easymock.classextension.EasyMock; +import org.easymock.IArgumentMatcher; +import org.easymock.classextension.IMocksControl; + +/** + * Tests services and stubs. + * + * @author kenton@google.com Kenton Varda + */ +public class ServiceTest extends TestCase { + private IMocksControl control; + private RpcController mockController; + private final Descriptors.MethodDescriptor fooDescriptor = TestService.getDescriptor().getMethods().get(0); private final Descriptors.MethodDescriptor barDescriptor = TestService.getDescriptor().getMethods().get(1); - private static final FooRequest FOO_REQUEST = FooRequest.getDefaultInstance(); - private static final BarRequest BAR_REQUEST = BarRequest.getDefaultInstance(); - private static final RpcController MOCK_RPC_CONTROLLER = Mockito.mock(RpcController.class); - private static final FooResponse FOO_RESPONSE = FooResponse.getDefaultInstance(); - private static final BarResponse BAR_RESPONSE = BarResponse.getDefaultInstance(); - private static final MessageWithNoOuter MESSAGE_WITH_NO_OUTER = - MessageWithNoOuter.getDefaultInstance(); + + @Override + protected void setUp() throws Exception { + super.setUp(); + control = EasyMock.createStrictControl(); + mockController = control.createMock(RpcController.class); + } + + // ================================================================= /** Tests Service.callMethod(). */ - @Test - @SuppressWarnings({"unchecked", "rawtypes"}) public void testCallMethod() throws Exception { - TestService mockService = Mockito.mock(TestService.class); - RpcCallback mockFooRpcCallback = Mockito.mock(RpcCallback.class); - RpcCallback mockBarRpcCallback = Mockito.mock(RpcCallback.class); - InOrder order = Mockito.inOrder(mockService); - - mockService.callMethod(fooDescriptor, MOCK_RPC_CONTROLLER, FOO_REQUEST, mockFooRpcCallback); - mockService.callMethod(barDescriptor, MOCK_RPC_CONTROLLER, BAR_REQUEST, mockBarRpcCallback); - order - .verify(mockService) - .foo( - Mockito.same(MOCK_RPC_CONTROLLER), - Mockito.same(FOO_REQUEST), - Mockito.same(mockFooRpcCallback)); - order - .verify(mockService) - .bar( - Mockito.same(MOCK_RPC_CONTROLLER), - Mockito.same(BAR_REQUEST), - Mockito.same(mockBarRpcCallback)); + FooRequest fooRequest = FooRequest.newBuilder().build(); + BarRequest barRequest = BarRequest.newBuilder().build(); + MockCallback fooCallback = new MockCallback(); + MockCallback barCallback = new MockCallback(); + TestService mockService = control.createMock(TestService.class); + + mockService.foo( + EasyMock.same(mockController), + EasyMock.same(fooRequest), + this.wrapsCallback(fooCallback)); + mockService.bar( + EasyMock.same(mockController), + EasyMock.same(barRequest), + this.wrapsCallback(barCallback)); + control.replay(); + + mockService.callMethod( + fooDescriptor, mockController, + fooRequest, fooCallback); + mockService.callMethod( + barDescriptor, mockController, + barRequest, barCallback); + control.verify(); } /** Tests Service.get{Request,Response}Prototype(). */ - @Test public void testGetPrototype() throws Exception { - Descriptors.MethodDescriptor fooDescriptor = TestService.getDescriptor().getMethods().get(0); - Descriptors.MethodDescriptor barDescriptor = TestService.getDescriptor().getMethods().get(1); - TestService mockService = Mockito.mock(TestService.class); - - assertThat(mockService.getRequestPrototype(fooDescriptor)).isSameInstanceAs(FOO_REQUEST); - assertThat(mockService.getResponsePrototype(fooDescriptor)).isSameInstanceAs(FOO_RESPONSE); - assertThat(mockService.getRequestPrototype(barDescriptor)).isSameInstanceAs(BAR_REQUEST); - assertThat(mockService.getResponsePrototype(barDescriptor)).isSameInstanceAs(BAR_RESPONSE); + TestService mockService = control.createMock(TestService.class); + + assertSame(mockService.getRequestPrototype(fooDescriptor), FooRequest.getDefaultInstance()); + assertSame(mockService.getResponsePrototype(fooDescriptor), FooResponse.getDefaultInstance()); + assertSame(mockService.getRequestPrototype(barDescriptor), BarRequest.getDefaultInstance()); + assertSame(mockService.getResponsePrototype(barDescriptor), BarResponse.getDefaultInstance()); } /** Tests generated stubs. */ - @Test - @SuppressWarnings({"unchecked", "rawtypes"}) public void testStub() throws Exception { - RpcCallback mockFooRpcCallback = Mockito.mock(RpcCallback.class); - RpcCallback mockBarRpcCallback = Mockito.mock(RpcCallback.class); - RpcChannel mockRpcChannel = Mockito.mock(RpcChannel.class); - InOrder order = Mockito.inOrder(mockRpcChannel); - TestService stub = TestService.newStub(mockRpcChannel); - - stub.foo(MOCK_RPC_CONTROLLER, FOO_REQUEST, mockFooRpcCallback); - stub.bar(MOCK_RPC_CONTROLLER, BAR_REQUEST, mockBarRpcCallback); - - order - .verify(mockRpcChannel) - .callMethod( - Mockito.same(fooDescriptor), - Mockito.same(MOCK_RPC_CONTROLLER), - Mockito.same(FOO_REQUEST), - Mockito.same(FOO_RESPONSE), - Mockito.any(RpcCallback.class)); - order - .verify(mockRpcChannel) - .callMethod( - Mockito.same(barDescriptor), - Mockito.same(MOCK_RPC_CONTROLLER), - Mockito.same(BAR_REQUEST), - Mockito.same(BAR_RESPONSE), - Mockito.any(RpcCallback.class)); + FooRequest fooRequest = FooRequest.newBuilder().build(); + BarRequest barRequest = BarRequest.newBuilder().build(); + MockCallback fooCallback = new MockCallback(); + MockCallback barCallback = new MockCallback(); + RpcChannel mockChannel = control.createMock(RpcChannel.class); + TestService stub = TestService.newStub(mockChannel); + + mockChannel.callMethod( + EasyMock.same(fooDescriptor), + EasyMock.same(mockController), + EasyMock.same(fooRequest), + EasyMock.same(FooResponse.getDefaultInstance()), + this.wrapsCallback(fooCallback)); + mockChannel.callMethod( + EasyMock.same(barDescriptor), + EasyMock.same(mockController), + EasyMock.same(barRequest), + EasyMock.same(BarResponse.getDefaultInstance()), + this.wrapsCallback(barCallback)); + control.replay(); + + stub.foo(mockController, fooRequest, fooCallback); + stub.bar(mockController, barRequest, barCallback); + control.verify(); } /** Tests generated blocking stubs. */ - @Test public void testBlockingStub() throws Exception { - BlockingRpcChannel mockBlockingRpcChannel = Mockito.mock(BlockingRpcChannel.class); - TestService.BlockingInterface stub = TestService.newBlockingStub(mockBlockingRpcChannel); - - when(mockBlockingRpcChannel.callBlockingMethod( - Mockito.same(fooDescriptor), - Mockito.same(MOCK_RPC_CONTROLLER), - Mockito.same(FOO_REQUEST), - Mockito.same(FOO_RESPONSE))) - .thenReturn(FOO_RESPONSE); - when(mockBlockingRpcChannel.callBlockingMethod( - Mockito.same(barDescriptor), - Mockito.same(MOCK_RPC_CONTROLLER), - Mockito.same(BAR_REQUEST), - Mockito.same(BAR_RESPONSE))) - .thenReturn(BAR_RESPONSE); - - assertThat(FOO_RESPONSE).isSameInstanceAs(stub.foo(MOCK_RPC_CONTROLLER, FOO_REQUEST)); - assertThat(BAR_RESPONSE).isSameInstanceAs(stub.bar(MOCK_RPC_CONTROLLER, BAR_REQUEST)); + FooRequest fooRequest = FooRequest.newBuilder().build(); + BarRequest barRequest = BarRequest.newBuilder().build(); + BlockingRpcChannel mockChannel = control.createMock(BlockingRpcChannel.class); + TestService.BlockingInterface stub = TestService.newBlockingStub(mockChannel); + + FooResponse fooResponse = FooResponse.newBuilder().build(); + BarResponse barResponse = BarResponse.newBuilder().build(); + + EasyMock.expect( + mockChannel.callBlockingMethod( + EasyMock.same(fooDescriptor), + EasyMock.same(mockController), + EasyMock.same(fooRequest), + EasyMock.same(FooResponse.getDefaultInstance()))) + .andReturn(fooResponse); + EasyMock.expect( + mockChannel.callBlockingMethod( + EasyMock.same(barDescriptor), + EasyMock.same(mockController), + EasyMock.same(barRequest), + EasyMock.same(BarResponse.getDefaultInstance()))) + .andReturn(barResponse); + control.replay(); + + assertSame(fooResponse, stub.foo(mockController, fooRequest)); + assertSame(barResponse, stub.bar(mockController, barRequest)); + control.verify(); } - @Test public void testNewReflectiveService() { - ServiceWithNoOuter.Interface impl = Mockito.mock(ServiceWithNoOuter.Interface.class); + ServiceWithNoOuter.Interface impl = control.createMock(ServiceWithNoOuter.Interface.class); + RpcController controller = control.createMock(RpcController.class); Service service = ServiceWithNoOuter.newReflectiveService(impl); MethodDescriptor fooMethod = ServiceWithNoOuter.getDescriptor().findMethodByName("Foo"); + MessageWithNoOuter request = MessageWithNoOuter.getDefaultInstance(); RpcCallback callback = new RpcCallback() { @Override public void run(Message parameter) { // No reason this should be run. - assertWithMessage("should not run").fail(); + fail(); } }; RpcCallback specializedCallback = RpcUtil.specializeCallback(callback); - service.callMethod(fooMethod, MOCK_RPC_CONTROLLER, MESSAGE_WITH_NO_OUTER, callback); - verify(impl) - .foo( - Mockito.same(MOCK_RPC_CONTROLLER), - Mockito.same(MESSAGE_WITH_NO_OUTER), - Mockito.same(specializedCallback)); + impl.foo(EasyMock.same(controller), EasyMock.same(request), EasyMock.same(specializedCallback)); + EasyMock.expectLastCall(); + + control.replay(); + + service.callMethod(fooMethod, controller, request, callback); + + control.verify(); } - @Test public void testNewReflectiveBlockingService() throws ServiceException { ServiceWithNoOuter.BlockingInterface impl = - Mockito.mock(ServiceWithNoOuter.BlockingInterface.class); - + control.createMock(ServiceWithNoOuter.BlockingInterface.class); + RpcController controller = control.createMock(RpcController.class); BlockingService service = ServiceWithNoOuter.newReflectiveBlockingService(impl); MethodDescriptor fooMethod = ServiceWithNoOuter.getDescriptor().findMethodByName("Foo"); + MessageWithNoOuter request = MessageWithNoOuter.getDefaultInstance(); TestAllTypes expectedResponse = TestAllTypes.getDefaultInstance(); + EasyMock.expect(impl.foo(EasyMock.same(controller), EasyMock.same(request))) + .andReturn(expectedResponse); + + control.replay(); + + Message response = service.callBlockingMethod(fooMethod, controller, request); + assertEquals(expectedResponse, response); - when(impl.foo(Mockito.same(MOCK_RPC_CONTROLLER), Mockito.same(MESSAGE_WITH_NO_OUTER))) - .thenReturn(expectedResponse); - Message response = - service.callBlockingMethod(fooMethod, MOCK_RPC_CONTROLLER, MESSAGE_WITH_NO_OUTER); - assertThat(response).isEqualTo(expectedResponse); + control.verify(); } - @Test public void testNoGenericServices() throws Exception { // Non-services should be usable. UnittestNoGenericServices.TestMessage message = @@ -187,15 +222,15 @@ public class ServiceTest { .setA(123) .setExtension(UnittestNoGenericServices.testExtension, 456) .build(); - assertThat(message.getA()).isEqualTo(123); - assertThat(UnittestNoGenericServices.TestEnum.FOO.getNumber()).isEqualTo(1); + assertEquals(123, message.getA()); + assertEquals(1, UnittestNoGenericServices.TestEnum.FOO.getNumber()); // Build a list of the class names nested in UnittestNoGenericServices. String outerName = "protobuf_unittest.no_generic_services_test.UnittestNoGenericServices"; Class outerClass = Class.forName(outerName); - Set innerClassNames = new HashSet<>(); + Set innerClassNames = new HashSet(); for (Class innerClass : outerClass.getClasses()) { String fullName = innerClass.getName(); // Figure out the unqualified name of the inner class. @@ -204,7 +239,7 @@ public class ServiceTest { // mentioned in the documentation for java.lang.Class. I don't want to // make assumptions, so I'm just going to accept any character as the // separator. - assertThat(fullName).startsWith(outerName); + assertTrue(fullName.startsWith(outerName)); if (!Service.class.isAssignableFrom(innerClass) && !Message.class.isAssignableFrom(innerClass) @@ -217,15 +252,72 @@ public class ServiceTest { } // No service class should have been generated. - assertThat(innerClassNames).contains("TestMessage"); - assertThat(innerClassNames).contains("TestEnum"); - assertThat(innerClassNames).doesNotContain("TestService"); + assertTrue(innerClassNames.contains("TestMessage")); + assertTrue(innerClassNames.contains("TestEnum")); + assertFalse(innerClassNames.contains("TestService")); // But descriptors are there. FileDescriptor file = UnittestNoGenericServices.getDescriptor(); - assertThat(file.getServices()).hasSize(1); - assertThat(file.getServices().get(0).getName()).isEqualTo("TestService"); - assertThat(file.getServices().get(0).getMethods()).hasSize(1); - assertThat(file.getServices().get(0).getMethods().get(0).getName()).isEqualTo("Foo"); + assertEquals(1, file.getServices().size()); + assertEquals("TestService", file.getServices().get(0).getName()); + assertEquals(1, file.getServices().get(0).getMethods().size()); + assertEquals("Foo", file.getServices().get(0).getMethods().get(0).getName()); + } + + + // ================================================================= + + /** + * wrapsCallback() is an EasyMock argument predicate. wrapsCallback(c) matches a callback if + * calling that callback causes c to be called. In other words, c wraps the given callback. + */ + private RpcCallback wrapsCallback(MockCallback callback) { + EasyMock.reportMatcher(new WrapsCallback(callback)); + return null; + } + + /** The parameter to wrapsCallback() must be a MockCallback. */ + private static class MockCallback implements RpcCallback { + private boolean called = false; + + public boolean isCalled() { + return called; + } + + public void reset() { + called = false; + } + + @Override + public void run(T message) { + called = true; + } + } + + /** Implementation of the wrapsCallback() argument matcher. */ + private static class WrapsCallback implements IArgumentMatcher { + private MockCallback callback; + + public WrapsCallback(MockCallback callback) { + this.callback = callback; + } + + @Override + @SuppressWarnings("unchecked") + public boolean matches(Object actual) { + if (!(actual instanceof RpcCallback)) { + return false; + } + RpcCallback actualCallback = (RpcCallback) actual; + + callback.reset(); + actualCallback.run(null); + return callback.isCalled(); + } + + @Override + public void appendTo(StringBuffer buffer) { + buffer.append("wrapsCallback(mockCallback)"); + } } } diff --git a/java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java b/java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java index e3161761997ce535c9fc982aefdb84b1e868f194..f2ae8f9bca44cf739cb5e3182c2d111b1842c6dc 100644 --- a/java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java +++ b/java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java @@ -1,109 +1,129 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import protobuf_unittest.UnittestProto.TestAllTypes; import protobuf_unittest.UnittestProto.TestAllTypesOrBuilder; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Tests for {@link SingleFieldBuilderV3}. This tests basic functionality. More extensive testing is * provided via other tests that exercise the builder. + * + * @author jonp@google.com (Jon Perlow) */ -@RunWith(JUnit4.class) -public class SingleFieldBuilderV3Test { +public class SingleFieldBuilderV3Test extends TestCase { - @Test public void testBasicUseAndInvalidations() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); SingleFieldBuilderV3 builder = - new SingleFieldBuilderV3<>(TestAllTypes.getDefaultInstance(), mockParent, false); - assertThat(builder.getMessage()).isSameInstanceAs(TestAllTypes.getDefaultInstance()); - assertThat(builder.getBuilder().buildPartial()).isEqualTo(TestAllTypes.getDefaultInstance()); - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + new SingleFieldBuilderV3( + TestAllTypes.getDefaultInstance(), mockParent, false); + assertSame(TestAllTypes.getDefaultInstance(), builder.getMessage()); + assertEquals(TestAllTypes.getDefaultInstance(), builder.getBuilder().buildPartial()); + assertEquals(0, mockParent.getInvalidationCount()); builder.getBuilder().setOptionalInt32(10); - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + assertEquals(0, mockParent.getInvalidationCount()); TestAllTypes message = builder.build(); - assertThat(message.getOptionalInt32()).isEqualTo(10); + assertEquals(10, message.getOptionalInt32()); // Test that we receive invalidations now that build has been called. - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); + assertEquals(0, mockParent.getInvalidationCount()); builder.getBuilder().setOptionalInt32(20); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); + assertEquals(1, mockParent.getInvalidationCount()); // Test that we don't keep getting invalidations on every change builder.getBuilder().setOptionalInt32(30); - assertThat(mockParent.getInvalidationCount()).isEqualTo(1); + assertEquals(1, mockParent.getInvalidationCount()); } - @Test public void testSetMessage() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); SingleFieldBuilderV3 builder = - new SingleFieldBuilderV3<>(TestAllTypes.getDefaultInstance(), mockParent, false); + new SingleFieldBuilderV3( + TestAllTypes.getDefaultInstance(), mockParent, false); builder.setMessage(TestAllTypes.newBuilder().setOptionalInt32(0).build()); - assertThat(builder.getMessage().getOptionalInt32()).isEqualTo(0); + assertEquals(0, builder.getMessage().getOptionalInt32()); // Update message using the builder builder.getBuilder().setOptionalInt32(1); - assertThat(mockParent.getInvalidationCount()).isEqualTo(0); - assertThat(builder.getBuilder().getOptionalInt32()).isEqualTo(1); - assertThat(builder.getMessage().getOptionalInt32()).isEqualTo(1); - TestAllTypes unused = builder.build(); + assertEquals(0, mockParent.getInvalidationCount()); + assertEquals(1, builder.getBuilder().getOptionalInt32()); + assertEquals(1, builder.getMessage().getOptionalInt32()); + builder.build(); builder.getBuilder().setOptionalInt32(2); - assertThat(builder.getBuilder().getOptionalInt32()).isEqualTo(2); - assertThat(builder.getMessage().getOptionalInt32()).isEqualTo(2); + assertEquals(2, builder.getBuilder().getOptionalInt32()); + assertEquals(2, builder.getMessage().getOptionalInt32()); // Make sure message stays cached - assertThat(builder.getMessage()).isSameInstanceAs(builder.getMessage()); + assertSame(builder.getMessage(), builder.getMessage()); } - @Test public void testClear() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); SingleFieldBuilderV3 builder = - new SingleFieldBuilderV3<>(TestAllTypes.getDefaultInstance(), mockParent, false); + new SingleFieldBuilderV3( + TestAllTypes.getDefaultInstance(), mockParent, false); builder.setMessage(TestAllTypes.newBuilder().setOptionalInt32(0).build()); - assertThat(TestAllTypes.getDefaultInstance()).isNotSameInstanceAs(builder.getMessage()); + assertNotSame(TestAllTypes.getDefaultInstance(), builder.getMessage()); builder.clear(); - assertThat(builder.getMessage()).isSameInstanceAs(TestAllTypes.getDefaultInstance()); + assertSame(TestAllTypes.getDefaultInstance(), builder.getMessage()); builder.getBuilder().setOptionalInt32(1); - assertThat(TestAllTypes.getDefaultInstance()).isNotSameInstanceAs(builder.getMessage()); + assertNotSame(TestAllTypes.getDefaultInstance(), builder.getMessage()); builder.clear(); - assertThat(builder.getMessage()).isSameInstanceAs(TestAllTypes.getDefaultInstance()); + assertSame(TestAllTypes.getDefaultInstance(), builder.getMessage()); } - @Test public void testMerge() { TestUtil.MockBuilderParent mockParent = new TestUtil.MockBuilderParent(); SingleFieldBuilderV3 builder = - new SingleFieldBuilderV3<>(TestAllTypes.getDefaultInstance(), mockParent, false); + new SingleFieldBuilderV3( + TestAllTypes.getDefaultInstance(), mockParent, false); // Merge into default field. builder.mergeFrom(TestAllTypes.getDefaultInstance()); - assertThat(builder.getMessage()).isSameInstanceAs(TestAllTypes.getDefaultInstance()); + assertSame(TestAllTypes.getDefaultInstance(), builder.getMessage()); // Merge into non-default field on existing builder. builder.getBuilder().setOptionalInt32(2); builder.mergeFrom(TestAllTypes.newBuilder().setOptionalDouble(4.0).buildPartial()); - assertThat(builder.getMessage().getOptionalInt32()).isEqualTo(2); - assertThat(builder.getMessage().getOptionalDouble()).isEqualTo(4.0); + assertEquals(2, builder.getMessage().getOptionalInt32()); + assertEquals(4.0, builder.getMessage().getOptionalDouble(), 0.0); // Merge into non-default field on existing message builder.setMessage(TestAllTypes.newBuilder().setOptionalInt32(10).buildPartial()); builder.mergeFrom(TestAllTypes.newBuilder().setOptionalDouble(5.0).buildPartial()); - assertThat(builder.getMessage().getOptionalInt32()).isEqualTo(10); - assertThat(builder.getMessage().getOptionalDouble()).isEqualTo(5.0); + assertEquals(10, builder.getMessage().getOptionalInt32()); + assertEquals(5.0, builder.getMessage().getOptionalDouble(), 0.0); } } diff --git a/java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java b/java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java index dbac08abaf33b2394b54ff5d2b2717a039b0a1d0..a1a7194b433f95cea16e89c55066a05e0c1db983 100644 --- a/java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java +++ b/java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java @@ -1,17 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; -import static java.lang.Math.min; - -import java.util.AbstractMap; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -20,19 +38,61 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; + +/** @author darick@google.com Darick Tong */ +public class SmallSortedMapTest extends TestCase { + // java.util.AbstractMap.SimpleEntry is private in JDK 1.5. We re-implement it + // here for JDK 1.5 users. + private static class SimpleEntry implements Map.Entry { + private final K key; + private V value; + + SimpleEntry(K key, V value) { + this.key = key; + this.value = value; + } + + @Override + public K getKey() { + return key; + } + + @Override + public V getValue() { + return value; + } -@RunWith(JUnit4.class) -public class SmallSortedMapTest { + @Override + public V setValue(V value) { + V oldValue = this.value; + this.value = value; + return oldValue; + } + + private static boolean eq(Object o1, Object o2) { + return o1 == null ? o2 == null : o1.equals(o2); + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof Map.Entry)) { + return false; + } + Map.Entry e = (Map.Entry) o; + return eq(key, e.getKey()) && eq(value, e.getValue()); + } + + @Override + public int hashCode() { + return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode()); + } + } - @Test public void testPutAndGetArrayEntriesOnly() { runPutAndGetTest(3); } - @Test public void testPutAndGetOverflowEntries() { runPutAndGetTest(6); } @@ -46,224 +106,214 @@ public class SmallSortedMapTest { // Test with puts in ascending order. for (int i = 0; i < numElements; i++) { - assertThat(map1.put(i, i + 1)).isNull(); - assertThat(map2.put(i, i + 1)).isNull(); + assertNull(map1.put(i, i + 1)); + assertNull(map2.put(i, i + 1)); } // Test with puts in descending order. for (int i = numElements - 1; i >= 0; i--) { - assertThat(map3.put(i, i + 1)).isNull(); - assertThat(map4.put(i, i + 1)).isNull(); + assertNull(map3.put(i, i + 1)); + assertNull(map4.put(i, i + 1)); } - assertThat(map1.getNumArrayEntries()).isEqualTo(min(3, numElements)); - assertThat(map2.getNumArrayEntries()).isEqualTo(min(4, numElements)); - assertThat(map3.getNumArrayEntries()).isEqualTo(min(3, numElements)); - assertThat(map4.getNumArrayEntries()).isEqualTo(min(4, numElements)); + assertEquals(Math.min(3, numElements), map1.getNumArrayEntries()); + assertEquals(Math.min(4, numElements), map2.getNumArrayEntries()); + assertEquals(Math.min(3, numElements), map3.getNumArrayEntries()); + assertEquals(Math.min(4, numElements), map4.getNumArrayEntries()); - List> allMaps = new ArrayList<>(); + List> allMaps = + new ArrayList>(); allMaps.add(map1); allMaps.add(map2); allMaps.add(map3); allMaps.add(map4); for (SmallSortedMap map : allMaps) { - assertThat(map).hasSize(numElements); + assertEquals(numElements, map.size()); for (int i = 0; i < numElements; i++) { - assertThat(map).containsEntry(i, Integer.valueOf(i + 1)); + assertEquals(Integer.valueOf(i + 1), map.get(i)); } } - assertThat(map1).isEqualTo(map2); - assertThat(map2).isEqualTo(map3); - assertThat(map3).isEqualTo(map4); + assertEquals(map1, map2); + assertEquals(map2, map3); + assertEquals(map3, map4); } - @Test public void testReplacingPut() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); - assertThat(map.remove(i + 1)).isNull(); + assertNull(map.put(i, i + 1)); + assertNull(map.remove(i + 1)); } for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 2)).isEqualTo(Integer.valueOf(i + 1)); + assertEquals(Integer.valueOf(i + 1), map.put(i, i + 2)); } } - @Test public void testRemove() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); - assertThat(map.remove(i + 1)).isNull(); - } - - assertThat(map.getNumArrayEntries()).isEqualTo(3); - assertThat(map.getNumOverflowEntries()).isEqualTo(3); - assertThat(map).hasSize(6); - assertThat(map.keySet()).isEqualTo(makeSortedKeySet(0, 1, 2, 3, 4, 5)); - - assertThat(map.remove(1)).isEqualTo(Integer.valueOf(2)); - assertThat(map.getNumArrayEntries()).isEqualTo(3); - assertThat(map.getNumOverflowEntries()).isEqualTo(2); - assertThat(map).hasSize(5); - assertThat(map.keySet()).isEqualTo(makeSortedKeySet(0, 2, 3, 4, 5)); - - assertThat(map.remove(4)).isEqualTo(Integer.valueOf(5)); - assertThat(map.getNumArrayEntries()).isEqualTo(3); - assertThat(map.getNumOverflowEntries()).isEqualTo(1); - assertThat(map).hasSize(4); - assertThat(map.keySet()).isEqualTo(makeSortedKeySet(0, 2, 3, 5)); - - assertThat(map.remove(3)).isEqualTo(Integer.valueOf(4)); - assertThat(map.getNumArrayEntries()).isEqualTo(3); - assertThat(map.getNumOverflowEntries()).isEqualTo(0); - assertThat(map).hasSize(3); - assertThat(map.keySet()).isEqualTo(makeSortedKeySet(0, 2, 5)); - - assertThat(map.remove(3)).isNull(); - assertThat(map.getNumArrayEntries()).isEqualTo(3); - assertThat(map.getNumOverflowEntries()).isEqualTo(0); - assertThat(map).hasSize(3); - - assertThat(map.remove(0)).isEqualTo(Integer.valueOf(1)); - assertThat(map.getNumArrayEntries()).isEqualTo(2); - assertThat(map.getNumOverflowEntries()).isEqualTo(0); - assertThat(map).hasSize(2); + assertNull(map.put(i, i + 1)); + assertNull(map.remove(i + 1)); + } + + assertEquals(3, map.getNumArrayEntries()); + assertEquals(3, map.getNumOverflowEntries()); + assertEquals(6, map.size()); + assertEquals(makeSortedKeySet(0, 1, 2, 3, 4, 5), map.keySet()); + + assertEquals(Integer.valueOf(2), map.remove(1)); + assertEquals(3, map.getNumArrayEntries()); + assertEquals(2, map.getNumOverflowEntries()); + assertEquals(5, map.size()); + assertEquals(makeSortedKeySet(0, 2, 3, 4, 5), map.keySet()); + + assertEquals(Integer.valueOf(5), map.remove(4)); + assertEquals(3, map.getNumArrayEntries()); + assertEquals(1, map.getNumOverflowEntries()); + assertEquals(4, map.size()); + assertEquals(makeSortedKeySet(0, 2, 3, 5), map.keySet()); + + assertEquals(Integer.valueOf(4), map.remove(3)); + assertEquals(3, map.getNumArrayEntries()); + assertEquals(0, map.getNumOverflowEntries()); + assertEquals(3, map.size()); + assertEquals(makeSortedKeySet(0, 2, 5), map.keySet()); + + assertNull(map.remove(3)); + assertEquals(3, map.getNumArrayEntries()); + assertEquals(0, map.getNumOverflowEntries()); + assertEquals(3, map.size()); + + assertEquals(Integer.valueOf(1), map.remove(0)); + assertEquals(2, map.getNumArrayEntries()); + assertEquals(0, map.getNumOverflowEntries()); + assertEquals(2, map.size()); } - @Test public void testClear() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } map.clear(); - assertThat(map.getNumArrayEntries()).isEqualTo(0); - assertThat(map.getNumOverflowEntries()).isEqualTo(0); - assertThat(map).isEmpty(); + assertEquals(0, map.getNumArrayEntries()); + assertEquals(0, map.getNumOverflowEntries()); + assertEquals(0, map.size()); } - @Test public void testGetArrayEntryAndOverflowEntries() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } - assertThat(map.getNumArrayEntries()).isEqualTo(3); + assertEquals(3, map.getNumArrayEntries()); for (int i = 0; i < 3; i++) { Map.Entry entry = map.getArrayEntryAt(i); - assertThat(entry.getKey()).isEqualTo(Integer.valueOf(i)); - assertThat(entry.getValue()).isEqualTo(Integer.valueOf(i + 1)); + assertEquals(Integer.valueOf(i), entry.getKey()); + assertEquals(Integer.valueOf(i + 1), entry.getValue()); } Iterator> it = map.getOverflowEntries().iterator(); for (int i = 3; i < 6; i++) { - assertThat(it.hasNext()).isTrue(); + assertTrue(it.hasNext()); Map.Entry entry = it.next(); - assertThat(entry.getKey()).isEqualTo(Integer.valueOf(i)); - assertThat(entry.getValue()).isEqualTo(Integer.valueOf(i + 1)); + assertEquals(Integer.valueOf(i), entry.getKey()); + assertEquals(Integer.valueOf(i + 1), entry.getValue()); } - assertThat(it.hasNext()).isFalse(); + assertFalse(it.hasNext()); } - @Test public void testEntrySetContains() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } Set> entrySet = map.entrySet(); for (int i = 0; i < 6; i++) { - assertThat(entrySet).contains(new AbstractMap.SimpleEntry(i, i + 1)); - assertThat(entrySet).doesNotContain(new AbstractMap.SimpleEntry(i, i)); + assertTrue(entrySet.contains(new SimpleEntry(i, i + 1))); + assertFalse(entrySet.contains(new SimpleEntry(i, i))); } } - @Test public void testEntrySetAdd() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); Set> entrySet = map.entrySet(); for (int i = 0; i < 6; i++) { - Map.Entry entry = new AbstractMap.SimpleEntry<>(i, i + 1); - assertThat(entrySet.add(entry)).isTrue(); - assertThat(entrySet.add(entry)).isFalse(); + Map.Entry entry = new SimpleEntry(i, i + 1); + assertTrue(entrySet.add(entry)); + assertFalse(entrySet.add(entry)); } for (int i = 0; i < 6; i++) { - assertThat(map).containsEntry(i, Integer.valueOf(i + 1)); + assertEquals(Integer.valueOf(i + 1), map.get(i)); } - assertThat(map.getNumArrayEntries()).isEqualTo(3); - assertThat(map.getNumOverflowEntries()).isEqualTo(3); - assertThat(map).hasSize(6); + assertEquals(3, map.getNumArrayEntries()); + assertEquals(3, map.getNumOverflowEntries()); + assertEquals(6, map.size()); } - @Test public void testEntrySetRemove() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); Set> entrySet = map.entrySet(); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } for (int i = 0; i < 6; i++) { - Map.Entry entry = new AbstractMap.SimpleEntry<>(i, i + 1); - assertThat(entrySet.remove(entry)).isTrue(); - assertThat(entrySet.remove(entry)).isFalse(); - } - assertThat(map).isEmpty(); - assertThat(map.getNumArrayEntries()).isEqualTo(0); - assertThat(map.getNumOverflowEntries()).isEqualTo(0); - assertThat(map).isEmpty(); + Map.Entry entry = new SimpleEntry(i, i + 1); + assertTrue(entrySet.remove(entry)); + assertFalse(entrySet.remove(entry)); + } + assertTrue(map.isEmpty()); + assertEquals(0, map.getNumArrayEntries()); + assertEquals(0, map.getNumOverflowEntries()); + assertEquals(0, map.size()); } - @Test public void testEntrySetClear() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } map.clear(); - assertThat(map).isEmpty(); - assertThat(map.getNumArrayEntries()).isEqualTo(0); - assertThat(map.getNumOverflowEntries()).isEqualTo(0); - assertThat(map).isEmpty(); + assertTrue(map.isEmpty()); + assertEquals(0, map.getNumArrayEntries()); + assertEquals(0, map.getNumOverflowEntries()); + assertEquals(0, map.size()); } - @Test public void testEntrySetIteratorNext() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } Iterator> it = map.entrySet().iterator(); for (int i = 0; i < 6; i++) { - assertThat(it.hasNext()).isTrue(); + assertTrue(it.hasNext()); Map.Entry entry = it.next(); - assertThat(entry.getKey()).isEqualTo(Integer.valueOf(i)); - assertThat(entry.getValue()).isEqualTo(Integer.valueOf(i + 1)); + assertEquals(Integer.valueOf(i), entry.getKey()); + assertEquals(Integer.valueOf(i + 1), entry.getValue()); } - assertThat(it.hasNext()).isFalse(); + assertFalse(it.hasNext()); } - @Test public void testEntrySetIteratorRemove() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } Iterator> it = map.entrySet().iterator(); for (int i = 0; i < 6; i++) { - assertThat(map).containsKey(i); + assertTrue(map.containsKey(i)); it.next(); it.remove(); - assertThat(map).doesNotContainKey(i); - assertThat(map).hasSize(6 - i - 1); + assertFalse(map.containsKey(i)); + assertEquals(6 - i - 1, map.size()); } } - @Test public void testMapEntryModification() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } Iterator> it = map.entrySet().iterator(); for (int i = 0; i < 6; i++) { @@ -271,50 +321,49 @@ public class SmallSortedMapTest { entry.setValue(i + 23); } for (int i = 0; i < 6; i++) { - assertThat(map).containsEntry(i, Integer.valueOf(i + 23)); + assertEquals(Integer.valueOf(i + 23), map.get(i)); } } - @Test public void testMakeImmutable() { SmallSortedMap map = SmallSortedMap.newInstanceForTest(3); for (int i = 0; i < 6; i++) { - assertThat(map.put(i, i + 1)).isNull(); + assertNull(map.put(i, i + 1)); } map.makeImmutable(); - assertThat(map).containsEntry(0, Integer.valueOf(1)); - assertThat(map).hasSize(6); + assertEquals(Integer.valueOf(1), map.get(0)); + assertEquals(6, map.size()); try { map.put(23, 23); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } - Map other = new HashMap<>(); + Map other = new HashMap(); other.put(23, 23); try { map.putAll(other); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } try { map.remove(0); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } try { map.clear(); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } Set> entrySet = map.entrySet(); try { entrySet.clear(); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } @@ -323,12 +372,12 @@ public class SmallSortedMapTest { Map.Entry entry = it.next(); try { entry.setValue(0); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } try { it.remove(); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } } @@ -336,7 +385,7 @@ public class SmallSortedMapTest { Set keySet = map.keySet(); try { keySet.clear(); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } @@ -345,18 +394,18 @@ public class SmallSortedMapTest { Integer key = keys.next(); try { keySet.remove(key); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } try { keys.remove(); - assertWithMessage("Expected UnsupportedOperationException").fail(); + fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { } } } private Set makeSortedKeySet(Integer... keys) { - return new TreeSet<>(Arrays.asList(keys)); + return new TreeSet(Arrays.asList(keys)); } } diff --git a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java index 9f9ebc21ae3473883d98637de80441921ca6096d..3d82c5f9affc3b03efbba760ac914e86c6d45995 100644 --- a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java +++ b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -20,13 +43,10 @@ public class TestBadIdentifiers extends TestCase { public void testCompilation() { // If this compiles, it means the generation was correct. - TestBadIdentifiersProto.Deprecated unused1 = - TestBadIdentifiersProto.Deprecated.newBuilder().build(); - TestBadIdentifiersProto.Override unused2 = - TestBadIdentifiersProto.Override.getDefaultInstance(); + TestBadIdentifiersProto.Deprecated.newBuilder(); + TestBadIdentifiersProto.Override.newBuilder(); } - @SuppressWarnings({"IgnoredPureGetter", "CheckReturnValue"}) // TODO: Fix this public void testGetDescriptor() { TestBadIdentifiersProto.getDescriptor(); TestBadIdentifiersProto.Descriptor.getDefaultInstance().getDescriptor(); @@ -76,6 +96,7 @@ public class TestBadIdentifiers extends TestCase { assertEquals("", message.getFieldName33()); assertEquals(0, message.get2Conflict34()); assertEquals(0, message.get2Conflict35()); + } public void testNumberFields() throws Exception { @@ -96,5 +117,6 @@ public class TestBadIdentifiers extends TestCase { assertEquals(0, message.get32()); assertEquals(0, message.get64Count()); assertEquals(0, message.get64List().size()); + } } diff --git a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java index 671cf8963c0a0f90915f17332f20ad0f975adf67..798d7ca612016e4167c5f0178ae95bcce615190d 100644 --- a/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java +++ b/java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import junit.framework.TestCase; /** @@ -24,47 +45,45 @@ public final class TestBadIdentifiersLite extends TestCase { public void testCompilation() { // If this compiles, it means the generation was correct. - TestBadIdentifiersProto.Deprecated.Builder builder1 = - TestBadIdentifiersProto.Deprecated.newBuilder(); - TestBadIdentifiersProto.Override.Builder builder2 = - TestBadIdentifiersProto.Override.newBuilder(); + TestBadIdentifiersProto.Deprecated.newBuilder(); + TestBadIdentifiersProto.Override.newBuilder(); } public void testConflictingFieldNames() throws Exception { TestBadIdentifiersProto.TestConflictingFieldNames message = TestBadIdentifiersProto.TestConflictingFieldNames.getDefaultInstance(); // Make sure generated accessors are properly named. - assertThat(message.getInt32Field1Count()).isEqualTo(0); - assertThat(message.getEnumField2Count()).isEqualTo(0); - assertThat(message.getStringField3Count()).isEqualTo(0); - assertThat(message.getBytesField4Count()).isEqualTo(0); - assertThat(message.getMessageField5Count()).isEqualTo(0); + assertEquals(0, message.getInt32Field1Count()); + assertEquals(0, message.getEnumField2Count()); + assertEquals(0, message.getStringField3Count()); + assertEquals(0, message.getBytesField4Count()); + assertEquals(0, message.getMessageField5Count()); - assertThat(message.getInt32FieldCount11()).isEqualTo(0); - assertThat(message.getEnumFieldCount12().getNumber()).isEqualTo(0); - assertThat(message.getStringFieldCount13()).isEmpty(); - assertThat(message.getBytesFieldCount14()).isEqualTo(ByteString.EMPTY); - assertThat(message.getMessageFieldCount15().getSerializedSize()).isEqualTo(0); + assertEquals(0, message.getInt32FieldCount11()); + assertEquals(0, message.getEnumFieldCount12().getNumber()); + assertEquals("", message.getStringFieldCount13()); + assertEquals(ByteString.EMPTY, message.getBytesFieldCount14()); + assertEquals(0, message.getMessageFieldCount15().getSerializedSize()); - assertThat(message.getInt32Field21Count()).isEqualTo(0); - assertThat(message.getEnumField22Count()).isEqualTo(0); - assertThat(message.getStringField23Count()).isEqualTo(0); - assertThat(message.getBytesField24Count()).isEqualTo(0); - assertThat(message.getMessageField25Count()).isEqualTo(0); + assertEquals(0, message.getInt32Field21Count()); + assertEquals(0, message.getEnumField22Count()); + assertEquals(0, message.getStringField23Count()); + assertEquals(0, message.getBytesField24Count()); + assertEquals(0, message.getMessageField25Count()); - assertThat(message.getInt32Field1List()).isEmpty(); - assertThat(message.getInt32FieldList31()).isEqualTo(0); + assertEquals(0, message.getInt32Field1List().size()); + assertEquals(0, message.getInt32FieldList31()); - assertThat(message.getInt64FieldCount()).isEqualTo(0); - assertThat( - message - .getExtension(TestBadIdentifiersProto.TestConflictingFieldNames.int64FieldCount) - .longValue()) - .isEqualTo(0L); - assertThat( - message - .getExtension(TestBadIdentifiersProto.TestConflictingFieldNames.int64FieldList) - .longValue()) - .isEqualTo(0L); + assertEquals(0, message.getInt64FieldCount()); + assertEquals( + 0L, + message + .getExtension(TestBadIdentifiersProto.TestConflictingFieldNames.int64FieldCount) + .longValue()); + assertEquals( + 0L, + message + .getExtension(TestBadIdentifiersProto.TestConflictingFieldNames.int64FieldList) + .longValue()); } } diff --git a/java/core/src/test/java/com/google/protobuf/TestSchemas.java b/java/core/src/test/java/com/google/protobuf/TestSchemas.java index d2e1e0cc988f6a37fa7b20504775f0673bcc94ae..ab0ced4cdc7b839248b3f94c6bf489a0eb603ba3 100644 --- a/java/core/src/test/java/com/google/protobuf/TestSchemas.java +++ b/java/core/src/test/java/com/google/protobuf/TestSchemas.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -18,10 +41,6 @@ import com.google.protobuf.testing.Proto3Testing.Proto3MessageWithMaps; /** Schemas to support testing. */ public class TestSchemas { - - private TestSchemas() { - } - public static final Schema genericProto2Schema = new ManifestSchemaFactory().createSchema(Proto2Message.class); public static final Schema genericProto3Schema = diff --git a/java/core/src/test/java/com/google/protobuf/TestSchemasLite.java b/java/core/src/test/java/com/google/protobuf/TestSchemasLite.java index d7eea9cf4e40e53b9a0339738867f2a8b60928d7..28a89d72a14d9f43912251f038ecca1c81829964 100644 --- a/java/core/src/test/java/com/google/protobuf/TestSchemasLite.java +++ b/java/core/src/test/java/com/google/protobuf/TestSchemasLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/TestUtil.java b/java/core/src/test/java/com/google/protobuf/TestUtil.java index 0f57ecc9acca21706864b4baeaee946622f7a350..22c0be25226c936206ad37ab22b1b1fad5045d81 100644 --- a/java/core/src/test/java/com/google/protobuf/TestUtil.java +++ b/java/core/src/test/java/com/google/protobuf/TestUtil.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -57,7 +80,6 @@ import static com.google.protobuf.UnittestLite.optionalStringExtensionLite; import static com.google.protobuf.UnittestLite.optionalStringPieceExtensionLite; import static com.google.protobuf.UnittestLite.optionalUint32ExtensionLite; import static com.google.protobuf.UnittestLite.optionalUint64ExtensionLite; -import static com.google.protobuf.UnittestLite.optionalUnverifiedLazyMessageExtensionLite; import static com.google.protobuf.UnittestLite.packedBoolExtensionLite; import static com.google.protobuf.UnittestLite.packedDoubleExtensionLite; import static com.google.protobuf.UnittestLite.packedEnumExtensionLite; @@ -147,7 +169,6 @@ import static protobuf_unittest.UnittestProto.optionalStringExtension; import static protobuf_unittest.UnittestProto.optionalStringPieceExtension; import static protobuf_unittest.UnittestProto.optionalUint32Extension; import static protobuf_unittest.UnittestProto.optionalUint64Extension; -import static protobuf_unittest.UnittestProto.optionalUnverifiedLazyMessageExtension; import static protobuf_unittest.UnittestProto.packedBoolExtension; import static protobuf_unittest.UnittestProto.packedDoubleExtension; import static protobuf_unittest.UnittestProto.packedEnumExtension; @@ -212,14 +233,13 @@ import protobuf_unittest.UnittestProto.TestRequired; import protobuf_unittest.UnittestProto.TestUnpackedTypes; import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.io.RandomAccessFile; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.logging.Handler; import java.util.logging.LogRecord; -import org.junit.Assert; +import junit.framework.Assert; /** * Contains methods for setting all fields of {@code TestAllTypes} to some values as well as @@ -240,8 +260,8 @@ public final class TestUtil { TestRequired.newBuilder().setA(1).setB(2).setC(3).build(); /** Helper to convert a String to ByteString. */ - public static ByteString toBytes(String str) { - return ByteString.copyFromUtf8(str); + static ByteString toBytes(String str) { + return ByteString.copyFrom(str.getBytes(Internal.UTF_8)); } // BEGIN FULL-RUNTIME @@ -323,8 +343,6 @@ public final class TestUtil { message.setOptionalImportMessage(ImportMessage.newBuilder().setD(120).build()); message.setOptionalPublicImportMessage(PublicImportMessage.newBuilder().setE(126).build()); message.setOptionalLazyMessage(TestAllTypes.NestedMessage.newBuilder().setBb(127).build()); - message.setOptionalUnverifiedLazyMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(128).build()); message.setOptionalNestedEnum(TestAllTypes.NestedEnum.BAZ); message.setOptionalForeignEnum(ForeignEnum.FOREIGN_BAZ); @@ -883,8 +901,8 @@ public final class TestUtil { Assert.assertEquals(208L, message.getRepeatedFixed64(0)); Assert.assertEquals(209, message.getRepeatedSfixed32(0)); Assert.assertEquals(210L, message.getRepeatedSfixed64(0)); - Assert.assertEquals(211F, message.getRepeatedFloat(0), 0.0); - Assert.assertEquals(212D, message.getRepeatedDouble(0), 0.0); + Assert.assertEquals(211F, message.getRepeatedFloat(0)); + Assert.assertEquals(212D, message.getRepeatedDouble(0)); Assert.assertEquals(true, message.getRepeatedBool(0)); Assert.assertEquals("215", message.getRepeatedString(0)); Assert.assertEquals(toBytes("216"), message.getRepeatedBytes(0)); @@ -913,8 +931,8 @@ public final class TestUtil { Assert.assertEquals(508L, message.getRepeatedFixed64(1)); Assert.assertEquals(509, message.getRepeatedSfixed32(1)); Assert.assertEquals(510L, message.getRepeatedSfixed64(1)); - Assert.assertEquals(511F, message.getRepeatedFloat(1), 0.0); - Assert.assertEquals(512D, message.getRepeatedDouble(1), 0.0); + Assert.assertEquals(511F, message.getRepeatedFloat(1)); + Assert.assertEquals(512D, message.getRepeatedDouble(1)); Assert.assertEquals(true, message.getRepeatedBool(1)); Assert.assertEquals("515", message.getRepeatedString(1)); Assert.assertEquals(toBytes("516"), message.getRepeatedBytes(1)); @@ -1222,9 +1240,6 @@ public final class TestUtil { optionalPublicImportMessageExtension, PublicImportMessage.newBuilder().setE(126).build()); message.setExtension( optionalLazyMessageExtension, TestAllTypes.NestedMessage.newBuilder().setBb(127).build()); - message.setExtension( - optionalUnverifiedLazyMessageExtension, - TestAllTypes.NestedMessage.newBuilder().setBb(128).build()); message.setExtension(optionalNestedEnumExtension, TestAllTypes.NestedEnum.BAZ); message.setExtension(optionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ); @@ -1444,8 +1459,6 @@ public final class TestUtil { assertEqualsExactType(120, message.getExtension(optionalImportMessageExtension).getD()); assertEqualsExactType(126, message.getExtension(optionalPublicImportMessageExtension).getE()); assertEqualsExactType(127, message.getExtension(optionalLazyMessageExtension).getBb()); - assertEqualsExactType( - 128, message.getExtension(optionalUnverifiedLazyMessageExtension).getBb()); assertEqualsExactType( TestAllTypes.NestedEnum.BAZ, message.getExtension(optionalNestedEnumExtension)); @@ -2038,8 +2051,6 @@ public final class TestUtil { assertEqualsExactType( 126, message.getExtension(optionalPublicImportMessageExtensionLite).getE()); assertEqualsExactType(127, message.getExtension(optionalLazyMessageExtensionLite).getBb()); - assertEqualsExactType( - 128, message.getExtension(optionalUnverifiedLazyMessageExtensionLite).getBb()); assertEqualsExactType( TestAllTypesLite.NestedEnum.BAZ, message.getExtension(optionalNestedEnumExtensionLite)); @@ -2233,7 +2244,6 @@ public final class TestUtil { Assert.assertFalse(message.hasExtension(optionalImportMessageExtensionLite)); Assert.assertFalse(message.hasExtension(optionalPublicImportMessageExtensionLite)); Assert.assertFalse(message.hasExtension(optionalLazyMessageExtensionLite)); - Assert.assertFalse(message.hasExtension(optionalUnverifiedLazyMessageExtensionLite)); Assert.assertFalse(message.hasExtension(optionalNestedEnumExtensionLite)); Assert.assertFalse(message.hasExtension(optionalForeignEnumExtensionLite)); @@ -2266,7 +2276,6 @@ public final class TestUtil { Assert.assertFalse(message.getExtension(optionalImportMessageExtensionLite).hasD()); Assert.assertFalse(message.getExtension(optionalPublicImportMessageExtensionLite).hasE()); Assert.assertFalse(message.getExtension(optionalLazyMessageExtensionLite).hasBb()); - Assert.assertFalse(message.getExtension(optionalUnverifiedLazyMessageExtensionLite).hasBb()); assertEqualsExactType(0, message.getExtension(optionalGroupExtensionLite).getA()); assertEqualsExactType(0, message.getExtension(optionalNestedMessageExtensionLite).getBb()); @@ -2274,8 +2283,6 @@ public final class TestUtil { assertEqualsExactType(0, message.getExtension(optionalImportMessageExtensionLite).getD()); assertEqualsExactType(0, message.getExtension(optionalPublicImportMessageExtensionLite).getE()); assertEqualsExactType(0, message.getExtension(optionalLazyMessageExtensionLite).getBb()); - assertEqualsExactType( - 0, message.getExtension(optionalUnverifiedLazyMessageExtensionLite).getBb()); // Enums without defaults are set to the first value in the enum. assertEqualsExactType( @@ -2530,7 +2537,7 @@ public final class TestUtil { // =================================================================== // oneof public static void setOneof(TestOneof2.Builder message) { - message.setFooLazyMessage(TestOneof2.NestedMessage.newBuilder().setMooInt(100).build()); + message.setFooLazyMessage(TestOneof2.NestedMessage.newBuilder().setQuxInt(100).build()); message.setBarString("101"); message.setBazInt(102); message.setBazString("103"); @@ -2538,13 +2545,13 @@ public final class TestUtil { public static void assertOneofSet(TestOneof2 message) { Assert.assertTrue(message.hasFooLazyMessage()); - Assert.assertTrue(message.getFooLazyMessage().hasMooInt()); + Assert.assertTrue(message.getFooLazyMessage().hasQuxInt()); Assert.assertTrue(message.hasBarString()); Assert.assertTrue(message.hasBazInt()); Assert.assertTrue(message.hasBazString()); - Assert.assertEquals(100, message.getFooLazyMessage().getMooInt()); + Assert.assertEquals(100, message.getFooLazyMessage().getQuxInt()); Assert.assertEquals("101", message.getBarString()); Assert.assertEquals(102, message.getBazInt()); Assert.assertEquals("103", message.getBazString()); @@ -2630,12 +2637,9 @@ public final class TestUtil { case FOO_LAZY_MESSAGE: Assert.assertTrue(message.hasFooLazyMessage()); break; - case FOO_BYTES_CORD: - Assert.assertTrue(message.hasFooBytesCord()); - break; case FOO_NOT_SET: break; - // TODO: go/enum-switch-lsc + // TODO(b/18683919): go/enum-switch-lsc } } @@ -2846,11 +2850,6 @@ public final class TestUtil { message.setField( f("optional_lazy_message"), newBuilderForField(message, f("optional_lazy_message")).setField(nestedB, 127).build()); - message.setField( - f("optional_unverified_lazy_message"), - newBuilderForField(message, f("optional_unverified_lazy_message")) - .setField(nestedB, 128) - .build()); message.setField(f("optional_nested_enum"), nestedBaz); message.setField(f("optional_foreign_enum"), foreignBaz); @@ -3101,9 +3100,6 @@ public final class TestUtil { 126, ((Message) message.getField(f("optional_public_import_message"))).getField(importE)); Assert.assertEquals( 127, ((Message) message.getField(f("optional_lazy_message"))).getField(nestedB)); - Assert.assertEquals( - 128, - ((Message) message.getField(f("optional_unverified_lazy_message"))).getField(nestedB)); Assert.assertEquals(nestedBaz, message.getField(f("optional_nested_enum"))); Assert.assertEquals(foreignBaz, message.getField(f("optional_foreign_enum"))); @@ -3355,8 +3351,6 @@ public final class TestUtil { ((Message) message.getField(f("optional_public_import_message"))).hasField(importE)); Assert.assertFalse( ((Message) message.getField(f("optional_lazy_message"))).hasField(nestedB)); - Assert.assertFalse( - ((Message) message.getField(f("optional_unverified_lazy_message"))).hasField(nestedB)); Assert.assertEquals(0, ((Message) message.getField(f("optionalgroup"))).getField(groupA)); Assert.assertEquals( @@ -3369,8 +3363,6 @@ public final class TestUtil { 0, ((Message) message.getField(f("optional_public_import_message"))).getField(importE)); Assert.assertEquals( 0, ((Message) message.getField(f("optional_lazy_message"))).getField(nestedB)); - Assert.assertEquals( - 0, ((Message) message.getField(f("optional_unverified_lazy_message"))).getField(nestedB)); // Enums without defaults are set to the first value in the enum. Assert.assertEquals(nestedFoo, message.getField(f("optional_nested_enum"))); @@ -3766,9 +3758,7 @@ public final class TestUtil { /** @param filePath The path relative to {@link #getTestDataDir}. */ public static String readTextFromFile(String filePath) { - return readBytesFromFile(filePath) - .toStringUtf8() - .replace(System.getProperty("line.separator"), "\n"); + return readBytesFromFile(filePath).toStringUtf8(); } private static File getTestDataDir() { @@ -3780,19 +3770,8 @@ public final class TestUtil { } catch (IOException e) { throw new RuntimeException("Couldn't get canonical name of working directory.", e); } - - String srcRootCheck = "src/google/protobuf"; - - // If we're running w/ Bazel on Windows, we're not in a sandbox, so we - // we must change our source root check condition to find the true test data dir. - String testBinaryName = System.getenv("TEST_BINARY"); - if (testBinaryName != null && testBinaryName.endsWith(".exe")) { - srcRootCheck = srcRootCheck + "/descriptor.cc"; - } - while (ancestor != null && ancestor.exists()) { - // Identify the true source root. - if (new File(ancestor, srcRootCheck).exists()) { + if (new File(ancestor, "src/google/protobuf").exists()) { return new File(ancestor, "src/google/protobuf/testdata"); } ancestor = ancestor.getParentFile(); @@ -3823,11 +3802,8 @@ public final class TestUtil { private static ByteString readBytesFromResource(String name) { try { - InputStream in = TestUtil.class.getResourceAsStream(name); - if (in == null) { // - throw new RuntimeException("Tests data file " + name + " is missing."); - } - return ByteString.readFrom(in); + return ByteString.copyFrom( + com.google.common.io.ByteStreams.toByteArray(TestUtil.class.getResourceAsStream(name))); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/java/core/src/test/java/com/google/protobuf/TestUtilLite.java b/java/core/src/test/java/com/google/protobuf/TestUtilLite.java index 1839695661a760d8df175cc093831ea7dd29fd65..31565fc40a64e67c1efdc3349e2e460cd5243d43 100644 --- a/java/core/src/test/java/com/google/protobuf/TestUtilLite.java +++ b/java/core/src/test/java/com/google/protobuf/TestUtilLite.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -57,7 +80,6 @@ import static com.google.protobuf.UnittestLite.optionalStringExtensionLite; import static com.google.protobuf.UnittestLite.optionalStringPieceExtensionLite; import static com.google.protobuf.UnittestLite.optionalUint32ExtensionLite; import static com.google.protobuf.UnittestLite.optionalUint64ExtensionLite; -import static com.google.protobuf.UnittestLite.optionalUnverifiedLazyMessageExtensionLite; import static com.google.protobuf.UnittestLite.packedBoolExtensionLite; import static com.google.protobuf.UnittestLite.packedDoubleExtensionLite; import static com.google.protobuf.UnittestLite.packedEnumExtensionLite; @@ -120,8 +142,8 @@ public final class TestUtilLite { private TestUtilLite() {} /** Helper to convert a String to ByteString. */ - public static ByteString toBytes(String str) { - return ByteString.copyFromUtf8(str); + static ByteString toBytes(String str) { + return ByteString.copyFrom(str.getBytes(Internal.UTF_8)); } /** @@ -175,8 +197,6 @@ public final class TestUtilLite { builder.setOptionalImportMessage(ImportMessageLite.newBuilder().setD(120).build()); builder.setOptionalPublicImportMessage(PublicImportMessageLite.newBuilder().setE(126).build()); builder.setOptionalLazyMessage(TestAllTypesLite.NestedMessage.newBuilder().setBb(127).build()); - builder.setOptionalUnverifiedLazyMessage( - TestAllTypesLite.NestedMessage.newBuilder().setBb(128).build()); builder.setOptionalNestedEnum(TestAllTypesLite.NestedEnum.BAZ); builder.setOptionalForeignEnum(ForeignEnumLite.FOREIGN_LITE_BAZ); @@ -335,9 +355,6 @@ public final class TestUtilLite { message.setExtension( optionalLazyMessageExtensionLite, TestAllTypesLite.NestedMessage.newBuilder().setBb(127).build()); - message.setExtension( - optionalUnverifiedLazyMessageExtensionLite, - TestAllTypesLite.NestedMessage.newBuilder().setBb(128).build()); message.setExtension(optionalNestedEnumExtensionLite, TestAllTypesLite.NestedEnum.BAZ); message.setExtension(optionalForeignEnumExtensionLite, ForeignEnumLite.FOREIGN_LITE_BAZ); diff --git a/java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java b/java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java index 6a4d0cd81af58960ee8728867f56ce133ff51851..ff413720b779a082e97b6d90d83e8f46ca00d119 100644 --- a/java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java +++ b/java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java @@ -1,26 +1,42 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import protobuf_unittest.UnittestProto.TestAllTypes; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Test {@link TextFormatParseInfoTree}. */ -@RunWith(JUnit4.class) -public class TextFormatParseInfoTreeTest { +/** Test @{link TextFormatParseInfoTree}. */ +public class TextFormatParseInfoTreeTest extends TestCase { private static final Descriptor DESCRIPTOR = TestAllTypes.getDescriptor(); private static final FieldDescriptor OPTIONAL_INT32 = @@ -41,121 +57,110 @@ public class TextFormatParseInfoTreeTest { private TextFormatParseInfoTree.Builder rootBuilder; - @Before + @Override public void setUp() { rootBuilder = TextFormatParseInfoTree.builder(); } - @Test public void testBuildEmptyParseTree() { TextFormatParseInfoTree tree = rootBuilder.build(); - assertThat(tree.getLocations(null)).isEmpty(); + assertTrue(tree.getLocations(null).isEmpty()); } - @Test public void testGetLocationReturnsSingleLocation() { rootBuilder.setLocation(OPTIONAL_INT32, LOC0); TextFormatParseInfoTree root = rootBuilder.build(); - assertThat(root.getLocation(OPTIONAL_INT32, 0)).isEqualTo(LOC0); - assertThat(root.getLocations(OPTIONAL_INT32)).hasSize(1); + assertEquals(LOC0, root.getLocation(OPTIONAL_INT32, 0)); + assertEquals(1, root.getLocations(OPTIONAL_INT32).size()); } - @Test public void testGetLocationsReturnsNoParseLocationsForUnknownField() { - assertThat(rootBuilder.build().getLocations(OPTIONAL_INT32)).isEmpty(); + assertTrue(rootBuilder.build().getLocations(OPTIONAL_INT32).isEmpty()); rootBuilder.setLocation(OPTIONAL_BOOLEAN, LOC0); TextFormatParseInfoTree root = rootBuilder.build(); - assertThat(root.getLocations(OPTIONAL_INT32)).isEmpty(); - assertThat(root.getLocations(OPTIONAL_BOOLEAN).get(0)).isEqualTo(LOC0); + assertTrue(root.getLocations(OPTIONAL_INT32).isEmpty()); + assertEquals(LOC0, root.getLocations(OPTIONAL_BOOLEAN).get(0)); } - @Test public void testGetLocationThrowsIllegalArgumentExceptionForUnknownField() { rootBuilder.setLocation(REPEATED_INT32, LOC0); TextFormatParseInfoTree root = rootBuilder.build(); try { root.getNestedTree(OPTIONAL_INT32, 0); - assertWithMessage("Did not detect unknown field").fail(); + fail("Did not detect unknown field"); } catch (IllegalArgumentException expected) { // pass } } - @Test public void testGetLocationThrowsIllegalArgumentExceptionForInvalidIndex() { TextFormatParseInfoTree root = rootBuilder.setLocation(OPTIONAL_INT32, LOC0).build(); try { root.getLocation(OPTIONAL_INT32, 1); - assertWithMessage("Invalid index not detected").fail(); + fail("Invalid index not detected"); } catch (IllegalArgumentException expected) { // pass } try { root.getLocation(OPTIONAL_INT32, -1); - assertWithMessage("Negative index not detected").fail(); + fail("Negative index not detected"); } catch (IllegalArgumentException expected) { // pass } } - @Test public void testGetLocationsReturnsMultipleLocations() { rootBuilder.setLocation(REPEATED_INT32, LOC0); rootBuilder.setLocation(REPEATED_INT32, LOC1); TextFormatParseInfoTree root = rootBuilder.build(); - assertThat(root.getLocation(REPEATED_INT32, 0)).isEqualTo(LOC0); - assertThat(root.getLocation(REPEATED_INT32, 1)).isEqualTo(LOC1); - assertThat(root.getLocations(REPEATED_INT32)).hasSize(2); + assertEquals(LOC0, root.getLocation(REPEATED_INT32, 0)); + assertEquals(LOC1, root.getLocation(REPEATED_INT32, 1)); + assertEquals(2, root.getLocations(REPEATED_INT32).size()); } - @Test public void testGetNestedTreeThrowsIllegalArgumentExceptionForUnknownField() { rootBuilder.setLocation(REPEATED_INT32, LOC0); TextFormatParseInfoTree root = rootBuilder.build(); try { root.getNestedTree(OPTIONAL_NESTED_MESSAGE, 0); - assertWithMessage("Did not detect unknown field").fail(); + fail("Did not detect unknown field"); } catch (IllegalArgumentException expected) { // pass } } - @Test public void testGetNestedTreesReturnsNoParseInfoTreesForUnknownField() { rootBuilder.setLocation(REPEATED_INT32, LOC0); TextFormatParseInfoTree root = rootBuilder.build(); - assertThat(root.getNestedTrees(OPTIONAL_NESTED_MESSAGE)).isEmpty(); + assertTrue(root.getNestedTrees(OPTIONAL_NESTED_MESSAGE).isEmpty()); } - @Test public void testGetNestedTreeThrowsIllegalArgumentExceptionForInvalidIndex() { rootBuilder.setLocation(REPEATED_INT32, LOC0); rootBuilder.getBuilderForSubMessageField(OPTIONAL_NESTED_MESSAGE); TextFormatParseInfoTree root = rootBuilder.build(); try { root.getNestedTree(OPTIONAL_NESTED_MESSAGE, 1); - assertWithMessage("Submessage index that is too large not detected").fail(); + fail("Submessage index that is too large not detected"); } catch (IllegalArgumentException expected) { // pass } try { rootBuilder.build().getNestedTree(OPTIONAL_NESTED_MESSAGE, -1); - assertWithMessage("Invalid submessage index (-1) not detected").fail(); + fail("Invalid submessage index (-1) not detected"); } catch (IllegalArgumentException expected) { // pass } } - @Test public void testGetNestedTreesReturnsSingleTree() { rootBuilder.getBuilderForSubMessageField(OPTIONAL_NESTED_MESSAGE); TextFormatParseInfoTree root = rootBuilder.build(); - assertThat(root.getNestedTrees(OPTIONAL_NESTED_MESSAGE)).hasSize(1); + assertEquals(1, root.getNestedTrees(OPTIONAL_NESTED_MESSAGE).size()); TextFormatParseInfoTree subtree = root.getNestedTrees(OPTIONAL_NESTED_MESSAGE).get(0); - assertThat(subtree).isNotNull(); + assertNotNull(subtree); } - @Test public void testGetNestedTreesReturnsMultipleTrees() { TextFormatParseInfoTree.Builder subtree1Builder = rootBuilder.getBuilderForSubMessageField(REPEATED_NESTED_MESSAGE); @@ -165,10 +170,10 @@ public class TextFormatParseInfoTreeTest { rootBuilder.getBuilderForSubMessageField(REPEATED_NESTED_MESSAGE); subtree2Builder.getBuilderForSubMessageField(FIELD_BB); TextFormatParseInfoTree root = rootBuilder.build(); - assertThat(root.getNestedTrees(REPEATED_NESTED_MESSAGE)).hasSize(2); - assertThat(root.getNestedTrees(REPEATED_NESTED_MESSAGE).get(0).getNestedTrees(FIELD_BB)) - .hasSize(2); - assertThat(root.getNestedTrees(REPEATED_NESTED_MESSAGE).get(1).getNestedTrees(FIELD_BB)) - .hasSize(1); + assertEquals(2, root.getNestedTrees(REPEATED_NESTED_MESSAGE).size()); + assertEquals( + 2, root.getNestedTrees(REPEATED_NESTED_MESSAGE).get(0).getNestedTrees(FIELD_BB).size()); + assertEquals( + 1, root.getNestedTrees(REPEATED_NESTED_MESSAGE).get(1).getNestedTrees(FIELD_BB).size()); } } diff --git a/java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java b/java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java index 5027f1b2ea2876ce71b33a39a4d3945a32419f88..19abc3f88fa8b3c151fe6d5df269db6a4791cafa 100644 --- a/java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java +++ b/java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java @@ -1,72 +1,84 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Test {@link TextFormatParseLocation}. */ -@RunWith(JUnit4.class) -public class TextFormatParseLocationTest { +/** Test @{link TextFormatParseLocation}. */ +public class TextFormatParseLocationTest extends TestCase { - @Test public void testCreateEmpty() { TextFormatParseLocation location = TextFormatParseLocation.create(-1, -1); - assertThat(location).isEqualTo(TextFormatParseLocation.EMPTY); + assertEquals(TextFormatParseLocation.EMPTY, location); } - @Test public void testCreate() { TextFormatParseLocation location = TextFormatParseLocation.create(2, 1); - assertThat(location.getLine()).isEqualTo(2); - assertThat(location.getColumn()).isEqualTo(1); + assertEquals(2, location.getLine()); + assertEquals(1, location.getColumn()); } - @Test public void testCreateThrowsIllegalArgumentExceptionForInvalidIndex() { try { TextFormatParseLocation.create(-1, 0); - assertWithMessage("Should throw IllegalArgumentException if line is less than 0").fail(); + fail("Should throw IllegalArgumentException if line is less than 0"); } catch (IllegalArgumentException unused) { // pass } try { TextFormatParseLocation.create(0, -1); - assertWithMessage("Should throw, column < 0").fail(); + fail("Should throw, column < 0"); } catch (IllegalArgumentException unused) { // pass } } - @Test public void testHashCode() { TextFormatParseLocation loc0 = TextFormatParseLocation.create(2, 1); TextFormatParseLocation loc1 = TextFormatParseLocation.create(2, 1); - assertThat(loc0.hashCode()).isEqualTo(loc1.hashCode()); - assertThat(TextFormatParseLocation.EMPTY.hashCode()) - .isEqualTo(TextFormatParseLocation.EMPTY.hashCode()); + assertEquals(loc0.hashCode(), loc1.hashCode()); + assertEquals( + TextFormatParseLocation.EMPTY.hashCode(), TextFormatParseLocation.EMPTY.hashCode()); } - @Test public void testEquals() { TextFormatParseLocation loc0 = TextFormatParseLocation.create(2, 1); TextFormatParseLocation loc1 = TextFormatParseLocation.create(1, 2); TextFormatParseLocation loc2 = TextFormatParseLocation.create(2, 2); TextFormatParseLocation loc3 = TextFormatParseLocation.create(2, 1); - assertThat(loc0).isEqualTo(loc3); - assertThat(loc0).isNotSameInstanceAs(loc1); - assertThat(loc0).isNotSameInstanceAs(loc2); - assertThat(loc1).isNotSameInstanceAs(loc2); + assertEquals(loc0, loc3); + assertNotSame(loc0, loc1); + assertNotSame(loc0, loc2); + assertNotSame(loc1, loc2); } } diff --git a/java/core/src/test/java/com/google/protobuf/TextFormatPerformanceTest.java b/java/core/src/test/java/com/google/protobuf/TextFormatPerformanceTest.java deleted file mode 100644 index beb59e6dac8a98665b46dfdd33fc3ede63943101..0000000000000000000000000000000000000000 --- a/java/core/src/test/java/com/google/protobuf/TextFormatPerformanceTest.java +++ /dev/null @@ -1,89 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf; - -import static com.google.common.truth.Truth.assertThat; - -import com.google.protobuf.testing.textformat.performance.proto2.Proto2TextFormatPerformanceProto; -import com.google.protobuf.testing.textformat.performance.proto3.Proto3TextFormatPerformanceProto; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class TextFormatPerformanceTest { - // 10 Seconds is longer than we'd really like, but necesssary to keep this test from being flaky. - // This test is mostly to make sure it doesn't explode to many 10s of seconds for some reason. - private static final long MAX_PARSE_TIME_MS = 10_000L; - - private static final int REPEAT_COUNT = 400000; - private static final String CONTAINS_SUB_MESSAGE_WITH_REPEATED_INT32 = - repeat("sub_msg { value: 123 }", REPEAT_COUNT); - private static final String CONTAINS_EXTENSION_SUB_MESSAGE_WITH_REPEATED_INT32 = - repeat( - "[protobuf.testing.textformat.performance.proto2.sub_msg_ext] { value: 123 }", - REPEAT_COUNT); - - // OSS Tests are still using JDK 8, which doesn't have JDK 11 String.repeat() - private static String repeat(String text, int count) { - StringBuilder builder = new StringBuilder(text.length() * count); - for (int i = 0; i < count; ++i) { - builder.append(text); - } - return builder.toString(); - } - - @Test(timeout = MAX_PARSE_TIME_MS) - public void testProto2ImmutableTextFormatParsing() throws Exception { - Proto2TextFormatPerformanceProto.ContainsSubMessageWithRepeatedInt32.Builder builder = - Proto2TextFormatPerformanceProto.ContainsSubMessageWithRepeatedInt32.newBuilder(); - - TextFormat.merge(CONTAINS_SUB_MESSAGE_WITH_REPEATED_INT32, builder); - - Proto2TextFormatPerformanceProto.ContainsSubMessageWithRepeatedInt32 msg = builder.build(); - assertThat(msg.getSubMsg().getValueCount()).isEqualTo(REPEAT_COUNT); - for (int i = 0; i < msg.getSubMsg().getValueCount(); ++i) { - assertThat(msg.getSubMsg().getValue(i)).isEqualTo(123); - } - } - - @Test(timeout = MAX_PARSE_TIME_MS) - public void testProto2ImmutableExtensionTextFormatParsing() throws Exception { - ExtensionRegistry registry = ExtensionRegistry.newInstance(); - Proto2TextFormatPerformanceProto.registerAllExtensions(registry); - - Proto2TextFormatPerformanceProto.ContainsExtensionSubMessage.Builder builder = - Proto2TextFormatPerformanceProto.ContainsExtensionSubMessage.newBuilder(); - - TextFormat.merge(CONTAINS_EXTENSION_SUB_MESSAGE_WITH_REPEATED_INT32, registry, builder); - - Proto2TextFormatPerformanceProto.ContainsExtensionSubMessage msg = builder.build(); - assertThat(msg.getExtension(Proto2TextFormatPerformanceProto.subMsgExt).getValueCount()) - .isEqualTo(REPEAT_COUNT); - for (int i = 0; - i < msg.getExtension(Proto2TextFormatPerformanceProto.subMsgExt).getValueCount(); - ++i) { - assertThat(msg.getExtension(Proto2TextFormatPerformanceProto.subMsgExt).getValue(i)) - .isEqualTo(123); - } - } - - @Test(timeout = MAX_PARSE_TIME_MS) - public void testProto3ImmutableTextFormatParsing() throws Exception { - Proto3TextFormatPerformanceProto.ContainsSubMessageWithRepeatedInt32.Builder builder = - Proto3TextFormatPerformanceProto.ContainsSubMessageWithRepeatedInt32.newBuilder(); - - TextFormat.merge(CONTAINS_SUB_MESSAGE_WITH_REPEATED_INT32, builder); - - Proto3TextFormatPerformanceProto.ContainsSubMessageWithRepeatedInt32 msg = builder.build(); - assertThat(msg.getSubMsg().getValueCount()).isEqualTo(REPEAT_COUNT); - for (int i = 0; i < msg.getSubMsg().getValueCount(); ++i) { - assertThat(msg.getSubMsg().getValue(i)).isEqualTo(123); - } - } -} diff --git a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java index d95ed4c8d9af972bc6aa62831924a9171f86b4c9..915dddf39218a9677b2a2581ed692a6144fbe04b 100644 --- a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java +++ b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java @@ -1,17 +1,38 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static com.google.protobuf.TestUtil.TEST_REQUIRED_INITIALIZED; import static com.google.protobuf.TestUtil.TEST_REQUIRED_UNINITIALIZED; -import static org.junit.Assert.assertThrows; import com.google.protobuf.DescriptorProtos.DescriptorProto; import com.google.protobuf.DescriptorProtos.FieldDescriptorProto; @@ -19,7 +40,6 @@ import com.google.protobuf.DescriptorProtos.FileDescriptorProto; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.Descriptors.FileDescriptor; -import com.google.protobuf.TextFormat.InvalidEscapeSequenceException; import com.google.protobuf.TextFormat.Parser.SingularOverwritePolicy; import com.google.protobuf.testing.proto.TestProto3Optional; import com.google.protobuf.testing.proto.TestProto3Optional.NestedEnum; @@ -33,22 +53,22 @@ import protobuf_unittest.UnittestProto.TestAllTypes; import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage; import protobuf_unittest.UnittestProto.TestEmptyMessage; import protobuf_unittest.UnittestProto.TestOneof2; -import protobuf_unittest.UnittestProto.TestRecursiveMessage; import protobuf_unittest.UnittestProto.TestRequired; -import protobuf_unittest.UnittestProto.TestReservedFields; import proto2_wireformat_unittest.UnittestMsetWireFormat.TestMessageSet; import java.io.StringReader; import java.util.Arrays; import java.util.List; import java.util.logging.Logger; -import org.junit.Test; -import org.junit.function.ThrowingRunnable; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Test case for {@link TextFormat}. */ -@RunWith(JUnit4.class) -public class TextFormatTest { +/** + * Test case for {@link TextFormat}. + * + *

      TODO(wenboz): ExtensionTest and rest of text_format_unittest.cc. + * + * @author wenboz@google.com (Wenbo Zhu) + */ +public class TextFormatTest extends TestCase { // A basic string with different escapable characters for testing. private static final String ESCAPE_TEST_STRING = @@ -59,12 +79,12 @@ public class TextFormatTest { "\\\"A string with \\' characters \\n and \\r newlines " + "and \\t tabs and \\001 slashes \\\\"; - private static final String ALL_FIELDS_SET_TEXT = + private static String allFieldsSetText = TestUtil.readTextFromFile("text_format_unittest_data_oneof_implemented.txt"); - private static final String ALL_EXTENSIONS_SET_TEXT = + private static String allExtensionsSetText = TestUtil.readTextFromFile("text_format_unittest_extensions_data.txt"); - private static final String EXOTIC_TEXT = + private static String exoticText = "" + "repeated_int32: -1\n" + "repeated_int32: -2147483648\n" @@ -94,8 +114,8 @@ public class TextFormatTest { + "\\341\\210\\264\"\n" + "repeated_bytes: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\376\"\n"; - private static final String CANONICAL_EXOTIC_TEXT = - EXOTIC_TEXT + private static String canonicalExoticText = + exoticText .replace(": .", ": 0.") .replace(": -.", ": -0.") // short-form double .replace("23e", "23E") @@ -103,7 +123,7 @@ public class TextFormatTest { .replace("0.23E17", "2.3E16") .replace(",", ""); - private static final String MESSAGE_SET_TEXT = + private String messageSetText = "" + "[protobuf_unittest.TestMessageSetExtension1] {\n" + " i: 123\n" @@ -112,7 +132,7 @@ public class TextFormatTest { + " str: \"foo\"\n" + "}\n"; - private static final String MESSAGE_SET_TEXT_WITH_REPEATED_EXTENSION = + private String messageSetTextWithRepeatedExtension = "" + "[protobuf_unittest.TestMessageSetExtension1] {\n" + " i: 123\n" @@ -121,21 +141,20 @@ public class TextFormatTest { + " i: 456\n" + "}\n"; - private static final TextFormat.Parser PARSER_ALLOWING_UNKNOWN_FIELDS = + private final TextFormat.Parser parserAllowingUnknownFields = TextFormat.Parser.newBuilder().setAllowUnknownFields(true).build(); - private static final TextFormat.Parser PARSER_ALLOWING_UNKNOWN_EXTENSIONS = + private final TextFormat.Parser parserAllowingUnknownExtensions = TextFormat.Parser.newBuilder().setAllowUnknownExtensions(true).build(); - private static final TextFormat.Parser PARSER_WITH_OVERWRITE_FORBIDDEN = + private final TextFormat.Parser parserWithOverwriteForbidden = TextFormat.Parser.newBuilder() .setSingularOverwritePolicy(SingularOverwritePolicy.FORBID_SINGULAR_OVERWRITES) .build(); - private static final TextFormat.Parser DEFAULT_PARSER = TextFormat.Parser.newBuilder().build(); + private final TextFormat.Parser defaultParser = TextFormat.Parser.newBuilder().build(); /** Print TestAllTypes and compare with golden file. */ - @Test public void testPrintMessage() throws Exception { String javaText = TextFormat.printer().printToString(TestUtil.getAllSet()); @@ -144,18 +163,10 @@ public class TextFormatTest { // C++ and Java TextFormat classes, so we need to conform. javaText = javaText.replace(".0\n", "\n"); - assertThat(javaText).isEqualTo(ALL_FIELDS_SET_TEXT); - } - - @Test - // https://github.com/protocolbuffers/protobuf/issues/9447 - public void testCharacterNotInUnicodeBlock() throws TextFormat.InvalidEscapeSequenceException { - ByteString actual = TextFormat.unescapeBytes("\\U000358da"); - assertThat(actual.size()).isEqualTo(4); + assertEquals(allFieldsSetText, javaText); } /** Print TestAllTypes as Builder and compare with golden file. */ - @Test public void testPrintMessageBuilder() throws Exception { String javaText = TextFormat.printer().printToString(TestUtil.getAllSetBuilder()); @@ -164,11 +175,10 @@ public class TextFormatTest { // C++ and Java TextFormat classes, so we need to conform. javaText = javaText.replace(".0\n", "\n"); - assertThat(javaText).isEqualTo(ALL_FIELDS_SET_TEXT); + assertEquals(allFieldsSetText, javaText); } /** Print TestAllExtensions and compare with golden file. */ - @Test public void testPrintExtensions() throws Exception { String javaText = TextFormat.printer().printToString(TestUtil.getAllExtensionsSet()); @@ -177,7 +187,7 @@ public class TextFormatTest { // C++ and Java TextFormat classes, so we need to conform. javaText = javaText.replace(".0\n", "\n"); - assertThat(javaText).isEqualTo(ALL_EXTENSIONS_SET_TEXT); + assertEquals(allExtensionsSetText, javaText); } // Creates an example unknown field set. @@ -213,45 +223,44 @@ public class TextFormatTest { .build(); } - @Test public void testPrintUnknownFields() throws Exception { // Test printing of unknown fields in a message. TestEmptyMessage message = TestEmptyMessage.newBuilder().setUnknownFields(makeUnknownFieldSet()).build(); - assertThat(TextFormat.printer().printToString(message)) - .isEqualTo( - "5: 1\n" - + "5: 0x00000002\n" - + "5: 0x0000000000000003\n" - + "5: \"4\"\n" - + "5: {\n" - + " 12: 6\n" - + "}\n" - + "5 {\n" - + " 10: 5\n" - + "}\n" - + "8: 1\n" - + "8: 2\n" - + "8: 3\n" - + "15: 12379813812177893520\n" - + "15: 0xabcd1234\n" - + "15: 0xabcdef1234567890\n"); + assertEquals( + "5: 1\n" + + "5: 0x00000002\n" + + "5: 0x0000000000000003\n" + + "5: \"4\"\n" + + "5: {\n" + + " 12: 6\n" + + "}\n" + + "5 {\n" + + " 10: 5\n" + + "}\n" + + "8: 1\n" + + "8: 2\n" + + "8: 3\n" + + "15: 12379813812177893520\n" + + "15: 0xabcd1234\n" + + "15: 0xabcdef1234567890\n", + TextFormat.printer().printToString(message)); } - @Test public void testPrintField() throws Exception { final FieldDescriptor dataField = OneString.getDescriptor().findFieldByName("data"); - assertThat(TextFormat.printer().printFieldToString(dataField, "test data")) - .isEqualTo("data: \"test data\"\n"); + assertEquals( + "data: \"test data\"\n", TextFormat.printer().printFieldToString(dataField, "test data")); final FieldDescriptor optionalField = TestAllTypes.getDescriptor().findFieldByName("optional_nested_message"); final Object value = NestedMessage.newBuilder().setBb(42).build(); - assertThat(TextFormat.printer().printFieldToString(optionalField, value)) - .isEqualTo("optional_nested_message {\n bb: 42\n}\n"); + assertEquals( + "optional_nested_message {\n bb: 42\n}\n", + TextFormat.printer().printFieldToString(optionalField, value)); } /** @@ -274,7 +283,6 @@ public class TextFormatTest { return ByteString.copyFrom(bytes); } - @Test public void testPrintExotic() throws Exception { Message message = TestAllTypes.newBuilder() @@ -311,10 +319,9 @@ public class TextFormatTest { .addRepeatedBytes(bytes("\0\001\007\b\f\n\r\t\013\\\'\"\u00fe")) .build(); - assertThat(message.toString()).isEqualTo(CANONICAL_EXOTIC_TEXT); + assertEquals(canonicalExoticText, message.toString()); } - @Test public void testRoundtripProto3Optional() throws Exception { Message message = TestProto3Optional.newBuilder() @@ -325,15 +332,14 @@ public class TextFormatTest { TestProto3Optional.Builder message2 = TestProto3Optional.newBuilder(); TextFormat.merge(message.toString(), message2); - assertThat(message2.hasOptionalInt32()).isTrue(); - assertThat(message2.hasOptionalInt64()).isTrue(); - assertThat(message2.hasOptionalNestedEnum()).isTrue(); - assertThat(message2.getOptionalInt32()).isEqualTo(1); - assertThat(message2.getOptionalInt64()).isEqualTo(2); - assertThat(message2.getOptionalNestedEnum()).isEqualTo(NestedEnum.BAZ); + assertTrue(message2.hasOptionalInt32()); + assertTrue(message2.hasOptionalInt64()); + assertTrue(message2.hasOptionalNestedEnum()); + assertEquals(1, message2.getOptionalInt32()); + assertEquals(2, message2.getOptionalInt64()); + assertEquals(NestedEnum.BAZ, message2.getOptionalNestedEnum()); } - @Test public void testPrintMessageSet() throws Exception { TestMessageSet messageSet = TestMessageSet.newBuilder() @@ -345,79 +351,69 @@ public class TextFormatTest { TestMessageSetExtension2.newBuilder().setStr("foo").build()) .build(); - assertThat(messageSet.toString()).isEqualTo(MESSAGE_SET_TEXT); + assertEquals(messageSetText, messageSet.toString()); } // ================================================================= - @Test public void testMerge() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(ALL_FIELDS_SET_TEXT, builder); + TextFormat.merge(allFieldsSetText, builder); TestUtil.assertAllFieldsSet(builder.build()); } - @Test public void testParse() throws Exception { - TestUtil.assertAllFieldsSet(TextFormat.parse(ALL_FIELDS_SET_TEXT, TestAllTypes.class)); + TestUtil.assertAllFieldsSet(TextFormat.parse(allFieldsSetText, TestAllTypes.class)); } - @Test public void testMergeInitialized() throws Exception { TestRequired.Builder builder = TestRequired.newBuilder(); TextFormat.merge(TEST_REQUIRED_INITIALIZED.toString(), builder); - assertThat(builder.buildPartial().toString()).isEqualTo(TEST_REQUIRED_INITIALIZED.toString()); - assertThat(builder.isInitialized()).isTrue(); + assertEquals(TEST_REQUIRED_INITIALIZED.toString(), builder.buildPartial().toString()); + assertTrue(builder.isInitialized()); } - @Test public void testParseInitialized() throws Exception { TestRequired parsed = TextFormat.parse(TEST_REQUIRED_INITIALIZED.toString(), TestRequired.class); - assertThat(parsed.toString()).isEqualTo(TEST_REQUIRED_INITIALIZED.toString()); - assertThat(parsed.isInitialized()).isTrue(); + assertEquals(TEST_REQUIRED_INITIALIZED.toString(), parsed.toString()); + assertTrue(parsed.isInitialized()); } - @Test public void testMergeUninitialized() throws Exception { TestRequired.Builder builder = TestRequired.newBuilder(); TextFormat.merge(TEST_REQUIRED_UNINITIALIZED.toString(), builder); - assertThat(builder.buildPartial().toString()).isEqualTo(TEST_REQUIRED_UNINITIALIZED.toString()); - assertThat(builder.isInitialized()).isFalse(); + assertEquals(TEST_REQUIRED_UNINITIALIZED.toString(), builder.buildPartial().toString()); + assertFalse(builder.isInitialized()); } - @Test public void testParseUninitialized() throws Exception { try { TextFormat.parse(TEST_REQUIRED_UNINITIALIZED.toString(), TestRequired.class); - assertWithMessage("Expected UninitializedMessageException.").fail(); + fail("Expected UninitializedMessageException."); } catch (UninitializedMessageException e) { - assertThat(e).hasMessageThat().isEqualTo("Message missing required fields: b, c"); + assertEquals("Message missing required fields: b, c", e.getMessage()); } } - @Test public void testMergeReader() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(new StringReader(ALL_FIELDS_SET_TEXT), builder); + TextFormat.merge(new StringReader(allFieldsSetText), builder); TestUtil.assertAllFieldsSet(builder.build()); } - @Test public void testMergeExtensions() throws Exception { TestAllExtensions.Builder builder = TestAllExtensions.newBuilder(); - TextFormat.merge(ALL_EXTENSIONS_SET_TEXT, TestUtil.getFullExtensionRegistry(), builder); + TextFormat.merge(allExtensionsSetText, TestUtil.getFullExtensionRegistry(), builder); TestUtil.assertAllExtensionsSet(builder.build()); } - @Test public void testParseExtensions() throws Exception { TestUtil.assertAllExtensionsSet( TextFormat.parse( - ALL_EXTENSIONS_SET_TEXT, TestUtil.getFullExtensionRegistry(), TestAllExtensions.class)); + allExtensionsSetText, TestUtil.getFullExtensionRegistry(), TestAllExtensions.class)); } - @Test public void testMergeAndParseCompatibility() throws Exception { String original = "repeated_float: inf\n" @@ -449,93 +445,82 @@ public class TextFormatTest { // Test merge(). TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge(original, builder); - assertThat(builder.build().toString()).isEqualTo(canonical); + assertEquals(canonical, builder.build().toString()); // Test parse(). - assertThat(TextFormat.parse(original, TestAllTypes.class).toString()).isEqualTo(canonical); + assertEquals(canonical, TextFormat.parse(original, TestAllTypes.class).toString()); } - @Test public void testMergeAndParseExotic() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - TextFormat.merge(EXOTIC_TEXT, builder); + TextFormat.merge(exoticText, builder); // Too lazy to check things individually. Don't try to debug this // if testPrintExotic() is failing. - assertThat(builder.build().toString()).isEqualTo(CANONICAL_EXOTIC_TEXT); - assertThat(TextFormat.parse(EXOTIC_TEXT, TestAllTypes.class).toString()) - .isEqualTo(CANONICAL_EXOTIC_TEXT); + assertEquals(canonicalExoticText, builder.build().toString()); + assertEquals(canonicalExoticText, TextFormat.parse(exoticText, TestAllTypes.class).toString()); } - @Test public void testMergeMessageSet() throws Exception { ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); extensionRegistry.add(TestMessageSetExtension1.messageSetExtension); extensionRegistry.add(TestMessageSetExtension2.messageSetExtension); TestMessageSet.Builder builder = TestMessageSet.newBuilder(); - TextFormat.merge(MESSAGE_SET_TEXT, extensionRegistry, builder); + TextFormat.merge(messageSetText, extensionRegistry, builder); TestMessageSet messageSet = builder.build(); - assertThat(messageSet.hasExtension(TestMessageSetExtension1.messageSetExtension)).isTrue(); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); - assertThat(messageSet.hasExtension(TestMessageSetExtension2.messageSetExtension)).isTrue(); - assertThat(messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()) - .isEqualTo("foo"); + assertTrue(messageSet.hasExtension(TestMessageSetExtension1.messageSetExtension)); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); + assertTrue(messageSet.hasExtension(TestMessageSetExtension2.messageSetExtension)); + assertEquals( + "foo", messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()); builder = TestMessageSet.newBuilder(); - TextFormat.merge(MESSAGE_SET_TEXT_WITH_REPEATED_EXTENSION, extensionRegistry, builder); + TextFormat.merge(messageSetTextWithRepeatedExtension, extensionRegistry, builder); messageSet = builder.build(); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(456); + assertEquals(456, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); } - @Test public void testMergeMessageSetWithOverwriteForbidden() throws Exception { ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); extensionRegistry.add(TestMessageSetExtension1.messageSetExtension); extensionRegistry.add(TestMessageSetExtension2.messageSetExtension); TestMessageSet.Builder builder = TestMessageSet.newBuilder(); - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(MESSAGE_SET_TEXT, extensionRegistry, builder); + parserWithOverwriteForbidden.merge(messageSetText, extensionRegistry, builder); TestMessageSet messageSet = builder.build(); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); - assertThat(messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()) - .isEqualTo("foo"); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); + assertEquals( + "foo", messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()); builder = TestMessageSet.newBuilder(); try { - PARSER_WITH_OVERWRITE_FORBIDDEN.merge( - MESSAGE_SET_TEXT_WITH_REPEATED_EXTENSION, extensionRegistry, builder); - assertWithMessage("expected parse exception").fail(); + parserWithOverwriteForbidden.merge( + messageSetTextWithRepeatedExtension, extensionRegistry, builder); + fail("expected parse exception"); } catch (TextFormat.ParseException e) { - assertThat(e) - .hasMessageThat() - .isEqualTo( - "4:44: Non-repeated field " - + "\"protobuf_unittest.TestMessageSetExtension1.message_set_extension\"" - + " cannot be overwritten."); + assertEquals( + "4:44: Non-repeated field " + + "\"protobuf_unittest.TestMessageSetExtension1.message_set_extension\"" + + " cannot be overwritten.", + e.getMessage()); } } - @Test public void testMergeNumericEnum() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge("optional_nested_enum: 2", builder); - assertThat(builder.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.BAR); + assertEquals(TestAllTypes.NestedEnum.BAR, builder.getOptionalNestedEnum()); } - @Test public void testMergeAngleBrackets() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge("OptionalGroup: < a: 1 >", builder); - assertThat(builder.hasOptionalGroup()).isTrue(); - assertThat(builder.getOptionalGroup().getA()).isEqualTo(1); + assertTrue(builder.hasOptionalGroup()); + assertEquals(1, builder.getOptionalGroup().getA()); } - @Test public void testMergeComment() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge( @@ -544,11 +529,10 @@ public class TextFormatTest { + "optional_int64: 2\n" + "# EOF comment", builder); - assertThat(builder.getOptionalInt32()).isEqualTo(1); - assertThat(builder.getOptionalInt64()).isEqualTo(2); + assertEquals(1, builder.getOptionalInt32()); + assertEquals(2, builder.getOptionalInt64()); } - @Test public void testPrintAny_customBuiltTypeRegistry() throws Exception { TestAny testAny = TestAny.newBuilder() @@ -569,7 +553,7 @@ public class TextFormatTest { + " optional_int32: 12345\n" + " }\n" + "}\n"; - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } private static Descriptor createDescriptorForAny(FieldDescriptorProto... fields) @@ -581,13 +565,14 @@ public class TextFormatTest { .setPackage("google.protobuf") .setSyntax("proto3") .addMessageType( - DescriptorProto.newBuilder().setName("Any").addAllField(Arrays.asList(fields))) + DescriptorProto.newBuilder() + .setName("Any") + .addAllField(Arrays.asList(fields))) .build(), new FileDescriptor[0]); return fileDescriptor.getMessageTypes().get(0); } - @Test public void testPrintAny_anyWithDynamicMessage() throws Exception { Descriptor descriptor = createDescriptorForAny( @@ -620,10 +605,9 @@ public class TextFormatTest { "[type.googleapis.com/protobuf_unittest.TestAllTypes] {\n" + " optional_int32: 12345\n" + "}\n"; - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } - @Test public void testPrintAny_anyFromWithNoValueField() throws Exception { Descriptor descriptor = createDescriptorForAny( @@ -644,10 +628,9 @@ public class TextFormatTest { .usingTypeRegistry(TypeRegistry.newBuilder().add(TestAllTypes.getDescriptor()).build()) .printToString(testAny); String expected = "type_url: \"type.googleapis.com/protobuf_unittest.TestAllTypes\"\n"; - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } - @Test public void testPrintAny_anyFromWithNoTypeUrlField() throws Exception { Descriptor descriptor = createDescriptorForAny( @@ -668,10 +651,9 @@ public class TextFormatTest { .usingTypeRegistry(TypeRegistry.newBuilder().add(TestAllTypes.getDescriptor()).build()) .printToString(testAny); String expected = "value: \"\\b\\271`\"\n"; - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } - @Test public void testPrintAny_anyWithInvalidFieldType() throws Exception { Descriptor descriptor = createDescriptorForAny( @@ -700,10 +682,10 @@ public class TextFormatTest { .printToString(testAny); String expected = "type_url: \"type.googleapis.com/protobuf_unittest.TestAllTypes\"\n" + "value: \"test\"\n"; - assertThat(actual).isEqualTo(expected); + assertEquals(expected, actual); } - @Test + public void testMergeAny_customBuiltTypeRegistry() throws Exception { TestAny.Builder builder = TestAny.newBuilder(); TextFormat.Parser.newBuilder() @@ -719,96 +701,94 @@ public class TextFormatTest { + "}\n" + "}", builder); - assertThat(builder.build()) - .isEqualTo( - TestAny.newBuilder() - .setValue( - Any.newBuilder() - .setTypeUrl( - "type.googleapis.com/" + TestAllTypes.getDescriptor().getFullName()) - .setValue( - TestAllTypes.newBuilder() - .setOptionalInt32(12345) - .setOptionalNestedMessage( - TestAllTypes.NestedMessage.newBuilder().setBb(123)) - .build() - .toByteString()) - .build()) - .build()); + assertEquals( + TestAny.newBuilder() + .setValue( + Any.newBuilder() + .setTypeUrl("type.googleapis.com/" + TestAllTypes.getDescriptor().getFullName()) + .setValue( + TestAllTypes.newBuilder() + .setOptionalInt32(12345) + .setOptionalNestedMessage( + TestAllTypes.NestedMessage.newBuilder().setBb(123)) + .build() + .toByteString()) + .build()) + .build(), + builder.build()); } + private void assertParseError(String error, String text) { // Test merge(). TestAllTypes.Builder builder = TestAllTypes.newBuilder(); try { TextFormat.merge(text, TestUtil.getFullExtensionRegistry(), builder); - assertWithMessage("Expected parse exception.").fail(); + fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().isEqualTo(error); + assertEquals(error, e.getMessage()); } // Test parse(). try { TextFormat.parse(text, TestUtil.getFullExtensionRegistry(), TestAllTypes.class); - assertWithMessage("Expected parse exception.").fail(); + fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().isEqualTo(error); + assertEquals(error, e.getMessage()); } } private void assertParseErrorWithUnknownFields(String error, String text) { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); try { - PARSER_ALLOWING_UNKNOWN_FIELDS.merge(text, TestUtil.getFullExtensionRegistry(), builder); - assertWithMessage("Expected parse exception.").fail(); + parserAllowingUnknownFields.merge(text, TestUtil.getFullExtensionRegistry(), builder); + fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().isEqualTo(error); + assertEquals(error, e.getMessage()); } } private TestAllTypes assertParseSuccessWithUnknownFields(String text) throws TextFormat.ParseException { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - PARSER_ALLOWING_UNKNOWN_FIELDS.merge(text, TestUtil.getFullExtensionRegistry(), builder); + parserAllowingUnknownFields.merge(text, TestUtil.getFullExtensionRegistry(), builder); return builder.build(); } private void assertParseErrorWithUnknownExtensions(String error, String text) { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); try { - PARSER_ALLOWING_UNKNOWN_EXTENSIONS.merge(text, builder); - assertWithMessage("Expected parse exception.").fail(); + parserAllowingUnknownExtensions.merge(text, builder); + fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().isEqualTo(error); + assertEquals(error, e.getMessage()); } } private TestAllTypes assertParseSuccessWithUnknownExtensions(String text) throws TextFormat.ParseException { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - PARSER_ALLOWING_UNKNOWN_EXTENSIONS.merge(text, builder); + parserAllowingUnknownExtensions.merge(text, builder); return builder.build(); } private void assertParseErrorWithOverwriteForbidden(String error, String text) { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); try { - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, TestUtil.getFullExtensionRegistry(), builder); - assertWithMessage("Expected parse exception.").fail(); + parserWithOverwriteForbidden.merge(text, TestUtil.getFullExtensionRegistry(), builder); + fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().isEqualTo(error); + assertEquals(error, e.getMessage()); } } - @CanIgnoreReturnValue private TestAllTypes assertParseSuccessWithOverwriteForbidden(String text) throws TextFormat.ParseException { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, TestUtil.getFullExtensionRegistry(), builder); + parserWithOverwriteForbidden.merge(text, TestUtil.getFullExtensionRegistry(), builder); return builder.build(); } - @Test public void testParseErrors() throws Exception { assertParseError("1:16: Expected \":\".", "optional_int32 123"); assertParseError("1:23: Expected identifier. Found '?'", "optional_nested_enum: ?"); @@ -856,76 +836,74 @@ public class TextFormatTest { } // ================================================================= - @Test - public void testEscapeQuestionMark() throws InvalidEscapeSequenceException { - assertThat(TextFormat.unescapeText("?")).isEqualTo("?"); - assertThat(TextFormat.unescapeText("\\?")).isEqualTo("?"); - } - @Test public void testEscape() throws Exception { // Escape sequences. - assertThat(TextFormat.escapeBytes(bytes("\0\001\007\b\f\n\r\t\013\\\'\"\177"))) - .isEqualTo("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\177"); - assertThat(TextFormat.escapeText("\0\001\007\b\f\n\r\t\013\\\'\"\177")) - .isEqualTo("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\177"); - assertThat(TextFormat.unescapeBytes("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")) - .isEqualTo(bytes("\0\001\007\b\f\n\r\t\013\\\'\"")); - assertThat(TextFormat.unescapeText("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")) - .isEqualTo("\0\001\007\b\f\n\r\t\013\\\'\""); - assertThat(TextFormat.escapeText(ESCAPE_TEST_STRING)).isEqualTo(ESCAPE_TEST_STRING_ESCAPED); - assertThat(TextFormat.unescapeText(ESCAPE_TEST_STRING_ESCAPED)).isEqualTo(ESCAPE_TEST_STRING); + assertEquals( + "\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\177", + TextFormat.escapeBytes(bytes("\0\001\007\b\f\n\r\t\013\\\'\"\177"))); + assertEquals( + "\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\177", + TextFormat.escapeText("\0\001\007\b\f\n\r\t\013\\\'\"\177")); + assertEquals( + bytes("\0\001\007\b\f\n\r\t\013\\\'\""), + TextFormat.unescapeBytes("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); + assertEquals( + "\0\001\007\b\f\n\r\t\013\\\'\"", + TextFormat.unescapeText("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); + assertEquals(ESCAPE_TEST_STRING_ESCAPED, TextFormat.escapeText(ESCAPE_TEST_STRING)); + assertEquals(ESCAPE_TEST_STRING, TextFormat.unescapeText(ESCAPE_TEST_STRING_ESCAPED)); // Invariant - assertThat(TextFormat.escapeBytes(bytes("hello"))).isEqualTo("hello"); - assertThat(TextFormat.escapeText("hello")).isEqualTo("hello"); - assertThat(TextFormat.unescapeBytes("hello")).isEqualTo(bytes("hello")); - assertThat(TextFormat.unescapeText("hello")).isEqualTo("hello"); + assertEquals("hello", TextFormat.escapeBytes(bytes("hello"))); + assertEquals("hello", TextFormat.escapeText("hello")); + assertEquals(bytes("hello"), TextFormat.unescapeBytes("hello")); + assertEquals("hello", TextFormat.unescapeText("hello")); // Unicode handling. - assertThat(TextFormat.escapeText("\u1234")).isEqualTo("\\341\\210\\264"); - assertThat(TextFormat.escapeBytes(bytes(0xe1, 0x88, 0xb4))).isEqualTo("\\341\\210\\264"); - assertThat(TextFormat.unescapeText("\\341\\210\\264")).isEqualTo("\u1234"); - assertThat(TextFormat.unescapeBytes("\\341\\210\\264")).isEqualTo(bytes(0xe1, 0x88, 0xb4)); - assertThat(TextFormat.unescapeText("\\xe1\\x88\\xb4")).isEqualTo("\u1234"); - assertThat(TextFormat.unescapeBytes("\\xe1\\x88\\xb4")).isEqualTo(bytes(0xe1, 0x88, 0xb4)); - assertThat(TextFormat.unescapeText("\\u1234")).isEqualTo("\u1234"); - assertThat(TextFormat.unescapeBytes("\\u1234")).isEqualTo(bytes(0xe1, 0x88, 0xb4)); - assertThat(TextFormat.unescapeBytes("\\U00001234")).isEqualTo(bytes(0xe1, 0x88, 0xb4)); - assertThat(TextFormat.unescapeText("\\xf0\\x90\\x90\\xb7")) - .isEqualTo(new String(new int[] {0x10437}, 0, 1)); - assertThat(TextFormat.unescapeBytes("\\U00010437")).isEqualTo(bytes(0xf0, 0x90, 0x90, 0xb7)); + assertEquals("\\341\\210\\264", TextFormat.escapeText("\u1234")); + assertEquals("\\341\\210\\264", TextFormat.escapeBytes(bytes(0xe1, 0x88, 0xb4))); + assertEquals("\u1234", TextFormat.unescapeText("\\341\\210\\264")); + assertEquals(bytes(0xe1, 0x88, 0xb4), TextFormat.unescapeBytes("\\341\\210\\264")); + assertEquals("\u1234", TextFormat.unescapeText("\\xe1\\x88\\xb4")); + assertEquals(bytes(0xe1, 0x88, 0xb4), TextFormat.unescapeBytes("\\xe1\\x88\\xb4")); + assertEquals("\u1234", TextFormat.unescapeText("\\u1234")); + assertEquals(bytes(0xe1, 0x88, 0xb4), TextFormat.unescapeBytes("\\u1234")); + assertEquals(bytes(0xe1, 0x88, 0xb4), TextFormat.unescapeBytes("\\U00001234")); + assertEquals( + new String(new int[] {0x10437}, 0, 1), TextFormat.unescapeText("\\xf0\\x90\\x90\\xb7")); + assertEquals(bytes(0xf0, 0x90, 0x90, 0xb7), TextFormat.unescapeBytes("\\U00010437")); // Handling of strings with unescaped Unicode characters > 255. final String zh = "\u9999\u6e2f\u4e0a\u6d77\ud84f\udf80\u8c50\u9280\u884c"; ByteString zhByteString = ByteString.copyFromUtf8(zh); - assertThat(TextFormat.unescapeBytes(zh)).isEqualTo(zhByteString); + assertEquals(zhByteString, TextFormat.unescapeBytes(zh)); // Errors. try { TextFormat.unescapeText("\\x"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { // success } try { TextFormat.unescapeText("\\z"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { // success } try { TextFormat.unescapeText("\\"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { // success } try { TextFormat.unescapeText("\\u"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -934,7 +912,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\ud800"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -943,7 +921,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\ud800\\u1234"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -952,7 +930,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\udc00"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -961,7 +939,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\ud801\\udc37"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -970,7 +948,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\U1234"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -979,7 +957,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\U1234no more hex"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -988,7 +966,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\U00110000"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -997,7 +975,7 @@ public class TextFormatTest { try { TextFormat.unescapeText("\\U0000d801\\U00000dc37"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.InvalidEscapeSequenceException e) { assertThat(e) .hasMessageThat() @@ -1005,107 +983,106 @@ public class TextFormatTest { } } - @Test public void testParseInteger() throws Exception { - assertThat(TextFormat.parseInt32("0")).isEqualTo(0); - assertThat(TextFormat.parseInt32("1")).isEqualTo(1); - assertThat(TextFormat.parseInt32("-1")).isEqualTo(-1); - assertThat(TextFormat.parseInt32("12345")).isEqualTo(12345); - assertThat(TextFormat.parseInt32("-12345")).isEqualTo(-12345); - assertThat(TextFormat.parseInt32("2147483647")).isEqualTo(2147483647); - assertThat(TextFormat.parseInt32("-2147483648")).isEqualTo(-2147483648); - - assertThat(TextFormat.parseUInt32("0")).isEqualTo(0); - assertThat(TextFormat.parseUInt32("1")).isEqualTo(1); - assertThat(TextFormat.parseUInt32("12345")).isEqualTo(12345); - assertThat(TextFormat.parseUInt32("2147483647")).isEqualTo(2147483647); - assertThat(TextFormat.parseUInt32("2147483648")).isEqualTo((int) 2147483648L); - assertThat(TextFormat.parseUInt32("4294967295")).isEqualTo((int) 4294967295L); - - assertThat(TextFormat.parseInt64("0")).isEqualTo(0L); - assertThat(TextFormat.parseInt64("1")).isEqualTo(1L); - assertThat(TextFormat.parseInt64("-1")).isEqualTo(-1L); - assertThat(TextFormat.parseInt64("12345")).isEqualTo(12345L); - assertThat(TextFormat.parseInt64("-12345")).isEqualTo(-12345L); - assertThat(TextFormat.parseInt64("2147483647")).isEqualTo(2147483647L); - assertThat(TextFormat.parseInt64("-2147483648")).isEqualTo(-2147483648L); - assertThat(TextFormat.parseInt64("4294967295")).isEqualTo(4294967295L); - assertThat(TextFormat.parseInt64("4294967296")).isEqualTo(4294967296L); - assertThat(TextFormat.parseInt64("9223372036854775807")).isEqualTo(9223372036854775807L); - assertThat(TextFormat.parseInt64("-9223372036854775808")).isEqualTo(-9223372036854775808L); - - assertThat(TextFormat.parseUInt64("0")).isEqualTo(0L); - assertThat(TextFormat.parseUInt64("1")).isEqualTo(1L); - assertThat(TextFormat.parseUInt64("12345")).isEqualTo(12345L); - assertThat(TextFormat.parseUInt64("2147483647")).isEqualTo(2147483647L); - assertThat(TextFormat.parseUInt64("4294967295")).isEqualTo(4294967295L); - assertThat(TextFormat.parseUInt64("4294967296")).isEqualTo(4294967296L); - assertThat(TextFormat.parseUInt64("9223372036854775807")).isEqualTo(9223372036854775807L); - assertThat(TextFormat.parseUInt64("9223372036854775808")).isEqualTo(-9223372036854775808L); - assertThat(TextFormat.parseUInt64("18446744073709551615")).isEqualTo(-1L); + assertEquals(0, TextFormat.parseInt32("0")); + assertEquals(1, TextFormat.parseInt32("1")); + assertEquals(-1, TextFormat.parseInt32("-1")); + assertEquals(12345, TextFormat.parseInt32("12345")); + assertEquals(-12345, TextFormat.parseInt32("-12345")); + assertEquals(2147483647, TextFormat.parseInt32("2147483647")); + assertEquals(-2147483648, TextFormat.parseInt32("-2147483648")); + + assertEquals(0, TextFormat.parseUInt32("0")); + assertEquals(1, TextFormat.parseUInt32("1")); + assertEquals(12345, TextFormat.parseUInt32("12345")); + assertEquals(2147483647, TextFormat.parseUInt32("2147483647")); + assertEquals((int) 2147483648L, TextFormat.parseUInt32("2147483648")); + assertEquals((int) 4294967295L, TextFormat.parseUInt32("4294967295")); + + assertEquals(0L, TextFormat.parseInt64("0")); + assertEquals(1L, TextFormat.parseInt64("1")); + assertEquals(-1L, TextFormat.parseInt64("-1")); + assertEquals(12345L, TextFormat.parseInt64("12345")); + assertEquals(-12345L, TextFormat.parseInt64("-12345")); + assertEquals(2147483647L, TextFormat.parseInt64("2147483647")); + assertEquals(-2147483648L, TextFormat.parseInt64("-2147483648")); + assertEquals(4294967295L, TextFormat.parseInt64("4294967295")); + assertEquals(4294967296L, TextFormat.parseInt64("4294967296")); + assertEquals(9223372036854775807L, TextFormat.parseInt64("9223372036854775807")); + assertEquals(-9223372036854775808L, TextFormat.parseInt64("-9223372036854775808")); + + assertEquals(0L, TextFormat.parseUInt64("0")); + assertEquals(1L, TextFormat.parseUInt64("1")); + assertEquals(12345L, TextFormat.parseUInt64("12345")); + assertEquals(2147483647L, TextFormat.parseUInt64("2147483647")); + assertEquals(4294967295L, TextFormat.parseUInt64("4294967295")); + assertEquals(4294967296L, TextFormat.parseUInt64("4294967296")); + assertEquals(9223372036854775807L, TextFormat.parseUInt64("9223372036854775807")); + assertEquals(-9223372036854775808L, TextFormat.parseUInt64("9223372036854775808")); + assertEquals(-1L, TextFormat.parseUInt64("18446744073709551615")); // Hex - assertThat(TextFormat.parseInt32("0x1234abcd")).isEqualTo(0x1234abcd); - assertThat(TextFormat.parseInt32("-0x1234abcd")).isEqualTo(-0x1234abcd); - assertThat(TextFormat.parseUInt64("0xffffffffffffffff")).isEqualTo(-1); - assertThat(TextFormat.parseInt64("0x7fffffffffffffff")).isEqualTo(0x7fffffffffffffffL); + assertEquals(0x1234abcd, TextFormat.parseInt32("0x1234abcd")); + assertEquals(-0x1234abcd, TextFormat.parseInt32("-0x1234abcd")); + assertEquals(-1, TextFormat.parseUInt64("0xffffffffffffffff")); + assertEquals(0x7fffffffffffffffL, TextFormat.parseInt64("0x7fffffffffffffff")); // Octal - assertThat(TextFormat.parseInt32("01234567")).isEqualTo(01234567); + assertEquals(01234567, TextFormat.parseInt32("01234567")); // Out-of-range try { TextFormat.parseInt32("2147483648"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } try { TextFormat.parseInt32("-2147483649"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } try { TextFormat.parseUInt32("4294967296"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } try { TextFormat.parseUInt32("-1"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } try { TextFormat.parseInt64("9223372036854775808"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } try { TextFormat.parseInt64("-9223372036854775809"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } try { TextFormat.parseUInt64("18446744073709551616"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } try { TextFormat.parseUInt64("-1"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } @@ -1113,21 +1090,19 @@ public class TextFormatTest { // Not a number. try { TextFormat.parseInt32("abcd"); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (NumberFormatException e) { // success } } - @Test public void testParseString() throws Exception { final String zh = "\u9999\u6e2f\u4e0a\u6d77\ud84f\udf80\u8c50\u9280\u884c"; TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge("optional_string: \"" + zh + "\"", builder); - assertThat(builder.getOptionalString()).isEqualTo(zh); + assertEquals(zh, builder.getOptionalString()); } - @Test public void testParseLongString() throws Exception { String longText = "123456789012345678901234567890123456789012345678901234567890" @@ -1153,10 +1128,9 @@ public class TextFormatTest { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge("optional_string: \"" + longText + "\"", builder); - assertThat(builder.getOptionalString()).isEqualTo(longText); + assertEquals(longText, builder.getOptionalString()); } - @Test public void testParseBoolean() throws Exception { String goodText = "repeated_bool: t repeated_bool : 0\n" @@ -1171,32 +1145,30 @@ public class TextFormatTest { + "repeated_bool: true\n"; TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge(goodText, builder); - assertThat(builder.build().toString()).isEqualTo(goodTextCanonical); + assertEquals(goodTextCanonical, builder.build().toString()); try { TestAllTypes.Builder badBuilder = TestAllTypes.newBuilder(); TextFormat.merge("optional_bool:2", badBuilder); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.ParseException e) { // success } try { TestAllTypes.Builder badBuilder = TestAllTypes.newBuilder(); TextFormat.merge("optional_bool: foo", badBuilder); - assertWithMessage("Should have thrown an exception.").fail(); + fail("Should have thrown an exception."); } catch (TextFormat.ParseException e) { // success } } - @Test public void testParseAdjacentStringLiterals() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge("optional_string: \"foo\" 'corge' \"grault\"", builder); - assertThat(builder.getOptionalString()).isEqualTo("foocorgegrault"); + assertEquals("foocorgegrault", builder.getOptionalString()); } - @Test public void testPrintFieldValue() throws Exception { assertPrintFieldValue("\"Hello\"", "Hello", "repeated_string"); assertPrintFieldValue("123.0", 123f, "repeated_float"); @@ -1215,168 +1187,133 @@ public class TextFormatTest { StringBuilder sb = new StringBuilder(); TextFormat.printer() .printFieldValue(TestAllTypes.getDescriptor().findFieldByName(fieldName), value, sb); - assertThat(sb.toString()).isEqualTo(expect); - } - - @Test - public void testPrintFieldValueThrows() throws Exception { - assertPrintFieldThrowsClassCastException(5, "repeated_string"); - assertPrintFieldThrowsClassCastException(5L, "repeated_string"); - assertPrintFieldThrowsClassCastException(ByteString.EMPTY, "repeated_string"); - assertPrintFieldThrowsClassCastException(5, "repeated_float"); - assertPrintFieldThrowsClassCastException(5D, "repeated_float"); - assertPrintFieldThrowsClassCastException("text", "repeated_float"); - assertPrintFieldThrowsClassCastException(5, "repeated_double"); - assertPrintFieldThrowsClassCastException(5F, "repeated_double"); - assertPrintFieldThrowsClassCastException("text", "repeated_double"); - assertPrintFieldThrowsClassCastException(123L, "repeated_int32"); - assertPrintFieldThrowsClassCastException(123, "repeated_int64"); - assertPrintFieldThrowsClassCastException(1, "repeated_bytes"); - } - - private void assertPrintFieldThrowsClassCastException(final Object value, String fieldName) - throws Exception { - final StringBuilder stringBuilder = new StringBuilder(); - final FieldDescriptor fieldDescriptor = TestAllTypes.getDescriptor().findFieldByName(fieldName); - assertThrows( - ClassCastException.class, - new ThrowingRunnable() { - @Override - public void run() throws Throwable { - TextFormat.printer().printFieldValue(fieldDescriptor, value, stringBuilder); - } - }); - } - - @Test + assertEquals(expect, sb.toString()); + } + public void testShortDebugString() { - assertThat( - TextFormat.shortDebugString( - TestAllTypes.newBuilder() - .addRepeatedInt32(1) - .addRepeatedUint32(2) - .setOptionalNestedMessage(NestedMessage.newBuilder().setBb(42).build()) - .build())) - .isEqualTo("optional_nested_message { bb: 42 } repeated_int32: 1 repeated_uint32: 2"); + assertEquals( + "optional_nested_message { bb: 42 } repeated_int32: 1 repeated_uint32: 2", + TextFormat.shortDebugString( + TestAllTypes.newBuilder() + .addRepeatedInt32(1) + .addRepeatedUint32(2) + .setOptionalNestedMessage(NestedMessage.newBuilder().setBb(42).build()) + .build())); } - @Test public void testShortDebugString_field() { final FieldDescriptor dataField = OneString.getDescriptor().findFieldByName("data"); - assertThat(TextFormat.printer().shortDebugString(dataField, "test data")) - .isEqualTo("data: \"test data\""); + assertEquals( + "data: \"test data\"", + TextFormat.printer().shortDebugString(dataField, "test data")); final FieldDescriptor optionalField = TestAllTypes.getDescriptor().findFieldByName("optional_nested_message"); final Object value = NestedMessage.newBuilder().setBb(42).build(); - assertThat(TextFormat.printer().shortDebugString(optionalField, value)) - .isEqualTo("optional_nested_message { bb: 42 }"); + assertEquals( + "optional_nested_message { bb: 42 }", + TextFormat.printer().shortDebugString(optionalField, value)); } - @Test public void testShortDebugString_unknown() { - assertThat(TextFormat.printer().shortDebugString(makeUnknownFieldSet())) - .isEqualTo( - "5: 1 5: 0x00000002 5: 0x0000000000000003 5: \"4\" 5: { 12: 6 } 5 { 10: 5 }" - + " 8: 1 8: 2 8: 3 15: 12379813812177893520 15: 0xabcd1234 15:" - + " 0xabcdef1234567890"); + assertEquals( + "5: 1 5: 0x00000002 5: 0x0000000000000003 5: \"4\" 5: { 12: 6 } 5 { 10: 5 }" + + " 8: 1 8: 2 8: 3 15: 12379813812177893520 15: 0xabcd1234 15:" + + " 0xabcdef1234567890", + TextFormat.printer().shortDebugString(makeUnknownFieldSet())); } - @Test public void testPrintToUnicodeString() throws Exception { - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString( - TestAllTypes.newBuilder() - .setOptionalString("abc\u3042efg") - .setOptionalBytes(bytes(0xe3, 0x81, 0x82)) - .addRepeatedString("\u3093XYZ") - .build())) - .isEqualTo( - "optional_string: \"abc\u3042efg\"\n" - + "optional_bytes: \"\\343\\201\\202\"\n" - + "repeated_string: \"\u3093XYZ\"\n"); + assertEquals( + "optional_string: \"abc\u3042efg\"\n" + + "optional_bytes: \"\\343\\201\\202\"\n" + + "repeated_string: \"\u3093XYZ\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString( + TestAllTypes.newBuilder() + .setOptionalString("abc\u3042efg") + .setOptionalBytes(bytes(0xe3, 0x81, 0x82)) + .addRepeatedString("\u3093XYZ") + .build())); // Double quotes and backslashes should be escaped - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString(TestAllTypes.newBuilder().setOptionalString("a\\bc\"ef\"g").build())) - .isEqualTo("optional_string: \"a\\\\bc\\\"ef\\\"g\"\n"); + assertEquals( + "optional_string: \"a\\\\bc\\\"ef\\\"g\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString(TestAllTypes.newBuilder().setOptionalString("a\\bc\"ef\"g").build())); // Test escaping roundtrip TestAllTypes message = TestAllTypes.newBuilder().setOptionalString("a\\bc\\\"ef\"g").build(); TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge(TextFormat.printer().escapingNonAscii(false).printToString(message), builder); - assertThat(builder.getOptionalString()).isEqualTo(message.getOptionalString()); + assertEquals(message.getOptionalString(), builder.getOptionalString()); } - @Test public void testPrintToUnicodeStringWithNewlines() throws Exception { // No newlines at start and end - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString( - TestAllTypes.newBuilder() - .setOptionalString("test newlines\n\nin\nstring") - .build())) - .isEqualTo("optional_string: \"test newlines\\n\\nin\\nstring\"\n"); + assertEquals( + "optional_string: \"test newlines\\n\\nin\\nstring\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString( + TestAllTypes.newBuilder() + .setOptionalString("test newlines\n\nin\nstring") + .build())); // Newlines at start and end - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString( - TestAllTypes.newBuilder() - .setOptionalString("\ntest\nnewlines\n\nin\nstring\n") - .build())) - .isEqualTo("optional_string: \"\\ntest\\nnewlines\\n\\nin\\nstring\\n\"\n"); + assertEquals( + "optional_string: \"\\ntest\\nnewlines\\n\\nin\\nstring\\n\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString( + TestAllTypes.newBuilder() + .setOptionalString("\ntest\nnewlines\n\nin\nstring\n") + .build())); // Strings with 0, 1 and 2 newlines. - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString(TestAllTypes.newBuilder().setOptionalString("").build())) - .isEqualTo("optional_string: \"\"\n"); - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString(TestAllTypes.newBuilder().setOptionalString("\n").build())) - .isEqualTo("optional_string: \"\\n\"\n"); - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString(TestAllTypes.newBuilder().setOptionalString("\n\n").build())) - .isEqualTo("optional_string: \"\\n\\n\"\n"); + assertEquals( + "optional_string: \"\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString(TestAllTypes.newBuilder().setOptionalString("").build())); + assertEquals( + "optional_string: \"\\n\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString(TestAllTypes.newBuilder().setOptionalString("\n").build())); + assertEquals( + "optional_string: \"\\n\\n\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString(TestAllTypes.newBuilder().setOptionalString("\n\n").build())); // Test escaping roundtrip TestAllTypes message = TestAllTypes.newBuilder().setOptionalString("\ntest\nnewlines\n\nin\nstring\n").build(); TestAllTypes.Builder builder = TestAllTypes.newBuilder(); TextFormat.merge(TextFormat.printer().escapingNonAscii(false).printToString(message), builder); - assertThat(builder.getOptionalString()).isEqualTo(message.getOptionalString()); + assertEquals(message.getOptionalString(), builder.getOptionalString()); } - @Test public void testPrintToUnicodeString_unknown() { - assertThat( - TextFormat.printer() - .escapingNonAscii(false) - .printToString( - UnknownFieldSet.newBuilder() - .addField( - 1, - UnknownFieldSet.Field.newBuilder() - .addLengthDelimited(bytes(0xe3, 0x81, 0x82)) - .build()) - .build())) - .isEqualTo("1: \"\\343\\201\\202\"\n"); + assertEquals( + "1: \"\\343\\201\\202\"\n", + TextFormat.printer() + .escapingNonAscii(false) + .printToString( + UnknownFieldSet.newBuilder() + .addField( + 1, + UnknownFieldSet.Field.newBuilder() + .addLengthDelimited(bytes(0xe3, 0x81, 0x82)) + .build()) + .build())); } - @Test + public void testParseUnknownExtensions() throws Exception { TestUtil.TestLogHandler logHandler = new TestUtil.TestLogHandler(); Logger logger = Logger.getLogger(TextFormat.class.getName()); @@ -1386,16 +1323,16 @@ public class TextFormatTest { assertParseSuccessWithUnknownExtensions( "[unknown_extension]: 123\n" + "[unknown_ext]: inf\n" + "[unknown]: 1.234"); // Test warning messages. - assertThat(logHandler.getStoredLogRecords().get(0).getMessage()) - .isEqualTo( - "Input contains unknown fields and/or extensions:\n" - + "1:2:\tprotobuf_unittest.TestAllTypes.[unknown_extension]"); - assertThat(logHandler.getStoredLogRecords().get(1).getMessage()) - .isEqualTo( - "Input contains unknown fields and/or extensions:\n" - + "1:2:\tprotobuf_unittest.TestAllTypes.[unknown_extension]\n" - + "2:2:\tprotobuf_unittest.TestAllTypes.[unknown_ext]\n" - + "3:2:\tprotobuf_unittest.TestAllTypes.[unknown]"); + assertEquals( + "Input contains unknown fields and/or extensions:\n" + + "1:2:\tprotobuf_unittest.TestAllTypes.[unknown_extension]", + logHandler.getStoredLogRecords().get(0).getMessage()); + assertEquals( + "Input contains unknown fields and/or extensions:\n" + + "1:2:\tprotobuf_unittest.TestAllTypes.[unknown_extension]\n" + + "2:2:\tprotobuf_unittest.TestAllTypes.[unknown_ext]\n" + + "3:2:\tprotobuf_unittest.TestAllTypes.[unknown]", + logHandler.getStoredLogRecords().get(1).getMessage()); // Test unknown field can not pass. assertParseErrorWithUnknownExtensions( @@ -1425,20 +1362,7 @@ public class TextFormatTest { + "unknown_field3: 3\n"); } - @Test - public void testParseUnknownExtensionWithAnyMessage() throws Exception { - assertParseSuccessWithUnknownExtensions( - "[unknown_extension]: { " - + " any_value { " - + " [type.googleapis.com/protobuf_unittest.OneString] { " - + " data: 123 " - + " } " - + " } " - + "}"); - } - // See additional coverage in testOneofOverwriteForbidden and testMapOverwriteForbidden. - @Test public void testParseNonRepeatedFields() throws Exception { assertParseSuccessWithOverwriteForbidden("repeated_int32: 1\nrepeated_int32: 2\n"); assertParseSuccessWithOverwriteForbidden("RepeatedGroup { a: 1 }\nRepeatedGroup { a: 2 }\n"); @@ -1474,7 +1398,6 @@ public class TextFormatTest { "default_string: \"zxcv\"\ndefault_string: \"asdf\"\n"); } - @Test public void testParseShortRepeatedFormOfRepeatedFields() throws Exception { assertParseSuccessWithOverwriteForbidden("repeated_foreign_enum: [FOREIGN_FOO, FOREIGN_BAR]"); assertParseSuccessWithOverwriteForbidden("repeated_int32: [ 1, 2 ]\n"); @@ -1483,7 +1406,6 @@ public class TextFormatTest { // See also testMapShortForm. } - @Test public void testParseShortRepeatedFormOfEmptyRepeatedFields() throws Exception { assertParseSuccessWithOverwriteForbidden("repeated_foreign_enum: []"); assertParseSuccessWithOverwriteForbidden("repeated_int32: []\n"); @@ -1492,7 +1414,6 @@ public class TextFormatTest { // See also testMapShortFormEmpty. } - @Test public void testParseShortRepeatedFormWithTrailingComma() throws Exception { assertParseErrorWithOverwriteForbidden( "1:38: Expected identifier. Found \']\'", "repeated_foreign_enum: [FOREIGN_FOO, ]\n"); @@ -1504,7 +1425,6 @@ public class TextFormatTest { // See also testMapShortFormTrailingComma. } - @Test public void testParseShortRepeatedFormOfNonRepeatedFields() throws Exception { assertParseErrorWithOverwriteForbidden( "1:17: Couldn't parse integer: For input string: \"[\"", "optional_int32: [1]\n"); @@ -1515,7 +1435,6 @@ public class TextFormatTest { // ======================================================================= // test oneof - @Test public void testOneofTextFormat() throws Exception { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestUtil.setOneof(builder); @@ -1525,38 +1444,34 @@ public class TextFormatTest { TestUtil.assertOneofSet(dest.build()); } - @Test public void testOneofOverwriteForbidden() throws Exception { String input = "foo_string: \"stringvalue\" foo_int: 123"; TestOneof2.Builder builder = TestOneof2.newBuilder(); try { - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(input, TestUtil.getFullExtensionRegistry(), builder); - assertWithMessage("Expected parse exception.").fail(); + parserWithOverwriteForbidden.merge(input, TestUtil.getFullExtensionRegistry(), builder); + fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e) - .hasMessageThat() - .isEqualTo( - "1:34: Field \"protobuf_unittest.TestOneof2.foo_int\"" - + " is specified along with field \"protobuf_unittest.TestOneof2.foo_string\"," - + " another member of oneof \"foo\"."); + assertEquals( + "1:34: Field \"protobuf_unittest.TestOneof2.foo_int\"" + + " is specified along with field \"protobuf_unittest.TestOneof2.foo_string\"," + + " another member of oneof \"foo\".", + e.getMessage()); } } - @Test public void testOneofOverwriteAllowed() throws Exception { String input = "foo_string: \"stringvalue\" foo_int: 123"; TestOneof2.Builder builder = TestOneof2.newBuilder(); - DEFAULT_PARSER.merge(input, TestUtil.getFullExtensionRegistry(), builder); + defaultParser.merge(input, TestUtil.getFullExtensionRegistry(), builder); // Only the last value sticks. TestOneof2 oneof = builder.build(); - assertThat(oneof.hasFooString()).isFalse(); - assertThat(oneof.hasFooInt()).isTrue(); + assertFalse(oneof.hasFooString()); + assertTrue(oneof.hasFooInt()); } // ======================================================================= // test map - @Test public void testMapTextFormat() throws Exception { TestMap message = TestMap.newBuilder() @@ -1568,16 +1483,15 @@ public class TextFormatTest { { TestMap.Builder dest = TestMap.newBuilder(); TextFormat.merge(text, dest); - assertThat(dest.build()).isEqualTo(message); + assertEquals(message, dest.build()); } { TestMap.Builder dest = TestMap.newBuilder(); - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, dest); - assertThat(dest.build()).isEqualTo(message); + parserWithOverwriteForbidden.merge(text, dest); + assertEquals(message, dest.build()); } } - @Test public void testMapDuplicateKeys() throws Exception { String input = "int32_to_int32_field: {\n" @@ -1593,50 +1507,46 @@ public class TextFormatTest { + " value: -1\n" + "}\n"; TestMap msg = TextFormat.parse(input, TestMap.class); - int i1 = msg.getInt32ToInt32FieldMap().get(1); + int i1 = msg.getInt32ToInt32Field().get(1); TestMap msg2 = TextFormat.parse(msg.toString(), TestMap.class); - int i2 = msg2.getInt32ToInt32FieldMap().get(1); - assertThat(i1).isEqualTo(i2); + int i2 = msg2.getInt32ToInt32Field().get(1); + assertEquals(i1, i2); } - @Test public void testMapShortForm() throws Exception { String text = "string_to_int32_field [{ key: 'x' value: 10 }, { key: 'y' value: 20 }]\n" + "int32_to_message_field " + "[{ key: 1 value { value: 100 } }, { key: 2 value: { value: 200 } }]\n"; TestMap.Builder dest = TestMap.newBuilder(); - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, dest); + parserWithOverwriteForbidden.merge(text, dest); TestMap message = dest.build(); - assertThat(message.getStringToInt32FieldMap()).hasSize(2); - assertThat(message.getInt32ToMessageFieldMap()).hasSize(2); - assertThat(message.getStringToInt32FieldMap().get("x").intValue()).isEqualTo(10); - assertThat(message.getInt32ToMessageFieldMap().get(2).getValue()).isEqualTo(200); + assertEquals(2, message.getStringToInt32Field().size()); + assertEquals(2, message.getInt32ToMessageField().size()); + assertEquals(10, message.getStringToInt32Field().get("x").intValue()); + assertEquals(200, message.getInt32ToMessageField().get(2).getValue()); } - @Test public void testMapShortFormEmpty() throws Exception { String text = "string_to_int32_field []\nint32_to_message_field: []\n"; TestMap.Builder dest = TestMap.newBuilder(); - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, dest); + parserWithOverwriteForbidden.merge(text, dest); TestMap message = dest.build(); - assertThat(message.getStringToInt32FieldMap()).isEmpty(); - assertThat(message.getInt32ToMessageFieldMap()).isEmpty(); + assertEquals(0, message.getStringToInt32Field().size()); + assertEquals(0, message.getInt32ToMessageField().size()); } - @Test public void testMapShortFormTrailingComma() throws Exception { String text = "string_to_int32_field [{ key: 'x' value: 10 }, ]\n"; TestMap.Builder dest = TestMap.newBuilder(); try { - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, dest); - assertWithMessage("Expected parse exception.").fail(); + parserWithOverwriteForbidden.merge(text, dest); + fail("Expected parse exception."); } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().isEqualTo("1:48: Expected \"{\"."); + assertEquals("1:48: Expected \"{\".", e.getMessage()); } } - @Test public void testMapOverwrite() throws Exception { String text = "int32_to_int32_field { key: 1 value: 10 }\n" @@ -1646,39 +1556,38 @@ public class TextFormatTest { { // With default parser, last value set for the key holds. TestMap.Builder builder = TestMap.newBuilder(); - DEFAULT_PARSER.merge(text, builder); + defaultParser.merge(text, builder); TestMap map = builder.build(); - assertThat(map.getInt32ToInt32FieldMap()).hasSize(2); - assertThat(map.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(30); + assertEquals(2, map.getInt32ToInt32Field().size()); + assertEquals(30, map.getInt32ToInt32Field().get(1).intValue()); } { // With overwrite forbidden, same behavior. - // TODO: Expect parse exception here. + // TODO(b/29122459): Expect parse exception here. TestMap.Builder builder = TestMap.newBuilder(); - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, builder); + parserWithOverwriteForbidden.merge(text, builder); TestMap map = builder.build(); - assertThat(map.getInt32ToInt32FieldMap()).hasSize(2); - assertThat(map.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(30); + assertEquals(2, map.getInt32ToInt32Field().size()); + assertEquals(30, map.getInt32ToInt32Field().get(1).intValue()); } { // With overwrite forbidden and a dynamic message, same behavior. - // TODO: Expect parse exception here. + // TODO(b/29122459): Expect parse exception here. Message.Builder builder = DynamicMessage.newBuilder(TestMap.getDescriptor()); - PARSER_WITH_OVERWRITE_FORBIDDEN.merge(text, builder); + parserWithOverwriteForbidden.merge(text, builder); TestMap map = TestMap.parseFrom( builder.build().toByteString(), ExtensionRegistryLite.getEmptyRegistry()); - assertThat(map.getInt32ToInt32FieldMap()).hasSize(2); - assertThat(map.getInt32ToInt32FieldMap().get(1).intValue()).isEqualTo(30); + assertEquals(2, map.getInt32ToInt32Field().size()); + assertEquals(30, map.getInt32ToInt32Field().get(1).intValue()); } } // ======================================================================= // test location information - @Test public void testParseInfoTreeBuilding() throws Exception { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); @@ -1743,13 +1652,12 @@ public class TextFormatTest { // Verify a NULL tree for an unknown nested field. try { tree.getNestedTree(nestedField, 2); - assertWithMessage("unknown nested field should throw").fail(); + fail("unknown nested field should throw"); } catch (IllegalArgumentException unused) { // pass } } - @SuppressWarnings("LenientFormatStringValidation") private void assertLocation( TextFormatParseInfoTree tree, final Descriptor descriptor, @@ -1761,17 +1669,15 @@ public class TextFormatTest { if (index < locs.size()) { TextFormatParseLocation location = locs.get(index); TextFormatParseLocation expected = TextFormatParseLocation.create(line, column); - assertThat(location).isEqualTo(expected); + assertEquals(expected, location); } else if (line != -1 && column != -1) { - // Expected 0 args, but got 3. - assertWithMessage( + fail( + String.format( "Tree/descriptor/fieldname did not contain index %d, line %d column %d expected", - index, line, column) - .fail(); + index, line, column)); } } - @Test public void testSortMapFields() throws Exception { TestMap message = TestMap.newBuilder() @@ -1807,113 +1713,6 @@ public class TextFormatTest { + " key: \"cherry\"\n" + " value: 30\n" + "}\n"; - assertThat(TextFormat.printer().printToString(message)).isEqualTo(text); - } - - @Test - public void testPreservesFloatingPointNegative0() throws Exception { - proto3_unittest.UnittestProto3.TestAllTypes message = - proto3_unittest.UnittestProto3.TestAllTypes.newBuilder() - .setOptionalFloat(-0.0f) - .setOptionalDouble(-0.0) - .build(); - assertThat(TextFormat.printer().printToString(message)) - .isEqualTo("optional_float: -0.0\noptional_double: -0.0\n"); - } - - private TestRecursiveMessage makeRecursiveMessage(int depth) { - if (depth == 0) { - return TestRecursiveMessage.newBuilder().setI(5).build(); - } else { - return TestRecursiveMessage.newBuilder().setA(makeRecursiveMessage(depth - 1)).build(); - } - } - - @Test - public void testDefaultRecursionLimit() throws Exception { - String depth100 = TextFormat.printer().printToString(makeRecursiveMessage(100)); - String depth101 = TextFormat.printer().printToString(makeRecursiveMessage(101)); - TextFormat.parse(depth100, TestRecursiveMessage.class); - try { - TextFormat.parse(depth101, TestRecursiveMessage.class); - assertWithMessage("Parsing deep message should have failed").fail(); - } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().contains("too deep"); - } - } - - @Test - public void testRecursionLimitWithUnknownFields() throws Exception { - TextFormat.Parser parser = - TextFormat.Parser.newBuilder().setAllowUnknownFields(true).setRecursionLimit(2).build(); - TestRecursiveMessage.Builder depth2 = TestRecursiveMessage.newBuilder(); - parser.merge("u { u { i: 0 } }", depth2); - try { - TestRecursiveMessage.Builder depth3 = TestRecursiveMessage.newBuilder(); - parser.merge("u { u { u { } } }", depth3); - assertWithMessage("Parsing deep message should have failed").fail(); - } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().contains("too deep"); - } - } - - @Test - public void testRecursionLimitWithKnownAndUnknownFields() throws Exception { - TextFormat.Parser parser = - TextFormat.Parser.newBuilder().setAllowUnknownFields(true).setRecursionLimit(2).build(); - TestRecursiveMessage.Builder depth2 = TestRecursiveMessage.newBuilder(); - parser.merge("a { u { i: 0 } }", depth2); - try { - TestRecursiveMessage.Builder depth3 = TestRecursiveMessage.newBuilder(); - parser.merge("a { u { u { } } }", depth3); - assertWithMessage("Parsing deep message should have failed").fail(); - } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().contains("too deep"); - } - } - - @Test - public void testRecursionLimitWithAny() throws Exception { - TextFormat.Parser parser = - TextFormat.Parser.newBuilder() - .setRecursionLimit(2) - .setTypeRegistry(TypeRegistry.newBuilder().add(TestAllTypes.getDescriptor()).build()) - .build(); - TestAny.Builder depth2 = TestAny.newBuilder(); - parser.merge( - "value { [type.googleapis.com/protobuf_unittest.TestAllTypes] { optional_int32: 1 } }", - depth2); - try { - TestAny.Builder depth3 = TestAny.newBuilder(); - parser.merge( - "value { [type.googleapis.com/protobuf_unittest.TestAllTypes] { optional_nested_message {" - + "} } }", - depth3); - assertWithMessage("Parsing deep message should have failed").fail(); - } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().contains("too deep"); - } - } - - @Test - public void testRecursionLimitWithTopLevelAny() throws Exception { - TextFormat.Parser parser = - TextFormat.Parser.newBuilder() - .setRecursionLimit(2) - .setTypeRegistry( - TypeRegistry.newBuilder().add(TestRecursiveMessage.getDescriptor()).build()) - .build(); - Any.Builder depth2 = Any.newBuilder(); - parser.merge( - "[type.googleapis.com/protobuf_unittest.TestRecursiveMessage] { a { i: 0 } }", depth2); - try { - Any.Builder depth3 = Any.newBuilder(); - parser.merge( - "[type.googleapis.com/protobuf_unittest.TestRecursiveMessage] { a { a { i: 0 } } }", - depth3); - assertWithMessage("Parsing deep message should have failed").fail(); - } catch (TextFormat.ParseException e) { - assertThat(e).hasMessageThat().contains("too deep"); - } + assertEquals(text, TextFormat.printer().printToString(message)); } } diff --git a/java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java b/java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java index 048948f957fb14d853f886eb84276bda1b43904a..0cd9677726df5c23a02ea3fa033564fc35165970 100644 --- a/java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java +++ b/java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java @@ -1,14 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; import com.google.protobuf.Descriptors.Descriptor; import protobuf_unittest.UnittestProto; @@ -19,38 +42,29 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public final class TypeRegistryTest { - @Test - public void getDescriptorForTypeUrl_throwsExceptionForUnknownTypes() throws Exception { - assertThrows( - InvalidProtocolBufferException.class, - () -> TypeRegistry.getEmptyTypeRegistry().getDescriptorForTypeUrl("UnknownType")); - assertThrows( - InvalidProtocolBufferException.class, - () -> TypeRegistry.getEmptyTypeRegistry().getDescriptorForTypeUrl("///")); - } - @Test public void findDescriptorByFullName() throws Exception { Descriptor descriptor = UnittestProto.TestAllTypes.getDescriptor(); - assertThat(TypeRegistry.getEmptyTypeRegistry().find(descriptor.getFullName())).isNull(); + assertNull(TypeRegistry.getEmptyTypeRegistry().find(descriptor.getFullName())); - assertThat(TypeRegistry.newBuilder().add(descriptor).build().find(descriptor.getFullName())) - .isSameInstanceAs(descriptor); + assertSame( + descriptor, + TypeRegistry.newBuilder().add(descriptor).build().find(descriptor.getFullName())); } @Test public void findDescriptorByTypeUrl() throws Exception { Descriptor descriptor = UnittestProto.TestAllTypes.getDescriptor(); - assertThat( - TypeRegistry.getEmptyTypeRegistry() - .getDescriptorForTypeUrl("type.googleapis.com/" + descriptor.getFullName())) - .isNull(); - - assertThat( - TypeRegistry.newBuilder() - .add(descriptor) - .build() - .getDescriptorForTypeUrl("type.googleapis.com/" + descriptor.getFullName())) - .isSameInstanceAs(descriptor); + assertNull( + TypeRegistry.getEmptyTypeRegistry() + .getDescriptorForTypeUrl("type.googleapis.com/" + descriptor.getFullName())); + + assertSame( + descriptor, + TypeRegistry.newBuilder() + .add(descriptor) + .build() + .getDescriptorForTypeUrl("type.googleapis.com/" + descriptor.getFullName())); } + } diff --git a/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java b/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java index 08fa50fb48f9943b7ee5c702b56b7453db0da032..7daef026dc93e5dd7638a2f0929600d4ed794ac5 100644 --- a/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java +++ b/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java @@ -1,15 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.EnumDescriptor; import com.google.protobuf.Descriptors.EnumValueDescriptor; @@ -20,85 +40,75 @@ import com.google.protobuf.Proto2UnknownEnumValuesTestProto.Proto2EnumMessageWit import com.google.protobuf.Proto2UnknownEnumValuesTestProto.Proto2TestEnum; import com.google.protobuf.Proto2UnknownEnumValuesTestProto.Proto2TestEnumSubset; import com.google.protobuf.TextFormat.ParseException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; /** * Unit tests for protos that keep unknown enum values rather than discard them as unknown fields. */ -@RunWith(JUnit4.class) -public class UnknownEnumValueTest { +public class UnknownEnumValueTest extends TestCase { - @Test - @SuppressWarnings("ProtoNewBuilderMergeFrom") public void testUnknownEnumValues() throws Exception { - assertThat(TestAllTypes.NestedEnum.getDescriptor().isClosed()).isFalse(); TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.setOptionalNestedEnumValue(4321); builder.addRepeatedNestedEnumValue(5432); builder.addPackedNestedEnumValue(6543); TestAllTypes message = builder.build(); - assertThat(message.getOptionalNestedEnumValue()).isEqualTo(4321); - assertThat(message.getRepeatedNestedEnumValue(0)).isEqualTo(5432); - assertThat(message.getRepeatedNestedEnumValueList().get(0).intValue()).isEqualTo(5432); - assertThat(message.getPackedNestedEnumValue(0)).isEqualTo(6543); + assertEquals(4321, message.getOptionalNestedEnumValue()); + assertEquals(5432, message.getRepeatedNestedEnumValue(0)); + assertEquals(5432, message.getRepeatedNestedEnumValueList().get(0).intValue()); + assertEquals(6543, message.getPackedNestedEnumValue(0)); // Returns UNRECOGNIZED if an enum type is requested. - assertThat(message.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(message.getRepeatedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(message.getRepeatedNestedEnumList().get(0)) - .isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(message.getPackedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getOptionalNestedEnum()); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getRepeatedNestedEnum(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getRepeatedNestedEnumList().get(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getPackedNestedEnum(0)); // Test serialization and parsing. ByteString data = message.toByteString(); message = TestAllTypes.parseFrom(data); - assertThat(message.getOptionalNestedEnumValue()).isEqualTo(4321); - assertThat(message.getRepeatedNestedEnumValue(0)).isEqualTo(5432); - assertThat(message.getRepeatedNestedEnumValueList().get(0).intValue()).isEqualTo(5432); - assertThat(message.getPackedNestedEnumValue(0)).isEqualTo(6543); + assertEquals(4321, message.getOptionalNestedEnumValue()); + assertEquals(5432, message.getRepeatedNestedEnumValue(0)); + assertEquals(5432, message.getRepeatedNestedEnumValueList().get(0).intValue()); + assertEquals(6543, message.getPackedNestedEnumValue(0)); // Returns UNRECOGNIZED if an enum type is requested. - assertThat(message.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(message.getRepeatedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(message.getRepeatedNestedEnumList().get(0)) - .isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(message.getPackedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getOptionalNestedEnum()); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getRepeatedNestedEnum(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getRepeatedNestedEnumList().get(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getPackedNestedEnum(0)); // Test toBuilder(). builder = message.toBuilder(); - assertThat(builder.getOptionalNestedEnumValue()).isEqualTo(4321); - assertThat(builder.getRepeatedNestedEnumValue(0)).isEqualTo(5432); - assertThat(builder.getRepeatedNestedEnumValueList().get(0).intValue()).isEqualTo(5432); - assertThat(builder.getPackedNestedEnumValue(0)).isEqualTo(6543); + assertEquals(4321, builder.getOptionalNestedEnumValue()); + assertEquals(5432, builder.getRepeatedNestedEnumValue(0)); + assertEquals(5432, builder.getRepeatedNestedEnumValueList().get(0).intValue()); + assertEquals(6543, builder.getPackedNestedEnumValue(0)); // Returns UNRECOGNIZED if an enum type is requested. - assertThat(builder.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(builder.getRepeatedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(builder.getRepeatedNestedEnumList().get(0)) - .isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(builder.getPackedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getOptionalNestedEnum()); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getRepeatedNestedEnum(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getRepeatedNestedEnumList().get(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getPackedNestedEnum(0)); // Test mergeFrom(). builder = TestAllTypes.newBuilder().mergeFrom(message); - assertThat(builder.getOptionalNestedEnumValue()).isEqualTo(4321); - assertThat(builder.getRepeatedNestedEnumValue(0)).isEqualTo(5432); - assertThat(builder.getRepeatedNestedEnumValueList().get(0).intValue()).isEqualTo(5432); - assertThat(builder.getPackedNestedEnumValue(0)).isEqualTo(6543); + assertEquals(4321, builder.getOptionalNestedEnumValue()); + assertEquals(5432, builder.getRepeatedNestedEnumValue(0)); + assertEquals(5432, builder.getRepeatedNestedEnumValueList().get(0).intValue()); + assertEquals(6543, builder.getPackedNestedEnumValue(0)); // Returns UNRECOGNIZED if an enum type is requested. - assertThat(builder.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(builder.getRepeatedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(builder.getRepeatedNestedEnumList().get(0)) - .isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(builder.getPackedNestedEnum(0)).isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getOptionalNestedEnum()); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getRepeatedNestedEnum(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getRepeatedNestedEnumList().get(0)); + assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, builder.getPackedNestedEnum(0)); // Test equals() and hashCode() TestAllTypes sameMessage = builder.build(); - assertThat(sameMessage).isEqualTo(message); - assertThat(sameMessage.hashCode()).isEqualTo(message.hashCode()); + assertEquals(message, sameMessage); + assertEquals(message.hashCode(), sameMessage.hashCode()); // Getting the numeric value of UNRECOGNIZED will throw an exception. try { TestAllTypes.NestedEnum.UNRECOGNIZED.getNumber(); - assertWithMessage("Exception is expected.").fail(); + fail("Exception is expected."); } catch (IllegalArgumentException e) { // Expected. } @@ -106,19 +116,18 @@ public class UnknownEnumValueTest { // Setting an enum field to an UNRECOGNIZED value will throw an exception. try { builder.setOptionalNestedEnum(builder.getOptionalNestedEnum()); - assertWithMessage("Exception is expected.").fail(); + fail("Exception is expected."); } catch (IllegalArgumentException e) { // Expected. } try { builder.addRepeatedNestedEnum(builder.getOptionalNestedEnum()); - assertWithMessage("Exception is expected.").fail(); + fail("Exception is expected."); } catch (IllegalArgumentException e) { // Expected. } } - @Test public void testUnknownEnumValueInReflectionApi() throws Exception { Descriptor descriptor = TestAllTypes.getDescriptor(); FieldDescriptor optionalNestedEnumField = descriptor.findFieldByName("optional_nested_enum"); @@ -141,17 +150,17 @@ public class UnknownEnumValueTest { (EnumValueDescriptor) message.getRepeatedField(repeatedNestedEnumField, 0); EnumValueDescriptor unknown6543 = (EnumValueDescriptor) message.getRepeatedField(packedNestedEnumField, 0); - assertThat(unknown4321.getNumber()).isEqualTo(4321); - assertThat(unknown5432.getNumber()).isEqualTo(5432); - assertThat(unknown6543.getNumber()).isEqualTo(6543); + assertEquals(4321, unknown4321.getNumber()); + assertEquals(5432, unknown5432.getNumber()); + assertEquals(6543, unknown6543.getNumber()); // Unknown EnumValueDescriptor will map to UNRECOGNIZED. - assertThat(TestAllTypes.NestedEnum.valueOf(unknown4321)) - .isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(TestAllTypes.NestedEnum.valueOf(unknown5432)) - .isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); - assertThat(TestAllTypes.NestedEnum.valueOf(unknown6543)) - .isEqualTo(TestAllTypes.NestedEnum.UNRECOGNIZED); + assertEquals( + TestAllTypes.NestedEnum.UNRECOGNIZED, TestAllTypes.NestedEnum.valueOf(unknown4321)); + assertEquals( + TestAllTypes.NestedEnum.UNRECOGNIZED, TestAllTypes.NestedEnum.valueOf(unknown5432)); + assertEquals( + TestAllTypes.NestedEnum.UNRECOGNIZED, TestAllTypes.NestedEnum.valueOf(unknown6543)); // Setters also accept unknown EnumValueDescriptor. builder.setField(optionalNestedEnumField, unknown6543); @@ -160,12 +169,11 @@ public class UnknownEnumValueTest { message = builder.build(); // Like other descriptors, unknown EnumValueDescriptor can be compared by // object identity. - assertThat(unknown6543).isSameInstanceAs(message.getField(optionalNestedEnumField)); - assertThat(unknown4321).isSameInstanceAs(message.getRepeatedField(repeatedNestedEnumField, 0)); - assertThat(unknown5432).isSameInstanceAs(message.getRepeatedField(packedNestedEnumField, 0)); + assertSame(message.getField(optionalNestedEnumField), unknown6543); + assertSame(message.getRepeatedField(repeatedNestedEnumField, 0), unknown4321); + assertSame(message.getRepeatedField(packedNestedEnumField, 0), unknown5432); } - @Test public void testUnknownEnumValueWithDynamicMessage() throws Exception { Descriptor descriptor = TestAllTypes.getDescriptor(); FieldDescriptor optionalNestedEnumField = descriptor.findFieldByName("optional_nested_enum"); @@ -182,28 +190,26 @@ public class UnknownEnumValueTest { builder.addRepeatedField( packedNestedEnumField, enumType.findValueByNumberCreatingIfUnknown(6543)); Message message = builder.build(); - assertThat(((EnumValueDescriptor) message.getField(optionalNestedEnumField)).getNumber()) - .isEqualTo(4321); - assertThat( - ((EnumValueDescriptor) message.getRepeatedField(repeatedNestedEnumField, 0)) - .getNumber()) - .isEqualTo(5432); - assertThat( - ((EnumValueDescriptor) message.getRepeatedField(packedNestedEnumField, 0)).getNumber()) - .isEqualTo(6543); + assertEquals( + 4321, ((EnumValueDescriptor) message.getField(optionalNestedEnumField)).getNumber()); + assertEquals( + 5432, + ((EnumValueDescriptor) message.getRepeatedField(repeatedNestedEnumField, 0)).getNumber()); + assertEquals( + 6543, + ((EnumValueDescriptor) message.getRepeatedField(packedNestedEnumField, 0)).getNumber()); // Test reflection based serialization/parsing implementation. ByteString data = message.toByteString(); message = dynamicMessageDefaultInstance.newBuilderForType().mergeFrom(data).build(); - assertThat(((EnumValueDescriptor) message.getField(optionalNestedEnumField)).getNumber()) - .isEqualTo(4321); - assertThat( - ((EnumValueDescriptor) message.getRepeatedField(repeatedNestedEnumField, 0)) - .getNumber()) - .isEqualTo(5432); - assertThat( - ((EnumValueDescriptor) message.getRepeatedField(packedNestedEnumField, 0)).getNumber()) - .isEqualTo(6543); + assertEquals( + 4321, ((EnumValueDescriptor) message.getField(optionalNestedEnumField)).getNumber()); + assertEquals( + 5432, + ((EnumValueDescriptor) message.getRepeatedField(repeatedNestedEnumField, 0)).getNumber()); + assertEquals( + 6543, + ((EnumValueDescriptor) message.getRepeatedField(packedNestedEnumField, 0)).getNumber()); // Test reflection based equals()/hashCode(). builder = dynamicMessageDefaultInstance.newBuilderForType(); @@ -213,14 +219,13 @@ public class UnknownEnumValueTest { builder.addRepeatedField( packedNestedEnumField, enumType.findValueByNumberCreatingIfUnknown(6543)); Message sameMessage = builder.build(); - assertThat(sameMessage).isEqualTo(message); - assertThat(sameMessage.hashCode()).isEqualTo(message.hashCode()); + assertEquals(message, sameMessage); + assertEquals(message.hashCode(), sameMessage.hashCode()); builder.setField(optionalNestedEnumField, enumType.findValueByNumberCreatingIfUnknown(0)); Message differentMessage = builder.build(); - assertThat(message.equals(differentMessage)).isFalse(); + assertFalse(message.equals(differentMessage)); } - @Test public void testUnknownEnumValuesInTextFormat() { TestAllTypes.Builder builder = TestAllTypes.newBuilder(); builder.setOptionalNestedEnumValue(4321); @@ -230,25 +235,23 @@ public class UnknownEnumValueTest { // We can print a message with unknown enum values. String textData = TextFormat.printer().printToString(message); - assertThat(textData) - .isEqualTo( - "optional_nested_enum: UNKNOWN_ENUM_VALUE_NestedEnum_4321\n" - + "repeated_nested_enum: UNKNOWN_ENUM_VALUE_NestedEnum_5432\n" - + "packed_nested_enum: UNKNOWN_ENUM_VALUE_NestedEnum_6543\n"); + assertEquals( + "optional_nested_enum: UNKNOWN_ENUM_VALUE_NestedEnum_4321\n" + + "repeated_nested_enum: UNKNOWN_ENUM_VALUE_NestedEnum_5432\n" + + "packed_nested_enum: UNKNOWN_ENUM_VALUE_NestedEnum_6543\n", + textData); // Parsing unknown enum values will fail just like parsing other kinds of // unknown fields. try { TextFormat.merge(textData, builder); - assertWithMessage("Expected exception").fail(); + fail(); } catch (ParseException e) { // expected. } } - @Test public void testUnknownEnumValuesInProto2() throws Exception { - assertThat(Proto2TestEnum.getDescriptor().isClosed()).isTrue(); Proto2EnumMessage.Builder sourceMessage = Proto2EnumMessage.newBuilder(); sourceMessage .addRepeatedPackedEnum(Proto2TestEnum.ZERO) @@ -259,24 +262,21 @@ public class UnknownEnumValueTest { Proto2EnumMessageWithEnumSubset.parseFrom(sourceMessage.build().toByteArray()); // Known enum values should be preserved. - assertThat(destMessage.getRepeatedPackedEnumCount()).isEqualTo(2); - assertThat(destMessage.getRepeatedPackedEnum(0)) - .isEqualTo(Proto2TestEnumSubset.TESTENUM_SUBSET_ZERO); - assertThat(destMessage.getRepeatedPackedEnum(1)) - .isEqualTo(Proto2TestEnumSubset.TESTENUM_SUBSET_ONE); + assertEquals(2, destMessage.getRepeatedPackedEnumCount()); + assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ZERO, destMessage.getRepeatedPackedEnum(0)); + assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ONE, destMessage.getRepeatedPackedEnum(1)); // Unknown enum values should be found in UnknownFieldSet. UnknownFieldSet unknown = destMessage.getUnknownFields(); - assertThat( - unknown - .getField(Proto2EnumMessageWithEnumSubset.REPEATED_PACKED_ENUM_FIELD_NUMBER) - .getVarintList() - .get(0) - .longValue()) - .isEqualTo(Proto2TestEnum.TWO_VALUE); + assertEquals( + Proto2TestEnum.TWO_VALUE, + unknown + .getField(Proto2EnumMessageWithEnumSubset.REPEATED_PACKED_ENUM_FIELD_NUMBER) + .getVarintList() + .get(0) + .longValue()); } - @Test public void testUnknownEnumValuesInProto2WithDynamicMessage() throws Exception { Descriptor descriptor = Proto2EnumMessageWithEnumSubset.getDescriptor(); FieldDescriptor repeatedPackedField = descriptor.findFieldByName("repeated_packed_enum"); @@ -292,18 +292,19 @@ public class UnknownEnumValueTest { Proto2EnumMessageWithEnumSubset.getDescriptor(), sourceMessage.build().toByteArray()); // Known enum values should be preserved. - assertThat(message.getRepeatedFieldCount(repeatedPackedField)).isEqualTo(2); + assertEquals(2, message.getRepeatedFieldCount(repeatedPackedField)); EnumValueDescriptor enumValue0 = (EnumValueDescriptor) message.getRepeatedField(repeatedPackedField, 0); EnumValueDescriptor enumValue1 = (EnumValueDescriptor) message.getRepeatedField(repeatedPackedField, 1); - assertThat(enumValue0.getNumber()).isEqualTo(Proto2TestEnumSubset.TESTENUM_SUBSET_ZERO_VALUE); - assertThat(enumValue1.getNumber()).isEqualTo(Proto2TestEnumSubset.TESTENUM_SUBSET_ONE_VALUE); + assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ZERO_VALUE, enumValue0.getNumber()); + assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ONE_VALUE, enumValue1.getNumber()); // Unknown enum values should be found in UnknownFieldSet. UnknownFieldSet unknown = message.getUnknownFields(); - assertThat(unknown.getField(repeatedPackedField.getNumber()).getVarintList().get(0).longValue()) - .isEqualTo(Proto2TestEnum.TWO_VALUE); + assertEquals( + Proto2TestEnum.TWO_VALUE, + unknown.getField(repeatedPackedField.getNumber()).getVarintList().get(0).longValue()); } } diff --git a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java index 363d5e8e36d5674d379d53dfcbea0589d80aa6f3..6ce0fc7e348b80b46b27039a83f9104cf4d0c401 100644 --- a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java +++ b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java index f34a448c515e0a71232bfce81bd98b013a541481..3e1e92822c6f760579cb4753d243a3fbdb796308 100644 --- a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java +++ b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; @@ -20,18 +43,18 @@ import protobuf_unittest.UnittestProto.TestPackedExtensions; import protobuf_unittest.UnittestProto.TestPackedTypes; import proto3_unittest.UnittestProto3; import java.util.List; +import java.util.Arrays; import java.util.Map; import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Tests related to unknown field handling. */ -@RunWith(JUnit4.class) -public class UnknownFieldSetTest { - - @Before +import junit.framework.TestCase; + +/** + * Tests related to unknown field handling. + * + * @author kenton@google.com (Kenton Varda) + */ +public class UnknownFieldSetTest extends TestCase { + @Override public void setUp() throws Exception { descriptor = TestAllTypes.getDescriptor(); allFields = TestUtil.getAllSet(); @@ -42,7 +65,7 @@ public class UnknownFieldSetTest { private UnknownFieldSet.Field getField(String name) { Descriptors.FieldDescriptor field = descriptor.findFieldByName(name); - assertThat(field).isNotNull(); + assertNotNull(field); return unknownFields.getField(field.getNumber()); } @@ -79,7 +102,6 @@ public class UnknownFieldSetTest { // ================================================================= - @Test public void testFieldBuildersAreReusable() { UnknownFieldSet.Field.Builder fieldBuilder = UnknownFieldSet.Field.newBuilder(); fieldBuilder.addFixed32(10); @@ -92,7 +114,6 @@ public class UnknownFieldSetTest { assertThat(first).isNotEqualTo(third); } - @Test public void testClone() { UnknownFieldSet.Builder unknownSetBuilder = UnknownFieldSet.newBuilder(); UnknownFieldSet.Field.Builder fieldBuilder = UnknownFieldSet.Field.newBuilder(); @@ -104,7 +125,6 @@ public class UnknownFieldSetTest { assertThat(clone1).isNotSameInstanceAs(clone2); } - @Test public void testClone_lengthDelimited() { UnknownFieldSet.Builder destUnknownFieldSet = UnknownFieldSet.newBuilder() @@ -130,7 +150,6 @@ public class UnknownFieldSetTest { assertThat(lengthDelimited2.get(1).toStringUtf8()).isEqualTo("some more data"); } - @Test public void testReuse() { UnknownFieldSet.Builder builder = UnknownFieldSet.newBuilder() @@ -151,7 +170,6 @@ public class UnknownFieldSetTest { assertThat(fieldSet1).isNotEqualTo(fieldSet3); } - @Test @SuppressWarnings("ModifiedButNotUsed") public void testAddField_zero() { UnknownFieldSet.Field field = getField("optional_int32"); @@ -163,7 +181,6 @@ public class UnknownFieldSetTest { } } - @Test @SuppressWarnings("ModifiedButNotUsed") public void testAddField_negative() { UnknownFieldSet.Field field = getField("optional_int32"); @@ -175,7 +192,6 @@ public class UnknownFieldSetTest { } } - @Test @SuppressWarnings("ModifiedButNotUsed") public void testClearField_negative() { try { @@ -186,7 +202,6 @@ public class UnknownFieldSetTest { } } - @Test @SuppressWarnings("ModifiedButNotUsed") public void testMergeField_negative() { UnknownFieldSet.Field field = getField("optional_int32"); @@ -198,7 +213,6 @@ public class UnknownFieldSetTest { } } - @Test @SuppressWarnings("ModifiedButNotUsed") public void testMergeVarintField_negative() { try { @@ -209,13 +223,11 @@ public class UnknownFieldSetTest { } } - @Test @SuppressWarnings("ModifiedButNotUsed") public void testHasField_negative() { assertThat(UnknownFieldSet.newBuilder().hasField(-2)).isFalse(); } - @Test @SuppressWarnings("ModifiedButNotUsed") public void testMergeLengthDelimitedField_negative() { ByteString byteString = ByteString.copyFromUtf8("some data"); @@ -227,14 +239,12 @@ public class UnknownFieldSetTest { } } - @Test public void testAddField() { UnknownFieldSet.Field field = getField("optional_int32"); UnknownFieldSet fieldSet = UnknownFieldSet.newBuilder().addField(1, field).build(); assertThat(fieldSet.getField(1)).isEqualTo(field); } - @Test public void testAddField_withReplacement() { UnknownFieldSet.Field first = UnknownFieldSet.Field.newBuilder().addFixed32(56).build(); UnknownFieldSet.Field second = UnknownFieldSet.Field.newBuilder().addFixed32(25).build(); @@ -247,69 +257,60 @@ public class UnknownFieldSetTest { assertThat(list.get(0)).isEqualTo(25); } - @Test public void testVarint() throws Exception { UnknownFieldSet.Field field = getField("optional_int32"); - assertThat(field.getVarintList()).hasSize(1); - assertThat((long) field.getVarintList().get(0)).isEqualTo(allFields.getOptionalInt32()); + assertEquals(1, field.getVarintList().size()); + assertEquals(allFields.getOptionalInt32(), (long) field.getVarintList().get(0)); } - @Test public void testFixed32() throws Exception { UnknownFieldSet.Field field = getField("optional_fixed32"); - assertThat(field.getFixed32List()).hasSize(1); - assertThat((int) field.getFixed32List().get(0)).isEqualTo(allFields.getOptionalFixed32()); + assertEquals(1, field.getFixed32List().size()); + assertEquals(allFields.getOptionalFixed32(), (int) field.getFixed32List().get(0)); } - @Test public void testFixed64() throws Exception { UnknownFieldSet.Field field = getField("optional_fixed64"); - assertThat(field.getFixed64List()).hasSize(1); - assertThat((long) field.getFixed64List().get(0)).isEqualTo(allFields.getOptionalFixed64()); + assertEquals(1, field.getFixed64List().size()); + assertEquals(allFields.getOptionalFixed64(), (long) field.getFixed64List().get(0)); } - @Test public void testLengthDelimited() throws Exception { UnknownFieldSet.Field field = getField("optional_bytes"); - assertThat(field.getLengthDelimitedList()).hasSize(1); - assertThat(field.getLengthDelimitedList().get(0)).isEqualTo(allFields.getOptionalBytes()); + assertEquals(1, field.getLengthDelimitedList().size()); + assertEquals(allFields.getOptionalBytes(), field.getLengthDelimitedList().get(0)); } - @Test public void testGroup() throws Exception { Descriptors.FieldDescriptor nestedFieldDescriptor = TestAllTypes.OptionalGroup.getDescriptor().findFieldByName("a"); - assertThat(nestedFieldDescriptor).isNotNull(); + assertNotNull(nestedFieldDescriptor); UnknownFieldSet.Field field = getField("optionalgroup"); - assertThat(field.getGroupList()).hasSize(1); + assertEquals(1, field.getGroupList().size()); UnknownFieldSet group = field.getGroupList().get(0); - assertThat(group.asMap()).hasSize(1); - assertThat(group.hasField(nestedFieldDescriptor.getNumber())).isTrue(); + assertEquals(1, group.asMap().size()); + assertTrue(group.hasField(nestedFieldDescriptor.getNumber())); UnknownFieldSet.Field nestedField = group.getField(nestedFieldDescriptor.getNumber()); - assertThat(nestedField.getVarintList()).hasSize(1); - assertThat((long) nestedField.getVarintList().get(0)) - .isEqualTo(allFields.getOptionalGroup().getA()); + assertEquals(1, nestedField.getVarintList().size()); + assertEquals(allFields.getOptionalGroup().getA(), (long) nestedField.getVarintList().get(0)); } - @Test public void testSerialize() throws Exception { // Check that serializing the UnknownFieldSet produces the original data // again. ByteString data = emptyMessage.toByteString(); - assertThat(data).isEqualTo(allFieldsData); + assertEquals(allFieldsData, data); } - @Test public void testCopyFrom() throws Exception { TestEmptyMessage message = TestEmptyMessage.newBuilder().mergeFrom(emptyMessage).build(); - assertThat(message.toString()).isEqualTo(emptyMessage.toString()); + assertEquals(emptyMessage.toString(), message.toString()); } - @Test public void testMergeFrom() throws Exception { TestEmptyMessage source = TestEmptyMessage.newBuilder() @@ -329,10 +330,9 @@ public class UnknownFieldSetTest { .mergeFrom(source) .build(); - assertThat(destination.toString()).isEqualTo("1: 1\n2: 2\n3: 3\n3: 4\n"); + assertEquals("1: 1\n2: 2\n3: 3\n3: 4\n", destination.toString()); } - @Test public void testAsMap() throws Exception { UnknownFieldSet.Builder builder = UnknownFieldSet.newBuilder().mergeFrom(unknownFields); Map mapFromBuilder = builder.asMap(); @@ -342,28 +342,24 @@ public class UnknownFieldSetTest { assertThat(mapFromFieldSet).containsExactlyEntriesIn(mapFromBuilder); } - @Test public void testClear() throws Exception { UnknownFieldSet fields = UnknownFieldSet.newBuilder().mergeFrom(unknownFields).clear().build(); - assertThat(fields.asMap()).isEmpty(); + assertTrue(fields.asMap().isEmpty()); } - @Test public void testClearMessage() throws Exception { TestEmptyMessage message = TestEmptyMessage.newBuilder().mergeFrom(emptyMessage).clear().build(); - assertThat(message.getSerializedSize()).isEqualTo(0); + assertEquals(0, message.getSerializedSize()); } - @Test public void testClearField() throws Exception { int fieldNumber = unknownFields.asMap().keySet().iterator().next(); UnknownFieldSet fields = UnknownFieldSet.newBuilder().mergeFrom(unknownFields).clearField(fieldNumber).build(); - assertThat(fields.hasField(fieldNumber)).isFalse(); + assertFalse(fields.hasField(fieldNumber)); } - @Test public void testParseKnownAndUnknown() throws Exception { // Test mixing known and unknown fields when parsing. @@ -376,14 +372,13 @@ public class UnknownFieldSetTest { TestAllTypes destination = TestAllTypes.parseFrom(data); TestUtil.assertAllFieldsSet(destination); - assertThat(destination.getUnknownFields().asMap()).hasSize(1); + assertEquals(1, destination.getUnknownFields().asMap().size()); UnknownFieldSet.Field field = destination.getUnknownFields().getField(123456); - assertThat(field.getVarintList()).hasSize(1); - assertThat((long) field.getVarintList().get(0)).isEqualTo(654321); + assertEquals(1, field.getVarintList().size()); + assertEquals(654321, (long) field.getVarintList().get(0)); } - @Test public void testWrongTypeTreatedAsUnknown() throws Exception { // Test that fields of the wrong wire type are treated like unknown fields // when parsing. @@ -394,10 +389,9 @@ public class UnknownFieldSetTest { // All fields should have been interpreted as unknown, so the debug strings // should be the same. - assertThat(emptyMessage.toString()).isEqualTo(allTypesMessage.toString()); + assertEquals(emptyMessage.toString(), allTypesMessage.toString()); } - @Test public void testUnknownExtensions() throws Exception { // Make sure fields are properly parsed to the UnknownFieldSet even when // they are declared as extension numbers. @@ -405,11 +399,10 @@ public class UnknownFieldSetTest { TestEmptyMessageWithExtensions message = TestEmptyMessageWithExtensions.parseFrom(allFieldsData); - assertThat(unknownFields.asMap()).hasSize(message.getUnknownFields().asMap().size()); - assertThat(allFieldsData).isEqualTo(message.toByteString()); + assertEquals(unknownFields.asMap().size(), message.getUnknownFields().asMap().size()); + assertEquals(allFieldsData, message.toByteString()); } - @Test public void testWrongExtensionTypeTreatedAsUnknown() throws Exception { // Test that fields of the wrong wire type are treated like unknown fields // when parsing extensions. @@ -420,17 +413,16 @@ public class UnknownFieldSetTest { // All fields should have been interpreted as unknown, so the debug strings // should be the same. - assertThat(emptyMessage.toString()).isEqualTo(allExtensionsMessage.toString()); + assertEquals(emptyMessage.toString(), allExtensionsMessage.toString()); } - @Test public void testParseUnknownEnumValue() throws Exception { Descriptors.FieldDescriptor singularField = TestAllTypes.getDescriptor().findFieldByName("optional_nested_enum"); Descriptors.FieldDescriptor repeatedField = TestAllTypes.getDescriptor().findFieldByName("repeated_nested_enum"); - assertThat(singularField).isNotNull(); - assertThat(repeatedField).isNotNull(); + assertNotNull(singularField); + assertNotNull(repeatedField); ByteString data = UnknownFieldSet.newBuilder() @@ -453,34 +445,36 @@ public class UnknownFieldSetTest { { TestAllTypes message = TestAllTypes.parseFrom(data); - assertThat(message.getOptionalNestedEnum()).isEqualTo(TestAllTypes.NestedEnum.BAR); - assertThat(message.getRepeatedNestedEnumList()) - .containsExactly(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ) - .inOrder(); - assertThat(message.getUnknownFields().getField(singularField.getNumber()).getVarintList()) - .containsExactly(5L); - assertThat(message.getUnknownFields().getField(repeatedField.getNumber()).getVarintList()) - .containsExactly(4L, 6L) - .inOrder(); + assertEquals(TestAllTypes.NestedEnum.BAR, message.getOptionalNestedEnum()); + assertEquals( + Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ), + message.getRepeatedNestedEnumList()); + assertEquals( + Arrays.asList(5L), + message.getUnknownFields().getField(singularField.getNumber()).getVarintList()); + assertEquals( + Arrays.asList(4L, 6L), + message.getUnknownFields().getField(repeatedField.getNumber()).getVarintList()); } { TestAllExtensions message = TestAllExtensions.parseFrom(data, TestUtil.getExtensionRegistry()); - assertThat(message.getExtension(UnittestProto.optionalNestedEnumExtension)) - .isEqualTo(TestAllTypes.NestedEnum.BAR); - assertThat(message.getExtension(UnittestProto.repeatedNestedEnumExtension)) - .containsExactly(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ) - .inOrder(); - assertThat(message.getUnknownFields().getField(singularField.getNumber()).getVarintList()) - .containsExactly(5L); - assertThat(message.getUnknownFields().getField(repeatedField.getNumber()).getVarintList()) - .containsExactly(4L, 6L) - .inOrder(); + assertEquals( + TestAllTypes.NestedEnum.BAR, + message.getExtension(UnittestProto.optionalNestedEnumExtension)); + assertEquals( + Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ), + message.getExtension(UnittestProto.repeatedNestedEnumExtension)); + assertEquals( + Arrays.asList(5L), + message.getUnknownFields().getField(singularField.getNumber()).getVarintList()); + assertEquals( + Arrays.asList(4L, 6L), + message.getUnknownFields().getField(repeatedField.getNumber()).getVarintList()); } } - @Test public void testLargeVarint() throws Exception { ByteString data = UnknownFieldSet.newBuilder() @@ -489,11 +483,10 @@ public class UnknownFieldSetTest { .toByteString(); UnknownFieldSet parsed = UnknownFieldSet.parseFrom(data); UnknownFieldSet.Field field = parsed.getField(1); - assertThat(field.getVarintList()).hasSize(1); - assertThat((long) field.getVarintList().get(0)).isEqualTo(0x7FFFFFFFFFFFFFFFL); + assertEquals(1, field.getVarintList().size()); + assertEquals(0x7FFFFFFFFFFFFFFFL, (long) field.getVarintList().get(0)); } - @Test public void testEqualsAndHashCode() { UnknownFieldSet.Field fixed32Field = UnknownFieldSet.Field.newBuilder().addFixed32(1).build(); UnknownFieldSet.Field fixed64Field = UnknownFieldSet.Field.newBuilder().addFixed64(1).build(); @@ -535,50 +528,49 @@ public class UnknownFieldSetTest { */ private void checkNotEqual(UnknownFieldSet s1, UnknownFieldSet s2) { String equalsError = String.format("%s should not be equal to %s", s1, s2); - assertWithMessage(equalsError).that(s1).isNotEqualTo(s2); - assertWithMessage(equalsError).that(s2).isNotEqualTo(s1); + assertFalse(equalsError, s1.equals(s2)); + assertFalse(equalsError, s2.equals(s1)); - assertWithMessage("%s should have a different hash code from %s", s1, s2) - .that(s1.hashCode()) - .isNotEqualTo(s2.hashCode()); + assertFalse( + String.format("%s should have a different hash code from %s", s1, s2), + s1.hashCode() == s2.hashCode()); } /** Asserts that the given field sets are equal and have identical hash codes. */ private void checkEqualsIsConsistent(UnknownFieldSet set) { // Object should be equal to itself. - assertThat(set.equals(set)).isTrue(); + assertEquals(set, set); // Object should be equal to a copy of itself. UnknownFieldSet copy = UnknownFieldSet.newBuilder(set).build(); - assertThat(copy).isEqualTo(set); - assertThat(set).isEqualTo(copy); - assertThat(set.hashCode()).isEqualTo(copy.hashCode()); + assertEquals(set, copy); + assertEquals(copy, set); + assertEquals(set.hashCode(), copy.hashCode()); } // ================================================================= - @Test public void testProto3RoundTrip() throws Exception { ByteString data = getBizarroData(); UnittestProto3.TestEmptyMessage message = UnittestProto3.TestEmptyMessage.parseFrom(data, ExtensionRegistryLite.getEmptyRegistry()); - assertThat(message.toByteString()).isEqualTo(data); + assertEquals(data, message.toByteString()); message = UnittestProto3.TestEmptyMessage.newBuilder().mergeFrom(message).build(); - assertThat(message.toByteString()).isEqualTo(data); - - assertThat(data) - .isEqualTo( - UnittestProto3.TestMessageWithDummy.parseFrom( - data, ExtensionRegistryLite.getEmptyRegistry()) - .toBuilder() - // force copy-on-write - .setDummy(true) - .build() - .toBuilder() - .clearDummy() - .build() - .toByteString()); + assertEquals(data, message.toByteString()); + + assertEquals( + data, + UnittestProto3.TestMessageWithDummy.parseFrom( + data, ExtensionRegistryLite.getEmptyRegistry()) + .toBuilder() + // force copy-on-write + .setDummy(true) + .build() + .toBuilder() + .clearDummy() + .build() + .toByteString()); } } diff --git a/java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java b/java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java index 0e2d9f85b292e59655b1d67f4dd77aad82f7f1fd..bc73cc97839dc64174b2c9fe087ec03c4d829c34 100644 --- a/java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java +++ b/java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java @@ -1,25 +1,46 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import java.util.Iterator; import java.util.List; import java.util.ListIterator; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests for {@link UnmodifiableLazyStringList}. */ -@RunWith(JUnit4.class) -public class UnmodifiableLazyStringListTest { +/** + * Tests for {@link UnmodifiableLazyStringList}. + * + * @author jonp@google.com (Jon Perlow) + */ +public class UnmodifiableLazyStringListTest extends TestCase { private static final String STRING_A = "A"; private static final String STRING_B = "B"; @@ -29,83 +50,80 @@ public class UnmodifiableLazyStringListTest { private static final ByteString BYTE_STRING_B = ByteString.copyFromUtf8("B"); private static final ByteString BYTE_STRING_C = ByteString.copyFromUtf8("C"); - @Test public void testReadOnlyMethods() { LazyStringArrayList rawList = createSampleList(); UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); - assertThat(list).hasSize(3); - assertThat(list.get(0)).isSameInstanceAs(STRING_A); - assertThat(list.get(1)).isSameInstanceAs(STRING_B); - assertThat(list.get(2)).isSameInstanceAs(STRING_C); - assertThat(list.getByteString(0)).isEqualTo(BYTE_STRING_A); - assertThat(list.getByteString(1)).isEqualTo(BYTE_STRING_B); - assertThat(list.getByteString(2)).isEqualTo(BYTE_STRING_C); + assertEquals(3, list.size()); + assertSame(STRING_A, list.get(0)); + assertSame(STRING_B, list.get(1)); + assertSame(STRING_C, list.get(2)); + assertEquals(BYTE_STRING_A, list.getByteString(0)); + assertEquals(BYTE_STRING_B, list.getByteString(1)); + assertEquals(BYTE_STRING_C, list.getByteString(2)); List byteStringList = list.asByteStringList(); - assertThat(byteStringList.get(0)).isSameInstanceAs(list.getByteString(0)); - assertThat(byteStringList.get(1)).isSameInstanceAs(list.getByteString(1)); - assertThat(byteStringList.get(2)).isSameInstanceAs(list.getByteString(2)); + assertSame(list.getByteString(0), byteStringList.get(0)); + assertSame(list.getByteString(1), byteStringList.get(1)); + assertSame(list.getByteString(2), byteStringList.get(2)); } - @Test public void testModifyMethods() { LazyStringArrayList rawList = createSampleList(); UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); try { list.remove(0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(list).hasSize(3); + assertEquals(3, list.size()); try { list.add(STRING_B); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(list).hasSize(3); + assertEquals(3, list.size()); try { list.set(1, STRING_B); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(list).hasSize(3); + assertEquals(3, list.size()); List byteStringList = list.asByteStringList(); try { byteStringList.remove(0); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(list).hasSize(3); - assertThat(byteStringList).hasSize(3); + assertEquals(3, list.size()); + assertEquals(3, byteStringList.size()); try { byteStringList.add(BYTE_STRING_B); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(list).hasSize(3); - assertThat(byteStringList).hasSize(3); + assertEquals(3, list.size()); + assertEquals(3, byteStringList.size()); try { byteStringList.set(1, BYTE_STRING_B); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } - assertThat(list).hasSize(3); - assertThat(byteStringList).hasSize(3); + assertEquals(3, list.size()); + assertEquals(3, byteStringList.size()); } - @Test public void testIterator() { LazyStringArrayList rawList = createSampleList(); UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); @@ -117,12 +135,12 @@ public class UnmodifiableLazyStringListTest { count++; try { iter.remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } - assertThat(count).isEqualTo(3); + assertEquals(3, count); List byteStringList = list.asByteStringList(); Iterator byteIter = byteStringList.iterator(); @@ -132,15 +150,14 @@ public class UnmodifiableLazyStringListTest { count++; try { byteIter.remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } - assertThat(count).isEqualTo(3); + assertEquals(3, count); } - @Test public void testListIterator() { LazyStringArrayList rawList = createSampleList(); UnmodifiableLazyStringList list = new UnmodifiableLazyStringList(rawList); @@ -152,24 +169,24 @@ public class UnmodifiableLazyStringListTest { count++; try { iter.remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { iter.set("bar"); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { iter.add("bar"); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } - assertThat(count).isEqualTo(3); + assertEquals(3, count); List byteStringList = list.asByteStringList(); ListIterator byteIter = byteStringList.listIterator(); @@ -179,24 +196,24 @@ public class UnmodifiableLazyStringListTest { count++; try { byteIter.remove(); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { byteIter.set(BYTE_STRING_A); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } try { byteIter.add(BYTE_STRING_A); - assertWithMessage("expected exception").fail(); + fail(); } catch (UnsupportedOperationException e) { // expected } } - assertThat(count).isEqualTo(3); + assertEquals(3, count); } private LazyStringArrayList createSampleList() { diff --git a/java/core/src/test/java/com/google/protobuf/Utf8Test.java b/java/core/src/test/java/com/google/protobuf/Utf8Test.java index 986702de431ae505663e354a64f6d50f198d3ae0..bc3c985104a582d83ffa322192649f07371c3d37 100644 --- a/java/core/src/test/java/com/google/protobuf/Utf8Test.java +++ b/java/core/src/test/java/com/google/protobuf/Utf8Test.java @@ -1,29 +1,48 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - import java.nio.ByteBuffer; +import java.util.Arrays; import java.util.Random; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import java.util.regex.Pattern; +import junit.framework.TestCase; -@RunWith(JUnit4.class) -public class Utf8Test { +/** Unit tests for {@link Utf8}. */ +public class Utf8Test extends TestCase { private static final int NUM_CHARS = 16384; private static final Utf8.Processor safeProcessor = new Utf8.SafeProcessor(); private static final Utf8.Processor unsafeProcessor = new Utf8.UnsafeProcessor(); - @Test public void testEncode() { assertEncoding(randomString(0x80)); assertEncoding(randomString(0x90)); @@ -32,7 +51,6 @@ public class Utf8Test { assertEncoding(randomString(0x10ffff)); } - @Test public void testEncode_insufficientSpace() { assertEncoding_insufficientSpace(randomString(0x80)); assertEncoding_insufficientSpace(randomString(0x90)); @@ -41,26 +59,22 @@ public class Utf8Test { assertEncoding_insufficientSpace(randomString(0x10ffff)); } - @Test public void testValid() { assertIsValid(new byte[] {(byte) 0xE0, (byte) 0xB9, (byte) 0x96}, true); assertIsValid(new byte[] {(byte) 0xF0, (byte) 0xB2, (byte) 0x83, (byte) 0xBC}, true); } - @Test public void testOverlongIsInvalid() { assertIsValid(new byte[] {(byte) 0xC0, (byte) 0x81}, false); assertIsValid(new byte[] {(byte) 0xE0, (byte) 0x81, (byte) 0x81}, false); assertIsValid(new byte[] {(byte) 0xF0, (byte) 0x81, (byte) 0x81, (byte) 0x81}, false); } - @Test public void testMaxCodepointExceeded() { // byte1 > 0xF4 assertIsValid(new byte[] {(byte) 0xF5, (byte) 0x81, (byte) 0x81, (byte) 0x81}, false); } - @Test public void testInvalidSurrogateCodepoint() { assertIsValid(new byte[] {(byte) 0xED, (byte) 0xA1, (byte) 0x81}, false); @@ -78,58 +92,53 @@ public class Utf8Test { int codePoint; do { codePoint = rnd.nextInt(maxCodePoint); - } while (Character.isSurrogate((char) codePoint)); + } while (Utf8Utils.isSurrogate(codePoint)); sb.appendCodePoint(codePoint); } return sb.toString(); } private static void assertIsValid(byte[] data, boolean valid) { - assertWithMessage("isValidUtf8[ARRAY]") - .that(safeProcessor.isValidUtf8(data, 0, data.length)) - .isEqualTo(valid); - assertWithMessage("isValidUtf8[ARRAY_UNSAFE]") - .that(unsafeProcessor.isValidUtf8(data, 0, data.length)) - .isEqualTo(valid); + assertEquals("isValidUtf8[ARRAY]", valid, safeProcessor.isValidUtf8(data, 0, data.length)); + assertEquals( + "isValidUtf8[ARRAY_UNSAFE]", valid, unsafeProcessor.isValidUtf8(data, 0, data.length)); ByteBuffer buffer = ByteBuffer.wrap(data); - assertWithMessage("isValidUtf8[NIO_HEAP]") - .that(safeProcessor.isValidUtf8(buffer, buffer.position(), buffer.remaining())) - .isEqualTo(valid); + assertEquals( + "isValidUtf8[NIO_HEAP]", + valid, + safeProcessor.isValidUtf8(buffer, buffer.position(), buffer.remaining())); // Direct buffers. buffer = ByteBuffer.allocateDirect(data.length); buffer.put(data); buffer.flip(); - assertWithMessage("isValidUtf8[NIO_DEFAULT]") - .that(safeProcessor.isValidUtf8(buffer, buffer.position(), buffer.remaining())) - .isEqualTo(valid); - assertWithMessage("isValidUtf8[NIO_UNSAFE]") - .that(unsafeProcessor.isValidUtf8(buffer, buffer.position(), buffer.remaining())) - .isEqualTo(valid); + assertEquals( + "isValidUtf8[NIO_DEFAULT]", + valid, + safeProcessor.isValidUtf8(buffer, buffer.position(), buffer.remaining())); + assertEquals( + "isValidUtf8[NIO_UNSAFE]", + valid, + unsafeProcessor.isValidUtf8(buffer, buffer.position(), buffer.remaining())); } private static void assertEncoding(String message) { byte[] expected = message.getBytes(Internal.UTF_8); byte[] output = encodeToByteArray(message, expected.length, safeProcessor); - assertWithMessage("encodeUtf8[ARRAY]") - .that(output).isEqualTo(expected); + assertTrue("encodeUtf8[ARRAY]", Arrays.equals(expected, output)); output = encodeToByteArray(message, expected.length, unsafeProcessor); - assertWithMessage("encodeUtf8[ARRAY_UNSAFE]") - .that(output).isEqualTo(expected); + assertTrue("encodeUtf8[ARRAY_UNSAFE]", Arrays.equals(expected, output)); output = encodeToByteBuffer(message, expected.length, false, safeProcessor); - assertWithMessage("encodeUtf8[NIO_HEAP]") - .that(output).isEqualTo(expected); + assertTrue("encodeUtf8[NIO_HEAP]", Arrays.equals(expected, output)); output = encodeToByteBuffer(message, expected.length, true, safeProcessor); - assertWithMessage("encodeUtf8[NIO_DEFAULT]") - .that(output).isEqualTo(expected); + assertTrue("encodeUtf8[NIO_DEFAULT]", Arrays.equals(expected, output)); output = encodeToByteBuffer(message, expected.length, true, unsafeProcessor); - assertWithMessage("encodeUtf8[NIO_UNSAFE]") - .that(output).isEqualTo(expected); + assertTrue("encodeUtf8[NIO_UNSAFE]", Arrays.equals(expected, output)); } private void assertEncoding_insufficientSpace(String message) { @@ -138,56 +147,54 @@ public class Utf8Test { try { encodeToByteArray(message, length, safeProcessor); - assertWithMessage("Expected " + clazz.getSimpleName()).fail(); + fail("Expected " + clazz.getSimpleName()); } catch (Throwable t) { // Expected - assertThat(t).isInstanceOf(clazz); + assertExceptionType(t, clazz); // byte[] + safeProcessor will not exit early. We can't match the message since we don't // know which char/index due to random input. } try { encodeToByteArray(message, length, unsafeProcessor); - assertWithMessage("Expected " + clazz.getSimpleName()).fail(); + fail("Expected " + clazz.getSimpleName()); } catch (Throwable t) { - assertThat(t).isInstanceOf(clazz); + assertExceptionType(t, clazz); // byte[] + unsafeProcessor will exit early, so we have can match the message. - String pattern = "Failed writing (.) at index " + length; - assertThat(t).hasMessageThat().matches(pattern); + assertExceptionMessage(t, length); } try { encodeToByteBuffer(message, length, false, safeProcessor); - assertWithMessage("Expected " + clazz.getSimpleName()).fail(); + fail("Expected " + clazz.getSimpleName()); } catch (Throwable t) { // Expected - assertThat(t).isInstanceOf(clazz); + assertExceptionType(t, clazz); // ByteBuffer + safeProcessor will not exit early. We can't match the message since we don't // know which char/index due to random input. } try { encodeToByteBuffer(message, length, true, safeProcessor); - assertWithMessage("Expected " + clazz.getSimpleName()).fail(); + fail("Expected " + clazz.getSimpleName()); } catch (Throwable t) { // Expected - assertThat(t).isInstanceOf(clazz); + assertExceptionType(t, clazz); // ByteBuffer + safeProcessor will not exit early. We can't match the message since we don't // know which char/index due to random input. } try { encodeToByteBuffer(message, length, true, unsafeProcessor); - assertWithMessage("Expected " + clazz.getSimpleName()).fail(); + fail("Expected " + clazz.getSimpleName()); } catch (Throwable t) { // Expected - assertThat(t).isInstanceOf(clazz); + assertExceptionType(t, clazz); // Direct ByteBuffer + unsafeProcessor will exit early if it's not on Android, so we can // match the message. On Android, a direct ByteBuffer will have hasArray() being true and // it will take a different code path and produces a different message. if (!Android.isOnAndroidDevice()) { - String pattern = "Failed writing (.) at index " + length; - assertThat(t).hasMessageThat().matches(pattern); + assertExceptionMessage(t, length); } } } @@ -210,4 +217,16 @@ public class Utf8Test { return output; } + private void assertExceptionType(Throwable t, Class expected) { + if (!expected.isAssignableFrom(t.getClass())) { + fail("Expected " + expected.getSimpleName() + ", but found " + t.getClass().getSimpleName()); + } + } + + private void assertExceptionMessage(Throwable t, int index) { + String pattern = "Failed writing (.) at index " + index; + assertTrue( + t.getMessage() + " does not match pattern " + pattern, + Pattern.matches(pattern, t.getMessage())); + } } diff --git a/java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java b/java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java index 89498b828b3aacc46a24b42d67766a2d7a042f15..982e200f53f678bfce021ed2e93ece13edc55cda 100644 --- a/java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java +++ b/java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; diff --git a/java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java b/java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java index f57e5c9a6d758d0b20e742b957aa6c6cacd9f7e4..a725d413ff5eca06f1ef0e7628a7c408d28fa733 100644 --- a/java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java +++ b/java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static com.google.protobuf.UnittestLite.optionalForeignEnumExtensionLite; import com.google.protobuf.UnittestLite.ForeignEnumLite; @@ -34,15 +55,11 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.util.Arrays; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class WireFormatLiteTest { +import junit.framework.TestCase; - @Test +public class WireFormatLiteTest extends TestCase { public void testSerializeExtensionsLite() throws Exception { // TestAllTypes and TestAllExtensions should have compatible wire formats, // so if we serialize a TestAllExtensions then parse it as TestAllTypes @@ -50,14 +67,13 @@ public class WireFormatLiteTest { TestAllExtensionsLite message = TestUtilLite.getAllLiteExtensionsSet(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); TestUtil.assertAllFieldsSet(message2); } - @Test public void testSerializePackedExtensionsLite() throws Exception { // TestPackedTypes and TestPackedExtensions should have compatible wire // formats; check that they serialize to the same string. @@ -67,10 +83,9 @@ public class WireFormatLiteTest { TestPackedTypes message2 = TestUtil.getPackedSet(); ByteString rawBytes2 = message2.toByteString(); - assertThat(rawBytes2).isEqualTo(rawBytes); + assertEquals(rawBytes, rawBytes2); } - @Test public void testParseExtensionsLite() throws Exception { // TestAllTypes and TestAllExtensions should have compatible wire formats, // so if we serialize a TestAllTypes then parse it as TestAllExtensions @@ -87,7 +102,6 @@ public class WireFormatLiteTest { TestUtil.assertAllExtensionsSet(message2); } - @Test public void testParsePackedExtensionsLite() throws Exception { // Ensure that packed extensions can be properly parsed. TestPackedExtensionsLite message = TestUtilLite.getLitePackedExtensionsSet(); @@ -101,31 +115,28 @@ public class WireFormatLiteTest { TestUtil.assertPackedExtensionsSet(message2); } - @Test public void testSerialization() throws Exception { TestAllTypes message = TestUtil.getAllSet(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); TestUtil.assertAllFieldsSet(message2); } - @Test public void testSerializationPacked() throws Exception { TestPackedTypes message = TestUtil.getPackedSet(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestPackedTypes message2 = TestPackedTypes.parseFrom(rawBytes); TestUtil.assertPackedFieldsSet(message2); } - @Test public void testSerializeExtensions() throws Exception { // TestAllTypes and TestAllExtensions should have compatible wire formats, // so if we serialize a TestAllExtensions then parse it as TestAllTypes @@ -133,14 +144,13 @@ public class WireFormatLiteTest { TestAllExtensions message = TestUtil.getAllExtensionsSet(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); TestUtil.assertAllFieldsSet(message2); } - @Test public void testSerializePackedExtensions() throws Exception { // TestPackedTypes and TestPackedExtensions should have compatible wire // formats; check that they serialize to the same string. @@ -150,10 +160,9 @@ public class WireFormatLiteTest { TestPackedTypes message2 = TestUtil.getPackedSet(); ByteString rawBytes2 = message2.toByteString(); - assertThat(rawBytes2).isEqualTo(rawBytes); + assertEquals(rawBytes, rawBytes2); } - @Test public void testSerializationPackedWithoutGetSerializedSize() throws Exception { // Write directly to an OutputStream, without invoking getSerializedSize() // This used to be a bug where the size of a packed field was incorrect, @@ -174,7 +183,6 @@ public class WireFormatLiteTest { TestUtil.assertPackedFieldsSet(message2); } - @Test public void testParseExtensions() throws Exception { // TestAllTypes and TestAllExtensions should have compatible wire formats, // so if we serialize a TestAllTypes then parse it as TestAllExtensions @@ -190,7 +198,6 @@ public class WireFormatLiteTest { TestUtil.assertAllExtensionsSet(message2); } - @Test public void testParsePackedExtensions() throws Exception { // Ensure that packed extensions can be properly parsed. TestPackedExtensions message = TestUtil.getPackedExtensionsSet(); @@ -203,7 +210,6 @@ public class WireFormatLiteTest { TestUtil.assertPackedExtensionsSet(message2); } - @Test public void testSerializeDelimited() throws Exception { ByteArrayOutputStream output = new ByteArrayOutputStream(); TestUtil.getAllSet().writeDelimitedTo(output); @@ -214,13 +220,13 @@ public class WireFormatLiteTest { ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray()); TestUtil.assertAllFieldsSet(TestAllTypes.parseDelimitedFrom(input)); - assertThat(input.read()).isEqualTo(12); + assertEquals(12, input.read()); TestUtil.assertPackedFieldsSet(TestPackedTypes.parseDelimitedFrom(input)); - assertThat(input.read()).isEqualTo(34); - assertThat(input.read()).isEqualTo(-1); + assertEquals(34, input.read()); + assertEquals(-1, input.read()); // We're at EOF, so parsing again should return null. - assertThat(TestAllTypes.parseDelimitedFrom(input)).isNull(); + assertNull(TestAllTypes.parseDelimitedFrom(input)); } private ExtensionRegistryLite getTestFieldOrderingsRegistry() { @@ -230,7 +236,6 @@ public class WireFormatLiteTest { return result; } - @Test public void testParseMultipleExtensionRanges() throws Exception { // Make sure we can parse a message that contains multiple extensions // ranges. @@ -244,7 +249,7 @@ public class WireFormatLiteTest { .build(); TestFieldOrderings dest = TestFieldOrderings.parseFrom(source.toByteString(), getTestFieldOrderingsRegistry()); - assertThat(dest).isEqualTo(source); + assertEquals(source, dest); } private static ExtensionRegistryLite getTestExtensionInsideTableRegistry() { @@ -253,7 +258,6 @@ public class WireFormatLiteTest { return result; } - @Test public void testExtensionInsideTable() throws Exception { // Make sure the extension within the range of table is parsed correctly in experimental // runtime. @@ -265,19 +269,17 @@ public class WireFormatLiteTest { TestExtensionInsideTable dest = TestExtensionInsideTable.parseFrom( source.toByteString(), getTestExtensionInsideTableRegistry()); - assertThat(dest).isEqualTo(source); + assertEquals(source, dest); } private static final int UNKNOWN_TYPE_ID = 1550055; private static final int TYPE_ID_1 = 1545008; private static final int TYPE_ID_2 = 1547769; - @Test public void testSerializeMessageSetEagerly() throws Exception { testSerializeMessageSetWithFlag(true); } - @Test public void testSerializeMessageSetNotEagerly() throws Exception { testSerializeMessageSetWithFlag(false); } @@ -307,28 +309,26 @@ public class WireFormatLiteTest { // Parse back using RawMessageSet and check the contents. RawMessageSet raw = RawMessageSet.parseFrom(data); - assertThat(raw.getItemCount()).isEqualTo(3); - assertThat(raw.getItem(0).getTypeId()).isEqualTo(TYPE_ID_1); - assertThat(raw.getItem(1).getTypeId()).isEqualTo(TYPE_ID_2); - assertThat(raw.getItem(2).getTypeId()).isEqualTo(UNKNOWN_TYPE_ID); + assertEquals(3, raw.getItemCount()); + assertEquals(TYPE_ID_1, raw.getItem(0).getTypeId()); + assertEquals(TYPE_ID_2, raw.getItem(1).getTypeId()); + assertEquals(UNKNOWN_TYPE_ID, raw.getItem(2).getTypeId()); TestMessageSetExtension1 message1 = TestMessageSetExtension1.parseFrom(raw.getItem(0).getMessage()); - assertThat(message1.getI()).isEqualTo(123); + assertEquals(123, message1.getI()); TestMessageSetExtension2 message2 = TestMessageSetExtension2.parseFrom(raw.getItem(1).getMessage()); - assertThat(message2.getStr()).isEqualTo("foo"); + assertEquals("foo", message2.getStr()); - assertThat(raw.getItem(2).getMessage().toStringUtf8()).isEqualTo("bar"); + assertEquals("bar", raw.getItem(2).getMessage().toStringUtf8()); } - @Test public void testParseMessageSetEagerly() throws Exception { testParseMessageSetWithFlag(true); } - @Test public void testParseMessageSetNotEagerly() throws Exception { testParseMessageSetWithFlag(false); } @@ -366,18 +366,15 @@ public class WireFormatLiteTest { // Parse as a TestMessageSet and check the contents. TestMessageSet messageSet = TestMessageSet.parseFrom(data, extensionRegistry); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); - assertThat(messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()) - .isEqualTo("foo"); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); + assertEquals( + "foo", messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()); } - @Test public void testParseMessageSetExtensionEagerly() throws Exception { testParseMessageSetExtensionWithFlag(true); } - @Test public void testParseMessageSetExtensionNotEagerly() throws Exception { testParseMessageSetExtensionWithFlag(false); } @@ -403,16 +400,13 @@ public class WireFormatLiteTest { // Parse as a TestMessageSet and check the contents. TestMessageSet messageSet = TestMessageSet.parseFrom(data, extensionRegistry); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); } - @Test public void testMergeLazyMessageSetExtensionEagerly() throws Exception { testMergeLazyMessageSetExtensionWithFlag(true); } - @Test public void testMergeLazyMessageSetExtensionNotEagerly() throws Exception { testMergeLazyMessageSetExtensionWithFlag(false); } @@ -440,16 +434,13 @@ public class WireFormatLiteTest { TestMessageSet messageSet = TestMessageSet.parseFrom(data, extensionRegistry); // Merge lazy field check the contents. messageSet = messageSet.toBuilder().mergeFrom(data, extensionRegistry).build(); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); } - @Test public void testMergeMessageSetExtensionEagerly() throws Exception { testMergeMessageSetExtensionWithFlag(true); } - @Test public void testMergeMessageSetExtensionNotEagerly() throws Exception { testMergeMessageSetExtensionWithFlag(false); } @@ -486,34 +477,31 @@ public class WireFormatLiteTest { // Merge bytes into TestMessageSet and check the contents. TestMessageSet messageSet = TestMessageSet.newBuilder().mergeFrom(data, extensionRegistry).build(); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); } // ================================================================ // oneof - @Test public void testOneofWireFormat() throws Exception { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestUtil.setOneof(builder); TestOneof2 message = builder.build(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestOneof2 message2 = TestOneof2.parseFrom(rawBytes); TestUtil.assertOneofSet(message2); } - @Test public void testOneofOnlyLastSet() throws Exception { TestOneofBackwardsCompatible source = TestOneofBackwardsCompatible.newBuilder().setFooInt(100).setFooString("101").build(); ByteString rawBytes = source.toByteString(); TestOneof2 message = TestOneof2.parseFrom(rawBytes); - assertThat(message.hasFooInt()).isFalse(); - assertThat(message.hasFooString()).isTrue(); + assertFalse(message.hasFooInt()); + assertTrue(message.hasFooString()); } private void assertInvalidWireFormat( @@ -521,27 +509,27 @@ public class WireFormatLiteTest { // Test all combinations: (builder vs parser) x (byte[] vs. InputStream). try { defaultInstance.newBuilderForType().mergeFrom(data, offset, length); - assertWithMessage("Expected exception").fail(); + fail("Expected exception"); } catch (InvalidProtocolBufferException e) { // Pass. } try { defaultInstance.getParserForType().parseFrom(data, offset, length); - assertWithMessage("Expected exception").fail(); + fail("Expected exception"); } catch (InvalidProtocolBufferException e) { // Pass. } try { InputStream input = new ByteArrayInputStream(data, offset, length); defaultInstance.newBuilderForType().mergeFrom(input); - assertWithMessage("Expected exception").fail(); + fail("Expected exception"); } catch (IOException e) { // Pass. } try { InputStream input = new ByteArrayInputStream(data, offset, length); defaultInstance.getParserForType().parseFrom(input); - assertWithMessage("Expected exception").fail(); + fail("Expected exception"); } catch (IOException e) { // Pass. } @@ -556,7 +544,6 @@ public class WireFormatLiteTest { assertInvalidWireFormat(UnittestProto3.TestAllTypes.getDefaultInstance(), data); } - @Test public void testParserRejectInvalidTag() throws Exception { byte[] invalidTags = new byte[] { @@ -622,7 +609,6 @@ public class WireFormatLiteTest { } } - @Test public void testUnmatchedGroupTag() throws Exception { int startTag = WireFormat.makeTag(16, WireFormat.WIRETYPE_START_GROUP); byte[] data = @@ -651,12 +637,11 @@ public class WireFormatLiteTest { defaultInstance.newBuilderForType().mergeFrom(new ByteArrayInputStream(data)).build(); MessageLite message4 = defaultInstance.getParserForType().parseFrom(new ByteArrayInputStream(data)); - assertThat(message2).isEqualTo(message1); - assertThat(message3).isEqualTo(message2); - assertThat(message4).isEqualTo(message3); + assertEquals(message1, message2); + assertEquals(message2, message3); + assertEquals(message3, message4); } - @Test public void testUnmatchedWireType() throws Exception { // Build a payload with all fields from 1 to 128 being varints. Parsing it into TestAllTypes // or other message types should succeed even though the wire type doesn't match for some @@ -675,7 +660,6 @@ public class WireFormatLiteTest { assertAccepted(MapForProto2TestProto.TestMap.getDefaultInstance(), data); } - @Test public void testParseTruncatedPackedFields() throws Exception { TestPackedTypes all = TestUtil.getPackedSet(); TestPackedTypes[] messages = @@ -703,7 +687,6 @@ public class WireFormatLiteTest { } } - @Test public void testParsePackedFieldsWithIncorrectLength() throws Exception { // Set the length-prefix to 1 with a 4-bytes payload to test what happens when reading a packed // element moves the reading position past the given length limit. It should result in an @@ -775,7 +758,6 @@ public class WireFormatLiteTest { } } - @Test public void testParseVarintMinMax() throws Exception { TestAllTypes message = TestAllTypes.newBuilder() @@ -785,61 +767,55 @@ public class WireFormatLiteTest { .addRepeatedInt64(Long.MAX_VALUE) .build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getOptionalInt32()).isEqualTo(Integer.MIN_VALUE); - assertThat(parsed.getRepeatedInt32(0)).isEqualTo(Integer.MAX_VALUE); - assertThat(parsed.getOptionalInt64()).isEqualTo(Long.MIN_VALUE); - assertThat(parsed.getRepeatedInt64(0)).isEqualTo(Long.MAX_VALUE); + assertEquals(Integer.MIN_VALUE, parsed.getOptionalInt32()); + assertEquals(Integer.MAX_VALUE, parsed.getRepeatedInt32(0)); + assertEquals(Long.MIN_VALUE, parsed.getOptionalInt64()); + assertEquals(Long.MAX_VALUE, parsed.getRepeatedInt64(0)); } - @Test public void testParseAllVarintBits() throws Exception { for (int i = 0; i < 32; i++) { final int value = 1 << i; TestAllTypes message = TestAllTypes.newBuilder().setOptionalInt32(value).build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getOptionalInt32()).isEqualTo(value); + assertEquals(value, parsed.getOptionalInt32()); } for (int i = 0; i < 64; i++) { final long value = 1L << i; TestAllTypes message = TestAllTypes.newBuilder().setOptionalInt64(value).build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getOptionalInt64()).isEqualTo(value); + assertEquals(value, parsed.getOptionalInt64()); } } - @Test public void testParseEmptyUnknownLengthDelimitedField() throws Exception { byte[] data = new byte[] {(byte) WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED), 0}; TestAllTypes parsed = TestAllTypes.parseFrom(data); - assertThat(parsed.toByteArray()).isEqualTo(data); + assertTrue(Arrays.equals(data, parsed.toByteArray())); } - @Test public void testParseEmptyString() throws Exception { TestAllTypes message = TestAllTypes.newBuilder().setOptionalString("").build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getOptionalString()).isEmpty(); + assertEquals("", parsed.getOptionalString()); } - @Test public void testParseEmptyStringProto3() throws Exception { TestAllTypes message = TestAllTypes.newBuilder().setOptionalString("").build(); // Note that we are parsing from a proto2 proto to a proto3 proto because empty string field is // not serialized in proto3. UnittestProto3.TestAllTypes parsed = UnittestProto3.TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getOptionalString()).isEmpty(); + assertEquals("", parsed.getOptionalString()); } - @Test public void testParseEmptyBytes() throws Exception { TestAllTypes message = TestAllTypes.newBuilder().setOptionalBytes(ByteString.EMPTY).build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getOptionalBytes()).isEqualTo(ByteString.EMPTY); + assertEquals(ByteString.EMPTY, parsed.getOptionalBytes()); } - @Test public void testParseEmptyRepeatedStringField() throws Exception { TestAllTypes message = TestAllTypes.newBuilder() @@ -848,13 +824,12 @@ public class WireFormatLiteTest { .addRepeatedString("0") .build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getRepeatedStringCount()).isEqualTo(3); - assertThat(parsed.getRepeatedString(0)).isEmpty(); - assertThat(parsed.getRepeatedString(1)).isEmpty(); - assertThat(parsed.getRepeatedString(2)).isEqualTo("0"); + assertEquals(3, parsed.getRepeatedStringCount()); + assertEquals("", parsed.getRepeatedString(0)); + assertEquals("", parsed.getRepeatedString(1)); + assertEquals("0", parsed.getRepeatedString(2)); } - @Test public void testParseEmptyRepeatedStringFieldProto3() throws Exception { TestAllTypes message = TestAllTypes.newBuilder() @@ -865,13 +840,12 @@ public class WireFormatLiteTest { .build(); UnittestProto3.TestAllTypes parsed = UnittestProto3.TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getRepeatedStringCount()).isEqualTo(3); - assertThat(parsed.getRepeatedString(0)).isEmpty(); - assertThat(parsed.getRepeatedString(1)).isEmpty(); - assertThat(parsed.getRepeatedString(2)).isEqualTo("0"); + assertEquals(3, parsed.getRepeatedStringCount()); + assertEquals("", parsed.getRepeatedString(0)); + assertEquals("", parsed.getRepeatedString(1)); + assertEquals("0", parsed.getRepeatedString(2)); } - @Test public void testParseEmptyRepeatedBytesField() throws Exception { ByteString oneByte = ByteString.copyFrom(new byte[] {1}); TestAllTypes message = @@ -881,13 +855,12 @@ public class WireFormatLiteTest { .addRepeatedBytes(oneByte) .build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getRepeatedBytesCount()).isEqualTo(3); - assertThat(parsed.getRepeatedBytes(0)).isEqualTo(ByteString.EMPTY); - assertThat(parsed.getRepeatedBytes(1)).isEqualTo(ByteString.EMPTY); - assertThat(parsed.getRepeatedBytes(2)).isEqualTo(oneByte); + assertEquals(3, parsed.getRepeatedBytesCount()); + assertEquals(ByteString.EMPTY, parsed.getRepeatedBytes(0)); + assertEquals(ByteString.EMPTY, parsed.getRepeatedBytes(1)); + assertEquals(oneByte, parsed.getRepeatedBytes(2)); } - @Test public void testSkipUnknownFieldInMessageSetItem() throws Exception { ByteArrayOutputStream output = new ByteArrayOutputStream(); // MessageSet item's start tag. @@ -908,119 +881,109 @@ public class WireFormatLiteTest { // Convert to RawMessageSet for inspection. RawMessageSet raw = RawMessageSet.parseFrom(parsed.toByteArray()); - assertThat(raw.getItemCount()).isEqualTo(1); - assertThat(raw.getItem(0).getTypeId()).isEqualTo(100); - assertThat(raw.getItem(0).getMessage().size()).isEqualTo(0); + assertEquals(1, raw.getItemCount()); + assertEquals(100, raw.getItem(0).getTypeId()); + assertEquals(0, raw.getItem(0).getMessage().size()); } - @Test public void testProto2UnknownEnumValuesInOptionalField() throws Exception { // Proto2 doesn't allow setting unknown enum values so we use proto3 to build a message with // unknown enum values UnittestProto3.TestAllTypes message = UnittestProto3.TestAllTypes.newBuilder().setOptionalNestedEnumValue(4321).build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.hasOptionalNestedEnum()).isFalse(); + assertFalse(parsed.hasOptionalNestedEnum()); // Make sure unknown enum values are preserved. UnittestProto3.TestAllTypes actual = UnittestProto3.TestAllTypes.parseFrom(parsed.toByteArray()); - assertThat(actual.getOptionalNestedEnumValue()).isEqualTo(4321); + assertEquals(4321, actual.getOptionalNestedEnumValue()); } - @Test public void testProto2UnknownEnumValuesInRepeatedField() throws Exception { // Proto2 doesn't allow setting unknown enum values so we use proto3 to build a message with // unknown enum values UnittestProto3.TestAllTypes message = UnittestProto3.TestAllTypes.newBuilder().addRepeatedNestedEnumValue(5432).build(); TestAllTypes parsed = TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getRepeatedNestedEnumCount()).isEqualTo(0); + assertEquals(0, parsed.getRepeatedNestedEnumCount()); // Make sure unknown enum values are preserved. UnittestProto3.TestAllTypes actual = UnittestProto3.TestAllTypes.parseFrom(parsed.toByteArray()); - assertThat(actual.getRepeatedNestedEnumCount()).isEqualTo(1); - assertThat(actual.getRepeatedNestedEnumValue(0)).isEqualTo(5432); + assertEquals(1, actual.getRepeatedNestedEnumCount()); + assertEquals(5432, actual.getRepeatedNestedEnumValue(0)); } - @Test public void testProto2UnknownEnumValuesInMapField() throws Exception { // Proto2 doesn't allow setting unknown enum values so we use proto3 to build a message with // unknown enum values TestMap message = TestMap.newBuilder().putInt32ToEnumFieldValue(1, 4321).build(); MapForProto2TestProto.TestMap parsed = MapForProto2TestProto.TestMap.parseFrom(message.toByteArray()); - assertThat(parsed.getInt32ToEnumFieldMap()).isEmpty(); + assertEquals(0, parsed.getInt32ToEnumFieldMap().size()); // Make sure unknown enum values are preserved. TestMap actual = TestMap.parseFrom(parsed.toByteArray()); - assertThat(actual.getInt32ToEnumFieldMap()).hasSize(1); - assertThat(actual.getInt32ToEnumFieldValueOrThrow(1)).isEqualTo(4321); + assertEquals(1, actual.getInt32ToEnumFieldMap().size()); + assertEquals(4321, actual.getInt32ToEnumFieldValueOrThrow(1)); } - @Test public void testProto2UnknownEnumValuesInOneof() throws Exception { // Proto2 doesn't allow setting unknown enum values so we use proto3 to build a message with // unknown enum values UnittestProto3.TestOneof2 message = UnittestProto3.TestOneof2.newBuilder().setFooEnumValue(1234).build(); TestOneof2 parsed = TestOneof2.parseFrom(message.toByteArray()); - assertThat(parsed.hasFooEnum()).isFalse(); + assertFalse(parsed.hasFooEnum()); // Make sure unknown enum values are preserved. UnittestProto3.TestOneof2 actual = UnittestProto3.TestOneof2.parseFrom(parsed.toByteArray()); - assertThat(actual.getFooEnumValue()).isEqualTo(1234); + assertEquals(1234, actual.getFooEnumValue()); } - @Test public void testProto2UnknownEnumValuesInExtension() throws Exception { ExtensionRegistryLite extensionRegistry = TestUtilLite.getExtensionRegistryLite(); // Raw bytes for "[.optional_foreign_enum_extension_lite]: 10" final byte[] rawBytes = new byte[]{-80, 1, 10}; TestAllExtensionsLite testAllExtensionsLite = TestAllExtensionsLite.parseFrom(rawBytes, extensionRegistry); - assertThat(testAllExtensionsLite.getExtension(optionalForeignEnumExtensionLite)) - .isEqualTo(ForeignEnumLite.FOREIGN_LITE_FOO); + assertEquals(ForeignEnumLite.FOREIGN_LITE_FOO, + testAllExtensionsLite.getExtension(optionalForeignEnumExtensionLite)); final byte[] resultRawBytes = testAllExtensionsLite.toByteArray(); - assertThat(resultRawBytes).hasLength(rawBytes.length); + assertEquals(rawBytes.length, resultRawBytes.length); for (int i = 0; i < rawBytes.length; i++) { - assertThat(resultRawBytes[i]).isEqualTo(rawBytes[i]); + assertEquals(rawBytes[i], resultRawBytes[i]); } } - @Test public void testProto3UnknownEnumValuesInOptionalField() throws Exception { UnittestProto3.TestAllTypes message = UnittestProto3.TestAllTypes.newBuilder().setOptionalNestedEnumValue(4321).build(); UnittestProto3.TestAllTypes parsed = UnittestProto3.TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getOptionalNestedEnumValue()).isEqualTo(4321); + assertEquals(4321, parsed.getOptionalNestedEnumValue()); } - @Test public void testProto3UnknownEnumValuesInRepeatedField() throws Exception { UnittestProto3.TestAllTypes message = UnittestProto3.TestAllTypes.newBuilder().addRepeatedNestedEnumValue(5432).build(); UnittestProto3.TestAllTypes parsed = UnittestProto3.TestAllTypes.parseFrom(message.toByteArray()); - assertThat(parsed.getRepeatedNestedEnumCount()).isEqualTo(1); - assertThat(parsed.getRepeatedNestedEnumValue(0)).isEqualTo(5432); + assertEquals(1, parsed.getRepeatedNestedEnumCount()); + assertEquals(5432, parsed.getRepeatedNestedEnumValue(0)); } - @Test public void testProto3UnknownEnumValuesInMapField() throws Exception { TestMap message = TestMap.newBuilder().putInt32ToEnumFieldValue(1, 4321).build(); TestMap parsed = TestMap.parseFrom(message.toByteArray()); - assertThat(parsed.getInt32ToEnumFieldMap()).hasSize(1); - assertThat(parsed.getInt32ToEnumFieldValueOrThrow(1)).isEqualTo(4321); + assertEquals(1, parsed.getInt32ToEnumFieldMap().size()); + assertEquals(4321, parsed.getInt32ToEnumFieldValueOrThrow(1)); } - @Test public void testProto3UnknownEnumValuesInOneof() throws Exception { UnittestProto3.TestOneof2 message = UnittestProto3.TestOneof2.newBuilder().setFooEnumValue(1234).build(); UnittestProto3.TestOneof2 parsed = UnittestProto3.TestOneof2.parseFrom(message.toByteArray()); - assertThat(parsed.getFooEnumValue()).isEqualTo(1234); + assertEquals(1234, parsed.getFooEnumValue()); } - @Test public void testProto3MessageFieldMergeBehavior() throws Exception { UnittestProto3.NestedTestAllTypes message1 = UnittestProto3.NestedTestAllTypes.newBuilder() @@ -1043,13 +1006,12 @@ public class WireFormatLiteTest { .mergeFrom(message2.toByteArray()) .build(); // Field values coming later in the stream override earlier values. - assertThat(merged.getPayload().getOptionalInt32()).isEqualTo(4321); + assertEquals(4321, merged.getPayload().getOptionalInt32()); // Field values present in either message should be present in the merged result. - assertThat(merged.getPayload().getOptionalInt64()).isEqualTo(5678); - assertThat(merged.getPayload().getOptionalUint32()).isEqualTo(8765); + assertEquals(5678, merged.getPayload().getOptionalInt64()); + assertEquals(8765, merged.getPayload().getOptionalUint32()); } - @Test public void testMergeFromPartialByteArray() throws Exception { byte[] data = TestUtil.getAllSet().toByteArray(); byte[] dataWithPaddings = new byte[data.length + 2]; diff --git a/java/core/src/test/java/com/google/protobuf/WireFormatTest.java b/java/core/src/test/java/com/google/protobuf/WireFormatTest.java index 020409e9cfed264373037745ccf5ef36716bb79a..45a396acd8e77619d9169b73f5c154b511775842 100644 --- a/java/core/src/test/java/com/google/protobuf/WireFormatTest.java +++ b/java/core/src/test/java/com/google/protobuf/WireFormatTest.java @@ -1,14 +1,35 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import protobuf_unittest.UnittestMset.RawMessageSet; import protobuf_unittest.UnittestMset.TestMessageSetExtension1; import protobuf_unittest.UnittestMset.TestMessageSetExtension2; @@ -25,13 +46,14 @@ import proto2_wireformat_unittest.UnittestMsetWireFormat.TestMessageSet; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -/** Tests related to parsing and serialization. */ -@RunWith(JUnit4.class) -public class WireFormatTest { +/** + * Tests related to parsing and serialization. + * + * @author kenton@google.com (Kenton Varda) + */ +public class WireFormatTest extends TestCase { private static final int TYPE_ID_1 = TestMessageSetExtension1.getDescriptor().getExtensions().get(0).getNumber(); @@ -39,31 +61,28 @@ public class WireFormatTest { TestMessageSetExtension2.getDescriptor().getExtensions().get(0).getNumber(); private static final int UNKNOWN_TYPE_ID = 1550055; - @Test public void testSerialization() throws Exception { TestAllTypes message = TestUtil.getAllSet(); ByteString rawBytes = message.toByteString(); - assertThat(rawBytes.size()).isEqualTo(message.getSerializedSize()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); TestUtil.assertAllFieldsSet(message2); } - @Test public void testSerializationPacked() throws Exception { TestPackedTypes message = TestUtil.getPackedSet(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestPackedTypes message2 = TestPackedTypes.parseFrom(rawBytes); TestUtil.assertPackedFieldsSet(message2); } - @Test public void testSerializeExtensions() throws Exception { // TestAllTypes and TestAllExtensions should have compatible wire formats, // so if we serialize a TestAllExtensions then parse it as TestAllTypes @@ -71,14 +90,13 @@ public class WireFormatTest { TestAllExtensions message = TestUtil.getAllExtensionsSet(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes); TestUtil.assertAllFieldsSet(message2); } - @Test public void testSerializePackedExtensions() throws Exception { // TestPackedTypes and TestPackedExtensions should have compatible wire // formats; check that they serialize to the same string. @@ -88,10 +106,9 @@ public class WireFormatTest { TestPackedTypes message2 = TestUtil.getPackedSet(); ByteString rawBytes2 = message2.toByteString(); - assertThat(rawBytes).isEqualTo(rawBytes2); + assertEquals(rawBytes, rawBytes2); } - @Test public void testSerializationPackedWithoutGetSerializedSize() throws Exception { // Write directly to an OutputStream, without invoking getSerializedSize() // This used to be a bug where the size of a packed field was incorrect, @@ -112,7 +129,6 @@ public class WireFormatTest { TestUtil.assertPackedFieldsSet(message2); } - @Test public void testParseExtensions() throws Exception { // TestAllTypes and TestAllExtensions should have compatible wire formats, // so if we serialize a TestAllTypes then parse it as TestAllExtensions @@ -128,7 +144,6 @@ public class WireFormatTest { TestUtil.assertAllExtensionsSet(message2); } - @Test public void testParsePackedExtensions() throws Exception { // Ensure that packed extensions can be properly parsed. TestPackedExtensions message = TestUtil.getPackedExtensionsSet(); @@ -141,7 +156,6 @@ public class WireFormatTest { TestUtil.assertPackedExtensionsSet(message2); } - @Test public void testSerializeDelimited() throws Exception { ByteArrayOutputStream output = new ByteArrayOutputStream(); TestUtil.getAllSet().writeDelimitedTo(output); @@ -152,13 +166,13 @@ public class WireFormatTest { ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray()); TestUtil.assertAllFieldsSet(TestAllTypes.parseDelimitedFrom(input)); - assertThat(input.read()).isEqualTo(12); + assertEquals(12, input.read()); TestUtil.assertPackedFieldsSet(TestPackedTypes.parseDelimitedFrom(input)); - assertThat(input.read()).isEqualTo(34); - assertThat(input.read()).isEqualTo(-1); + assertEquals(34, input.read()); + assertEquals(-1, input.read()); // We're at EOF, so parsing again should return null. - assertThat(TestAllTypes.parseDelimitedFrom(input)).isNull(); + assertTrue(TestAllTypes.parseDelimitedFrom(input) == null); } private void assertFieldsInOrder(ByteString data) throws Exception { @@ -171,13 +185,12 @@ public class WireFormatTest { break; } - assertThat(tag).isGreaterThan(previousTag); + assertTrue(tag > previousTag); previousTag = tag; input.skipField(tag); } } - @Test public void testInterleavedFieldsAndExtensions() throws Exception { // Tests that fields are written in order even when extension ranges // are interleaved with field numbers. @@ -212,7 +225,6 @@ public class WireFormatTest { return result; } - @Test public void testParseMultipleExtensionRanges() throws Exception { // Make sure we can parse a message that contains multiple extensions // ranges. @@ -226,7 +238,7 @@ public class WireFormatTest { .build(); TestFieldOrderings dest = TestFieldOrderings.parseFrom(source.toByteString(), getTestFieldOrderingsRegistry()); - assertThat(source).isEqualTo(dest); + assertEquals(source, dest); } private static ExtensionRegistry getTestExtensionInsideTableRegistry() { @@ -235,7 +247,6 @@ public class WireFormatTest { return result; } - @Test public void testExtensionInsideTable() throws Exception { // Make sure the extension within the range of table is parsed correctly in experimental // runtime. @@ -247,10 +258,9 @@ public class WireFormatTest { TestExtensionInsideTable dest = TestExtensionInsideTable.parseFrom( source.toByteString(), getTestExtensionInsideTableRegistry()); - assertThat(source).isEqualTo(dest); + assertEquals(source, dest); } - @Test public void testParseMultipleExtensionRangesDynamic() throws Exception { // Same as above except with DynamicMessage. Descriptors.Descriptor descriptor = TestFieldOrderings.getDescriptor(); @@ -265,15 +275,13 @@ public class WireFormatTest { DynamicMessage dest = DynamicMessage.parseFrom( descriptor, source.toByteString(), getTestFieldOrderingsRegistry()); - assertThat(source).isEqualTo(dest); + assertEquals(source, dest); } - @Test public void testSerializeMessageSetEagerly() throws Exception { testSerializeMessageSetWithFlag(true); } - @Test public void testSerializeMessageSetNotEagerly() throws Exception { testSerializeMessageSetWithFlag(false); } @@ -304,30 +312,28 @@ public class WireFormatTest { // Parse back using RawMessageSet and check the contents. RawMessageSet raw = RawMessageSet.parseFrom(data); - assertThat(raw.getUnknownFields().asMap()).isEmpty(); + assertTrue(raw.getUnknownFields().asMap().isEmpty()); - assertThat(raw.getItemCount()).isEqualTo(3); - assertThat(raw.getItem(0).getTypeId()).isEqualTo(TYPE_ID_1); - assertThat(raw.getItem(1).getTypeId()).isEqualTo(TYPE_ID_2); - assertThat(raw.getItem(2).getTypeId()).isEqualTo(UNKNOWN_TYPE_ID); + assertEquals(3, raw.getItemCount()); + assertEquals(TYPE_ID_1, raw.getItem(0).getTypeId()); + assertEquals(TYPE_ID_2, raw.getItem(1).getTypeId()); + assertEquals(UNKNOWN_TYPE_ID, raw.getItem(2).getTypeId()); TestMessageSetExtension1 message1 = TestMessageSetExtension1.parseFrom(raw.getItem(0).getMessage()); - assertThat(message1.getI()).isEqualTo(123); + assertEquals(123, message1.getI()); TestMessageSetExtension2 message2 = TestMessageSetExtension2.parseFrom(raw.getItem(1).getMessage()); - assertThat(message2.getStr()).isEqualTo("foo"); + assertEquals("foo", message2.getStr()); - assertThat(raw.getItem(2).getMessage().toStringUtf8()).isEqualTo("bar"); + assertEquals("bar", raw.getItem(2).getMessage().toStringUtf8()); } - @Test public void testParseMessageSetEagerly() throws Exception { testParseMessageSetWithFlag(true); } - @Test public void testParseMessageSetNotEagerly() throws Exception { testParseMessageSetWithFlag(false); } @@ -365,28 +371,25 @@ public class WireFormatTest { // Parse as a TestMessageSet and check the contents. TestMessageSet messageSet = TestMessageSet.parseFrom(data, extensionRegistry); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); - assertThat(messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()) - .isEqualTo("foo"); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); + assertEquals( + "foo", messageSet.getExtension(TestMessageSetExtension2.messageSetExtension).getStr()); // Check for unknown field with type LENGTH_DELIMITED, // number UNKNOWN_TYPE_ID, and contents "bar". UnknownFieldSet unknownFields = messageSet.getUnknownFields(); - assertThat(unknownFields.asMap()).hasSize(1); - assertThat(unknownFields.hasField(UNKNOWN_TYPE_ID)).isTrue(); + assertEquals(1, unknownFields.asMap().size()); + assertTrue(unknownFields.hasField(UNKNOWN_TYPE_ID)); UnknownFieldSet.Field field = unknownFields.getField(UNKNOWN_TYPE_ID); - assertThat(field.getLengthDelimitedList()).hasSize(1); - assertThat(field.getLengthDelimitedList().get(0).toStringUtf8()).isEqualTo("bar"); + assertEquals(1, field.getLengthDelimitedList().size()); + assertEquals("bar", field.getLengthDelimitedList().get(0).toStringUtf8()); } - @Test public void testParseMessageSetExtensionEagerly() throws Exception { testParseMessageSetExtensionWithFlag(true); } - @Test public void testParseMessageSetExtensionNotEagerly() throws Exception { testParseMessageSetExtensionWithFlag(false); } @@ -411,16 +414,13 @@ public class WireFormatTest { // Parse as a TestMessageSet and check the contents. TestMessageSet messageSet = TestMessageSet.parseFrom(data, extensionRegistry); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); } - @Test public void testMergeLazyMessageSetExtensionEagerly() throws Exception { testMergeLazyMessageSetExtensionWithFlag(true); } - @Test public void testMergeLazyMessageSetExtensionNotEagerly() throws Exception { testMergeLazyMessageSetExtensionWithFlag(false); } @@ -447,16 +447,13 @@ public class WireFormatTest { TestMessageSet messageSet = TestMessageSet.parseFrom(data, extensionRegistry); // Merge lazy field check the contents. messageSet = messageSet.toBuilder().mergeFrom(data, extensionRegistry).build(); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); } - @Test public void testMergeMessageSetExtensionEagerly() throws Exception { testMergeMessageSetExtensionWithFlag(true); } - @Test public void testMergeMessageSetExtensionNotEagerly() throws Exception { testMergeMessageSetExtensionWithFlag(false); } @@ -493,33 +490,30 @@ public class WireFormatTest { // Merge bytes into TestMessageSet and check the contents. TestMessageSet messageSet = TestMessageSet.newBuilder().mergeFrom(data, extensionRegistry).build(); - assertThat(messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()) - .isEqualTo(123); + assertEquals(123, messageSet.getExtension(TestMessageSetExtension1.messageSetExtension).getI()); } // ================================================================ // oneof - @Test public void testOneofWireFormat() throws Exception { TestOneof2.Builder builder = TestOneof2.newBuilder(); TestUtil.setOneof(builder); TestOneof2 message = builder.build(); ByteString rawBytes = message.toByteString(); - assertThat(message.getSerializedSize()).isEqualTo(rawBytes.size()); + assertEquals(rawBytes.size(), message.getSerializedSize()); TestOneof2 message2 = TestOneof2.parseFrom(rawBytes); TestUtil.assertOneofSet(message2); } - @Test public void testOneofOnlyLastSet() throws Exception { TestOneofBackwardsCompatible source = TestOneofBackwardsCompatible.newBuilder().setFooInt(100).setFooString("101").build(); ByteString rawBytes = source.toByteString(); TestOneof2 message = TestOneof2.parseFrom(rawBytes); - assertThat(message.hasFooInt()).isFalse(); - assertThat(message.hasFooString()).isTrue(); + assertFalse(message.hasFooInt()); + assertTrue(message.hasFooString()); } } diff --git a/java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java b/java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java index 1b61a0996e56b2b6984d8f7e28bbcb9327dbbdf5..4a3c7647f10480d12a2cffe65670d9176b8c3ebd 100644 --- a/java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java +++ b/java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java @@ -1,23 +1,40 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import com.google.protobuf.wrapperstest.WrappersTestProto.TopLevelMessage; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -@RunWith(JUnit4.class) -public class WrappersLiteOfMethodTest { +public class WrappersLiteOfMethodTest extends TestCase { - @Test public void testOf() throws Exception { TopLevelMessage.Builder builder = TopLevelMessage.newBuilder(); builder.setFieldDouble(DoubleValue.of(2.333)); @@ -31,14 +48,14 @@ public class WrappersLiteOfMethodTest { builder.setFieldBytes(BytesValue.of(ByteString.wrap("233".getBytes(Internal.UTF_8)))); TopLevelMessage message = builder.build(); - assertThat(message.getFieldDouble().getValue()).isEqualTo(2.333); - assertThat(message.getFieldFloat().getValue()).isEqualTo(2.333F); - assertThat(message.getFieldInt32().getValue()).isEqualTo(2333); - assertThat(message.getFieldInt64().getValue()).isEqualTo(23333333333333L); - assertThat(message.getFieldUint32().getValue()).isEqualTo(2333); - assertThat(message.getFieldUint64().getValue()).isEqualTo(23333333333333L); - assertThat(true).isSameInstanceAs(message.getFieldBool().getValue()); - assertThat(message.getFieldString().getValue().equals("23333")).isTrue(); - assertThat(message.getFieldBytes().getValue().toStringUtf8().equals("233")).isTrue(); + assertTrue(2.333 == message.getFieldDouble().getValue()); + assertTrue(2.333f == message.getFieldFloat().getValue()); + assertTrue(2333 == message.getFieldInt32().getValue()); + assertTrue(23333333333333L == message.getFieldInt64().getValue()); + assertTrue(2333 == message.getFieldUint32().getValue()); + assertTrue(23333333333333L == message.getFieldUint64().getValue()); + assertTrue(true == message.getFieldBool().getValue()); + assertTrue(message.getFieldString().getValue().equals("23333")); + assertTrue(message.getFieldBytes().getValue().toStringUtf8().equals("233")); } } diff --git a/java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java b/java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java index 631bae991c4d77d290acd0ebf76f716e9ce42ead..f0d662d0c618bd7d876bd5c96b0c88a8a8a9d1dc 100644 --- a/java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java +++ b/java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java @@ -1,23 +1,40 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.protobuf; -import static com.google.common.truth.Truth.assertThat; - import com.google.protobuf.wrapperstest.WrappersTestProto.TopLevelMessage; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import junit.framework.TestCase; -@RunWith(JUnit4.class) -public class WrappersOfMethodTest { +public class WrappersOfMethodTest extends TestCase { - @Test public void testOf() throws Exception { TopLevelMessage.Builder builder = TopLevelMessage.newBuilder(); builder.setFieldDouble(DoubleValue.of(2.333)); @@ -31,14 +48,14 @@ public class WrappersOfMethodTest { builder.setFieldBytes(BytesValue.of(ByteString.wrap("233".getBytes(Internal.UTF_8)))); TopLevelMessage message = builder.build(); - assertThat(message.getFieldDouble().getValue()).isEqualTo(2.333); - assertThat(message.getFieldFloat().getValue()).isEqualTo(2.333F); - assertThat(message.getFieldInt32().getValue()).isEqualTo(2333); - assertThat(message.getFieldInt64().getValue()).isEqualTo(23333333333333L); - assertThat(message.getFieldUint32().getValue()).isEqualTo(2333); - assertThat(message.getFieldUint64().getValue()).isEqualTo(23333333333333L); - assertThat(true).isSameInstanceAs(message.getFieldBool().getValue()); - assertThat(message.getFieldString().getValue().equals("23333")).isTrue(); - assertThat(message.getFieldBytes().getValue().toStringUtf8().equals("233")).isTrue(); + assertTrue(2.333 == message.getFieldDouble().getValue()); + assertTrue(2.333f == message.getFieldFloat().getValue()); + assertTrue(2333 == message.getFieldInt32().getValue()); + assertTrue(23333333333333L == message.getFieldInt64().getValue()); + assertTrue(2333 == message.getFieldUint32().getValue()); + assertTrue(23333333333333L == message.getFieldUint64().getValue()); + assertTrue(true == message.getFieldBool().getValue()); + assertTrue(message.getFieldString().getValue().equals("23333")); + assertTrue(message.getFieldBytes().getValue().toStringUtf8().equals("233")); } } diff --git a/java/core/src/test/proto/com/google/protobuf/any_test.proto b/java/core/src/test/proto/com/google/protobuf/any_test.proto index d180f710f754eaf85f435c1d9238c4cc85b2f84b..99d52b75c8102bc74451ec751e7c71baa327fbc0 100644 --- a/java/core/src/test/proto/com/google/protobuf/any_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/any_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; diff --git a/java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto b/java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto index bcb219e294bcea9d7e02e4d3d9f1f6d593b1c58c..9579a0a5057db5c2303b3b533cc69ddc2dd0a095 100644 --- a/java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // A regression test for b/74087933 syntax = "proto2"; diff --git a/java/core/src/test/proto/com/google/protobuf/deprecated_file.proto b/java/core/src/test/proto/com/google/protobuf/deprecated_file.proto index 52904fac817c9846fe64d8bd07c3c592f226b95c..ca90e927cde318e95e25d2a352ad3cf116c4c6d4 100644 --- a/java/core/src/test/proto/com/google/protobuf/deprecated_file.proto +++ b/java/core/src/test/proto/com/google/protobuf/deprecated_file.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; @@ -11,5 +34,5 @@ package deprecated_file; option deprecated = true; -// TODO : Add deprecation options on messages, enums fields as well and +// TODO (liujisi): Add deprecation options on messages, enums fields as well and // add tests to verify those annotations are actually generated. diff --git a/java/core/src/test/proto/com/google/protobuf/dynamic_message_test.proto b/java/core/src/test/proto/com/google/protobuf/dynamic_message_test.proto deleted file mode 100644 index 170e6b5bee2c7c1dc8065d9b6656cdd2f35009d1..0000000000000000000000000000000000000000 --- a/java/core/src/test/proto/com/google/protobuf/dynamic_message_test.proto +++ /dev/null @@ -1,19 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto2"; - -package dynamic_message_test; - -option java_package = "dynamicmessagetest"; -option java_outer_classname = "DynamicMessageTestProto"; - -message EmptyMessage {} - -message MessageWithMapFields { - map string_message_map = 1; -} diff --git a/java/core/src/test/proto/com/google/protobuf/field_presence_test.proto b/java/core/src/test/proto/com/google/protobuf/field_presence_test.proto index 638ffc1d7ee1ced8824ed9852b4bf47a653a3966..28f3658354c3a696ac8913da343bad2404df30e7 100644 --- a/java/core/src/test/proto/com/google/protobuf/field_presence_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/field_presence_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; diff --git a/java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto b/java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto index acd28cd3c22f49d0c2fe81cf40714d25185a39dc..736a344f14859804e0ae1333c5b4c3ced2266081 100644 --- a/java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto +++ b/java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Naoki Iwasaki (niwasaki@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto b/java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto index 3dabb163329643c982a3343682f738da13271b0e..080c5192ba21e47dcb3c9b247c8b209cc43cf730 100644 --- a/java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto +++ b/java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: pbogle@google.com (Phil Bogle) diff --git a/java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto b/java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto index fb5320d84cb366792968ee6202c5fa6f77cce9ff..4ec968819b566257043ce86ae99885e84e068091 100644 --- a/java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto @@ -1,17 +1,37 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; -package map_for_proto2_lite_test; option java_outer_classname = "MapForProto2TestProto"; -option optimize_for = LITE_RUNTIME; -option java_package = "map_lite_test"; message TestMap { message MessageValue { @@ -105,3 +125,6 @@ message ReservedAsMapFieldWithEnumValue { // null is not a 'reserved word' per se but as a literal needs similar care map null = 10; } +package map_for_proto2_lite_test; +option java_package = "map_lite_test"; +option optimize_for = LITE_RUNTIME; diff --git a/java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto b/java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto index 90d17cf51624fd4d95f2c95a0de44f066d963a0c..f73bd6375b3be181d8070f4adc98d6d65e098742 100644 --- a/java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; diff --git a/java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto b/java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto index b816d94ea58423be6c7ca7bd6a528d9de725dc8e..ab99e5f006d5329dcab2c8ad1db273b778f01f35 100644 --- a/java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Regression test for a map initialization order bug. The bug only manifests // when: diff --git a/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto b/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto index 8496257654b01b7cd07f548c1e17e8e981d72b34..7324653f81c59e0fa58ae056aff37de91790b7f2 100644 --- a/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; @@ -96,8 +119,3 @@ message ReservedAsMapFieldWithEnumValue { // null is not a 'reserved word' per se but as a literal needs similar care map null = 10; } - -// https://github.com/protocolbuffers/protobuf/issues/9785 -message MapContainer { - map my_map = 1; -} diff --git a/java/core/src/test/proto/com/google/protobuf/map_test.proto b/java/core/src/test/proto/com/google/protobuf/map_test.proto index f9d069bb744fa9217d290fe7d4e668d5be4f17af..240600f2def9d956bef3e2967f056c8131146af7 100644 --- a/java/core/src/test/proto/com/google/protobuf/map_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/map_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; @@ -95,8 +118,3 @@ message ReservedAsMapFieldWithEnumValue { // null is not a 'reserved word' per se but as a literal needs similar care map null = 10; } - -// https://github.com/protocolbuffers/protobuf/issues/9785 -message MapContainer { - map my_map = 1; -} diff --git a/java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto b/java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto index baadf061649f17793cfaf098366141cbe7cb570c..0de6f7b868bb5c794bc33ccfca2cf76e7aba8765 100644 --- a/java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // @@ -15,8 +38,8 @@ syntax = "proto2"; // See: http://go/proto2-generic-services-default package protobuf_unittest; -import "google/protobuf/descriptor.proto"; import "google/protobuf/unittest.proto"; +import "google/protobuf/descriptor.proto"; option java_generic_services = true; // auto-added option java_multiple_files = true; @@ -26,9 +49,7 @@ message MessageWithNoOuter { message NestedMessage { optional int32 i = 1; } - enum NestedEnum { - BAZ = 3; - } + enum NestedEnum { BAZ = 3; } optional NestedMessage nested = 1; repeated TestAllTypes foreign = 2; optional NestedEnum nested_enum = 3; diff --git a/java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto b/java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto index 04a50047bc92c520b865c3c6d3a162bce9baad38..07933ed4494940e49daf43f706dfe39170b032bd 100644 --- a/java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: jonp@google.com (Jon Perlow) // @@ -22,11 +45,6 @@ message Vehicle { message Engine { optional int32 cylinder = 1; optional int32 liters = 2; - optional TimingBelt timing_belt = 3; -} - -message TimingBelt { - optional int32 number_of_teeth = 1; } message Wheel { diff --git a/java/core/src/test/proto/com/google/protobuf/nested_extension.proto b/java/core/src/test/proto/com/google/protobuf/nested_extension.proto index ef7c56086f3e1e0dc9761bbfb00bc390e875147a..2da6d08e3acc2f194be51f226a3fda7fccc17efc 100644 --- a/java/core/src/test/proto/com/google/protobuf/nested_extension.proto +++ b/java/core/src/test/proto/com/google/protobuf/nested_extension.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Darick Tong (darick@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto b/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto index c409b1a3cfe2f2cb7818e57ae2de401a74d9809c..024097cb5eeb82578025b2a2390fe0965ed496ea 100644 --- a/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto +++ b/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Darick Tong (darick@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto b/java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto index 4ab97c81e4325cdf61fcaf2703380bad3028c344..45395a353a7ec38bfcf8d68fa0678f1c4e1a4a48 100644 --- a/java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto +++ b/java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Darick Tong (darick@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto b/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto index d5051a44008e8101025ab0a42b990bb5bc118f17..782a1e66d4b78d22631e6612172d03755cd1a8bf 100644 --- a/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto +++ b/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Darick Tong (darick@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto b/java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto index 3020616e16d69804251901472a4882e3bc7d7456..28b8bb568797ee78ffcb04f40e6ed022fe598693 100644 --- a/java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; diff --git a/java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto b/java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto index 032716793bc70430d77ca6817cc06e82d4e57611..b475510e745beedbc7db8972e53dd0d6c46d2b11 100644 --- a/java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto +++ b/java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; diff --git a/java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto b/java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto index f2229891626a6b3454fc9b146635e9f04399e3e7..e5ef2f0534ef7a6b184a54dd5c1d4a3b5113f84d 100644 --- a/java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto +++ b/java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; diff --git a/java/core/src/test/proto/com/google/protobuf/packed_field_test.proto b/java/core/src/test/proto/com/google/protobuf/packed_field_test.proto index b53b5e33b7431a4607af0b7338c684d8dfc8d0ab..7935322b72eef635ea2461817bef5a0ab43b3461 100644 --- a/java/core/src/test/proto/com/google/protobuf/packed_field_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/packed_field_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; diff --git a/java/core/src/test/proto/com/google/protobuf/proto2_message.proto b/java/core/src/test/proto/com/google/protobuf/proto2_message.proto index 7b3411ef2a988caaebdb8d593fcb363d896b621e..86c48b098636db0492c0bbee2d8fa0e8dcb8ee5f 100644 --- a/java/core/src/test/proto/com/google/protobuf/proto2_message.proto +++ b/java/core/src/test/proto/com/google/protobuf/proto2_message.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // LINT: ALLOW_GROUPS syntax = "proto2"; @@ -13,6 +36,7 @@ package protobuf.experimental; option java_package = "com.google.protobuf.testing"; option java_outer_classname = "Proto2Testing"; + message Proto2SpecialFieldName { optional double regular_name = 1; optional int32 cached_size = 2; diff --git a/java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto b/java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto index 14930bb0196281048f25995486a479067c37fc21..7dfd40eea34cde0e066bfcfd5421483683b4df1f 100644 --- a/java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto +++ b/java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // LINT: ALLOW_GROUPS syntax = "proto2"; @@ -13,6 +36,7 @@ package protobuf.experimental.lite; option java_package = "com.google.protobuf.testing"; option java_outer_classname = "Proto2TestingLite"; + message Proto2MessageLite { enum TestEnum { diff --git a/java/core/src/test/proto/com/google/protobuf/proto2_text_format_performance_test.proto b/java/core/src/test/proto/com/google/protobuf/proto2_text_format_performance_test.proto deleted file mode 100644 index bce621fb407debd72efeaa616f4dbdab6606d7cc..0000000000000000000000000000000000000000 --- a/java/core/src/test/proto/com/google/protobuf/proto2_text_format_performance_test.proto +++ /dev/null @@ -1,29 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto2"; - -package protobuf.testing.textformat.performance.proto2; - -option java_package = "com.google.protobuf.testing.textformat.performance.proto2"; -option java_outer_classname = "Proto2TextFormatPerformanceProto"; - -message ContainsSubMessageWithRepeatedInt32 { - optional RepeatedInt32 sub_msg = 1; -} - -message RepeatedInt32 { - repeated int32 value = 2; -} - -message ContainsExtensionSubMessage { - extensions 1 to max; -} - -extend ContainsExtensionSubMessage { - optional RepeatedInt32 sub_msg_ext = 1; -} diff --git a/java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto b/java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto index bb7d9596cb440ed9a1ccd99c329bbae0d6581d0b..5d470ac0e37fe34908f38a20f75e76a738b21d95 100644 --- a/java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto +++ b/java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; diff --git a/java/core/src/test/proto/com/google/protobuf/proto3_message.proto b/java/core/src/test/proto/com/google/protobuf/proto3_message.proto index 9b439c0ae270e9ac6e0b8dd52dea2c5f6d6e9817..bcf32e1965c144f88c2b964bbf7160be8530222c 100644 --- a/java/core/src/test/proto/com/google/protobuf/proto3_message.proto +++ b/java/core/src/test/proto/com/google/protobuf/proto3_message.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; diff --git a/java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto b/java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto index 09537cb1d4da059d597e12080388aa5d48c1487a..4a378b5bd3baa556a8cb47a593d7eb08befecf4e 100644 --- a/java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto +++ b/java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; diff --git a/java/core/src/test/proto/com/google/protobuf/proto3_text_format_performance_test.proto b/java/core/src/test/proto/com/google/protobuf/proto3_text_format_performance_test.proto deleted file mode 100644 index 5a837fc7e8f71a98a8da81edc9bec6fc99f08423..0000000000000000000000000000000000000000 --- a/java/core/src/test/proto/com/google/protobuf/proto3_text_format_performance_test.proto +++ /dev/null @@ -1,21 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto3"; - -package protobuf.testing.textformat.performance.proto3; - -option java_package = "com.google.protobuf.testing.textformat.performance.proto3"; -option java_outer_classname = "Proto3TextFormatPerformanceProto"; - -message ContainsSubMessageWithRepeatedInt32 { - optional RepeatedInt32 sub_msg = 1; -} - -message RepeatedInt32 { - repeated int32 value = 2; -} diff --git a/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto b/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto index f79521361d50c10451b0610a2744d2be2b30a722..8bf16914313e569114e3370dc10d200f354d96de 100644 --- a/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto +++ b/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto @@ -1,84 +1,52 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: jonp@google.com (Jon Perlow) // This file tests that various identifiers work as field and type names even // though the same identifiers are used internally by the java code generator. -// LINT: LEGACY_NAMES syntax = "proto2"; +// Some generic_services option(s) added automatically. +// See: http://go/proto2-generic-services-default package io_protocol_tests; option java_generic_services = true; // auto-added option java_package = "com.google.protobuf"; option java_outer_classname = "TestBadIdentifiersProto"; -// Message with field names using underscores that conflict with accessors in -// the base message class in java. See kForbiddenWordList in -// src/google/protobuf/compiler/java/java_helpers.cc -message ForbiddenWordsUnderscoreMessage { - // java.lang.Object - optional bool class = 1; - // com.google.protobuf.MessageLiteOrBuilder - optional bool default_instance_for_type = 2; - // com.google.protobuf.MessageLite - optional bool parser_for_type = 3; - optional bool serialized_size = 4; - // com.google.protobuf.MessageOrBuilder - optional bool all_fields = 5; - optional bool descriptor_for_type = 6; - optional bool initialization_error_string = 7; - optional bool unknown_fields = 8; - // obsolete. kept for backwards compatibility of generated code - optional bool cached_size = 9; -} - -// Message with field names using leading underscores that conflict with -// accessors in the base message class in java. See kForbiddenWordList in -// src/google/protobuf/compiler/java/java_helpers.cc -message ForbiddenWordsLeadingUnderscoreMessage { - // java.lang.Object - optional bool _class = 1; - // com.google.protobuf.MessageLiteOrBuilder - optional bool _default_instance_for_type = 2; - // com.google.protobuf.MessageLite - optional bool _parser_for_type = 3; - optional bool _serialized_size = 4; - // com.google.protobuf.MessageOrBuilder - optional bool _all_fields = 5; - optional bool _descriptor_for_type = 6; - optional bool _initialization_error_string = 7; - // TODO: re-enable - // optional bool _unknown_fields = 8; - // obsolete. kept for backwards compatibility of generated code - optional bool _cached_size = 9; -} - -// Message with field names in camel case that conflict with accessors in the -// base message class in java. See kForbiddenWordList in -// src/google/protobuf/compiler/java/java_helpers.cc -message ForbiddenWordsCamelMessage { - // java.lang.Object - optional bool class = 1; - // com.google.protobuf.MessageLiteOrBuilder - optional bool defaultInstanceForType = 2; - // com.google.protobuf.MessageLite - optional bool serializedSize = 3; - optional bool parserForType = 4; - // com.google.protobuf.MessageOrBuilder: - optional bool initializationErrorString = 5; - optional bool descriptorForType = 6; - optional bool allFields = 7; - // TODO: re-enable - // optional bool unknownFields = 8; - // obsolete. kept for backwards compatibility of generated code - optional bool cachedSize = 9; +message TestMessage { + optional string cached_size = 1; + optional string serialized_size = 2; + optional string class = 3; } message Descriptor { @@ -116,7 +84,7 @@ message Deprecated { optional int32 field1 = 1 [deprecated = true]; optional TestEnum field2 = 2 [deprecated = true]; - optional ForbiddenWordsUnderscoreMessage field3 = 3 [deprecated = true]; + optional TestMessage field3 = 3 [deprecated = true]; } message Override { @@ -149,36 +117,32 @@ message Double { } service TestConflictingMethodNames { - rpc Override(ForbiddenWordsUnderscoreMessage) - returns (ForbiddenWordsUnderscoreMessage); + rpc Override(TestMessage) returns (TestMessage); } message TestConflictingFieldNames { - // TODO Remove these tests once this behavior is removed. - option deprecated_legacy_json_field_conflicts = true; - enum TestEnum { UNKNOWN = 0; FOO = 1; } - message ForbiddenWordsUnderscoreMessage {} + message TestMessage {} repeated int32 int32_field = 1; repeated TestEnum enum_field = 2; repeated string string_field = 3; repeated bytes bytes_field = 4; - repeated ForbiddenWordsUnderscoreMessage message_field = 5; + repeated TestMessage message_field = 5; optional int32 int32_field_count = 11; optional TestEnum enum_field_count = 12; optional string string_field_count = 13; optional bytes bytes_field_count = 14; - optional ForbiddenWordsUnderscoreMessage message_field_count = 15; + optional TestMessage message_field_count = 15; - repeated int32 Int32Field = 21; // NO_PROTO3 - repeated TestEnum EnumField = 22; // NO_PROTO3 - repeated string StringField = 23; // NO_PROTO3 - repeated bytes BytesField = 24; // NO_PROTO3 - repeated ForbiddenWordsUnderscoreMessage MessageField = 25; // NO_PROTO3 + repeated int32 Int32Field = 21; // NO_PROTO3 + repeated TestEnum EnumField = 22; // NO_PROTO3 + repeated string StringField = 23; // NO_PROTO3 + repeated bytes BytesField = 24; // NO_PROTO3 + repeated TestMessage MessageField = 25; // NO_PROTO3 // This field conflicts with "int32_field" as they both generate // the method getInt32FieldList(). diff --git a/java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto b/java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto index 06e1af657f09f7603fd0b14747408724a68c99f4..119c1dcbada8708354f51d55b8945b7f5f45e68b 100644 --- a/java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto +++ b/java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Jacob Butcher (jbaum@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto b/java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto index 8e27a9b914328718555eff2047cf68db0a3bdef5..f06d76d629fac8dba4c935c40cfb0d3bc6b771dc 100644 --- a/java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto +++ b/java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Jacob Butcher (jbaum@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/test_custom_options.proto b/java/core/src/test/proto/com/google/protobuf/test_custom_options.proto index 40a93523d99641ce40d1587043b27a8672e86068..dde4ca5616b095001912bea8b395529a4e9ad083 100644 --- a/java/core/src/test/proto/com/google/protobuf/test_custom_options.proto +++ b/java/core/src/test/proto/com/google/protobuf/test_custom_options.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: Feng Xiao (xiaofeng@google.com) // diff --git a/java/core/src/test/proto/com/google/protobuf/wrappers_test.proto b/java/core/src/test/proto/com/google/protobuf/wrappers_test.proto index dd2cee4dae1aa291853a2cc286f518531678c809..60f49e08c7c55aafddf7e4ad9198105164a05744 100644 --- a/java/core/src/test/proto/com/google/protobuf/wrappers_test.proto +++ b/java/core/src/test/proto/com/google/protobuf/wrappers_test.proto @@ -1,9 +1,32 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ // -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; diff --git a/java/kotlin/BUILD.bazel b/java/kotlin/BUILD.bazel deleted file mode 100644 index 2d17a71d474cd3b9fa92a6bb568f84a6080e4830..0000000000000000000000000000000000000000 --- a/java/kotlin/BUILD.bazel +++ /dev/null @@ -1,352 +0,0 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") -load("@rules_java//java:defs.bzl", "java_proto_library") -load("@rules_jvm_external//:kt_defs.bzl", "kt_jvm_export") -load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") -load("@rules_proto//proto:defs.bzl", "proto_library") -load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") -load("//:protobuf.bzl", "internal_gen_kt_protos") - -exports_files([ - "src/test/kotlin/com/google/protobuf/Proto3Test.kt", -]) - -# Kotlin generated protos depend on this and only this. -kt_jvm_library( - name = "shared_runtime", - srcs = [ - "src/main/kotlin/com/google/protobuf/DslList.kt", - "src/main/kotlin/com/google/protobuf/DslMap.kt", - "src/main/kotlin/com/google/protobuf/DslProxy.kt", - "src/main/kotlin/com/google/protobuf/ExtensionList.kt", - "src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt", - "src/main/kotlin/com/google/protobuf/UnmodifiableCollections.kt", - ], - visibility = ["//visibility:public"], - deps = [ - ":only_for_use_in_proto_generated_code_its_generator_and_tests", - "//java/lite", - ], -) - -kt_jvm_library( - name = "only_for_use_in_proto_generated_code_its_generator_and_tests", - srcs = ["src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt"], - visibility = ["//java:__subpackages__"], -) - -kt_jvm_library( - name = "bytestring_lib", - srcs = ["src/main/kotlin/com/google/protobuf/ByteStrings.kt"], - visibility = ["//java:__subpackages__"], - deps = ["//java/lite"], -) - -kt_jvm_library( - name = "full_extensions", - srcs = [ - "src/main/kotlin/com/google/protobuf/Anies.kt", - "src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt", - ], - deps = ["//java/core"], -) - -kt_jvm_export( - name = "kotlin_mvn", - deploy_env = [ - "@com_github_jetbrains_kotlin//:kotlin-stdlib", - "//java/core", - ], - maven_coordinates = "com.google.protobuf:protobuf-kotlin:%s" % PROTOBUF_JAVA_VERSION, - pom_template = "//java/kotlin:pom_template.xml", - resources = [ - "//:well_known_type_protos", - "//src/google/protobuf:descriptor_proto_srcs", - ], - tags = ["manual"], - runtime_deps = [ - ":bytestring_lib", - ":full_extensions", - ":only_for_use_in_proto_generated_code_its_generator_and_tests", - ":shared_runtime", - ":well_known_protos_kotlin", - ], -) - -filegroup( - name = "release", - srcs = [ - ":kotlin_mvn-docs", - ":kotlin_mvn-maven-source", - ":kotlin_mvn-pom", - ":kotlin_mvn-project", - ], - visibility = ["//java:__pkg__"], -) - -test_suite( - name = "tests", - tests = [ - "bytestring_test", - "proto2_test", - "proto3_test", - "shared_tests", - "test_extensions", - ], -) - -kt_jvm_library( - name = "bytestring_test_library", - srcs = ["src/test/kotlin/com/google/protobuf/ByteStringsTest.kt"], - deps = [ - ":bytestring_lib", - "//java/lite", - "@com_github_jetbrains_kotlin//:kotlin-test", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - ], -) - -java_test( - name = "bytestring_test", - test_class = "com.google.protobuf.kotlin.ByteStringsTest", - runtime_deps = [":bytestring_test_library"], -) - -proto_library( - name = "example_extensible_message_proto", - srcs = ["src/test/proto/com/google/protobuf/example_extensible_message.proto"], - visibility = ["//java:__subpackages__"], -) - -java_proto_library( - name = "example_extensible_message_java_proto", - deps = [":example_extensible_message_proto"], -) - -kt_jvm_library( - name = "shared_tests_library", - srcs = [ - "src/test/kotlin/com/google/protobuf/DslListTest.kt", - "src/test/kotlin/com/google/protobuf/DslMapTest.kt", - "src/test/kotlin/com/google/protobuf/ExtensionListTest.kt", - ], - deps = [ - ":bytestring_lib", - ":example_extensible_message_java_proto", - ":only_for_use_in_proto_generated_code_its_generator_and_tests", - ":shared_runtime", - "@com_github_jetbrains_kotlin//:kotlin-test", - "@maven//:com_google_guava_guava_testlib", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - ], -) - -java_test( - name = "shared_tests", - test_class = "com.google.protobuf.kotlin.DslListTest", - runtime_deps = [":shared_tests_library"], -) - -kt_jvm_library( - name = "test_extensions_library", - srcs = [ - "src/test/kotlin/com/google/protobuf/AniesTest.kt", - "src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt", - ], - deps = [ - ":example_extensible_message_java_proto", - ":full_extensions", - ":kotlin_unittest", - ":only_for_use_in_proto_generated_code_its_generator_and_tests", - ":shared_runtime", - "//java/core", - "@com_github_jetbrains_kotlin//:kotlin-test", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - ], -) - -java_test( - name = "test_extensions", - test_class = "com.google.protobuf.kotlin.ExtendableMessageExtensionsTest", - runtime_deps = [":test_extensions_library"], -) - -proto_library( - name = "evil_names_proto2", - srcs = ["src/test/proto/com/google/protobuf/evil_names_proto2.proto"], - visibility = ["//:__subpackages__"], -) - -java_proto_library( - name = "evil_names_proto2_java_proto", - deps = [":evil_names_proto2"], -) - -internal_gen_kt_protos( - name = "gen_evil_names_proto2", - deps = [":evil_names_proto2"], -) - -proto_library( - name = "evil_names_proto3", - srcs = ["src/test/proto/com/google/protobuf/evil_names_proto3.proto"], - visibility = ["//:__subpackages__"], -) - -java_proto_library( - name = "evil_names_proto3_java_proto", - deps = [":evil_names_proto3"], -) - -internal_gen_kt_protos( - name = "gen_evil_names_proto3", - deps = [":evil_names_proto3"], -) - -proto_library( - name = "multiple_files_proto3", - srcs = ["src/test/proto/com/google/protobuf/multiple_files_proto3.proto"], - visibility = ["//:__subpackages__"], -) - -java_proto_library( - name = "multiple_files_proto3_java_proto", - deps = [":multiple_files_proto3"], -) - -internal_gen_kt_protos( - name = "gen_kotlin_proto3_java_multiple_files", - deps = [":multiple_files_proto3"], -) - -internal_gen_kt_protos( - name = "gen_kotlin_unittest", - visibility = ["//java:__subpackages__"], - deps = ["//src/google/protobuf:kt_unittest_protos"], -) - -kt_jvm_library( - name = "kotlin_unittest", - srcs = [ - ":gen_evil_names_proto2", - ":gen_kotlin_unittest", - ], - deps = [ - ":evil_names_proto2_java_proto", - ":only_for_use_in_proto_generated_code_its_generator_and_tests", - ":shared_runtime", - ":well_known_protos_kotlin", - "//java/core", - "//java/core:generic_test_protos_java_proto", - "//java/core:lite_test_protos_java_proto", - ], -) - -internal_gen_kt_protos( - name = "gen_kotlin_proto3_unittest", - deps = ["//src/google/protobuf:kt_proto3_unittest_protos"], -) - -kt_jvm_library( - name = "kotlin_proto3_unittest", - srcs = [ - ":gen_evil_names_proto3", - ":gen_kotlin_proto3_java_multiple_files", - ":gen_kotlin_proto3_unittest", - ], - deps = [ - ":evil_names_proto3_java_proto", - ":multiple_files_proto3_java_proto", - ":only_for_use_in_proto_generated_code_its_generator_and_tests", - ":shared_runtime", - "//java/core", - "//java/core:generic_test_protos_java_proto", - "//java/core:lite_test_protos_java_proto", - ], -) - -kt_jvm_library( - name = "proto2_test_library", - srcs = ["src/test/kotlin/com/google/protobuf/Proto2Test.kt"], - deps = [ - ":kotlin_unittest", - "//java/core:test_util", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - ], -) - -java_test( - name = "proto2_test", - test_class = "com.google.protobuf.kotlin.Proto2Test", - runtime_deps = [":proto2_test_library"], -) - -kt_jvm_library( - name = "proto3_test_library", - srcs = ["src/test/kotlin/com/google/protobuf/Proto3Test.kt"], - deps = [ - ":kotlin_proto3_unittest", - "//java/core:test_util", - "@maven//:com_google_truth_truth", - "@maven//:junit_junit", - ], -) - -java_test( - name = "proto3_test", - test_class = "com.google.protobuf.kotlin.Proto3Test", - runtime_deps = [":proto3_test_library"], -) - -internal_gen_kt_protos( - name = "gen_well_known_protos_kotlin", - visibility = [ - "//java:__subpackages__", - ], - deps = [ - "//:any_proto", - "//:api_proto", - "//:compiler_plugin_proto", - "//:descriptor_proto", - "//:duration_proto", - "//:empty_proto", - "//:field_mask_proto", - "//:source_context_proto", - "//:struct_proto", - "//:timestamp_proto", - "//:type_proto", - "//:wrappers_proto", - ], -) - -kt_jvm_library( - name = "well_known_protos_kotlin", - srcs = [ - ":gen_well_known_protos_kotlin", - ], - deps = [ - ":only_for_use_in_proto_generated_code_its_generator_and_tests", - ":shared_runtime", - "//java/core", - ], -) - -pkg_files( - name = "dist_files", - srcs = glob([ - "src/main/kotlin/com/google/protobuf/*.kt", - "src/test/kotlin/**/*.kt", - "src/test/proto/**/*.proto", - ]) + [ - "BUILD.bazel", - "generate-sources-build.xml", - "generate-test-sources-build.xml", - "pom.xml", - "pom_template.xml", - ], - strip_prefix = strip_prefix.from_root(""), - visibility = ["//java:__pkg__"], -) diff --git a/java/kotlin/generate-sources-build.xml b/java/kotlin/generate-sources-build.xml deleted file mode 100644 index 6963f3717f57692b1318c75d572f082b117acbb9..0000000000000000000000000000000000000000 --- a/java/kotlin/generate-sources-build.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/java/kotlin/generate-test-sources-build.xml b/java/kotlin/generate-test-sources-build.xml deleted file mode 100644 index dca1a05350e9f3ac4678024f8c47530ada567fa8..0000000000000000000000000000000000000000 --- a/java/kotlin/generate-test-sources-build.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/kotlin/pom.xml b/java/kotlin/pom.xml deleted file mode 100644 index 30f547c86b9c0ad3a6e4c6e1ea95c670852e29dd..0000000000000000000000000000000000000000 --- a/java/kotlin/pom.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - 4.0.0 - - com.google.protobuf - protobuf-parent - 3.25.2 - - - protobuf-kotlin - - Protocol Buffers [Kotlin-Core] - - Kotlin core Protocol Buffers library. Protocol Buffers are a way of encoding structured data in an - efficient yet extensible format. - - - - 1.6.0 - - - - - ${project.groupId} - protobuf-java - - - junit - junit - test - - - org.mockito - mockito-core - test - - - com.google.guava - guava - test - - - com.google.guava - guava-testlib - test - - - com.google.truth - truth - test - - - org.jetbrains.kotlin - kotlin-stdlib - ${kotlin.version} - - - org.jetbrains.kotlin - kotlin-test - ${kotlin.version} - test - - - - - - - ${protobuf.source.dir} - - google/protobuf/testdata/golden_message_oneof_implemented - google/protobuf/testdata/golden_packed_fields_message - - - - - - - maven-resources-plugin - 3.1.0 - - - copy-test-source-files - generate-test-sources - - copy-resources - - - ${generated.testsources.dir}/com/google/protobuf - - - ${basedir}/../core/src/test/java/com/google/protobuf - - TestUtil.java - TestUtilLite.java - - - - - - - - - - - maven-antrun-plugin - - - - generate-sources - generate-sources - - - - - - - run - - - - - - generate-test-sources - generate-test-sources - - - - - - - run - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-generated-sources - generate-sources - - add-source - - - - ${generated.sources.dir} - - - - - add-generated-test-sources - generate-test-sources - - add-test-source - - - - ${generated.testsources.dir} - - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - true - - - compile - compile - - - ${generated.sources.dir} - ${project.basedir}/src/main/kotlin - - - - - test-compile - test-compile - - - ${project.basedir}/src/test/kotlin - ${generated.testsources.dir} - - - - - - - - - diff --git a/java/kotlin/pom_template.xml b/java/kotlin/pom_template.xml deleted file mode 100644 index a66e44d52b2bf16b01f85b7c3dc0011061a05315..0000000000000000000000000000000000000000 --- a/java/kotlin/pom_template.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - - {groupId} - protobuf-parent - {version} - - - {artifactId} - {type} - - Protocol Buffers [Kotlin-Core] - - Kotlin core Protocol Buffers library. Protocol Buffers are a way of encoding structured data in an - efficient yet extensible format. - - - - {groupId} - protobuf-java - {version} - - - org.jetbrains.kotlin - kotlin-stdlib - ${kotlin.version} - - {dependencies} - - - - 1.6.0 - - - diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/Anies.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/Anies.kt deleted file mode 100644 index 14cce06dce1e4a7d896525c6ef404800f3ce15db..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/Anies.kt +++ /dev/null @@ -1,45 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.protobuf.Any as ProtoAny -import com.google.protobuf.Message - -/** Returns `true` if this [com.google.protobuf.Any] contains a message of type `T`. */ -inline fun ProtoAny.isA(): Boolean = this.`is`(T::class.java) - -/** - * Returns the message of type `T` encoded in this [com.google.protobuf.Any]. - * - * @throws InvalidProtocolBufferException if this [com.google.protobuf.Any] does not contain a `T` - * message. - */ -inline fun ProtoAny.unpack(): T = unpack(T::class.java) diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/ByteStrings.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/ByteStrings.kt deleted file mode 100644 index 8211d895c8a46e2e29b7888879aea6e4948fe57b..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/ByteStrings.kt +++ /dev/null @@ -1,53 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.protobuf.ByteString -import java.nio.ByteBuffer - -/** Encodes this String into a sequence of UTF-8 bytes and returns the result as a [ByteString]. */ -fun String.toByteStringUtf8(): ByteString = - ByteString.copyFromUtf8(this) // symmetric from ByteString.toStringUtf8() - -/** Concatenates the given [ByteString] to this one. */ -operator fun ByteString.plus(other: ByteString): ByteString = concat(other) - -/** Gets the byte at [index]. */ -operator fun ByteString.get(index: Int): Byte = byteAt(index) - -/** Checks if this is not empty. */ -fun ByteString.isNotEmpty(): Boolean = !isEmpty() - -/** Returns a copy of this [ByteArray] as an immutable [ByteString]. */ -fun ByteArray.toByteString(): ByteString = ByteString.copyFrom(this) - -/** Copies the remaining bytes from this [ByteBuffer] to a [ByteString]. */ -fun ByteBuffer.toByteString(): ByteString = ByteString.copyFrom(this) diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/DslList.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/DslList.kt deleted file mode 100644 index 1e144a15c3825171625d915730b67dc0c7564368..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/DslList.kt +++ /dev/null @@ -1,59 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -/** - * A simple wrapper around a [List] with an extra generic parameter that can be used to disambiguate - * extension methods. - * - *

      This class is used by Kotlin protocol buffer extensions, and its constructor is public only - * because generated message code is in a different compilation unit. Others should not use this - * class directly in any way. - */ -@Suppress("unused") // the unused type parameter -class DslList -@OnlyForUseByGeneratedProtoCode -constructor(private val delegate: List) : List by delegate { - override fun iterator(): Iterator = UnmodifiableIterator(delegate.iterator()) - - override fun listIterator(): ListIterator = UnmodifiableListIterator(delegate.listIterator()) - - override fun listIterator(index: Int): ListIterator = - UnmodifiableListIterator(delegate.listIterator(index)) - - override fun equals(other: Any?): Boolean = delegate == other - - override fun hashCode(): Int = delegate.hashCode() - - override fun toString(): String = delegate.toString() -} - -// TODO: investigate making this an inline class diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/DslMap.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/DslMap.kt deleted file mode 100644 index 5c46d9a6c4d9df75379e0f84a443013582b7f157..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/DslMap.kt +++ /dev/null @@ -1,64 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -/** - * A simple wrapper around a [Map] with an extra generic parameter that can be used to disambiguate - * extension methods. - * - *

      This class is used by Kotlin protocol buffer extensions, and its constructor is public only - * because generated message code is in a different compilation unit. Others should not use this - * class directly in any way. - */ -@Suppress("unused") // the unused type parameter -class DslMap -@OnlyForUseByGeneratedProtoCode -constructor(private val delegate: Map) : Map by delegate { - // We allocate the wrappers on calls to get, not with lazy {...}, because lazy allocates - // a few objects up front, and any kind of query operation on this object should be rare. - - override val entries: Set> - get() = UnmodifiableMapEntries(delegate.entries) - - override val keys: Set - get() = UnmodifiableSet(delegate.keys) - - override val values: Collection - get() = UnmodifiableCollection(delegate.values) - - override fun equals(other: Any?): Boolean = delegate == other - - override fun hashCode(): Int = delegate.hashCode() - - override fun toString(): String = delegate.toString() -} - -// TODO: investigate making this an inline class diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/DslProxy.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/DslProxy.kt deleted file mode 100644 index 403cc0430c0428de3a33f6d5b1eac67578e667a6..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/DslProxy.kt +++ /dev/null @@ -1,42 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -/** - * A type meaningful only for its existence, never intended to be instantiated. For example, a - * `DslList` can be given different extension methods than a `DslList`. - */ -abstract class DslProxy @OnlyForUseByGeneratedProtoCode protected constructor() { - init { - throw UnsupportedOperationException("A DslProxy should never be instantiated") - } -} diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtensionList.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/ExtensionList.kt deleted file mode 100644 index 206c19f1c30d747e97c0a16414e008bb354f2be9..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/ExtensionList.kt +++ /dev/null @@ -1,57 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.protobuf.ExtensionLite -import com.google.protobuf.MessageLite - -/** - * Implementation for ExtensionList and ExtensionListLite. Like [DslList], represents an - * unmodifiable view of a repeated proto field -- in this case, an extension field -- but supports - * querying the extension. - */ -class ExtensionList -@OnlyForUseByGeneratedProtoCode -constructor(val extension: ExtensionLite>, private val delegate: List) : - List by delegate { - override fun iterator(): Iterator = UnmodifiableIterator(delegate.iterator()) - - override fun listIterator(): ListIterator = UnmodifiableListIterator(delegate.listIterator()) - - override fun listIterator(index: Int): ListIterator = - UnmodifiableListIterator(delegate.listIterator(index)) - - override fun equals(other: Any?): Boolean = delegate == other - - override fun hashCode(): Int = delegate.hashCode() - - override fun toString(): String = delegate.toString() -} diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt deleted file mode 100644 index a1cb808b72ef892bd71364a6d5aa8d0e68886d7b..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt +++ /dev/null @@ -1,48 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -/** - * Opt-in annotation to make it difficult to accidentally use APIs only intended for use by proto - * generated code. See https://kotlinlang.org/docs/reference/opt-in-requirements.html for details on - * how this API works. - */ -@RequiresOptIn( - message = - """ - This API is only intended for use by generated protobuf code, the code generator, and their own - tests. If this does not describe your code, you should not be using this API. - """, - level = RequiresOptIn.Level.ERROR -) -@Retention(AnnotationRetention.BINARY) -@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.ANNOTATION_CLASS) -annotation class OnlyForUseByGeneratedProtoCode diff --git a/java/kotlin/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt b/java/kotlin/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt deleted file mode 100644 index 0c199ae3b1ffb6dffd7124185a20fdfa81ce2734..0000000000000000000000000000000000000000 --- a/java/kotlin/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt +++ /dev/null @@ -1,38 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -/** Indicates an API that is part of a DSL to generate protocol buffer messages. */ -@DslMarker -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.BINARY) -@OnlyForUseByGeneratedProtoCode -annotation class ProtoDslMarker diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/AniesTest.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/AniesTest.kt deleted file mode 100644 index 808c644a9026fa3a8563a3e7e70bde013f5be8fa..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/AniesTest.kt +++ /dev/null @@ -1,70 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.truth.Truth.assertThat -import com.google.protobuf.Any as ProtoAny -import com.google.protobuf.InvalidProtocolBufferException -import protobuf_unittest.UnittestProto.BoolMessage -import protobuf_unittest.UnittestProto.Int32Message -import protobuf_unittest.int32Message -import kotlin.test.assertFailsWith -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -/** Tests for extension methods on [ProtoAny]. */ -@RunWith(JUnit4::class) -class AniesTest { - companion object { - val anAny = ProtoAny.pack(int32Message { data = 5 }) - } - - @Test - fun isA_Positive() { - assertThat(anAny.isA()).isTrue() - } - - @Test - fun isA_Negative() { - assertThat(anAny.isA()).isFalse() - } - - @Test - fun unpackValid() { - assertThat(anAny.unpack().data).isEqualTo(5) - } - - @Test - fun unpackInvalid() { - assertFailsWith { anAny.unpack() } - } -} diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/ByteStringsTest.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/ByteStringsTest.kt deleted file mode 100644 index 9b8dbf50fcf0a6f69cce3cb424394c190dbbcaeb..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/ByteStringsTest.kt +++ /dev/null @@ -1,108 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.truth.Truth.assertThat -import com.google.protobuf.ByteString -import java.lang.IndexOutOfBoundsException -import java.nio.Buffer -import java.nio.ByteBuffer -import kotlin.test.assertFailsWith -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -/** Tests for the extension functions in ByteStrings.kt. */ -@RunWith(JUnit4::class) -class ByteStringsTest { - @Test - fun toByteStringUtf8() { - assertThat("abc".toByteStringUtf8()) - .isEqualTo(ByteString.copyFrom("abc".toByteArray(Charsets.UTF_8))) - } - - @Test - fun plus() { - assertThat("abc".toByteStringUtf8() + "def".toByteStringUtf8()) - .isEqualTo(ByteString.copyFrom("abcdef".toByteArray(Charsets.UTF_8))) - } - - @Test - fun byteAt() { - val str = "abc".toByteStringUtf8() - assertThat(str[0]).isEqualTo('a'.toByte()) - assertThat(str[2]).isEqualTo('c'.toByte()) - } - - @Test - fun isNotEmpty_returnsTrue_whenNotEmpty() { - assertThat("abc".toByteStringUtf8().isNotEmpty()).isTrue() - } - - @Test - fun isNotEmpty_returnsFalse_whenEmpty() { - assertThat(ByteString.EMPTY.isNotEmpty()).isFalse() - } - - @Test - fun byteAtBelowZero() { - val str = "abc".toByteStringUtf8() - assertFailsWith { str[-1] } - assertFailsWith { str[-2] } - } - - @Test - fun byteAtAboveLength() { - val str = "abc".toByteStringUtf8() - assertFailsWith { str[3] } - assertFailsWith { str[4] } - } - - @Test - fun byteArrayToByteString() { - assertThat("abc".toByteArray(Charsets.UTF_8).toByteString()) - .isEqualTo(ByteString.copyFromUtf8("abc")) - } - - @Test - fun byteBufferToByteString() { - val buffer = ByteBuffer.wrap("abc".toByteArray(Charsets.UTF_8)) - assertThat(buffer.toByteString()).isEqualTo(ByteString.copyFromUtf8("abc")) - } - - @Test - fun byteBufferToByteStringRespectsPositionAndLimit() { - val buffer = ByteBuffer.wrap("abc".toByteArray(Charsets.UTF_8)) - (buffer as java.nio.Buffer).position(1) - (buffer as java.nio.Buffer).limit(2) - assertThat(buffer.toByteString()).isEqualTo(ByteString.copyFromUtf8("b")) - } -} diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/DslListTest.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/DslListTest.kt deleted file mode 100644 index 9044ce3b294a914c58ee47501c8fc95d7e6944a5..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/DslListTest.kt +++ /dev/null @@ -1,120 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.testing.EqualsTester -import com.google.common.truth.Truth.assertThat -import kotlin.test.assertFailsWith -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -/** Tests for [DslList]. */ -@RunWith(JUnit4::class) -@OptIn(OnlyForUseByGeneratedProtoCode::class) -class DslListTest { - class DummyProxy private constructor() : DslProxy() - - @Test - fun matchesList() { - assertThat(DslList(listOf(1, 2, 3))).containsExactly(1, 2, 3).inOrder() - } - - @Test - fun reflectsChangesInList() { - val mutableList = mutableListOf(1, 2, 3) - val dslList = DslList(mutableList) - mutableList.add(4) - assertThat(dslList).containsExactly(1, 2, 3, 4).inOrder() - } - - @Test - fun dslListIsNotMutable() { - val dslList = DslList(mutableListOf(1, 2, 3)) - assertThat(dslList is MutableList<*>).isFalse() - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslListIsNotEvenSecretlyMutable() { - val dslList = DslList(mutableListOf(1, 2, 3)) - val dslListAsJavaUtil = dslList as java.util.List - assertFailsWith { dslListAsJavaUtil.add(4) } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslList_IteratorIsNotEvenSecretlyMutable() { - val dslList = DslList(mutableListOf(1, 2, 3)) - val iterator = dslList.iterator() as java.util.Iterator - iterator.next() - - assertFailsWith { iterator.remove() } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslList_ListIteratorIsNotEvenSecretlyMutable() { - val dslList = DslList(mutableListOf(1, 2, 3)) - val iterator = dslList.listIterator() as java.util.ListIterator - iterator.next() - - assertFailsWith { iterator.remove() } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslList_ListIteratorIndexIsNotEvenSecretlyMutable() { - val dslList = DslList(mutableListOf(1, 2, 3)) - val iterator = dslList.listIterator(1) as java.util.ListIterator - iterator.next() - - assertFailsWith { iterator.remove() } - } - - @Test - fun expectedToString() { - assertThat(DslList(listOf(1, 2)).toString()).isEqualTo("[1, 2]") - } - - @Test - fun equality() { - EqualsTester() - .addEqualityGroup(DslList(listOf(1, 2)), listOf(1, 2)) - .addEqualityGroup(DslList(listOf(2, 2)), listOf(2, 2)) - .addEqualityGroup( - DslList(emptyList()), - DslList(emptyList()), - emptyList() - ) - .testEquals() - } -} diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/DslMapTest.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/DslMapTest.kt deleted file mode 100644 index 3487f221e531f8e5bd74a4a0c9356b25d5092c08..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/DslMapTest.kt +++ /dev/null @@ -1,177 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.testing.EqualsTester -import com.google.common.truth.Truth.assertThat -import kotlin.test.assertFailsWith -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -@RunWith(JUnit4::class) -@OptIn(OnlyForUseByGeneratedProtoCode::class) -class DslMapTest { - class DummyProxy private constructor() : DslProxy() - - @Test - fun matchesMap() { - assertThat(DslMap(mapOf(1 to -1, 2 to -2))).containsExactly(1, -1, 2, -2) - } - - @Test - fun reflectsChangesInMap() { - val mutableMap = mutableMapOf(1 to -1, 2 to -2) - val dslMap = DslMap(mutableMap) - mutableMap[3] = -3 - assertThat(dslMap).containsExactly(1, -1, 2, -2, 3, -3).inOrder() - } - - @Test - fun dslMapIsNotMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - assertThat(dslMap is MutableMap<*, *>).isFalse() - } - - @Test - fun dslMapKeysAreNotMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - assertThat(dslMap.keys is MutableSet<*>).isFalse() - } - - @Test - fun dslMapValuesAreNotMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - assertThat(dslMap.values is MutableSet<*>).isFalse() - } - - @Test - fun dslMapEntriesAreNotMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - assertThat(dslMap.entries is MutableSet<*>).isFalse() - } - - @Test - fun dslMapEntryObjectsAreNotMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - assertThat(dslMap.entries.single() is MutableMap.MutableEntry<*, *>).isFalse() - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapIsNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapAsJavaUtilMap = dslMap as java.util.Map - assertFailsWith { dslMapAsJavaUtilMap.put(2, -2) } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapKeysAreNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapKeysAsJavaUtilSet = dslMap.keys as java.util.Set - assertFailsWith { dslMapKeysAsJavaUtilSet.remove(1) } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapKeysIteratorIsNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapKeysAsJavaUtilSet = dslMap.keys as java.util.Set - val itr = dslMapKeysAsJavaUtilSet.iterator() - itr.next() - assertFailsWith { itr.remove() } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapValuesAreNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapValuesAsJavaUtilCollection = dslMap.values as java.util.Collection - assertFailsWith { dslMapValuesAsJavaUtilCollection.remove(1) } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapValuesIteratorIsNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapValuesAsJavaUtilCollection = dslMap.values as java.util.Collection - val itr = dslMapValuesAsJavaUtilCollection.iterator() - itr.next() - assertFailsWith { itr.remove() } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapEntriesAreNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapEntriesAsJavaUtilSet = dslMap.entries as java.util.Set> - val entry = dslMap.entries.single() - assertFailsWith { dslMapEntriesAsJavaUtilSet.remove(entry) } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapEntriesIteratorIsNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapEntriesAsJavaUtilSet = dslMap.entries as java.util.Set> - val itr = dslMapEntriesAsJavaUtilSet.iterator() - itr.next() - assertFailsWith { itr.remove() } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun dslMapEntryObjectsAreNotEvenSecretlyMutable() { - val dslMap = DslMap(mutableMapOf(1 to -1)) - val dslMapEntryAsJavaUtilMapEntry = dslMap.entries.single() as java.util.Map.Entry - assertFailsWith { dslMapEntryAsJavaUtilMapEntry.value = 2 } - } - - @Test - fun expectedToString() { - assertThat(DslMap(mapOf(1 to 2, 2 to 3)).toString()) - .isEqualTo("{1=2, 2=3}") - } - - @Test - fun equality() { - EqualsTester() - .addEqualityGroup(DslMap(mapOf(1 to 2, 2 to 3)), mapOf(1 to 2, 2 to 3)) - .addEqualityGroup(DslMap(mapOf(1 to 3, 2 to 3)), mapOf(1 to 3, 2 to 3)) - .addEqualityGroup( - DslMap(emptyMap()), - DslMap(emptyMap()), - emptyMap() - ) - .testEquals() - } -} diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt deleted file mode 100644 index f4ad142a192f71a87c2aef5ce7161b1c0ce0b65a..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt +++ /dev/null @@ -1,86 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.truth.Truth.assertThat -import com.google.protobuf.kotlin.test.ExampleExtensibleMessage -import com.google.protobuf.kotlin.test.ExampleExtensibleMessageOuterClass as TestProto -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -@RunWith(JUnit4::class) -class ExtendableMessageExtensionsTest { - @Test - fun setOnBuilder() { - val builder = ExampleExtensibleMessage.newBuilder() - builder[TestProto.int32Extension] = 5 - assertThat(builder.build().getExtension(TestProto.int32Extension)).isEqualTo(5) - } - - @Test - fun getOnBuilder() { - val builder = ExampleExtensibleMessage.newBuilder().setExtension(TestProto.int32Extension, 6) - assertThat(builder[TestProto.int32Extension]).isEqualTo(6) - } - - @Test - fun getOnMessage() { - val message = - ExampleExtensibleMessage.newBuilder().setExtension(TestProto.int32Extension, 6).build() - assertThat(message[TestProto.int32Extension]).isEqualTo(6) - } - - @Test - fun containsPositiveOnMessage() { - val message = - ExampleExtensibleMessage.newBuilder().setExtension(TestProto.int32Extension, 6).build() - assertThat(TestProto.int32Extension in message).isTrue() - } - - @Test - fun containsPositiveOnBuilder() { - val builder = ExampleExtensibleMessage.newBuilder().setExtension(TestProto.int32Extension, 6) - assertThat(TestProto.int32Extension in builder).isTrue() - } - - @Test - fun containsNegativeOnMessage() { - val message = ExampleExtensibleMessage.newBuilder().build() - assertThat(TestProto.int32Extension in message).isFalse() - } - - @Test - fun containsNegativeOnBuilder() { - val builder = ExampleExtensibleMessage.newBuilder() - assertThat(TestProto.int32Extension in builder).isFalse() - } -} diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt deleted file mode 100644 index e311b825af6100f147559180391254f3fcc5ef43..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt +++ /dev/null @@ -1,157 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.testing.EqualsTester -import com.google.common.truth.Truth.assertThat -import com.google.protobuf.kotlin.test.ExampleExtensibleMessage -import com.google.protobuf.kotlin.test.ExampleExtensibleMessageOuterClass as TestProto -import kotlin.test.assertFailsWith -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -/** Tests for [DslList]. */ -@RunWith(JUnit4::class) -@OptIn(OnlyForUseByGeneratedProtoCode::class) -class ExtensionListTest { - class DummyProxy private constructor() : DslProxy() - - @Test - fun matchesList() { - assertThat( - ExtensionList(TestProto.repeatedExtension, listOf(1, 2, 3)) - ) - .containsExactly(1, 2, 3) - .inOrder() - } - - @Test - fun reflectsChangesInList() { - val mutableList = mutableListOf(1, 2, 3) - val extensionList = - ExtensionList(TestProto.repeatedExtension, mutableList) - mutableList.add(4) - assertThat(extensionList).containsExactly(1, 2, 3, 4).inOrder() - } - - @Test - fun extensionListIsNotMutable() { - val extensionList = - ExtensionList( - TestProto.repeatedExtension, - mutableListOf(1, 2, 3) - ) - assertThat(extensionList is MutableList<*>).isFalse() - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun extensionListIsNotEvenSecretlyMutable() { - val extensionList = - ExtensionList( - TestProto.repeatedExtension, - mutableListOf(1, 2, 3) - ) - val extensionListAsJavaUtil = extensionList as java.util.List - assertFailsWith { extensionListAsJavaUtil.add(4) } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun extensionList_IteratorIsNotEvenSecretlyMutable() { - val extensionList = - ExtensionList( - TestProto.repeatedExtension, - mutableListOf(1, 2, 3) - ) - val iterator = extensionList.iterator() as java.util.Iterator - iterator.next() - - assertFailsWith { iterator.remove() } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun extensionList_ListIteratorIsNotEvenSecretlyMutable() { - val extensionList = - ExtensionList( - TestProto.repeatedExtension, - mutableListOf(1, 2, 3) - ) - val iterator = extensionList.listIterator() as java.util.ListIterator - iterator.next() - - assertFailsWith { iterator.remove() } - } - - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST") - @Test - fun extensionList_ListIteratorIndexIsNotEvenSecretlyMutable() { - val extensionList = - ExtensionList( - TestProto.repeatedExtension, - mutableListOf(1, 2, 3) - ) - val iterator = extensionList.listIterator(1) as java.util.ListIterator - iterator.next() - - assertFailsWith { iterator.remove() } - } - - @Test - fun expectedToString() { - assertThat( - ExtensionList(TestProto.repeatedExtension, listOf(1, 2)) - .toString() - ) - .isEqualTo("[1, 2]") - } - - @Test - fun equality() { - EqualsTester() - .addEqualityGroup( - ExtensionList(TestProto.repeatedExtension, listOf(1, 2)), - ExtensionList(TestProto.differentExtension, listOf(1, 2)), - listOf(1, 2) - ) - .addEqualityGroup( - ExtensionList(TestProto.repeatedExtension, listOf(2, 2)), - listOf(2, 2) - ) - .addEqualityGroup( - ExtensionList(TestProto.repeatedExtension, emptyList()), - emptyList() - ) - .testEquals() - } -} diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/Proto2Test.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/Proto2Test.kt deleted file mode 100644 index 0aa9fdfe84a5041c38e6be411f8ecf4d3a3b4e0d..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/Proto2Test.kt +++ /dev/null @@ -1,975 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.truth.Truth.assertThat -import com.google.protobuf.TestUtil -import com.google.protobuf.TestUtil.toBytes -import com.google.protobuf.test.UnittestImport.ImportEnum -import com.google.protobuf.test.UnittestImport.ImportMessage -import com.google.protobuf.test.UnittestImportPublic.PublicImportMessage -import protobuf_unittest.MapProto2Unittest.Proto2MapEnum -import protobuf_unittest.MapProto2Unittest.TestEnumMap -import protobuf_unittest.MapProto2Unittest.TestIntIntMap -import protobuf_unittest.MapProto2Unittest.TestMaps -import protobuf_unittest.TestAllTypesKt -import protobuf_unittest.TestAllTypesKt.nestedMessage -import protobuf_unittest.UnittestProto -import protobuf_unittest.UnittestProto.ForeignEnum -import protobuf_unittest.UnittestProto.TestAllTypes -import protobuf_unittest.UnittestProto.TestAllTypes.NestedEnum -import protobuf_unittest.UnittestProto.TestEmptyMessage -import protobuf_unittest.UnittestProto.TestEmptyMessageWithExtensions -import protobuf_unittest.copy -import protobuf_unittest.foreignMessage -import protobuf_unittest.optionalGroupExtension -import protobuf_unittest.optionalNestedMessageOrNull -import protobuf_unittest.repeatedGroupExtension -import protobuf_unittest.testAllExtensions -import protobuf_unittest.testAllTypes -import protobuf_unittest.testEmptyMessage -import protobuf_unittest.testEmptyMessageWithExtensions -import protobuf_unittest.testEnumMap -import protobuf_unittest.testIntIntMap -import protobuf_unittest.testMaps -import `in`.com.google.protobuf.kotlin.generator.EvilNamesProto2 -import `in`.com.google.protobuf.kotlin.generator.HardKeywordsAllTypesProto2 -import `in`.com.google.protobuf.kotlin.generator.HardKeywordsAllTypesProto2Kt -import `in`.com.google.protobuf.kotlin.generator.Interface -import `in`.com.google.protobuf.kotlin.generator.evilNamesProto2 -import `in`.com.google.protobuf.kotlin.generator.hardKeywordsAllTypesProto2 -import `in`.com.google.protobuf.kotlin.generator.interface_ -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -@RunWith(JUnit4::class) -class Proto2Test { - @Test - fun testSetters() { - assertThat( - testAllTypes { - optionalInt32 = 101 - optionalInt64 = 102 - optionalUint32 = 103 - optionalUint64 = 104 - optionalSint32 = 105 - optionalSint64 = 106 - optionalFixed32 = 107 - optionalFixed64 = 108 - optionalSfixed32 = 109 - optionalSfixed64 = 110 - optionalFloat = 111.0f - optionalDouble = 112.0 - optionalBool = true - optionalString = "115" - optionalBytes = toBytes("116") - optionalGroup = TestAllTypesKt.optionalGroup { a = 117 } - optionalNestedMessage = nestedMessage { bb = 118 } - optionalForeignMessage = foreignMessage { c = 119 } - optionalImportMessage = ImportMessage.newBuilder().setD(120).build() - optionalPublicImportMessage = PublicImportMessage.newBuilder().setE(126).build() - optionalLazyMessage = nestedMessage { bb = 127 } - optionalUnverifiedLazyMessage = nestedMessage { bb = 128 } - optionalNestedEnum = NestedEnum.BAZ - optionalForeignEnum = ForeignEnum.FOREIGN_BAZ - optionalImportEnum = ImportEnum.IMPORT_BAZ - optionalStringPiece = "124" - optionalCord = "125" - repeatedInt32.add(201) - repeatedInt64.add(202) - repeatedUint32.add(203) - repeatedUint64.add(204) - repeatedSint32.add(205) - repeatedSint64.add(206) - repeatedFixed32.add(207) - repeatedFixed64.add(208) - repeatedSfixed32.add(209) - repeatedSfixed64.add(210) - repeatedFloat.add(211f) - repeatedDouble.add(212.0) - repeatedBool.add(true) - repeatedString.add("215") - repeatedBytes.add(toBytes("216")) - repeatedGroup.add(TestAllTypesKt.repeatedGroup { a = 217 }) - repeatedNestedMessage.add(nestedMessage { bb = 218 }) - repeatedForeignMessage.add(foreignMessage { c = 219 }) - repeatedImportMessage.add(ImportMessage.newBuilder().setD(220).build()) - repeatedLazyMessage.add(nestedMessage { bb = 227 }) - repeatedNestedEnum.add(NestedEnum.BAR) - repeatedForeignEnum.add(ForeignEnum.FOREIGN_BAR) - repeatedImportEnum.add(ImportEnum.IMPORT_BAR) - repeatedStringPiece.add("224") - repeatedCord.add("225") - repeatedInt32 += 301 - repeatedInt64 += 302 - repeatedUint32 += 303 - repeatedUint64 += 304 - repeatedSint32 += 305 - repeatedSint64 += 306 - repeatedFixed32 += 307 - repeatedFixed64 += 308 - repeatedSfixed32 += 309 - repeatedSfixed64 += 310 - repeatedFloat += 311f - repeatedDouble += 312.0 - repeatedBool += false - repeatedString += "315" - repeatedBytes += toBytes("316") - repeatedGroup += TestAllTypesKt.repeatedGroup { a = 317 } - repeatedNestedMessage += nestedMessage { bb = 318 } - repeatedForeignMessage += foreignMessage { c = 319 } - repeatedImportMessage += ImportMessage.newBuilder().setD(320).build() - repeatedLazyMessage += TestAllTypesKt.nestedMessage { bb = 327 } - repeatedNestedEnum += NestedEnum.BAZ - repeatedForeignEnum += ForeignEnum.FOREIGN_BAZ - repeatedImportEnum += ImportEnum.IMPORT_BAZ - repeatedStringPiece += "324" - repeatedCord += "325" - defaultInt32 = 401 - defaultInt64 = 402 - defaultUint32 = 403 - defaultUint64 = 404 - defaultSint32 = 405 - defaultSint64 = 406 - defaultFixed32 = 407 - defaultFixed64 = 408 - defaultSfixed32 = 409 - defaultSfixed64 = 410 - defaultFloat = 411f - defaultDouble = 412.0 - defaultBool = false - defaultString = "415" - defaultBytes = toBytes("416") - defaultNestedEnum = NestedEnum.FOO - defaultForeignEnum = ForeignEnum.FOREIGN_FOO - defaultImportEnum = ImportEnum.IMPORT_FOO - defaultStringPiece = "424" - defaultCord = "425" - oneofUint32 = 601 - oneofNestedMessage = TestAllTypesKt.nestedMessage { bb = 602 } - oneofString = "603" - oneofBytes = toBytes("604") - } - ) - .isEqualTo(TestUtil.getAllSetBuilder().build()) - } - - @Suppress("CheckResult") - @Test - fun testGetters() { - testAllTypes { - optionalInt32 = 101 - assertThat(optionalInt32).isEqualTo(101) - optionalString = "115" - assertThat(optionalString).isEqualTo("115") - optionalGroup = TestAllTypesKt.optionalGroup { a = 117 } - assertThat(optionalGroup).isEqualTo(TestAllTypesKt.optionalGroup { a = 117 }) - optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 } - assertThat(optionalNestedMessage).isEqualTo(TestAllTypesKt.nestedMessage { bb = 118 }) - optionalNestedEnum = NestedEnum.BAZ - assertThat(optionalNestedEnum).isEqualTo(NestedEnum.BAZ) - defaultInt32 = 401 - assertThat(defaultInt32).isEqualTo(401) - oneofUint32 = 601 - assertThat(oneofUint32).isEqualTo(601) - } - } - - @Suppress("CheckResult") - @Test - fun testDefaultGetters() { - testAllTypes { - assertThat(defaultInt32).isEqualTo(41) - assertThat(defaultString).isEqualTo("hello") - assertThat(defaultNestedEnum).isEqualTo(NestedEnum.BAR) - assertThat(defaultStringPiece).isEqualTo("abc") - } - } - - @Suppress("CheckResult") - @Test - fun testRepeatedGettersAndSetters() { - testAllTypes { - repeatedInt32.addAll(listOf(1, 2)) - assertThat(repeatedInt32).isEqualTo(listOf(1, 2)) - repeatedInt32 += listOf(3, 4) - assertThat(repeatedInt32).isEqualTo(listOf(1, 2, 3, 4)) - repeatedInt32[0] = 5 - assertThat(repeatedInt32).isEqualTo(listOf(5, 2, 3, 4)) - - repeatedString.addAll(listOf("1", "2")) - assertThat(repeatedString).isEqualTo(listOf("1", "2")) - repeatedString += listOf("3", "4") - assertThat(repeatedString).isEqualTo(listOf("1", "2", "3", "4")) - repeatedString[0] = "5" - assertThat(repeatedString).isEqualTo(listOf("5", "2", "3", "4")) - - repeatedGroup.addAll( - listOf(TestAllTypesKt.repeatedGroup { a = 1 }, TestAllTypesKt.repeatedGroup { a = 2 }) - ) - assertThat(repeatedGroup) - .isEqualTo( - listOf(TestAllTypesKt.repeatedGroup { a = 1 }, TestAllTypesKt.repeatedGroup { a = 2 }) - ) - repeatedGroup += - listOf(TestAllTypesKt.repeatedGroup { a = 3 }, TestAllTypesKt.repeatedGroup { a = 4 }) - assertThat(repeatedGroup) - .isEqualTo( - listOf( - TestAllTypesKt.repeatedGroup { a = 1 }, - TestAllTypesKt.repeatedGroup { a = 2 }, - TestAllTypesKt.repeatedGroup { a = 3 }, - TestAllTypesKt.repeatedGroup { a = 4 } - ) - ) - repeatedGroup[0] = TestAllTypesKt.repeatedGroup { a = 5 } - assertThat(repeatedGroup) - .isEqualTo( - listOf( - TestAllTypesKt.repeatedGroup { a = 5 }, - TestAllTypesKt.repeatedGroup { a = 2 }, - TestAllTypesKt.repeatedGroup { a = 3 }, - TestAllTypesKt.repeatedGroup { a = 4 } - ) - ) - - repeatedNestedMessage.addAll(listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })) - assertThat(repeatedNestedMessage) - .isEqualTo(listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })) - repeatedNestedMessage += listOf(nestedMessage { bb = 3 }, nestedMessage { bb = 4 }) - assertThat(repeatedNestedMessage) - .isEqualTo( - listOf( - nestedMessage { bb = 1 }, - nestedMessage { bb = 2 }, - nestedMessage { bb = 3 }, - nestedMessage { bb = 4 } - ) - ) - repeatedNestedMessage[0] = nestedMessage { bb = 5 } - assertThat(repeatedNestedMessage) - .isEqualTo( - listOf( - nestedMessage { bb = 5 }, - nestedMessage { bb = 2 }, - nestedMessage { bb = 3 }, - nestedMessage { bb = 4 } - ) - ) - - repeatedNestedEnum.addAll(listOf(NestedEnum.FOO, NestedEnum.BAR)) - assertThat(repeatedNestedEnum).isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR)) - repeatedNestedEnum += listOf(NestedEnum.BAZ, NestedEnum.FOO) - assertThat(repeatedNestedEnum) - .isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)) - repeatedNestedEnum[0] = NestedEnum.BAR - assertThat(repeatedNestedEnum) - .isEqualTo(listOf(NestedEnum.BAR, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)) - } - } - - @Suppress("CheckResult") - @Test - fun testHazzers() { - testAllTypes { - optionalInt32 = 101 - assertThat(hasOptionalInt32()).isTrue() - assertThat(hasOptionalString()).isFalse() - optionalGroup = TestAllTypesKt.optionalGroup { a = 117 } - assertThat(hasOptionalGroup()).isTrue() - assertThat(hasOptionalNestedMessage()).isFalse() - optionalNestedEnum = NestedEnum.BAZ - assertThat(hasOptionalNestedEnum()).isTrue() - assertThat(hasDefaultInt32()).isFalse() - oneofUint32 = 601 - assertThat(hasOneofUint32()).isTrue() - } - - testAllTypes { - assertThat(hasOptionalInt32()).isFalse() - optionalString = "115" - assertThat(hasOptionalString()).isTrue() - assertThat(hasOptionalGroup()).isFalse() - optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 } - assertThat(hasOptionalNestedMessage()).isTrue() - assertThat(hasOptionalNestedEnum()).isFalse() - defaultInt32 = 401 - assertThat(hasDefaultInt32()).isTrue() - assertThat(hasOneofUint32()).isFalse() - } - } - - @Suppress("CheckResult") - @Test - fun testClears() { - testAllTypes { - optionalInt32 = 101 - clearOptionalInt32() - assertThat(hasOptionalInt32()).isFalse() - - optionalString = "115" - clearOptionalString() - assertThat(hasOptionalString()).isFalse() - - optionalGroup = TestAllTypesKt.optionalGroup { a = 117 } - clearOptionalGroup() - assertThat(hasOptionalGroup()).isFalse() - - optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 } - clearOptionalNestedMessage() - assertThat(hasOptionalNestedMessage()).isFalse() - - optionalNestedEnum = NestedEnum.BAZ - clearOptionalNestedEnum() - assertThat(hasOptionalNestedEnum()).isFalse() - - defaultInt32 = 401 - clearDefaultInt32() - assertThat(hasDefaultInt32()).isFalse() - - oneofUint32 = 601 - clearOneofUint32() - assertThat(hasOneofUint32()).isFalse() - } - } - - @Test - fun testCopy() { - val message = testAllTypes { - optionalInt32 = 101 - optionalString = "115" - } - val modifiedMessage = message.copy { optionalInt32 = 201 } - - assertThat(message) - .isEqualTo(TestAllTypes.newBuilder().setOptionalInt32(101).setOptionalString("115").build()) - assertThat(modifiedMessage) - .isEqualTo(TestAllTypes.newBuilder().setOptionalInt32(201).setOptionalString("115").build()) - } - - @Test - fun testOneof() { - val message = testAllTypes { - oneofString = "foo" - assertThat(oneofFieldCase).isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_STRING) - assertThat(oneofString).isEqualTo("foo") - clearOneofField() - assertThat(hasOneofUint32()).isFalse() - assertThat(oneofFieldCase).isEqualTo(TestAllTypes.OneofFieldCase.ONEOFFIELD_NOT_SET) - oneofUint32 = 5 - } - - assertThat(message.getOneofFieldCase()).isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_UINT32) - assertThat(message.getOneofUint32()).isEqualTo(5) - } - - @Test - fun testExtensionsSet() { - assertThat( - testAllExtensions { - this[UnittestProto.optionalInt32Extension] = 101 - this[UnittestProto.optionalInt64Extension] = 102L - this[UnittestProto.optionalUint32Extension] = 103 - this[UnittestProto.optionalUint64Extension] = 104L - this[UnittestProto.optionalSint32Extension] = 105 - this[UnittestProto.optionalSint64Extension] = 106L - this[UnittestProto.optionalFixed32Extension] = 107 - this[UnittestProto.optionalFixed64Extension] = 108L - this[UnittestProto.optionalSfixed32Extension] = 109 - this[UnittestProto.optionalSfixed64Extension] = 110L - this[UnittestProto.optionalFloatExtension] = 111F - this[UnittestProto.optionalDoubleExtension] = 112.0 - this[UnittestProto.optionalBoolExtension] = true - this[UnittestProto.optionalStringExtension] = "115" - this[UnittestProto.optionalBytesExtension] = toBytes("116") - this[UnittestProto.optionalGroupExtension] = optionalGroupExtension { a = 117 } - this[UnittestProto.optionalNestedMessageExtension] = - TestAllTypesKt.nestedMessage { bb = 118 } - this[UnittestProto.optionalForeignMessageExtension] = foreignMessage { c = 119 } - this[UnittestProto.optionalImportMessageExtension] = - ImportMessage.newBuilder().setD(120).build() - this[UnittestProto.optionalPublicImportMessageExtension] = - PublicImportMessage.newBuilder().setE(126).build() - this[UnittestProto.optionalLazyMessageExtension] = - TestAllTypesKt.nestedMessage { bb = 127 } - this[UnittestProto.optionalUnverifiedLazyMessageExtension] = - TestAllTypesKt.nestedMessage { bb = 128 } - this[UnittestProto.optionalNestedEnumExtension] = NestedEnum.BAZ - this[UnittestProto.optionalForeignEnumExtension] = ForeignEnum.FOREIGN_BAZ - this[UnittestProto.optionalImportEnumExtension] = ImportEnum.IMPORT_BAZ - this[UnittestProto.optionalStringPieceExtension] = "124" - this[UnittestProto.optionalCordExtension] = "125" - this[UnittestProto.repeatedInt32Extension].add(201) - this[UnittestProto.repeatedInt64Extension].add(202L) - this[UnittestProto.repeatedUint32Extension].add(203) - this[UnittestProto.repeatedUint64Extension].add(204L) - this[UnittestProto.repeatedSint32Extension].add(205) - this[UnittestProto.repeatedSint64Extension].add(206L) - this[UnittestProto.repeatedFixed32Extension].add(207) - this[UnittestProto.repeatedFixed64Extension].add(208L) - this[UnittestProto.repeatedSfixed32Extension].add(209) - this[UnittestProto.repeatedSfixed64Extension].add(210L) - this[UnittestProto.repeatedFloatExtension].add(211F) - this[UnittestProto.repeatedDoubleExtension].add(212.0) - this[UnittestProto.repeatedBoolExtension].add(true) - this[UnittestProto.repeatedStringExtension].add("215") - this[UnittestProto.repeatedBytesExtension].add(toBytes("216")) - this[UnittestProto.repeatedGroupExtension].add(repeatedGroupExtension { a = 217 }) - this[UnittestProto.repeatedNestedMessageExtension].add( - TestAllTypesKt.nestedMessage { bb = 218 } - ) - this[UnittestProto.repeatedForeignMessageExtension].add(foreignMessage { c = 219 }) - this[UnittestProto.repeatedImportMessageExtension].add( - ImportMessage.newBuilder().setD(220).build() - ) - this[UnittestProto.repeatedLazyMessageExtension].add( - TestAllTypesKt.nestedMessage { bb = 227 } - ) - this[UnittestProto.repeatedNestedEnumExtension].add(NestedEnum.BAR) - this[UnittestProto.repeatedForeignEnumExtension].add(ForeignEnum.FOREIGN_BAR) - this[UnittestProto.repeatedImportEnumExtension].add(ImportEnum.IMPORT_BAR) - this[UnittestProto.repeatedStringPieceExtension].add("224") - this[UnittestProto.repeatedCordExtension].add("225") - this[UnittestProto.repeatedInt32Extension] += 301 - this[UnittestProto.repeatedInt64Extension] += 302L - this[UnittestProto.repeatedUint32Extension] += 303 - this[UnittestProto.repeatedUint64Extension] += 304L - this[UnittestProto.repeatedSint32Extension] += 305 - this[UnittestProto.repeatedSint64Extension] += 306L - this[UnittestProto.repeatedFixed32Extension] += 307 - this[UnittestProto.repeatedFixed64Extension] += 308L - this[UnittestProto.repeatedSfixed32Extension] += 309 - this[UnittestProto.repeatedSfixed64Extension] += 310L - this[UnittestProto.repeatedFloatExtension] += 311F - this[UnittestProto.repeatedDoubleExtension] += 312.0 - this[UnittestProto.repeatedBoolExtension] += false - this[UnittestProto.repeatedStringExtension] += "315" - this[UnittestProto.repeatedBytesExtension] += toBytes("316") - this[UnittestProto.repeatedGroupExtension] += repeatedGroupExtension { a = 317 } - this[UnittestProto.repeatedNestedMessageExtension] += - TestAllTypesKt.nestedMessage { bb = 318 } - this[UnittestProto.repeatedForeignMessageExtension] += foreignMessage { c = 319 } - this[UnittestProto.repeatedImportMessageExtension] += - ImportMessage.newBuilder().setD(320).build() - this[UnittestProto.repeatedLazyMessageExtension] += - TestAllTypesKt.nestedMessage { bb = 327 } - this[UnittestProto.repeatedNestedEnumExtension] += NestedEnum.BAZ - this[UnittestProto.repeatedForeignEnumExtension] += ForeignEnum.FOREIGN_BAZ - this[UnittestProto.repeatedImportEnumExtension] += ImportEnum.IMPORT_BAZ - this[UnittestProto.repeatedStringPieceExtension] += "324" - this[UnittestProto.repeatedCordExtension] += "325" - setExtension(UnittestProto.defaultInt32Extension, 401) - setExtension(UnittestProto.defaultInt64Extension, 402L) - setExtension(UnittestProto.defaultUint32Extension, 403) - setExtension(UnittestProto.defaultUint64Extension, 404L) - setExtension(UnittestProto.defaultSint32Extension, 405) - setExtension(UnittestProto.defaultSint64Extension, 406L) - setExtension(UnittestProto.defaultFixed32Extension, 407) - setExtension(UnittestProto.defaultFixed64Extension, 408L) - setExtension(UnittestProto.defaultSfixed32Extension, 409) - setExtension(UnittestProto.defaultSfixed64Extension, 410L) - setExtension(UnittestProto.defaultFloatExtension, 411F) - setExtension(UnittestProto.defaultDoubleExtension, 412.0) - setExtension(UnittestProto.defaultBoolExtension, false) - setExtension(UnittestProto.defaultStringExtension, "415") - setExtension(UnittestProto.defaultBytesExtension, toBytes("416")) - setExtension(UnittestProto.defaultNestedEnumExtension, NestedEnum.FOO) - setExtension(UnittestProto.defaultForeignEnumExtension, ForeignEnum.FOREIGN_FOO) - setExtension(UnittestProto.defaultImportEnumExtension, ImportEnum.IMPORT_FOO) - setExtension(UnittestProto.defaultStringPieceExtension, "424") - setExtension(UnittestProto.defaultCordExtension, "425") - this[UnittestProto.oneofUint32Extension] = 601 - this[UnittestProto.oneofNestedMessageExtension] = - TestAllTypesKt.nestedMessage { bb = 602 } - this[UnittestProto.oneofStringExtension] = "603" - this[UnittestProto.oneofBytesExtension] = toBytes("604") - } - ) - .isEqualTo(TestUtil.getAllExtensionsSet()) - } - - @Suppress("CheckResult") - @Test - fun testExtensionGetters() { - testAllExtensions { - this[UnittestProto.optionalInt32Extension] = 101 - assertThat(this[UnittestProto.optionalInt32Extension]).isEqualTo(101) - this[UnittestProto.optionalStringExtension] = "115" - assertThat(this[UnittestProto.optionalStringExtension]).isEqualTo("115") - this[UnittestProto.optionalGroupExtension] = optionalGroupExtension { a = 117 } - assertThat(this[UnittestProto.optionalGroupExtension]) - .isEqualTo(optionalGroupExtension { a = 117 }) - this[UnittestProto.optionalNestedMessageExtension] = TestAllTypesKt.nestedMessage { bb = 118 } - assertThat(this[UnittestProto.optionalNestedMessageExtension]) - .isEqualTo(TestAllTypesKt.nestedMessage { bb = 118 }) - this[UnittestProto.optionalNestedEnumExtension] = NestedEnum.BAZ - assertThat(this[UnittestProto.optionalNestedEnumExtension]).isEqualTo(NestedEnum.BAZ) - this[UnittestProto.defaultInt32Extension] = 401 - assertThat(this[UnittestProto.defaultInt32Extension]).isEqualTo(401) - this[UnittestProto.oneofUint32Extension] = 601 - assertThat(this[UnittestProto.oneofUint32Extension]).isEqualTo(601) - } - } - - @Suppress("CheckResult") - @Test - fun testRepeatedExtensionGettersAndSetters() { - testAllExtensions { - this[UnittestProto.repeatedInt32Extension].addAll(listOf(1, 2)) - assertThat(this[UnittestProto.repeatedInt32Extension]).isEqualTo(listOf(1, 2)) - this[UnittestProto.repeatedInt32Extension] += listOf(3, 4) - assertThat(this[UnittestProto.repeatedInt32Extension]).isEqualTo(listOf(1, 2, 3, 4)) - this[UnittestProto.repeatedInt32Extension][0] = 5 - assertThat(this[UnittestProto.repeatedInt32Extension]).isEqualTo(listOf(5, 2, 3, 4)) - - this[UnittestProto.repeatedStringExtension].addAll(listOf("1", "2")) - assertThat(this[UnittestProto.repeatedStringExtension]).isEqualTo(listOf("1", "2")) - this[UnittestProto.repeatedStringExtension] += listOf("3", "4") - assertThat(this[UnittestProto.repeatedStringExtension]).isEqualTo(listOf("1", "2", "3", "4")) - this[UnittestProto.repeatedStringExtension][0] = "5" - assertThat(this[UnittestProto.repeatedStringExtension]).isEqualTo(listOf("5", "2", "3", "4")) - - this[UnittestProto.repeatedGroupExtension].addAll( - listOf(repeatedGroupExtension { a = 1 }, repeatedGroupExtension { a = 2 }) - ) - assertThat(this[UnittestProto.repeatedGroupExtension]) - .isEqualTo(listOf(repeatedGroupExtension { a = 1 }, repeatedGroupExtension { a = 2 })) - this[UnittestProto.repeatedGroupExtension] += - listOf(repeatedGroupExtension { a = 3 }, repeatedGroupExtension { a = 4 }) - assertThat(this[UnittestProto.repeatedGroupExtension]) - .isEqualTo( - listOf( - repeatedGroupExtension { a = 1 }, - repeatedGroupExtension { a = 2 }, - repeatedGroupExtension { a = 3 }, - repeatedGroupExtension { a = 4 } - ) - ) - this[UnittestProto.repeatedGroupExtension][0] = repeatedGroupExtension { a = 5 } - assertThat(this[UnittestProto.repeatedGroupExtension]) - .isEqualTo( - listOf( - repeatedGroupExtension { a = 5 }, - repeatedGroupExtension { a = 2 }, - repeatedGroupExtension { a = 3 }, - repeatedGroupExtension { a = 4 } - ) - ) - - this[UnittestProto.repeatedNestedMessageExtension].addAll( - listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 }) - ) - assertThat(this[UnittestProto.repeatedNestedMessageExtension]) - .isEqualTo(listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })) - this[UnittestProto.repeatedNestedMessageExtension] += - listOf(nestedMessage { bb = 3 }, nestedMessage { bb = 4 }) - assertThat(this[UnittestProto.repeatedNestedMessageExtension]) - .isEqualTo( - listOf( - nestedMessage { bb = 1 }, - nestedMessage { bb = 2 }, - nestedMessage { bb = 3 }, - nestedMessage { bb = 4 } - ) - ) - this[UnittestProto.repeatedNestedMessageExtension][0] = nestedMessage { bb = 5 } - assertThat(this[UnittestProto.repeatedNestedMessageExtension]) - .isEqualTo( - listOf( - nestedMessage { bb = 5 }, - nestedMessage { bb = 2 }, - nestedMessage { bb = 3 }, - nestedMessage { bb = 4 } - ) - ) - - this[UnittestProto.repeatedNestedEnumExtension].addAll(listOf(NestedEnum.FOO, NestedEnum.BAR)) - assertThat(this[UnittestProto.repeatedNestedEnumExtension]) - .isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR)) - this[UnittestProto.repeatedNestedEnumExtension] += listOf(NestedEnum.BAZ, NestedEnum.FOO) - assertThat(this[UnittestProto.repeatedNestedEnumExtension]) - .isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)) - } - } - - @Suppress("CheckResult") - @Test - fun testExtensionContains() { - testAllExtensions { - this[UnittestProto.optionalInt32Extension] = 101 - assertThat(contains(UnittestProto.optionalInt32Extension)).isTrue() - assertThat(contains(UnittestProto.optionalStringExtension)).isFalse() - this[UnittestProto.optionalGroupExtension] = optionalGroupExtension { a = 117 } - assertThat(contains(UnittestProto.optionalGroupExtension)).isTrue() - assertThat(contains(UnittestProto.optionalNestedMessageExtension)).isFalse() - this[UnittestProto.optionalNestedEnumExtension] = NestedEnum.BAZ - assertThat(contains(UnittestProto.optionalNestedEnumExtension)).isTrue() - assertThat(contains(UnittestProto.defaultInt32Extension)).isFalse() - this[UnittestProto.oneofUint32Extension] = 601 - assertThat(contains(UnittestProto.optionalInt32Extension)).isTrue() - } - - testAllExtensions { - assertThat(contains(UnittestProto.optionalInt32Extension)).isFalse() - this[UnittestProto.optionalStringExtension] = "115" - assertThat(contains(UnittestProto.optionalStringExtension)).isTrue() - assertThat(contains(UnittestProto.optionalGroupExtension)).isFalse() - this[UnittestProto.optionalNestedMessageExtension] = TestAllTypesKt.nestedMessage { bb = 118 } - assertThat(contains(UnittestProto.optionalNestedMessageExtension)).isTrue() - assertThat(contains(UnittestProto.optionalNestedEnumExtension)).isFalse() - this[UnittestProto.defaultInt32Extension] = 401 - assertThat(contains(UnittestProto.defaultInt32Extension)).isTrue() - assertThat(contains(UnittestProto.oneofUint32Extension)).isFalse() - } - } - - @Suppress("CheckResult") - @Test - fun testExtensionClears() { - testAllExtensions { - this[UnittestProto.optionalInt32Extension] = 101 - clear(UnittestProto.optionalInt32Extension) - assertThat(contains(UnittestProto.optionalInt32Extension)).isFalse() - - this[UnittestProto.optionalStringExtension] = "115" - clear(UnittestProto.optionalStringExtension) - assertThat(contains(UnittestProto.optionalStringExtension)).isFalse() - - this[UnittestProto.optionalGroupExtension] = optionalGroupExtension { a = 117 } - clear(UnittestProto.optionalGroupExtension) - assertThat(contains(UnittestProto.optionalGroupExtension)).isFalse() - - this[UnittestProto.optionalNestedMessageExtension] = TestAllTypesKt.nestedMessage { bb = 118 } - clear(UnittestProto.optionalNestedMessageExtension) - assertThat(contains(UnittestProto.optionalNestedMessageExtension)).isFalse() - - this[UnittestProto.optionalNestedEnumExtension] = NestedEnum.BAZ - clear(UnittestProto.optionalNestedEnumExtension) - assertThat(contains(UnittestProto.optionalNestedEnumExtension)).isFalse() - - this[UnittestProto.defaultInt32Extension] = 401 - clear(UnittestProto.defaultInt32Extension) - assertThat(contains(UnittestProto.oneofUint32Extension)).isFalse() - } - } - - @Test - fun testEmptyMessages() { - assertThat(testEmptyMessage {}).isEqualTo(TestEmptyMessage.newBuilder().build()) - - assertThat(testEmptyMessageWithExtensions {}) - .isEqualTo(TestEmptyMessageWithExtensions.newBuilder().build()) - } - - @Test - fun testMapSetters() { - val intMap = testIntIntMap { m[1] = 2 } - assertThat(intMap).isEqualTo(TestIntIntMap.newBuilder().putM(1, 2).build()) - - assertThat( - testMaps { - mInt32[1] = intMap - mInt64[1L] = intMap - mUint32[1] = intMap - mUint64[1L] = intMap - mSint32[1] = intMap - mSint64[1L] = intMap - mFixed32[1] = intMap - mFixed64[1L] = intMap - mSfixed32[1] = intMap - mSfixed64[1] = intMap - mBool[true] = intMap - mString["1"] = intMap - } - ) - .isEqualTo( - TestMaps.newBuilder() - .putMInt32(1, intMap) - .putMInt64(1L, intMap) - .putMUint32(1, intMap) - .putMUint64(1L, intMap) - .putMSint32(1, intMap) - .putMSint64(1L, intMap) - .putMFixed32(1, intMap) - .putMFixed64(1L, intMap) - .putMSfixed32(1, intMap) - .putMSfixed64(1L, intMap) - .putMBool(true, intMap) - .putMString("1", intMap) - .build() - ) - - assertThat(testEnumMap { knownMapField[1] = Proto2MapEnum.PROTO2_MAP_ENUM_FOO }) - .isEqualTo( - TestEnumMap.newBuilder().putKnownMapField(1, Proto2MapEnum.PROTO2_MAP_ENUM_FOO).build() - ) - } - - @Suppress("CheckResult") - @Test - fun testMapGettersAndSetters() { - val intMap = testIntIntMap { - m.put(1, 2) - assertThat(m).isEqualTo(mapOf(1 to 2)) - m[3] = 4 - assertThat(m).isEqualTo(mapOf(1 to 2, 3 to 4)) - m.putAll(mapOf(5 to 6, 7 to 8)) - assertThat(m).isEqualTo(mapOf(1 to 2, 3 to 4, 5 to 6, 7 to 8)) - } - - testMaps { - mInt32.put(1, intMap) - assertThat(mInt32).isEqualTo(mapOf(1 to intMap)) - mInt32[2] = intMap - assertThat(mInt32).isEqualTo(mapOf(1 to intMap, 2 to intMap)) - mInt32.putAll(mapOf(3 to intMap, 4 to intMap)) - assertThat(mInt32).isEqualTo(mapOf(1 to intMap, 2 to intMap, 3 to intMap, 4 to intMap)) - - mString.put("1", intMap) - assertThat(mString).isEqualTo(mapOf("1" to intMap)) - mString["2"] = intMap - assertThat(mString).isEqualTo(mapOf("1" to intMap, "2" to intMap)) - mString.putAll(mapOf("3" to intMap, "4" to intMap)) - assertThat(mString) - .isEqualTo(mapOf("1" to intMap, "2" to intMap, "3" to intMap, "4" to intMap)) - } - - testEnumMap { - knownMapField.put(1, Proto2MapEnum.PROTO2_MAP_ENUM_FOO) - assertThat(knownMapField).isEqualTo(mapOf(1 to Proto2MapEnum.PROTO2_MAP_ENUM_FOO)) - knownMapField[2] = Proto2MapEnum.PROTO2_MAP_ENUM_BAR - assertThat(knownMapField) - .isEqualTo( - mapOf(1 to Proto2MapEnum.PROTO2_MAP_ENUM_FOO, 2 to Proto2MapEnum.PROTO2_MAP_ENUM_BAR) - ) - knownMapField.putAll( - mapOf(3 to Proto2MapEnum.PROTO2_MAP_ENUM_BAZ, 4 to Proto2MapEnum.PROTO2_MAP_ENUM_FOO) - ) - assertThat(knownMapField) - .isEqualTo( - mapOf( - 1 to Proto2MapEnum.PROTO2_MAP_ENUM_FOO, - 2 to Proto2MapEnum.PROTO2_MAP_ENUM_BAR, - 3 to Proto2MapEnum.PROTO2_MAP_ENUM_BAZ, - 4 to Proto2MapEnum.PROTO2_MAP_ENUM_FOO - ) - ) - } - } - - @Suppress("CheckResult") - @Test - fun testMapRemove() { - val intMap = testIntIntMap { - m.putAll(mapOf(1 to 2, 3 to 4)) - m.remove(1) - assertThat(m).isEqualTo(mapOf(3 to 4)) - } - - testMaps { - mInt32.putAll(mapOf(1 to intMap, 2 to intMap)) - mInt32.remove(1) - assertThat(mInt32).isEqualTo(mapOf(2 to intMap)) - - mString.putAll(mapOf("1" to intMap, "2" to intMap)) - mString.remove("1") - assertThat(mString).isEqualTo(mapOf("2" to intMap)) - } - - testEnumMap { - knownMapField.putAll( - mapOf(1 to Proto2MapEnum.PROTO2_MAP_ENUM_FOO, 2 to Proto2MapEnum.PROTO2_MAP_ENUM_BAR) - ) - knownMapField.remove(1) - assertThat(knownMapField).isEqualTo(mapOf(2 to Proto2MapEnum.PROTO2_MAP_ENUM_BAR)) - } - } - - @Suppress("CheckResult") - @Test - fun testMapClear() { - val intMap = testIntIntMap { - m.putAll(mapOf(1 to 2, 3 to 4)) - m.clear() - assertThat(m.isEmpty()).isTrue() - } - - testMaps { - mInt32.putAll(mapOf(1 to intMap, 2 to intMap)) - mInt32.clear() - assertThat(mInt32.isEmpty()).isTrue() - - mString.putAll(mapOf("1" to intMap, "2" to intMap)) - mString.clear() - assertThat(mString.isEmpty()).isTrue() - } - - testEnumMap { - knownMapField.putAll( - mapOf(1 to Proto2MapEnum.PROTO2_MAP_ENUM_FOO, 2 to Proto2MapEnum.PROTO2_MAP_ENUM_BAR) - ) - knownMapField.clear() - assertThat(knownMapField.isEmpty()).isTrue() - } - } - - @Test - fun testEvilNames() { - assertThat( - evilNamesProto2 { - initialized = true - hasFoo = true - bar = "foo" - isInitialized = true - fooBar = "foo" - aLLCAPS += "foo" - aLLCAPSMAP[1] = true - hasUnderbarPrecedingNumeric1Foo = true - hasUnderbarPrecedingNumeric42Bar = true - hasUnderbarPrecedingNumeric123Foo42BarBaz = true - extension += "foo" - class_ += 1 - int = 1.0 - long = true - boolean = 1L - sealed = "foo" - interface_ = 1F - object_ = "foo" - cachedSize_ = "foo" - serializedSize_ = true - by = "foo" - } - ) - .isEqualTo( - EvilNamesProto2.newBuilder() - .setInitialized(true) - .setHasFoo(true) - .setBar("foo") - .setIsInitialized(true) - .setFooBar("foo") - .addALLCAPS("foo") - .putALLCAPSMAP(1, true) - .setHasUnderbarPrecedingNumeric1Foo(true) - .setHasUnderbarPrecedingNumeric42Bar(true) - .setHasUnderbarPrecedingNumeric123Foo42BarBaz(true) - .addExtension("foo") - .addClass_(1) - .setInt(1.0) - .setLong(true) - .setBoolean(1L) - .setSealed("foo") - .setInterface(1F) - .setObject("foo") - .setCachedSize_("foo") - .setSerializedSize_(true) - .setBy("foo") - .build() - ) - - assertThat(interface_ {}).isEqualTo(Interface.newBuilder().build()) - } - - @Suppress("CheckResult") - @Test - fun testHardKeywordGettersAndSetters() { - hardKeywordsAllTypesProto2 { - as_ = 1 - assertThat(as_).isEqualTo(1) - - break_ = HardKeywordsAllTypesProto2.NestedEnum.FOO - assertThat(break_).isEqualTo(HardKeywordsAllTypesProto2.NestedEnum.FOO) - - do_ = HardKeywordsAllTypesProto2Kt.nestedMessage { while_ = 1 } - assertThat(do_).isEqualTo(HardKeywordsAllTypesProto2Kt.nestedMessage { while_ = 1 }) - - continue_[1] = 1 - assertThat(continue_[1]).isEqualTo(1) - - else_ += 1 - assertThat(else_).isEqualTo(listOf(1)) - - for_ += "foo" - assertThat(for_).isEqualTo(listOf("foo")) - - fun_ += HardKeywordsAllTypesProto2.NestedEnum.FOO - assertThat(fun_).isEqualTo(listOf(HardKeywordsAllTypesProto2.NestedEnum.FOO)) - - if_ += HardKeywordsAllTypesProto2Kt.nestedMessage { while_ = 1 } - assertThat(if_).isEqualTo(listOf(HardKeywordsAllTypesProto2Kt.nestedMessage { while_ = 1 })) - } - } - - @Suppress("CheckResult") - @Test - fun testHardKeywordHazzers() { - hardKeywordsAllTypesProto2 { - as_ = 1 - assertThat(hasAs_()).isTrue() - - break_ = HardKeywordsAllTypesProto2.NestedEnum.FOO - assertThat(hasBreak_()).isTrue() - - do_ = HardKeywordsAllTypesProto2Kt.nestedMessage { while_ = 1 } - assertThat(hasDo_()).isTrue() - } - } - - @Suppress("CheckResult") - @Test - fun testHardKeywordClears() { - hardKeywordsAllTypesProto2 { - as_ = 1 - clearAs_() - assertThat(hasAs_()).isFalse() - - break_ = HardKeywordsAllTypesProto2.NestedEnum.FOO - clearBreak_() - assertThat(hasBreak_()).isFalse() - - do_ = HardKeywordsAllTypesProto2Kt.nestedMessage { while_ = 1 } - clearDo_() - assertThat(hasDo_()).isFalse() - } - } - - @Test - fun testGetOrNull() { - val noNestedMessage = testAllTypes {} - assertThat(noNestedMessage.optionalNestedMessageOrNull).isEqualTo(null) - - val someNestedMessage = testAllTypes { - optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 } - } - assertThat(someNestedMessage.optionalNestedMessageOrNull) - .isEqualTo(TestAllTypesKt.nestedMessage { bb = 118 }) - } -} diff --git a/java/kotlin/src/test/kotlin/com/google/protobuf/Proto3Test.kt b/java/kotlin/src/test/kotlin/com/google/protobuf/Proto3Test.kt deleted file mode 100644 index 8ce00946dc6d8c4b148a58b6ca7e0da93898a780..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/kotlin/com/google/protobuf/Proto3Test.kt +++ /dev/null @@ -1,365 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package com.google.protobuf.kotlin - -import com.google.common.truth.Truth.assertThat -import com.google.protobuf.kotlin.generator.`in`.EvilNamesProto3OuterClass.Class -import com.google.protobuf.kotlin.generator.`in`.EvilNamesProto3OuterClass.EvilNamesProto3 -import com.google.protobuf.kotlin.generator.`in`.EvilNamesProto3OuterClass.HardKeywordsAllTypesProto3 -import com.google.protobuf.kotlin.generator.`in`.HardKeywordsAllTypesProto3Kt -import com.google.protobuf.kotlin.generator.`in`.class_ -import com.google.protobuf.kotlin.generator.`in`.evilNamesProto3 -import com.google.protobuf.kotlin.generator.`in`.hardKeywordsAllTypesProto3 -import proto3_unittest.TestAllTypesKt -import proto3_unittest.TestAllTypesKt.nestedMessage -import proto3_unittest.UnittestProto3.TestAllTypes -import proto3_unittest.UnittestProto3.TestAllTypes.NestedEnum -import proto3_unittest.UnittestProto3.TestEmptyMessage -import proto3_unittest.copy -import proto3_unittest.optionalForeignMessageOrNull -import proto3_unittest.optionalNestedMessageOrNull -import proto3_unittest.testAllTypes -import proto3_unittest.testEmptyMessage -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -@RunWith(JUnit4::class) -class Proto3Test { - @Suppress("CheckResult") - @Test - fun testGettersAndSetters() { - testAllTypes { - optionalInt32 = 101 - assertThat(optionalInt32).isEqualTo(101) - optionalString = "115" - assertThat(optionalString).isEqualTo("115") - optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 } - assertThat(optionalNestedMessage).isEqualTo(TestAllTypesKt.nestedMessage { bb = 118 }) - optionalNestedEnum = NestedEnum.BAZ - assertThat(optionalNestedEnum).isEqualTo(NestedEnum.BAZ) - assertThat(optionalNestedEnumValue).isEqualTo(3) - optionalNestedEnumValue = 1 - assertThat(optionalNestedEnumValue).isEqualTo(1) - assertThat(optionalNestedEnum).isEqualTo(NestedEnum.FOO) - - oneofUint32 = 601 - assertThat(oneofUint32).isEqualTo(601) - } - } - - @Suppress("CheckResult") - @Test - fun testRepeatedGettersAndSetters() { - testAllTypes { - repeatedInt32.addAll(listOf(1, 2)) - assertThat(repeatedInt32).isEqualTo(listOf(1, 2)) - repeatedInt32 += listOf(3, 4) - assertThat(repeatedInt32).isEqualTo(listOf(1, 2, 3, 4)) - repeatedInt32[0] = 5 - assertThat(repeatedInt32).isEqualTo(listOf(5, 2, 3, 4)) - - repeatedString.addAll(listOf("1", "2")) - assertThat(repeatedString).isEqualTo(listOf("1", "2")) - repeatedString += listOf("3", "4") - assertThat(repeatedString).isEqualTo(listOf("1", "2", "3", "4")) - repeatedString[0] = "5" - assertThat(repeatedString).isEqualTo(listOf("5", "2", "3", "4")) - - repeatedNestedMessage.addAll(listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })) - assertThat(repeatedNestedMessage) - .isEqualTo(listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })) - repeatedNestedMessage += listOf(nestedMessage { bb = 3 }, nestedMessage { bb = 4 }) - assertThat(repeatedNestedMessage) - .isEqualTo( - listOf( - nestedMessage { bb = 1 }, - nestedMessage { bb = 2 }, - nestedMessage { bb = 3 }, - nestedMessage { bb = 4 } - ) - ) - repeatedNestedMessage[0] = nestedMessage { bb = 5 } - assertThat(repeatedNestedMessage) - .isEqualTo( - listOf( - nestedMessage { bb = 5 }, - nestedMessage { bb = 2 }, - nestedMessage { bb = 3 }, - nestedMessage { bb = 4 } - ) - ) - - repeatedNestedEnum.addAll(listOf(NestedEnum.FOO, NestedEnum.BAR)) - assertThat(repeatedNestedEnum).isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR)) - repeatedNestedEnum += listOf(NestedEnum.BAZ, NestedEnum.FOO) - assertThat(repeatedNestedEnum) - .isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)) - repeatedNestedEnum[0] = NestedEnum.BAR - assertThat(repeatedNestedEnum) - .isEqualTo(listOf(NestedEnum.BAR, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)) - } - } - - @Test - fun testClears() { - assertThat( - testAllTypes { - optionalInt32 = 101 - clearOptionalInt32() - - optionalString = "115" - clearOptionalString() - - optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 } - clearOptionalNestedMessage() - - optionalNestedEnum = NestedEnum.BAZ - clearOptionalNestedEnum() - - oneofUint32 = 601 - clearOneofUint32() - } - ) - .isEqualTo(TestAllTypes.newBuilder().build()) - } - - @Test - fun testCopy() { - val message = testAllTypes { - optionalInt32 = 101 - optionalString = "115" - } - val modifiedMessage = message.copy { optionalInt32 = 201 } - - assertThat(message) - .isEqualTo(TestAllTypes.newBuilder().setOptionalInt32(101).setOptionalString("115").build()) - assertThat(modifiedMessage) - .isEqualTo(TestAllTypes.newBuilder().setOptionalInt32(201).setOptionalString("115").build()) - } - - @Test - fun testOneof() { - val message = testAllTypes { - oneofString = "foo" - assertThat(oneofFieldCase).isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_STRING) - assertThat(oneofString).isEqualTo("foo") - clearOneofField() - assertThat(oneofFieldCase).isEqualTo(TestAllTypes.OneofFieldCase.ONEOFFIELD_NOT_SET) - oneofUint32 = 5 - } - - assertThat(message.getOneofFieldCase()).isEqualTo(TestAllTypes.OneofFieldCase.ONEOF_UINT32) - assertThat(message.getOneofUint32()).isEqualTo(5) - } - - @Test - fun testEmptyMessages() { - assertThat(testEmptyMessage {}).isEqualTo(TestEmptyMessage.newBuilder().build()) - } - - @Test - fun testEvilNames() { - assertThat( - evilNamesProto3 { - initialized = true - hasFoo = true - bar = "foo" - isInitialized = true - fooBar = "foo" - aLLCAPS += "foo" - aLLCAPSMAP[1] = true - hasUnderbarPrecedingNumeric1Foo = true - hasUnderbarPrecedingNumeric42Bar = true - hasUnderbarPrecedingNumeric123Foo42BarBaz = true - extension += "foo" - class_ = "foo" - int = 1.0 - long = true - boolean = 1L - sealed = "foo" - interface_ = 1F - in_ = 1 - object_ = "foo" - cachedSize_ = "foo" - serializedSize_ = true - value = "foo" - index = 1L - values += "foo" - newValues += "foo" - builder = true - k[1] = 1 - v["foo"] = "foo" - key["foo"] = 1 - map[1] = "foo" - pairs["foo"] = 1 - LeadingUnderscore = "foo" - option = 1 - } - ) - .isEqualTo( - EvilNamesProto3.newBuilder() - .setInitialized(true) - .setHasFoo(true) - .setBar("foo") - .setIsInitialized(true) - .setFooBar("foo") - .addALLCAPS("foo") - .putALLCAPSMAP(1, true) - .setHasUnderbarPrecedingNumeric1Foo(true) - .setHasUnderbarPrecedingNumeric42Bar(true) - .setHasUnderbarPrecedingNumeric123Foo42BarBaz(true) - .addExtension("foo") - .setClass_("foo") - .setInt(1.0) - .setLong(true) - .setBoolean(1L) - .setSealed("foo") - .setInterface(1F) - .setIn(1) - .setObject("foo") - .setCachedSize_("foo") - .setSerializedSize_(true) - .setValue("foo") - .setIndex(1L) - .addValues("foo") - .addNewValues("foo") - .setBuilder(true) - .putK(1, 1) - .putV("foo", "foo") - .putKey("foo", 1) - .putMap(1, "foo") - .putPairs("foo", 1) - .setLeadingUnderscore("foo") - .setOption(1) - .build() - ) - - assertThat(class_ {}).isEqualTo(Class.newBuilder().build()) - } - - @Suppress("CheckResult") - @Test - fun testHardKeywordGettersAndSetters() { - hardKeywordsAllTypesProto3 { - as_ = 1 - assertThat(as_).isEqualTo(1) - - in_ = "foo" - assertThat(in_).isEqualTo("foo") - - break_ = HardKeywordsAllTypesProto3.NestedEnum.FOO - assertThat(break_).isEqualTo(HardKeywordsAllTypesProto3.NestedEnum.FOO) - - do_ = HardKeywordsAllTypesProto3Kt.nestedMessage { while_ = 1 } - assertThat(do_).isEqualTo(HardKeywordsAllTypesProto3Kt.nestedMessage { while_ = 1 }) - - continue_[1] = 1 - assertThat(continue_[1]).isEqualTo(1) - - else_ += 1 - assertThat(else_).isEqualTo(listOf(1)) - - for_ += "foo" - assertThat(for_).isEqualTo(listOf("foo")) - - fun_ += HardKeywordsAllTypesProto3.NestedEnum.FOO - assertThat(fun_).isEqualTo(listOf(HardKeywordsAllTypesProto3.NestedEnum.FOO)) - - if_ += HardKeywordsAllTypesProto3Kt.nestedMessage { while_ = 1 } - assertThat(if_).isEqualTo(listOf(HardKeywordsAllTypesProto3Kt.nestedMessage { while_ = 1 })) - } - } - - @Suppress("CheckResult") - @Test - fun testHardKeywordHazzers() { - hardKeywordsAllTypesProto3 { - as_ = 1 - assertThat(hasAs_()).isTrue() - - in_ = "foo" - assertThat(hasIn_()).isTrue() - - break_ = HardKeywordsAllTypesProto3.NestedEnum.FOO - assertThat(hasBreak_()).isTrue() - - do_ = HardKeywordsAllTypesProto3Kt.nestedMessage { while_ = 1 } - assertThat(hasDo_()).isTrue() - } - } - - @Suppress("CheckResult") - @Test - fun testHardKeywordClears() { - hardKeywordsAllTypesProto3 { - as_ = 1 - clearAs_() - assertThat(hasAs_()).isFalse() - - in_ = "foo" - clearIn_() - assertThat(hasIn_()).isFalse() - - break_ = HardKeywordsAllTypesProto3.NestedEnum.FOO - clearBreak_() - assertThat(hasBreak_()).isFalse() - - do_ = HardKeywordsAllTypesProto3Kt.nestedMessage { while_ = 1 } - clearDo_() - assertThat(hasDo_()).isFalse() - } - } - - @Test - fun testMultipleFiles() { - assertThat(com.google.protobuf.kotlin.generator.multipleFilesMessageA {}) - .isEqualTo(com.google.protobuf.kotlin.generator.MultipleFilesMessageA.newBuilder().build()) - - assertThat(com.google.protobuf.kotlin.generator.multipleFilesMessageB {}) - .isEqualTo(com.google.protobuf.kotlin.generator.MultipleFilesMessageB.newBuilder().build()) - } - - @Test - fun testGetOrNull() { - val noNestedMessage = testAllTypes {} - assertThat(noNestedMessage.optionalNestedMessageOrNull).isEqualTo(null) - - val someNestedMessage = testAllTypes { - optionalNestedMessage = TestAllTypesKt.nestedMessage { bb = 118 } - } - assertThat(someNestedMessage.optionalNestedMessageOrNull) - .isEqualTo(TestAllTypesKt.nestedMessage { bb = 118 }) - - // No optional keyword, OrNull should still be generated - assertThat(someNestedMessage.optionalForeignMessageOrNull).isEqualTo(null) - } -} diff --git a/java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto b/java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto deleted file mode 100644 index b82c82b032a12bf8e83f4e21088c19354af1f50b..0000000000000000000000000000000000000000 --- a/java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto +++ /dev/null @@ -1,46 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -package protobuf.kotlin.test; - -option java_package = "com.google.protobuf.kotlin.test"; -option java_multiple_files = true; - -message ExampleExtensibleMessage { - extensions 10 to 20; -} - -extend ExampleExtensibleMessage { - repeated int32 repeated_extension = 10; - repeated int32 different_extension = 11; - optional int32 int32_extension = 12; -} diff --git a/java/lite.md b/java/lite.md index 5cbfbb1d5fd6cd3c8e3d4cf93d99b6dd9ad4bceb..f248ff6c3e82da881b4e2871f3d557d21bcd4429 100644 --- a/java/lite.md +++ b/java/lite.md @@ -34,6 +34,22 @@ protobuf Java runtime. If you are using Maven, use the following: ``` +## R8 rule to make production app builds work + +The Lite runtime internally uses reflection to avoid generating hashCode/equals/(de)serialization methods. +R8 by default obfuscates the field names, which makes the reflection fail causing exceptions of the form +`java.lang.RuntimeException: Field {NAME}_ for {CLASS} not found. Known fields are [ {FIELDS} ]` in MessageSchema.java. + +There are open issues for this on the [protobuf Github project](https://github.com/protocolbuffers/protobuf/issues/6463) and [R8](https://issuetracker.google.com/issues/144631039). + +Until the issues is resolved you need to add the following line to your `proguard-rules.pro` file inside your project: + +``` +-keep class * extends com.google.protobuf.GeneratedMessageLite { *; } +``` + +## Older versions + For the older version of Java Lite (v3.0.0), please refer to: https://github.com/protocolbuffers/protobuf/blob/javalite/java/lite.md diff --git a/java/lite/pom.xml b/java/lite/pom.xml index 94c577a713eb0d85481004ab4eb8d380c18ba974..d0954837a44318cd18a581a514579b73de2d3b38 100644 --- a/java/lite/pom.xml +++ b/java/lite/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.13.0 + 3.14.0 protobuf-javalite @@ -232,7 +232,7 @@ TestUtil.java TypeRegistryTest.java UnknownEnumValueTest.java - UnknownFieldSetLiteTest.java + UnknownFieldSetLiteTest.java UnknownFieldSetPerformanceTest.java UnknownFieldSetTest.java WellKnownTypesTest.java diff --git a/java/lite/proguard.pgcfg b/java/lite/proguard.pgcfg deleted file mode 100644 index 4bb31e57b25988161585c75680ceac69231b6575..0000000000000000000000000000000000000000 --- a/java/lite/proguard.pgcfg +++ /dev/null @@ -1,3 +0,0 @@ --keepclassmembers class * extends com.google.protobuf.GeneratedMessageLite { - ; -} diff --git a/java/lite/src/test/java/com/google/protobuf/LiteTest.java b/java/lite/src/test/java/com/google/protobuf/LiteTest.java index 3e39bc7c8b4e18d4e27f4549242ba6b1511ba657..7481b69c23bd091cbca9b6c36a905557387c61b6 100644 --- a/java/lite/src/test/java/com/google/protobuf/LiteTest.java +++ b/java/lite/src/test/java/com/google/protobuf/LiteTest.java @@ -42,21 +42,13 @@ import com.google.protobuf.UnittestLite.TestAllExtensionsLite; import com.google.protobuf.UnittestLite.TestAllTypesLite; import com.google.protobuf.UnittestLite.TestAllTypesLite.NestedEnum; import com.google.protobuf.UnittestLite.TestAllTypesLite.NestedMessage; +import com.google.protobuf.UnittestLite.TestAllTypesLite.NestedMessage2; import com.google.protobuf.UnittestLite.TestAllTypesLite.OneofFieldCase; import com.google.protobuf.UnittestLite.TestAllTypesLite.OptionalGroup; import com.google.protobuf.UnittestLite.TestAllTypesLite.RepeatedGroup; import com.google.protobuf.UnittestLite.TestAllTypesLiteOrBuilder; import com.google.protobuf.UnittestLite.TestHugeFieldNumbersLite; import com.google.protobuf.UnittestLite.TestNestedExtensionLite; -import map_lite_test.MapTestProto.TestMap; -import map_lite_test.MapTestProto.TestMap.MessageValue; -import protobuf_unittest.NestedExtensionLite; -import protobuf_unittest.NonNestedExtensionLite; -import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Bar; -import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.BarPrime; -import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Foo; -import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.TestOneofEquals; -import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.TestRecursiveOneof; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -68,6 +60,15 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; import junit.framework.TestCase; +import map_lite_test.MapTestProto.TestMap; +import map_lite_test.MapTestProto.TestMap.MessageValue; +import protobuf_unittest.NestedExtensionLite; +import protobuf_unittest.NonNestedExtensionLite; +import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Bar; +import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.BarPrime; +import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Foo; +import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.TestOneofEquals; +import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.TestRecursiveOneof; /** * Test lite runtime. @@ -180,16 +181,24 @@ public class LiteTest extends TestCase { TestAllExtensionsLite message = TestUtilLite.getAllLiteExtensionsSet(); // Test serialized size is memoized - message.memoizedSerializedSize = -1; + assertEquals( + GeneratedMessageLite.UNINITIALIZED_SERIALIZED_SIZE, + message.getMemoizedSerializedSize()); int size = message.getSerializedSize(); assertTrue(size > 0); - assertEquals(size, message.memoizedSerializedSize); + assertEquals(size, message.getMemoizedSerializedSize()); + message.clearMemoizedSerializedSize(); + assertEquals( + GeneratedMessageLite.UNINITIALIZED_SERIALIZED_SIZE, + message.getMemoizedSerializedSize()); // Test hashCode is memoized - assertEquals(0, message.memoizedHashCode); + assertTrue(message.hashCodeIsNotMemoized()); int hashCode = message.hashCode(); - assertTrue(hashCode != 0); - assertEquals(hashCode, message.memoizedHashCode); + assertFalse(message.hashCodeIsNotMemoized()); + assertEquals(hashCode, message.getMemoizedHashCode()); + message.clearMemoizedHashCode(); + assertTrue(message.hashCodeIsNotMemoized()); // Test isInitialized is memoized Field memo = message.getClass().getDeclaredField("memoizedIsInitialized"); @@ -1354,6 +1363,45 @@ public class LiteTest extends TestCase { assertEquals(message.getSerializedSize() * 2, result.getSerializedSize()); } + public void testMergeFrom_differentFieldsSetWithinOneField() throws Exception { + TestAllTypesLite result = + TestAllTypesLite.newBuilder() + .setOneofNestedMessage(NestedMessage.newBuilder().setBb(2)) + .mergeFrom( + TestAllTypesLite.newBuilder() + .setOneofNestedMessage2(NestedMessage2.newBuilder().setDd(3)) + .build()) + .build(); + + assertToStringEquals("oneof_nested_message2 {\n dd: 3\n}", result); + } + + public void testMergeFrom_differentFieldsOfSameTypeSetWithinOneField() throws Exception { + TestAllTypesLite result = + TestAllTypesLite.newBuilder() + .setOneofNestedMessage(NestedMessage.newBuilder().setBb(2)) + .mergeFrom( + TestAllTypesLite.newBuilder() + .setOneofLazyNestedMessage(NestedMessage.newBuilder().setCc(3)) + .build()) + .build(); + + assertToStringEquals("oneof_lazy_nested_message {\n cc: 3\n}", result); + } + + public void testMergeFrom_sameFieldSetWithinOneofField() throws Exception { + TestAllTypesLite result = + TestAllTypesLite.newBuilder() + .setOneofNestedMessage(NestedMessage.newBuilder().setBb(2)) + .mergeFrom( + TestAllTypesLite.newBuilder() + .setOneofNestedMessage(NestedMessage.newBuilder().setCc(4)) + .build()) + .build(); + + assertToStringEquals("oneof_nested_message {\n bb: 2\n cc: 4\n}", result); + } + public void testToStringDefaultInstance() throws Exception { assertToStringEquals("", TestAllTypesLite.getDefaultInstance()); } diff --git a/java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java b/java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java index 57e933f3a42ef2c6636f41bb7b66625742ebaea6..a17dda5c1f1735a25c48491e2b27510064ce5653 100644 --- a/java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java +++ b/java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java @@ -174,8 +174,9 @@ public final class Proto2MessageLiteInfoFactory implements MessageInfoFactory { "fieldRequiredSint6487_", "fieldRequiredGroup88_", }; - // To update this after a proto change, run protoc on proto2_message_lite.proto and copy over - // the content of the generated buildMessageInfo() method here. + // To update this after a proto change, run blaze build on proto2_message_lite.proto and copy + // over the String info from the proto2_message_lite_proto-lite-src.jar file in the + // blaze-genfiles directory. java.lang.String info = "\u0001U\u0001\u0002\u0001XU\u0000 \u0015\u0001\u1000\u0000\u0002\u1001\u0001\u0003" + "\u1002\u0002\u0004\u1003\u0003\u0005\u1004\u0004\u0006\u1005\u0005\u0007\u1006\u0006\b\u1007\u0007" diff --git a/java/osgi/BUILD.bazel b/java/osgi/BUILD.bazel deleted file mode 100644 index 223e6fea733c893f0999b8f97c053e548e35862d..0000000000000000000000000000000000000000 --- a/java/osgi/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -load("@rules_java//java:defs.bzl", "java_binary") - -package( - default_visibility = ["//java:__subpackages__"], -) - -java_binary( - name = "osgi_wrapper", - srcs = ["OsgiWrapper.java"], - main_class = "com.google.protobuf.osgi.OsgiWrapper", - deps = [ - "@maven//:biz_aQute_bnd_biz_aQute_bndlib", - "@maven//:com_google_guava_guava", - "@maven//:info_picocli_picocli", - ], -) diff --git a/java/osgi/OsgiWrapper.java b/java/osgi/OsgiWrapper.java deleted file mode 100644 index e917ae60f39b464ed99632cf99f62d9e70d2ba26..0000000000000000000000000000000000000000 --- a/java/osgi/OsgiWrapper.java +++ /dev/null @@ -1,143 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -package com.google.protobuf.osgi; - -import aQute.bnd.osgi.Analyzer; -import aQute.bnd.osgi.Jar; -import java.io.File; -import java.util.Arrays; -import java.util.concurrent.Callable; -import java.util.jar.Manifest; -import java.util.stream.Collectors; -import picocli.CommandLine; -import picocli.CommandLine.Command; -import picocli.CommandLine.Option; - -/** Java binary that runs bndlib to analyze a jar file to generate OSGi bundle manifest. */ -@Command(name = "osgi_wrapper") -public final class OsgiWrapper implements Callable { - private static final String REMOVEHEADERS = - Arrays.stream( - new String[] { - "Embed-Dependency", - "Embed-Transitive", - "Built-By", - // "Tool", - "Created-By", - // "Build-Jdk", - "Originally-Created-By", - "Archiver-Version", - "Include-Resource", - "Private-Package", - "Ignore-Package", - // "Bnd-LastModified", - "Target-Label" - }) - .collect(Collectors.joining(",")); - - @Option( - names = {"--input_jar"}, - description = "The jar file to wrap with OSGi metadata") - private File inputJar; - - @Option( - names = {"--output_jar"}, - description = "Output path to the wrapped jar") - private File outputJar; - - @Option( - names = {"--classpath"}, - description = "The classpath that contains dependencies of the input jar, separated with :") - private String classpath; - - @Option( - names = {"--bundle_copyright"}, - description = "Copyright string for the bundle") - private String bundleCopyright; - - @Option( - names = {"--bundle_description"}, - description = "Description of the bundle") - private String bundleDescription; - - @Option( - names = {"--bundle_doc_url"}, - description = "Documentation URL for the bundle") - private String bundleDocUrl; - - @Option( - names = {"--bundle_license"}, - description = "URL for the license of the bundle") - private String bundleLicense; - - @Option( - names = {"--bundle_name"}, - description = "The name of the bundle") - private String bundleName; - - @Option( - names = {"--bundle_symbolic_name"}, - description = "The symbolic name of the bundle") - private String bundleSymbolicName; - - @Option( - names = {"--bundle_version"}, - description = "The version of the bundle") - private String bundleVersion; - - @Option( - names = {"--export_package"}, - description = "The exported packages from this bundle") - private String exportPackage; - - @Option( - names = {"--import_package"}, - description = "The imported packages from this bundle") - private String importPackage; - - @Override - public Integer call() throws Exception { - Jar bin = new Jar(inputJar); - - Analyzer analyzer = new Analyzer(); - analyzer.setJar(bin); - analyzer.setProperty(Analyzer.BUNDLE_NAME, bundleName); - analyzer.setProperty(Analyzer.BUNDLE_SYMBOLICNAME, bundleSymbolicName); - analyzer.setProperty(Analyzer.BUNDLE_VERSION, bundleVersion); - analyzer.setProperty(Analyzer.IMPORT_PACKAGE, importPackage); - analyzer.setProperty(Analyzer.EXPORT_PACKAGE, exportPackage); - analyzer.setProperty(Analyzer.BUNDLE_DESCRIPTION, bundleDescription); - analyzer.setProperty(Analyzer.BUNDLE_COPYRIGHT, bundleCopyright); - analyzer.setProperty(Analyzer.BUNDLE_DOCURL, bundleDocUrl); - analyzer.setProperty(Analyzer.BUNDLE_LICENSE, bundleLicense); - analyzer.setProperty(Analyzer.REMOVEHEADERS, REMOVEHEADERS); - - if (classpath != null) { - for (String dep : Arrays.asList(classpath.split(":"))) { - analyzer.addClasspath(new File(dep)); - } - } - - analyzer.analyze(); - - Manifest manifest = analyzer.calcManifest(); - - if (analyzer.isOk()) { - analyzer.getJar().setManifest(manifest); - if (analyzer.save(outputJar, true)) { - return 0; - } - } - return 1; - } - - public static void main(String[] args) { - int exitCode = new CommandLine(new OsgiWrapper()).execute(args); - System.exit(exitCode); - } -} diff --git a/java/osgi/osgi.bzl b/java/osgi/osgi.bzl deleted file mode 100644 index 40ee0842a556144d5af2b0ad82abf6505ea5fb23..0000000000000000000000000000000000000000 --- a/java/osgi/osgi.bzl +++ /dev/null @@ -1,240 +0,0 @@ -""" Custom rule to generate OSGi Manifest """ - -load("@rules_java//java:defs.bzl", "java_library") - -# Note that this rule is currently agnostic of protobuf concerns and could be -# pulled out as a general purpose helper to allow migrations from maven to bazel -# for OSS release builds. -# -# There are (at least) 3 things that would nice to fix about this rule: -# 1. `deps` are captured by wrapping the java_library target into the -# osgi_java_library target -- if possible, it would be better to get -# the deps from the JavaInfo or some other provider from any java_library -# target. -# 2. imports are probably not being calculated properly for deps that are more -# than 1 step deep in the dependency chain. For example: //java:core depends -# on //java/core:lite_runtime_only but does not calculate the need for -# "sun.misc" like the //java/core:lite target does (even though the same code -# is transitively included. Those imports can be explicitly added through -# `bundle_additional_imports`, but it would be better if the calculation -# applied correctly to transitive dependencies. -# 3. Versioned imports didn't work properly when an ijar is used as the -# "compile_jar". Thus, this rule uses the full jar as the compile_jar, -# which is probably sub-optimal. -def osgi_java_library( - name, - bundle_description, - bundle_doc_url, - bundle_license, - bundle_name, - bundle_symbolic_name, - bundle_version, - bundle_additional_imports = [], - bundle_additional_exports = [], - deps = [], - exports = [], - exported_plugins = [], - neverlink = False, - runtime_deps = [], - visibility = [], - **kwargs): - """Extends `java_library` to add OSGi headers to the MANIFEST.MF using bndlib - - This macro should be usable as a drop-in replacement for java_library. - - The additional arguments are given the bndlib tool to generate an OSGi-compliant manifest file. - See [bnd documentation](https://bnd.bndtools.org/chapters/110-introduction.html) - - Args: - name: (required) A unique name for this target. - bundle_description: (required) The Bundle-Description header defines a short - description of this bundle. - bundle_doc_url: (required) The Bundle-DocURL headers must contain a URL pointing - to documentation about this bundle. - bundle_license: (required) The Bundle-License header provides an optional machine - readable form of license information. - bundle_name: (required) The Bundle-Name header defines a readable name for this - bundle. This should be a short, human-readable name that can - contain spaces. - bundle_symbolic_name: (required) The Bundle-SymbolicName header specifies a - non-localizable name for this bundle. The bundle symbolic name - together with a version must identify a unique bundle though it can - be installed multiple times in a framework. The bundle symbolic - name should be based on the reverse domain name convention. - bundle_version: (required) The Bundle-Version header specifies the version string - for this bundle. The version string is expected to follow semantic - versioning conventions MAJOR.MINOR.PATCH[.BUILD] - bundle_additional_exports: The Export-Package header contains a - declaration of exported packages. These are additional export - package statements to be added before the default wildcard export - "*;version={$Bundle-Version}". - bundle_additional_imports: The Import-Package header declares the - imported packages for this bundle. These are additional import - package statements to be added before the default wildcard import - "*". - deps: The list of libraries to link into this library. See general - comments about deps at Typical attributes defined by most build - rules. The jars built by java_library rules listed in deps will be - on the compile-time classpath of this rule. Furthermore the - transitive closure of their deps, runtime_deps and exports will be - on the runtime classpath. By contrast, targets in the data - attribute are included in the runfiles but on neither the - compile-time nor runtime classpath. - exports: Exported libraries. - exported_plugins: The list of java_plugins (e.g. annotation processors) - to export to libraries that directly depend on this library. The - specified list of java_plugins will be applied to any library which - directly depends on this library, just as if that library had - explicitly declared these labels in plugins. - neverlink: Whether this library should only be used for compilation and - not at runtime. Useful if the library will be provided by the runtime - environment during execution. Examples of such libraries are the IDE - APIs for IDE plug-ins or tools.jar for anything running on a standard - JDK. - runtime_deps: Libraries to make available to the final binary or test - at runtime only. Like ordinary deps, these will appear on the runtime - classpath, but unlike them, not on the compile-time classpath. - Dependencies needed only at runtime should be listed here. - Dependency-analysis tools should ignore targets that appear in both - runtime_deps and deps - visibility: The visibility attribute on a target controls whether the - target can be used in other packages. See the documentation for - visibility. - **kwargs: Additional key-word arguments that are passed to the internal - java_library target. - """ - - # Build the private jar without the OSGI manifest - private_library_name = "%s-no-manifest-do-not-use" % name - java_library( - name = private_library_name, - deps = deps, - runtime_deps = runtime_deps, - neverlink = True, - exported_plugins = exported_plugins, - visibility = ["//visibility:private"], - **kwargs - ) - - # Repackage the jar with an OSGI manifest - _osgi_jar( - name = name, - bundle_description = bundle_description, - bundle_doc_url = bundle_doc_url, - bundle_license = bundle_license, - bundle_name = bundle_name, - bundle_symbolic_name = bundle_symbolic_name, - bundle_version = bundle_version, - export_package = bundle_additional_exports + ["*;version=${Bundle-Version}"], - import_package = bundle_additional_imports + ["*"], - target = private_library_name, - deps = deps, - runtime_deps = runtime_deps, - exported_plugins = exported_plugins, - neverlink = neverlink, - exports = exports, - visibility = visibility, - ) - -def _run_osgi_wrapper(ctx, input_jar, classpath_jars, output_jar): - args = ctx.actions.args() - args.add_joined("--classpath", classpath_jars, join_with = ":") - args.add("--input_jar", input_jar.path) - args.add("--output_jar", output_jar.path) - args.add("--bundle_copyright", ctx.attr.bundle_copyright) - args.add("--bundle_description", ctx.attr.bundle_description) - args.add("--bundle_doc_url", ctx.attr.bundle_doc_url) - args.add("--bundle_license", ctx.attr.bundle_license) - args.add("--bundle_name", ctx.attr.bundle_name) - args.add("--bundle_version", ctx.attr.bundle_version) - args.add("--bundle_symbolic_name", ctx.attr.bundle_symbolic_name) - args.add_joined("--export_package", ctx.attr.export_package, join_with = ",") - args.add_joined("--import_package", ctx.attr.import_package, join_with = ",") - - ctx.actions.run( - inputs = [input_jar] + classpath_jars, - executable = ctx.executable._osgi_wrapper_exe, - arguments = [args], - outputs = [output_jar], - progress_message = "Generating OSGi bundle Manifest for %s" % input_jar.path, - ) - -def _osgi_jar_impl(ctx): - if len(ctx.attr.target[JavaInfo].java_outputs) != 1: - fail("osgi_jar rule can only be used on a single java target.") - target_java_output = ctx.attr.target[JavaInfo].java_outputs[0] - - # source_jars may be a list or a Depset due to: - # https://github.com/bazelbuild/bazel/issues/18966 - source_jars = target_java_output.source_jars - if hasattr(source_jars, "to_list"): - source_jars = source_jars.to_list() - if len(source_jars) > 1: - fail("osgi_jar rule doesn't know how to deal with more than one source jar.") - source_jar = target_java_output.source_jars[0] - - output_jar = ctx.outputs.output_jar - - input_jar = target_java_output.class_jar - classpath_jars = ctx.attr.target[JavaInfo].compilation_info.compilation_classpath.to_list() - - _run_osgi_wrapper(ctx, input_jar, classpath_jars, output_jar) - - return [ - DefaultInfo( - files = depset([output_jar]), - # Workaround for https://github.com/bazelbuild/bazel/issues/15043 - # Bazel's native rule such as sh_test do not pick up 'files' in - # DefaultInfo for a target in 'data'. - data_runfiles = ctx.runfiles([output_jar]), - ), - JavaInfo( - output_jar = output_jar, - - # compile_jar should be an ijar, but using an ijar results in - # missing protobuf import version. - compile_jar = output_jar, - source_jar = source_jar, - compile_jdeps = target_java_output.compile_jdeps, - generated_class_jar = target_java_output.generated_class_jar, - generated_source_jar = target_java_output.generated_source_jar, - native_headers_jar = target_java_output.native_headers_jar, - manifest_proto = target_java_output.manifest_proto, - neverlink = ctx.attr.neverlink, - deps = [dep[JavaInfo] for dep in ctx.attr.deps], - runtime_deps = [dep[JavaInfo] for dep in ctx.attr.runtime_deps], - exports = [exp[JavaInfo] for exp in ctx.attr.exports], - exported_plugins = ctx.attr.exported_plugins, - jdeps = target_java_output.jdeps, - ), - ] - -_osgi_jar = rule( - implementation = _osgi_jar_impl, - outputs = { - "output_jar": "lib%{name}.jar", - }, - attrs = { - "bundle_copyright": attr.string(), - "bundle_description": attr.string(), - "bundle_doc_url": attr.string(), - "bundle_license": attr.string(), - "bundle_name": attr.string(), - "bundle_version": attr.string(), - "bundle_symbolic_name": attr.string(), - "export_package": attr.string_list(), - "import_package": attr.string_list(), - "target": attr.label(), - "deps": attr.label_list(), - "runtime_deps": attr.label_list(), - "exports": attr.label_list(), - "neverlink": attr.bool(), - "exported_plugins": attr.label_list(), - "_osgi_wrapper_exe": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//java/osgi:osgi_wrapper"), - ), - }, -) diff --git a/java/pom.xml b/java/pom.xml index bb91146fd20596338e8b659d8073357e3e561fb4..3283268afcb411e9f8efee209214ba3b6cd4997f 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.13.0 + 3.14.0 pom Protocol Buffers [Parent] @@ -75,7 +75,7 @@ junit junit - 4.13 + 4.13.1 test diff --git a/java/protoc/README.md b/java/protoc/README.md deleted file mode 100644 index a31ffbe8224736607faf85ff74b9d26debc1bd33..0000000000000000000000000000000000000000 --- a/java/protoc/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Publish pre-compiled protoc artifacts -``protoc`` is the compiler for ``.proto`` files. It generates language bindings -for the messages and/or RPC services from ``.proto`` files. - -Because ``protoc`` is a native executable, the scripts under this directory -publish a ``protoc`` executable (a.k.a. artifact) to Maven repositories. The -artifact can be used by build automation tools so that users would not need to -compile and install ``protoc`` for their systems. - -If you would like us to publish protoc artifact for a new platform, please -open an issue to request it. - -## Maven Location -The published protoc artifacts are available on Maven here: - - https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/ - -## Versioning -The version of the ``protoc`` artifact must be the same as the version of the -Protobuf project. - -## Artifact name -The name of a published ``protoc`` artifact is in the following format: -``protoc---.exe``, e.g., ``protoc-3.6.1-linux-x86_64.exe``. - -Note that artifacts for linux/macos also have the `.exe` suffix but they are -not windows binaries. - -## System requirement -Install [Apache Maven](http://maven.apache.org/) if you don't have it. - -The scripts only work under Unix-like environments, e.g., Linux, MacOSX, and -Cygwin or MinGW for Windows. Please see ``README.md`` of the Protobuf project -for how to set up the build environment. - -## Tested build environments -We have successfully built artifacts on the following environments: -- Linux x86_32 and x86_64: - - Centos 6.9 (within Docker 1.6.1) - - Ubuntu 14.04.5 64-bit -- Linux aarch_64: Cross compiled with `g++-aarch64-linux-gnu` on Ubuntu 14.04.5 64-bit -- Mac OS X x86_32 and x86_64: Mac OS X 10.9.5 diff --git a/java/protoc/pom.xml b/java/protoc/pom.xml deleted file mode 100644 index c01d9fce10367a0a475603ae81593b89d3403407..0000000000000000000000000000000000000000 --- a/java/protoc/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 4.0.0 - - com.google - google - 5 - - com.google.protobuf - protoc - 3.25.2 - pom - Protobuf Compiler - - Protobuf Compiler (protoc) is a compiler for .proto files. It generates - language-specific code for Protobuf messages and RPC interfaces. - - 2008 - https://developers.google.com/protocol-buffers/ - - - BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause - repo - - - - https://github.com/protocolbuffers/protobuf - - scm:git:https://github.com/protocolbuffers/protobuf.git - - - diff --git a/java/util/BUILD b/java/util/BUILD index cfdb28e2e177d5d50dfc9a9999dd7eb78cc30f27..71f73bab10dcf9c29f66b82cb0d3eb4a52461ac4 100644 --- a/java/util/BUILD +++ b/java/util/BUILD @@ -5,10 +5,6 @@ java_library( srcs = glob([ "src/main/java/com/google/protobuf/util/*.java", ]), - javacopts = [ - "-source 7", - "-target 7", - ], visibility = ["//visibility:public"], deps = [ "//external:error_prone_annotations", diff --git a/java/util/pom.xml b/java/util/pom.xml index 54dcc869078bd5f9d2b3ec915fe0b30774c4f457..75457fbc8ea72e14da0d432e4073c574deb48352 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.13.0 + 3.14.0 protobuf-java-util diff --git a/java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java b/java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java index 4092b30683a65a5f4e081367fd2e64943a1efc2f..2aa0916f06255e2c0c7385e01700fd7d1e2dd2e0 100644 --- a/java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java +++ b/java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java @@ -35,6 +35,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.FieldMask; +import com.google.protobuf.GeneratedMessage; import com.google.protobuf.Message; import java.util.ArrayList; import java.util.List; @@ -137,11 +138,19 @@ final class FieldMaskTree { } /** - * Remove {@code path} from the tree. + * Removes {@code path} from the tree. * - *

      When removing a field path from the tree, all sub-paths will be removed. That is, after - * removing "foo.bar" from the tree, "foo.bar.baz" will be removed. Likewise, if the field path to - * remove is a non-exist sub-path, nothing will be changed. + *

        + * When removing a field path from the tree: + *
      • All sub-paths will be removed. That is, after removing "foo.bar" from the tree, + * "foo.bar.baz" will be removed. + *
      • If all children of a node has been removed, the node itself will be removed as well. + * That is, if "foo" only has one child "bar" and "foo.bar" only has one child "baz", + * removing "foo.bar.barz" would remove both "foo" and "foo.bar". + * If "foo" has both "bar" and "qux" as children, removing "foo.bar" would leave the path + * "foo.qux" intact. + *
      • If the field path to remove is a non-exist sub-path, nothing will be changed. + *
      */ @CanIgnoreReturnValue FieldMaskTree removeFieldPath(String path) { @@ -149,23 +158,35 @@ final class FieldMaskTree { if (parts.isEmpty()) { return this; } - Node node = root; - for (int i = 0; i < parts.size(); i++) { - String key = parts.get(i); - if (!node.children.containsKey(key)) { - // Path does not exist. - return this; - } - if (i == parts.size() - 1) { - // Remove path. - node.children.remove(key); - return this; - } - node = node.children.get(key); - } + removeFieldPath(root, parts, 0); return this; } + /** + * Removes {@code parts} from {@code node} recursively. + * + * @return a boolean value indicating whether current {@code node} should be removed. + */ + @CanIgnoreReturnValue + private static boolean removeFieldPath(Node node, List parts, int index) { + String key = parts.get(index); + + // Base case 1: path not match. + if (!node.children.containsKey(key)) { + return false; + } + // Base case 2: last element in parts. + if (index == parts.size() - 1) { + node.children.remove(key); + return node.children.isEmpty(); + } + // Recursive remove sub-path. + if (removeFieldPath(node.children.get(key), parts, index + 1)) { + node.children.remove(key); + } + return node.children.isEmpty(); + } + /** Removes all field paths in {@code mask} from this tree. */ @CanIgnoreReturnValue FieldMaskTree removeFromFieldMask(FieldMask mask) { @@ -187,10 +208,8 @@ final class FieldMaskTree { return FieldMask.newBuilder().addAllPaths(paths).build(); } - /** - * Gathers all field paths in a sub-tree. - */ - private void getFieldPaths(Node node, String path, List paths) { + /** Gathers all field paths in a sub-tree. */ + private static void getFieldPaths(Node node, String path, List paths) { if (node.children.isEmpty()) { paths.add(path); return; @@ -247,10 +266,8 @@ final class FieldMaskTree { merge(root, "", source, destination, options); } - /** - * Merges all fields specified by a sub-tree from {@code source} to {@code destination}. - */ - private void merge( + /** Merges all fields specified by a sub-tree from {@code source} to {@code destination}. */ + private static void merge( Node node, String path, Message source, @@ -288,9 +305,12 @@ final class FieldMaskTree { // so we don't create unnecessary empty messages. continue; } - String childPath = path.isEmpty() ? entry.getKey() : path + "." + entry.getKey(); - Message.Builder childBuilder = ((Message) destination.getField(field)).toBuilder(); - merge(entry.getValue(), childPath, (Message) source.getField(field), childBuilder, options); + // This is a mess because of java proto API 1 still hanging around. + Message.Builder childBuilder = + destination instanceof GeneratedMessage.Builder + ? destination.getFieldBuilder(field) + : ((Message) destination.getField(field)).toBuilder(); + merge(entry.getValue(), path, (Message) source.getField(field), childBuilder, options); destination.setField(field, childBuilder.buildPartial()); continue; } diff --git a/java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java b/java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java index 0c2f90c91e065426de6243903b4c3146d576da03..c32d10a2639c22bf15296eebe83b30ef97c2fe9f 100644 --- a/java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java +++ b/java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java @@ -276,7 +276,13 @@ public final class FieldMaskUtil { return maskTree.toFieldMask(); } - /** Subtracts {@code secondMask} and {@code otherMasks} from {@code firstMask}. */ + /** + * Subtracts {@code secondMask} and {@code otherMasks} from {@code firstMask}. + * + *

      This method disregards proto structure. That is, if {@code firstMask} is "foo" and {@code + * secondMask} is "foo.bar", the response will always be "foo" without considering the internal + * proto structure of message "foo". + */ public static FieldMask subtract( FieldMask firstMask, FieldMask secondMask, FieldMask... otherMasks) { FieldMaskTree maskTree = new FieldMaskTree(firstMask).removeFromFieldMask(secondMask); diff --git a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java index 67981435d12de7c55905a4627f28fdc0244f3b33..4f2fe3fcfa4b7fd815f63f6b46a644844ea35cf6 100644 --- a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java +++ b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java @@ -328,14 +328,13 @@ public class JsonFormat { /** * Create a new {@link Printer} that will sort the map keys in the JSON output. * - * Use of this modifier is discouraged, the generated JSON messages are equivalent - * with and without this option set, but there are some corner caseuse cases that - * demand a stable output, while order of map keys is otherwise arbitrary. + *

      Use of this modifier is discouraged, the generated JSON messages are equivalent with and + * without this option set, but there are some corner use cases that demand a stable output, + * while order of map keys is otherwise arbitrary. * - * The generated order is not well-defined and should not be depended on, but - * it's stable. + *

      The generated order is not well-defined and should not be depended on, but it's stable. * - * This new Printer clones all other configurations from the current {@link Printer}. + *

      This new Printer clones all other configurations from the current {@link Printer}. */ public Printer sortingMapKeys() { return new Printer( @@ -526,7 +525,6 @@ public class JsonFormat { return types.get(name); } - /* @Nullable */ Descriptor getDescriptorForTypeUrl(String typeUrl) throws InvalidProtocolBufferException { return find(getTypeName(typeUrl)); } diff --git a/java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java b/java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java index 7ec37d097b051ce633b554651178208fa63e4487..c8297226f77a4fe56681ab4f898f508d508f9c04 100644 --- a/java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java +++ b/java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java @@ -77,25 +77,37 @@ public class FieldMaskTreeTest extends TestCase { public void testRemoveFieldPath() throws Exception { String initialTreeString = "bar.baz,bar.quz.bar,foo"; - FieldMaskTree tree = new FieldMaskTree(FieldMaskUtil.fromString(initialTreeString)); + FieldMaskTree tree; + // Empty path. + tree = new FieldMaskTree(FieldMaskUtil.fromString(initialTreeString)); tree.removeFieldPath(""); assertEquals(initialTreeString, tree.toString()); + // Non-exist sub-path of an existing leaf. + tree = new FieldMaskTree(FieldMaskUtil.fromString(initialTreeString)); tree.removeFieldPath("foo.bar"); assertEquals(initialTreeString, tree.toString()); + // Non-exist path. + tree = new FieldMaskTree(FieldMaskUtil.fromString(initialTreeString)); tree.removeFieldPath("bar.foo"); assertEquals(initialTreeString, tree.toString()); - // Match an existing leaf node. + + // Match an existing leaf node -> remove leaf node. + tree = new FieldMaskTree(FieldMaskUtil.fromString(initialTreeString)); tree.removeFieldPath("foo"); assertEquals("bar.baz,bar.quz.bar", tree.toString()); - // Match sub-path of an existing leaf node. + + // Match sub-path of an existing leaf node -> recursive removal. + tree = new FieldMaskTree(FieldMaskUtil.fromString(initialTreeString)); tree.removeFieldPath("bar.quz.bar"); - assertEquals("bar.baz,bar.quz", tree.toString()); - // Match a non-leaf node. + assertEquals("bar.baz,foo", tree.toString()); + + // Match a non-leaf node -> remove all children. + tree = new FieldMaskTree(FieldMaskUtil.fromString(initialTreeString)); tree.removeFieldPath("bar"); - assertThat(tree.toString()).isEmpty(); + assertEquals("foo", tree.toString()); } public void testRemoveFromFieldMask() throws Exception { diff --git a/java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java b/java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java index 796020eaf2a385e08ec8a03e04e904399edc65a5..28e43a7bf77b32c4f473700b731f1e44cb4cbd8b 100644 --- a/java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java +++ b/java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java @@ -239,7 +239,7 @@ public class FieldMaskUtilTest extends TestCase { FieldMask mask3 = FieldMaskUtil.fromString("bar.quz"); FieldMask mask4 = FieldMaskUtil.fromString("foo,bar.baz"); FieldMask result = FieldMaskUtil.subtract(mask1, mask2, mask3, mask4); - assertEquals("bar", FieldMaskUtil.toString(result)); + assertThat(FieldMaskUtil.toString(result)).isEmpty(); } public void testIntersection() throws Exception { diff --git a/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java b/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java index f9358e522141247595feaf7785986bbca084cbd2..46d3cc4c352cf6aa4d919891388ccc21806904e5 100644 --- a/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java +++ b/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java @@ -722,8 +722,8 @@ public class JsonFormatTest extends TestCase { mergeFromJson( "{\n" + " int32ToInt32Map: {1: 2},\n" + " stringToInt32Map: {hello: 3}\n" + "}", builder); TestMap message = builder.build(); - assertEquals(2, message.getInt32ToInt32Map().get(1).intValue()); - assertEquals(3, message.getStringToInt32Map().get("hello").intValue()); + assertEquals(2, message.getInt32ToInt32MapMap().get(1).intValue()); + assertEquals(3, message.getStringToInt32MapMap().get("hello").intValue()); } public void testWrappers() throws Exception { diff --git a/js/binary/constants.js b/js/binary/constants.js index f8b13a8b9e370eb3f393f58d152c66f675bf69d2..d2e62e5b0f6cfb353b871bca55f3f8b5987c94a9 100644 --- a/js/binary/constants.js +++ b/js/binary/constants.js @@ -31,6 +31,7 @@ /** * @fileoverview This file contains constants and typedefs used by * jspb.BinaryReader and BinaryWriter. + * @suppress {missingRequire} TODO(b/152540451): this shouldn't be needed * * @author aappleby@google.com (Austin Appleby) */ diff --git a/js/binary/decoder.js b/js/binary/decoder.js index 257c283f09a7e5150d173b2410973c3663610d43..fb40ec99e3f086ae5c239fe54ae34695553266a0 100644 --- a/js/binary/decoder.js +++ b/js/binary/decoder.js @@ -40,6 +40,7 @@ * intact, you _must_ read them using one of the Hash64 methods, which return * an 8-character string. * + * @suppress {missingRequire} TODO(b/152540451): this shouldn't be needed * @author aappleby@google.com (Austin Appleby) */ diff --git a/js/binary/reader.js b/js/binary/reader.js index 2af1a4ac393a660f6c2165aed3dd6d59ed9dac28..31bbfda4388599876fc8d19bb3a29423589bd657 100644 --- a/js/binary/reader.js +++ b/js/binary/reader.js @@ -41,6 +41,7 @@ * using the typed jspb code generator, but if you bypass that you'll need * to keep things in sync by hand. * + * @suppress {missingRequire} TODO(b/152540451): this shouldn't be needed * @author aappleby@google.com (Austin Appleby) */ @@ -206,6 +207,15 @@ jspb.BinaryReader.prototype.getWireType = function() { }; +/** + * @return {boolean} Whether the current wire type is a delimited field. Used to + * conditionally parse packed repeated fields. + */ +jspb.BinaryReader.prototype.isDelimited = function() { + return this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED; +}; + + /** * @return {boolean} Whether the current wire type is an end-group tag. Used as * an exit condition in decoder loops in generated code. diff --git a/js/binary/utils.js b/js/binary/utils.js index 0d55a4ad366ea90f931834bc3b69703ec01543fc..6cd15e36445dcc7c4df380b677b48316c76491db 100644 --- a/js/binary/utils.js +++ b/js/binary/utils.js @@ -32,6 +32,7 @@ * @fileoverview This file contains helper code used by jspb.BinaryReader * and BinaryWriter. * + * @suppress {missingRequire} TODO(b/152540451): this shouldn't be needed * @author aappleby@google.com (Austin Appleby) */ @@ -258,7 +259,7 @@ jspb.utils.splitFloat64 = function(value) { // Compute the least significant exponent needed to represent the magnitude of // the value by repeadly dividing/multiplying by 2 until the magnitude // crosses 2. While tempting to use log math to find the exponent, at the - // bounadaries of precision, the result can be off by one. + // boundaries of precision, the result can be off by one. var maxDoubleExponent = 1023; var minDoubleExponent = -1022; var x = value; diff --git a/js/binary/writer.js b/js/binary/writer.js index ab9a815056022caf65919c9af71d9ae5a7ae00bf..1e2beee3e94e4453618ad8c69a2558a94c5c211d 100644 --- a/js/binary/writer.js +++ b/js/binary/writer.js @@ -52,6 +52,7 @@ * Major caveat 3 - This class uses typed arrays and must not be used on older * browsers that do not support them. * + * @suppress {missingRequire} TODO(b/152540451): this shouldn't be needed * @author aappleby@google.com (Austin Appleby) */ diff --git a/js/experimental/runtime/kernel/kernel_test.js b/js/experimental/runtime/kernel/kernel_test.js index e72be4f3b62648aa937dbb22f8879ac9bdf4a904..eba7c4a55a2de8b929fd2f3777cd128e759f94ef 100644 --- a/js/experimental/runtime/kernel/kernel_test.js +++ b/js/experimental/runtime/kernel/kernel_test.js @@ -699,7 +699,7 @@ describe('Bytes access', () => { expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer( createArrayBuffer(0x0A, 0x01, 0x00, 0x0A, 0x01, 0x01)); expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString); @@ -801,7 +801,7 @@ describe('Fixed32 access', () => { expect(accessor.getFixed32WithDefault(1)).toEqual(1); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer( 0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00)); expect(accessor.getFixed32WithDefault(1)).toEqual(2); @@ -909,7 +909,7 @@ describe('Fixed64 access', () => { expect(accessor.getFixed64WithDefault(1)).toEqual(Int64.fromInt(1)); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer( 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)); @@ -1008,7 +1008,7 @@ describe('Float access', () => { expect(accessor.getFloatWithDefault(1)).toEqual(1); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer( 0x0D, 0x00, 0x00, 0x80, 0x3F, 0x0D, 0x00, 0x00, 0x80, 0xBF)); expect(accessor.getFloatWithDefault(1)).toEqual(-1); @@ -1110,7 +1110,7 @@ describe('Int32 access', () => { expect(accessor.getInt32WithDefault(1)).toEqual(1); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); expect(accessor.getInt32WithDefault(1)).toEqual(2); @@ -1207,7 +1207,7 @@ describe('Int64 access', () => { expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(1)); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(2)); @@ -1306,7 +1306,7 @@ describe('Sfixed32 access', () => { expect(accessor.getSfixed32WithDefault(1)).toEqual(1); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer( 0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00)); expect(accessor.getSfixed32WithDefault(1)).toEqual(2); @@ -1404,7 +1404,7 @@ describe('Sfixed64 access', () => { expect(accessor.getSfixed64WithDefault(1)).toEqual(Int64.fromInt(1)); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer( 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)); @@ -1502,7 +1502,7 @@ describe('Sint32 access', () => { expect(accessor.getSint32WithDefault(1)).toEqual(1); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x03, 0x08, 0x02)); expect(accessor.getSint32WithDefault(1)).toEqual(1); @@ -1599,7 +1599,7 @@ describe('SInt64 access', () => { expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1)); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1)); @@ -1698,7 +1698,7 @@ describe('String access', () => { expect(accessor.getStringWithDefault(1)).toEqual('a'); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer( createArrayBuffer(0x0A, 0x01, 0x60, 0x0A, 0x01, 0x61)); expect(accessor.getStringWithDefault(1)).toEqual('a'); @@ -1789,7 +1789,7 @@ describe('Uint32 access', () => { expect(accessor.getUint32WithDefault(1)).toEqual(1); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); expect(accessor.getUint32WithDefault(1)).toEqual(2); @@ -1896,7 +1896,7 @@ describe('Uint64 access', () => { expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(1)); }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02)); expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(2)); @@ -1996,7 +1996,7 @@ describe('Double access', () => { }); - it('decodes value from wire with multple values being present', () => { + it('decodes value from wire with multiple values being present', () => { const accessor = Kernel.fromArrayBuffer(createArrayBuffer( 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF)); diff --git a/js/experimental/runtime/kernel/tag_test.js b/js/experimental/runtime/kernel/tag_test.js index 04a6cb66689b3afc7d83152a221f1cba20932538..35137bb247053ccd7cfaf78a62a9514e5d5709f0 100644 --- a/js/experimental/runtime/kernel/tag_test.js +++ b/js/experimental/runtime/kernel/tag_test.js @@ -95,12 +95,12 @@ describe('skipField', () => { it('skips group in group', () => { const buffer = createArrayBuffer( - 0x0B, // start outter + 0x0B, // start outer 0x10, 0x01, // field: 2, value: 1 0x0B, // start inner group 0x10, 0x01, // payload inner group 0x0C, // stop inner group - 0x0C // end outter + 0x0C // end outer ); const bufferDecoder = BufferDecoder.fromArrayBuffer(buffer); bufferDecoder.setCursor(1); diff --git a/js/gulpfile.js b/js/gulpfile.js index 2e72a88898d37cc7a7625d7326db42b0b4a3ce4e..8137b907020524c9a89bcfb8ff411c4211951515 100644 --- a/js/gulpfile.js +++ b/js/gulpfile.js @@ -71,13 +71,16 @@ gulp.task('genproto_group1_closure', function (cb) { }); }); -gulp.task('genproto_group2_closure', function (cb) { - exec(protoc + ' --experimental_allow_proto3_optional --js_out=library=testproto_libs2,binary:. -I ../src -I . -I commonjs ' + group2Protos.join(' '), - function (err, stdout, stderr) { - console.log(stdout); - console.log(stderr); - cb(err); - }); +gulp.task('genproto_group2_closure', function(cb) { + exec( + protoc + + ' --experimental_allow_proto3_optional --js_out=library=testproto_libs2,binary:. -I ../src -I . -I commonjs ' + + group2Protos.join(' '), + function(err, stdout, stderr) { + console.log(stdout); + console.log(stderr); + cb(err); + }); }); gulp.task('genproto_well_known_types_commonjs', function (cb) { @@ -98,13 +101,16 @@ gulp.task('genproto_group1_commonjs', function (cb) { }); }); -gulp.task('genproto_group2_commonjs', function (cb) { - exec('mkdir -p commonjs_out && ' + protoc + ' --experimental_allow_proto3_optional --js_out=import_style=commonjs,binary:commonjs_out -I ../src -I commonjs -I . ' + group2Protos.join(' '), - function (err, stdout, stderr) { - console.log(stdout); - console.log(stderr); - cb(err); - }); +gulp.task('genproto_group2_commonjs', function(cb) { + exec( + 'mkdir -p commonjs_out && ' + protoc + + ' --experimental_allow_proto3_optional --js_out=import_style=commonjs,binary:commonjs_out -I ../src -I commonjs -I . ' + + group2Protos.join(' '), + function(err, stdout, stderr) { + console.log(stdout); + console.log(stderr); + cb(err); + }); }); gulp.task('genproto_commonjs_wellknowntypes', function (cb) { diff --git a/js/map.js b/js/map.js index 589a2938d5ede7d424a7e56ff6634ba756ebd78f..61f0f3b63f19de5976e93fa642c16037a45526a3 100644 --- a/js/map.js +++ b/js/map.js @@ -1,3 +1,4 @@ + // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ @@ -28,6 +29,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @fileoverview + * @suppress {missingRequire} TODO(b/152540451): this shouldn't be needed + */ goog.provide('jspb.Map'); goog.require('goog.asserts'); diff --git a/js/message.js b/js/message.js index f190894b26f35a280c32b247b27ef55945228849..905329fe4409520560eadd2417e6868f0539fa28 100644 --- a/js/message.js +++ b/js/message.js @@ -31,6 +31,7 @@ /** * @fileoverview Definition of jspb.Message. * + * @suppress {missingRequire} TODO(b/152540451): this shouldn't be needed * @author mwr@google.com (Mark Rawling) */ diff --git a/js/package.json b/js/package.json index a3d9ba32e590fd8d8ee314bb425a534e1df4bd12..6bbc115c044d29e20fd421550c73e1976cdda793 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.13.0", + "version": "3.14.0", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/js/proto3_test.js b/js/proto3_test.js index bd7cce517a744a3cfb48076fbe73fb6b3e6baa85..fd59ae50d607f00819c17cc7d49c91e306ad7ace 100644 --- a/js/proto3_test.js +++ b/js/proto3_test.js @@ -130,8 +130,8 @@ describe('proto3Test', function() { assertEquals(msg.getSingularBytes_asU8().length, 0); assertEquals(msg.getSingularBytes_asB64(), ''); - assertEquals(msg.getSingularForeignEnum(), - proto.jspb.test.Proto3Enum.PROTO3_FOO); + assertEquals( + msg.getSingularForeignEnum(), proto.jspb.test.Proto3Enum.PROTO3_FOO); assertEquals(msg.getSingularForeignMessage(), undefined); assertEquals(msg.getSingularForeignMessage(), undefined); @@ -201,7 +201,7 @@ describe('proto3Test', function() { assertTrue(msg.hasOptionalInt64()); assertFalse(msg.hasOptionalString()); - msg.setOptionalString(""); + msg.setOptionalString(''); assertTrue(msg.hasOptionalString()); // Now the proto will have a non-zero size, even though its values are 0. @@ -224,7 +224,7 @@ describe('proto3Test', function() { /** * Test that all fields can be set ,and read via a serialization roundtrip. */ - it('testProto3FieldSetGet', function () { + it('testProto3FieldSetGet', function() { var msg = new proto.jspb.test.TestProto3(); msg.setSingularInt32(-42); @@ -288,8 +288,8 @@ describe('proto3Test', function() { assertEquals(msg.getSingularString(), 'hello world'); assertEquals(true, bytesCompare(msg.getSingularBytes(), BYTES)); assertEquals(msg.getSingularForeignMessage().getC(), 16); - assertEquals(msg.getSingularForeignEnum(), - proto.jspb.test.Proto3Enum.PROTO3_BAR); + assertEquals( + msg.getSingularForeignEnum(), proto.jspb.test.Proto3Enum.PROTO3_BAR); assertElementsEquals(msg.getRepeatedInt32List(), [-42]); assertElementsEquals(msg.getRepeatedInt64List(), [-0x7fffffff00000000]); diff --git a/js/proto3_test.proto b/js/proto3_test.proto index 1f6bbed06017be0208665fa2b53342745afcdb6e..14f104ef56d36be23d8c5d32997622eceb1baa77 100644 --- a/js/proto3_test.proto +++ b/js/proto3_test.proto @@ -30,10 +30,10 @@ syntax = "proto3"; -import "testbinary.proto"; - package jspb.test; +import "testbinary.proto"; + message TestProto3 { int32 singular_int32 = 1; int64 singular_int64 = 2; @@ -71,7 +71,7 @@ message TestProto3 { optional bytes optional_bytes = 135; optional ForeignMessage optional_foreign_message = 136; - optional Proto3Enum optional_foreign_enum =137; + optional Proto3Enum optional_foreign_enum = 137; repeated int32 repeated_int32 = 31; repeated int64 repeated_int64 = 32; @@ -92,7 +92,6 @@ message TestProto3 { repeated ForeignMessage repeated_foreign_message = 49; repeated Proto3Enum repeated_foreign_enum = 52; - oneof oneof_field { uint32 oneof_uint32 = 111; ForeignMessage oneof_foreign_message = 112; diff --git a/kokoro/README.md b/kokoro/README.md deleted file mode 100644 index 0791c9253bd402c7e5722f2b0625362090660941..0000000000000000000000000000000000000000 --- a/kokoro/README.md +++ /dev/null @@ -1,6 +0,0 @@ - -Kokoro Infrastructure ----------------------- - -The files in this directory serve as plumbing for running Protobuf -tests under Kokoro, our internal CI. \ No newline at end of file diff --git a/kokoro/docs/common.cfg b/kokoro/docs/common.cfg deleted file mode 100644 index 771ca7f637c62c53c5884959949c24fe58b377e4..0000000000000000000000000000000000000000 --- a/kokoro/docs/common.cfg +++ /dev/null @@ -1,44 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "protobuf/kokoro/docs/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" -} - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -# Fetch the token needed for reporting release status to GitHub -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "yoshi-automation-github-key" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} diff --git a/kokoro/docs/publish-python.sh b/kokoro/docs/publish-python.sh deleted file mode 100644 index eea17552b4806e088d0cbd74311584f4dd1283af..0000000000000000000000000000000000000000 --- a/kokoro/docs/publish-python.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# Adapted from https://github.com/googleapis/google-cloud-python/blob/master/.kokoro/publish-docs.sh - -set -eo pipefail - -# Disable buffering, so that the logs stream through. -export PYTHONUNBUFFERED=1 - -cd github/protobuf/python - -# install package -sudo apt-get update -sudo apt-get -y install software-properties-common -sudo add-apt-repository universe -sudo apt-get update -sudo apt-get -y install unzip -wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protoc-3.11.2-linux-x86_64.zip -unzip protoc-3.11.2-linux-x86_64.zip bin/protoc -mv bin/protoc ../src/protoc -python3.6 -m venv venv -source venv/bin/activate -python setup.py install - -# install docs dependencies -python -m pip install -r docs/requirements.txt - -# build docs -cd docs -make html -cd .. -deactivate - -python3.6 -m pip install protobuf==3.11.1 gcp-docuploader - -# install a json parser -sudo apt-get -y install jq - -# create metadata -python3.6 -m docuploader create-metadata \ - --name=$(jq --raw-output '.name // empty' .repo-metadata.json) \ - --version=$(python3 setup.py --version) \ - --language=$(jq --raw-output '.language // empty' .repo-metadata.json) \ - --distribution-name=$(python3 setup.py --name) \ - --product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \ - --github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \ - --issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json) - -cat docs.metadata - -# upload docs -python3.6 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket docs-staging diff --git a/kokoro/docs/python.cfg b/kokoro/docs/python.cfg deleted file mode 100644 index 382f431ad2f26e57719a6e097cc07b030cd8ba46..0000000000000000000000000000000000000000 --- a/kokoro/docs/python.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/protobuf/kokoro/docs/publish-python.sh" -} diff --git a/kokoro/docs/trampoline.sh b/kokoro/docs/trampoline.sh deleted file mode 100644 index db7e90b2e8ca14d2285c7eed68c64b888519691b..0000000000000000000000000000000000000000 --- a/kokoro/docs/trampoline.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# Copied from https://github.com/googleapis/google-cloud-python/blob/master/.kokoro/trampoline.sh - -set -eo pipefail - -python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" || ret_code=$? - -chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh -${KOKORO_GFILE_DIR}/trampoline_cleanup.sh || true - -exit ${ret_code} diff --git a/kokoro/linux/32-bit/Dockerfile b/kokoro/linux/32-bit/Dockerfile deleted file mode 100644 index 1278889f91ca78ec073eb56ca56d359d81087fcb..0000000000000000000000000000000000000000 --- a/kokoro/linux/32-bit/Dockerfile +++ /dev/null @@ -1,143 +0,0 @@ -# This Dockerfile specifies the recipe for creating an image for the tests -# to run in. -# -# We install as many test dependencies here as we can, because these setup -# steps can be cached. They do *not* run every time we run the build. -# The Docker image is only rebuilt when the Dockerfile (ie. this file) -# changes. - -# Base Dockerfile for gRPC dev images -FROM 32bit/debian:latest - -# Apt source for php -RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc/apt/sources.list.d/various-php.list && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F4FCBB07 - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - unzip \ - # -- For python -- - python-setuptools \ - python-pip \ - python-dev \ - # -- For C++ benchmarks -- - cmake \ - # -- For PHP -- - php5.5 \ - php5.5-dev \ - php5.5-xml \ - php5.6 \ - php5.6-dev \ - php5.6-xml \ - php7.0 \ - php7.0-dev \ - php7.0-xml \ - phpunit \ - valgrind \ - libxml2-dev \ - && apt-get clean - -################## -# PHP dependencies. -RUN wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror -RUN mv mirror php-5.5.38.tar.bz2 -RUN tar -xvf php-5.5.38.tar.bz2 -RUN cd php-5.5.38 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.5-zts && \ - make && make install && make clean && cd .. -RUN cd php-5.5.38 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.5 && \ - make && make install && make clean && cd .. - -RUN wget http://am1.php.net/get/php-5.6.30.tar.bz2/from/this/mirror -RUN mv mirror php-5.6.30.tar.bz2 -RUN tar -xvf php-5.6.30.tar.bz2 -RUN cd php-5.6.30 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.6-zts && \ - make && make install && cd .. -RUN cd php-5.6.30 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.6 && \ - make && make install && cd .. - -RUN wget http://am1.php.net/get/php-7.0.18.tar.bz2/from/this/mirror -RUN mv mirror php-7.0.18.tar.bz2 -RUN tar -xvf php-7.0.18.tar.bz2 -RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.0-zts && \ - make && make install && cd .. -RUN cd php-7.0.18 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.0 && \ - make && make install && cd .. - -RUN wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror -RUN mv mirror php-7.1.4.tar.bz2 -RUN tar -xvf php-7.1.4.tar.bz2 -RUN cd php-7.1.4 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.1-zts && \ - make && make install && cd .. -RUN cd php-7.1.4 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.1 && \ - make && make install && cd .. - -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -RUN php composer-setup.php -RUN mv composer.phar /usr/bin/composer -RUN php -r "unlink('composer-setup.php');" -RUN composer config -g -- disable-tls true -RUN composer config -g -- secure-http false -RUN cd /tmp && \ - git clone https://github.com/google/protobuf.git && \ - cd protobuf/php && \ - git reset --hard 49b44bff2b6257a119f9c6a342d6151c736586b8 && \ - ln -sfn /usr/local/php-5.5/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-5.5/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-5.5/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-5.5 && \ - ln -sfn /usr/local/php-5.6/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-5.6/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-5.6/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-5.6 && \ - ln -sfn /usr/local/php-7.0/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-7.0/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-7.0/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-7.0 && \ - ln -sfn /usr/local/php-7.1/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-7.1/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-7.1/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-7.1 - -################## -# Python dependencies - -# These packages exist in apt-get, but their versions are too old, so we have -# to get updates from pip. - -RUN pip install pip --upgrade -RUN pip install virtualenv tox yattag - -################## -# Prepare ccache - -RUN ln -s /usr/bin/ccache /usr/local/bin/gcc -RUN ln -s /usr/bin/ccache /usr/local/bin/g++ -RUN ln -s /usr/bin/ccache /usr/local/bin/cc -RUN ln -s /usr/bin/ccache /usr/local/bin/c++ -RUN ln -s /usr/bin/ccache /usr/local/bin/clang -RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ - -# Define the default command. -CMD ["bash"] diff --git a/kokoro/linux/32-bit/build.sh b/kokoro/linux/32-bit/build.sh deleted file mode 100644 index 8c0a41ea2e91e2906a277f9a82a7f3e12378048b..0000000000000000000000000000000000000000 --- a/kokoro/linux/32-bit/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request 32" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/php_32bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="php_all_32" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/32-bit/continuous.cfg b/kokoro/linux/32-bit/continuous.cfg deleted file mode 100644 index 28b66c07c2e1b9cfc9a89b2697febb610eded7d9..0000000000000000000000000000000000000000 --- a/kokoro/linux/32-bit/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/32-bit/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/32-bit/presubmit.cfg b/kokoro/linux/32-bit/presubmit.cfg deleted file mode 100644 index 28b66c07c2e1b9cfc9a89b2697febb610eded7d9..0000000000000000000000000000000000000000 --- a/kokoro/linux/32-bit/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/32-bit/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/bazel/build.sh b/kokoro/linux/bazel/build.sh deleted file mode 100644 index 5f34bea30ef1266b452895649b39f551c453a735..0000000000000000000000000000000000000000 --- a/kokoro/linux/bazel/build.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests -set -ex - -# Install the latest Bazel version available -use_bazel.sh latest -bazel version - -# Print bazel testlogs to stdout when tests failed. -function print_test_logs { - # TODO(yannic): Only print logs of failing tests. - testlogs_dir=$(bazel info bazel-testlogs) - testlogs=$(find "${testlogs_dir}" -name "*.log") - for log in $testlogs; do - cat "${log}" - done -} - -# Change to repo root -cd $(dirname $0)/../../.. - -git submodule update --init --recursive - -trap print_test_logs EXIT -bazel test --copt=-Werror --host_copt=-Werror \ - //:build_files_updated_unittest \ - //java/... \ - //:protoc \ - //:protobuf \ - //:protobuf_python \ - //:protobuf_test \ - @com_google_protobuf//:cc_proto_blacklist_test -trap - EXIT - -cd examples -bazel build //... diff --git a/kokoro/linux/bazel/continuous.cfg b/kokoro/linux/bazel/continuous.cfg deleted file mode 100644 index 13cfef1583c06f7443b3483ab0aa09cf903b410e..0000000000000000000000000000000000000000 --- a/kokoro/linux/bazel/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel/build.sh" -timeout_mins: 15 diff --git a/kokoro/linux/bazel/presubmit.cfg b/kokoro/linux/bazel/presubmit.cfg deleted file mode 100644 index 13cfef1583c06f7443b3483ab0aa09cf903b410e..0000000000000000000000000000000000000000 --- a/kokoro/linux/bazel/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel/build.sh" -timeout_mins: 15 diff --git a/kokoro/linux/benchmark/build.sh b/kokoro/linux/benchmark/build.sh deleted file mode 100644 index e563e791663c840985b24256096bb72b043169ef..0000000000000000000000000000000000000000 --- a/kokoro/linux/benchmark/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -cd $(dirname $0)/../../.. - -# prepare php environments -sudo apt-get update && sudo apt-get install -y --force-yes php5 -sudo ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h -mkdir php_temp -cd php_temp -curl -sS https://getcomposer.org/installer | php -sudo mv composer.phar /usr/local/bin/composer -git clone https://github.com/php/php-src -cd php-src && git checkout PHP-7.2.13 && ./buildconf --force -./configure \ - --enable-bcmatch \ - --with-gmp --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2 && \ -make -j8 && sudo make install && make clean -wget -O phpunit https://phar.phpunit.de/phpunit-7.phar && \ - chmod +x phpunit && \ - sudo cp phpunit /usr/local/php-7.2/bin -sudo apt-get install -y --force-yes valgrind -cd ../.. - -./tests.sh benchmark diff --git a/kokoro/linux/benchmark/continuous.cfg b/kokoro/linux/benchmark/continuous.cfg deleted file mode 100644 index 8cc8f96bfa62b5cfc7a7b68d12be21ba24faa74b..0000000000000000000000000000000000000000 --- a/kokoro/linux/benchmark/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/benchmark/build.sh" -timeout_mins: 240 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/benchmark/run.sh b/kokoro/linux/benchmark/run.sh deleted file mode 100644 index 1b1032bd3775c049450223af0dea151427456eaa..0000000000000000000000000000000000000000 --- a/kokoro/linux/benchmark/run.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash -# -# Change to repo root -cd $(dirname $0)/../../.. - -export OUTPUT_DIR=testoutput -oldpwd=`pwd` - -# tcmalloc -if [ ! -f gperftools/.libs/libtcmalloc.so ]; then - git clone https://github.com/gperftools/gperftools.git - cd gperftools - ./autogen.sh - ./configure - make -j8 - cd .. -fi - -# download datasets for benchmark -cd benchmarks -./download_data.sh -datasets=$(for file in $(find . -type f -name "dataset.*.pb" -not -path "./tmp/*"); do echo "$(pwd)/$file"; done | xargs) -echo $datasets -cd $oldpwd - -# build Python protobuf -./autogen.sh -./configure CXXFLAGS="-fPIC -O2" -make -j8 -cd python -python setup.py build --cpp_implementation -pip install . --user - - -# build and run Python benchmark -cd ../benchmarks -make python-pure-python-benchmark -make python-cpp-reflection-benchmark -make -j8 python-cpp-generated-code-benchmark -echo "[" > tmp/python_result.json -echo "benchmarking pure python..." -./python-pure-python-benchmark --json --behavior_prefix="pure-python-benchmark" $datasets >> tmp/python_result.json -echo "," >> "tmp/python_result.json" -echo "benchmarking python cpp reflection..." -env LD_PRELOAD="$oldpwd/gperftools/.libs/libtcmalloc.so" LD_LIBRARY_PATH="$oldpwd/src/.libs" ./python-cpp-reflection-benchmark --json --behavior_prefix="cpp-reflection-benchmark" $datasets >> tmp/python_result.json -echo "," >> "tmp/python_result.json" -echo "benchmarking python cpp generated code..." -env LD_PRELOAD="$oldpwd/gperftools/.libs/libtcmalloc.so" LD_LIBRARY_PATH="$oldpwd/src/.libs" ./python-cpp-generated-code-benchmark --json --behavior_prefix="cpp-generated-code-benchmark" $datasets >> tmp/python_result.json -echo "]" >> "tmp/python_result.json" -cd $oldpwd - -# build CPP protobuf -./configure -make clean && make -j8 - -# build Java protobuf -cd java -mvn package -cd .. - -# build CPP benchmark -cd benchmarks -mv tmp/python_result.json . && make clean && make -j8 cpp-benchmark && mv python_result.json tmp -echo "benchmarking cpp..." -env LD_PRELOAD="$oldpwd/gperftools/.libs/libtcmalloc.so" ./cpp-benchmark --benchmark_min_time=5.0 --benchmark_out_format=json --benchmark_out="tmp/cpp_result.json" $datasets -cd $oldpwd - -# build go protobuf -export PATH="`pwd`/src:$PATH" -export GOPATH="$HOME/gocode" -mkdir -p "$GOPATH/src/github.com/google" -rm -f "$GOPATH/src/github.com/protocolbuffers/protobuf" -ln -s "`pwd`" "$GOPATH/src/github.com/protocolbuffers/protobuf" -export PATH="$GOPATH/bin:$PATH" -go get github.com/golang/protobuf/protoc-gen-go - -# build go benchmark -cd benchmarks -make go-benchmark -echo "benchmarking go..." -./go-benchmark $datasets > tmp/go_result.txt - -# build java benchmark -make java-benchmark -echo "benchmarking java..." -./java-benchmark -Cresults.file.options.file="tmp/java_result.json" $datasets - -make js-benchmark -echo "benchmarking js..." -./js-benchmark $datasets --json_output=$(pwd)/tmp/node_result.json - -make -j8 generate_proto3_data -proto3_datasets=$(for file in $datasets; do echo $(pwd)/tmp/proto3_data/${file#$(pwd)}; done | xargs) -echo $proto3_datasets - -# build php benchmark -make -j8 php-c-benchmark -echo "benchmarking php_c..." -./php-c-benchmark $proto3_datasets --json --behavior_prefix="php_c" > tmp/php_c_result.json - -# upload result to bq -make python_add_init -env LD_LIBRARY_PATH="$oldpwd/src/.libs" python -m util.result_uploader -php_c="../tmp/php_c_result.json" \ - -cpp="../tmp/cpp_result.json" -java="../tmp/java_result.json" -go="../tmp/go_result.txt" -python="../tmp/python_result.json" -node="../tmp/node_result.json" -cd $oldpwd diff --git a/kokoro/linux/build_and_run_docker.sh b/kokoro/linux/build_and_run_docker.sh deleted file mode 100644 index cdbd6e29b0fb378efc9afee05458e68be386f571..0000000000000000000000000000000000000000 --- a/kokoro/linux/build_and_run_docker.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# -# Builds docker image and runs a command under it. -# This is a generic script that is configured with the following variables: -# -# DOCKERHUB_ORGANIZATION - The organization on docker hub storing the -# Dockerfile. -# DOCKERFILE_DIR - Directory in which Dockerfile file is located. -# DOCKER_RUN_SCRIPT - Script to run under docker (relative to protobuf repo root) -# OUTPUT_DIR - Directory that will be copied from inside docker after finishing. -# $@ - Extra args to pass to docker run - -set -ex - -cd $(dirname $0)/../.. -git_root=$(pwd) -cd - - -# Use image name based on Dockerfile sha1 -if [ -z "$DOCKERHUB_ORGANIZATION" ] -then - DOCKERHUB_ORGANIZATION=grpctesting/protobuf - DOCKER_IMAGE_NAME=${DOCKERHUB_ORGANIZATION}_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ ) -else - # TODO(teboring): Remove this when all tests have been migrated to separate - # docker images. - DOCKERFILE_PREFIX=$(basename $DOCKERFILE_DIR) - DOCKER_IMAGE_NAME=${DOCKERHUB_ORGANIZATION}/${DOCKERFILE_PREFIX}_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ ) -fi - -# Pull dockerimage from Dockerhub. This sometimes fails intermittently, so we -# keep trying until we succeed. -until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done - -# Ensure existence of ccache directory -CCACHE_DIR=/tmp/protobuf-ccache -mkdir -p $CCACHE_DIR - -# Choose random name for docker container -CONTAINER_NAME="build_and_run_docker_$(uuidgen)" - -echo $git_root - -# Run command inside docker -docker run \ - "$@" \ - -e CCACHE_DIR=$CCACHE_DIR \ - -e KOKORO_BUILD_NUMBER=$KOKORO_BUILD_NUMBER \ - -e KOKORO_BUILD_ID=$KOKORO_BUILD_ID \ - -e EXTERNAL_GIT_ROOT="/var/local/kokoro/protobuf" \ - -e TEST_SET="$TEST_SET" \ - -v "$git_root:/var/local/kokoro/protobuf:ro" \ - -v $CCACHE_DIR:$CCACHE_DIR \ - -w /var/local/git/protobuf \ - --name=$CONTAINER_NAME \ - $DOCKER_IMAGE_NAME \ - bash -l "/var/local/kokoro/protobuf/$DOCKER_RUN_SCRIPT" || FAILED="true" - -# remove the container, possibly killing it first -docker rm -f $CONTAINER_NAME || true - -[ -z "$FAILED" ] || { - exit 1 -} diff --git a/kokoro/linux/cpp_distcheck/build.sh b/kokoro/linux/cpp_distcheck/build.sh deleted file mode 100644 index 42ac88caffb4e9b550c3d0992ec935a4837f985f..0000000000000000000000000000000000000000 --- a/kokoro/linux/cpp_distcheck/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -set -ex # exit immediately on error - -# Change to repo root -cd $(dirname $0)/../../.. - -./tests.sh cpp_distcheck - -# Run tests under release docker image. -DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ") -until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done - -docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \ - bash -l /var/local/protobuf/tests.sh cpp || FAILED="true" - -if [ "$FAILED" = "true" ]; then - exit 1 -fi diff --git a/kokoro/linux/cpp_distcheck/continuous.cfg b/kokoro/linux/cpp_distcheck/continuous.cfg deleted file mode 100644 index 4289f6a715f41af5977d531919f979f75954aef5..0000000000000000000000000000000000000000 --- a/kokoro/linux/cpp_distcheck/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_distcheck/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/cpp_distcheck/presubmit.cfg b/kokoro/linux/cpp_distcheck/presubmit.cfg deleted file mode 100644 index 4289f6a715f41af5977d531919f979f75954aef5..0000000000000000000000000000000000000000 --- a/kokoro/linux/cpp_distcheck/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_distcheck/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/cpp_tcmalloc/build.sh b/kokoro/linux/cpp_tcmalloc/build.sh deleted file mode 100644 index 3c77b11e70f4730322cb8a3543d06b80c453c29e..0000000000000000000000000000000000000000 --- a/kokoro/linux/cpp_tcmalloc/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/cpp_tcmalloc -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="cpp_tcmalloc" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/cpp_tcmalloc/continuous.cfg b/kokoro/linux/cpp_tcmalloc/continuous.cfg deleted file mode 100644 index 46312a9be29ccb45ec99607c76285c04037efdf7..0000000000000000000000000000000000000000 --- a/kokoro/linux/cpp_tcmalloc/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_tcmalloc/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/cpp_tcmalloc/presubmit.cfg b/kokoro/linux/cpp_tcmalloc/presubmit.cfg deleted file mode 100644 index 46312a9be29ccb45ec99607c76285c04037efdf7..0000000000000000000000000000000000000000 --- a/kokoro/linux/cpp_tcmalloc/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_tcmalloc/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/csharp/build.sh b/kokoro/linux/csharp/build.sh deleted file mode 100644 index 9a2eb48621a87322874606e8a9da00299f3a985b..0000000000000000000000000000000000000000 --- a/kokoro/linux/csharp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/csharp -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="csharp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/csharp/continuous.cfg b/kokoro/linux/csharp/continuous.cfg deleted file mode 100644 index 3d177670a9d8b541ce140502dd88881f35d6d0f1..0000000000000000000000000000000000000000 --- a/kokoro/linux/csharp/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/csharp/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/csharp/presubmit.cfg b/kokoro/linux/csharp/presubmit.cfg deleted file mode 100644 index 3d177670a9d8b541ce140502dd88881f35d6d0f1..0000000000000000000000000000000000000000 --- a/kokoro/linux/csharp/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/csharp/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/dist_install/build.sh b/kokoro/linux/dist_install/build.sh deleted file mode 100644 index 81a0516aa8453591203b141a25dbd48580cdfe87..0000000000000000000000000000000000000000 --- a/kokoro/linux/dist_install/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -set -ex # exit immediately on error - -# Change to repo root -cd $(dirname $0)/../../.. - -# Run tests under release docker image. -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="dist_install" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/dist_install/continuous.cfg b/kokoro/linux/dist_install/continuous.cfg deleted file mode 100644 index b1e0b2013d06bd2c7b91bcbcd0c7549fae9ea48e..0000000000000000000000000000000000000000 --- a/kokoro/linux/dist_install/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/dist_install/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/dist_install/presubmit.cfg b/kokoro/linux/dist_install/presubmit.cfg deleted file mode 100644 index b1e0b2013d06bd2c7b91bcbcd0c7549fae9ea48e..0000000000000000000000000000000000000000 --- a/kokoro/linux/dist_install/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/dist_install/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/dockerfile/push_testing_images.sh b/kokoro/linux/dockerfile/push_testing_images.sh deleted file mode 100644 index 2d82babba4190ac632a7762dca9edf2e96822d5e..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/push_testing_images.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -ex - -cd $(dirname $0)/../../.. -git_root=$(pwd) -cd kokoro/linux/dockerfile - -DOCKERHUB_ORGANIZATION=protobuftesting - -for DOCKERFILE_DIR in test/* -do - # Generate image name based on Dockerfile checksum. That works well as long - # as can count on dockerfiles being written in a way that changing the logical - # contents of the docker image always changes the SHA (e.g. using "ADD file" - # cmd in the dockerfile in not ok as contents of the added file will not be - # reflected in the SHA). - DOCKER_IMAGE_NAME=$(basename $DOCKERFILE_DIR)_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ ) - - echo $DOCKER_IMAGE_NAME - # skip the image if it already exists in the repo - curl --silent -f -lSL https://registry.hub.docker.com/v2/repositories/${DOCKERHUB_ORGANIZATION}/${DOCKER_IMAGE_NAME}/tags/latest > /dev/null \ - && continue - - docker build -t ${DOCKERHUB_ORGANIZATION}/${DOCKER_IMAGE_NAME} ${DOCKERFILE_DIR} - - # "docker login" needs to be run in advance - docker push ${DOCKERHUB_ORGANIZATION}/${DOCKER_IMAGE_NAME} -done diff --git a/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile b/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile deleted file mode 100644 index 0ce9982ad410cf824ff924784e8783a0e5511124..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean - -# Install dependencies for TC malloc -RUN apt-get install -y \ - google-perftools \ - libgoogle-perftools4 \ - libgoogle-perftools-dev diff --git a/kokoro/linux/dockerfile/test/csharp/Dockerfile b/kokoro/linux/dockerfile/test/csharp/Dockerfile deleted file mode 100644 index 95bd653152f095bdfb3b3f3a2d92e3ab0375b754..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/csharp/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:stretch - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean - -# dotnet SDK prerequisites -RUN apt-get update && apt-get install -y libunwind8 libicu57 && apt-get clean - -# Install dotnet SDK via install script -RUN wget -q https://dot.net/v1/dotnet-install.sh && \ - chmod u+x dotnet-install.sh && \ - ./dotnet-install.sh --version 2.1.802 && \ - ./dotnet-install.sh --version 3.1.301 && \ - ln -s /root/.dotnet/dotnet /usr/local/bin - -RUN wget -q www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe - -ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE true diff --git a/kokoro/linux/dockerfile/test/java_stretch/Dockerfile b/kokoro/linux/dockerfile/test/java_stretch/Dockerfile deleted file mode 100644 index fc5e82abdbb38079ed5f45d4cb089f2b2c1318bb..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/java_stretch/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM debian:stretch - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean - -# Java dependencies -RUN apt-get install -y \ - # -- For all Java builds -- \ - maven \ - # -- For java_linkage_monitor \ - openjdk-8-jdk \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/javascript/Dockerfile b/kokoro/linux/dockerfile/test/javascript/Dockerfile deleted file mode 100644 index dff7e7bec115e8f2c6af31bf5b06f3db228125c7..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/javascript/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM ubuntu:latest - -RUN apt-get update && apt-get install -y gnupg - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean - - -################## -# Javascript dependencies. -RUN apt-get install -y \ - # -- For javascript and closure compiler -- \ - npm \ - default-jre diff --git a/kokoro/linux/dockerfile/test/php/Dockerfile b/kokoro/linux/dockerfile/test/php/Dockerfile deleted file mode 100644 index a540177c06c36fe7d937083a8f0ed2d4dcb42e80..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/php/Dockerfile +++ /dev/null @@ -1,283 +0,0 @@ -FROM debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - re2c \ - sqlite3 \ - libsqlite3-dev \ - && apt-get clean - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - php5 \ - libcurl4-openssl-dev \ - libgmp-dev \ - libgmp3-dev \ - libssl-dev \ - libxml2-dev \ - unzip \ - zlib1g-dev \ - pkg-config \ - && apt-get clean - -# Install other dependencies -RUN ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h -RUN wget http://ftp.gnu.org/gnu/bison/bison-2.6.4.tar.gz -O /var/local/bison-2.6.4.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-2.6.4.tar.gz \ - && cd /var/local/bison-2.6.4 \ - && ./configure \ - && make \ - && make install - -# Install composer -RUN curl -sS https://getcomposer.org/installer | php -RUN mv composer.phar /usr/local/bin/composer - -# Download php source code -RUN git clone https://github.com/php/php-src - -# php 5.5 -RUN cd php-src \ - && git checkout PHP-5.5.38 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.5 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.5-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-4.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-5.5/bin \ - && mv phpunit /usr/local/php-5.5-zts/bin - -# php 5.6 -RUN cd php-src \ - && git checkout PHP-5.6.39 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.6 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.6-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-5.6/bin \ - && mv phpunit /usr/local/php-5.6-zts/bin - -# php 7.0 -RUN cd php-src \ - && git checkout PHP-7.0.33 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-6.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.0/bin \ - && mv phpunit /usr/local/php-7.0-zts/bin - -# php 7.1 -RUN cd php-src \ - && git checkout PHP-7.1.25 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.1/bin \ - && mv phpunit /usr/local/php-7.1-zts/bin - -# php 7.2 -RUN cd php-src \ - && git checkout PHP-7.2.13 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.2/bin \ - && mv phpunit /usr/local/php-7.2-zts/bin - -# php 7.3 -RUN cd php-src \ - && git checkout PHP-7.3.0 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.3/bin \ - && mv phpunit /usr/local/php-7.3-zts/bin - -# php 7.4 -RUN wget https://ftp.gnu.org/gnu/bison/bison-3.0.1.tar.gz -O /var/local/bison-3.0.1.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-3.0.1.tar.gz \ - && cd /var/local/bison-3.0.1 \ - && ./configure \ - && make \ - && make install - -RUN wget https://github.com/php/php-src/archive/php-7.4.0.tar.gz -O /var/local/php-7.4.0.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.4.0.tar.gz - -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-8.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.4/bin \ - && mv phpunit /usr/local/php-7.4-zts/bin - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - valgrind \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/php80/Dockerfile b/kokoro/linux/dockerfile/test/php80/Dockerfile deleted file mode 100644 index d6c9b4d273bf1cde1160facc37ed50636f760dd7..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/php80/Dockerfile +++ /dev/null @@ -1,96 +0,0 @@ -FROM debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - re2c \ - sqlite3 \ - vim \ - libonig-dev \ - libsqlite3-dev \ - && apt-get clean - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - php5 \ - libcurl4-openssl-dev \ - libgmp-dev \ - libgmp3-dev \ - libssl-dev \ - libxml2-dev \ - unzip \ - zlib1g-dev \ - pkg-config \ - && apt-get clean - -# Install other dependencies -RUN ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h -RUN wget https://ftp.gnu.org/gnu/bison/bison-3.0.1.tar.gz -O /var/local/bison-3.0.1.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-3.0.1.tar.gz \ - && cd /var/local/bison-3.0.1 \ - && ./configure \ - && make \ - && make install - -# Install composer -RUN curl -sS https://getcomposer.org/installer | php -RUN mv composer.phar /usr/local/bin/composer - -# Download php source code -RUN git clone https://github.com/php/php-src - -# php 8.0 -RUN cd php-src \ - && git checkout php-8.0.0alpha3 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-8.0 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-8.0-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-9.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-8.0/bin \ - && mv phpunit /usr/local/php-8.0-zts/bin - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - valgrind \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile b/kokoro/linux/dockerfile/test/php_32bit/Dockerfile deleted file mode 100644 index b40cb70032512f04cda064ce3da3e7b3e18adae4..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile +++ /dev/null @@ -1,267 +0,0 @@ -FROM i386/debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - re2c \ - sqlite3 \ - libsqlite3-dev \ - && apt-get clean - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - bison \ - php5 \ - libcurl4-openssl-dev \ - libssl-dev \ - libxml2-dev \ - unzip \ - zlib1g-dev \ - pkg-config \ - && apt-get clean - -# Install other dependencies -RUN wget http://ftp.gnu.org/gnu/bison/bison-2.6.4.tar.gz -O /var/local/bison-2.6.4.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-2.6.4.tar.gz \ - && cd /var/local/bison-2.6.4 \ - && ./configure \ - && make \ - && make install - -# Install composer -RUN curl -sS https://getcomposer.org/installer | php -RUN mv composer.phar /usr/local/bin/composer - -# Download php source code -RUN git clone https://github.com/php/php-src - -# php 5.5 -RUN cd php-src \ - && git checkout PHP-5.5.38 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.5 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.5-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-4.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-5.5/bin \ - && mv phpunit /usr/local/php-5.5-zts/bin - -# php 5.6 -RUN cd php-src \ - && git checkout PHP-5.6.39 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.6 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.6-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-5.6/bin \ - && mv phpunit /usr/local/php-5.6-zts/bin - -# php 7.0 -RUN cd php-src \ - && git checkout PHP-7.0.33 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-6.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.0/bin \ - && mv phpunit /usr/local/php-7.0-zts/bin - -# php 7.1 -RUN cd php-src \ - && git checkout PHP-7.1.25 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.1/bin \ - && mv phpunit /usr/local/php-7.1-zts/bin - -# php 7.2 -RUN cd php-src \ - && git checkout PHP-7.2.13 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.2/bin \ - && mv phpunit /usr/local/php-7.2-zts/bin - -# php 7.3 -RUN cd php-src \ - && git checkout PHP-7.3.0 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.3/bin \ - && mv phpunit /usr/local/php-7.3-zts/bin - -# php 7.4 -RUN wget https://ftp.gnu.org/gnu/bison/bison-3.0.1.tar.gz -O /var/local/bison-3.0.1.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-3.0.1.tar.gz \ - && cd /var/local/bison-3.0.1 \ - && ./configure \ - && make \ - && make install - -RUN wget https://github.com/php/php-src/archive/php-7.4.0.tar.gz -O /var/local/php-7.4.0.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.4.0.tar.gz - -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-8.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.4/bin \ - && mv phpunit /usr/local/php-7.4-zts/bin - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - valgrind \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/python27/Dockerfile b/kokoro/linux/dockerfile/test/python27/Dockerfile deleted file mode 100644 index e41e49a6e5085e4a2df179ecad96d13ee2b15f22..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/python27/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:2.7-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/python35/Dockerfile b/kokoro/linux/dockerfile/test/python35/Dockerfile deleted file mode 100644 index 3ea4c9e188dd1dffb2fb160d65eb8ca1c6b03665..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/python35/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.5-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/python36/Dockerfile b/kokoro/linux/dockerfile/test/python36/Dockerfile deleted file mode 100644 index 436846065b41425717ad411c511df34ba463b059..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/python36/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.6-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/python37/Dockerfile b/kokoro/linux/dockerfile/test/python37/Dockerfile deleted file mode 100644 index c711eb86a5901f903252ea93c669af309e46e101..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/python37/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.7-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/python38/Dockerfile b/kokoro/linux/dockerfile/test/python38/Dockerfile deleted file mode 100644 index 48a7be5e051914741be10c4df25d4e359d739751..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/python38/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.8-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/ruby/Dockerfile b/kokoro/linux/dockerfile/test/ruby/Dockerfile deleted file mode 100644 index 9037da715f09843e9b3ec367a27808b2bdd582db..0000000000000000000000000000000000000000 --- a/kokoro/linux/dockerfile/test/ruby/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean - -# Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys \ - 409B6B1796C275462A1703113804BB82D39DC0E3 \ - 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -RUN \curl -sSL https://get.rvm.io | bash -s stable - -RUN /bin/bash -l -c "rvm install 2.3.8" -RUN /bin/bash -l -c "rvm install 2.4.5" -RUN /bin/bash -l -c "rvm install 2.5.1" -RUN /bin/bash -l -c "rvm install 2.6.0" -RUN /bin/bash -l -c "rvm install 2.7.0" - -RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" -RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/kokoro/linux/golang/build.sh b/kokoro/linux/golang/build.sh deleted file mode 100644 index 79cddff15ca2da00187e453c73472e3bcb77e8ac..0000000000000000000000000000000000000000 --- a/kokoro/linux/golang/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="golang" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/golang/continuous.cfg b/kokoro/linux/golang/continuous.cfg deleted file mode 100644 index 2282f78f047bc19c51859d0a99b573f22ecd65fb..0000000000000000000000000000000000000000 --- a/kokoro/linux/golang/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/golang/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/golang/presubmit.cfg b/kokoro/linux/golang/presubmit.cfg deleted file mode 100644 index 2282f78f047bc19c51859d0a99b573f22ecd65fb..0000000000000000000000000000000000000000 --- a/kokoro/linux/golang/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/golang/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/java_compatibility/build.sh b/kokoro/linux/java_compatibility/build.sh deleted file mode 100644 index de88454fc7fa25a207bc0c66fd9f44d75db1d94d..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_compatibility/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="java_compatibility" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/java_compatibility/continuous.cfg b/kokoro/linux/java_compatibility/continuous.cfg deleted file mode 100644 index 4897f5c889887d910314707809306fca6881924d..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_compatibility/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_compatibility/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/java_compatibility/presubmit.cfg b/kokoro/linux/java_compatibility/presubmit.cfg deleted file mode 100644 index 4897f5c889887d910314707809306fca6881924d..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_compatibility/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_compatibility/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/java_jdk7/build.sh b/kokoro/linux/java_jdk7/build.sh deleted file mode 100644 index 0a5604b426a63bc1327ef81a092c71e66443362e..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_jdk7/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="java_jdk7" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/java_jdk7/continuous.cfg b/kokoro/linux/java_jdk7/continuous.cfg deleted file mode 100644 index 07a9df5f443f34a811943b4aa385b542f232559c..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_jdk7/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_jdk7/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/java_jdk7/presubmit.cfg b/kokoro/linux/java_jdk7/presubmit.cfg deleted file mode 100644 index 07a9df5f443f34a811943b4aa385b542f232559c..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_jdk7/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_jdk7/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/java_linkage_monitor/build.sh b/kokoro/linux/java_linkage_monitor/build.sh deleted file mode 100644 index c447453f607dbd93f012a7e10fab3567f1a83fc6..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_linkage_monitor/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -# The image of the Dockerfile sha1 is fetched from the organization -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/java_stretch -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="java_linkage_monitor" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/java_linkage_monitor/continuous.cfg b/kokoro/linux/java_linkage_monitor/continuous.cfg deleted file mode 100644 index d0486cce416f5101306da65509fb242fe99f441a..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_linkage_monitor/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_linkage_monitor/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/java_linkage_monitor/presubmit.cfg b/kokoro/linux/java_linkage_monitor/presubmit.cfg deleted file mode 100644 index c02a52f0fa619b040e311b708a767badbd6d364f..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_linkage_monitor/presubmit.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Config file for running Linkage Monitor in Kokoro -# https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_linkage_monitor/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/java_oracle7/build.sh b/kokoro/linux/java_oracle7/build.sh deleted file mode 100644 index 9ab90dadf253de7144617ee7caac9f95a11bf115..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_oracle7/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="java_oracle7" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/java_oracle7/continuous.cfg b/kokoro/linux/java_oracle7/continuous.cfg deleted file mode 100644 index 610469b42c993e7c58baaf69412decf0672b2910..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_oracle7/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_oracle7/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/java_oracle7/presubmit.cfg b/kokoro/linux/java_oracle7/presubmit.cfg deleted file mode 100644 index 610469b42c993e7c58baaf69412decf0672b2910..0000000000000000000000000000000000000000 --- a/kokoro/linux/java_oracle7/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_oracle7/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/javascript/build.sh b/kokoro/linux/javascript/build.sh deleted file mode 100644 index e1e172310cf585c8e3889cc813f0f16d01d9e35e..0000000000000000000000000000000000000000 --- a/kokoro/linux/javascript/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/javascript -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="javascript" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/javascript/continuous.cfg b/kokoro/linux/javascript/continuous.cfg deleted file mode 100644 index b42f522fe9c315935f29babf7c4d0184624cb005..0000000000000000000000000000000000000000 --- a/kokoro/linux/javascript/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/javascript/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/javascript/presubmit.cfg b/kokoro/linux/javascript/presubmit.cfg deleted file mode 100644 index b42f522fe9c315935f29babf7c4d0184624cb005..0000000000000000000000000000000000000000 --- a/kokoro/linux/javascript/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/javascript/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/make_test_output.py b/kokoro/linux/make_test_output.py deleted file mode 100644 index 985368534cb834ff070320e99d9cb6a1b59bb849..0000000000000000000000000000000000000000 --- a/kokoro/linux/make_test_output.py +++ /dev/null @@ -1,94 +0,0 @@ -"""Gathers output from test runs and create an XML file in JUnit format. - -The output files from the individual tests have been written in a directory -structure like: - - $DIR/joblog (output from "parallel --joblog joblog") - $DIR/logs/1/cpp/stdout - $DIR/logs/1/cpp/stderr - $DIR/logs/1/csharp/stdout - $DIR/logs/1/csharp/stderr - $DIR/logs/1/java_jdk7/stdout - $DIR/logs/1/java_jdk7/stderr - etc. - -This script bundles them into a single output XML file so Jenkins can show -detailed test results. It runs as the last step before the Jenkins build -finishes. -""" - -import os -import sys -from yattag import Doc -from collections import defaultdict - - -def readtests(basedir): - tests = defaultdict(dict) - - # Sample input (note: separators are tabs). - # - # Seq Host Starttime Runtime Send Receive Exitval Signal Command - # 1 : 1456263838.313 0.005 0 0 0 0 echo A - with open(basedir + "/joblog") as jobs: - firstline = next(jobs) - for line in jobs: - values = line.split("\t") - - name = values[8].split()[-1] - test = tests[name] - test["name"] = name - test["time"] = values[3] - - exitval = values[6] - if int(exitval): - # We don't have a more specific message. User should look at stderr. - test["failure"] = "TEST FAILURE" - else: - test["failure"] = False - - for testname in os.listdir(basedir + "/logs/1"): - test = tests[testname] - - with open(basedir + "/logs/1/" + testname + "/stdout") as f: - test["stdout"] = f.read() - - with open(basedir + "/logs/1/" + testname + "/stderr") as f: - test["stderr"] = f.read() - - # The cpp test is special since it doesn't run under parallel so doesn't show - # up in the job log. - tests["cpp"]["name"] = "cpp" - - with open(basedir + '/logs/1/cpp/build_time', 'r') as f: - tests["cpp"]["time"] = f.read().strip() - tests["cpp"]["failure"] = False - - ret = tests.values() - ret.sort(key=lambda x: x["name"]) - - return ret - - -def genxml(tests): - doc, tag, text = Doc().tagtext() - - with tag("testsuites"): - with tag("testsuite", name="Protobuf Tests"): - for test in tests: - with tag("testcase", name=test["name"], classname=test["name"], - time=test["time"]): - with tag("system-out"): - text(test["stdout"]) - with tag("system-err"): - text(test["stderr"]) - if test["failure"]: - with tag("failure"): - text(test["failure"]) - - return doc.getvalue() - - -sys.stderr.write("make_test_output.py: writing XML from directory: " + - sys.argv[1] + "\n") -print(genxml(readtests(sys.argv[1]))) diff --git a/kokoro/linux/php80/build.sh b/kokoro/linux/php80/build.sh deleted file mode 100644 index 6499b39af8be1ee763c5da3ce9260ecb80150c6a..0000000000000000000000000000000000000000 --- a/kokoro/linux/php80/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/php -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="php8.0_all" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/php80/continuous.cfg b/kokoro/linux/php80/continuous.cfg deleted file mode 100644 index 8426318bbee4dfe655b3be64b06451a190b160e5..0000000000000000000000000000000000000000 --- a/kokoro/linux/php80/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php80/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/php80/presubmit.cfg b/kokoro/linux/php80/presubmit.cfg deleted file mode 100644 index 8426318bbee4dfe655b3be64b06451a190b160e5..0000000000000000000000000000000000000000 --- a/kokoro/linux/php80/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php80/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/php_all/build.sh b/kokoro/linux/php_all/build.sh deleted file mode 100644 index 23468a70107eb8df1c37ac2ccad31b872122e3c9..0000000000000000000000000000000000000000 --- a/kokoro/linux/php_all/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/php -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="php_all" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/php_all/continuous.cfg b/kokoro/linux/php_all/continuous.cfg deleted file mode 100644 index dfa8037ef82461bd3f534ac4653291ee38076f34..0000000000000000000000000000000000000000 --- a/kokoro/linux/php_all/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php_all/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/php_all/presubmit.cfg b/kokoro/linux/php_all/presubmit.cfg deleted file mode 100644 index dfa8037ef82461bd3f534ac4653291ee38076f34..0000000000000000000000000000000000000000 --- a/kokoro/linux/php_all/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/php_all/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/pull_request_in_docker.sh b/kokoro/linux/pull_request_in_docker.sh deleted file mode 100644 index a048c470315ac145814301ac25ba3bfd31532371..0000000000000000000000000000000000000000 --- a/kokoro/linux/pull_request_in_docker.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# -# This is the script that runs inside Docker, once the image has been built, -# to execute all tests for the "pull request" project. - -WORKSPACE_BASE=`pwd` -MY_DIR="$(dirname "$0")" -TEST_SCRIPT=./tests.sh -BUILD_DIR=/tmp/protobuf - -set -e # exit immediately on error -set -x # display all commands - -# The protobuf repository is mounted into our Docker image, but read-only. -# We clone into a directory inside Docker (this is faster than cp). -rm -rf $BUILD_DIR -mkdir -p $BUILD_DIR -cd $BUILD_DIR -git clone /var/local/kokoro/protobuf -cd protobuf - -# Initialize any submodules: -git submodule update --init --recursive - -$TEST_SCRIPT $TEST_SET diff --git a/kokoro/linux/python/build.sh b/kokoro/linux/python/build.sh deleted file mode 100644 index 86964f55ef1d63ab1aed01f19b0ea9bfb59ffda4..0000000000000000000000000000000000000000 --- a/kokoro/linux/python/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python/continuous.cfg b/kokoro/linux/python/continuous.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python/presubmit.cfg b/kokoro/linux/python/presubmit.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python27/build.sh b/kokoro/linux/python27/build.sh deleted file mode 100644 index 41531a15efe88ae86c4dacca1c7dd4734123121d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python27/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python27 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python27" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python27/continuous.cfg b/kokoro/linux/python27/continuous.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python27/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python27/presubmit.cfg b/kokoro/linux/python27/presubmit.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python27/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python27_cpp/build.sh b/kokoro/linux/python27_cpp/build.sh deleted file mode 100644 index 1a972ee9f26117030e6d0a22376c2c741ef2db29..0000000000000000000000000000000000000000 --- a/kokoro/linux/python27_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python27 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python27_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python27_cpp/continuous.cfg b/kokoro/linux/python27_cpp/continuous.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python27_cpp/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python27_cpp/presubmit.cfg b/kokoro/linux/python27_cpp/presubmit.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python27_cpp/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python35/build.sh b/kokoro/linux/python35/build.sh deleted file mode 100644 index 66ea03f0367ab9b48c4a0adc59bb2e9a91134cab..0000000000000000000000000000000000000000 --- a/kokoro/linux/python35/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python35 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python35" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python35/continuous.cfg b/kokoro/linux/python35/continuous.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python35/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python35/presubmit.cfg b/kokoro/linux/python35/presubmit.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python35/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python35_cpp/build.sh b/kokoro/linux/python35_cpp/build.sh deleted file mode 100644 index 4d0dbd4986b29ad30b42df538eaf2b47d689bd63..0000000000000000000000000000000000000000 --- a/kokoro/linux/python35_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python35 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python35_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python35_cpp/continuous.cfg b/kokoro/linux/python35_cpp/continuous.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python35_cpp/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python35_cpp/presubmit.cfg b/kokoro/linux/python35_cpp/presubmit.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python35_cpp/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python36/build.sh b/kokoro/linux/python36/build.sh deleted file mode 100644 index a483efc3027f1d55a2061c7494052bf16850ae53..0000000000000000000000000000000000000000 --- a/kokoro/linux/python36/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python36 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python36" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python36/continuous.cfg b/kokoro/linux/python36/continuous.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python36/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python36/presubmit.cfg b/kokoro/linux/python36/presubmit.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python36/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python36_cpp/build.sh b/kokoro/linux/python36_cpp/build.sh deleted file mode 100644 index eb71bda92c48ce1fc245665acb82118d0c0f6480..0000000000000000000000000000000000000000 --- a/kokoro/linux/python36_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python36 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python36_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python36_cpp/continuous.cfg b/kokoro/linux/python36_cpp/continuous.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python36_cpp/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python36_cpp/presubmit.cfg b/kokoro/linux/python36_cpp/presubmit.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python36_cpp/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python37/build.sh b/kokoro/linux/python37/build.sh deleted file mode 100644 index 2117a271ce647c7013f1c4574073e91406b2a4ad..0000000000000000000000000000000000000000 --- a/kokoro/linux/python37/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python37 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python37" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python37/continuous.cfg b/kokoro/linux/python37/continuous.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python37/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python37/presubmit.cfg b/kokoro/linux/python37/presubmit.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python37/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python37_cpp/build.sh b/kokoro/linux/python37_cpp/build.sh deleted file mode 100644 index 3126b481e3722f55c1eaaef3d1aa0fa6ce4d5b1d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python37_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python37 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python37_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python37_cpp/continuous.cfg b/kokoro/linux/python37_cpp/continuous.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python37_cpp/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python37_cpp/presubmit.cfg b/kokoro/linux/python37_cpp/presubmit.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python37_cpp/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python38/build.sh b/kokoro/linux/python38/build.sh deleted file mode 100644 index 299c7ba6f3bdb6374d7013c63bcc1a6c3a79f592..0000000000000000000000000000000000000000 --- a/kokoro/linux/python38/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python38 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python38" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python38/continuous.cfg b/kokoro/linux/python38/continuous.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python38/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python38/presubmit.cfg b/kokoro/linux/python38/presubmit.cfg deleted file mode 100644 index e2fc4136f07e344719f71229b1cead698be3a80a..0000000000000000000000000000000000000000 --- a/kokoro/linux/python38/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python38_cpp/build.sh b/kokoro/linux/python38_cpp/build.sh deleted file mode 100644 index b43859b988a9fb504324b75b82850fca4192de25..0000000000000000000000000000000000000000 --- a/kokoro/linux/python38_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python38 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python38_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python38_cpp/continuous.cfg b/kokoro/linux/python38_cpp/continuous.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python38_cpp/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python38_cpp/presubmit.cfg b/kokoro/linux/python38_cpp/presubmit.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python38_cpp/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python_compatibility/build.sh b/kokoro/linux/python_compatibility/build.sh deleted file mode 100644 index 1ba35394d1c9f1c52adacf12f3db4c5601c0681d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python_compatibility/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python_compatibility" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python_compatibility/continuous.cfg b/kokoro/linux/python_compatibility/continuous.cfg deleted file mode 100644 index 4cf6bb077c88b7d052d5953177537b46294bc2e6..0000000000000000000000000000000000000000 --- a/kokoro/linux/python_compatibility/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_compatibility/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/python_compatibility/presubmit.cfg b/kokoro/linux/python_compatibility/presubmit.cfg deleted file mode 100644 index 4cf6bb077c88b7d052d5953177537b46294bc2e6..0000000000000000000000000000000000000000 --- a/kokoro/linux/python_compatibility/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_compatibility/build.sh" -timeout_mins: 1440 diff --git a/kokoro/linux/python_cpp/build.sh b/kokoro/linux/python_cpp/build.sh deleted file mode 100644 index add64651909508a8d2e9bf5441ee29ceda422742..0000000000000000000000000000000000000000 --- a/kokoro/linux/python_cpp/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERFILE_DIR=kokoro/linux/64-bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python_cpp/continuous.cfg b/kokoro/linux/python_cpp/continuous.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python_cpp/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/python_cpp/presubmit.cfg b/kokoro/linux/python_cpp/presubmit.cfg deleted file mode 100644 index b1b0e550ffd44ce168a8af42cd15b12a2b6fdd4d..0000000000000000000000000000000000000000 --- a/kokoro/linux/python_cpp/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/python_cpp/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby23/build.sh b/kokoro/linux/ruby23/build.sh deleted file mode 100644 index 503a320de22e74dbb57d6255c5551f11ded9fb66..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby23/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby23" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby23/continuous.cfg b/kokoro/linux/ruby23/continuous.cfg deleted file mode 100644 index f5c64988bfc7c262367439b7304d39d5c7d4f409..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby23/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby23/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby23/presubmit.cfg b/kokoro/linux/ruby23/presubmit.cfg deleted file mode 100644 index f5c64988bfc7c262367439b7304d39d5c7d4f409..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby23/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby23/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby24/build.sh b/kokoro/linux/ruby24/build.sh deleted file mode 100644 index 68585aabc0a59ed3cfe73ba434c3f780372043c3..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby24/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby24" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby24/continuous.cfg b/kokoro/linux/ruby24/continuous.cfg deleted file mode 100644 index a1ccfc0b8ba8552aff0ba96e16c6de6badc5d9e1..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby24/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby24/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby24/presubmit.cfg b/kokoro/linux/ruby24/presubmit.cfg deleted file mode 100644 index a1ccfc0b8ba8552aff0ba96e16c6de6badc5d9e1..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby24/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby24/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby25/build.sh b/kokoro/linux/ruby25/build.sh deleted file mode 100644 index 1e82ec5f4c68f2a423b5a16a89021a5baf84618e..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby25/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby25" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby25/continuous.cfg b/kokoro/linux/ruby25/continuous.cfg deleted file mode 100644 index dee2db033fc5e9557aa6f25b4c4fba1ed663696f..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby25/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby25/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby25/presubmit.cfg b/kokoro/linux/ruby25/presubmit.cfg deleted file mode 100644 index dee2db033fc5e9557aa6f25b4c4fba1ed663696f..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby25/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby25/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby26/build.sh b/kokoro/linux/ruby26/build.sh deleted file mode 100644 index 72d2d45669cbd2a553e98b183066083d323edb0c..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby26/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby26" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby26/continuous.cfg b/kokoro/linux/ruby26/continuous.cfg deleted file mode 100644 index 47790656704b39f807a0cea99f460adb193d2437..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby26/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby26/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby26/presubmit.cfg b/kokoro/linux/ruby26/presubmit.cfg deleted file mode 100644 index 47790656704b39f807a0cea99f460adb193d2437..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby26/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby26/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby27/build.sh b/kokoro/linux/ruby27/build.sh deleted file mode 100644 index c38ee36e584a302d930ea5842e0071998790e48d..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby27/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby27" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby27/continuous.cfg b/kokoro/linux/ruby27/continuous.cfg deleted file mode 100644 index 9cce8c90e1ffc1f8396a8aa18e901e2aea791896..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby27/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby27/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby27/presubmit.cfg b/kokoro/linux/ruby27/presubmit.cfg deleted file mode 100644 index 9cce8c90e1ffc1f8396a8aa18e901e2aea791896..0000000000000000000000000000000000000000 --- a/kokoro/linux/ruby27/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby27/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/macos/cpp/build.sh b/kokoro/macos/cpp/build.sh deleted file mode 100644 index bae2ebbc5fc1d2fe27f08e25754f00c0f4bb1ef1..0000000000000000000000000000000000000000 --- a/kokoro/macos/cpp/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh cpp diff --git a/kokoro/macos/cpp/continuous.cfg b/kokoro/macos/cpp/continuous.cfg deleted file mode 100644 index 4bea1cbbb121e8e90e29cfba9c8090b3272d2877..0000000000000000000000000000000000000000 --- a/kokoro/macos/cpp/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/cpp/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/cpp/presubmit.cfg b/kokoro/macos/cpp/presubmit.cfg deleted file mode 100644 index 4bea1cbbb121e8e90e29cfba9c8090b3272d2877..0000000000000000000000000000000000000000 --- a/kokoro/macos/cpp/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/cpp/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/cpp_distcheck/build.sh b/kokoro/macos/cpp_distcheck/build.sh deleted file mode 100644 index d729b63db19638bc4dc58f54619456a4b9e985d4..0000000000000000000000000000000000000000 --- a/kokoro/macos/cpp_distcheck/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh cpp_distcheck diff --git a/kokoro/macos/cpp_distcheck/continuous.cfg b/kokoro/macos/cpp_distcheck/continuous.cfg deleted file mode 100644 index 89441bcca0b7f05e389ae5cfc74c0a4d797a888e..0000000000000000000000000000000000000000 --- a/kokoro/macos/cpp_distcheck/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/cpp_distcheck/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/cpp_distcheck/presubmit.cfg b/kokoro/macos/cpp_distcheck/presubmit.cfg deleted file mode 100644 index 89441bcca0b7f05e389ae5cfc74c0a4d797a888e..0000000000000000000000000000000000000000 --- a/kokoro/macos/cpp_distcheck/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/cpp_distcheck/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/javascript/build.sh b/kokoro/macos/javascript/build.sh deleted file mode 100644 index 016832a32e17e415ee686d3a0318a5f49746eced..0000000000000000000000000000000000000000 --- a/kokoro/macos/javascript/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh javascript diff --git a/kokoro/macos/javascript/continuous.cfg b/kokoro/macos/javascript/continuous.cfg deleted file mode 100644 index b478cc19392cf49ebd74e892e9783043b2b0c5ea..0000000000000000000000000000000000000000 --- a/kokoro/macos/javascript/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/javascript/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/javascript/presubmit.cfg b/kokoro/macos/javascript/presubmit.cfg deleted file mode 100644 index b478cc19392cf49ebd74e892e9783043b2b0c5ea..0000000000000000000000000000000000000000 --- a/kokoro/macos/javascript/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/javascript/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_cocoapods_integration/build.sh b/kokoro/macos/objectivec_cocoapods_integration/build.sh deleted file mode 100644 index 8f3c9b4c15d64a21f711ff992377dab7c0d82ac8..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_cocoapods_integration/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_COCOAPODS=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh objectivec_cocoapods_integration diff --git a/kokoro/macos/objectivec_cocoapods_integration/continuous.cfg b/kokoro/macos/objectivec_cocoapods_integration/continuous.cfg deleted file mode 100644 index 952874ed11e7174b15237a5a99bdadb4d1a397a1..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_cocoapods_integration/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_cocoapods_integration/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_cocoapods_integration/presubmit.cfg b/kokoro/macos/objectivec_cocoapods_integration/presubmit.cfg deleted file mode 100644 index 952874ed11e7174b15237a5a99bdadb4d1a397a1..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_cocoapods_integration/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_cocoapods_integration/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_ios_debug/build.sh b/kokoro/macos/objectivec_ios_debug/build.sh deleted file mode 100644 index 1055d72ecba2214963866e0f627ae04d760b652f..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_ios_debug/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh objectivec_ios_debug diff --git a/kokoro/macos/objectivec_ios_debug/continuous.cfg b/kokoro/macos/objectivec_ios_debug/continuous.cfg deleted file mode 100644 index 473d54554a0350b86514456d3712ed96707b3601..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_ios_debug/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_debug/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_ios_debug/presubmit.cfg b/kokoro/macos/objectivec_ios_debug/presubmit.cfg deleted file mode 100644 index 473d54554a0350b86514456d3712ed96707b3601..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_ios_debug/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_debug/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_ios_release/build.sh b/kokoro/macos/objectivec_ios_release/build.sh deleted file mode 100644 index 76ce3ba0b585dc1dd0dde47ab4453c25bf60709f..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_ios_release/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh objectivec_ios_release diff --git a/kokoro/macos/objectivec_ios_release/continuous.cfg b/kokoro/macos/objectivec_ios_release/continuous.cfg deleted file mode 100644 index 3cbfb685d876300e4fc411a023eda482415fe87e..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_ios_release/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_release/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_ios_release/presubmit.cfg b/kokoro/macos/objectivec_ios_release/presubmit.cfg deleted file mode 100644 index 3cbfb685d876300e4fc411a023eda482415fe87e..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_ios_release/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_ios_release/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_osx/build.sh b/kokoro/macos/objectivec_osx/build.sh deleted file mode 100644 index 000be274601d1d3b0fc949d11f4e9ecc2d46846e..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_osx/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh objectivec_osx diff --git a/kokoro/macos/objectivec_osx/continuous.cfg b/kokoro/macos/objectivec_osx/continuous.cfg deleted file mode 100644 index 41bd46aa8703d35aeb760475eb7e0d2c55d9bd59..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_osx/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_osx/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/objectivec_osx/presubmit.cfg b/kokoro/macos/objectivec_osx/presubmit.cfg deleted file mode 100644 index 41bd46aa8703d35aeb760475eb7e0d2c55d9bd59..0000000000000000000000000000000000000000 --- a/kokoro/macos/objectivec_osx/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/objectivec_osx/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/php5.6_mac/build.sh b/kokoro/macos/php5.6_mac/build.sh deleted file mode 100644 index 74878898faa71535a46c650efb5714aceb113593..0000000000000000000000000000000000000000 --- a/kokoro/macos/php5.6_mac/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh php5.6_mac diff --git a/kokoro/macos/php5.6_mac/continuous.cfg b/kokoro/macos/php5.6_mac/continuous.cfg deleted file mode 100644 index ff345e9fc41d0584113755744eddff5db8199f21..0000000000000000000000000000000000000000 --- a/kokoro/macos/php5.6_mac/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php5.6_mac/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/php5.6_mac/presubmit.cfg b/kokoro/macos/php5.6_mac/presubmit.cfg deleted file mode 100644 index ff345e9fc41d0584113755744eddff5db8199f21..0000000000000000000000000000000000000000 --- a/kokoro/macos/php5.6_mac/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php5.6_mac/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/php7.0_mac/build.sh b/kokoro/macos/php7.0_mac/build.sh deleted file mode 100644 index e5a37e30eee0dd5285f94877059652c9c2e96b18..0000000000000000000000000000000000000000 --- a/kokoro/macos/php7.0_mac/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh php7.0_mac diff --git a/kokoro/macos/php7.0_mac/continuous.cfg b/kokoro/macos/php7.0_mac/continuous.cfg deleted file mode 100644 index c2c18119207dce93807826ffce13aaf01834a705..0000000000000000000000000000000000000000 --- a/kokoro/macos/php7.0_mac/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php7.0_mac/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/php7.0_mac/presubmit.cfg b/kokoro/macos/php7.0_mac/presubmit.cfg deleted file mode 100644 index c2c18119207dce93807826ffce13aaf01834a705..0000000000000000000000000000000000000000 --- a/kokoro/macos/php7.0_mac/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php7.0_mac/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/php7.3_mac/build.sh b/kokoro/macos/php7.3_mac/build.sh deleted file mode 100644 index 2d2f679da2ca0da4eb217789362c04c2688603f5..0000000000000000000000000000000000000000 --- a/kokoro/macos/php7.3_mac/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -source kokoro/macos/prepare_build_macos_rc - -./tests.sh php7.3_mac diff --git a/kokoro/macos/php7.3_mac/continuous.cfg b/kokoro/macos/php7.3_mac/continuous.cfg deleted file mode 100644 index 9a717451d373bd1d0ca2d25d300554c176db98da..0000000000000000000000000000000000000000 --- a/kokoro/macos/php7.3_mac/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php7.3_mac/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/php7.3_mac/presubmit.cfg b/kokoro/macos/php7.3_mac/presubmit.cfg deleted file mode 100644 index 9a717451d373bd1d0ca2d25d300554c176db98da..0000000000000000000000000000000000000000 --- a/kokoro/macos/php7.3_mac/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/php7.3_mac/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc deleted file mode 100644 index 830e7eee67312f3daee867fd42cb7aa4cd6eae2e..0000000000000000000000000000000000000000 --- a/kokoro/macos/prepare_build_macos_rc +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# -# This script sets up a Kokoro MacOS worker for running Protobuf tests - -set -eux - -## -# Select Xcode version - -# Remember to update the Xcode version when Xcode_11.3.app is not available. -# If xcode is not available, it will probably encounter the failure for -# "autom4te: need GNU m4 1.4 or later: /usr/bin/m4" -# go/kokoro/userdocs/macos/selecting_xcode.md for more information. -export DEVELOPER_DIR=/Applications/Xcode_11.3.app/Contents/Developer - -## -# Select C/C++ compilers - -export CC=gcc -export CXX=g++ - -## -# Brew: update, then upgrade the installed tools to current version and install -# some needed ones not in the Kokoro base image. This ensure current versions -# of CMake, autotools, etc. - -# But first... -# -# The transitive deps of the installed tools need protobuf, but Kokoro manually -# installed it outside of brew so it needs to be removed so brew can install the -# tools (and a newer version of protobuf). g/kokoro-users/7FRvQMUdN40 about why -# it is a manual install vs. a brew install in the first place. -sudo rm -rf \ - /usr/local/include/google/protobuf \ - /usr/local/bin/protoc -# Likewise, updating python can have issues because of some existing binaries. -sudo rm -rf \ - /usr/local/bin/2to3* \ - /usr/local/bin/idle3* \ - /usr/local/bin/pydoc3* \ - /usr/local/bin/python3* \ - /usr/local/bin/pyvenv* - -brew update -brew upgrade - -## -# Install Ruby - -if [[ "${KOKORO_INSTALL_RUBY:-}" == "yes" ]] ; then - brew install ruby -fi - -## -# Install Cocoapods - -if [[ "${KOKORO_INSTALL_COCOAPODS:-}" == "yes" ]] ; then - # The existing cocoapods was installed via gem, but that doesn't work well - # with the overlap in deps with things managed by brew (errors around ruby - # versions, etc.); so remove it and install in via brew instead. - gem uninstall -a "$(gem list | grep cocoapods | cut -d ' ' -f 1)" - brew install cocoapods -fi - -## -# Install Tox - -if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then - sudo python3 -m pip install --upgrade pip tox -fi - -## -# Install RVM - -if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then - curl -sSL https://rvm.io/mpapis.asc | gpg --import - - curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - - - curl -sSL https://get.rvm.io | bash -s stable --ruby -fi diff --git a/kokoro/macos/python/build.sh b/kokoro/macos/python/build.sh deleted file mode 100644 index 388e24b4ac1281ed1f544b858eb07b8d9eaf43d1..0000000000000000000000000000000000000000 --- a/kokoro/macos/python/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_TOX=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh python diff --git a/kokoro/macos/python/continuous.cfg b/kokoro/macos/python/continuous.cfg deleted file mode 100644 index 0fc8b503e81ca6c77f5afa57a189ced283caf8f8..0000000000000000000000000000000000000000 --- a/kokoro/macos/python/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/python/presubmit.cfg b/kokoro/macos/python/presubmit.cfg deleted file mode 100644 index 0fc8b503e81ca6c77f5afa57a189ced283caf8f8..0000000000000000000000000000000000000000 --- a/kokoro/macos/python/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/python_cpp/build.sh b/kokoro/macos/python_cpp/build.sh deleted file mode 100644 index f86dd6f76e49e2c16beacecc0da937fb507af420..0000000000000000000000000000000000000000 --- a/kokoro/macos/python_cpp/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_TOX=yes -source kokoro/macos/prepare_build_macos_rc -g++ --version - -./tests.sh python_cpp diff --git a/kokoro/macos/python_cpp/continuous.cfg b/kokoro/macos/python_cpp/continuous.cfg deleted file mode 100644 index 22f4a0e4c90bc80b27749ea5ffd2c88bd3033f63..0000000000000000000000000000000000000000 --- a/kokoro/macos/python_cpp/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python_cpp/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/python_cpp/presubmit.cfg b/kokoro/macos/python_cpp/presubmit.cfg deleted file mode 100644 index 22f4a0e4c90bc80b27749ea5ffd2c88bd3033f63..0000000000000000000000000000000000000000 --- a/kokoro/macos/python_cpp/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/python_cpp/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby23/build.sh b/kokoro/macos/ruby23/build.sh deleted file mode 100644 index 9317838781cea3a39fdd411284da893fba804538..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby23/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_RUBY=yes -KOKORO_INSTALL_RVM=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh ruby23 diff --git a/kokoro/macos/ruby23/continuous.cfg b/kokoro/macos/ruby23/continuous.cfg deleted file mode 100644 index c9b1f61284af3ae51b15804b6e93fa34ee66251a..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby23/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby23/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby23/presubmit.cfg b/kokoro/macos/ruby23/presubmit.cfg deleted file mode 100644 index c9b1f61284af3ae51b15804b6e93fa34ee66251a..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby23/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby23/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby24/build.sh b/kokoro/macos/ruby24/build.sh deleted file mode 100644 index 51bb2e603b8cff510748504e5cd9bd236589c6c8..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby24/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_RUBY=yes -KOKORO_INSTALL_RVM=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh ruby24 diff --git a/kokoro/macos/ruby24/continuous.cfg b/kokoro/macos/ruby24/continuous.cfg deleted file mode 100644 index fada028fc502ec355e46d0dc5f7aafd1673119ae..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby24/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby24/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby24/presubmit.cfg b/kokoro/macos/ruby24/presubmit.cfg deleted file mode 100644 index fada028fc502ec355e46d0dc5f7aafd1673119ae..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby24/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby24/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby25/build.sh b/kokoro/macos/ruby25/build.sh deleted file mode 100644 index ba2d0a4d1926fc60d9f838f83936f09939396cf2..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby25/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_RUBY=yes -KOKORO_INSTALL_RVM=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh ruby25 diff --git a/kokoro/macos/ruby25/continuous.cfg b/kokoro/macos/ruby25/continuous.cfg deleted file mode 100644 index b3755e410448921b15a55bab8523444012cd5603..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby25/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby25/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby25/presubmit.cfg b/kokoro/macos/ruby25/presubmit.cfg deleted file mode 100644 index b3755e410448921b15a55bab8523444012cd5603..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby25/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby25/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby26/build.sh b/kokoro/macos/ruby26/build.sh deleted file mode 100644 index 5a4c2432227e8116282e5ad76f7d7faa9beb58e0..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby26/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_RUBY=yes -KOKORO_INSTALL_RVM=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh ruby26 diff --git a/kokoro/macos/ruby26/continuous.cfg b/kokoro/macos/ruby26/continuous.cfg deleted file mode 100644 index 688f63c2bc3ef52d2226c10584e1fbf8758f1250..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby26/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby26/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby26/presubmit.cfg b/kokoro/macos/ruby26/presubmit.cfg deleted file mode 100644 index 688f63c2bc3ef52d2226c10584e1fbf8758f1250..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby26/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby26/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby27/build.sh b/kokoro/macos/ruby27/build.sh deleted file mode 100644 index b1529b9da02b3dbbbe272aaf8ef1873610785744..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby27/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_RUBY=yes -KOKORO_INSTALL_RVM=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh ruby27 diff --git a/kokoro/macos/ruby27/continuous.cfg b/kokoro/macos/ruby27/continuous.cfg deleted file mode 100644 index b10b455da3fbf733cc51a244fb321953e8c29e5f..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby27/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby27/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby27/presubmit.cfg b/kokoro/macos/ruby27/presubmit.cfg deleted file mode 100644 index b10b455da3fbf733cc51a244fb321953e8c29e5f..0000000000000000000000000000000000000000 --- a/kokoro/macos/ruby27/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby27/build.sh" -timeout_mins: 1440 diff --git a/kokoro/release/collect_all_artifacts.cfg b/kokoro/release/collect_all_artifacts.cfg deleted file mode 100644 index 3da1a7c49a02ccdc05715e86df2e982a6c5e7fb6..0000000000000000000000000000000000000000 --- a/kokoro/release/collect_all_artifacts.cfg +++ /dev/null @@ -1,7 +0,0 @@ -build_file: "protobuf/kokoro/release/collect_all_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/collect_all_artifacts.sh b/kokoro/release/collect_all_artifacts.sh deleted file mode 100644 index 3b7d7d4066285d5e20a16949291fa928dfc76fab..0000000000000000000000000000000000000000 --- a/kokoro/release/collect_all_artifacts.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -set -ex - -# Change to repo root. -cd $(dirname $0)/../.. - -# Initialize any submodules. -git submodule update --init --recursive - -# The directory with all resulting artifacts -mkdir -p artifacts - -# Artifacts from all predecessor jobs get copied to this directory by kokoro -INPUT_ARTIFACTS_DIR="${KOKORO_GFILE_DIR}/github/protobuf" - -# TODO(jtattermusch): remove listing the files, but for now it make it easier -# to iterate on the script. -ls -R ${INPUT_ARTIFACTS_DIR} - -# ==================================== -# Copy to expose all the artifacts from the predecessor jobs to the output -# TODO(jtattermusch): the directory layout of the artifact builds is pretty messy, -# so will be the output artifacts of this job. -cp -r ${INPUT_ARTIFACTS_DIR}/* artifacts - -# ==================================== -# Build Google.Protobuf.Tools C# nuget -# The reason it's being done in this script is that we need access to protoc binaries -# built on multiple platform (the build is performed by the "build artifact" step) -# and adding and extra chained build just for building the Google.Protobuf.Tools -# nuget seems like an overkill. -cd csharp -mkdir -p protoc/windows_x86 -mkdir -p protoc/windows_x64 -cp ${INPUT_ARTIFACTS_DIR}/build32/Release/protoc.exe protoc/windows_x86/protoc.exe -cp ${INPUT_ARTIFACTS_DIR}/build64/Release/protoc.exe protoc/windows_x64/protoc.exe - -mkdir -p protoc/linux_x86 -mkdir -p protoc/linux_x64 -# Because of maven unrelated reasonse the linux protoc binaries have a dummy .exe extension. -# For the Google.Protobuf.Tools nuget, we don't want that expection, so we just remove it. -cp ${INPUT_ARTIFACTS_DIR}/protoc-artifacts/target/linux/x86_32/protoc.exe protoc/linux_x86/protoc -cp ${INPUT_ARTIFACTS_DIR}/protoc-artifacts/target/linux/x86_64/protoc.exe protoc/linux_x64/protoc - -mkdir -p protoc/macosx_x64 -cp ${INPUT_ARTIFACTS_DIR}/build64/src/protoc protoc/macosx_x64/protoc - -# Install nuget (will also install mono) -# TODO(jtattermusch): use "mono:5.14" docker image instead so we don't have to apt-get install -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -sudo apt install apt-transport-https -echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list -sudo apt update -sudo apt-get install -y nuget - -nuget pack Google.Protobuf.Tools.nuspec - -# Copy the nupkg to the output artifacts -cp Google.Protobuf.Tools.*.nupkg ../artifacts diff --git a/kokoro/release/csharp/windows/build_nuget.bat b/kokoro/release/csharp/windows/build_nuget.bat deleted file mode 100644 index 0ff8db04284ffcb30e6d12062c9b4eb54b1d1723..0000000000000000000000000000000000000000 --- a/kokoro/release/csharp/windows/build_nuget.bat +++ /dev/null @@ -1,14 +0,0 @@ -@rem enter repo root -cd /d %~dp0\..\..\..\.. - -cd csharp - -@rem Install dotnet SDK -powershell -File install_dotnet_sdk.ps1 -set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH% - -@rem Disable some unwanted dotnet options -set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true -set DOTNET_CLI_TELEMETRY_OPTOUT=true - -call build_packages.bat diff --git a/kokoro/release/csharp/windows/continuous.cfg b/kokoro/release/csharp/windows/continuous.cfg deleted file mode 100644 index f508c65bda0fe11c58b64df3bbf3bb5d9fe9cce3..0000000000000000000000000000000000000000 --- a/kokoro/release/csharp/windows/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat" -timeout_mins: 60 - -action { - define_artifacts { - regex: "**/*.nupkg" - } -} diff --git a/kokoro/release/csharp/windows/presubmit.cfg b/kokoro/release/csharp/windows/presubmit.cfg deleted file mode 100644 index f508c65bda0fe11c58b64df3bbf3bb5d9fe9cce3..0000000000000000000000000000000000000000 --- a/kokoro/release/csharp/windows/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat" -timeout_mins: 60 - -action { - define_artifacts { - regex: "**/*.nupkg" - } -} diff --git a/kokoro/release/csharp/windows/release.cfg b/kokoro/release/csharp/windows/release.cfg deleted file mode 100644 index f508c65bda0fe11c58b64df3bbf3bb5d9fe9cce3..0000000000000000000000000000000000000000 --- a/kokoro/release/csharp/windows/release.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat" -timeout_mins: 60 - -action { - define_artifacts { - regex: "**/*.nupkg" - } -} diff --git a/kokoro/release/protoc/linux/build.sh b/kokoro/release/protoc/linux/build.sh deleted file mode 100644 index efc3ee62caaba1c3c417fc7f3ad0255659616707..0000000000000000000000000000000000000000 --- a/kokoro/release/protoc/linux/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -x - -# Change to repo root. -cd $(dirname $0)/../../../.. - -# Initialize any submodules. -git submodule update --init --recursive - -# Generate the configure script. -./autogen.sh - -# Cross-build for aarch64, ppc64le and s390x. Note: we do these builds first to avoid -# file permission issues. The Docker builds will create directories owned by -# root, which causes problems if we try to add new artifacts to those -# directories afterward. - -sudo apt install -y g++-aarch64-linux-gnu -protoc-artifacts/build-protoc.sh linux aarch_64 protoc - -sudo apt install -y g++-powerpc64le-linux-gnu -protoc-artifacts/build-protoc.sh linux ppcle_64 protoc - -sudo apt install -y g++-s390x-linux-gnu -protoc-artifacts/build-protoc.sh linux s390x protoc - -# Use docker image to build linux artifacts. -DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ") -docker pull $DOCKER_IMAGE_NAME - -docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \ - bash -l /var/local/protobuf/protoc-artifacts/build-protoc.sh \ - linux x86_64 protoc || { - echo "Failed to build protoc for linux + x86_64." - exit 1 -} - -docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \ - bash -l /var/local/protobuf/protoc-artifacts/build-protoc.sh \ - linux x86_32 protoc || { - echo "Failed to build protoc for linux + x86_32." - exit 1 -} diff --git a/kokoro/release/protoc/linux/release.cfg b/kokoro/release/protoc/linux/release.cfg deleted file mode 100644 index 4d8b7b612f1d8717cf6068c7a71a4cb64f56505c..0000000000000000000000000000000000000000 --- a/kokoro/release/protoc/linux/release.cfg +++ /dev/null @@ -1,7 +0,0 @@ -build_file: "protobuf/kokoro/release/protoc/linux/build.sh" - -action { - define_artifacts { - regex: "**/protoc.exe" - } -} diff --git a/kokoro/release/protoc/macos/build.sh b/kokoro/release/protoc/macos/build.sh deleted file mode 100644 index 47c9bfa9685edb8a4013313aaa3d58a163204db5..0000000000000000000000000000000000000000 --- a/kokoro/release/protoc/macos/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -ex -CXXFLAGS_COMMON="-std=c++14 -DNDEBUG -mmacosx-version-min=10.9" - -cd github/protobuf -./autogen.sh - -mkdir build64 && cd build64 -export CXXFLAGS="$CXXFLAGS_COMMON -m64" -../configure --disable-shared -make -j4 -file src/protoc -otool -L src/protoc | grep dylib -cd .. diff --git a/kokoro/release/protoc/macos/release.cfg b/kokoro/release/protoc/macos/release.cfg deleted file mode 100644 index da903d0316073db7a22179b5d013a00f12f85e9c..0000000000000000000000000000000000000000 --- a/kokoro/release/protoc/macos/release.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Mac OSX protoc release builds -build_file: "protobuf/kokoro/release/protoc/macos/build.sh" - -action { - define_artifacts { - regex: "**/protoc" - } -} diff --git a/kokoro/release/protoc/windows/build.bat b/kokoro/release/protoc/windows/build.bat deleted file mode 100644 index ae0fa94a106e707f2293045cc261ebde9be9f70d..0000000000000000000000000000000000000000 --- a/kokoro/release/protoc/windows/build.bat +++ /dev/null @@ -1,27 +0,0 @@ -set PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH% -set generator32=Visual Studio 14 -set generator64=Visual Studio 14 Win64 -set vcplatform32=win32 -set vcplatform64=x64 -set configuration=Release - -echo Building protoc -cd github\protobuf - -mkdir build32 -cd build32 -cmake -G "%generator32%" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_UNICODE=ON ../cmake -msbuild protobuf.sln /p:Platform=%vcplatform32% || goto error -cd .. - -mkdir build64 -cd build64 -cmake -G "%generator64%" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_UNICODE=ON ../cmake -msbuild protobuf.sln /p:Platform=%vcplatform64% || goto error -cd .. - -goto :EOF - -:error -echo Failed! -exit /b %ERRORLEVEL% diff --git a/kokoro/release/protoc/windows/release.cfg b/kokoro/release/protoc/windows/release.cfg deleted file mode 100644 index 0d0da8f133b7896814a60eae3c96a11c9d4af59a..0000000000000000000000000000000000000000 --- a/kokoro/release/protoc/windows/release.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Windows protoc release builds -build_file: "protobuf/kokoro/release/protoc/windows/build.bat" - -action { - define_artifacts { - regex: "**/protoc.exe" - } -} diff --git a/kokoro/release/python/linux/build_artifacts.sh b/kokoro/release/python/linux/build_artifacts.sh deleted file mode 100644 index fd9d5a93952cfeb41ec93aaf2aa21b81ceba3bda..0000000000000000000000000000000000000000 --- a/kokoro/release/python/linux/build_artifacts.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -set -ex - -# change to repo root -pushd $(dirname $0)/../../../.. - -# Create stage dir -ORIGINAL_DIR=`pwd` -pushd .. -cp -R $ORIGINAL_DIR stage -export STAGE_DIR="`pwd`/stage" -popd - -export REPO_DIR=protobuf -export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"` - -export BUILD_COMMIT=`git rev-parse HEAD` -export PLAT=x86_64 -export UNICODE_WIDTH=32 -export MACOSX_DEPLOYMENT_TARGET=10.9 - -rm -rf artifacts/ -rm -rf multibuild/ -mkdir artifacts -export ARTIFACT_DIR=$(pwd)/artifacts - -git clone https://github.com/matthew-brett/multibuild.git -cp kokoro/release/python/linux/config.sh config.sh - -build_artifact_version() { - MB_PYTHON_VERSION=$1 - - # Clean up env - rm -rf venv - sudo rm -rf $REPO_DIR - cp -R $STAGE_DIR $REPO_DIR - - source multibuild/common_utils.sh - source multibuild/travis_steps.sh - before_install - - clean_code $REPO_DIR $BUILD_COMMIT - sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py - cat $REPO_DIR/python/setup.py - - build_wheel $REPO_DIR/python $PLAT - - mv wheelhouse/* $ARTIFACT_DIR -} - -build_artifact_version 2.7 -build_artifact_version 3.5 -build_artifact_version 3.6 -build_artifact_version 3.7 -build_artifact_version 3.8 diff --git a/kokoro/release/python/linux/config.sh b/kokoro/release/python/linux/config.sh deleted file mode 100644 index 7a8f663d81a930ccb826b99ddd9234ade46cbc24..0000000000000000000000000000000000000000 --- a/kokoro/release/python/linux/config.sh +++ /dev/null @@ -1,50 +0,0 @@ -# Define custom utilities -# Test for OSX with [ -n "$IS_OSX" ] - -function pre_build { - # Any stuff that you need to do before you start building the wheels - # Runs in the root directory of this repository. - pushd protobuf - - yum install -y devtoolset-2-libatomic-devel - - # Build protoc - ./autogen.sh - ./configure - - CXXFLAGS="-fPIC -g -O2" ./configure - make -j8 - - # Generate python dependencies. - pushd python - python setup.py build_py - popd - - popd -} - -function bdist_wheel_cmd { - # Builds wheel with bdist_wheel, puts into wheelhouse - # - # It may sometimes be useful to use bdist_wheel for the wheel building - # process. For example, versioneer has problems with versions which are - # fixed with bdist_wheel: - # https://github.com/warner/python-versioneer/issues/121 - local abs_wheelhouse=$1 - - # Modify build version - pwd - ls - python setup.py bdist_wheel --cpp_implementation --compile_static_extension - cp dist/*.whl $abs_wheelhouse -} - -function build_wheel { - build_wheel_cmd "bdist_wheel_cmd" $@ -} - -function run_tests { - # Runs tests on installed distribution from an empty directory - python --version - python -c "from google.protobuf.pyext import _message;" -} diff --git a/kokoro/release/python/linux/continuous.cfg b/kokoro/release/python/linux/continuous.cfg deleted file mode 100644 index c0b9a018f131df8534eedba6002a6f755fbc210b..0000000000000000000000000000000000000000 --- a/kokoro/release/python/linux/continuous.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Config file for running tests in Kokoro -build_file: "protobuf/kokoro/release/python/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/linux/presubmit.cfg b/kokoro/release/python/linux/presubmit.cfg deleted file mode 100644 index c0b9a018f131df8534eedba6002a6f755fbc210b..0000000000000000000000000000000000000000 --- a/kokoro/release/python/linux/presubmit.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Config file for running tests in Kokoro -build_file: "protobuf/kokoro/release/python/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/linux/release.cfg b/kokoro/release/python/linux/release.cfg deleted file mode 100644 index b31b3f11929b4fd07eae47f077b0b83eee6a12f1..0000000000000000000000000000000000000000 --- a/kokoro/release/python/linux/release.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Linux release builds -build_file: "protobuf/kokoro/release/python/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/macos/build_artifacts.sh b/kokoro/release/python/macos/build_artifacts.sh deleted file mode 100644 index 15aae39777a71477d0e48588b7f54e5f2d6d76a8..0000000000000000000000000000000000000000 --- a/kokoro/release/python/macos/build_artifacts.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -set -ex - -# change to repo root -pushd $(dirname $0)/../../../.. - -# Create stage dir -ORIGINAL_DIR=`pwd` -pushd .. -cp -R $ORIGINAL_DIR stage -export STAGE_DIR="`pwd`/stage" -popd - -export REPO_DIR=protobuf -export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"` -export BUILD_COMMIT=`git rev-parse HEAD` -export PLAT=x86_64 -export UNICODE_WIDTH=32 -export MACOSX_DEPLOYMENT_TARGET=10.9 -export TRAVIS_OS_NAME="osx" - -rm -rf artifacts/ -rm -rf multibuild/ -mkdir artifacts -export ARTIFACT_DIR=$(pwd)/artifacts - -git clone https://github.com/matthew-brett/multibuild.git -cp kokoro/release/python/macos/config.sh config.sh - -OLD_PATH=$PATH - -build_artifact_version() { - MB_PYTHON_VERSION=$1 - - # Clean up env - rm -rf venv - sudo rm -rf $REPO_DIR - cp -R $STAGE_DIR $REPO_DIR - export PATH=$OLD_PATH - - source multibuild/common_utils.sh - source multibuild/travis_steps.sh - before_install - - clean_code $REPO_DIR $BUILD_COMMIT - - build_wheel $REPO_DIR/python $PLAT - - mv wheelhouse/* $ARTIFACT_DIR -} - -export MB_PYTHON_OSX_VER=10.9 -build_artifact_version 2.7 -build_artifact_version 3.6 -build_artifact_version 3.7 -build_artifact_version 3.8 - -# python OSX10.9 does not have python 3.5 -export MB_PYTHON_OSX_VER=10.6 -build_artifact_version 3.5 - diff --git a/kokoro/release/python/macos/config.sh b/kokoro/release/python/macos/config.sh deleted file mode 100644 index 1b0a302e4cb3512c1de473f7df9adf98938d83df..0000000000000000000000000000000000000000 --- a/kokoro/release/python/macos/config.sh +++ /dev/null @@ -1,67 +0,0 @@ -# Define custom utilities -# Test for OSX with [ -n "$IS_OSX" ] - -function remove_travis_ve_pip { - # Removing the system virtualenv or pip can be very problematic for - # macOS on Kokoro, so just leave them be. - :; -} - -function install_pip { - check_python - PIP_CMD="sudo $PYTHON_EXE -m pip${pip_args:+ $pip_args}" - $PIP_CMD install --upgrade pip -} - -function install_virtualenv { - check_python - check_pip - $PIP_CMD install --upgrade virtualenv - VIRTUALENV_CMD="$PYTHON_EXE -m virtualenv" -} - -function pre_build { - # Any stuff that you need to do before you start building the wheels - # Runs in the root directory of this repository. - pushd protobuf - - # Build protoc - ./autogen.sh - ./configure - - CXXFLAGS="-std=c++14 -fPIC -g -O2" ./configure - make -j8 - - # Generate python dependencies. - pushd python - python setup.py build_py - popd - - popd -} - -function bdist_wheel_cmd { - # Builds wheel with bdist_wheel, puts into wheelhouse - # - # It may sometimes be useful to use bdist_wheel for the wheel building - # process. For example, versioneer has problems with versions which are - # fixed with bdist_wheel: - # https://github.com/warner/python-versioneer/issues/121 - local abs_wheelhouse=$1 - - # Modify build version - pwd - ls - python setup.py bdist_wheel --cpp_implementation --compile_static_extension - cp dist/*.whl $abs_wheelhouse -} - -function build_wheel { - build_wheel_cmd "bdist_wheel_cmd" $@ -} - -function run_tests { - # Runs tests on installed distribution from an empty directory - python --version - python -c "from google.protobuf.pyext import _message;" -} diff --git a/kokoro/release/python/macos/continuous.cfg b/kokoro/release/python/macos/continuous.cfg deleted file mode 100644 index 85cf81b507f45d72bbbc1173ee72da3491f80e49..0000000000000000000000000000000000000000 --- a/kokoro/release/python/macos/continuous.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/macos/presubmit.cfg b/kokoro/release/python/macos/presubmit.cfg deleted file mode 100644 index 85cf81b507f45d72bbbc1173ee72da3491f80e49..0000000000000000000000000000000000000000 --- a/kokoro/release/python/macos/presubmit.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/macos/release.cfg b/kokoro/release/python/macos/release.cfg deleted file mode 100644 index 85cf81b507f45d72bbbc1173ee72da3491f80e49..0000000000000000000000000000000000000000 --- a/kokoro/release/python/macos/release.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/windows/build_artifacts.bat b/kokoro/release/python/windows/build_artifacts.bat deleted file mode 100644 index 70a86a199cbd2f0d4be2b4a254d258bb5f7e4590..0000000000000000000000000000000000000000 --- a/kokoro/release/python/windows/build_artifacts.bat +++ /dev/null @@ -1,78 +0,0 @@ -REM Move scripts to root -set REPO_DIR_STAGE=%cd%\github\protobuf-stage -xcopy /S github\protobuf "%REPO_DIR_STAGE%\" -cd github\protobuf -copy kokoro\release\python\windows\build_single_artifact.bat build_single_artifact.bat - -REM Set environment variables -set PACKAGE_NAME=protobuf -set REPO_DIR=protobuf -set BUILD_DLL=OFF -set UNICODE=ON -set PB_TEST_DEP="six==1.9" -set OTHER_TEST_DEP="setuptools==38.5.1" -set OLD_PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH% - -REM Fetch multibuild -git clone https://github.com/matthew-brett/multibuild.git - -REM Install zlib -mkdir zlib -curl -L -o zlib.zip http://www.winimage.com/zLibDll/zlib123dll.zip -curl -L -o zlib-src.zip http://www.winimage.com/zLibDll/zlib123.zip -7z x zlib.zip -ozlib -7z x zlib-src.zip -ozlib\include -SET ZLIB_ROOT=%cd%\zlib -del /Q zlib.zip -del /Q zlib-src.zip - -REM Create directory for artifacts -SET ARTIFACT_DIR=%cd%\artifacts -mkdir %ARTIFACT_DIR% - -REM Build wheel - -SET PYTHON=C:\python35_32bit -SET PYTHON_VERSION=3.5 -SET PYTHON_ARCH=32 -CALL build_single_artifact.bat || goto :error - -SET PYTHON=C:\python35 -SET PYTHON_VERSION=3.5 -SET PYTHON_ARCH=64 -CALL build_single_artifact.bat || goto :error - -SET PYTHON=C:\python36_32bit -SET PYTHON_VERSION=3.6 -SET PYTHON_ARCH=32 -CALL build_single_artifact.bat || goto :error - -SET PYTHON=C:\python36 -SET PYTHON_VERSION=3.6 -SET PYTHON_ARCH=64 -CALL build_single_artifact.bat || goto :error - -SET PYTHON=C:\python37_32bit -SET PYTHON_VERSION=3.7 -SET PYTHON_ARCH=32 -CALL build_single_artifact.bat || goto :error - -SET PYTHON=C:\python37 -SET PYTHON_VERSION=3.7 -SET PYTHON_ARCH=64 -CALL build_single_artifact.bat || goto :error - -SET PYTHON=C:\python38_32bit -SET PYTHON_VERSION=3.8 -SET PYTHON_ARCH=32 -CALL build_single_artifact.bat || goto :error - -SET PYTHON=C:\python38 -SET PYTHON_VERSION=3.8 -SET PYTHON_ARCH=64 -CALL build_single_artifact.bat || goto :error - -goto :EOF - -:error -exit /b %errorlevel% diff --git a/kokoro/release/python/windows/build_single_artifact.bat b/kokoro/release/python/windows/build_single_artifact.bat deleted file mode 100644 index 45843e1a09c2657f27468b8bfc56fe0fc1f64fea..0000000000000000000000000000000000000000 --- a/kokoro/release/python/windows/build_single_artifact.bat +++ /dev/null @@ -1,78 +0,0 @@ -setlocal - -if %PYTHON%==C:\python35_32bit set generator=Visual Studio 14 -if %PYTHON%==C:\python35_32bit set vcplatform=Win32 - -if %PYTHON%==C:\python35 set generator=Visual Studio 14 Win64 -if %PYTHON%==C:\python35 set vcplatform=x64 - -if %PYTHON%==C:\python36_32bit set generator=Visual Studio 14 -if %PYTHON%==C:\python36_32bit set vcplatform=Win32 - -if %PYTHON%==C:\python36 set generator=Visual Studio 14 Win64 -if %PYTHON%==C:\python36 set vcplatform=x64 - -if %PYTHON%==C:\python37_32bit set generator=Visual Studio 14 -if %PYTHON%==C:\python37_32bit set vcplatform=Win32 - -if %PYTHON%==C:\python37 set generator=Visual Studio 14 Win64 -if %PYTHON%==C:\python37 set vcplatform=x64 - -if %PYTHON%==C:\python38_32bit set generator=Visual Studio 14 -if %PYTHON%==C:\python38_32bit set vcplatform=Win32 - -if %PYTHON%==C:\python38 set generator=Visual Studio 14 Win64 -if %PYTHON%==C:\python38 set vcplatform=x64 - -REM Prepend newly installed Python to the PATH of this build (this cannot be -REM done from inside the powershell script as it would require to restart -REM the parent CMD process). -SET PATH=%PYTHON%;%PYTHON%\Scripts;%OLD_PATH% -python -m pip install -U pip -pip install wheel - -REM Check that we have the expected version and architecture for Python -python --version -python -c "import struct; print(struct.calcsize('P') * 8)" - -rmdir /s/q %REPO_DIR% -xcopy /s %REPO_DIR_STAGE% "%REPO_DIR%\" - -REM Checkout release commit -cd %REPO_DIR% - -REM ====================== -REM Build Protobuf Library -REM ====================== - -mkdir src\.libs - -mkdir vcprojects -pushd vcprojects -cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=OFF ../cmake || goto :error -msbuild protobuf.sln /p:Platform=%vcplatform% /p:Configuration=Release || goto :error -dir /s /b -popd -copy vcprojects\Release\libprotobuf.lib src\.libs\libprotobuf.a -copy vcprojects\Release\libprotobuf-lite.lib src\.libs\libprotobuf-lite.a -SET PATH=%cd%\vcprojects\Release;%PATH% -dir vcprojects\Release - -REM ====================== -REM Build python library -REM ====================== - -cd python - -REM sed -i 's/\ extra_compile_args\ =\ \[\]/\ extra_compile_args\ =\ \[\'\/MT\'\]/g' setup.py - -python setup.py bdist_wheel --cpp_implementation --compile_static_extension -dir dist -copy dist\* %ARTIFACT_DIR% -dir %ARTIFACT_DIR% -cd ..\.. - -goto :EOF - -:error -exit /b %errorlevel% diff --git a/kokoro/release/python/windows/continuous.cfg b/kokoro/release/python/windows/continuous.cfg deleted file mode 100644 index 5261606477ab10ee28c2b4efd71cbeb8c675127c..0000000000000000000000000000000000000000 --- a/kokoro/release/python/windows/continuous.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Windows protoc release builds -build_file: "protobuf/kokoro/release/python/windows/build_artifacts.bat" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/windows/presubmit.cfg b/kokoro/release/python/windows/presubmit.cfg deleted file mode 100644 index 5261606477ab10ee28c2b4efd71cbeb8c675127c..0000000000000000000000000000000000000000 --- a/kokoro/release/python/windows/presubmit.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Windows protoc release builds -build_file: "protobuf/kokoro/release/python/windows/build_artifacts.bat" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/python/windows/release.cfg b/kokoro/release/python/windows/release.cfg deleted file mode 100644 index 5261606477ab10ee28c2b4efd71cbeb8c675127c..0000000000000000000000000000000000000000 --- a/kokoro/release/python/windows/release.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Windows protoc release builds -build_file: "protobuf/kokoro/release/python/windows/build_artifacts.bat" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/ruby/linux/build_artifacts.sh b/kokoro/release/ruby/linux/build_artifacts.sh deleted file mode 100644 index 88555226b01f0e32596611953b63bf6be1c04d08..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/linux/build_artifacts.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -ex - -# change to repo root -cd $(dirname $0)/../../../.. - -source kokoro/release/ruby/linux/prepare_build.sh - -# ruby environment -source kokoro/release/ruby/linux/ruby/ruby_build_environment.sh - -# build artifacts -bash kokoro/release/ruby/linux/ruby/ruby_build.sh diff --git a/kokoro/release/ruby/linux/continuous.cfg b/kokoro/release/ruby/linux/continuous.cfg deleted file mode 100644 index dbc71b2ceb305488925d63372bbdcb91ff9759a9..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/linux/continuous.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Linux release builds -build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/ruby/linux/prepare_build.sh b/kokoro/release/ruby/linux/prepare_build.sh deleted file mode 100644 index 91d186898cbdee126260aad0425c457f84c08ac2..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/linux/prepare_build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Move docker's storage location to scratch disk so we don't run out of space. -echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker -# Use container registry mirror for pulling docker images (should make downloads faster) -# See https://cloud.google.com/container-registry/docs/using-dockerhub-mirroring -echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee --append /etc/default/docker -sudo service docker restart - -# All artifacts come here -mkdir artifacts -export ARTIFACT_DIR=$(pwd)/artifacts diff --git a/kokoro/release/ruby/linux/presubmit.cfg b/kokoro/release/ruby/linux/presubmit.cfg deleted file mode 100644 index dbc71b2ceb305488925d63372bbdcb91ff9759a9..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/linux/presubmit.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Linux release builds -build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/ruby/linux/release.cfg b/kokoro/release/ruby/linux/release.cfg deleted file mode 100644 index dbc71b2ceb305488925d63372bbdcb91ff9759a9..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/linux/release.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Linux release builds -build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/ruby/linux/ruby/ruby_build.sh b/kokoro/release/ruby/linux/ruby/ruby_build.sh deleted file mode 100644 index f8ae9623f255f0752a71560cd86475a5455ac1a1..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/linux/ruby/ruby_build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -ex - -# Build protoc -if test ! -e src/protoc; then - ./autogen.sh - ./configure - make -j4 -fi - -umask 0022 -pushd ruby -gem install bundler -v 2.1.4 -bundle update && bundle exec rake gem:native -ls pkg -mv pkg/* $ARTIFACT_DIR -popd diff --git a/kokoro/release/ruby/linux/ruby/ruby_build_environment.sh b/kokoro/release/ruby/linux/ruby/ruby_build_environment.sh deleted file mode 100644 index 87c0f75448d82f6bf83350a37d056055492f5be8..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/linux/ruby/ruby_build_environment.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set +ex -[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh -set -e # rvm commands are very verbose -rvm --default use ruby-2.4.1 -# The version needs to be updated if the version specified in Gemfile.lock is changed -gem install bundler -v '1.17.3' -set -ex diff --git a/kokoro/release/ruby/macos/build_artifacts.sh b/kokoro/release/ruby/macos/build_artifacts.sh deleted file mode 100644 index c68b63cc43d7dce17733da516a75227e9abcdcf8..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/macos/build_artifacts.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -ex - -# change to repo root -cd $(dirname $0)/../../../.. - -# all artifacts come here -mkdir artifacts -export ARTIFACT_DIR=$(pwd)/artifacts - -# ruby environment -bash kokoro/release/ruby/macos/ruby/ruby_build_environment.sh - -gem install rubygems-update -update_rubygems - -# build artifacts -bash kokoro/release/ruby/macos/ruby/ruby_build.sh diff --git a/kokoro/release/ruby/macos/continuous.cfg b/kokoro/release/ruby/macos/continuous.cfg deleted file mode 100644 index cb1c08bb88279acd96f4476dcf82579201002216..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/macos/continuous.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/ruby/macos/presubmit.cfg b/kokoro/release/ruby/macos/presubmit.cfg deleted file mode 100644 index cb1c08bb88279acd96f4476dcf82579201002216..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/macos/presubmit.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/ruby/macos/release.cfg b/kokoro/release/ruby/macos/release.cfg deleted file mode 100644 index cb1c08bb88279acd96f4476dcf82579201002216..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/macos/release.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Mac OSX release builds -build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh" - -action { - define_artifacts { - regex: "github/protobuf/artifacts/**" - } -} diff --git a/kokoro/release/ruby/macos/ruby/ruby_build.sh b/kokoro/release/ruby/macos/ruby/ruby_build.sh deleted file mode 100644 index 7f6c18fe8e8d7dee0244417777171e7434aedc2b..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/macos/ruby/ruby_build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -ex - -# Build protoc -if test ! -e src/protoc; then - ./autogen.sh - ./configure - make -j4 -fi - -umask 0022 -pushd ruby -bundle update && bundle exec rake gem:native -ls pkg -mv pkg/* $ARTIFACT_DIR -popd diff --git a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh b/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh deleted file mode 100644 index 880c23390cfbe241b82916bd57c35f9d1c93d979..0000000000000000000000000000000000000000 --- a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -set -ex - -set +ex # rvm script is very verbose and exits with errorcode -source $HOME/.rvm/scripts/rvm -set -e # rvm commands are very verbose -time rvm install 2.5.0 -rvm use 2.5.0 -gem install rake-compiler --no-document -gem install bundler --no-document -time rvm install 2.7.0 -rvm use 2.7.0 --default -gem install rake-compiler --no-document -gem install bundler --no-document -rvm osx-ssl-certs status all -rvm osx-ssl-certs update all -set -ex - -rm -rf ~/.rake-compiler - -CROSS_RUBY=$(mktemp tmpfile.XXXXXXXX) - -curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.1.0/tasks/bin/cross-ruby.rake > "$CROSS_RUBY" - -# See https://github.com/grpc/grpc/issues/12161 for verconf.h patch details -patch "$CROSS_RUBY" << EOF ---- cross-ruby.rake 2018-04-10 11:32:16.000000000 -0700 -+++ patched 2018-04-10 11:40:25.000000000 -0700 -@@ -141,8 +141,10 @@ - "--host=#{MINGW_HOST}", - "--target=#{MINGW_TARGET}", - "--build=#{RUBY_BUILD}", -- '--enable-shared', -+ '--enable-static', -+ '--disable-shared', - '--disable-install-doc', -+ '--without-gmp', - '--with-ext=' - ] - -@@ -159,6 +161,7 @@ - # make - file "#{build_dir}/ruby.exe" => ["#{build_dir}/Makefile"] do |t| - chdir File.dirname(t.prerequisites.first) do -+ sh "test -s verconf.h || rm -f verconf.h" # if verconf.h has size 0, make sure it gets re-built by make - sh MAKE - end - end -EOF - -MAKE="make -j8" - -set +x # rvm commands are very verbose -rvm use 2.7.0 -set -x -ruby --version | grep 'ruby 2.7.0' -for v in 2.7.0 ; do - ccache -c - rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE" -done -set +x -rvm use 2.5.0 -set -x -ruby --version | grep 'ruby 2.5.0' -for v in 2.6.0 2.5.1 2.4.0 2.3.0; do - ccache -c - rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE" -done -set +x -rvm use 2.7.0 -set -x - -sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > "$CROSS_RUBY" -mv "$CROSS_RUBY" ~/.rake-compiler/config.yml diff --git a/kokoro/windows/csharp/build.bat b/kokoro/windows/csharp/build.bat deleted file mode 100644 index 95224f2eb21d244a0dea0adb7876e6a3eedf3ed2..0000000000000000000000000000000000000000 --- a/kokoro/windows/csharp/build.bat +++ /dev/null @@ -1,14 +0,0 @@ -@rem enter repo root -cd /d %~dp0\..\..\.. - -cd csharp - -@rem Install dotnet SDK -powershell -File install_dotnet_sdk.ps1 -set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH% - -@rem Disable some unwanted dotnet options -set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true -set DOTNET_CLI_TELEMETRY_OPTOUT=true - -call buildall.bat diff --git a/kokoro/windows/csharp/continuous.cfg b/kokoro/windows/csharp/continuous.cfg deleted file mode 100644 index f586585176b10001d73f4b9f95f8186b3a8023f2..0000000000000000000000000000000000000000 --- a/kokoro/windows/csharp/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/csharp/build.bat" -timeout_mins: 1440 diff --git a/kokoro/windows/csharp/presubmit.cfg b/kokoro/windows/csharp/presubmit.cfg deleted file mode 100644 index f586585176b10001d73f4b9f95f8186b3a8023f2..0000000000000000000000000000000000000000 --- a/kokoro/windows/csharp/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/windows/csharp/build.bat" -timeout_mins: 1440 diff --git a/libprotobuf.map b/libprotobuf.map index d6060f07edea5e8da5fb80c5b0ec2607b16a6a5e..0a0632e86b21c0612ecae2858cd1435b598d4b59 100644 --- a/libprotobuf.map +++ b/libprotobuf.map @@ -188,6 +188,25 @@ "google::protobuf::internal::ExtensionSet::ParseField(unsigned long, char const*, google::protobuf::Message const*, google::protobuf::internal::InternalMetadata*, google::protobuf::internal::ParseContext*)"; "google::protobuf::RepeatedField::elements() const"; "google::protobuf::internal::EpsCopyInputStream::SkipFallback(char const*, int)"; + "google::protobuf::internal::ArenaStringPtr::ClearToEmpty()"; + "google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__h::basic_string, std::__h::allocator> const&, google::protobuf::Arena*)"; + "google::protobuf::internal::ArenaStringPtr::Mutable(google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena*)"; + "google::protobuf::internal::EpsCopyInputStream::DoneFallback(int, int)"; + "google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__h::basic_string, std::__h::allocator>&&, google::protobuf::Arena*)"; + "google::protobuf::internal::InitProtobufDefaultsSlow()"; + "google::protobuf::internal::init_protobuf_defaults_state"; + "google::protobuf::internal::EpsCopyInputStream::Next()"; + "google::protobuf::internal::ParseAnyTypeUrl(google::protobuf::StringPiece, std::__h::basic_string, std::__h::allocator>*, std::__h::basic_string, std::__h::allocator>*)"; + "google::protobuf::internal::ParseAnyTypeUrl(google::protobuf::StringPiece, std::__cxx11::basic_string, std::allocator>*, std::__cxx11::basic_string, std::allocator>*)"; + "google::protobuf::GeneratedCodeInfo::Clear()"; + "google::protobuf::GeneratedCodeInfo* google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena*)"; + "google::protobuf::GeneratedCodeInfo::_InternalParse(char const*, google::protobuf::internal::ParseContext*)"; + "google::protobuf::GeneratedCodeInfo::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const"; + "google::protobuf::GeneratedCodeInfo::ByteSizeLong() const"; + "google::protobuf::_GeneratedCodeInfo_default_instance_"; + "google::protobuf::GeneratedCodeInfo::MergeFrom(google::protobuf::GeneratedCodeInfo const&)"; + "scc_info_GeneratedCodeInfo_google_2fprotobuf_2fdescriptor_2eproto"; + "google::protobuf::internal::ArenaStringPtr::Destroy(google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena*)"; }; local: *; diff --git a/libprotobuf_lite.map b/libprotobuf_lite.map index 63e7b88fae4ca81b772a7cdb67db4c31eab10586..c13e2053006455377000c011445b236acb85c8c4 100644 --- a/libprotobuf_lite.map +++ b/libprotobuf_lite.map @@ -533,6 +533,25 @@ "google::protobuf::ShutdownProtobufLibrary()"; "google::protobuf::RepeatedField::elements() const"; "google::protobuf::internal::EpsCopyInputStream::SkipFallback(char const*, int)"; + "google::protobuf::internal::ArenaStringPtr::ClearToEmpty()"; + "google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__h::basic_string, std::__h::allocator> const&, google::protobuf::Arena*)"; + "google::protobuf::internal::ArenaStringPtr::Mutable(google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena*)"; + "google::protobuf::internal::EpsCopyInputStream::DoneFallback(int, int)"; + "google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__h::basic_string, std::__h::allocator>&&, google::protobuf::Arena*)"; + "google::protobuf::internal::InitProtobufDefaultsSlow()"; + "google::protobuf::internal::init_protobuf_defaults_state"; + "google::protobuf::internal::EpsCopyInputStream::Next()"; + "google::protobuf::internal::ParseAnyTypeUrl(google::protobuf::StringPiece, std::__h::basic_string, std::__h::allocator>*, std::__h::basic_string, std::__h::allocator>*)"; + "google::protobuf::internal::ParseAnyTypeUrl(google::protobuf::StringPiece, std::__cxx11::basic_string, std::allocator>*, std::__cxx11::basic_string, std::allocator>*)"; + "google::protobuf::GeneratedCodeInfo::Clear()"; + "google::protobuf::GeneratedCodeInfo* google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena*)"; + "google::protobuf::GeneratedCodeInfo::_InternalParse(char const*, google::protobuf::internal::ParseContext*)"; + "google::protobuf::GeneratedCodeInfo::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const"; + "google::protobuf::GeneratedCodeInfo::ByteSizeLong() const"; + "google::protobuf::_GeneratedCodeInfo_default_instance_"; + "google::protobuf::GeneratedCodeInfo::MergeFrom(google::protobuf::GeneratedCodeInfo const&)"; + "scc_info_GeneratedCodeInfo_google_2fprotobuf_2fdescriptor_2eproto"; + "google::protobuf::internal::ArenaStringPtr::Destroy(google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena*)"; }; local: *; diff --git a/libprotoc.map b/libprotoc.map index 398239662fda0c3ce586ce1edf1647c87a9446a7..8ffad30f91d0cc6485af3ec922cd648add8e9b30 100644 --- a/libprotoc.map +++ b/libprotoc.map @@ -20,7 +20,16 @@ "google::protobuf::OneofDescriptor::GetLocationPath(std::__h::vector>*) const"; "google::protobuf::SplitStringAllowEmpty(google::protobuf::StringPiece, char const*, std::__h::vector, std::__h::allocator>, std::__h::allocator, std::__h::allocator>>>*)"; "google::protobuf::io::Printer::Annotate(char const*, char const*, std::__h::basic_string, std::__h::allocator> const&, std::__h::vector> const&)"; - + "google::protobuf::internal::ArenaStringPtr::Mutable[abi:cxx11](google::protobuf::internal::ArenaStringPtr::EmptyDefault, google::protobuf::Arena*)"; + "google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string, std::allocator> const&, google::protobuf::Arena*)"; + "google::protobuf::GeneratedCodeInfo::Clear()"; + "google::protobuf::GeneratedCodeInfo* google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena*)"; + "google::protobuf::GeneratedCodeInfo::_InternalParse(char const*, google::protobuf::internal::ParseContext*)"; + "google::protobuf::GeneratedCodeInfo::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const"; + "google::protobuf::GeneratedCodeInfo::ByteSizeLong() const"; + "google::protobuf::_GeneratedCodeInfo_default_instance_"; + "google::protobuf::GeneratedCodeInfo::MergeFrom(google::protobuf::GeneratedCodeInfo const&)"; + "scc_info_GeneratedCodeInfo_google_2fprotobuf_2fdescriptor_2eproto"; }; local: *; diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000000000000000000000000000000000000..0cb7f90d3bd7a7fc62accae5bdce9a5ce73c6103 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,11251 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 + +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.6 Debian-2.4.6-14" +package_revision=2.4.6 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2015-10-07.11; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + _G_rc_run_hooks=false + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + if eval $_G_hook '"$@"'; then + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + _G_rc_run_hooks=: + fi + done + + $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, you may remove/edit +# any options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. In this case you also must return $EXIT_SUCCESS to let the +# hook's caller know that it should pay attention to +# '_result'. Returning $EXIT_FAILURE signalizes that +# arguments are left untouched by the hook and therefore caller will ignore the +# result variable. +# +# Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# # No change in '$@' (ignored completely by this hook). There is +# # no need to do the equivalent (but slower) action: +# # func_quote_for_eval ${1+"$@"} +# # my_options_prep_result=$func_quote_for_eval_result +# false +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# args_changed=false +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: +# args_changed=: +# ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# args_changed=: +# ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@", we could need that later +# # if $args_changed is true. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; +# esac +# done +# +# if $args_changed; then +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# fi +# +# $args_changed +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# false +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll also need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + _G_func_options_finish_exit=false + if func_run_hooks func_options ${1+"$@"}; then + func_options_finish_result=$func_run_hooks_result + _G_func_options_finish_exit=: + fi + + $_G_func_options_finish_exit +} + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + _G_rc_options=false + + for my_func in options_prep parse_options validate_options options_finish + do + if eval func_$my_func '${1+"$@"}'; then + eval _G_res_var='$'"func_${my_func}_result" + eval set dummy "$_G_res_var" ; shift + _G_rc_options=: + fi + done + + # Save modified positional parameters for caller. As a top-level + # options-parser function we always need to set the 'func_options_result' + # variable (regardless the $_G_rc_options value). + if $_G_rc_options; then + func_options_result=$_G_res_var + else + func_quote_for_eval ${1+"$@"} + func_options_result=$func_quote_for_eval_result + fi + + $_G_rc_options +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + _G_rc_options_prep=false + if func_run_hooks func_options_prep ${1+"$@"}; then + _G_rc_options_prep=: + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result + fi + + $_G_rc_options_prep +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + _G_rc_parse_options=false + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + if func_run_hooks func_parse_options ${1+"$@"}; then + eval set dummy "$func_run_hooks_result"; shift + _G_rc_parse_options=: + fi + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_match_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + if test $# = 0 && func_missing_arg $_G_opt; then + _G_rc_parse_options=: + break + fi + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) _G_rc_parse_options=: ; break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; + esac + + $_G_match_parse_options && _G_rc_parse_options=: + done + + + if $_G_rc_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result + fi + + $_G_rc_parse_options +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + _G_rc_validate_options=false + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + if func_run_hooks func_validate_options ${1+"$@"}; then + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result + _G_rc_validate_options=: + fi + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + $_G_rc_validate_options +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname $scriptversion Debian-2.4.6-14 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + _G_rc_lt_options_prep=: + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + *) + _G_rc_lt_options_prep=false + ;; + esac + + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result + fi + + $_G_rc_lt_options_prep +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + _G_rc_lt_parse_options=false + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_match_lt_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; + esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: + done + + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result + fi + + $_G_rc_lt_parse_options +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type '$version_type'" + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/m4/ac_system_extensions.m4 b/m4/ac_system_extensions.m4 new file mode 100644 index 0000000000000000000000000000000000000000..1ca2eeb1d8aceffb1a8f8ba3236dcb4c4655f987 --- /dev/null +++ b/m4/ac_system_extensions.m4 @@ -0,0 +1,37 @@ +dnl Provide AC_USE_SYSTEM_EXTENSIONS for old autoconf machines. +AC_DEFUN([ACX_USE_SYSTEM_EXTENSIONS],[ + ifdef([AC_USE_SYSTEM_EXTENSIONS],[ + AC_USE_SYSTEM_EXTENSIONS + ],[ + AC_BEFORE([$0], [AC_COMPILE_IFELSE]) + AC_BEFORE([$0], [AC_RUN_IFELSE]) + + AC_REQUIRE([AC_GNU_SOURCE]) + AC_REQUIRE([AC_AIX]) + AC_REQUIRE([AC_MINIX]) + + AH_VERBATIM([__EXTENSIONS__], +[/* Enable extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif]) + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], + [ac_cv_safe_to_define___extensions__], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ +# define __EXTENSIONS__ 1 + AC_INCLUDES_DEFAULT])], + [ac_cv_safe_to_define___extensions__=yes], + [ac_cv_safe_to_define___extensions__=no])]) + test $ac_cv_safe_to_define___extensions__ = yes && + AC_DEFINE([__EXTENSIONS__]) + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) + AC_DEFINE([_TANDEM_SOURCE]) + ]) +]) diff --git a/m4/acx_check_suncc.m4 b/m4/acx_check_suncc.m4 new file mode 100644 index 0000000000000000000000000000000000000000..0a9a5770b37b51207135f5ec37dab396f05e06e6 --- /dev/null +++ b/m4/acx_check_suncc.m4 @@ -0,0 +1,73 @@ +dnl Check for the presence of the Sun Studio compiler. +dnl If Sun Studio compiler is found, set appropriate flags. +dnl Additionally, Sun Studio doesn't default to 64-bit by itself, +dnl nor does it automatically look in standard Solaris places for +dnl 64-bit libs, so we must add those options and paths to the search +dnl paths. + +dnl TODO(kenton): This is pretty hacky. It sets CXXFLAGS, which the autoconf +dnl docs say should never be overridden except by the user. It also isn't +dnl cross-compile safe. We should fix these problems, but since I don't have +dnl Sun CC at my disposal for testing, someone else will have to do it. + +AC_DEFUN([ACX_CHECK_SUNCC],[ + + AC_LANG_PUSH([C++]) + AC_CHECK_DECL([__SUNPRO_CC], [SUNCC="yes"], [SUNCC="no"]) + AC_LANG_POP() + + + AC_ARG_ENABLE([64bit-solaris], + [AS_HELP_STRING([--disable-64bit-solaris], + [Build 64 bit binary on Solaris @<:@default=on@:>@])], + [ac_enable_64bit="$enableval"], + [ac_enable_64bit="yes"]) + + AS_IF([test "$SUNCC" = "yes" -a "x${ac_cv_env_CXXFLAGS_set}" = "x"],[ + dnl Sun Studio has a crashing bug with -xO4 in some cases. Keep this + dnl at -xO3 until a proper test to detect those crashes can be done. + CXXFLAGS="-g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -template=no%extdef ${CXXFLAGS}" + ]) + + case $host_os in + *solaris*) + AC_CHECK_PROGS(ISAINFO, [isainfo], [no]) + AS_IF([test "x$ISAINFO" != "xno"], + [isainfo_b=`${ISAINFO} -b`], + [isainfo_b="x"]) + + AS_IF([test "$isainfo_b" != "x"],[ + + isainfo_k=`${ISAINFO} -k` + + AS_IF([test "x$ac_enable_64bit" = "xyes"],[ + + AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[ + dnl The user hasn't overridden the default libdir, so we'll + dnl the dir suffix to match solaris 32/64-bit policy + libdir="${libdir}/${isainfo_k}" + ]) + + dnl This should just be set in CPPFLAGS and in LDFLAGS, but libtool + dnl does the wrong thing if you don't put it into CXXFLAGS. sigh. + dnl (It also needs it in CFLAGS, or it does a different wrong thing!) + CXXFLAGS="${CXXFLAGS} -m64" + ac_cv_env_CXXFLAGS_set=set + ac_cv_env_CXXFLAGS_value='-m64' + + CFLAGS="${CFLAGS} -m64" + ac_cv_env_CFLAGS_set=set + ac_cv_env_CFLAGS_value='-m64' + + AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ],[ + CXXFLAGS="-xmemalign=8s ${CXXFLAGS}" + ]) + ]) + ]) + ;; + esac + + AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ],[ + CXXFLAGS="-xregs=no%appl ${CXXFLAGS}" + ]) +]) diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 new file mode 100644 index 0000000000000000000000000000000000000000..d3288e2fb26676c7be5e13b6366ea3350f5a37f7 --- /dev/null +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -0,0 +1,1001 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016 Krzesimir Nowak +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 6 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AX_REQUIRE_DEFINED([AC_MSG_WARN]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) + m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +#include + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + + namespace test_std_move_and_forward + { + struct message {}; + char foo(message&) { return '\0'; } + int foo(message&&) { return 0; } + + template + void check(Arg&& arg, RT rt) { + static_assert(sizeof(rt) == sizeof(foo(std::forward(arg))), ""); + } + void test() { + message a; + check(a, char()); + check(std::move(a), int()); + } + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus <= 201402L + +#error "This is not a C++17 compiler" + +#else + +#if defined(__clang__) + #define REALLY_CLANG +#else + #if defined(__GNUC__) + #define REALLY_GCC + #endif +#endif + +#include +#include +#include + +namespace cxx17 +{ + +#if !defined(REALLY_CLANG) + namespace test_constexpr_lambdas + { + + // TODO: test it with clang++ from git + + constexpr int foo = [](){return 42;}(); + + } +#endif // !defined(REALLY_CLANG) + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + +#if !defined(REALLY_CLANG) + namespace test_template_argument_deduction_for_class_templates + { + + // TODO: test it with clang++ from git + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } +#endif // !defined(REALLY_CLANG) + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + +#if !defined(REALLY_CLANG) + namespace test_structured_bindings + { + + // TODO: test it with clang++ from git + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } +#endif // !defined(REALLY_CLANG) + +#if !defined(REALLY_CLANG) + namespace test_exception_spec_type_system + { + + // TODO: test it with clang++ from git + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } +#endif // !defined(REALLY_CLANG) + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus <= 201402L + +]]) diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 new file mode 100644 index 0000000000000000000000000000000000000000..77fd346a79a6faea6e1c40e34465bb6a5b7f5895 --- /dev/null +++ b/m4/ax_prog_cc_for_build.m4 @@ -0,0 +1,125 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_CC_FOR_BUILD +# +# DESCRIPTION +# +# This macro searches for a C compiler that generates native executables, +# that is a C compiler that surely is not a cross-compiler. This can be +# useful if you have to generate source code at compile-time like for +# example GCC does. +# +# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything +# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). +# The value of these variables can be overridden by the user by specifying +# a compiler with an environment variable (like you do for standard CC). +# +# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object +# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if +# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are +# substituted in the Makefile. +# +# LICENSE +# +# Copyright (c) 2008 Paolo Bonzini +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 8 + +AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) +AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_CPP])dnl +AC_REQUIRE([AC_EXEEXT])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl + +dnl Use the standard macros, but make them use other variable names +dnl +pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl +pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl +pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl +pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl +pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl +pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl +pushdef([ac_cv_objext], ac_cv_build_objext)dnl +pushdef([ac_exeext], ac_build_exeext)dnl +pushdef([ac_objext], ac_build_objext)dnl +pushdef([CC], CC_FOR_BUILD)dnl +pushdef([CPP], CPP_FOR_BUILD)dnl +pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl +pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl +pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl +pushdef([host], build)dnl +pushdef([host_alias], build_alias)dnl +pushdef([host_cpu], build_cpu)dnl +pushdef([host_vendor], build_vendor)dnl +pushdef([host_os], build_os)dnl +pushdef([ac_cv_host], ac_cv_build)dnl +pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl +pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl +pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl +pushdef([ac_cv_host_os], ac_cv_build_os)dnl +pushdef([ac_cpp], ac_build_cpp)dnl +pushdef([ac_compile], ac_build_compile)dnl +pushdef([ac_link], ac_build_link)dnl + +save_cross_compiling=$cross_compiling +save_ac_tool_prefix=$ac_tool_prefix +cross_compiling=no +ac_tool_prefix= + +AC_PROG_CC +AC_PROG_CPP +AC_EXEEXT + +ac_tool_prefix=$save_ac_tool_prefix +cross_compiling=$save_cross_compiling + +dnl Restore the old definitions +dnl +popdef([ac_link])dnl +popdef([ac_compile])dnl +popdef([ac_cpp])dnl +popdef([ac_cv_host_os])dnl +popdef([ac_cv_host_vendor])dnl +popdef([ac_cv_host_cpu])dnl +popdef([ac_cv_host_alias])dnl +popdef([ac_cv_host])dnl +popdef([host_os])dnl +popdef([host_vendor])dnl +popdef([host_cpu])dnl +popdef([host_alias])dnl +popdef([host])dnl +popdef([LDFLAGS])dnl +popdef([CPPFLAGS])dnl +popdef([CFLAGS])dnl +popdef([CPP])dnl +popdef([CC])dnl +popdef([ac_objext])dnl +popdef([ac_exeext])dnl +popdef([ac_cv_objext])dnl +popdef([ac_cv_exeext])dnl +popdef([ac_cv_prog_cc_g])dnl +popdef([ac_cv_prog_cc_cross])dnl +popdef([ac_cv_prog_cc_works])dnl +popdef([ac_cv_prog_gcc])dnl +popdef([ac_cv_prog_CPP])dnl + +dnl Finally, set Makefile variables +dnl +BUILD_EXEEXT=$ac_build_exeext +BUILD_OBJEXT=$ac_build_objext +AC_SUBST(BUILD_EXEEXT)dnl +AC_SUBST(BUILD_OBJEXT)dnl +AC_SUBST([CFLAGS_FOR_BUILD])dnl +AC_SUBST([CPPFLAGS_FOR_BUILD])dnl +AC_SUBST([LDFLAGS_FOR_BUILD])dnl +]) diff --git a/m4/ax_prog_cxx_for_build.m4 b/m4/ax_prog_cxx_for_build.m4 new file mode 100644 index 0000000000000000000000000000000000000000..8cc0f73c0f77008e0c1623b1a53cca48755d7cdd --- /dev/null +++ b/m4/ax_prog_cxx_for_build.m4 @@ -0,0 +1,110 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_CXX_FOR_BUILD +# +# DESCRIPTION +# +# This macro searches for a C++ compiler that generates native +# executables, that is a C++ compiler that surely is not a cross-compiler. +# This can be useful if you have to generate source code at compile-time +# like for example GCC does. +# +# The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything +# needed to compile or link (CXX_FOR_BUILD) and preprocess +# (CXXCPP_FOR_BUILD). The value of these variables can be overridden by +# the user by specifying a compiler with an environment variable (like you +# do for standard CXX). +# +# LICENSE +# +# Copyright (c) 2008 Paolo Bonzini +# Copyright (c) 2012 Avionic Design GmbH +# +# Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD]) +AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl +AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl +AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_PROG_CXXCPP])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl + +dnl Use the standard macros, but make them use other variable names +dnl +pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl +pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl +pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl +pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl +pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl +pushdef([CXX], CXX_FOR_BUILD)dnl +pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl +pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl +pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl +pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl +pushdef([host], build)dnl +pushdef([host_alias], build_alias)dnl +pushdef([host_cpu], build_cpu)dnl +pushdef([host_vendor], build_vendor)dnl +pushdef([host_os], build_os)dnl +pushdef([ac_cv_host], ac_cv_build)dnl +pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl +pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl +pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl +pushdef([ac_cv_host_os], ac_cv_build_os)dnl +pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl +pushdef([ac_compile], ac_build_compile)dnl +pushdef([ac_link], ac_build_link)dnl + +save_cross_compiling=$cross_compiling +save_ac_tool_prefix=$ac_tool_prefix +cross_compiling=no +ac_tool_prefix= + +AC_PROG_CXX +AC_PROG_CXXCPP + +ac_tool_prefix=$save_ac_tool_prefix +cross_compiling=$save_cross_compiling + +dnl Restore the old definitions +dnl +popdef([ac_link])dnl +popdef([ac_compile])dnl +popdef([ac_cxxcpp])dnl +popdef([ac_cv_host_os])dnl +popdef([ac_cv_host_vendor])dnl +popdef([ac_cv_host_cpu])dnl +popdef([ac_cv_host_alias])dnl +popdef([ac_cv_host])dnl +popdef([host_os])dnl +popdef([host_vendor])dnl +popdef([host_cpu])dnl +popdef([host_alias])dnl +popdef([host])dnl +popdef([CXXCPPFLAGS])dnl +popdef([CPPFLAGS])dnl +popdef([CXXFLAGS])dnl +popdef([CXXCPP])dnl +popdef([CXX])dnl +popdef([ac_cv_prog_cxx_g])dnl +popdef([ac_cv_prog_cxx_cross])dnl +popdef([ac_cv_prog_cxx_works])dnl +popdef([ac_cv_prog_gxx])dnl +popdef([ac_cv_prog_CXXCPP])dnl + +dnl Finally, set Makefile variables +dnl +AC_SUBST([CXXFLAGS_FOR_BUILD])dnl +AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl +]) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 new file mode 100644 index 0000000000000000000000000000000000000000..d218d1af73817271c75a22679c4b1b24e52b1912 --- /dev/null +++ b/m4/ax_pthread.m4 @@ -0,0 +1,485 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also to link with them as well. For example, you might link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threaded programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 22 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ;; +esac + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix* | freebsd*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + +ax_pthread_clang_warning=no + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + PTHREAD_CFLAGS="-pthread" + PTHREAD_LIBS= + + ax_pthread_ok=yes + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -mt,pthread) + AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) + PTHREAD_CFLAGS="-mt" + PTHREAD_LIBS="-lpthread" + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + AC_MSG_RESULT([$ax_pthread_ok]) + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 0000000000000000000000000000000000000000..a6d21ae56ea74c1ac100364f8a37375a3632db72 --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,8394 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +]) + +# serial 58 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + +# _LT_CC_BASENAME(CC) +# ------------------- +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. +m4_defun([_LT_CC_BASENAME], +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from 'configure', and 'config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain=$ac_aux_dir/ltmain.sh +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the 'libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags='_LT_TAGS'dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# '#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test 0 = "$lt_write_fail" && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $[#] +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try '$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +_LT_COPYING +_LT_LIBTOOL_TAGS + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and where our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cr} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS +]) + +if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes = "$cross_compiling"; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program that can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac]) +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program that can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi]) +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + osf3*) + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC=$CC +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC=$lt_save_CC +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)=$prev$p + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_FC" + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` + if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine what file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 new file mode 100644 index 0000000000000000000000000000000000000000..94b082976667c0c9edf2e9ff7a668c1fd7d997bf --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1,437 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 8 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option '$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# LT_INIT options. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 new file mode 100644 index 0000000000000000000000000000000000000000..48bc9344a4d661e116be1483d5520753875b2bd1 --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1,124 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59, which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 new file mode 100644 index 0000000000000000000000000000000000000000..fa04b52a3bf868bd57e7ba796d64385a51e7ec5a --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 4179 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.6' +macro_revision='2.4.6' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 new file mode 100644 index 0000000000000000000000000000000000000000..c6b26f88f6c3c1a052afa6314ba2adf832d785ee --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -0,0 +1,99 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/m4/stl_hash.m4 b/m4/stl_hash.m4 new file mode 100644 index 0000000000000000000000000000000000000000..d7def1af9b55ce975ee227ff68194414b06e96f3 --- /dev/null +++ b/m4/stl_hash.m4 @@ -0,0 +1,71 @@ +# We check two things: where the include file is for +# unordered_map/hash_map (we prefer the first form), and what +# namespace unordered/hash_map lives in within that include file. We +# include AC_TRY_COMPILE for all the combinations we've seen in the +# wild. We define HASH_MAP_H to the location of the header file, and +# HASH_NAMESPACE to the namespace the class (unordered_map or +# hash_map) is in. + +# This also checks if unordered map exists. +AC_DEFUN([AC_CXX_STL_HASH], + [ + AC_MSG_CHECKING(the location of hash_map) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_cv_cxx_hash_map="" + # First try unordered_map, but not on gcc's before 4.2 -- I've + # seen unexplainable unordered_map bugs with -O2 on older gcc's. + AC_TRY_COMPILE([#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)) + # error GCC too old for unordered_map + #endif + ], + [/* no program body necessary */], + [stl_hash_old_gcc=no], + [stl_hash_old_gcc=yes]) + for location in unordered_map tr1/unordered_map; do + for namespace in std std::tr1; do + if test -z "$ac_cv_cxx_hash_map" -a "$stl_hash_old_gcc" != yes; then + # Some older gcc's have a buggy tr1, so test a bit of code. + AC_TRY_COMPILE([#include <$location>], + [const ${namespace}::unordered_map t; + return t.find(5) == t.end();], + [ac_cv_cxx_hash_map="<$location>"; + ac_cv_cxx_hash_namespace="$namespace"; + ac_cv_cxx_hash_map_class="unordered_map";]) + fi + done + done + # Now try hash_map + for location in ext/hash_map hash_map; do + for namespace in __gnu_cxx "" std stdext; do + if test -z "$ac_cv_cxx_hash_map"; then + AC_TRY_COMPILE([#include <$location>], + [${namespace}::hash_map t], + [ac_cv_cxx_hash_map="<$location>"; + ac_cv_cxx_hash_namespace="$namespace"; + ac_cv_cxx_hash_map_class="hash_map";]) + fi + done + done + ac_cv_cxx_hash_set=`echo "$ac_cv_cxx_hash_map" | sed s/map/set/`; + ac_cv_cxx_hash_set_class=`echo "$ac_cv_cxx_hash_map_class" | sed s/map/set/`; + if test -n "$ac_cv_cxx_hash_map"; then + AC_DEFINE(HAVE_HASH_MAP, 1, [define if the compiler has hash_map]) + AC_DEFINE(HAVE_HASH_SET, 1, [define if the compiler has hash_set]) + AC_DEFINE_UNQUOTED(HASH_MAP_H,$ac_cv_cxx_hash_map, + [the location of or ]) + AC_DEFINE_UNQUOTED(HASH_SET_H,$ac_cv_cxx_hash_set, + [the location of or ]) + AC_DEFINE_UNQUOTED(HASH_NAMESPACE,$ac_cv_cxx_hash_namespace, + [the namespace of hash_map/hash_set]) + AC_DEFINE_UNQUOTED(HASH_MAP_CLASS,$ac_cv_cxx_hash_map_class, + [the name of ]) + AC_DEFINE_UNQUOTED(HASH_SET_CLASS,$ac_cv_cxx_hash_set_class, + [the name of ]) + AC_MSG_RESULT([$ac_cv_cxx_hash_map]) + else + AC_MSG_RESULT() + AC_MSG_WARN([could not find an STL hash_map]) + fi +]) + diff --git a/missing b/missing new file mode 100644 index 0000000000000000000000000000000000000000..8d0eaad250fc1ea8f3728338c1b016596cedfc60 --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/objectivec/.gitignore b/objectivec/.gitignore deleted file mode 100644 index f786ffce8236b7841458e4131723673a2bde2710..0000000000000000000000000000000000000000 --- a/objectivec/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa diff --git a/objectivec/BUILD b/objectivec/BUILD new file mode 100644 index 0000000000000000000000000000000000000000..9f702ec95fde8e003adfa224d98f94374abab872 --- /dev/null +++ b/objectivec/BUILD @@ -0,0 +1,90 @@ +load("@rules_cc//cc:defs.bzl", "objc_library") + +objc_library( + name = "objectivec", + hdrs = [ + "GPBAny.pbobjc.h", + "GPBApi.pbobjc.h", + "GPBDuration.pbobjc.h", + "GPBEmpty.pbobjc.h", + "GPBFieldMask.pbobjc.h", + "GPBSourceContext.pbobjc.h", + "GPBStruct.pbobjc.h", + "GPBTimestamp.pbobjc.h", + "GPBType.pbobjc.h", + "GPBWrappers.pbobjc.h", + "GPBArray.h", + "GPBBootstrap.h", + "GPBCodedInputStream.h", + "GPBCodedOutputStream.h", + "GPBDescriptor.h", + "GPBDictionary.h", + "GPBExtensionInternals.h", + "GPBExtensionRegistry.h", + "GPBMessage.h", + "GPBProtocolBuffers.h", + "GPBProtocolBuffers_RuntimeSupport.h", + "GPBRootObject.h", + "GPBRuntimeTypes.h", + "GPBUnknownField.h", + "GPBUnknownFieldSet.h", + "GPBUtilities.h", + "GPBWellKnownTypes.h", + "GPBWireFormat.h", + "google/protobuf/Any.pbobjc.h", + "google/protobuf/Api.pbobjc.h", + "google/protobuf/Duration.pbobjc.h", + "google/protobuf/Empty.pbobjc.h", + "google/protobuf/FieldMask.pbobjc.h", + "google/protobuf/SourceContext.pbobjc.h", + "google/protobuf/Struct.pbobjc.h", + "google/protobuf/Timestamp.pbobjc.h", + "google/protobuf/Type.pbobjc.h", + "google/protobuf/Wrappers.pbobjc.h", + # Package private headers, but exposed because the generated sources + # need to use them. + "GPBArray_PackagePrivate.h", + "GPBCodedInputStream_PackagePrivate.h", + "GPBCodedOutputStream_PackagePrivate.h", + "GPBDescriptor_PackagePrivate.h", + "GPBDictionary_PackagePrivate.h", + "GPBMessage_PackagePrivate.h", + "GPBRootObject_PackagePrivate.h", + "GPBUnknownFieldSet_PackagePrivate.h", + "GPBUnknownField_PackagePrivate.h", + "GPBUtilities_PackagePrivate.h", + ], + copts = [ + "-Wno-vla", + ], + includes = [ + ".", + ], + non_arc_srcs = [ + "GPBAny.pbobjc.m", + "GPBApi.pbobjc.m", + "GPBDuration.pbobjc.m", + "GPBEmpty.pbobjc.m", + "GPBFieldMask.pbobjc.m", + "GPBSourceContext.pbobjc.m", + "GPBStruct.pbobjc.m", + "GPBTimestamp.pbobjc.m", + "GPBType.pbobjc.m", + "GPBWrappers.pbobjc.m", + "GPBArray.m", + "GPBCodedInputStream.m", + "GPBCodedOutputStream.m", + "GPBDescriptor.m", + "GPBDictionary.m", + "GPBExtensionInternals.m", + "GPBExtensionRegistry.m", + "GPBMessage.m", + "GPBRootObject.m", + "GPBUnknownField.m", + "GPBUnknownFieldSet.m", + "GPBUtilities.m", + "GPBWellKnownTypes.m", + "GPBWireFormat.m", + ], + visibility = ["//visibility:public"], +) diff --git a/objectivec/DevTools/compile_testing_protos.sh b/objectivec/DevTools/compile_testing_protos.sh index 021e03d0ed89042ea3699e34b6cc3624212baf43..69c32f920bdc44a637ff7866127c1dc3ad1132d4 100644 --- a/objectivec/DevTools/compile_testing_protos.sh +++ b/objectivec/DevTools/compile_testing_protos.sh @@ -95,7 +95,7 @@ cd "${SRCROOT}/.." # ----------------------------------------------------------------------------- RUN_PROTOC=no -# Check to if all the output files exist (incase a new one got added). +# Check to if all the output files exist (in case a new one got added). for PROTO_FILE in "${CORE_PROTO_FILES[@]}" "${OBJC_TEST_PROTO_FILES[@]}"; do DIR=${PROTO_FILE%/*} diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh index 84ed8e99147391c329d6b5492d8b52eb0b0b8561..9319b5587176c8e196d3c440aa26b558e22e15c3 100644 --- a/objectivec/DevTools/full_mac_build.sh +++ b/objectivec/DevTools/full_mac_build.sh @@ -285,11 +285,11 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit -destination "platform=iOS Simulator,name=iPhone 7,OS=latest" # 64bit # 10.x also seems to often fail running destinations in parallel (with - # 32bit one include atleast) + # 32bit one include at least) -disable-concurrent-destination-testing ) ;; - 11.*) + 11.* | 12.*) # Dropped 32bit as Apple doesn't seem support the simulators either. XCODEBUILD_TEST_BASE_IOS+=( -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" # 64bit @@ -352,10 +352,8 @@ if [[ "${DO_XCODE_TVOS_TESTS}" == "yes" ]] ; then echo "ERROR: Xcode 10.0 or higher is required to build the test suite." 1>&2 exit 11 ;; - 10.* | 11.* ) + 10.* | 11.* | 12.*) XCODEBUILD_TEST_BASE_TVOS+=( - # Test on the oldest and current. - -destination "platform=tvOS Simulator,name=Apple TV,OS=11.0" -destination "platform=tvOS Simulator,name=Apple TV 4K,OS=latest" ) ;; diff --git a/objectivec/DevTools/pddm.py b/objectivec/DevTools/pddm.py index dacf7bba00dbd4166b6b77f3833a39b505a14334..b572cc75b618377dfd794be603341527af64aa61 100644 --- a/objectivec/DevTools/pddm.py +++ b/objectivec/DevTools/pddm.py @@ -645,7 +645,7 @@ def main(args): opts, extra_args = parser.parse_args(args) if not extra_args: - parser.error('Need atleast one file to process') + parser.error('Need at least one file to process') result = 0 for a_path in extra_args: diff --git a/objectivec/GPBAny.pbobjc.h b/objectivec/GPBAny.pbobjc.h index 288d552356160bd0d639f1bf6812ab9161867692..21b7dcf4afb4c499d0131e8dd458a7c095a259d0 100644 --- a/objectivec/GPBAny.pbobjc.h +++ b/objectivec/GPBAny.pbobjc.h @@ -94,10 +94,13 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { * Example 4: Pack and unpack a message in Go * * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } * ... * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * if err := any.UnmarshalTo(foo); err != nil { * ... * } * diff --git a/objectivec/GPBApi.pbobjc.h b/objectivec/GPBApi.pbobjc.h index 287c0516d0f47c86d08aa597651c1c1958c3e829..5d55ebf39921a442269e9826f9aae77ba035508f 100644 --- a/objectivec/GPBApi.pbobjc.h +++ b/objectivec/GPBApi.pbobjc.h @@ -257,7 +257,7 @@ typedef GPB_ENUM(GPBMixin_FieldNumber) { * The mixin construct implies that all methods in `AccessControl` are * also declared with same name and request/response types in * `Storage`. A documentation generator or annotation processor will - * see the effective `Storage.GetAcl` method after inherting + * see the effective `Storage.GetAcl` method after inheriting * documentation and annotations as follows: * * service Storage { diff --git a/objectivec/GPBExtensionInternals.m b/objectivec/GPBExtensionInternals.m index 290c82a1bb8203a3bbe702ad4a3b525c40d967f1..bacec5740a5068dc8577b6a0b5cff672541d307f 100644 --- a/objectivec/GPBExtensionInternals.m +++ b/objectivec/GPBExtensionInternals.m @@ -361,8 +361,8 @@ static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension, if (existingValue) { message = [existingValue retain]; } else { - GPBDescriptor *decriptor = [extension.msgClass descriptor]; - message = [[decriptor.messageClass alloc] init]; + GPBDescriptor *descriptor = [extension.msgClass descriptor]; + message = [[descriptor.messageClass alloc] init]; } if (description->dataType == GPBDataTypeGroup) { diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m index 8e6aaf16e93d438618f85758c2a9cdf26e6b6b9f..20ae9aee989c8b2955abfe95898537302f510e6f 100644 --- a/objectivec/GPBMessage.m +++ b/objectivec/GPBMessage.m @@ -71,6 +71,8 @@ static NSString *const kGPBDataCoderKey = @"GPBData"; @package GPBUnknownFieldSet *unknownFields_; NSMutableDictionary *extensionMap_; + // Readonly access to autocreatedExtensionMap_ is protected via + // readOnlySemaphore_. NSMutableDictionary *autocreatedExtensionMap_; // If the object was autocreated, we remember the creator so that if we get @@ -79,10 +81,10 @@ static NSString *const kGPBDataCoderKey = @"GPBData"; GPBFieldDescriptor *autocreatorField_; GPBExtensionDescriptor *autocreatorExtension_; - // A lock to provide mutual exclusion from internal data that can be modified - // by *read* operations such as getters (autocreation of message fields and - // message extensions, not setting of values). Used to guarantee thread safety - // for concurrent reads on the message. + // Message can only be mutated from one thread. But some *readonly* operations + // modifify internal state because they autocreate things. The + // autocreatedExtensionMap_ is one such structure. Access during readonly + // operations is protected via this semaphore. // NOTE: OSSpinLock may seem like a good fit here but Apple engineers have // pointed out that they are vulnerable to live locking on iOS in cases of // priority inversion: @@ -583,19 +585,30 @@ static id GetOrCreateArrayIvarWithField(GPBMessage *self, // This is like GPBGetObjectIvarWithField(), but for arrays, it should // only be used to wire the method into the class. static id GetArrayIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { - id array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); - if (!array) { - // Check again after getting the lock. - GPBPrepareReadOnlySemaphore(self); - dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); - array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); - if (!array) { - array = CreateArrayForField(field, self); - GPBSetAutocreatedRetainedObjectIvarWithField(self, field, array); - } - dispatch_semaphore_signal(self->readOnlySemaphore_); + uint8_t *storage = (uint8_t *)self->messageStorage_; + _Atomic(id) *typePtr = (_Atomic(id) *)&storage[field->description_->offset]; + id array = atomic_load(typePtr); + if (array) { + return array; } - return array; + + id expected = nil; + id autocreated = CreateArrayForField(field, self); + if (atomic_compare_exchange_strong(typePtr, &expected, autocreated)) { + // Value was set, return it. + return autocreated; + } + + // Some other thread set it, release the one created and return what got set. + if (GPBFieldDataTypeIsObject(field)) { + GPBAutocreatedArray *autoArray = autocreated; + autoArray->_autocreator = nil; + } else { + GPBInt32Array *gpbArray = autocreated; + gpbArray->_autocreator = nil; + } + [autocreated release]; + return expected; } static id GetOrCreateMapIvarWithField(GPBMessage *self, @@ -613,19 +626,31 @@ static id GetOrCreateMapIvarWithField(GPBMessage *self, // This is like GPBGetObjectIvarWithField(), but for maps, it should // only be used to wire the method into the class. static id GetMapIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { - id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); - if (!dict) { - // Check again after getting the lock. - GPBPrepareReadOnlySemaphore(self); - dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); - dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); - if (!dict) { - dict = CreateMapForField(field, self); - GPBSetAutocreatedRetainedObjectIvarWithField(self, field, dict); - } - dispatch_semaphore_signal(self->readOnlySemaphore_); + uint8_t *storage = (uint8_t *)self->messageStorage_; + _Atomic(id) *typePtr = (_Atomic(id) *)&storage[field->description_->offset]; + id dict = atomic_load(typePtr); + if (dict) { + return dict; } - return dict; + + id expected = nil; + id autocreated = CreateMapForField(field, self); + if (atomic_compare_exchange_strong(typePtr, &expected, autocreated)) { + // Value was set, return it. + return autocreated; + } + + // Some other thread set it, release the one created and return what got set. + if ((field.mapKeyDataType == GPBDataTypeString) && + GPBFieldDataTypeIsObject(field)) { + GPBAutocreatedDictionary *autoDict = autocreated; + autoDict->_autocreator = nil; + } else { + GPBInt32Int32Dictionary *gpbDict = autocreated; + gpbDict->_autocreator = nil; + } + [autocreated release]; + return expected; } #endif // !defined(__clang_analyzer__) @@ -3286,7 +3311,7 @@ static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field, // if a sub message in a field has extensions, the issue still exists. A // recursive check could be done here (like the work in // GPBMessageDropUnknownFieldsRecursively()), but that has the potential to - // be expensive and could slow down serialization in DEBUG enought to cause + // be expensive and could slow down serialization in DEBUG enough to cause // developers other problems. NSLog(@"Warning: writing out a GPBMessage (%@) via NSCoding and it" @" has %ld extensions; when read back in, those fields will be" @@ -3337,30 +3362,34 @@ id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field) { id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { NSCAssert(!GPBFieldIsMapOrArray(field), @"Shouldn't get here"); - if (GPBGetHasIvarField(self, field)) { - uint8_t *storage = (uint8_t *)self->messageStorage_; - id *typePtr = (id *)&storage[field->description_->offset]; - return *typePtr; - } - // Not set... - - // Non messages (string/data), get their default. if (!GPBFieldDataTypeIsMessage(field)) { + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + return *typePtr; + } + // Not set...non messages (string/data), get their default. return field.defaultValue.valueMessage; } - GPBPrepareReadOnlySemaphore(self); - dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); - GPBMessage *result = GPBGetObjectIvarWithFieldNoAutocreate(self, field); - if (!result) { - // For non repeated messages, create the object, set it and return it. - // This object will not initially be visible via GPBGetHasIvar, so - // we save its creator so it can become visible if it's mutated later. - result = GPBCreateMessageWithAutocreator(field.msgClass, self, field); - GPBSetAutocreatedRetainedObjectIvarWithField(self, field, result); - } - dispatch_semaphore_signal(self->readOnlySemaphore_); - return result; + uint8_t *storage = (uint8_t *)self->messageStorage_; + _Atomic(id) *typePtr = (_Atomic(id) *)&storage[field->description_->offset]; + id msg = atomic_load(typePtr); + if (msg) { + return msg; + } + + id expected = nil; + id autocreated = GPBCreateMessageWithAutocreator(field.msgClass, self, field); + if (atomic_compare_exchange_strong(typePtr, &expected, autocreated)) { + // Value was set, return it. + return autocreated; + } + + // Some other thread set it, release the one created and return what got set. + GPBClearMessageAutocreator(autocreated); + [autocreated release]; + return expected; } #pragma clang diagnostic pop diff --git a/objectivec/GPBTimestamp.pbobjc.h b/objectivec/GPBTimestamp.pbobjc.h index 92f0bac886d87d53fb6f9bd74c1c10535eaf82f1..a328afc7c93d4259e3815cdf6ff7fee4cd903380 100644 --- a/objectivec/GPBTimestamp.pbobjc.h +++ b/objectivec/GPBTimestamp.pbobjc.h @@ -107,7 +107,16 @@ typedef GPB_ENUM(GPBTimestamp_FieldNumber) { * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/objectivec/GPBUtilities.m b/objectivec/GPBUtilities.m index ee79d00192d41402ced248e43a3d101275fe73f1..08dd358225fb2125e6e0950b5ea7adf7f717f090 100644 --- a/objectivec/GPBUtilities.m +++ b/objectivec/GPBUtilities.m @@ -219,7 +219,7 @@ void GPBCheckRuntimeVersionSupport(int32_t objcRuntimeVersion) { // Library is too old for headers. [NSException raise:NSInternalInconsistencyException format:@"Linked to ProtocolBuffer runtime version %d," - @" but code compiled needing atleast %d!", + @" but code compiled needing at least %d!", GOOGLE_PROTOBUF_OBJC_VERSION, objcRuntimeVersion]; } if (objcRuntimeVersion < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION) { @@ -504,15 +504,6 @@ static void GPBMaybeClearOneofPrivate(GPBMessage *self, // Object types are handled slightly differently, they need to be released // and retained. -void GPBSetAutocreatedRetainedObjectIvarWithField( - GPBMessage *self, GPBFieldDescriptor *field, - id __attribute__((ns_consumed)) value) { - uint8_t *storage = (uint8_t *)self->messageStorage_; - id *typePtr = (id *)&storage[field->description_->offset]; - NSCAssert(*typePtr == NULL, @"Can't set autocreated object more than once."); - *typePtr = value; -} - void GPBClearAutocreatedMessageIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { if (GPBGetHasIvarField(self, field)) { diff --git a/objectivec/GPBUtilities_PackagePrivate.h b/objectivec/GPBUtilities_PackagePrivate.h index 9c29c39c0b274bcd8c8e77c2ae4392c443b93d79..3d3d7349ec786d8a9e62d45b49036bc496f286c5 100644 --- a/objectivec/GPBUtilities_PackagePrivate.h +++ b/objectivec/GPBUtilities_PackagePrivate.h @@ -289,10 +289,6 @@ void GPBSetRetainedObjectIvarWithFieldPrivate(GPBMessage *self, id GPBGetObjectIvarWithFieldNoAutocreate(GPBMessage *self, GPBFieldDescriptor *field); -void GPBSetAutocreatedRetainedObjectIvarWithField( - GPBMessage *self, GPBFieldDescriptor *field, - id __attribute__((ns_consumed)) value); - // Clears and releases the autocreated message ivar, if it's autocreated. If // it's not set as autocreated, this method does nothing. void GPBClearAutocreatedMessageIvarWithField(GPBMessage *self, @@ -304,7 +300,7 @@ void GPBClearAutocreatedMessageIvarWithField(GPBMessage *self, const char *GPBMessageEncodingForSelector(SEL selector, BOOL instanceSel); // Helper for text format name encoding. -// decodeData is the data describing the sepecial decodes. +// decodeData is the data describing the special decodes. // key and inputString are the input that needs decoding. NSString *GPBDecodeTextFormatName(const uint8_t *decodeData, int32_t key, NSString *inputString); diff --git a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj index 12d0ffd61a7fcb41903a36cc48f6050068aa64d4..f0f82c8289373a6cf72907efd6a9989b6d3b20f9 100644 --- a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj @@ -856,13 +856,11 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; - ENABLE_BITCODE = YES; FRAMEWORK_SEARCH_PATHS = ( "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); INFOPLIST_FILE = "Tests/UnitTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -889,13 +887,11 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; - ENABLE_BITCODE = YES; FRAMEWORK_SEARCH_PATHS = ( "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); INFOPLIST_FILE = "Tests/UnitTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -972,7 +968,7 @@ GCC_WARN_UNUSED_PARAMETER = YES; GCC_WARN_UNUSED_VARIABLE = YES; GENERATE_PROFILING_CODE = NO; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; @@ -1041,7 +1037,7 @@ GCC_WARN_UNUSED_PARAMETER = YES; GCC_WARN_UNUSED_VARIABLE = YES; GENERATE_PROFILING_CODE = NO; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/objectivec/README.md b/objectivec/README.md index 5982939290eade13dd91e5c831c236aa67b51846..2583779d38f0d57e0680698259d0daccb9f2f739 100644 --- a/objectivec/README.md +++ b/objectivec/README.md @@ -168,7 +168,7 @@ supported keys are: Any number of files can be listed for a framework, just separate them with commas. - There can be multiple lines listing the same frameworkName incase it has a + There can be multiple lines listing the same frameworkName in case it has a lot of proto files included in it; and having multiple lines makes things easier to read. diff --git a/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework b/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework index 913a289b8ec15f6abfffa08cd576bfba2a89c5e5..e0ee905514527e74be170f0dc92b97f3f6b1ef81 100644 --- a/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework +++ b/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework @@ -1,5 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' +platform :ios, '9.0' install! 'cocoapods', :deterministic_uuids => false diff --git a/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static b/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static index e9b3c235dd1694d4589ced283bcbbc3c11b76a99..1bb8cb2e1aa497a203a9259310aba7f123da1c82 100644 --- a/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static +++ b/objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static @@ -1,5 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' +platform :ios, '9.0' install! 'cocoapods', :deterministic_uuids => false diff --git a/objectivec/Tests/CocoaPods/run_tests.sh b/objectivec/Tests/CocoaPods/run_tests.sh index 6d3e12be30f28d304cf726d627d3d18b97c994e3..35bcc18df7a9dc8b9af9e2dc08c067a2fc3fbe68 100644 --- a/objectivec/Tests/CocoaPods/run_tests.sh +++ b/objectivec/Tests/CocoaPods/run_tests.sh @@ -90,7 +90,7 @@ cleanup() { echo "Cleaning up..." # Generally don't let things fail, and eat common stdout, but let stderr show - # incase something does hiccup. + # in case something does hiccup. xcodebuild -workspace "${TEST_NAME}.xcworkspace" -scheme "${TEST_NAME}" clean > /dev/null || true pod deintegrate > /dev/null || true # Flush the cache so nothing is left behind. diff --git a/objectivec/Tests/GPBCodedInputStreamTests.m b/objectivec/Tests/GPBCodedInputStreamTests.m index f5aa69038f5cf48d6d16e3d9492afa245217a406..6cd5a1ffd7694ca00f28e9fa43a6d2495dd2c62e 100644 --- a/objectivec/Tests/GPBCodedInputStreamTests.m +++ b/objectivec/Tests/GPBCodedInputStreamTests.m @@ -422,7 +422,7 @@ - (void)testBOMWithinStrings { // We've seen servers that end up with BOMs within strings (not always at the // start, and sometimes in multiple places), make sure they always parse - // correctly. (Again, this is inpart incase a custom string class is ever + // correctly. (Again, this is inpart in case a custom string class is ever // used again.) const char* strs[] = { "\xEF\xBB\xBF String with BOM", diff --git a/objectivec/Tests/GPBCodedOuputStreamTests.m b/objectivec/Tests/GPBCodedOuputStreamTests.m index 6c9144fb577de04f1568e5933459748be551786a..a9934acdac1ab1d1d0074a1ce58a22198b536f22 100644 --- a/objectivec/Tests/GPBCodedOuputStreamTests.m +++ b/objectivec/Tests/GPBCodedOuputStreamTests.m @@ -400,7 +400,7 @@ - (void)testWriteStringsWithZeroChar { // Unicode allows `\0` as a character, and NSString is a class cluster, so - // there are a few different classes that could end up beind a given string. + // there are a few different classes that could end up behind a given string. // Historically, we've seen differences based on constant strings in code and // strings built via the NSString apis. So this round trips them to ensure // they are acting as expected. diff --git a/objectivec/Tests/GPBTestUtilities.m b/objectivec/Tests/GPBTestUtilities.m index 0362bdde647c748e2ff76267ec2e6242de2a0a2b..48d75e794ab83d4ad25f43e21091c1d29544dea6 100644 --- a/objectivec/Tests/GPBTestUtilities.m +++ b/objectivec/Tests/GPBTestUtilities.m @@ -779,7 +779,7 @@ const uint32_t kGPBDefaultRepeatCount = 2; [message.repeatedSfixed64Array addValue:210 + i * 100]; [message.repeatedFloatArray addValue:211 + i * 100]; [message.repeatedDoubleArray addValue:212 + i * 100]; - [message.repeatedBoolArray addValue:(i % 2)]; + [message.repeatedBoolArray addValue:(BOOL)(i % 2)]; NSString *string = [[NSString alloc] initWithFormat:@"%d", 215 + i * 100]; [message.repeatedStringArray addObject:string]; [string release]; diff --git a/php/ext/google/protobuf/array.c b/php/ext/google/protobuf/array.c index 4615ed31aaaa3da4b4d662a957eaa22770999455..0fa9bf0e5bb363fbd1828e73629a60f31326f49a 100644 --- a/php/ext/google/protobuf/array.c +++ b/php/ext/google/protobuf/array.c @@ -41,6 +41,7 @@ #include "arena.h" #include "convert.h" #include "def.h" +#include "message.h" #include "php-upb.h" #include "protobuf.h" @@ -94,6 +95,26 @@ static void RepeatedField_destructor(zend_object* obj) { zend_object_std_dtor(&intern->std); } +/** + * RepeatedField_compare_objects() + * + * Object handler for comparing two repeated field objects. Called whenever PHP + * code does: + * + * $rf1 == $rf2 + */ +static int RepeatedField_compare_objects(zval *rf1, zval *rf2) { + RepeatedField* intern1 = (RepeatedField*)Z_OBJ_P(rf1); + RepeatedField* intern2 = (RepeatedField*)Z_OBJ_P(rf2); + upb_fieldtype_t type = intern1->type; + const upb_msgdef *m = intern1->desc ? intern1->desc->msgdef : NULL; + + if (type != intern2->type) return 1; + if (intern1->desc != intern2->desc) return 1; + + return ArrayEq(intern1->array, intern2->array, type, m) ? 0 : 1; +} + static HashTable *RepeatedField_GetProperties(PROTO_VAL *object) { return NULL; // We do not have a properties table. } @@ -177,6 +198,27 @@ upb_array *RepeatedField_GetUpbArray(zval *val, const upb_fielddef *f, } } +bool ArrayEq(const upb_array *a1, const upb_array *a2, upb_fieldtype_t type, + const upb_msgdef *m) { + size_t i; + size_t n; + + if ((a1 == NULL) != (a2 == NULL)) return false; + if (a1 == NULL) return true; + + n = upb_array_size(a1); + if (n != upb_array_size(a2)) return false; + + for (i = 0; i < n; i++) { + upb_msgval val1 = upb_array_get(a1, i); + upb_msgval val2 = upb_array_get(a2, i); + if (!ValueEq(val1, val2, type, m)) return false; + } + + return true; +} + + // RepeatedField PHP methods /////////////////////////////////////////////////// /** @@ -594,6 +636,7 @@ void Array_ModuleInit() { h = &RepeatedField_object_handlers; memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); h->dtor_obj = RepeatedField_destructor; + h->compare_objects = RepeatedField_compare_objects; h->get_properties = RepeatedField_GetProperties; h->get_property_ptr_ptr = RepeatedField_GetPropertyPtrPtr; diff --git a/php/ext/google/protobuf/array.h b/php/ext/google/protobuf/array.h index 5cf517c5662d24a387ed7a798bd8687323f18fcd..921e0bf564f48f6d1d4ccf75a79ceb33b00f73a0 100644 --- a/php/ext/google/protobuf/array.h +++ b/php/ext/google/protobuf/array.h @@ -58,4 +58,9 @@ upb_array *RepeatedField_GetUpbArray(zval *val, const upb_fielddef *f, upb_arena void RepeatedField_GetPhpWrapper(zval *val, upb_array *arr, const upb_fielddef *f, zval *arena); +// Returns true if the given arrays are equal. Both arrays must be of this +// |type| and, if the type is |UPB_TYPE_MESSAGE|, must have the same |m|. +bool ArrayEq(const upb_array *a1, const upb_array *a2, upb_fieldtype_t type, + const upb_msgdef *m); + #endif // PHP_PROTOBUF_ARRAY_H_ diff --git a/php/ext/google/protobuf/bundled_php.h b/php/ext/google/protobuf/bundled_php.h deleted file mode 100644 index 76147677a1774c45f00088e5a6ab66c3aae71fb6..0000000000000000000000000000000000000000 --- a/php/ext/google/protobuf/bundled_php.h +++ /dev/null @@ -1,46 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef PHP_PROTOBUF_BUNDLED_PHP_H_ -#define PHP_PROTOBUF_BUNDLED_PHP_H_ - -// We embed PHP source code into the binary for things we don't want to -// implement in C. This struct serves as a table of contents for all of -// the embedded files. -typedef struct { - const char *filename; - const char *contents; -} BundledPhp_File; - -// An array of all the embedded file structs. This array is terminated with a -// {NULL, NULL} entry. -extern BundledPhp_File *bundled_files; - -#endif // PHP_PROTOBUF_BUNDLED_PHP_H_ diff --git a/php/ext/google/protobuf/config.m4 b/php/ext/google/protobuf/config.m4 index 3fdcb00480d41d0b4d22b8c5f3176920f1bb9472..c09c03af0a5b7567cf2bdcf891aa476a50648f5f 100644 --- a/php/ext/google/protobuf/config.m4 +++ b/php/ext/google/protobuf/config.m4 @@ -4,7 +4,7 @@ if test "$PHP_PROTOBUF" != "no"; then PHP_NEW_EXTENSION( protobuf, - arena.c array.c bundled_php.c convert.c def.c map.c message.c names.c php-upb.c protobuf.c, - $ext_shared) + arena.c array.c convert.c def.c map.c message.c names.c php-upb.c protobuf.c, + $ext_shared, , -std=gnu99) fi diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index 37dd50c1824ab17bae433aac07097903e504eacb..3f7590ca44dc224790332a496f2238acd84b1d91 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -772,6 +772,7 @@ upb_symtab *DescriptorPool_GetSymbolTable() { return intern->symtab; } + /* * DescriptorPool::getGeneratedPool() * @@ -906,13 +907,38 @@ static void add_name_mappings(const upb_filedef *file) { } } +static void add_descriptor(DescriptorPool *pool, + const google_protobuf_FileDescriptorProto *file) { + upb_strview name = google_protobuf_FileDescriptorProto_name(file); + upb_status status; + const upb_filedef *file_def; + upb_status_clear(&status); + + if (upb_symtab_lookupfile2(pool->symtab, name.data, name.size)) { + // Already added. + fprintf(stderr, "WARNING: file was already added\n"); + return; + } + + // The PHP code generator currently special-cases descriptor.proto. It + // doesn't add it as a dependency even if the proto file actually does + // depend on it. + if (depends_on_descriptor(file)) { + google_protobuf_FileDescriptorProto_getmsgdef(pool->symtab); + } + + file_def = upb_symtab_addfile(pool->symtab, file, &status); + CheckUpbStatus(&status, "Unable to load descriptor"); + add_name_mappings(file_def); +} + /* - * add_name_mappings() + * add_descriptor() * * Adds the given descriptor data to this DescriptorPool. */ -static void add_descriptor(DescriptorPool *pool, const char *data, - int data_len, upb_arena *arena) { +static void add_descriptor_set(DescriptorPool *pool, const char *data, + int data_len, upb_arena *arena) { size_t i, n; google_protobuf_FileDescriptorSet *set; const google_protobuf_FileDescriptorProto* const* files; @@ -928,27 +954,28 @@ static void add_descriptor(DescriptorPool *pool, const char *data, for (i = 0; i < n; i++) { const google_protobuf_FileDescriptorProto* file = files[i]; - upb_strview name = google_protobuf_FileDescriptorProto_name(file); - upb_status status; - const upb_filedef *file_def; - upb_status_clear(&status); - - if (upb_symtab_lookupfile2(pool->symtab, name.data, name.size)) { - // Already added. - continue; - } + add_descriptor(pool, file); + } +} - // The PHP code generator currently special-cases descriptor.proto. It - // doesn't add it as a dependency even if the proto file actually does - // depend on it. - if (depends_on_descriptor(file)) { - google_protobuf_FileDescriptorProto_getmsgdef(pool->symtab); - } +bool DescriptorPool_HasFile(const char *filename) { + DescriptorPool *intern = GetPool(get_generated_pool()); + return upb_symtab_lookupfile(intern->symtab, filename) != NULL; +} + +void DescriptorPool_AddDescriptor(const char *filename, const char *data, + int size) { + upb_arena *arena = upb_arena_new(); + const google_protobuf_FileDescriptorProto *file = + google_protobuf_FileDescriptorProto_parse(data, size, arena); - file_def = upb_symtab_addfile(pool->symtab, file, &status); - CheckUpbStatus(&status, "Unable to load descriptor"); - add_name_mappings(file_def); + if (!file) { + zend_error(E_ERROR, "Failed to parse binary descriptor for %s\n", filename); + return; } + + add_descriptor(GetPool(get_generated_pool()), file); + upb_arena_free(arena); } /* @@ -969,7 +996,7 @@ PHP_METHOD(DescriptorPool, internalAddGeneratedFile) { } arena = upb_arena_new(); - add_descriptor(intern, data, data_len, arena); + add_descriptor_set(intern, data, data_len, arena); upb_arena_free(arena); } @@ -983,6 +1010,35 @@ static zend_function_entry DescriptorPool_methods[] = { ZEND_FE_END }; +// ----------------------------------------------------------------------------- +// InternalDescriptorPool +// ----------------------------------------------------------------------------- + +// For the C extension, Google\Protobuf\Internal\DescriptorPool is not a +// separate instantiable object, it just returns a +// Google\Protobuf\DescriptorPool. + +zend_class_entry *InternalDescriptorPool_class_entry; + +/* + * InternalDescriptorPool::getGeneratedPool() + * + * Returns the generated DescriptorPool. Note that this is identical to + * DescriptorPool::getGeneratedPool(), and in fact returns a DescriptorPool + * instance. + */ +PHP_METHOD(InternalDescriptorPool, getGeneratedPool) { + zval ret; + ZVAL_COPY(&ret, get_generated_pool()); + RETURN_ZVAL(&ret, 0, 1); +} + +static zend_function_entry InternalDescriptorPool_methods[] = { + PHP_ME(InternalDescriptorPool, getGeneratedPool, NULL, + ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_FE_END +}; + // ----------------------------------------------------------------------------- // GPBType // ----------------------------------------------------------------------------- @@ -1044,7 +1100,7 @@ void Def_ModuleInit() { h = &FieldDescriptor_object_handlers; memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); - INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Internal\\DescriptorPool", + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\DescriptorPool", DescriptorPool_methods); DescriptorPool_class_entry = zend_register_internal_class(&tmp_ce); DescriptorPool_class_entry->ce_flags |= ZEND_ACC_FINAL; @@ -1053,6 +1109,10 @@ void Def_ModuleInit() { memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); h->dtor_obj = DescriptorPool_destructor; + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Internal\\DescriptorPool", + InternalDescriptorPool_methods); + InternalDescriptorPool_class_entry = zend_register_internal_class(&tmp_ce); + // GPBType. #define STR(str) (str), strlen(str) zend_class_entry class_type; diff --git a/php/ext/google/protobuf/def.h b/php/ext/google/protobuf/def.h index 515a83eca7daa7f936bb7d123a5f78246c24faa4..2a89cd0fd4e6feb7d30e4e8b88137a43f6ed50b0 100644 --- a/php/ext/google/protobuf/def.h +++ b/php/ext/google/protobuf/def.h @@ -49,6 +49,12 @@ upb_symtab *DescriptorPool_Steal(zval *zv); upb_symtab *DescriptorPool_GetSymbolTable(); +// Returns true if the global descriptor pool already has the given filename. +bool DescriptorPool_HasFile(const char *filename); + +// Adds the given descriptor with the given filename to the global pool. +void DescriptorPool_AddDescriptor(const char *filename, const char *data, int size); + typedef struct Descriptor { zend_object std; const upb_msgdef *msgdef; diff --git a/php/ext/google/protobuf/make-preload.php b/php/ext/google/protobuf/make-preload.php deleted file mode 100644 index 4b1ce7f676fa27f9bf91659f9272314172e497de..0000000000000000000000000000000000000000 --- a/php/ext/google/protobuf/make-preload.php +++ /dev/null @@ -1,62 +0,0 @@ - Google\\Protobuf\\BoolValue - $ret = stripSuffix($filename, ".php"); - return str_replace("/", "\\\\", $ret); -} - -function toCSymbolName($filename) { - # Google/Protobuf/BoolValue.php -> Google__Protobuf__BoolValue - $ret = stripSuffix($filename, ".php"); - return str_replace("/", "__", $ret); -} - -$f = fopen($output, "w"); - -fwrite($f, "#include \"bundled_php.h\"\n"); -fwrite($f, "#include \"stdlib.h\"\n"); - -foreach ($filenames as $filename) { - print("Reading $filename...\n"); - $contents = file_get_contents($filename); - $contents = substr($contents, 5); // Strip diff --git a/php/ext/google/protobuf/map.c b/php/ext/google/protobuf/map.c index f29c18c9bd9aa13c815c5def16423232b7f8d521..426d56a4f9b4a9140eded3fcc1b211579873bc20 100644 --- a/php/ext/google/protobuf/map.c +++ b/php/ext/google/protobuf/map.c @@ -37,6 +37,7 @@ #include "arena.h" #include "convert.h" +#include "message.h" #include "php-upb.h" #include "protobuf.h" @@ -90,6 +91,28 @@ static void MapField_destructor(zend_object* obj) { zend_object_std_dtor(&intern->std); } +/** + * MapField_compare_objects() + * + * Object handler for comparing two repeated field objects. Called whenever PHP + * code does: + * + * $map1 == $map2 + */ +static int MapField_compare_objects(zval *map1, zval *map2) { + MapField* intern1 = (MapField*)Z_OBJ_P(map1); + MapField* intern2 = (MapField*)Z_OBJ_P(map2); + const upb_msgdef *m = intern1->desc ? intern1->desc->msgdef : NULL; + upb_fieldtype_t key_type = intern1->key_type; + upb_fieldtype_t val_type = intern1->val_type; + + if (key_type != intern2->key_type) return 1; + if (val_type != intern2->val_type) return 1; + if (intern1->desc != intern2->desc) return 1; + + return MapEq(intern1->map, intern2->map, key_type, val_type, m) ? 0 : 1; +} + static zval *Map_GetPropertyPtrPtr(PROTO_VAL *object, PROTO_STR *member, int type, void **cache_slot) { return NULL; // We don't offer direct references to our properties. @@ -185,6 +208,27 @@ upb_map *MapField_GetUpbMap(zval *val, const upb_fielddef *f, upb_arena *arena) } } +bool MapEq(const upb_map *m1, const upb_map *m2, upb_fieldtype_t key_type, + upb_fieldtype_t val_type, const upb_msgdef *m) { + size_t iter = UPB_MAP_BEGIN; + + if ((m1 == NULL) != (m2 == NULL)) return false; + if (m1 == NULL) return true; + if (upb_map_size(m1) != upb_map_size(m2)) return false; + + while (upb_mapiter_next(m1, &iter)) { + upb_msgval key = upb_mapiter_key(m1, iter); + upb_msgval val1 = upb_mapiter_value(m1, iter); + upb_msgval val2; + + if (!upb_map_get(m2, key, &val2)) return false; + if (!ValueEq(val1, val2, val_type, m)) return false; + } + + return true; +} + + // MapField PHP methods //////////////////////////////////////////////////////// /** @@ -578,6 +622,7 @@ void Map_ModuleInit() { h = &MapField_object_handlers; memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); h->dtor_obj = MapField_destructor; + h->compare_objects = MapField_compare_objects; h->get_properties = Map_GetProperties; h->get_property_ptr_ptr = Map_GetPropertyPtrPtr; diff --git a/php/ext/google/protobuf/map.h b/php/ext/google/protobuf/map.h index 9b3c9c144cd415927932bc17c9b8321fda50f041..6eb0620c2e06f8d5ba3004b94c30f28a56c15460 100644 --- a/php/ext/google/protobuf/map.h +++ b/php/ext/google/protobuf/map.h @@ -57,4 +57,7 @@ upb_map *MapField_GetUpbMap(zval *val, const upb_fielddef *f, upb_arena *arena); void MapField_GetPhpWrapper(zval *val, upb_map *arr, const upb_fielddef *f, zval *arena); +bool MapEq(const upb_map *m1, const upb_map *m2, upb_fieldtype_t key_type, + upb_fieldtype_t val_type, const upb_msgdef *m); + #endif // PHP_PROTOBUF_MAP_H_ diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index 63d2b084aa35792c99585faf51456b807b3f3cf4..f15b8ac1b466a2de9a247e6680373fad3cbc1d6b 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -36,6 +36,7 @@ // This is not self-contained: it must be after other Zend includes. #include +#include #include "arena.h" #include "array.h" @@ -108,6 +109,134 @@ static const upb_fielddef *get_field(Message *msg, PROTO_STR *member) { return f; } +static void Message_get(Message *intern, const upb_fielddef *f, zval *rv) { + upb_arena *arena = Arena_Get(&intern->arena); + + if (upb_fielddef_ismap(f)) { + upb_mutmsgval msgval = upb_msg_mutable(intern->msg, f, arena); + MapField_GetPhpWrapper(rv, msgval.map, f, &intern->arena); + } else if (upb_fielddef_isseq(f)) { + upb_mutmsgval msgval = upb_msg_mutable(intern->msg, f, arena); + RepeatedField_GetPhpWrapper(rv, msgval.array, f, &intern->arena); + } else { + upb_msgval msgval = upb_msg_get(intern->msg, f); + const Descriptor *subdesc = Descriptor_GetFromFieldDef(f); + Convert_UpbToPhp(msgval, rv, upb_fielddef_type(f), subdesc, &intern->arena); + } +} + +static bool Message_set(Message *intern, const upb_fielddef *f, zval *val) { + upb_arena *arena = Arena_Get(&intern->arena); + upb_msgval msgval; + + if (upb_fielddef_ismap(f)) { + msgval.map_val = MapField_GetUpbMap(val, f, arena); + if (!msgval.map_val) return false; + } else if (upb_fielddef_isseq(f)) { + msgval.array_val = RepeatedField_GetUpbArray(val, f, arena); + if (!msgval.array_val) return false; + } else { + upb_fieldtype_t type = upb_fielddef_type(f); + const Descriptor *subdesc = Descriptor_GetFromFieldDef(f); + bool ok = Convert_PhpToUpb(val, &msgval, type, subdesc, arena); + if (!ok) return false; + } + + upb_msg_set(intern->msg, f, msgval, arena); + return true; +} + +static bool MessageEq(const upb_msg *m1, const upb_msg *m2, const upb_msgdef *m); + +/** + * ValueEq()() + */ +bool ValueEq(upb_msgval val1, upb_msgval val2, upb_fieldtype_t type, + const upb_msgdef *m) { + switch (type) { + case UPB_TYPE_BOOL: + return val1.bool_val == val2.bool_val; + case UPB_TYPE_INT32: + case UPB_TYPE_UINT32: + case UPB_TYPE_ENUM: + return val1.int32_val == val2.int32_val; + case UPB_TYPE_INT64: + case UPB_TYPE_UINT64: + return val1.int64_val == val2.int64_val; + case UPB_TYPE_FLOAT: + return val1.float_val == val2.float_val; + case UPB_TYPE_DOUBLE: + return val1.double_val == val2.double_val; + case UPB_TYPE_STRING: + case UPB_TYPE_BYTES: + return val1.str_val.size == val2.str_val.size && + memcmp(val1.str_val.data, val2.str_val.data, val1.str_val.size) == 0; + case UPB_TYPE_MESSAGE: + return MessageEq(val1.msg_val, val2.msg_val, m); + default: + return false; + } +} + +/** + * MessageEq() + */ +static bool MessageEq(const upb_msg *m1, const upb_msg *m2, const upb_msgdef *m) { + upb_msg_field_iter i; + + for(upb_msg_field_begin(&i, m); + !upb_msg_field_done(&i); + upb_msg_field_next(&i)) { + const upb_fielddef *f = upb_msg_iter_field(&i); + upb_msgval val1 = upb_msg_get(m1, f); + upb_msgval val2 = upb_msg_get(m2, f); + upb_fieldtype_t type = upb_fielddef_type(f); + const upb_msgdef *sub_m = upb_fielddef_msgsubdef(f); + + if (upb_fielddef_haspresence(f)) { + if (upb_msg_has(m1, f) != upb_msg_has(m2, f)) { + return false; + } + if (!upb_msg_has(m1, f)) continue; + } + + if (upb_fielddef_ismap(f)) { + const upb_fielddef *key_f = upb_msgdef_itof(sub_m, 1); + const upb_fielddef *val_f = upb_msgdef_itof(sub_m, 2); + upb_fieldtype_t key_type = upb_fielddef_type(key_f); + upb_fieldtype_t val_type = upb_fielddef_type(val_f); + const upb_msgdef *val_m = upb_fielddef_msgsubdef(val_f); + if (!MapEq(val1.map_val, val2.map_val, key_type, val_type, val_m)) { + return false; + } + } else if (upb_fielddef_isseq(f)) { + if (!ArrayEq(val1.array_val, val2.array_val, type, sub_m)) return false; + } else { + if (!ValueEq(val1, val2, type, sub_m)) return false; + } + } + + return true; +} + +/** + * Message_compare_objects() + * + * Object handler for comparing two message objects. Called whenever PHP code + * does: + * + * $m1 == $m2 + */ +static int Message_compare_objects(zval *m1, zval *m2) { + Message* intern1 = (Message*)Z_OBJ_P(m1); + Message* intern2 = (Message*)Z_OBJ_P(m2); + const upb_msgdef *m = intern1->desc->msgdef; + + if (intern2->desc->msgdef != m) return 1; + + return MessageEq(intern1->msg, intern2->msg, m) ? 0 : 1; +} + /** * Message_has_property() * @@ -180,6 +309,7 @@ static void Message_unset_property(PROTO_VAL *obj, PROTO_STR *member, upb_msg_clearfield(intern->msg, f); } + /** * Message_read_property() * @@ -202,22 +332,9 @@ static zval *Message_read_property(PROTO_VAL *obj, PROTO_STR *member, int type, void **cache_slot, zval *rv) { Message* intern = PROTO_MSG_P(obj); const upb_fielddef *f = get_field(intern, member); - upb_arena *arena = Arena_Get(&intern->arena); if (!f) return NULL; - - if (upb_fielddef_ismap(f)) { - upb_mutmsgval msgval = upb_msg_mutable(intern->msg, f, arena); - MapField_GetPhpWrapper(rv, msgval.map, f, &intern->arena); - } else if (upb_fielddef_isseq(f)) { - upb_mutmsgval msgval = upb_msg_mutable(intern->msg, f, arena); - RepeatedField_GetPhpWrapper(rv, msgval.array, f, &intern->arena); - } else { - upb_msgval msgval = upb_msg_get(intern->msg, f); - const Descriptor *subdesc = Descriptor_GetFromFieldDef(f); - Convert_UpbToPhp(msgval, rv, upb_fielddef_type(f), subdesc, &intern->arena); - } - + Message_get(intern, f, rv); return rv; } @@ -246,37 +363,20 @@ static PROTO_RETURN_VAL Message_write_property( PROTO_VAL *obj, PROTO_STR *member, zval *val, void **cache_slot) { Message* intern = PROTO_MSG_P(obj); const upb_fielddef *f = get_field(intern, member); - upb_arena *arena = Arena_Get(&intern->arena); - upb_msgval msgval; - - if (!f) goto error; - if (upb_fielddef_ismap(f)) { - msgval.map_val = MapField_GetUpbMap(val, f, arena); - if (!msgval.map_val) goto error; - } else if (upb_fielddef_isseq(f)) { - msgval.array_val = RepeatedField_GetUpbArray(val, f, arena); - if (!msgval.array_val) goto error; - } else { - upb_fieldtype_t type = upb_fielddef_type(f); - const Descriptor *subdesc = Descriptor_GetFromFieldDef(f); - bool ok = Convert_PhpToUpb(val, &msgval, type, subdesc, arena); - if (!ok) goto error; - } - - upb_msg_set(intern->msg, f, msgval, arena); -#if PHP_VERSION_ID < 704000 - return; + if (f && Message_set(intern, f, val)) { +#if PHP_VERSION_ID < 70400 + return; #else - return val; + return val; #endif - -error: -#if PHP_VERSION_ID < 704000 - return; + } else { +#if PHP_VERSION_ID < 70400 + return; #else - return &EG(error_zval); + return &EG(error_zval); #endif + } } /** @@ -440,6 +540,12 @@ bool Message_InitFromPhp(upb_msg *msg, const upb_msgdef *m, zval *init, } } +static void Message_Initialize(Message *intern, const Descriptor *desc) { + intern->desc = desc; + intern->msg = upb_msg_new(desc->msgdef, Arena_Get(&intern->arena)); + ObjCache_Add(intern->msg, &intern->std); +} + /** * Message::__construct() * @@ -449,13 +555,10 @@ bool Message_InitFromPhp(upb_msg *msg, const upb_msgdef *m, zval *init, PHP_METHOD(Message, __construct) { Message* intern = (Message*)Z_OBJ_P(getThis()); const Descriptor* desc = Descriptor_GetFromClassEntry(Z_OBJCE_P(getThis())); - const upb_msgdef *msgdef = desc->msgdef; upb_arena *arena = Arena_Get(&intern->arena); zval *init_arr = NULL; - intern->desc = desc; - intern->msg = upb_msg_new(msgdef, arena); - ObjCache_Add(intern->msg, &intern->std); + Message_Initialize(intern, desc); if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a!", &init_arr) == FAILURE) { return; @@ -801,6 +904,39 @@ PHP_METHOD(Message, whichOneof) { RETURN_STRING(field ? upb_fielddef_name(field) : ""); } +/** + * Message::hasOneof() + * + * Returns the presence of the given oneof field, given a field number. Called + * from generated code methods such as: + * + * public function hasDoubleValueOneof() + * { + * return $this->hasOneof(10); + * } + * + * @return boolean + */ +PHP_METHOD(Message, hasOneof) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + zend_long field_num; + const upb_fielddef* f; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &field_num) == FAILURE) { + return; + } + + f = upb_msgdef_itof(intern->desc->msgdef, field_num); + + if (!f || !upb_fielddef_realcontainingoneof(f)) { + php_error_docref(NULL, E_USER_ERROR, + "Internal error, no such oneof field %d\n", + (int)field_num); + } + + RETVAL_BOOL(upb_msg_has(intern->msg, f)); +} + /** * Message::readOneof() * @@ -911,6 +1047,7 @@ static zend_function_entry Message_methods[] = { PHP_ME(Message, mergeFrom, arginfo_mergeFrom, ZEND_ACC_PUBLIC) PHP_ME(Message, readWrapperValue, arginfo_read, ZEND_ACC_PROTECTED) PHP_ME(Message, writeWrapperValue, arginfo_write, ZEND_ACC_PROTECTED) + PHP_ME(Message, hasOneof, arginfo_read, ZEND_ACC_PROTECTED) PHP_ME(Message, readOneof, arginfo_read, ZEND_ACC_PROTECTED) PHP_ME(Message, writeOneof, arginfo_write, ZEND_ACC_PROTECTED) PHP_ME(Message, whichOneof, arginfo_read, ZEND_ACC_PROTECTED) @@ -918,6 +1055,260 @@ static zend_function_entry Message_methods[] = { ZEND_FE_END }; +// Well-known types //////////////////////////////////////////////////////////// + +static const char TYPE_URL_PREFIX[] = "type.googleapis.com/"; + +static upb_msgval Message_getval(Message *intern, const char *field_name) { + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, field_name); + PBPHP_ASSERT(f); + return upb_msg_get(intern->msg, f); +} + +static void Message_setval(Message *intern, const char *field_name, + upb_msgval val) { + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, field_name); + PBPHP_ASSERT(f); + return upb_msg_set(intern->msg, f, val, Arena_Get(&intern->arena)); +} + +static upb_msgval StringVal(upb_strview view) { + upb_msgval ret; + ret.str_val = view; + return ret; +} + +static bool TryStripUrlPrefix(upb_strview *str) { + size_t size = strlen(TYPE_URL_PREFIX); + if (str->size < size || memcmp(TYPE_URL_PREFIX, str->data, size) != 0) { + return false; + } + str->data += size; + str->size -= size; + return true; +} + +static bool StrViewEq(upb_strview view, const char *str) { + size_t size = strlen(str); + return view.size == size && memcmp(view.data, str, size) == 0; +} + +PHP_METHOD(google_protobuf_Any, unpack) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + upb_strview type_url = Message_getval(intern, "type_url").str_val; + upb_strview value = Message_getval(intern, "value").str_val; + upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_msgdef *m; + Descriptor *desc; + zval ret; + + // Ensure that type_url has TYPE_URL_PREFIX as a prefix. + if (!TryStripUrlPrefix(&type_url)) { + zend_throw_exception( + NULL, "Type url needs to be type.googleapis.com/fully-qualified", + 0 TSRMLS_CC); + return; + } + + m = upb_symtab_lookupmsg2(symtab, type_url.data, type_url.size); + + if (m == NULL) { + zend_throw_exception( + NULL, "Specified message in any hasn't been added to descriptor pool", + 0 TSRMLS_CC); + return; + } + + desc = Descriptor_GetFromMessageDef(m); + PBPHP_ASSERT(desc->class_entry->create_object == Message_create); + zend_object *obj = Message_create(desc->class_entry); + Message *msg = (Message*)obj; + Message_Initialize(msg, desc); + ZVAL_OBJ(&ret, obj); + + // Get value. + if (!upb_decode(value.data, value.size, msg->msg, + upb_msgdef_layout(desc->msgdef), Arena_Get(&msg->arena))) { + zend_throw_exception_ex(NULL, 0, "Error occurred during parsing"); + return; + } + + // Fuse since the parsed message could alias "value". + upb_arena_fuse(Arena_Get(&intern->arena), Arena_Get(&msg->arena)); + + RETURN_ZVAL(&ret, 1, 0); +} + +PHP_METHOD(google_protobuf_Any, pack) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + upb_arena *arena = Arena_Get(&intern->arena); + zval *val; + Message *msg; + upb_strview value; + upb_strview type_url; + const char *full_name; + char *buf; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &val) == + FAILURE) { + return; + } + + if (!instanceof_function(Z_OBJCE_P(val), message_ce)) { + zend_error(E_USER_ERROR, "Given value is not an instance of Message."); + return; + } + + msg = (Message*)Z_OBJ_P(val); + + // Serialize and set value. + value.data = upb_encode(msg->msg, upb_msgdef_layout(msg->desc->msgdef), arena, + &value.size); + Message_setval(intern, "value", StringVal(value)); + + // Set type url: type_url_prefix + fully_qualified_name + full_name = upb_msgdef_fullname(msg->desc->msgdef); + type_url.size = strlen(TYPE_URL_PREFIX) + strlen(full_name); + buf = upb_arena_malloc(arena, type_url.size + 1); + memcpy(buf, TYPE_URL_PREFIX, strlen(TYPE_URL_PREFIX)); + memcpy(buf + strlen(TYPE_URL_PREFIX), full_name, strlen(full_name)); + type_url.data = buf; + Message_setval(intern, "type_url", StringVal(type_url)); +} + +PHP_METHOD(google_protobuf_Any, is) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + upb_strview type_url = Message_getval(intern, "type_url").str_val; + zend_class_entry *klass = NULL; + const upb_msgdef *m; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "C", &klass) == + FAILURE) { + return; + } + + m = NameMap_GetMessage(klass); + + if (m == NULL) { + RETURN_BOOL(false); + } + + RETURN_BOOL(TryStripUrlPrefix(&type_url) && + StrViewEq(type_url, upb_msgdef_fullname(m))); +} + +PHP_METHOD(google_protobuf_Timestamp, fromDateTime) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + zval* datetime; + const char *classname = "\\DatetimeInterface"; + zend_string *classname_str = zend_string_init(classname, strlen(classname), 0); + zend_class_entry *date_interface_ce = zend_lookup_class(classname_str); + + if (date_interface_ce == NULL) { + zend_error(E_ERROR, "Make sure date extension is enabled."); + return; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetime, + date_interface_ce) == FAILURE) { + zend_error(E_USER_ERROR, "Expect DatetimeInterface."); + return; + } + + upb_msgval timestamp_seconds; + { + zval retval; + zval function_name; + + ZVAL_STRING(&function_name, "date_timestamp_get"); + + if (call_user_function(EG(function_table), NULL, &function_name, &retval, 1, + datetime) == FAILURE || + !Convert_PhpToUpb(&retval, ×tamp_seconds, UPB_TYPE_INT64, NULL, + NULL)) { + zend_error(E_ERROR, "Cannot get timestamp from DateTime."); + return; + } + + zval_dtor(&retval); + zval_dtor(&function_name); + } + + upb_msgval timestamp_nanos; + { + zval retval; + zval function_name; + zval format_string; + + ZVAL_STRING(&function_name, "date_format"); + ZVAL_STRING(&format_string, "u"); + + zval params[2] = { + *datetime, + format_string, + }; + + if (call_user_function(EG(function_table), NULL, &function_name, &retval, 2, + params) == FAILURE || + !Convert_PhpToUpb(&retval, ×tamp_nanos, UPB_TYPE_INT32, NULL, + NULL)) { + zend_error(E_ERROR, "Cannot format DateTime."); + return; + } + + timestamp_nanos.int32_val *= 1000; + + zval_dtor(&retval); + zval_dtor(&function_name); + zval_dtor(&format_string); + } + + Message_setval(intern, "seconds", timestamp_seconds); + Message_setval(intern, "nanos", timestamp_nanos); + + RETURN_NULL(); +} + +PHP_METHOD(google_protobuf_Timestamp, toDateTime) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + upb_msgval seconds = Message_getval(intern, "seconds"); + upb_msgval nanos = Message_getval(intern, "nanos"); + + // Get formatted time string. + char formatted_time[32]; + snprintf(formatted_time, sizeof(formatted_time), "%" PRId64 ".%06" PRId32, + seconds.int64_val, nanos.int32_val / 1000); + + // Create Datetime object. + zval datetime; + zval function_name; + zval format_string; + zval formatted_time_php; + + ZVAL_STRING(&function_name, "date_create_from_format"); + ZVAL_STRING(&format_string, "U.u"); + ZVAL_STRING(&formatted_time_php, formatted_time); + + zval params[2] = { + format_string, + formatted_time_php, + }; + + if (call_user_function(EG(function_table), NULL, &function_name, &datetime, 2, + params) == FAILURE) { + zend_error(E_ERROR, "Cannot create DateTime."); + return; + } + + zval_dtor(&function_name); + zval_dtor(&format_string); + zval_dtor(&formatted_time_php); + + ZVAL_OBJ(return_value, Z_OBJ(datetime)); +} + +#include "wkt.inc" + /** * Message_ModuleInit() * @@ -935,10 +1326,13 @@ void Message_ModuleInit() { memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); h->dtor_obj = Message_dtor; + h->compare_objects = Message_compare_objects; h->read_property = Message_read_property; h->write_property = Message_write_property; h->has_property = Message_has_property; h->unset_property = Message_unset_property; h->get_properties = Message_get_properties; h->get_property_ptr_ptr = Message_get_property_ptr_ptr; + + WellKnownTypes_ModuleInit(); /* From wkt.inc. */ } diff --git a/php/ext/google/protobuf/message.h b/php/ext/google/protobuf/message.h index 50839760164359fa7f34c2298df4f4332d442ffc..0e6fb5a4fcbe9fbbc62d6c3c202f242fde681b71 100644 --- a/php/ext/google/protobuf/message.h +++ b/php/ext/google/protobuf/message.h @@ -56,4 +56,7 @@ bool Message_GetUpbMessage(zval *val, const Descriptor *desc, upb_arena *arena, void Message_GetPhpWrapper(zval *val, const Descriptor *desc, upb_msg *msg, zval *arena); +bool ValueEq(upb_msgval val1, upb_msgval val2, upb_fieldtype_t type, + const upb_msgdef *m); + #endif // PHP_PROTOBUF_MESSAGE_H_ diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index 037fa90d9332f596abe3558c43ec28d31a904c52..557f8ffc23a7122ebb5123c3e2212e36fad60205 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -10,18 +10,18 @@ protobuf-opensource@google.com yes - 2020-08-14 - + 2020-11-12 + - 3.13.0 - 3.13.0 + 3.14.0 + 3.14.0 stable stable 3-Clause BSD License - GA release. + PHP protobuf

      @@ -29,8 +29,6 @@ - - @@ -45,6 +43,9 @@ + + + @@ -675,5 +676,79 @@ G A release. 3-Clause BSD License GA release. + + + 3.13.0.1 + 3.13.0.1 + + + stable + stable + + 2020-10-08 + + 3-Clause BSD License + GA release. + + + + 3.14.0RC1 + 3.14.0 + + + beta + beta + + 2020-11-05 + + 3-Clause BSD License + + + + + + 3.14.0RC2 + 3.14.0 + + + beta + beta + + 2020-11-10 + + 3-Clause BSD License + + + + + + 3.14.0RC3 + 3.14.0 + + + beta + beta + + 2020-11-11 + + 3-Clause BSD License + + + + + + 3.14.0 + 3.14.0 + + + stable + stable + + 2020-11-12 + + 3-Clause BSD License + + + diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index 6ce85f1e6a9bc621c1de24f9c2f73f0ec30bd696..738386890bb1872013552cd5624eab503197d59c 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -22,6 +22,15 @@ * * This file is private and must not be included by users! */ + +#if !(__STDC_VERSION__ >= 199901L || __cplusplus >= 201103L) +#error upb requires C99 or C++11 +#endif + +#if (defined(_MSC_VER) && _MSC_VER < 1900) +#error upb requires MSVC >= 2015. +#endif + #include #include @@ -70,66 +79,21 @@ #define UPB_UNLIKELY(x) (x) #endif -/* Define UPB_BIG_ENDIAN manually if you're on big endian and your compiler - * doesn't provide these preprocessor symbols. */ -#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) -#define UPB_BIG_ENDIAN -#endif - /* Macros for function attributes on compilers that support them. */ #ifdef __GNUC__ #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) #define UPB_NOINLINE __attribute__((noinline)) #define UPB_NORETURN __attribute__((__noreturn__)) +#elif defined(_MSC_VER) +#define UPB_NOINLINE +#define UPB_FORCEINLINE +#define UPB_NORETURN __declspec(noreturn) #else /* !defined(__GNUC__) */ #define UPB_FORCEINLINE #define UPB_NOINLINE #define UPB_NORETURN #endif -#if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L -/* C99/C++11 versions. */ -#include -#define _upb_snprintf snprintf -#define _upb_vsnprintf vsnprintf -#define _upb_va_copy(a, b) va_copy(a, b) -#elif defined(_MSC_VER) -/* Microsoft C/C++ versions. */ -#include -#include -#if _MSC_VER < 1900 -int msvc_snprintf(char* s, size_t n, const char* format, ...); -int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg); -#define UPB_MSVC_VSNPRINTF -#define _upb_snprintf msvc_snprintf -#define _upb_vsnprintf msvc_vsnprintf -#else -#define _upb_snprintf snprintf -#define _upb_vsnprintf vsnprintf -#endif -#define _upb_va_copy(a, b) va_copy(a, b) -#elif defined __GNUC__ -/* A few hacky workarounds for functions not in C89. - * For internal use only! - * TODO(haberman): fix these by including our own implementations, or finding - * another workaround. - */ -#define _upb_snprintf __builtin_snprintf -#define _upb_vsnprintf __builtin_vsnprintf -#define _upb_va_copy(a, b) __va_copy(a, b) -#else -#error Need implementations of [v]snprintf and va_copy -#endif - -#ifdef __cplusplus -#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || \ - (defined(_MSC_VER) && _MSC_VER >= 1900) -/* C++11 is present */ -#else -#error upb requires C++11 for C++ support -#endif -#endif - #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y)) #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y)) @@ -143,7 +107,7 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg); #elif defined _MSC_VER #define UPB_ASSUME(expr) if (!(expr)) __assume(0) #else -#define UPB_ASSUME(expr) do {} if (false && (expr)) +#define UPB_ASSUME(expr) do {} while (false && (expr)) #endif #else #define UPB_ASSUME(expr) assert(expr) @@ -157,55 +121,62 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg); #define UPB_ASSERT(expr) assert(expr) #endif -/* UPB_ASSERT_DEBUGVAR(): assert that uses functions or variables that only - * exist in debug mode. This turns into regular assert. */ -#define UPB_ASSERT_DEBUGVAR(expr) assert(expr) - #if defined(__GNUC__) || defined(__clang__) #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0) #else #define UPB_UNREACHABLE() do { assert(0); } while(0) #endif -/* UPB_INFINITY representing floating-point positive infinity. */ -#include -#ifdef INFINITY -#define UPB_INFINITY INFINITY -#else -#define UPB_INFINITY (1.0 / 0.0) +#if defined(__SANITIZE_ADDRESS__) +#define UPB_ASAN 1 +#ifdef __cplusplus +extern "C" { #endif -#ifdef NAN -#define UPB_NAN NAN -#else -#define UPB_NAN (0.0 / 0.0) +void __asan_poison_memory_region(void const volatile *addr, size_t size); +void __asan_unpoison_memory_region(void const volatile *addr, size_t size); +#ifdef __cplusplus +} /* extern "C" */ #endif +#define UPB_POISON_MEMORY_REGION(addr, size) \ + __asan_poison_memory_region((addr), (size)) +#define UPB_UNPOISON_MEMORY_REGION(addr, size) \ + __asan_unpoison_memory_region((addr), (size)) +#else +#define UPB_ASAN 0 +#define UPB_POISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#define UPB_UNPOISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#endif + #include #include +/* Must be last. */ -/* Maps descriptor type -> upb field type. */ -static const uint8_t desctype_to_fieldtype[] = { +/* Maps descriptor type -> elem_size_lg2. */ +static const uint8_t desctype_to_elem_size_lg2[] = { -1, /* invalid descriptor type */ - UPB_TYPE_DOUBLE, /* DOUBLE */ - UPB_TYPE_FLOAT, /* FLOAT */ - UPB_TYPE_INT64, /* INT64 */ - UPB_TYPE_UINT64, /* UINT64 */ - UPB_TYPE_INT32, /* INT32 */ - UPB_TYPE_UINT64, /* FIXED64 */ - UPB_TYPE_UINT32, /* FIXED32 */ - UPB_TYPE_BOOL, /* BOOL */ - UPB_TYPE_STRING, /* STRING */ - UPB_TYPE_MESSAGE, /* GROUP */ - UPB_TYPE_MESSAGE, /* MESSAGE */ - UPB_TYPE_BYTES, /* BYTES */ - UPB_TYPE_UINT32, /* UINT32 */ - UPB_TYPE_ENUM, /* ENUM */ - UPB_TYPE_INT32, /* SFIXED32 */ - UPB_TYPE_INT64, /* SFIXED64 */ - UPB_TYPE_INT32, /* SINT32 */ - UPB_TYPE_INT64, /* SINT64 */ + 3, /* DOUBLE */ + 2, /* FLOAT */ + 3, /* INT64 */ + 3, /* UINT64 */ + 2, /* INT32 */ + 3, /* FIXED64 */ + 2, /* FIXED32 */ + 0, /* BOOL */ + UPB_SIZE(3, 4), /* STRING */ + UPB_SIZE(2, 3), /* GROUP */ + UPB_SIZE(2, 3), /* MESSAGE */ + UPB_SIZE(3, 4), /* BYTES */ + 2, /* UINT32 */ + 2, /* ENUM */ + 2, /* SFIXED32 */ + 3, /* SFIXED64 */ + 2, /* SINT32 */ + 3, /* SINT64 */ }; /* Maps descriptor type -> upb map size. */ @@ -314,20 +285,22 @@ static const int8_t delim_ops[37] = { /* Data pertaining to the parse. */ typedef struct { - const char *limit; /* End of delimited region or end of buffer. */ - upb_arena *arena; + const char *end; /* Can read up to 16 bytes slop beyond this. */ + const char *limit_ptr; /* = end + UPB_MIN(limit, 0) */ + int limit; /* Submessage limit relative to end. */ int depth; uint32_t end_group; /* Set to field number of END_GROUP tag, if any. */ + bool alias; + char patch[32]; + upb_arena arena; jmp_buf err; } upb_decstate; typedef union { bool bool_val; - int32_t int32_val; - int64_t int64_val; uint32_t uint32_val; uint64_t uint64_val; - upb_strview str_val; + uint32_t size; } wireval; static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg, @@ -371,46 +344,54 @@ void decode_verifyutf8(upb_decstate *d, const char *buf, int len) { static bool decode_reserve(upb_decstate *d, upb_array *arr, size_t elem) { bool need_realloc = arr->size - arr->len < elem; - if (need_realloc && !_upb_array_realloc(arr, arr->len + elem, d->arena)) { + if (need_realloc && !_upb_array_realloc(arr, arr->len + elem, &d->arena)) { decode_err(d); } return need_realloc; } -UPB_NOINLINE -static const char *decode_longvarint64(upb_decstate *d, const char *ptr, - const char *limit, uint64_t *val) { - uint8_t byte; - int bitpos = 0; - uint64_t out = 0; - - do { - if (bitpos >= 70 || ptr == limit) decode_err(d); - byte = *ptr; - out |= (uint64_t)(byte & 0x7F) << bitpos; - ptr++; - bitpos += 7; - } while (byte & 0x80); +typedef struct { + const char *ptr; + uint64_t val; +} decode_vret; - *val = out; - return ptr; +UPB_NOINLINE +static decode_vret decode_longvarint64(const char *ptr, uint64_t val) { + decode_vret ret = {NULL, 0}; + uint64_t byte; + int i; + for (i = 1; i < 10; i++) { + byte = (uint8_t)ptr[i]; + val += (byte - 1) << (i * 7); + if (!(byte & 0x80)) { + ret.ptr = ptr + i + 1; + ret.val = val; + return ret; + } + } + return ret; } UPB_FORCEINLINE static const char *decode_varint64(upb_decstate *d, const char *ptr, - const char *limit, uint64_t *val) { - if (UPB_LIKELY(ptr < limit && (*ptr & 0x80) == 0)) { - *val = (uint8_t)*ptr; + uint64_t *val) { + uint64_t byte = (uint8_t)*ptr; + if (UPB_LIKELY((byte & 0x80) == 0)) { + *val = byte; return ptr + 1; } else { - return decode_longvarint64(d, ptr, limit, val); + decode_vret res = decode_longvarint64(ptr, byte); + if (!res.ptr) decode_err(d); + *val = res.val; + return res.ptr; } } +UPB_FORCEINLINE static const char *decode_varint32(upb_decstate *d, const char *ptr, - const char *limit, uint32_t *val) { + uint32_t *val) { uint64_t u64; - ptr = decode_varint64(d, ptr, limit, &u64); + ptr = decode_varint64(d, ptr, &u64); if (u64 > UINT32_MAX) decode_err(d); *val = (uint32_t)u64; return ptr; @@ -423,14 +404,21 @@ static void decode_munge(int type, wireval *val) { break; case UPB_DESCRIPTOR_TYPE_SINT32: { uint32_t n = val->uint32_val; - val->int32_val = (n >> 1) ^ -(int32_t)(n & 1); + val->uint32_val = (n >> 1) ^ -(int32_t)(n & 1); break; } case UPB_DESCRIPTOR_TYPE_SINT64: { uint64_t n = val->uint64_val; - val->int64_val = (n >> 1) ^ -(int64_t)(n & 1); + val->uint64_val = (n >> 1) ^ -(int64_t)(n & 1); break; } + case UPB_DESCRIPTOR_TYPE_INT32: + case UPB_DESCRIPTOR_TYPE_UINT32: + if (!_upb_isle()) { + /* The next stage will memcpy(dst, &val, 4) */ + val->uint32_val = val->uint64_val; + } + break; } } @@ -453,20 +441,85 @@ static const upb_msglayout_field *upb_find_field(const upb_msglayout *l, static upb_msg *decode_newsubmsg(upb_decstate *d, const upb_msglayout *layout, const upb_msglayout_field *field) { const upb_msglayout *subl = layout->submsgs[field->submsg_index]; - return _upb_msg_new(subl, d->arena); + return _upb_msg_new_inl(subl, &d->arena); +} + +static int decode_pushlimit(upb_decstate *d, const char *ptr, int size) { + int limit = size + (int)(ptr - d->end); + int delta = d->limit - limit; + d->limit = limit; + d->limit_ptr = d->end + UPB_MIN(0, limit); + return delta; +} + +static void decode_poplimit(upb_decstate *d, int saved_delta) { + d->limit += saved_delta; + d->limit_ptr = d->end + UPB_MIN(0, d->limit); +} + +typedef struct { + bool ok; + const char *ptr; +} decode_doneret; + +UPB_NOINLINE +static const char *decode_isdonefallback(upb_decstate *d, const char *ptr, + int overrun) { + if (overrun < d->limit) { + /* Need to copy remaining data into patch buffer. */ + UPB_ASSERT(overrun < 16); + memset(d->patch + 16, 0, 16); + memcpy(d->patch, d->end, 16); + ptr = &d->patch[0] + overrun; + d->end = &d->patch[16]; + d->limit -= 16; + d->limit_ptr = d->end + d->limit; + d->alias = false; + UPB_ASSERT(ptr < d->limit_ptr); + return ptr; + } else { + decode_err(d); + } +} + +UPB_FORCEINLINE +static bool decode_isdone(upb_decstate *d, const char **ptr) { + int overrun = *ptr - d->end; + if (UPB_LIKELY(*ptr < d->limit_ptr)) { + return false; + } else if (UPB_LIKELY(overrun == d->limit)) { + return true; + } else { + *ptr = decode_isdonefallback(d, *ptr, overrun); + return false; + } +} + +static const char *decode_readstr(upb_decstate *d, const char *ptr, int size, + upb_strview *str) { + if (d->alias) { + str->data = ptr; + } else { + char *data = upb_arena_malloc(&d->arena, size); + if (!data) decode_err(d); + memcpy(data, ptr, size); + str->data = data; + } + str->size = size; + return ptr + size; } -static void decode_tosubmsg(upb_decstate *d, upb_msg *submsg, - const upb_msglayout *layout, - const upb_msglayout_field *field, upb_strview val) { +static const char *decode_tosubmsg(upb_decstate *d, const char *ptr, + upb_msg *submsg, const upb_msglayout *layout, + const upb_msglayout_field *field, int size) { const upb_msglayout *subl = layout->submsgs[field->submsg_index]; - const char *saved_limit = d->limit; + int saved_delta = decode_pushlimit(d, ptr, size); if (--d->depth < 0) decode_err(d); - d->limit = val.data + val.size; - decode_msg(d, val.data, submsg, subl); - d->limit = saved_limit; + ptr = decode_msg(d, ptr, submsg, subl); + decode_poplimit(d, saved_delta); if (d->end_group != 0) decode_err(d); d->depth++; + return ptr; } static const char *decode_group(upb_decstate *d, const char *ptr, @@ -495,15 +548,15 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr, upb_array *arr = *arrp; void *mem; - if (!arr) { - upb_fieldtype_t type = desctype_to_fieldtype[field->descriptortype]; - arr = _upb_array_new(d->arena, type); + if (arr) { + decode_reserve(d, arr, 1); + } else { + size_t lg2 = desctype_to_elem_size_lg2[field->descriptortype]; + arr = _upb_array_new(&d->arena, 4, lg2); if (!arr) decode_err(d); *arrp = arr; } - decode_reserve(d, arr, 1); - switch (op) { case OP_SCALAR_LG2(0): case OP_SCALAR_LG2(2): @@ -514,15 +567,14 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr, memcpy(mem, &val, 1 << op); return ptr; case OP_STRING: - decode_verifyutf8(d, val.str_val.data, val.str_val.size); + decode_verifyutf8(d, ptr, val.size); /* Fallthrough. */ - case OP_BYTES: + case OP_BYTES: { /* Append bytes. */ - mem = - UPB_PTR_AT(_upb_array_ptr(arr), arr->len * sizeof(upb_strview), void); + upb_strview *str = (upb_strview*)_upb_array_ptr(arr) + arr->len; arr->len++; - memcpy(mem, &val, sizeof(upb_strview)); - return ptr; + return decode_readstr(d, ptr, val.size, str); + } case OP_SUBMSG: { /* Append submessage / group. */ upb_msg *submsg = decode_newsubmsg(d, layout, field); @@ -530,26 +582,25 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr, submsg; arr->len++; if (UPB_UNLIKELY(field->descriptortype == UPB_DTYPE_GROUP)) { - ptr = decode_togroup(d, ptr, submsg, layout, field); + return decode_togroup(d, ptr, submsg, layout, field); } else { - decode_tosubmsg(d, submsg, layout, field, val.str_val); + return decode_tosubmsg(d, ptr, submsg, layout, field, val.size); } - return ptr; } case OP_FIXPCK_LG2(2): case OP_FIXPCK_LG2(3): { /* Fixed packed. */ int lg2 = op - OP_FIXPCK_LG2(0); int mask = (1 << lg2) - 1; - size_t count = val.str_val.size >> lg2; - if ((val.str_val.size & mask) != 0) { + size_t count = val.size >> lg2; + if ((val.size & mask) != 0) { decode_err(d); /* Length isn't a round multiple of elem size. */ } decode_reserve(d, arr, count); mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void); arr->len += count; - memcpy(mem, val.str_val.data, val.str_val.size); - return ptr; + memcpy(mem, ptr, val.size); /* XXX: ptr boundary. */ + return ptr + val.size; } case OP_VARPCK_LG2(0): case OP_VARPCK_LG2(2): @@ -557,12 +608,11 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr, /* Varint packed. */ int lg2 = op - OP_VARPCK_LG2(0); int scale = 1 << lg2; - const char *ptr = val.str_val.data; - const char *end = ptr + val.str_val.size; + int saved_limit = decode_pushlimit(d, ptr, val.size); char *out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void); - while (ptr < end) { + while (!decode_isdone(d, &ptr)) { wireval elem; - ptr = decode_varint64(d, ptr, end, &elem.uint64_val); + ptr = decode_varint64(d, ptr, &elem.uint64_val); decode_munge(field->descriptortype, &elem); if (decode_reserve(d, arr, 1)) { out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void); @@ -571,7 +621,7 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr, memcpy(out, &elem, scale); out += scale; } - if (ptr != end) decode_err(d); + decode_poplimit(d, saved_limit); return ptr; } default: @@ -579,9 +629,9 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr, } } -static void decode_tomap(upb_decstate *d, upb_msg *msg, - const upb_msglayout *layout, - const upb_msglayout_field *field, wireval val) { +static const char *decode_tomap(upb_decstate *d, const char *ptr, upb_msg *msg, + const upb_msglayout *layout, + const upb_msglayout_field *field, wireval val) { upb_map **map_p = UPB_PTR_AT(msg, field->offset, upb_map *); upb_map *map = *map_p; upb_map_entry ent; @@ -596,7 +646,7 @@ static void decode_tomap(upb_decstate *d, upb_msg *msg, char val_size = desctype_to_mapsize[val_field->descriptortype]; UPB_ASSERT(key_field->offset == 0); UPB_ASSERT(val_field->offset == sizeof(upb_strview)); - map = _upb_map_new(d->arena, key_size, val_size); + map = _upb_map_new(&d->arena, key_size, val_size); *map_p = map; } @@ -606,13 +656,12 @@ static void decode_tomap(upb_decstate *d, upb_msg *msg, if (entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE || entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_GROUP) { /* Create proactively to handle the case where it doesn't appear. */ - ent.v.val.val = (uint64_t)_upb_msg_new(entry->submsgs[0], d->arena); + ent.v.val = upb_value_ptr(_upb_msg_new(entry->submsgs[0], &d->arena)); } - decode_tosubmsg(d, &ent.k, layout, field, val.str_val); - - /* Insert into map. */ - _upb_map_set(map, &ent.k, map->key_size, &ent.v, map->val_size, d->arena); + ptr = decode_tosubmsg(d, ptr, &ent.k, layout, field, val.size); + _upb_map_set(map, &ent.k, map->key_size, &ent.v, map->val_size, &d->arena); + return ptr; } static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg, @@ -646,16 +695,15 @@ static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg, if (UPB_UNLIKELY(type == UPB_DTYPE_GROUP)) { ptr = decode_togroup(d, ptr, submsg, layout, field); } else { - decode_tosubmsg(d, submsg, layout, field, val.str_val); + ptr = decode_tosubmsg(d, ptr, submsg, layout, field, val.size); } break; } case OP_STRING: - decode_verifyutf8(d, val.str_val.data, val.str_val.size); + decode_verifyutf8(d, ptr, val.size); /* Fallthrough. */ case OP_BYTES: - memcpy(mem, &val, sizeof(upb_strview)); - break; + return decode_readstr(d, ptr, val.size, mem); case OP_SCALAR_LG2(3): memcpy(mem, &val, 8); break; @@ -674,7 +722,7 @@ static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg, static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg, const upb_msglayout *layout) { - while (ptr < d->limit) { + while (!decode_isdone(d, &ptr)) { uint32_t tag; const upb_msglayout_field *field; int field_number; @@ -683,7 +731,7 @@ static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg, wireval val; int op; - ptr = decode_varint32(d, ptr, d->limit, &tag); + ptr = decode_varint32(d, ptr, &tag); field_number = tag >> 3; wire_type = tag & 7; @@ -691,40 +739,37 @@ static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg, switch (wire_type) { case UPB_WIRE_TYPE_VARINT: - ptr = decode_varint64(d, ptr, d->limit, &val.uint64_val); + ptr = decode_varint64(d, ptr, &val.uint64_val); op = varint_ops[field->descriptortype]; decode_munge(field->descriptortype, &val); break; case UPB_WIRE_TYPE_32BIT: - if (d->limit - ptr < 4) decode_err(d); - memcpy(&val, ptr, 4); + memcpy(&val.uint32_val, ptr, 4); + val.uint32_val = _upb_be_swap32(val.uint32_val); ptr += 4; op = OP_SCALAR_LG2(2); if (((1 << field->descriptortype) & fixed32_ok) == 0) goto unknown; break; case UPB_WIRE_TYPE_64BIT: - if (d->limit - ptr < 8) decode_err(d); - memcpy(&val, ptr, 8); + memcpy(&val.uint64_val, ptr, 8); + val.uint64_val = _upb_be_swap64(val.uint64_val); ptr += 8; op = OP_SCALAR_LG2(3); if (((1 << field->descriptortype) & fixed64_ok) == 0) goto unknown; break; case UPB_WIRE_TYPE_DELIMITED: { - uint32_t size; int ndx = field->descriptortype; if (_upb_isrepeated(field)) ndx += 18; - ptr = decode_varint32(d, ptr, d->limit, &size); - if (size >= INT32_MAX || (size_t)(d->limit - ptr) < size) { + ptr = decode_varint32(d, ptr, &val.size); + if (val.size >= INT32_MAX || + ptr - d->end + (int32_t)val.size > d->limit) { decode_err(d); /* Length overflow. */ } - val.str_val.data = ptr; - val.str_val.size = size; - ptr += size; op = delim_ops[ndx]; break; } case UPB_WIRE_TYPE_START_GROUP: - val.int32_val = field_number; + val.uint32_val = field_number; op = OP_SUBMSG; if (field->descriptortype != UPB_DTYPE_GROUP) goto unknown; break; @@ -743,7 +788,7 @@ static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg, ptr = decode_toarray(d, ptr, msg, layout, field, val, op); break; case _UPB_LABEL_MAP: - decode_tomap(d, msg, layout, field, val); + ptr = decode_tomap(d, ptr, msg, layout, field, val); break; default: ptr = decode_tomsg(d, ptr, msg, layout, field, val, op); @@ -757,32 +802,55 @@ static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg, ptr = decode_group(d, ptr, NULL, NULL, field_number); } if (msg) { + if (wire_type == UPB_WIRE_TYPE_DELIMITED) ptr += val.size; if (!_upb_msg_addunknown(msg, field_start, ptr - field_start, - d->arena)) { + &d->arena)) { decode_err(d); } } } } - if (ptr != d->limit) decode_err(d); return ptr; } bool upb_decode(const char *buf, size_t size, void *msg, const upb_msglayout *l, upb_arena *arena) { + bool ok; upb_decstate state; - state.limit = buf + size; - state.arena = arena; + + if (size == 0) { + return true; + } else if (size < 16) { + memset(&state.patch, 0, 32); + memcpy(&state.patch, buf, size); + buf = state.patch; + state.end = buf + size; + state.limit = 0; + state.alias = false; + } else { + state.end = buf + size - 16; + state.limit = 16; + state.alias = true; + } + + state.limit_ptr = state.end; state.depth = 64; state.end_group = 0; + state.arena.head = arena->head; + state.arena.last_size = arena->last_size; + state.arena.parent = arena; - if (setjmp(state.err)) return false; - - if (size == 0) return true; - decode_msg(&state, buf, msg, l); + if (UPB_UNLIKELY(setjmp(state.err))) { + ok = false; + } else { + decode_msg(&state, buf, msg, l); + ok = state.end_group == 0; + } - return state.end_group == 0; + arena->head.ptr = state.arena.head.ptr; + arena->head.end = state.arena.head.end; + return ok; } #undef OP_SCALAR_LG2 @@ -793,30 +861,30 @@ bool upb_decode(const char *buf, size_t size, void *msg, const upb_msglayout *l, /* We encode backwards, to avoid pre-computing lengths (one-pass encode). */ +#include #include #define UPB_PB_VARINT_MAX_LEN 10 -#define CHK(x) do { if (!(x)) { return false; } } while(0) -static size_t upb_encode_varint(uint64_t val, char *buf) { - size_t i; - if (val < 128) { buf[0] = val; return 1; } - i = 0; - while (val) { +UPB_NOINLINE +static size_t encode_varint64(uint64_t val, char *buf) { + size_t i = 0; + do { uint8_t byte = val & 0x7fU; val >>= 7; if (val) byte |= 0x80U; buf[i++] = byte; - } + } while (val); return i; } -static uint32_t upb_zzencode_32(int32_t n) { return ((uint32_t)n << 1) ^ (n >> 31); } -static uint64_t upb_zzencode_64(int64_t n) { return ((uint64_t)n << 1) ^ (n >> 63); } +static uint32_t encode_zz32(int32_t n) { return ((uint32_t)n << 1) ^ (n >> 31); } +static uint64_t encode_zz64(int64_t n) { return ((uint64_t)n << 1) ^ (n >> 63); } typedef struct { + jmp_buf err; upb_alloc *alloc; char *buf, *ptr, *limit; } upb_encstate; @@ -829,11 +897,15 @@ static size_t upb_roundup_pow2(size_t bytes) { return ret; } -static bool upb_encode_growbuffer(upb_encstate *e, size_t bytes) { +UPB_NORETURN static void encode_err(upb_encstate *e) { longjmp(e->err, 1); } + +UPB_NOINLINE +static void encode_growbuffer(upb_encstate *e, size_t bytes) { size_t old_size = e->limit - e->buf; size_t new_size = upb_roundup_pow2(bytes + (e->limit - e->ptr)); char *new_buf = upb_realloc(e->alloc, e->buf, old_size, new_size); - CHK(new_buf); + + if (!new_buf) encode_err(e); /* We want previous data at the end, realloc() put it at the beginning. */ if (old_size > 0) { @@ -843,99 +915,115 @@ static bool upb_encode_growbuffer(upb_encstate *e, size_t bytes) { e->ptr = new_buf + new_size - (e->limit - e->ptr); e->limit = new_buf + new_size; e->buf = new_buf; - return true; + + e->ptr -= bytes; } /* Call to ensure that at least "bytes" bytes are available for writing at * e->ptr. Returns false if the bytes could not be allocated. */ -static bool upb_encode_reserve(upb_encstate *e, size_t bytes) { - CHK(UPB_LIKELY((size_t)(e->ptr - e->buf) >= bytes) || - upb_encode_growbuffer(e, bytes)); +UPB_FORCEINLINE +static void encode_reserve(upb_encstate *e, size_t bytes) { + if ((size_t)(e->ptr - e->buf) < bytes) { + encode_growbuffer(e, bytes); + return; + } e->ptr -= bytes; - return true; } /* Writes the given bytes to the buffer, handling reserve/advance. */ -static bool upb_put_bytes(upb_encstate *e, const void *data, size_t len) { - if (len == 0) return true; - CHK(upb_encode_reserve(e, len)); +static void encode_bytes(upb_encstate *e, const void *data, size_t len) { + if (len == 0) return; /* memcpy() with zero size is UB */ + encode_reserve(e, len); memcpy(e->ptr, data, len); - return true; } -static bool upb_put_fixed64(upb_encstate *e, uint64_t val) { - /* TODO(haberman): byte-swap for big endian. */ - return upb_put_bytes(e, &val, sizeof(uint64_t)); +static void encode_fixed64(upb_encstate *e, uint64_t val) { + val = _upb_be_swap64(val); + encode_bytes(e, &val, sizeof(uint64_t)); } -static bool upb_put_fixed32(upb_encstate *e, uint32_t val) { - /* TODO(haberman): byte-swap for big endian. */ - return upb_put_bytes(e, &val, sizeof(uint32_t)); +static void encode_fixed32(upb_encstate *e, uint32_t val) { + val = _upb_be_swap32(val); + encode_bytes(e, &val, sizeof(uint32_t)); } -static bool upb_put_varint(upb_encstate *e, uint64_t val) { +UPB_NOINLINE +static void encode_longvarint(upb_encstate *e, uint64_t val) { size_t len; char *start; - CHK(upb_encode_reserve(e, UPB_PB_VARINT_MAX_LEN)); - len = upb_encode_varint(val, e->ptr); + + encode_reserve(e, UPB_PB_VARINT_MAX_LEN); + len = encode_varint64(val, e->ptr); start = e->ptr + UPB_PB_VARINT_MAX_LEN - len; memmove(start, e->ptr, len); e->ptr = start; - return true; } -static bool upb_put_double(upb_encstate *e, double d) { +UPB_FORCEINLINE +static void encode_varint(upb_encstate *e, uint64_t val) { + if (val < 128 && e->ptr != e->buf) { + --e->ptr; + *e->ptr = val; + } else { + encode_longvarint(e, val); + } +} + +static void encode_double(upb_encstate *e, double d) { uint64_t u64; UPB_ASSERT(sizeof(double) == sizeof(uint64_t)); memcpy(&u64, &d, sizeof(uint64_t)); - return upb_put_fixed64(e, u64); + encode_fixed64(e, u64); } -static bool upb_put_float(upb_encstate *e, float d) { +static void encode_float(upb_encstate *e, float d) { uint32_t u32; UPB_ASSERT(sizeof(float) == sizeof(uint32_t)); memcpy(&u32, &d, sizeof(uint32_t)); - return upb_put_fixed32(e, u32); + encode_fixed32(e, u32); } -static bool upb_put_tag(upb_encstate *e, int field_number, int wire_type) { - return upb_put_varint(e, (field_number << 3) | wire_type); +static void encode_tag(upb_encstate *e, int field_number, int wire_type) { + encode_varint(e, (field_number << 3) | wire_type); } -static bool upb_put_fixedarray(upb_encstate *e, const upb_array *arr, +static void encode_fixedarray(upb_encstate *e, const upb_array *arr, size_t elem_size, uint32_t tag) { size_t bytes = arr->len * elem_size; const char* data = _upb_array_constptr(arr); const char* ptr = data + bytes - elem_size; if (tag) { while (true) { - CHK(upb_put_bytes(e, ptr, elem_size) && upb_put_varint(e, tag)); + encode_bytes(e, ptr, elem_size); + encode_varint(e, tag); if (ptr == data) break; ptr -= elem_size; } - return true; } else { - return upb_put_bytes(e, data, bytes) && upb_put_varint(e, bytes); + encode_bytes(e, data, bytes); } } -bool upb_encode_message(upb_encstate *e, const char *msg, - const upb_msglayout *m, size_t *size); +static void encode_message(upb_encstate *e, const char *msg, + const upb_msglayout *m, size_t *size); -static bool upb_encode_scalarfield(upb_encstate *e, const void *_field_mem, - const upb_msglayout *m, - const upb_msglayout_field *f, - bool skip_zero_value) { +static void encode_scalar(upb_encstate *e, const void *_field_mem, + const upb_msglayout *m, const upb_msglayout_field *f, + bool skip_zero_value) { const char *field_mem = _field_mem; -#define CASE(ctype, type, wire_type, encodeval) do { \ - ctype val = *(ctype*)field_mem; \ - if (skip_zero_value && val == 0) { \ - return true; \ - } \ - return upb_put_ ## type(e, encodeval) && \ - upb_put_tag(e, f->number, wire_type); \ -} while(0) + int wire_type; + +#define CASE(ctype, type, wtype, encodeval) \ + { \ + ctype val = *(ctype *)field_mem; \ + if (skip_zero_value && val == 0) { \ + return; \ + } \ + encode_##type(e, encodeval); \ + wire_type = wtype; \ + break; \ + } switch (f->descriptortype) { case UPB_DESCRIPTOR_TYPE_DOUBLE: @@ -959,90 +1047,91 @@ static bool upb_encode_scalarfield(upb_encstate *e, const void *_field_mem, case UPB_DESCRIPTOR_TYPE_BOOL: CASE(bool, varint, UPB_WIRE_TYPE_VARINT, val); case UPB_DESCRIPTOR_TYPE_SINT32: - CASE(int32_t, varint, UPB_WIRE_TYPE_VARINT, upb_zzencode_32(val)); + CASE(int32_t, varint, UPB_WIRE_TYPE_VARINT, encode_zz32(val)); case UPB_DESCRIPTOR_TYPE_SINT64: - CASE(int64_t, varint, UPB_WIRE_TYPE_VARINT, upb_zzencode_64(val)); + CASE(int64_t, varint, UPB_WIRE_TYPE_VARINT, encode_zz64(val)); case UPB_DESCRIPTOR_TYPE_STRING: case UPB_DESCRIPTOR_TYPE_BYTES: { upb_strview view = *(upb_strview*)field_mem; if (skip_zero_value && view.size == 0) { - return true; + return; } - return upb_put_bytes(e, view.data, view.size) && - upb_put_varint(e, view.size) && - upb_put_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED); + encode_bytes(e, view.data, view.size); + encode_varint(e, view.size); + wire_type = UPB_WIRE_TYPE_DELIMITED; + break; } case UPB_DESCRIPTOR_TYPE_GROUP: { size_t size; void *submsg = *(void **)field_mem; const upb_msglayout *subm = m->submsgs[f->submsg_index]; if (submsg == NULL) { - return true; + return; } - return upb_put_tag(e, f->number, UPB_WIRE_TYPE_END_GROUP) && - upb_encode_message(e, submsg, subm, &size) && - upb_put_tag(e, f->number, UPB_WIRE_TYPE_START_GROUP); + encode_tag(e, f->number, UPB_WIRE_TYPE_END_GROUP); + encode_message(e, submsg, subm, &size); + wire_type = UPB_WIRE_TYPE_START_GROUP; + break; } case UPB_DESCRIPTOR_TYPE_MESSAGE: { size_t size; void *submsg = *(void **)field_mem; const upb_msglayout *subm = m->submsgs[f->submsg_index]; if (submsg == NULL) { - return true; + return; } - return upb_encode_message(e, submsg, subm, &size) && - upb_put_varint(e, size) && - upb_put_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED); + encode_message(e, submsg, subm, &size); + encode_varint(e, size); + wire_type = UPB_WIRE_TYPE_DELIMITED; + break; } + default: + UPB_UNREACHABLE(); } #undef CASE - UPB_UNREACHABLE(); + + encode_tag(e, f->number, wire_type); } -static bool upb_encode_array(upb_encstate *e, const char *field_mem, - const upb_msglayout *m, - const upb_msglayout_field *f) { +static void encode_array(upb_encstate *e, const char *field_mem, + const upb_msglayout *m, const upb_msglayout_field *f) { const upb_array *arr = *(const upb_array**)field_mem; bool packed = f->label == _UPB_LABEL_PACKED; + size_t pre_len = e->limit - e->ptr; if (arr == NULL || arr->len == 0) { - return true; + return; } #define VARINT_CASE(ctype, encode) \ { \ const ctype *start = _upb_array_constptr(arr); \ const ctype *ptr = start + arr->len; \ - size_t pre_len = e->limit - e->ptr; \ uint32_t tag = packed ? 0 : (f->number << 3) | UPB_WIRE_TYPE_VARINT; \ do { \ ptr--; \ - CHK(upb_put_varint(e, encode)); \ - if (tag) CHK(upb_put_varint(e, tag)); \ + encode_varint(e, encode); \ + if (tag) encode_varint(e, tag); \ } while (ptr != start); \ - if (!tag) CHK(upb_put_varint(e, e->limit - e->ptr - pre_len)); \ } \ - break; \ - do { \ - ; \ - } while (0) + break; #define TAG(wire_type) (packed ? 0 : (f->number << 3 | wire_type)) switch (f->descriptortype) { case UPB_DESCRIPTOR_TYPE_DOUBLE: - CHK(upb_put_fixedarray(e, arr, sizeof(double), TAG(UPB_WIRE_TYPE_64BIT))); + encode_fixedarray(e, arr, sizeof(double), TAG(UPB_WIRE_TYPE_64BIT)); break; case UPB_DESCRIPTOR_TYPE_FLOAT: - CHK(upb_put_fixedarray(e, arr, sizeof(float), TAG(UPB_WIRE_TYPE_32BIT))); + encode_fixedarray(e, arr, sizeof(float), TAG(UPB_WIRE_TYPE_32BIT)); break; case UPB_DESCRIPTOR_TYPE_SFIXED64: case UPB_DESCRIPTOR_TYPE_FIXED64: - CHK(upb_put_fixedarray(e, arr, sizeof(uint64_t), TAG(UPB_WIRE_TYPE_64BIT))); + encode_fixedarray(e, arr, sizeof(uint64_t), TAG(UPB_WIRE_TYPE_64BIT)); break; case UPB_DESCRIPTOR_TYPE_FIXED32: case UPB_DESCRIPTOR_TYPE_SFIXED32: - CHK(upb_put_fixedarray(e, arr, sizeof(uint32_t), TAG(UPB_WIRE_TYPE_32BIT))); + encode_fixedarray(e, arr, sizeof(uint32_t), TAG(UPB_WIRE_TYPE_32BIT)); break; case UPB_DESCRIPTOR_TYPE_INT64: case UPB_DESCRIPTOR_TYPE_UINT64: @@ -1055,20 +1144,20 @@ static bool upb_encode_array(upb_encstate *e, const char *field_mem, case UPB_DESCRIPTOR_TYPE_BOOL: VARINT_CASE(bool, *ptr); case UPB_DESCRIPTOR_TYPE_SINT32: - VARINT_CASE(int32_t, upb_zzencode_32(*ptr)); + VARINT_CASE(int32_t, encode_zz32(*ptr)); case UPB_DESCRIPTOR_TYPE_SINT64: - VARINT_CASE(int64_t, upb_zzencode_64(*ptr)); + VARINT_CASE(int64_t, encode_zz64(*ptr)); case UPB_DESCRIPTOR_TYPE_STRING: case UPB_DESCRIPTOR_TYPE_BYTES: { const upb_strview *start = _upb_array_constptr(arr); const upb_strview *ptr = start + arr->len; do { ptr--; - CHK(upb_put_bytes(e, ptr->data, ptr->size) && - upb_put_varint(e, ptr->size) && - upb_put_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED)); + encode_bytes(e, ptr->data, ptr->size); + encode_varint(e, ptr->size); + encode_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED); } while (ptr != start); - return true; + return; } case UPB_DESCRIPTOR_TYPE_GROUP: { const void *const*start = _upb_array_constptr(arr); @@ -1077,11 +1166,11 @@ static bool upb_encode_array(upb_encstate *e, const char *field_mem, do { size_t size; ptr--; - CHK(upb_put_tag(e, f->number, UPB_WIRE_TYPE_END_GROUP) && - upb_encode_message(e, *ptr, subm, &size) && - upb_put_tag(e, f->number, UPB_WIRE_TYPE_START_GROUP)); + encode_tag(e, f->number, UPB_WIRE_TYPE_END_GROUP); + encode_message(e, *ptr, subm, &size); + encode_tag(e, f->number, UPB_WIRE_TYPE_START_GROUP); } while (ptr != start); - return true; + return; } case UPB_DESCRIPTOR_TYPE_MESSAGE: { const void *const*start = _upb_array_constptr(arr); @@ -1090,31 +1179,30 @@ static bool upb_encode_array(upb_encstate *e, const char *field_mem, do { size_t size; ptr--; - CHK(upb_encode_message(e, *ptr, subm, &size) && - upb_put_varint(e, size) && - upb_put_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED)); + encode_message(e, *ptr, subm, &size); + encode_varint(e, size); + encode_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED); } while (ptr != start); - return true; + return; } } #undef VARINT_CASE if (packed) { - CHK(upb_put_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED)); + encode_varint(e, e->limit - e->ptr - pre_len); + encode_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED); } - return true; } -static bool upb_encode_map(upb_encstate *e, const char *field_mem, - const upb_msglayout *m, - const upb_msglayout_field *f) { +static void encode_map(upb_encstate *e, const char *field_mem, + const upb_msglayout *m, const upb_msglayout_field *f) { const upb_map *map = *(const upb_map**)field_mem; const upb_msglayout *entry = m->submsgs[f->submsg_index]; const upb_msglayout_field *key_field = &entry->fields[0]; const upb_msglayout_field *val_field = &entry->fields[1]; upb_strtable_iter i; if (map == NULL) { - return true; + return; } upb_strtable_begin(&i, &map->table); @@ -1126,59 +1214,57 @@ static bool upb_encode_map(upb_encstate *e, const char *field_mem, upb_map_entry ent; _upb_map_fromkey(key, &ent.k, map->key_size); _upb_map_fromvalue(val, &ent.v, map->val_size); - CHK(upb_encode_scalarfield(e, &ent.v, entry, val_field, false)); - CHK(upb_encode_scalarfield(e, &ent.k, entry, key_field, false)); + encode_scalar(e, &ent.v, entry, val_field, false); + encode_scalar(e, &ent.k, entry, key_field, false); size = (e->limit - e->ptr) - pre_len; - CHK(upb_put_varint(e, size)); - CHK(upb_put_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED)); + encode_varint(e, size); + encode_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED); } - - return true; } +static void encode_scalarfield(upb_encstate *e, const char *msg, + const upb_msglayout *m, + const upb_msglayout_field *f) { + bool skip_empty = false; + if (f->presence == 0) { + /* Proto3 presence. */ + skip_empty = true; + } else if (f->presence > 0) { + /* Proto2 presence: hasbit. */ + if (!_upb_hasbit_field(msg, f)) return; + } else { + /* Field is in a oneof. */ + if (_upb_getoneofcase_field(msg, f) != f->number) return; + } + encode_scalar(e, msg + f->offset, m, f, skip_empty); +} -bool upb_encode_message(upb_encstate *e, const char *msg, - const upb_msglayout *m, size_t *size) { - int i; +static void encode_message(upb_encstate *e, const char *msg, + const upb_msglayout *m, size_t *size) { size_t pre_len = e->limit - e->ptr; const char *unknown; size_t unknown_size; + const upb_msglayout_field *f = &m->fields[m->field_count]; + const upb_msglayout_field *first = &m->fields[0]; unknown = upb_msg_getunknown(msg, &unknown_size); if (unknown) { - upb_put_bytes(e, unknown, unknown_size); + encode_bytes(e, unknown, unknown_size); } - for (i = m->field_count - 1; i >= 0; i--) { - const upb_msglayout_field *f = &m->fields[i]; - + while (f != first) { + f--; if (_upb_isrepeated(f)) { - CHK(upb_encode_array(e, msg + f->offset, m, f)); + encode_array(e, msg + f->offset, m, f); } else if (f->label == _UPB_LABEL_MAP) { - CHK(upb_encode_map(e, msg + f->offset, m, f)); + encode_map(e, msg + f->offset, m, f); } else { - bool skip_empty = false; - if (f->presence == 0) { - /* Proto3 presence. */ - skip_empty = true; - } else if (f->presence > 0) { - /* Proto2 presence: hasbit. */ - if (!_upb_hasbit_field(msg, f)) { - continue; - } - } else { - /* Field is in a oneof. */ - if (_upb_getoneofcase_field(msg, f) != f->number) { - continue; - } - } - CHK(upb_encode_scalarfield(e, msg + f->offset, m, f, skip_empty)); + encode_scalarfield(e, msg, m, f); } } *size = (e->limit - e->ptr) - pre_len; - return true; } char *upb_encode(const void *msg, const upb_msglayout *m, upb_arena *arena, @@ -1189,11 +1275,13 @@ char *upb_encode(const void *msg, const upb_msglayout *m, upb_arena *arena, e.limit = NULL; e.ptr = NULL; - if (!upb_encode_message(&e, msg, m, size)) { + if (setjmp(e.err)) { *size = 0; return NULL; } + encode_message(&e, msg, m, size); + *size = e.limit - e.ptr; if (*size == 0) { @@ -1205,113 +1293,72 @@ char *upb_encode(const void *msg, const upb_msglayout *m, upb_arena *arena, } } -#undef CHK - /** upb_msg *******************************************************************/ -static const char _upb_fieldtype_to_sizelg2[12] = { - 0, - 0, /* UPB_TYPE_BOOL */ - 2, /* UPB_TYPE_FLOAT */ - 2, /* UPB_TYPE_INT32 */ - 2, /* UPB_TYPE_UINT32 */ - 2, /* UPB_TYPE_ENUM */ - UPB_SIZE(2, 3), /* UPB_TYPE_MESSAGE */ - 3, /* UPB_TYPE_DOUBLE */ - 3, /* UPB_TYPE_INT64 */ - 3, /* UPB_TYPE_UINT64 */ - UPB_SIZE(3, 4), /* UPB_TYPE_STRING */ - UPB_SIZE(3, 4), /* UPB_TYPE_BYTES */ -}; - -static uintptr_t tag_arrptr(void* ptr, int elem_size_lg2) { - UPB_ASSERT(elem_size_lg2 <= 4); - return (uintptr_t)ptr | elem_size_lg2; -} - -static int upb_msg_internalsize(const upb_msglayout *l) { - return sizeof(upb_msg_internal) - l->extendable * sizeof(void *); -} - -static size_t upb_msg_sizeof(const upb_msglayout *l) { - return l->size + upb_msg_internalsize(l); -} +static const size_t overhead = sizeof(upb_msg_internal); static const upb_msg_internal *upb_msg_getinternal_const(const upb_msg *msg) { ptrdiff_t size = sizeof(upb_msg_internal); - return UPB_PTR_AT(msg, -size, upb_msg_internal); + return (upb_msg_internal*)((char*)msg - size); } -static upb_msg_internal *upb_msg_getinternal(upb_msg *msg) { - return (upb_msg_internal*)upb_msg_getinternal_const(msg); +upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a) { + return _upb_msg_new_inl(l, a); } void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l) { - ptrdiff_t internal = upb_msg_internalsize(l); - void *mem = UPB_PTR_AT(msg, -internal, char); - memset(mem, 0, l->size + internal); -} - -upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a) { - void *mem = upb_arena_malloc(a, upb_msg_sizeof(l)); - upb_msg *msg; - - if (!mem) { - return NULL; - } - - msg = UPB_PTR_AT(mem, upb_msg_internalsize(l), upb_msg); - _upb_msg_clear(msg, l); - return msg; + void *mem = UPB_PTR_AT(msg, -sizeof(upb_msg_internal), char); + memset(mem, 0, upb_msg_sizeof(l)); } bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len, upb_arena *arena) { + upb_msg_internal *in = upb_msg_getinternal(msg); - if (len > in->unknown_size - in->unknown_len) { - upb_alloc *alloc = upb_arena_alloc(arena); - size_t need = in->unknown_size + len; - size_t newsize = UPB_MAX(in->unknown_size * 2, need); - void *mem = upb_realloc(alloc, in->unknown, in->unknown_size, newsize); - if (!mem) return false; - in->unknown = mem; - in->unknown_size = newsize; - } - memcpy(in->unknown + in->unknown_len, data, len); - in->unknown_len += len; + if (!in->unknown) { + size_t size = 128; + while (size < len) size *= 2; + in->unknown = upb_arena_malloc(arena, size + overhead); + if (!in->unknown) return false; + in->unknown->size = size; + in->unknown->len = 0; + } else if (in->unknown->size - in->unknown->len < len) { + size_t need = in->unknown->len + len; + size_t size = in->unknown->size; + while (size < need) size *= 2; + in->unknown = upb_arena_realloc( + arena, in->unknown, in->unknown->size + overhead, size + overhead); + if (!in->unknown) return false; + in->unknown->size = size; + } + memcpy(UPB_PTR_AT(in->unknown + 1, in->unknown->len, char), data, len); + in->unknown->len += len; return true; } void _upb_msg_discardunknown_shallow(upb_msg *msg) { upb_msg_internal *in = upb_msg_getinternal(msg); - in->unknown_len = 0; + if (in->unknown) { + in->unknown->len = 0; + } } const char *upb_msg_getunknown(const upb_msg *msg, size_t *len) { const upb_msg_internal *in = upb_msg_getinternal_const(msg); - *len = in->unknown_len; - return in->unknown; -} - -/** upb_array *****************************************************************/ - -upb_array *_upb_array_new(upb_arena *a, upb_fieldtype_t type) { - upb_array *arr = upb_arena_malloc(a, sizeof(upb_array)); - - if (!arr) { + if (in->unknown) { + *len = in->unknown->len; + return (char*)(in->unknown + 1); + } else { + *len = 0; return NULL; } - - arr->data = tag_arrptr(NULL, _upb_fieldtype_to_sizelg2[type]); - arr->len = 0; - arr->size = 0; - - return arr; } +/** upb_array *****************************************************************/ + bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena) { size_t new_size = UPB_MAX(arr->size, 4); int elem_size_lg2 = arr->data & 7; @@ -1329,16 +1376,16 @@ bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena) { return false; } - arr->data = tag_arrptr(ptr, elem_size_lg2); + arr->data = _upb_tag_arrptr(ptr, elem_size_lg2); arr->size = new_size; return true; } -static upb_array *getorcreate_array(upb_array **arr_ptr, upb_fieldtype_t type, +static upb_array *getorcreate_array(upb_array **arr_ptr, int elem_size_lg2, upb_arena *arena) { upb_array *arr = *arr_ptr; if (!arr) { - arr = _upb_array_new(arena, type); + arr = _upb_array_new(arena, 4, elem_size_lg2); if (!arr) return NULL; *arr_ptr = arr; } @@ -1346,22 +1393,25 @@ static upb_array *getorcreate_array(upb_array **arr_ptr, upb_fieldtype_t type, } void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size, - upb_fieldtype_t type, upb_arena *arena) { - upb_array *arr = getorcreate_array(arr_ptr, type, arena); - return arr && _upb_array_resize(arr, size, arena) ? _upb_array_ptr(arr) : NULL; + int elem_size_lg2, upb_arena *arena) { + upb_array *arr = getorcreate_array(arr_ptr, elem_size_lg2, arena); + return arr && _upb_array_resize(arr, size, arena) ? _upb_array_ptr(arr) + : NULL; } bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value, - upb_fieldtype_t type, upb_arena *arena) { - upb_array *arr = getorcreate_array(arr_ptr, type, arena); - size_t elem = arr->len; - int lg2 = _upb_fieldtype_to_sizelg2[type]; - char *data; + int elem_size_lg2, upb_arena *arena) { + upb_array *arr = getorcreate_array(arr_ptr, elem_size_lg2, arena); + if (!arr) return false; + + size_t elems = arr->len; - if (!arr || !_upb_array_resize(arr, elem + 1, arena)) return false; + if (!_upb_array_resize(arr, elems + 1, arena)) { + return false; + } - data = _upb_array_ptr(arr); - memcpy(data + (elem << lg2), value, 1 << lg2); + char *data = _upb_array_ptr(arr); + memcpy(data + (elems << elem_size_lg2), value, 1 << elem_size_lg2); return true; } @@ -1374,7 +1424,7 @@ upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size) { return NULL; } - upb_strtable_init2(&map->table, UPB_CTYPE_INT32, upb_arena_alloc(a)); + upb_strtable_init2(&map->table, UPB_CTYPE_INT32, 4, upb_arena_alloc(a)); map->key_size = key_size; map->val_size = value_size; @@ -1386,9 +1436,11 @@ upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size) { ** Implementation is heavily inspired by Lua's ltable.c. */ - #include +#include "third_party/wyhash/wyhash.h" + +/* Must be last. */ #define UPB_MAXARRSIZE 16 /* 64k. */ @@ -1467,11 +1519,7 @@ static upb_tabent *mutable_entries(upb_table *t) { } static bool isfull(upb_table *t) { - if (upb_table_size(t) == 0) { - return true; - } else { - return ((double)(t->count + 1) / upb_table_size(t)) > MAX_LOAD; - } + return t->count == t->max_count; } static bool init(upb_table *t, uint8_t size_lg2, upb_alloc *a) { @@ -1480,6 +1528,7 @@ static bool init(upb_table *t, uint8_t size_lg2, upb_alloc *a) { t->count = 0; t->size_lg2 = size_lg2; t->mask = upb_table_size(t) ? upb_table_size(t) - 1 : 0; + t->max_count = upb_table_size(t) * MAX_LOAD; bytes = upb_table_size(t) * sizeof(upb_tabent); if (bytes > 0) { t->entries = upb_malloc(a, bytes); @@ -1495,9 +1544,17 @@ static void uninit(upb_table *t, upb_alloc *a) { upb_free(a, mutable_entries(t)); } -static upb_tabent *emptyent(upb_table *t) { - upb_tabent *e = mutable_entries(t) + upb_table_size(t); - while (1) { if (upb_tabent_isempty(--e)) return e; UPB_ASSERT(e > t->entries); } +static upb_tabent *emptyent(upb_table *t, upb_tabent *e) { + upb_tabent *begin = mutable_entries(t); + upb_tabent *end = begin + upb_table_size(t); + for (e = e + 1; e < end; e++) { + if (upb_tabent_isempty(e)) return e; + } + for (e = begin; e < end; e++) { + if (upb_tabent_isempty(e)) return e; + } + UPB_ASSERT(false); + return NULL; } static upb_tabent *getentry_mutable(upb_table *t, uint32_t hash) { @@ -1553,7 +1610,7 @@ static void insert(upb_table *t, lookupkey_t key, upb_tabkey tabkey, our_e->next = NULL; } else { /* Collision. */ - upb_tabent *new_e = emptyent(t); + upb_tabent *new_e = emptyent(t, mainpos_e); /* Head of collider's chain. */ upb_tabent *chain = getentry_mutable(t, hashfunc(mainpos_e->key)); if (chain == mainpos_e) { @@ -1648,10 +1705,14 @@ static upb_tabkey strcopy(lookupkey_t k2, upb_alloc *a) { return (uintptr_t)str; } +static uint32_t table_hash(const char *p, size_t n) { + return wyhash(p, n, 0, _wyp); +} + static uint32_t strhash(upb_tabkey key) { uint32_t len; char *str = upb_tabstr(key, &len); - return upb_murmur_hash2(str, len, 0); + return table_hash(str, len); } static bool streql(upb_tabkey k1, lookupkey_t k2) { @@ -1660,9 +1721,14 @@ static bool streql(upb_tabkey k1, lookupkey_t k2) { return len == k2.str.len && (len == 0 || memcmp(str, k2.str.str, len) == 0); } -bool upb_strtable_init2(upb_strtable *t, upb_ctype_t ctype, upb_alloc *a) { +bool upb_strtable_init2(upb_strtable *t, upb_ctype_t ctype, + size_t expected_size, upb_alloc *a) { UPB_UNUSED(ctype); /* TODO(haberman): rm */ - return init(&t->t, 2, a); + // Multiply by approximate reciprocal of MAX_LOAD (0.85), with pow2 denominator. + size_t need_entries = (expected_size + 1) * 1204 / 1024; + UPB_ASSERT(need_entries >= expected_size * 0.85); + int size_lg2 = _upb_lg2ceil(need_entries); + return init(&t->t, size_lg2, a); } void upb_strtable_clear(upb_strtable *t) { @@ -1713,20 +1779,20 @@ bool upb_strtable_insert3(upb_strtable *t, const char *k, size_t len, tabkey = strcopy(key, a); if (tabkey == 0) return false; - hash = upb_murmur_hash2(key.str.str, key.str.len, 0); + hash = table_hash(key.str.str, key.str.len); insert(&t->t, key, tabkey, v, hash, &strhash, &streql); return true; } bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len, upb_value *v) { - uint32_t hash = upb_murmur_hash2(key, len, 0); + uint32_t hash = table_hash(key, len); return lookup(&t->t, strkey2(key, len), v, hash, &streql); } bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len, upb_value *val, upb_alloc *alloc) { - uint32_t hash = upb_murmur_hash2(key, len, 0); + uint32_t hash = table_hash(key, len); upb_tabkey tabkey; if (rm(&t->t, strkey2(key, len), val, &tabkey, hash, &streql)) { if (alloc) { @@ -2080,234 +2146,55 @@ bool upb_inttable_iter_isequal(const upb_inttable_iter *i1, i1->array_part == i2->array_part; } -#if defined(UPB_UNALIGNED_READS_OK) || defined(__s390x__) -/* ----------------------------------------------------------------------------- - * MurmurHash2, by Austin Appleby (released as public domain). - * Reformatted and C99-ified by Joshua Haberman. - * Note - This code makes a few assumptions about how your machine behaves - - * 1. We can read a 4-byte value from any address without crashing - * 2. sizeof(int) == 4 (in upb this limitation is removed by using uint32_t - * And it has a few limitations - - * 1. It will not work incrementally. - * 2. It will not produce the same results on little-endian and big-endian - * machines. */ -uint32_t upb_murmur_hash2(const void *key, size_t len, uint32_t seed) { - /* 'm' and 'r' are mixing constants generated offline. - * They're not really 'magic', they just happen to work well. */ - const uint32_t m = 0x5bd1e995; - const int32_t r = 24; - - /* Initialize the hash to a 'random' value */ - uint32_t h = seed ^ len; - - /* Mix 4 bytes at a time into the hash */ - const uint8_t * data = (const uint8_t *)key; - while(len >= 4) { - uint32_t k; - memcpy(&k, data, sizeof(k)); - - k *= m; - k ^= k >> r; - k *= m; - - h *= m; - h ^= k; - - data += 4; - len -= 4; - } - - /* Handle the last few bytes of the input array */ - switch(len) { - case 3: h ^= data[2] << 16; - case 2: h ^= data[1] << 8; - case 1: h ^= data[0]; h *= m; - }; - /* Do a few final mixes of the hash to ensure the last few - * bytes are well-incorporated. */ - h ^= h >> 13; - h *= m; - h ^= h >> 15; +#include +#include +#include +#include +#include +#include +#include - return h; -} -#else /* !UPB_UNALIGNED_READS_OK */ +/* upb_status *****************************************************************/ -/* ----------------------------------------------------------------------------- - * MurmurHashAligned2, by Austin Appleby - * Same algorithm as MurmurHash2, but only does aligned reads - should be safer - * on certain platforms. - * Performance will be lower than MurmurHash2 */ +void upb_status_clear(upb_status *status) { + if (!status) return; + status->ok = true; + status->msg[0] = '\0'; +} -#define MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; } +bool upb_ok(const upb_status *status) { return status->ok; } -uint32_t upb_murmur_hash2(const void * key, size_t len, uint32_t seed) { - const uint32_t m = 0x5bd1e995; - const int32_t r = 24; - const uint8_t * data = (const uint8_t *)key; - uint32_t h = (uint32_t)(seed ^ len); - uint8_t align = (uintptr_t)data & 3; +const char *upb_status_errmsg(const upb_status *status) { return status->msg; } - if(align && (len >= 4)) { - /* Pre-load the temp registers */ - uint32_t t = 0, d = 0; - int32_t sl; - int32_t sr; +void upb_status_seterrmsg(upb_status *status, const char *msg) { + if (!status) return; + status->ok = false; + strncpy(status->msg, msg, UPB_STATUS_MAX_MESSAGE - 1); + status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0'; +} - switch(align) { - case 1: t |= data[2] << 16; /* fallthrough */ - case 2: t |= data[1] << 8; /* fallthrough */ - case 3: t |= data[0]; - } +void upb_status_seterrf(upb_status *status, const char *fmt, ...) { + va_list args; + va_start(args, fmt); + upb_status_vseterrf(status, fmt, args); + va_end(args); +} - t <<= (8 * align); - - data += 4-align; - len -= 4-align; - - sl = 8 * (4-align); - sr = 8 * align; - - /* Mix */ - - while(len >= 4) { - uint32_t k; - - d = *(uint32_t *)data; - t = (t >> sr) | (d << sl); - - k = t; - - MIX(h,k,m); - - t = d; - - data += 4; - len -= 4; - } - - /* Handle leftover data in temp registers */ - - d = 0; - - if(len >= align) { - uint32_t k; - - switch(align) { - case 3: d |= data[2] << 16; /* fallthrough */ - case 2: d |= data[1] << 8; /* fallthrough */ - case 1: d |= data[0]; /* fallthrough */ - } - - k = (t >> sr) | (d << sl); - MIX(h,k,m); - - data += align; - len -= align; - - /* ---------- - * Handle tail bytes */ - - switch(len) { - case 3: h ^= data[2] << 16; /* fallthrough */ - case 2: h ^= data[1] << 8; /* fallthrough */ - case 1: h ^= data[0]; h *= m; /* fallthrough */ - }; - } else { - switch(len) { - case 3: d |= data[2] << 16; /* fallthrough */ - case 2: d |= data[1] << 8; /* fallthrough */ - case 1: d |= data[0]; /* fallthrough */ - case 0: h ^= (t >> sr) | (d << sl); h *= m; - } - } - - h ^= h >> 13; - h *= m; - h ^= h >> 15; - - return h; - } else { - while(len >= 4) { - uint32_t k = *(uint32_t *)data; - - MIX(h,k,m); - - data += 4; - len -= 4; - } - - /* ---------- - * Handle tail bytes */ - - switch(len) { - case 3: h ^= data[2] << 16; /* fallthrough */ - case 2: h ^= data[1] << 8; /* fallthrough */ - case 1: h ^= data[0]; h *= m; - }; - - h ^= h >> 13; - h *= m; - h ^= h >> 15; - - return h; - } -} -#undef MIX - -#endif /* UPB_UNALIGNED_READS_OK */ - - -#include -#include -#include -#include -#include -#include -#include - - -/* upb_status *****************************************************************/ - -void upb_status_clear(upb_status *status) { - if (!status) return; - status->ok = true; - status->msg[0] = '\0'; -} - -bool upb_ok(const upb_status *status) { return status->ok; } - -const char *upb_status_errmsg(const upb_status *status) { return status->msg; } - -void upb_status_seterrmsg(upb_status *status, const char *msg) { - if (!status) return; - status->ok = false; - strncpy(status->msg, msg, UPB_STATUS_MAX_MESSAGE - 1); - status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0'; -} - -void upb_status_seterrf(upb_status *status, const char *fmt, ...) { - va_list args; - va_start(args, fmt); - upb_status_vseterrf(status, fmt, args); - va_end(args); -} - -void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args) { - if (!status) return; - status->ok = false; - _upb_vsnprintf(status->msg, sizeof(status->msg), fmt, args); - status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0'; -} +void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args) { + if (!status) return; + status->ok = false; + vsnprintf(status->msg, sizeof(status->msg), fmt, args); + status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0'; +} void upb_status_vappenderrf(upb_status *status, const char *fmt, va_list args) { size_t len; if (!status) return; status->ok = false; len = strlen(status->msg); - _upb_vsnprintf(status->msg + len, sizeof(status->msg) - len, fmt, args); + vsnprintf(status->msg + len, sizeof(status->msg) - len, fmt, args); status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0'; } @@ -2331,37 +2218,18 @@ upb_alloc upb_alloc_global = {&upb_global_allocfunc}; /* Be conservative and choose 16 in case anyone is using SSE. */ -typedef struct mem_block { +struct mem_block { struct mem_block *next; uint32_t size; uint32_t cleanups; /* Data follows. */ -} mem_block; +}; typedef struct cleanup_ent { upb_cleanup_func *cleanup; void *ud; } cleanup_ent; -struct upb_arena { - _upb_arena_head head; - uint32_t *cleanups; - - /* Allocator to allocate arena blocks. We are responsible for freeing these - * when we are destroyed. */ - upb_alloc *block_alloc; - uint32_t last_size; - - /* When multiple arenas are fused together, each arena points to a parent - * arena (root points to itself). The root tracks how many live arenas - * reference it. */ - uint32_t refcount; /* Only used when a->parent == a */ - struct upb_arena *parent; - - /* Linked list of blocks to free/cleanup. */ - mem_block *freelist, *freelist_tail; -}; - static const size_t memblock_reserve = UPB_ALIGN_UP(sizeof(mem_block), 16); static upb_arena *arena_findroot(upb_arena *a) { @@ -2375,9 +2243,9 @@ static upb_arena *arena_findroot(upb_arena *a) { return a; } -static void upb_arena_addblock(upb_arena *a, void *ptr, size_t size) { +static void upb_arena_addblock(upb_arena *a, upb_arena *root, void *ptr, + size_t size) { mem_block *block = ptr; - upb_arena *root = arena_findroot(a); /* The block is for arena |a|, but should appear in the freelist of |root|. */ block->next = root->freelist; @@ -2391,26 +2259,22 @@ static void upb_arena_addblock(upb_arena *a, void *ptr, size_t size) { a->head.end = UPB_PTR_AT(block, size, char); a->cleanups = &block->cleanups; - /* TODO(haberman): ASAN poison. */ + UPB_POISON_MEMORY_REGION(a->head.ptr, a->head.end - a->head.ptr); } static bool upb_arena_allocblock(upb_arena *a, size_t size) { + upb_arena *root = arena_findroot(a); size_t block_size = UPB_MAX(size, a->last_size * 2) + memblock_reserve; - mem_block *block = upb_malloc(a->block_alloc, block_size); + mem_block *block = upb_malloc(root->block_alloc, block_size); if (!block) return false; - upb_arena_addblock(a, block, block_size); + upb_arena_addblock(a, root, block, block_size); return true; } -static bool arena_has(upb_arena *a, size_t size) { - _upb_arena_head *h = (_upb_arena_head*)a; - return (size_t)(h->end - h->ptr) >= size; -} - void *_upb_arena_slowmalloc(upb_arena *a, size_t size) { if (!upb_arena_allocblock(a, size)) return NULL; /* Out of memory. */ - UPB_ASSERT(arena_has(a, size)); + UPB_ASSERT(_upb_arenahas(a, size)); return upb_arena_malloc(a, size); } @@ -2442,7 +2306,7 @@ upb_arena *arena_initslow(void *mem, size_t n, upb_alloc *alloc) { a->freelist = NULL; a->freelist_tail = NULL; - upb_arena_addblock(a, mem, n); + upb_arena_addblock(a, a, mem, n); return a; } @@ -2505,14 +2369,15 @@ void upb_arena_free(upb_arena *a) { bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func) { cleanup_ent *ent; - if (!a->cleanups || !arena_has(a, sizeof(cleanup_ent))) { + if (!a->cleanups || !_upb_arenahas(a, sizeof(cleanup_ent))) { if (!upb_arena_allocblock(a, 128)) return false; /* Out of memory. */ - UPB_ASSERT(arena_has(a, sizeof(cleanup_ent))); + UPB_ASSERT(_upb_arenahas(a, sizeof(cleanup_ent))); } a->head.end -= sizeof(cleanup_ent); ent = (cleanup_ent*)a->head.end; (*a->cleanups)++; + UPB_UNPOISON_MEMORY_REGION(ent, sizeof(cleanup_ent)); ent->cleanup = func; ent->ud = ud; @@ -2598,7 +2463,7 @@ const upb_msglayout google_protobuf_FileDescriptorProto_msginit = { UPB_SIZE(64, 128), 12, false, }; -static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[8] = { +static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[7] = { &google_protobuf_DescriptorProto_msginit, &google_protobuf_DescriptorProto_ExtensionRange_msginit, &google_protobuf_DescriptorProto_ReservedRange_msginit, @@ -2673,23 +2538,23 @@ static const upb_msglayout *const google_protobuf_FieldDescriptorProto_submsgs[1 }; static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[11] = { - {1, UPB_SIZE(36, 40), 6, 0, 12, 1}, - {2, UPB_SIZE(44, 56), 7, 0, 12, 1}, - {3, UPB_SIZE(24, 24), 3, 0, 5, 1}, - {4, UPB_SIZE(8, 8), 1, 0, 14, 1}, - {5, UPB_SIZE(16, 16), 2, 0, 14, 1}, - {6, UPB_SIZE(52, 72), 8, 0, 12, 1}, - {7, UPB_SIZE(60, 88), 9, 0, 12, 1}, - {8, UPB_SIZE(76, 120), 11, 0, 11, 1}, - {9, UPB_SIZE(28, 28), 4, 0, 5, 1}, - {10, UPB_SIZE(68, 104), 10, 0, 12, 1}, - {17, UPB_SIZE(32, 32), 5, 0, 8, 1}, + {1, UPB_SIZE(24, 24), 6, 0, 12, 1}, + {2, UPB_SIZE(32, 40), 7, 0, 12, 1}, + {3, UPB_SIZE(12, 12), 3, 0, 5, 1}, + {4, UPB_SIZE(4, 4), 1, 0, 14, 1}, + {5, UPB_SIZE(8, 8), 2, 0, 14, 1}, + {6, UPB_SIZE(40, 56), 8, 0, 12, 1}, + {7, UPB_SIZE(48, 72), 9, 0, 12, 1}, + {8, UPB_SIZE(64, 104), 11, 0, 11, 1}, + {9, UPB_SIZE(16, 16), 4, 0, 5, 1}, + {10, UPB_SIZE(56, 88), 10, 0, 12, 1}, + {17, UPB_SIZE(20, 20), 5, 0, 8, 1}, }; const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = { &google_protobuf_FieldDescriptorProto_submsgs[0], &google_protobuf_FieldDescriptorProto__fields[0], - UPB_SIZE(80, 128), 11, false, + UPB_SIZE(72, 112), 11, false, }; static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1] = { @@ -2795,33 +2660,33 @@ static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1] = { }; static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = { - {1, UPB_SIZE(28, 32), 11, 0, 12, 1}, - {8, UPB_SIZE(36, 48), 12, 0, 12, 1}, - {9, UPB_SIZE(8, 8), 1, 0, 14, 1}, - {10, UPB_SIZE(16, 16), 2, 0, 8, 1}, - {11, UPB_SIZE(44, 64), 13, 0, 12, 1}, - {16, UPB_SIZE(17, 17), 3, 0, 8, 1}, - {17, UPB_SIZE(18, 18), 4, 0, 8, 1}, - {18, UPB_SIZE(19, 19), 5, 0, 8, 1}, - {20, UPB_SIZE(20, 20), 6, 0, 8, 1}, - {23, UPB_SIZE(21, 21), 7, 0, 8, 1}, - {27, UPB_SIZE(22, 22), 8, 0, 8, 1}, - {31, UPB_SIZE(23, 23), 9, 0, 8, 1}, - {36, UPB_SIZE(52, 80), 14, 0, 12, 1}, - {37, UPB_SIZE(60, 96), 15, 0, 12, 1}, - {39, UPB_SIZE(68, 112), 16, 0, 12, 1}, - {40, UPB_SIZE(76, 128), 17, 0, 12, 1}, - {41, UPB_SIZE(84, 144), 18, 0, 12, 1}, - {42, UPB_SIZE(24, 24), 10, 0, 8, 1}, - {44, UPB_SIZE(92, 160), 19, 0, 12, 1}, - {45, UPB_SIZE(100, 176), 20, 0, 12, 1}, - {999, UPB_SIZE(108, 192), 0, 0, 11, 3}, + {1, UPB_SIZE(20, 24), 11, 0, 12, 1}, + {8, UPB_SIZE(28, 40), 12, 0, 12, 1}, + {9, UPB_SIZE(4, 4), 1, 0, 14, 1}, + {10, UPB_SIZE(8, 8), 2, 0, 8, 1}, + {11, UPB_SIZE(36, 56), 13, 0, 12, 1}, + {16, UPB_SIZE(9, 9), 3, 0, 8, 1}, + {17, UPB_SIZE(10, 10), 4, 0, 8, 1}, + {18, UPB_SIZE(11, 11), 5, 0, 8, 1}, + {20, UPB_SIZE(12, 12), 6, 0, 8, 1}, + {23, UPB_SIZE(13, 13), 7, 0, 8, 1}, + {27, UPB_SIZE(14, 14), 8, 0, 8, 1}, + {31, UPB_SIZE(15, 15), 9, 0, 8, 1}, + {36, UPB_SIZE(44, 72), 14, 0, 12, 1}, + {37, UPB_SIZE(52, 88), 15, 0, 12, 1}, + {39, UPB_SIZE(60, 104), 16, 0, 12, 1}, + {40, UPB_SIZE(68, 120), 17, 0, 12, 1}, + {41, UPB_SIZE(76, 136), 18, 0, 12, 1}, + {42, UPB_SIZE(16, 16), 10, 0, 8, 1}, + {44, UPB_SIZE(84, 152), 19, 0, 12, 1}, + {45, UPB_SIZE(92, 168), 20, 0, 12, 1}, + {999, UPB_SIZE(100, 184), 0, 0, 11, 3}, }; const upb_msglayout google_protobuf_FileOptions_msginit = { &google_protobuf_FileOptions_submsgs[0], &google_protobuf_FileOptions__fields[0], - UPB_SIZE(112, 208), 21, false, + UPB_SIZE(104, 192), 21, false, }; static const upb_msglayout *const google_protobuf_MessageOptions_submsgs[1] = { @@ -2847,19 +2712,19 @@ static const upb_msglayout *const google_protobuf_FieldOptions_submsgs[1] = { }; static const upb_msglayout_field google_protobuf_FieldOptions__fields[7] = { - {1, UPB_SIZE(8, 8), 1, 0, 14, 1}, - {2, UPB_SIZE(24, 24), 3, 0, 8, 1}, - {3, UPB_SIZE(25, 25), 4, 0, 8, 1}, - {5, UPB_SIZE(26, 26), 5, 0, 8, 1}, - {6, UPB_SIZE(16, 16), 2, 0, 14, 1}, - {10, UPB_SIZE(27, 27), 6, 0, 8, 1}, - {999, UPB_SIZE(28, 32), 0, 0, 11, 3}, + {1, UPB_SIZE(4, 4), 1, 0, 14, 1}, + {2, UPB_SIZE(12, 12), 3, 0, 8, 1}, + {3, UPB_SIZE(13, 13), 4, 0, 8, 1}, + {5, UPB_SIZE(14, 14), 5, 0, 8, 1}, + {6, UPB_SIZE(8, 8), 2, 0, 14, 1}, + {10, UPB_SIZE(15, 15), 6, 0, 8, 1}, + {999, UPB_SIZE(16, 16), 0, 0, 11, 3}, }; const upb_msglayout google_protobuf_FieldOptions_msginit = { &google_protobuf_FieldOptions_submsgs[0], &google_protobuf_FieldOptions__fields[0], - UPB_SIZE(32, 40), 7, false, + UPB_SIZE(20, 24), 7, false, }; static const upb_msglayout *const google_protobuf_OneofOptions_submsgs[1] = { @@ -2927,15 +2792,15 @@ static const upb_msglayout *const google_protobuf_MethodOptions_submsgs[1] = { }; static const upb_msglayout_field google_protobuf_MethodOptions__fields[3] = { - {33, UPB_SIZE(16, 16), 2, 0, 8, 1}, - {34, UPB_SIZE(8, 8), 1, 0, 14, 1}, - {999, UPB_SIZE(20, 24), 0, 0, 11, 3}, + {33, UPB_SIZE(8, 8), 2, 0, 8, 1}, + {34, UPB_SIZE(4, 4), 1, 0, 14, 1}, + {999, UPB_SIZE(12, 16), 0, 0, 11, 3}, }; const upb_msglayout google_protobuf_MethodOptions_msginit = { &google_protobuf_MethodOptions_submsgs[0], &google_protobuf_MethodOptions__fields[0], - UPB_SIZE(24, 32), 3, false, + UPB_SIZE(16, 24), 3, false, }; static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1] = { @@ -3092,7 +2957,7 @@ static const upb_msglayout *layouts[27] = { &google_protobuf_GeneratedCodeInfo_Annotation_msginit, }; -static const char descriptor[7619] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', +static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', 'M', '\n', '\021', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'S', 'e', 't', '\022', '8', '\n', '\004', 'f', 'i', 'l', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', @@ -3390,13 +3255,13 @@ static const char descriptor[7619] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', ' 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l', 'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', -'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '\217', -'\001', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', -'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '>', 'g', 'i', 't', 'h', 'u', 'b', -'.', 'c', 'o', 'm', '/', 'g', 'o', 'l', 'a', 'n', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'p', 'r', 'o', 't', -'o', 'c', '-', 'g', 'e', 'n', '-', 'g', 'o', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', ';', 'd', 'e', 's', 'c', -'r', 'i', 'p', 't', 'o', 'r', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', '.', -'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n', +'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '~', +'\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', +'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', +'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', +'/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', +'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', +'n', }; static upb_def_init *deps[1] = { @@ -3407,12 +3272,13 @@ upb_def_init google_protobuf_descriptor_proto_upbdefinit = { deps, layouts, "google/protobuf/descriptor.proto", - UPB_STRVIEW_INIT(descriptor, 7619) + UPB_STRVIEW_INIT(descriptor, 7601) }; #include #include +#include #include #include @@ -3422,15 +3288,6 @@ typedef struct { char str[1]; /* Null-terminated string data follows. */ } str_t; -static str_t *newstr(upb_alloc *alloc, const char *data, size_t len) { - str_t *ret = upb_malloc(alloc, sizeof(*ret) + len); - if (!ret) return NULL; - ret->len = len; - if (len) memcpy(ret->str, data, len); - ret->str[len] = '\0'; - return ret; -} - struct upb_fielddef { const upb_filedef *file; const upb_msgdef *msgdef; @@ -3497,7 +3354,9 @@ struct upb_enumdef { struct upb_oneofdef { const upb_msgdef *parent; const char *full_name; - uint32_t index; + int field_count; + bool synthetic; + const upb_fielddef **fields; upb_strtable ntof; upb_inttable itof; }; @@ -3524,6 +3383,7 @@ struct upb_symtab { upb_arena *arena; upb_strtable syms; /* full_name -> packed def ptr */ upb_strtable files; /* file_name -> upb_filedef* */ + size_t bytes_loaded; }; /* Inside a symtab we store tagged pointers to specific def types. */ @@ -3562,38 +3422,6 @@ static bool upb_isalphanum(char c) { return upb_isletter(c) || upb_isbetween(c, '0', '9'); } -static bool upb_isident(upb_strview name, bool full, upb_status *s) { - const char *str = name.data; - size_t len = name.size; - bool start = true; - size_t i; - for (i = 0; i < len; i++) { - char c = str[i]; - if (c == '.') { - if (start || !full) { - upb_status_seterrf(s, "invalid name: unexpected '.' (%s)", str); - return false; - } - start = true; - } else if (start) { - if (!upb_isletter(c)) { - upb_status_seterrf( - s, "invalid name: path components must start with a letter (%s)", - str); - return false; - } - start = false; - } else { - if (!upb_isalphanum(c)) { - upb_status_seterrf(s, "invalid name: non-alphanumeric character (%s)", - str); - return false; - } - } - } - return !start; -} - static const char *shortdefname(const char *fullname) { const char *p; @@ -3653,85 +3481,6 @@ static void upb_status_setoom(upb_status *status) { upb_status_seterrmsg(status, "out of memory"); } -static bool assign_msg_indices(upb_msgdef *m, upb_status *s) { - /* Sort fields. upb internally relies on UPB_TYPE_MESSAGE fields having the - * lowest indexes, but we do not publicly guarantee this. */ - upb_msg_field_iter j; - int i; - uint32_t selector; - int n = upb_msgdef_numfields(m); - upb_fielddef **fields; - - if (n == 0) { - m->selector_count = UPB_STATIC_SELECTOR_COUNT; - m->submsg_field_count = 0; - return true; - } - - fields = upb_gmalloc(n * sizeof(*fields)); - if (!fields) { - upb_status_setoom(s); - return false; - } - - m->submsg_field_count = 0; - for(i = 0, upb_msg_field_begin(&j, m); - !upb_msg_field_done(&j); - upb_msg_field_next(&j), i++) { - upb_fielddef *f = upb_msg_iter_field(&j); - UPB_ASSERT(f->msgdef == m); - if (upb_fielddef_issubmsg(f)) { - m->submsg_field_count++; - } - fields[i] = f; - } - - qsort(fields, n, sizeof(*fields), cmp_fields); - - selector = UPB_STATIC_SELECTOR_COUNT + m->submsg_field_count; - for (i = 0; i < n; i++) { - upb_fielddef *f = fields[i]; - f->index_ = i; - f->selector_base = selector + upb_handlers_selectorbaseoffset(f); - selector += upb_handlers_selectorcount(f); - } - m->selector_count = selector; - - upb_gfree(fields); - return true; -} - -static bool check_oneofs(upb_msgdef *m, upb_status *s) { - int i; - int first_synthetic = -1; - upb_oneofdef *mutable_oneofs = (upb_oneofdef*)m->oneofs; - - for (i = 0; i < m->oneof_count; i++) { - mutable_oneofs[i].index = i; - - if (upb_oneofdef_issynthetic(&mutable_oneofs[i])) { - if (first_synthetic == -1) { - first_synthetic = i; - } - } else { - if (first_synthetic != -1) { - upb_status_seterrf( - s, "Synthetic oneofs must be after all other oneofs: %s", - upb_oneofdef_name(&mutable_oneofs[i])); - return false; - } - } - } - - if (first_synthetic == -1) { - m->real_oneof_count = m->oneof_count; - } else { - m->real_oneof_count = first_synthetic; - } - - return true; -} - static void assign_msg_wellknowntype(upb_msgdef *m) { const char *name = upb_msgdef_fullname(m); if (name == NULL) { @@ -4134,15 +3883,32 @@ int upb_msgdef_numrealoneofs(const upb_msgdef *m) { return m->real_oneof_count; } +int upb_msgdef_fieldcount(const upb_msgdef *m) { + return m->field_count; +} + +int upb_msgdef_oneofcount(const upb_msgdef *m) { + return m->oneof_count; +} + +int upb_msgdef_realoneofcount(const upb_msgdef *m) { + return m->real_oneof_count; +} + const upb_msglayout *upb_msgdef_layout(const upb_msgdef *m) { return m->layout; } -const upb_fielddef *_upb_msgdef_field(const upb_msgdef *m, int i) { - if (i >= m->field_count) return NULL; +const upb_fielddef *upb_msgdef_field(const upb_msgdef *m, int i) { + UPB_ASSERT(i >= 0 && i < m->field_count); return &m->fields[i]; } +const upb_oneofdef *upb_msgdef_oneof(const upb_msgdef *m, int i) { + UPB_ASSERT(i >= 0 && i < m->oneof_count); + return &m->oneofs[i]; +} + bool upb_msgdef_mapentry(const upb_msgdef *m) { return m->map_entry; } @@ -4230,22 +3996,25 @@ const upb_msgdef *upb_oneofdef_containingtype(const upb_oneofdef *o) { return o->parent; } +int upb_oneofdef_fieldcount(const upb_oneofdef *o) { + return o->field_count; +} + +const upb_fielddef *upb_oneofdef_field(const upb_oneofdef *o, int i) { + UPB_ASSERT(i < o->field_count); + return o->fields[i]; +} + int upb_oneofdef_numfields(const upb_oneofdef *o) { - return (int)upb_strtable_count(&o->ntof); + return o->field_count; } uint32_t upb_oneofdef_index(const upb_oneofdef *o) { - return o->index; + return o - o->parent->oneofs; } bool upb_oneofdef_issynthetic(const upb_oneofdef *o) { - upb_inttable_iter iter; - const upb_fielddef *f; - upb_inttable_begin(&iter, &o->itof); - if (upb_oneofdef_numfields(o) != 1) return false; - f = upb_value_getptr(upb_inttable_iter_value(&iter)); - UPB_ASSERT(f); - return f->proto3_optional_; + return o->synthetic; } const upb_fielddef *upb_oneofdef_ntof(const upb_oneofdef *o, @@ -4281,7 +4050,185 @@ void upb_oneof_iter_setdone(upb_oneof_iter *iter) { upb_inttable_iter_setdone(iter); } -/* Dynamic Layout Generation. *************************************************/ +/* upb_filedef ****************************************************************/ + +const char *upb_filedef_name(const upb_filedef *f) { + return f->name; +} + +const char *upb_filedef_package(const upb_filedef *f) { + return f->package; +} + +const char *upb_filedef_phpprefix(const upb_filedef *f) { + return f->phpprefix; +} + +const char *upb_filedef_phpnamespace(const upb_filedef *f) { + return f->phpnamespace; +} + +upb_syntax_t upb_filedef_syntax(const upb_filedef *f) { + return f->syntax; +} + +int upb_filedef_msgcount(const upb_filedef *f) { + return f->msg_count; +} + +int upb_filedef_depcount(const upb_filedef *f) { + return f->dep_count; +} + +int upb_filedef_enumcount(const upb_filedef *f) { + return f->enum_count; +} + +const upb_filedef *upb_filedef_dep(const upb_filedef *f, int i) { + return i < 0 || i >= f->dep_count ? NULL : f->deps[i]; +} + +const upb_msgdef *upb_filedef_msg(const upb_filedef *f, int i) { + return i < 0 || i >= f->msg_count ? NULL : &f->msgs[i]; +} + +const upb_enumdef *upb_filedef_enum(const upb_filedef *f, int i) { + return i < 0 || i >= f->enum_count ? NULL : &f->enums[i]; +} + +void upb_symtab_free(upb_symtab *s) { + upb_arena_free(s->arena); + upb_gfree(s); +} + +upb_symtab *upb_symtab_new(void) { + upb_symtab *s = upb_gmalloc(sizeof(*s)); + upb_alloc *alloc; + + if (!s) { + return NULL; + } + + s->arena = upb_arena_new(); + s->bytes_loaded = 0; + alloc = upb_arena_alloc(s->arena); + + if (!upb_strtable_init2(&s->syms, UPB_CTYPE_CONSTPTR, 32, alloc) || + !upb_strtable_init2(&s->files, UPB_CTYPE_CONSTPTR, 4, alloc)) { + upb_arena_free(s->arena); + upb_gfree(s); + s = NULL; + } + return s; +} + +const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym) { + upb_value v; + return upb_strtable_lookup(&s->syms, sym, &v) ? + unpack_def(v, UPB_DEFTYPE_MSG) : NULL; +} + +const upb_msgdef *upb_symtab_lookupmsg2(const upb_symtab *s, const char *sym, + size_t len) { + upb_value v; + return upb_strtable_lookup2(&s->syms, sym, len, &v) ? + unpack_def(v, UPB_DEFTYPE_MSG) : NULL; +} + +const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym) { + upb_value v; + return upb_strtable_lookup(&s->syms, sym, &v) ? + unpack_def(v, UPB_DEFTYPE_ENUM) : NULL; +} + +const upb_filedef *upb_symtab_lookupfile(const upb_symtab *s, const char *name) { + upb_value v; + return upb_strtable_lookup(&s->files, name, &v) ? upb_value_getconstptr(v) + : NULL; +} + +const upb_filedef *upb_symtab_lookupfile2( + const upb_symtab *s, const char *name, size_t len) { + upb_value v; + return upb_strtable_lookup2(&s->files, name, len, &v) ? + upb_value_getconstptr(v) : NULL; +} + +int upb_symtab_filecount(const upb_symtab *s) { + return (int)upb_strtable_count(&s->files); +} + +/* Code to build defs from descriptor protos. *********************************/ + +/* There is a question of how much validation to do here. It will be difficult + * to perfectly match the amount of validation performed by proto2. But since + * this code is used to directly build defs from Ruby (for example) we do need + * to validate important constraints like uniqueness of names and numbers. */ + +#define CHK_OOM(x) if (!(x)) { symtab_oomerr(ctx); } + +typedef struct { + upb_symtab *symtab; + upb_filedef *file; /* File we are building. */ + upb_arena *file_arena; /* Allocate defs here. */ + upb_alloc *alloc; /* Alloc of file_arena, for tables. */ + const upb_msglayout **layouts; /* NULL if we should build layouts. */ + upb_status *status; /* Record errors here. */ + jmp_buf err; /* longjmp() on error. */ +} symtab_addctx; + +UPB_NORETURN UPB_NOINLINE +static void symtab_errf(symtab_addctx *ctx, const char *fmt, ...) { + va_list argp; + va_start(argp, fmt); + upb_status_vseterrf(ctx->status, fmt, argp); + va_end(argp); + longjmp(ctx->err, 1); +} + +UPB_NORETURN UPB_NOINLINE +static void symtab_oomerr(symtab_addctx *ctx) { + upb_status_setoom(ctx->status); + longjmp(ctx->err, 1); +} + +void *symtab_alloc(symtab_addctx *ctx, size_t bytes) { + void *ret = upb_arena_malloc(ctx->file_arena, bytes); + if (!ret) symtab_oomerr(ctx); + return ret; +} + +static void check_ident(symtab_addctx *ctx, upb_strview name, bool full) { + const char *str = name.data; + size_t len = name.size; + bool start = true; + size_t i; + for (i = 0; i < len; i++) { + char c = str[i]; + if (c == '.') { + if (start || !full) { + symtab_errf(ctx, "invalid name: unexpected '.' (%.*s)", (int)len, str); + } + start = true; + } else if (start) { + if (!upb_isletter(c)) { + symtab_errf( + ctx, + "invalid name: path components must start with a letter (%.*s)", + (int)len, str); + } + start = false; + } else { + if (!upb_isalphanum(c)) { + symtab_errf(ctx, "invalid name: non-alphanumeric character (%.*s)", + (int)len, str); + } + } + } + if (start) { + symtab_errf(ctx, "invalid name: empty part (%.*s)", (int)len, str); + } +} static size_t div_round_up(size_t n, size_t d) { return (n + d - 1) / d; @@ -4348,7 +4295,7 @@ static void assign_layout_indices(const upb_msgdef *m, upb_msglayout_field *fiel /* This function is the dynamic equivalent of message_layout.{cc,h} in upbc. * It computes a dynamic layout for all of the fields in |m|. */ -static bool make_layout(const upb_symtab *symtab, const upb_msgdef *m) { +static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) { upb_msglayout *l = (upb_msglayout*)m->layout; upb_msg_field_iter it; upb_msg_oneof_iter oit; @@ -4356,18 +4303,11 @@ static bool make_layout(const upb_symtab *symtab, const upb_msgdef *m) { size_t submsg_count = m->submsg_field_count; const upb_msglayout **submsgs; upb_msglayout_field *fields; - upb_alloc *alloc = upb_arena_alloc(symtab->arena); memset(l, 0, sizeof(*l)); - fields = upb_malloc(alloc, upb_msgdef_numfields(m) * sizeof(*fields)); - submsgs = upb_malloc(alloc, submsg_count * sizeof(*submsgs)); - - if ((!fields && upb_msgdef_numfields(m)) || - (!submsgs && submsg_count)) { - /* OOM. */ - return false; - } + fields = symtab_alloc(ctx, upb_msgdef_numfields(m) * sizeof(*fields)); + submsgs = symtab_alloc(ctx, submsg_count * sizeof(*submsgs)); l->field_count = upb_msgdef_numfields(m); l->fields = fields; @@ -4397,7 +4337,7 @@ static bool make_layout(const upb_symtab *symtab, const upb_msgdef *m) { l->field_count = 2; l->size = 2 * sizeof(upb_strview); l->size = UPB_ALIGN_UP(l->size, 8); - return true; + return; } /* Allocate data offsets in three stages: @@ -4509,31 +4449,52 @@ static bool make_layout(const upb_symtab *symtab, const upb_msgdef *m) { /* Sort fields by number. */ qsort(fields, upb_msgdef_numfields(m), sizeof(*fields), field_number_cmp); assign_layout_indices(m, fields); - - return true; } -/* Code to build defs from descriptor protos. *********************************/ +static void assign_msg_indices(symtab_addctx *ctx, upb_msgdef *m) { + /* Sort fields. upb internally relies on UPB_TYPE_MESSAGE fields having the + * lowest indexes, but we do not publicly guarantee this. */ + upb_msg_field_iter j; + int i; + uint32_t selector; + int n = upb_msgdef_numfields(m); + upb_fielddef **fields; -/* There is a question of how much validation to do here. It will be difficult - * to perfectly match the amount of validation performed by proto2. But since - * this code is used to directly build defs from Ruby (for example) we do need - * to validate important constraints like uniqueness of names and numbers. */ + if (n == 0) { + m->selector_count = UPB_STATIC_SELECTOR_COUNT; + m->submsg_field_count = 0; + return; + } -#define CHK(x) if (!(x)) { return false; } -#define CHK_OOM(x) if (!(x)) { upb_status_setoom(ctx->status); return false; } + fields = upb_gmalloc(n * sizeof(*fields)); -typedef struct { - const upb_symtab *symtab; - upb_filedef *file; /* File we are building. */ - upb_alloc *alloc; /* Allocate defs here. */ - upb_alloc *tmp; /* Alloc for addtab and any other tmp data. */ - upb_strtable *addtab; /* full_name -> packed def ptr for new defs */ - const upb_msglayout **layouts; /* NULL if we should build layouts. */ - upb_status *status; /* Record errors here. */ -} symtab_addctx; + m->submsg_field_count = 0; + for(i = 0, upb_msg_field_begin(&j, m); + !upb_msg_field_done(&j); + upb_msg_field_next(&j), i++) { + upb_fielddef *f = upb_msg_iter_field(&j); + UPB_ASSERT(f->msgdef == m); + if (upb_fielddef_issubmsg(f)) { + m->submsg_field_count++; + } + fields[i] = f; + } + + qsort(fields, n, sizeof(*fields), cmp_fields); + + selector = UPB_STATIC_SELECTOR_COUNT + m->submsg_field_count; + for (i = 0; i < n; i++) { + upb_fielddef *f = fields[i]; + f->index_ = i; + f->selector_base = selector + upb_handlers_selectorbaseoffset(f); + selector += upb_handlers_selectorcount(f); + } + m->selector_count = selector; + + upb_gfree(fields); +} -static char* strviewdup(const symtab_addctx *ctx, upb_strview view) { +static char *strviewdup(symtab_addctx *ctx, upb_strview view) { return upb_strdup2(view.data, view.size, ctx->alloc); } @@ -4545,13 +4506,12 @@ static bool streql_view(upb_strview view, const char *b) { return streql2(view.data, view.size, b); } -static const char *makefullname(const symtab_addctx *ctx, const char *prefix, +static const char *makefullname(symtab_addctx *ctx, const char *prefix, upb_strview name) { if (prefix) { /* ret = prefix + '.' + name; */ size_t n = strlen(prefix); - char *ret = upb_malloc(ctx->alloc, n + name.size + 2); - CHK_OOM(ret); + char *ret = symtab_alloc(ctx, n + name.size + 2); strcpy(ret, prefix); ret[n] = '.'; memcpy(&ret[n + 1], name.data, name.size); @@ -4562,6 +4522,41 @@ static const char *makefullname(const symtab_addctx *ctx, const char *prefix, } } +static void finalize_oneofs(symtab_addctx *ctx, upb_msgdef *m) { + int i; + int synthetic_count = 0; + upb_oneofdef *mutable_oneofs = (upb_oneofdef*)m->oneofs; + + for (i = 0; i < m->oneof_count; i++) { + upb_oneofdef *o = &mutable_oneofs[i]; + + if (o->synthetic && o->field_count != 1) { + symtab_errf(ctx, "Synthetic oneofs must have one field, not %d: %s", + o->field_count, upb_oneofdef_name(o)); + } + + if (o->synthetic) { + synthetic_count++; + } else if (synthetic_count != 0) { + symtab_errf(ctx, "Synthetic oneofs must be after all other oneofs: %s", + upb_oneofdef_name(o)); + } + + o->fields = symtab_alloc(ctx, sizeof(upb_fielddef *) * o->field_count); + o->field_count = 0; + } + + for (i = 0; i < m->field_count; i++) { + const upb_fielddef *f = &m->fields[i]; + upb_oneofdef *o = (upb_oneofdef*)f->oneof; + if (o) { + o->fields[o->field_count++] = f; + } + } + + m->real_oneof_count = m->oneof_count - synthetic_count; +} + size_t getjsonname(const char *name, char *buf, size_t len) { size_t src, dst = 0; bool ucase_next = false; @@ -4600,76 +4595,57 @@ size_t getjsonname(const char *name, char *buf, size_t len) { #undef WRITE } -static char* makejsonname(const char* name, upb_alloc *alloc) { +static char* makejsonname(symtab_addctx *ctx, const char* name) { size_t size = getjsonname(name, NULL, 0); - char* json_name = upb_malloc(alloc, size); + char* json_name = symtab_alloc(ctx, size); getjsonname(name, json_name, size); return json_name; } -static bool symtab_add(const symtab_addctx *ctx, const char *name, - upb_value v) { - upb_value tmp; - if (upb_strtable_lookup(ctx->addtab, name, &tmp) || - upb_strtable_lookup(&ctx->symtab->syms, name, &tmp)) { - upb_status_seterrf(ctx->status, "duplicate symbol '%s'", name); - return false; +static void symtab_add(symtab_addctx *ctx, const char *name, upb_value v) { + if (upb_strtable_lookup(&ctx->symtab->syms, name, NULL)) { + symtab_errf(ctx, "duplicate symbol '%s'", name); } - - CHK_OOM(upb_strtable_insert3(ctx->addtab, name, strlen(name), v, ctx->tmp)); - return true; + upb_alloc *alloc = upb_arena_alloc(ctx->symtab->arena); + size_t len = strlen(name); + CHK_OOM(upb_strtable_insert3(&ctx->symtab->syms, name, len, v, alloc)); } /* Given a symbol and the base symbol inside which it is defined, find the * symbol's definition in t. */ -static bool resolvename(const upb_strtable *t, const upb_fielddef *f, - const char *base, upb_strview sym, - upb_deftype_t type, upb_status *status, - const void **def) { - if(sym.size == 0) return false; +static const void *symtab_resolve(symtab_addctx *ctx, const upb_fielddef *f, + const char *base, upb_strview sym, + upb_deftype_t type) { + const upb_strtable *t = &ctx->symtab->syms; + if(sym.size == 0) goto notfound; if(sym.data[0] == '.') { /* Symbols starting with '.' are absolute, so we do a single lookup. * Slice to omit the leading '.' */ upb_value v; if (!upb_strtable_lookup2(t, sym.data + 1, sym.size - 1, &v)) { - return false; + goto notfound; } - *def = unpack_def(v, type); - - if (!*def) { - upb_status_seterrf(status, - "type mismatch when resolving field %s, name %s", - f->full_name, sym.data); - return false; + const void *ret = unpack_def(v, type); + if (!ret) { + symtab_errf(ctx, "type mismatch when resolving field %s, name %s", + f->full_name, sym.data); } - - return true; + return ret; } else { /* Remove components from base until we find an entry or run out. * TODO: This branch is totally broken, but currently not used. */ (void)base; UPB_ASSERT(false); - return false; + goto notfound; } -} -const void *symtab_resolve(const symtab_addctx *ctx, const upb_fielddef *f, - const char *base, upb_strview sym, - upb_deftype_t type) { - const void *ret; - if (!resolvename(ctx->addtab, f, base, sym, type, ctx->status, &ret) && - !resolvename(&ctx->symtab->syms, f, base, sym, type, ctx->status, &ret)) { - if (upb_ok(ctx->status)) { - upb_status_seterrf(ctx->status, "couldn't resolve name '%s'", sym.data); - } - return false; - } - return ret; +notfound: + symtab_errf(ctx, "couldn't resolve name '%s'", sym.data); } -static bool create_oneofdef( - const symtab_addctx *ctx, upb_msgdef *m, +static void create_oneofdef( + symtab_addctx *ctx, upb_msgdef *m, const google_protobuf_OneofDescriptorProto *oneof_proto) { upb_oneofdef *o; upb_strview name = google_protobuf_OneofDescriptorProto_name(oneof_proto); @@ -4678,18 +4654,27 @@ static bool create_oneofdef( o = (upb_oneofdef*)&m->oneofs[m->oneof_count++]; o->parent = m; o->full_name = makefullname(ctx, m->full_name, name); + o->field_count = 0; + o->synthetic = false; v = pack_def(o, UPB_DEFTYPE_ONEOF); - CHK_OOM(symtab_add(ctx, o->full_name, v)); + symtab_add(ctx, o->full_name, v); CHK_OOM(upb_strtable_insert3(&m->ntof, name.data, name.size, v, ctx->alloc)); CHK_OOM(upb_inttable_init2(&o->itof, UPB_CTYPE_CONSTPTR, ctx->alloc)); - CHK_OOM(upb_strtable_init2(&o->ntof, UPB_CTYPE_CONSTPTR, ctx->alloc)); + CHK_OOM(upb_strtable_init2(&o->ntof, UPB_CTYPE_CONSTPTR, 4, ctx->alloc)); +} - return true; +static str_t *newstr(symtab_addctx *ctx, const char *data, size_t len) { + str_t *ret = symtab_alloc(ctx, sizeof(*ret) + len); + if (!ret) return NULL; + ret->len = len; + if (len) memcpy(ret->str, data, len); + ret->str[len] = '\0'; + return ret; } -static bool parse_default(const symtab_addctx *ctx, const char *str, size_t len, +static void parse_default(symtab_addctx *ctx, const char *str, size_t len, upb_fielddef *f) { char *end; char nullz[64]; @@ -4704,7 +4689,7 @@ static bool parse_default(const symtab_addctx *ctx, const char *str, size_t len, case UPB_TYPE_FLOAT: /* Standard C number parsing functions expect null-terminated strings. */ if (len >= sizeof(nullz) - 1) { - return false; + symtab_errf(ctx, "Default too long: %.*s", (int)len, str); } memcpy(nullz, str, len); nullz[len] = '\0'; @@ -4717,47 +4702,61 @@ static bool parse_default(const symtab_addctx *ctx, const char *str, size_t len, switch (upb_fielddef_type(f)) { case UPB_TYPE_INT32: { long val = strtol(str, &end, 0); - CHK(val <= INT32_MAX && val >= INT32_MIN && errno != ERANGE && !*end); + if (val > INT32_MAX || val < INT32_MIN || errno == ERANGE || *end) { + goto invalid; + } f->defaultval.sint = val; break; } case UPB_TYPE_ENUM: { const upb_enumdef *e = f->sub.enumdef; int32_t val; - CHK(upb_enumdef_ntoi(e, str, len, &val)); + if (!upb_enumdef_ntoi(e, str, len, &val)) { + goto invalid; + } f->defaultval.sint = val; break; } case UPB_TYPE_INT64: { /* XXX: Need to write our own strtoll, since it's not available in c89. */ int64_t val = strtol(str, &end, 0); - CHK(val <= INT64_MAX && val >= INT64_MIN && errno != ERANGE && !*end); + if (val > INT64_MAX || val < INT64_MIN || errno == ERANGE || *end) { + goto invalid; + } f->defaultval.sint = val; break; } case UPB_TYPE_UINT32: { unsigned long val = strtoul(str, &end, 0); - CHK(val <= UINT32_MAX && errno != ERANGE && !*end); + if (val > UINT32_MAX || errno == ERANGE || *end) { + goto invalid; + } f->defaultval.uint = val; break; } case UPB_TYPE_UINT64: { /* XXX: Need to write our own strtoull, since it's not available in c89. */ uint64_t val = strtoul(str, &end, 0); - CHK(val <= UINT64_MAX && errno != ERANGE && !*end); + if (val > UINT64_MAX || errno == ERANGE || *end) { + goto invalid; + } f->defaultval.uint = val; break; } case UPB_TYPE_DOUBLE: { double val = strtod(str, &end); - CHK(errno != ERANGE && !*end); + if (errno == ERANGE || *end) { + goto invalid; + } f->defaultval.dbl = val; break; } case UPB_TYPE_FLOAT: { /* XXX: Need to write our own strtof, since it's not available in c89. */ float val = strtod(str, &end); - CHK(errno != ERANGE && !*end); + if (errno == ERANGE || *end) { + goto invalid; + } f->defaultval.flt = val; break; } @@ -4767,25 +4766,30 @@ static bool parse_default(const symtab_addctx *ctx, const char *str, size_t len, } else if (streql2(str, len, "true")) { f->defaultval.boolean = true; } else { - return false; } break; } case UPB_TYPE_STRING: - f->defaultval.str = newstr(ctx->alloc, str, len); + f->defaultval.str = newstr(ctx, str, len); break; case UPB_TYPE_BYTES: /* XXX: need to interpret the C-escaped value. */ - f->defaultval.str = newstr(ctx->alloc, str, len); + f->defaultval.str = newstr(ctx, str, len); break; case UPB_TYPE_MESSAGE: /* Should not have a default value. */ - return false; + symtab_errf(ctx, "Message should not have a default (%s)", + upb_fielddef_fullname(f)); } - return true; + + return; + +invalid: + symtab_errf(ctx, "Invalid default '%.*s' for field %f", (int)len, str, + upb_fielddef_fullname(f)); } -static void set_default_default(const symtab_addctx *ctx, upb_fielddef *f) { +static void set_default_default(symtab_addctx *ctx, upb_fielddef *f) { switch (upb_fielddef_type(f)) { case UPB_TYPE_INT32: case UPB_TYPE_INT64: @@ -4802,7 +4806,7 @@ static void set_default_default(const symtab_addctx *ctx, upb_fielddef *f) { break; case UPB_TYPE_STRING: case UPB_TYPE_BYTES: - f->defaultval.str = newstr(ctx->alloc, NULL, 0); + f->defaultval.str = newstr(ctx, NULL, 0); break; case UPB_TYPE_BOOL: f->defaultval.boolean = false; @@ -4812,8 +4816,8 @@ static void set_default_default(const symtab_addctx *ctx, upb_fielddef *f) { } } -static bool create_fielddef( - const symtab_addctx *ctx, const char *prefix, upb_msgdef *m, +static void create_fielddef( + symtab_addctx *ctx, const char *prefix, upb_msgdef *m, const google_protobuf_FieldDescriptorProto *field_proto) { upb_alloc *alloc = ctx->alloc; upb_fielddef *f; @@ -4825,12 +4829,11 @@ static bool create_fielddef( uint32_t field_number; if (!google_protobuf_FieldDescriptorProto_has_name(field_proto)) { - upb_status_seterrmsg(ctx->status, "field has no name"); - return false; + symtab_errf(ctx, "field has no name (%s)", upb_msgdef_fullname(m)); } name = google_protobuf_FieldDescriptorProto_name(field_proto); - CHK(upb_isident(name, false, ctx->status)); + check_ident(ctx, name, false); full_name = makefullname(ctx, prefix, name); shortname = shortdefname(full_name); @@ -4838,14 +4841,13 @@ static bool create_fielddef( json_name = strviewdup( ctx, google_protobuf_FieldDescriptorProto_json_name(field_proto)); } else { - json_name = makejsonname(shortname, ctx->alloc); + json_name = makejsonname(ctx, shortname); } field_number = google_protobuf_FieldDescriptorProto_number(field_proto); if (field_number == 0 || field_number > UPB_MAX_FIELDNUMBER) { - upb_status_seterrf(ctx->status, "invalid field number (%u)", field_number); - return false; + symtab_errf(ctx, "invalid field number (%u)", field_number); } if (m) { @@ -4858,19 +4860,15 @@ static bool create_fielddef( f->is_extension_ = false; if (upb_strtable_lookup(&m->ntof, shortname, NULL)) { - upb_status_seterrf(ctx->status, "duplicate field name (%s)", shortname); - return false; + symtab_errf(ctx, "duplicate field name (%s)", shortname); } if (upb_strtable_lookup(&m->ntof, json_name, NULL)) { - upb_status_seterrf(ctx->status, "duplicate json_name (%s)", json_name); - return false; + symtab_errf(ctx, "duplicate json_name (%s)", json_name); } if (upb_inttable_lookup(&m->itof, field_number, NULL)) { - upb_status_seterrf(ctx->status, "duplicate field number (%u)", - field_number); - return false; + symtab_errf(ctx, "duplicate field number (%u)", field_number); } field_v = pack_def(f, UPB_DEFTYPE_FIELD); @@ -4904,7 +4902,7 @@ static bool create_fielddef( /* extension field. */ f = (upb_fielddef*)&ctx->file->exts[ctx->file->ext_count++]; f->is_extension_ = true; - CHK_OOM(symtab_add(ctx, full_name, pack_def(f, UPB_DEFTYPE_FIELD))); + symtab_add(ctx, full_name, pack_def(f, UPB_DEFTYPE_FIELD)); } f->full_name = full_name; @@ -4923,9 +4921,7 @@ static bool create_fielddef( f->sub.unresolved = field_proto; if (f->label_ == UPB_LABEL_REQUIRED && f->file->syntax == UPB_SYNTAX_PROTO3) { - upb_status_seterrf(ctx->status, "proto3 fields cannot be required (%s)", - f->full_name); - return false; + symtab_errf(ctx, "proto3 fields cannot be required (%s)", f->full_name); } if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { @@ -4935,32 +4931,34 @@ static bool create_fielddef( upb_value v = upb_value_constptr(f); if (upb_fielddef_label(f) != UPB_LABEL_OPTIONAL) { - upb_status_seterrf(ctx->status, - "fields in oneof must have OPTIONAL label (%s)", - f->full_name); - return false; + symtab_errf(ctx, "fields in oneof must have OPTIONAL label (%s)", + f->full_name); } if (!m) { - upb_status_seterrf(ctx->status, - "oneof_index provided for extension field (%s)", - f->full_name); - return false; + symtab_errf(ctx, "oneof_index provided for extension field (%s)", + f->full_name); } if (oneof_index >= m->oneof_count) { - upb_status_seterrf(ctx->status, "oneof_index out of range (%s)", - f->full_name); - return false; + symtab_errf(ctx, "oneof_index out of range (%s)", f->full_name); } oneof = (upb_oneofdef*)&m->oneofs[oneof_index]; f->oneof = oneof; - CHK(upb_inttable_insert2(&oneof->itof, f->number_, v, alloc)); - CHK(upb_strtable_insert3(&oneof->ntof, name.data, name.size, v, alloc)); + oneof->field_count++; + if (f->proto3_optional_) { + oneof->synthetic = true; + } + CHK_OOM(upb_inttable_insert2(&oneof->itof, f->number_, v, alloc)); + CHK_OOM(upb_strtable_insert3(&oneof->ntof, name.data, name.size, v, alloc)); } else { f->oneof = NULL; + if (f->proto3_optional_) { + symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)", + f->full_name); + } } options = google_protobuf_FieldDescriptorProto_has_options(field_proto) ? @@ -4979,12 +4977,10 @@ static bool create_fielddef( } else { f->lazy_ = false; } - - return true; } -static bool create_enumdef( - const symtab_addctx *ctx, const char *prefix, +static void create_enumdef( + symtab_addctx *ctx, const char *prefix, const google_protobuf_EnumDescriptorProto *enum_proto) { upb_enumdef *e; const google_protobuf_EnumValueDescriptorProto *const *values; @@ -4992,25 +4988,22 @@ static bool create_enumdef( size_t i, n; name = google_protobuf_EnumDescriptorProto_name(enum_proto); - CHK(upb_isident(name, false, ctx->status)); + check_ident(ctx, name, false); e = (upb_enumdef*)&ctx->file->enums[ctx->file->enum_count++]; e->full_name = makefullname(ctx, prefix, name); - CHK_OOM(symtab_add(ctx, e->full_name, pack_def(e, UPB_DEFTYPE_ENUM))); + symtab_add(ctx, e->full_name, pack_def(e, UPB_DEFTYPE_ENUM)); - CHK_OOM(upb_strtable_init2(&e->ntoi, UPB_CTYPE_INT32, ctx->alloc)); + values = google_protobuf_EnumDescriptorProto_value(enum_proto, &n); + CHK_OOM(upb_strtable_init2(&e->ntoi, UPB_CTYPE_INT32, n, ctx->alloc)); CHK_OOM(upb_inttable_init2(&e->iton, UPB_CTYPE_CSTR, ctx->alloc)); e->file = ctx->file; e->defaultval = 0; - values = google_protobuf_EnumDescriptorProto_value(enum_proto, &n); - if (n == 0) { - upb_status_seterrf(ctx->status, - "enums must contain at least one value (%s)", - e->full_name); - return false; + symtab_errf(ctx, "enums must contain at least one value (%s)", + e->full_name); } for (i = 0; i < n; i++) { @@ -5021,15 +5014,12 @@ static bool create_enumdef( upb_value v = upb_value_int32(num); if (i == 0 && e->file->syntax == UPB_SYNTAX_PROTO3 && num != 0) { - upb_status_seterrf(ctx->status, - "for proto3, the first enum value must be zero (%s)", - e->full_name); - return false; + symtab_errf(ctx, "for proto3, the first enum value must be zero (%s)", + e->full_name); } if (upb_strtable_lookup(&e->ntoi, name2, NULL)) { - upb_status_seterrf(ctx->status, "duplicate enum label '%s'", name2); - return false; + symtab_errf(ctx, "duplicate enum label '%s'", name2); } CHK_OOM(name2) @@ -5043,11 +5033,9 @@ static bool create_enumdef( } upb_inttable_compact2(&e->iton, ctx->alloc); - - return true; } -static bool create_msgdef(symtab_addctx *ctx, const char *prefix, +static void create_msgdef(symtab_addctx *ctx, const char *prefix, const google_protobuf_DescriptorProto *msg_proto) { upb_msgdef *m; const google_protobuf_MessageOptions *options; @@ -5055,18 +5043,22 @@ static bool create_msgdef(symtab_addctx *ctx, const char *prefix, const google_protobuf_FieldDescriptorProto *const *fields; const google_protobuf_EnumDescriptorProto *const *enums; const google_protobuf_DescriptorProto *const *msgs; - size_t i, n; + size_t i, n_oneof, n_field, n; upb_strview name; name = google_protobuf_DescriptorProto_name(msg_proto); - CHK(upb_isident(name, false, ctx->status)); + check_ident(ctx, name, false); m = (upb_msgdef*)&ctx->file->msgs[ctx->file->msg_count++]; m->full_name = makefullname(ctx, prefix, name); - CHK_OOM(symtab_add(ctx, m->full_name, pack_def(m, UPB_DEFTYPE_MSG))); + symtab_add(ctx, m->full_name, pack_def(m, UPB_DEFTYPE_MSG)); + + oneofs = google_protobuf_DescriptorProto_oneof_decl(msg_proto, &n_oneof); + fields = google_protobuf_DescriptorProto_field(msg_proto, &n_field); CHK_OOM(upb_inttable_init2(&m->itof, UPB_CTYPE_CONSTPTR, ctx->alloc)); - CHK_OOM(upb_strtable_init2(&m->ntof, UPB_CTYPE_CONSTPTR, ctx->alloc)); + CHK_OOM(upb_strtable_init2(&m->ntof, UPB_CTYPE_CONSTPTR, n_oneof + n_field, + ctx->alloc)); m->file = ctx->file; m->map_entry = false; @@ -5082,25 +5074,23 @@ static bool create_msgdef(symtab_addctx *ctx, const char *prefix, ctx->layouts++; } else { /* Allocate now (to allow cross-linking), populate later. */ - m->layout = upb_malloc(ctx->alloc, sizeof(*m->layout)); + m->layout = symtab_alloc(ctx, sizeof(*m->layout)); } - oneofs = google_protobuf_DescriptorProto_oneof_decl(msg_proto, &n); m->oneof_count = 0; - m->oneofs = upb_malloc(ctx->alloc, sizeof(*m->oneofs) * n); - for (i = 0; i < n; i++) { - CHK(create_oneofdef(ctx, m, oneofs[i])); + m->oneofs = symtab_alloc(ctx, sizeof(*m->oneofs) * n_oneof); + for (i = 0; i < n_oneof; i++) { + create_oneofdef(ctx, m, oneofs[i]); } - fields = google_protobuf_DescriptorProto_field(msg_proto, &n); m->field_count = 0; - m->fields = upb_malloc(ctx->alloc, sizeof(*m->fields) * n); - for (i = 0; i < n; i++) { - CHK(create_fielddef(ctx, m->full_name, m, fields[i])); + m->fields = symtab_alloc(ctx, sizeof(*m->fields) * n_field); + for (i = 0; i < n_field; i++) { + create_fielddef(ctx, m->full_name, m, fields[i]); } - CHK(assign_msg_indices(m, ctx->status)); - CHK(check_oneofs(m, ctx->status)); + assign_msg_indices(ctx, m); + finalize_oneofs(ctx, m); assign_msg_wellknowntype(m); upb_inttable_compact2(&m->itof, ctx->alloc); @@ -5108,93 +5098,78 @@ static bool create_msgdef(symtab_addctx *ctx, const char *prefix, enums = google_protobuf_DescriptorProto_enum_type(msg_proto, &n); for (i = 0; i < n; i++) { - CHK(create_enumdef(ctx, m->full_name, enums[i])); + create_enumdef(ctx, m->full_name, enums[i]); } msgs = google_protobuf_DescriptorProto_nested_type(msg_proto, &n); for (i = 0; i < n; i++) { - CHK(create_msgdef(ctx, m->full_name, msgs[i])); + create_msgdef(ctx, m->full_name, msgs[i]); } - - return true; } -typedef struct { - int msg_count; - int enum_count; - int ext_count; -} decl_counts; - static void count_types_in_msg(const google_protobuf_DescriptorProto *msg_proto, - decl_counts *counts) { + upb_filedef *file) { const google_protobuf_DescriptorProto *const *msgs; size_t i, n; - counts->msg_count++; + file->msg_count++; msgs = google_protobuf_DescriptorProto_nested_type(msg_proto, &n); for (i = 0; i < n; i++) { - count_types_in_msg(msgs[i], counts); + count_types_in_msg(msgs[i], file); } google_protobuf_DescriptorProto_enum_type(msg_proto, &n); - counts->enum_count += n; + file->enum_count += n; google_protobuf_DescriptorProto_extension(msg_proto, &n); - counts->ext_count += n; + file->ext_count += n; } static void count_types_in_file( const google_protobuf_FileDescriptorProto *file_proto, - decl_counts *counts) { + upb_filedef *file) { const google_protobuf_DescriptorProto *const *msgs; size_t i, n; msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); for (i = 0; i < n; i++) { - count_types_in_msg(msgs[i], counts); + count_types_in_msg(msgs[i], file); } google_protobuf_FileDescriptorProto_enum_type(file_proto, &n); - counts->enum_count += n; + file->enum_count += n; google_protobuf_FileDescriptorProto_extension(file_proto, &n); - counts->ext_count += n; + file->ext_count += n; } -static bool resolve_fielddef(const symtab_addctx *ctx, const char *prefix, +static void resolve_fielddef(symtab_addctx *ctx, const char *prefix, upb_fielddef *f) { upb_strview name; const google_protobuf_FieldDescriptorProto *field_proto = f->sub.unresolved; if (f->is_extension_) { if (!google_protobuf_FieldDescriptorProto_has_extendee(field_proto)) { - upb_status_seterrf(ctx->status, - "extension for field '%s' had no extendee", - f->full_name); - return false; + symtab_errf(ctx, "extension for field '%s' had no extendee", + f->full_name); } name = google_protobuf_FieldDescriptorProto_extendee(field_proto); f->msgdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_MSG); - CHK(f->msgdef); } if ((upb_fielddef_issubmsg(f) || f->type_ == UPB_DESCRIPTOR_TYPE_ENUM) && !google_protobuf_FieldDescriptorProto_has_type_name(field_proto)) { - upb_status_seterrf(ctx->status, "field '%s' is missing type name", - f->full_name); - return false; + symtab_errf(ctx, "field '%s' is missing type name", f->full_name); } name = google_protobuf_FieldDescriptorProto_type_name(field_proto); if (upb_fielddef_issubmsg(f)) { f->sub.msgdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_MSG); - CHK(f->sub.msgdef); } else if (f->type_ == UPB_DESCRIPTOR_TYPE_ENUM) { f->sub.enumdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_ENUM); - CHK(f->sub.enumdef); } /* Have to delay resolving of the default value until now because of the enum @@ -5204,54 +5179,36 @@ static bool resolve_fielddef(const symtab_addctx *ctx, const char *prefix, google_protobuf_FieldDescriptorProto_default_value(field_proto); if (f->file->syntax == UPB_SYNTAX_PROTO3) { - upb_status_seterrf(ctx->status, - "proto3 fields cannot have explicit defaults (%s)", - f->full_name); - return false; + symtab_errf(ctx, "proto3 fields cannot have explicit defaults (%s)", + f->full_name); } if (upb_fielddef_issubmsg(f)) { - upb_status_seterrf(ctx->status, - "message fields cannot have explicit defaults (%s)", - f->full_name); - return false; + symtab_errf(ctx, "message fields cannot have explicit defaults (%s)", + f->full_name); } - if (!parse_default(ctx, defaultval.data, defaultval.size, f)) { - upb_status_seterrf(ctx->status, - "couldn't parse default '" UPB_STRVIEW_FORMAT - "' for field (%s)", - UPB_STRVIEW_ARGS(defaultval), f->full_name); - return false; - } + parse_default(ctx, defaultval.data, defaultval.size, f); } else { set_default_default(ctx, f); } - - return true; } -static bool build_filedef( +static void build_filedef( symtab_addctx *ctx, upb_filedef *file, const google_protobuf_FileDescriptorProto *file_proto) { - upb_alloc *alloc = ctx->alloc; const google_protobuf_FileOptions *file_options_proto; const google_protobuf_DescriptorProto *const *msgs; const google_protobuf_EnumDescriptorProto *const *enums; const google_protobuf_FieldDescriptorProto *const *exts; const upb_strview* strs; size_t i, n; - decl_counts counts = {0, 0, 0}; - count_types_in_file(file_proto, &counts); + count_types_in_file(file_proto, file); - file->msgs = upb_malloc(alloc, sizeof(*file->msgs) * counts.msg_count); - file->enums = upb_malloc(alloc, sizeof(*file->enums) * counts.enum_count); - file->exts = upb_malloc(alloc, sizeof(*file->exts) * counts.ext_count); - - CHK_OOM(counts.msg_count == 0 || file->msgs); - CHK_OOM(counts.enum_count == 0 || file->enums); - CHK_OOM(counts.ext_count == 0 || file->exts); + file->msgs = symtab_alloc(ctx, sizeof(*file->msgs) * file->msg_count); + file->enums = symtab_alloc(ctx, sizeof(*file->enums) * file->enum_count); + file->exts = symtab_alloc(ctx, sizeof(*file->exts) * file->ext_count); /* We increment these as defs are added. */ file->msg_count = 0; @@ -5259,8 +5216,7 @@ static bool build_filedef( file->ext_count = 0; if (!google_protobuf_FileDescriptorProto_has_name(file_proto)) { - upb_status_seterrmsg(ctx->status, "File has no name"); - return false; + symtab_errf(ctx, "File has no name"); } file->name = @@ -5271,7 +5227,7 @@ static bool build_filedef( if (google_protobuf_FileDescriptorProto_has_package(file_proto)) { upb_strview package = google_protobuf_FileDescriptorProto_package(file_proto); - CHK(upb_isident(package, true, ctx->status)); + check_ident(ctx, package, true); file->package = strviewdup(ctx, package); } else { file->package = NULL; @@ -5286,9 +5242,8 @@ static bool build_filedef( } else if (streql_view(syntax, "proto3")) { file->syntax = UPB_SYNTAX_PROTO3; } else { - upb_status_seterrf(ctx->status, "Invalid syntax '" UPB_STRVIEW_FORMAT "'", - UPB_STRVIEW_ARGS(syntax)); - return false; + symtab_errf(ctx, "Invalid syntax '" UPB_STRVIEW_FORMAT "'", + UPB_STRVIEW_ARGS(syntax)); } } else { file->syntax = UPB_SYNTAX_PROTO2; @@ -5310,19 +5265,17 @@ static bool build_filedef( /* Verify dependencies. */ strs = google_protobuf_FileDescriptorProto_dependency(file_proto, &n); - file->deps = upb_malloc(alloc, sizeof(*file->deps) * n) ; - CHK_OOM(n == 0 || file->deps); + file->deps = symtab_alloc(ctx, sizeof(*file->deps) * n); for (i = 0; i < n; i++) { upb_strview dep_name = strs[i]; upb_value v; if (!upb_strtable_lookup2(&ctx->symtab->files, dep_name.data, dep_name.size, &v)) { - upb_status_seterrf(ctx->status, - "Depends on file '" UPB_STRVIEW_FORMAT - "', but it has not been loaded", - UPB_STRVIEW_ARGS(dep_name)); - return false; + symtab_errf(ctx, + "Depends on file '" UPB_STRVIEW_FORMAT + "', but it has not been loaded", + UPB_STRVIEW_ARGS(dep_name)); } file->deps[i] = upb_value_getconstptr(v); } @@ -5330,194 +5283,98 @@ static bool build_filedef( /* Create messages. */ msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); for (i = 0; i < n; i++) { - CHK(create_msgdef(ctx, file->package, msgs[i])); + create_msgdef(ctx, file->package, msgs[i]); } /* Create enums. */ enums = google_protobuf_FileDescriptorProto_enum_type(file_proto, &n); for (i = 0; i < n; i++) { - CHK(create_enumdef(ctx, file->package, enums[i])); + create_enumdef(ctx, file->package, enums[i]); } /* Create extensions. */ exts = google_protobuf_FileDescriptorProto_extension(file_proto, &n); - file->exts = upb_malloc(alloc, sizeof(*file->exts) * n); - CHK_OOM(n == 0 || file->exts); + file->exts = symtab_alloc(ctx, sizeof(*file->exts) * n); for (i = 0; i < n; i++) { - CHK(create_fielddef(ctx, file->package, NULL, exts[i])); + create_fielddef(ctx, file->package, NULL, exts[i]); } /* Now that all names are in the table, build layouts and resolve refs. */ for (i = 0; i < (size_t)file->ext_count; i++) { - CHK(resolve_fielddef(ctx, file->package, (upb_fielddef*)&file->exts[i])); + resolve_fielddef(ctx, file->package, (upb_fielddef*)&file->exts[i]); } for (i = 0; i < (size_t)file->msg_count; i++) { const upb_msgdef *m = &file->msgs[i]; int j; for (j = 0; j < m->field_count; j++) { - CHK(resolve_fielddef(ctx, m->full_name, (upb_fielddef*)&m->fields[j])); + resolve_fielddef(ctx, m->full_name, (upb_fielddef*)&m->fields[j]); } } if (!ctx->layouts) { for (i = 0; i < (size_t)file->msg_count; i++) { const upb_msgdef *m = &file->msgs[i]; - make_layout(ctx->symtab, m); + make_layout(ctx, m); } } +} - return true; - } - -static bool upb_symtab_addtotabs(upb_symtab *s, symtab_addctx *ctx) { - const upb_filedef *file = ctx->file; +static void remove_filedef(upb_symtab *s, upb_filedef *file) { upb_alloc *alloc = upb_arena_alloc(s->arena); - upb_strtable_iter iter; - - CHK_OOM(upb_strtable_insert3(&s->files, file->name, strlen(file->name), - upb_value_constptr(file), alloc)); - - upb_strtable_begin(&iter, ctx->addtab); - for (; !upb_strtable_done(&iter); upb_strtable_next(&iter)) { - upb_strview key = upb_strtable_iter_key(&iter); - upb_value value = upb_strtable_iter_value(&iter); - CHK_OOM(upb_strtable_insert3(&s->syms, key.data, key.size, value, alloc)); + int i; + for (i = 0; i < file->msg_count; i++) { + const char *name = file->msgs[i].full_name; + upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc); } - - return true; -} - -/* upb_filedef ****************************************************************/ - -const char *upb_filedef_name(const upb_filedef *f) { - return f->name; -} - -const char *upb_filedef_package(const upb_filedef *f) { - return f->package; -} - -const char *upb_filedef_phpprefix(const upb_filedef *f) { - return f->phpprefix; -} - -const char *upb_filedef_phpnamespace(const upb_filedef *f) { - return f->phpnamespace; -} - -upb_syntax_t upb_filedef_syntax(const upb_filedef *f) { - return f->syntax; -} - -int upb_filedef_msgcount(const upb_filedef *f) { - return f->msg_count; -} - -int upb_filedef_depcount(const upb_filedef *f) { - return f->dep_count; -} - -int upb_filedef_enumcount(const upb_filedef *f) { - return f->enum_count; -} - -const upb_filedef *upb_filedef_dep(const upb_filedef *f, int i) { - return i < 0 || i >= f->dep_count ? NULL : f->deps[i]; -} - -const upb_msgdef *upb_filedef_msg(const upb_filedef *f, int i) { - return i < 0 || i >= f->msg_count ? NULL : &f->msgs[i]; -} - -const upb_enumdef *upb_filedef_enum(const upb_filedef *f, int i) { - return i < 0 || i >= f->enum_count ? NULL : &f->enums[i]; -} - -void upb_symtab_free(upb_symtab *s) { - upb_arena_free(s->arena); - upb_gfree(s); -} - -upb_symtab *upb_symtab_new(void) { - upb_symtab *s = upb_gmalloc(sizeof(*s)); - upb_alloc *alloc; - - if (!s) { - return NULL; + for (i = 0; i < file->enum_count; i++) { + const char *name = file->enums[i].full_name; + upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc); } - - s->arena = upb_arena_new(); - alloc = upb_arena_alloc(s->arena); - - if (!upb_strtable_init2(&s->syms, UPB_CTYPE_CONSTPTR, alloc) || - !upb_strtable_init2(&s->files, UPB_CTYPE_CONSTPTR, alloc)) { - upb_arena_free(s->arena); - upb_gfree(s); - s = NULL; + for (i = 0; i < file->ext_count; i++) { + const char *name = file->exts[i].full_name; + upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc); } - return s; -} - -const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym) { - upb_value v; - return upb_strtable_lookup(&s->syms, sym, &v) ? - unpack_def(v, UPB_DEFTYPE_MSG) : NULL; -} - -const upb_msgdef *upb_symtab_lookupmsg2(const upb_symtab *s, const char *sym, - size_t len) { - upb_value v; - return upb_strtable_lookup2(&s->syms, sym, len, &v) ? - unpack_def(v, UPB_DEFTYPE_MSG) : NULL; -} - -const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym) { - upb_value v; - return upb_strtable_lookup(&s->syms, sym, &v) ? - unpack_def(v, UPB_DEFTYPE_ENUM) : NULL; -} - -const upb_filedef *upb_symtab_lookupfile(const upb_symtab *s, const char *name) { - upb_value v; - return upb_strtable_lookup(&s->files, name, &v) ? upb_value_getconstptr(v) - : NULL; -} - -const upb_filedef *upb_symtab_lookupfile2( - const upb_symtab *s, const char *name, size_t len) { - upb_value v; - return upb_strtable_lookup2(&s->files, name, len, &v) ? - upb_value_getconstptr(v) : NULL; -} - -int upb_symtab_filecount(const upb_symtab *s) { - return (int)upb_strtable_count(&s->files); } static const upb_filedef *_upb_symtab_addfile( upb_symtab *s, const google_protobuf_FileDescriptorProto *file_proto, const upb_msglayout **layouts, upb_status *status) { - upb_arena *tmparena = upb_arena_new(); - upb_strtable addtab; - upb_alloc *alloc = upb_arena_alloc(s->arena); - upb_filedef *file = upb_malloc(alloc, sizeof(*file)); - bool ok; + upb_arena *file_arena = upb_arena_new(); + upb_filedef *file; symtab_addctx ctx; + if (!file_arena) return NULL; + + file = upb_arena_malloc(file_arena, sizeof(*file)); + if (!file) goto done; + ctx.file = file; ctx.symtab = s; - ctx.alloc = alloc; - ctx.tmp = upb_arena_alloc(tmparena); - ctx.addtab = &addtab; + ctx.file_arena = file_arena; + ctx.alloc = upb_arena_alloc(file_arena); ctx.layouts = layouts; ctx.status = status; - ok = file && upb_strtable_init2(&addtab, UPB_CTYPE_CONSTPTR, ctx.tmp) && - build_filedef(&ctx, file, file_proto) && upb_symtab_addtotabs(s, &ctx); + file->msg_count = 0; + file->enum_count = 0; + file->ext_count = 0; + + if (UPB_UNLIKELY(setjmp(ctx.err))) { + UPB_ASSERT(!upb_ok(status)); + remove_filedef(s, file); + file = NULL; + } else { + build_filedef(&ctx, file, file_proto); + upb_strtable_insert3(&s->files, file->name, strlen(file->name), + upb_value_constptr(file), ctx.alloc); + UPB_ASSERT(upb_ok(status)); + upb_arena_fuse(s->arena, file_arena); + } - upb_arena_free(tmparena); - return ok ? file : NULL; +done: + upb_arena_free(file_arena); + return file; } const upb_filedef *upb_symtab_addfile( @@ -5551,6 +5408,7 @@ bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init) { file = google_protobuf_FileDescriptorProto_parse( init->descriptor.data, init->descriptor.size, arena); + s->bytes_loaded += init->descriptor.size; if (!file) { upb_status_seterrf( @@ -5573,7 +5431,10 @@ err: return false; } -#undef CHK +size_t _upb_symtab_bytesloaded(const upb_symtab *s) { + return s->bytes_loaded; +} + #undef CHK_OOM @@ -5621,6 +5482,21 @@ static char _upb_fieldtype_to_mapsize[12] = { 0, /* UPB_TYPE_BYTES */ }; +static const char _upb_fieldtype_to_sizelg2[12] = { + 0, + 0, /* UPB_TYPE_BOOL */ + 2, /* UPB_TYPE_FLOAT */ + 2, /* UPB_TYPE_INT32 */ + 2, /* UPB_TYPE_UINT32 */ + 2, /* UPB_TYPE_ENUM */ + UPB_SIZE(2, 3), /* UPB_TYPE_MESSAGE */ + 3, /* UPB_TYPE_DOUBLE */ + 3, /* UPB_TYPE_INT64 */ + 3, /* UPB_TYPE_UINT64 */ + UPB_SIZE(3, 4), /* UPB_TYPE_STRING */ + UPB_SIZE(3, 4), /* UPB_TYPE_BYTES */ +}; + /** upb_msg *******************************************************************/ upb_msg *upb_msg_new(const upb_msgdef *m, upb_arena *a) { @@ -5654,24 +5530,17 @@ bool upb_msg_has(const upb_msg *msg, const upb_fielddef *f) { const upb_fielddef *upb_msg_whichoneof(const upb_msg *msg, const upb_oneofdef *o) { - upb_oneof_iter i; - const upb_fielddef *f; - const upb_msglayout_field *field; - const upb_msgdef *m = upb_oneofdef_containingtype(o); - uint32_t oneof_case; - - /* This is far from optimal. */ - upb_oneof_begin(&i, o); - if (upb_oneof_done(&i)) return false; - f = upb_oneof_iter_field(&i); - field = upb_fielddef_layout(f); - if (in_oneof(field)) { - oneof_case = _upb_getoneofcase_field(msg, field); + const upb_fielddef *f = upb_oneofdef_field(o, 0); + if (upb_oneofdef_issynthetic(o)) { + UPB_ASSERT(upb_oneofdef_fieldcount(o) == 1); + return upb_msg_has(msg, f) ? f : NULL; } else { - return _upb_hasbit_field(msg, field) ? f : NULL; + const upb_msglayout_field *field = upb_fielddef_layout(f); + uint32_t oneof_case = _upb_getoneofcase_field(msg, field); + f = oneof_case ? upb_oneofdef_itof(o, oneof_case) : NULL; + UPB_ASSERT((f != NULL) == (oneof_case != 0)); + return f; } - - return oneof_case ? upb_msgdef_itof(m, oneof_case) : NULL; } upb_msgval upb_msg_get(const upb_msg *msg, const upb_fielddef *f) { @@ -5784,11 +5653,12 @@ void upb_msg_clear(upb_msg *msg, const upb_msgdef *m) { bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m, const upb_symtab *ext_pool, const upb_fielddef **out_f, upb_msgval *out_val, size_t *iter) { - size_t i = *iter; + int i = *iter; + int n = upb_msgdef_fieldcount(m); const upb_msgval zero = {0}; - const upb_fielddef *f; UPB_UNUSED(ext_pool); - while ((f = _upb_msgdef_field(m, (int)++i)) != NULL) { + while (++i < n) { + const upb_fielddef *f = upb_msgdef_field(m, i); upb_msgval val = _upb_msg_getraw(msg, f); /* Skip field if unset or empty. */ @@ -5873,7 +5743,7 @@ bool upb_msg_discardunknown(upb_msg *msg, const upb_msgdef *m, int maxdepth) { /** upb_array *****************************************************************/ upb_array *upb_array_new(upb_arena *a, upb_fieldtype_t type) { - return _upb_array_new(a, type); + return _upb_array_new(a, 4, _upb_fieldtype_to_sizelg2[type]); } size_t upb_array_size(const upb_array *arr) { @@ -5997,6 +5867,7 @@ int msvc_snprintf(char* s, size_t n, const char* format, ...) { #include #include #include +#include #include #include #include @@ -6031,6 +5902,19 @@ static bool jsondec_streql(upb_strview str, const char *lit) { return str.size == strlen(lit) && memcmp(str.data, lit, str.size) == 0; } +static bool jsondec_isnullvalue(const upb_fielddef *f) { + return upb_fielddef_type(f) == UPB_TYPE_ENUM && + strcmp(upb_enumdef_fullname(upb_fielddef_enumsubdef(f)), + "google.protobuf.NullValue") == 0; +} + +static bool jsondec_isvalue(const upb_fielddef *f) { + return (upb_fielddef_type(f) == UPB_TYPE_MESSAGE && + upb_msgdef_wellknowntype(upb_fielddef_msgsubdef(f)) == + UPB_WELLKNOWN_VALUE) || + jsondec_isnullvalue(f); +} + UPB_NORETURN static void jsondec_err(jsondec *d, const char *msg) { upb_status_seterrf(d->status, "Error parsing JSON @%d:%d: %s", d->line, (int)(d->ptr - d->line_begin), msg); @@ -6371,6 +6255,8 @@ static void jsondec_resize(jsondec *d, char **buf, char **end, char **buf_end) { size_t size = UPB_MAX(8, 2 * oldsize); *buf = upb_arena_realloc(d->arena, *buf, len, size); + if (!*buf) jsondec_err(d, "Out of memory"); + *end = *buf + len; *buf_end = *buf + size; } @@ -6723,11 +6609,11 @@ static upb_msgval jsondec_double(jsondec *d, const upb_fielddef *f) { case JD_STRING: str = jsondec_string(d); if (jsondec_streql(str, "NaN")) { - val.double_val = UPB_NAN; + val.double_val = NAN; } else if (jsondec_streql(str, "Infinity")) { - val.double_val = UPB_INFINITY; + val.double_val = INFINITY; } else if (jsondec_streql(str, "-Infinity")) { - val.double_val = -UPB_INFINITY; + val.double_val = -INFINITY; } else { val.double_val = strtod(str.data, NULL); } @@ -6737,7 +6623,7 @@ static upb_msgval jsondec_double(jsondec *d, const upb_fielddef *f) { } if (upb_fielddef_type(f) == UPB_TYPE_FLOAT) { - if (val.double_val != UPB_INFINITY && val.double_val != -UPB_INFINITY && + if (val.double_val != INFINITY && val.double_val != -INFINITY && (val.double_val > FLT_MAX || val.double_val < -FLT_MAX)) { jsondec_err(d, "Float out of range"); } @@ -6758,21 +6644,32 @@ static upb_msgval jsondec_strfield(jsondec *d, const upb_fielddef *f) { } static upb_msgval jsondec_enum(jsondec *d, const upb_fielddef *f) { - if (jsondec_peek(d) == JD_STRING) { - const upb_enumdef *e = upb_fielddef_enumsubdef(f); - upb_strview str = jsondec_string(d); - upb_msgval val; - if (!upb_enumdef_ntoi(e, str.data, str.size, &val.int32_val)) { - if (d->options & UPB_JSONDEC_IGNOREUNKNOWN) { + switch (jsondec_peek(d)) { + case JD_STRING: { + const upb_enumdef *e = upb_fielddef_enumsubdef(f); + upb_strview str = jsondec_string(d); + upb_msgval val; + if (!upb_enumdef_ntoi(e, str.data, str.size, &val.int32_val)) { + if (d->options & UPB_JSONDEC_IGNOREUNKNOWN) { + val.int32_val = 0; + } else { + jsondec_errf(d, "Unknown enumerator: '" UPB_STRVIEW_FORMAT "'", + UPB_STRVIEW_ARGS(str)); + } + } + return val; + } + case JD_NULL: { + if (jsondec_isnullvalue(f)) { + upb_msgval val; + jsondec_null(d); val.int32_val = 0; - } else { - jsondec_errf(d, "Unknown enumerator: '" UPB_STRVIEW_FORMAT "'", - UPB_STRVIEW_ARGS(str)); + return val; } } - return val; - } else { - return jsondec_int(d, f); + /* Fallthrough. */ + default: + return jsondec_int(d, f); } } @@ -6856,12 +6753,6 @@ static upb_msgval jsondec_msg(jsondec *d, const upb_fielddef *f) { return val; } -static bool jsondec_isvalue(const upb_fielddef *f) { - return upb_fielddef_type(f) == UPB_TYPE_MESSAGE && - upb_msgdef_wellknowntype(upb_fielddef_msgsubdef(f)) == - UPB_WELLKNOWN_VALUE; -} - static void jsondec_field(jsondec *d, upb_msg *msg, const upb_msgdef *m) { upb_strview name; const upb_fielddef *f; @@ -7067,6 +6958,7 @@ static void jsondec_duration(jsondec *d, upb_msg *msg, const upb_msgdef *m) { upb_strview str = jsondec_string(d); const char *ptr = str.data; const char *end = ptr + str.size; + const int64_t max = (uint64_t)3652500 * 86400; /* "3.000000001s", "3s", etc. */ ptr = jsondec_buftoint64(d, ptr, end, &seconds.int64_val); @@ -7076,7 +6968,7 @@ static void jsondec_duration(jsondec *d, upb_msg *msg, const upb_msgdef *m) { jsondec_err(d, "Malformed duration"); } - if (seconds.int64_val < -315576000000LL || seconds.int64_val > 315576000000LL) { + if (seconds.int64_val < -max || seconds.int64_val > max) { jsondec_err(d, "Duration out of range"); } @@ -7413,12 +7305,14 @@ bool upb_json_decode(const char *buf, size_t size, upb_msg *msg, #include #include #include +#include +#include #include #include #include -#include +/* Must be last. */ typedef struct { char *buf, *ptr, *end; @@ -7482,7 +7376,7 @@ static void jsonenc_printf(jsonenc *e, const char *fmt, ...) { va_list args; va_start(args, fmt); - n = _upb_vsnprintf(e->ptr, have, fmt, args); + n = vsnprintf(e->ptr, have, fmt, args); va_end(args); if (UPB_LIKELY(have > n)) { @@ -7573,12 +7467,17 @@ static void jsonenc_duration(jsonenc *e, const upb_msg *msg, const upb_msgdef *m static void jsonenc_enum(int32_t val, const upb_fielddef *f, jsonenc *e) { const upb_enumdef *e_def = upb_fielddef_enumsubdef(f); - const char *name = upb_enumdef_iton(e_def, val); - if (name) { - jsonenc_printf(e, "\"%s\"", name); + if (strcmp(upb_enumdef_fullname(e_def), "google.protobuf.NullValue") == 0) { + jsonenc_putstr(e, "null"); } else { - jsonenc_printf(e, "%" PRId32, val); + const char *name = upb_enumdef_iton(e_def, val); + + if (name) { + jsonenc_printf(e, "\"%s\"", name); + } else { + jsonenc_printf(e, "%" PRId32, val); + } } } @@ -7669,9 +7568,9 @@ static void jsonenc_string(jsonenc *e, upb_strview str) { } static void jsonenc_double(jsonenc *e, const char *fmt, double val) { - if (val == UPB_INFINITY) { + if (val == INFINITY) { jsonenc_putstr(e, "\"Infinity\""); - } else if (val == -UPB_INFINITY) { + } else if (val == -INFINITY) { jsonenc_putstr(e, "\"-Infinity\""); } else if (val != val) { jsonenc_putstr(e, "\"NaN\""); @@ -8054,10 +7953,10 @@ static void jsonenc_msgfields(jsonenc *e, const upb_msg *msg, if (e->options & UPB_JSONENC_EMITDEFAULTS) { /* Iterate over all fields. */ - upb_msg_field_iter i; - for (upb_msg_field_begin(&i, m); !upb_msg_field_done(&i); - upb_msg_field_next(&i)) { - f = upb_msg_iter_field(&i); + int i = 0; + int n = upb_msgdef_fieldcount(m); + for (i = 0; i < n; i++) { + f = upb_msgdef_field(m, i); jsonenc_fieldval(e, f, upb_msg_get(msg, f), &first); } } else { @@ -8126,11 +8025,7 @@ size_t upb_json_encode(const upb_msg *msg, const upb_msgdef *m, #undef UPB_UNUSED #undef UPB_ASSUME #undef UPB_ASSERT -#undef UPB_ASSERT_DEBUGVAR #undef UPB_UNREACHABLE -#undef UPB_INFINITY -#undef UPB_NAN -#undef UPB_MSVC_VSNPRINTF -#undef _upb_snprintf -#undef _upb_vsnprintf -#undef _upb_va_copy +#undef UPB_POISON_MEMORY_REGION +#undef UPB_UNPOISON_MEMORY_REGION +#undef UPB_ASAN diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index dfaaf7a4e14711f8e479a985e342dd99e60576ef..d22b4aa0e0e19980a58353a2d36af3511778713c 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -21,6 +21,15 @@ * * This file is private and must not be included by users! */ + +#if !(__STDC_VERSION__ >= 199901L || __cplusplus >= 201103L) +#error upb requires C99 or C++11 +#endif + +#if (defined(_MSC_VER) && _MSC_VER < 1900) +#error upb requires MSVC >= 2015. +#endif + #include #include @@ -69,66 +78,21 @@ #define UPB_UNLIKELY(x) (x) #endif -/* Define UPB_BIG_ENDIAN manually if you're on big endian and your compiler - * doesn't provide these preprocessor symbols. */ -#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) -#define UPB_BIG_ENDIAN -#endif - /* Macros for function attributes on compilers that support them. */ #ifdef __GNUC__ #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) #define UPB_NOINLINE __attribute__((noinline)) #define UPB_NORETURN __attribute__((__noreturn__)) +#elif defined(_MSC_VER) +#define UPB_NOINLINE +#define UPB_FORCEINLINE +#define UPB_NORETURN __declspec(noreturn) #else /* !defined(__GNUC__) */ #define UPB_FORCEINLINE #define UPB_NOINLINE #define UPB_NORETURN #endif -#if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L -/* C99/C++11 versions. */ -#include -#define _upb_snprintf snprintf -#define _upb_vsnprintf vsnprintf -#define _upb_va_copy(a, b) va_copy(a, b) -#elif defined(_MSC_VER) -/* Microsoft C/C++ versions. */ -#include -#include -#if _MSC_VER < 1900 -int msvc_snprintf(char* s, size_t n, const char* format, ...); -int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg); -#define UPB_MSVC_VSNPRINTF -#define _upb_snprintf msvc_snprintf -#define _upb_vsnprintf msvc_vsnprintf -#else -#define _upb_snprintf snprintf -#define _upb_vsnprintf vsnprintf -#endif -#define _upb_va_copy(a, b) va_copy(a, b) -#elif defined __GNUC__ -/* A few hacky workarounds for functions not in C89. - * For internal use only! - * TODO(haberman): fix these by including our own implementations, or finding - * another workaround. - */ -#define _upb_snprintf __builtin_snprintf -#define _upb_vsnprintf __builtin_vsnprintf -#define _upb_va_copy(a, b) __va_copy(a, b) -#else -#error Need implementations of [v]snprintf and va_copy -#endif - -#ifdef __cplusplus -#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || \ - (defined(_MSC_VER) && _MSC_VER >= 1900) -/* C++11 is present */ -#else -#error upb requires C++11 for C++ support -#endif -#endif - #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y)) #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y)) @@ -142,7 +106,7 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg); #elif defined _MSC_VER #define UPB_ASSUME(expr) if (!(expr)) __assume(0) #else -#define UPB_ASSUME(expr) do {} if (false && (expr)) +#define UPB_ASSUME(expr) do {} while (false && (expr)) #endif #else #define UPB_ASSUME(expr) assert(expr) @@ -156,28 +120,33 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg); #define UPB_ASSERT(expr) assert(expr) #endif -/* UPB_ASSERT_DEBUGVAR(): assert that uses functions or variables that only - * exist in debug mode. This turns into regular assert. */ -#define UPB_ASSERT_DEBUGVAR(expr) assert(expr) - #if defined(__GNUC__) || defined(__clang__) #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0) #else #define UPB_UNREACHABLE() do { assert(0); } while(0) #endif -/* UPB_INFINITY representing floating-point positive infinity. */ -#include -#ifdef INFINITY -#define UPB_INFINITY INFINITY -#else -#define UPB_INFINITY (1.0 / 0.0) +#if defined(__SANITIZE_ADDRESS__) +#define UPB_ASAN 1 +#ifdef __cplusplus +extern "C" { #endif -#ifdef NAN -#define UPB_NAN NAN -#else -#define UPB_NAN (0.0 / 0.0) +void __asan_poison_memory_region(void const volatile *addr, size_t size); +void __asan_unpoison_memory_region(void const volatile *addr, size_t size); +#ifdef __cplusplus +} /* extern "C" */ #endif +#define UPB_POISON_MEMORY_REGION(addr, size) \ + __asan_poison_memory_region((addr), (size)) +#define UPB_UNPOISON_MEMORY_REGION(addr, size) \ + __asan_unpoison_memory_region((addr), (size)) +#else +#define UPB_ASAN 0 +#define UPB_POISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#define UPB_UNPOISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#endif /* ** upb_decode: parsing into a upb_msg using a upb_msglayout. */ @@ -213,7 +182,7 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg); ** store pointers or integers of at least 32 bits (upb isn't really useful on ** systems where sizeof(void*) < 4). ** -** The table must be homogenous (all values of the same type). In debug +** The table must be homogeneous (all values of the same type). In debug ** mode, we check this on insert and lookup. */ @@ -384,17 +353,35 @@ void *_upb_arena_slowmalloc(upb_arena *a, size_t size); UPB_INLINE upb_alloc *upb_arena_alloc(upb_arena *a) { return (upb_alloc*)a; } +UPB_INLINE bool _upb_arenahas(upb_arena *a, size_t size) { + _upb_arena_head *h = (_upb_arena_head*)a; + return (size_t)(h->end - h->ptr) >= size; +} + UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) { _upb_arena_head *h = (_upb_arena_head*)a; void* ret; size = UPB_ALIGN_MALLOC(size); - if (UPB_UNLIKELY((size_t)(h->end - h->ptr) < size)) { + if (UPB_UNLIKELY(!_upb_arenahas(a, size))) { return _upb_arena_slowmalloc(a, size); } ret = h->ptr; h->ptr += size; + UPB_UNPOISON_MEMORY_REGION(ret, size); + +#if UPB_ASAN + { + size_t guard_size = 32; + if (_upb_arenahas(a, guard_size)) { + h->ptr += guard_size; + } else { + h->ptr = h->end; + } + } +#endif + return ret; } @@ -496,6 +483,39 @@ typedef enum { #define UPB_MAP_BEGIN ((size_t)-1) +UPB_INLINE bool _upb_isle(void) { + int x = 1; + return *(char*)&x == 1; +} + +UPB_INLINE uint32_t _upb_be_swap32(uint32_t val) { + if (_upb_isle()) { + return val; + } else { + return ((val & 0xff) << 24) | ((val & 0xff00) << 8) | + ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24); + } +} + +UPB_INLINE uint64_t _upb_be_swap64(uint64_t val) { + if (_upb_isle()) { + return val; + } else { + return ((uint64_t)_upb_be_swap32(val) << 32) | _upb_be_swap32(val >> 32); + } +} + +UPB_INLINE int _upb_lg2ceil(int x) { + if (x <= 1) return 0; +#ifdef __GNUC__ + return 32 - __builtin_clz(x - 1); +#else + int lg2 = 0; + while (1 << lg2 < x) lg2++; + return lg2; +#endif +} + #ifdef __cplusplus } /* extern "C" */ @@ -649,7 +669,8 @@ typedef struct _upb_tabent { typedef struct { size_t count; /* Number of entries in the hash part. */ - size_t mask; /* Mask to turn hash value -> bucket. */ + uint32_t mask; /* Mask to turn hash value -> bucket. */ + uint32_t max_count; /* Max count before we hit our load limit. */ uint8_t size_lg2; /* Size of the hashtable part is 2^size_lg2 entries. */ /* Hash table entries. @@ -708,7 +729,8 @@ UPB_INLINE bool upb_arrhas(upb_tabval key) { /* Initialize and uninitialize a table, respectively. If memory allocation * failed, false is returned that the table is uninitialized. */ bool upb_inttable_init2(upb_inttable *table, upb_ctype_t ctype, upb_alloc *a); -bool upb_strtable_init2(upb_strtable *table, upb_ctype_t ctype, upb_alloc *a); +bool upb_strtable_init2(upb_strtable *table, upb_ctype_t ctype, + size_t expected_size, upb_alloc *a); void upb_inttable_uninit2(upb_inttable *table, upb_alloc *a); void upb_strtable_uninit2(upb_strtable *table, upb_alloc *a); @@ -717,7 +739,7 @@ UPB_INLINE bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype) { } UPB_INLINE bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype) { - return upb_strtable_init2(table, ctype, &upb_alloc_global); + return upb_strtable_init2(table, ctype, 4, &upb_alloc_global); } UPB_INLINE void upb_inttable_uninit(upb_inttable *table) { @@ -989,25 +1011,42 @@ typedef struct upb_msglayout { * compatibility. We put these before the user's data. The user's upb_msg* * points after the upb_msg_internal. */ -/* Used when a message is not extendable. */ typedef struct { - char *unknown; - size_t unknown_len; - size_t unknown_size; -} upb_msg_internal; + uint32_t len; + uint32_t size; + /* Data follows. */ +} upb_msg_unknowndata; -/* Used when a message is extendable. */ +/* Used when a message is not extendable. */ typedef struct { - upb_inttable *extdict; - upb_msg_internal base; -} upb_msg_internal_withext; + upb_msg_unknowndata *unknown; +} upb_msg_internal; /* Maps upb_fieldtype_t -> memory size. */ extern char _upb_fieldtype_to_size[12]; +UPB_INLINE size_t upb_msg_sizeof(const upb_msglayout *l) { + return l->size + sizeof(upb_msg_internal); +} + +UPB_INLINE upb_msg *_upb_msg_new_inl(const upb_msglayout *l, upb_arena *a) { + size_t size = upb_msg_sizeof(l); + void *mem = upb_arena_malloc(a, size); + upb_msg *msg; + if (UPB_UNLIKELY(!mem)) return NULL; + msg = UPB_PTR_AT(mem, sizeof(upb_msg_internal), upb_msg); + memset(mem, 0, size); + return msg; +} + /* Creates a new messages with the given layout on the given arena. */ upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a); +UPB_INLINE upb_msg_internal *upb_msg_getinternal(upb_msg *msg) { + ptrdiff_t size = sizeof(upb_msg_internal); + return (upb_msg_internal*)((char*)msg - size); +} + /* Clears the given message. */ void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l); @@ -1100,9 +1139,11 @@ typedef struct { uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */ size_t len; /* Measured in elements. */ size_t size; /* Measured in elements. */ + uint64_t junk; } upb_array; UPB_INLINE const void *_upb_array_constptr(const upb_array *arr) { + UPB_ASSERT((arr->data & 7) <= 4); return (void*)(arr->data & ~(uintptr_t)7); } @@ -1110,17 +1151,32 @@ UPB_INLINE void *_upb_array_ptr(upb_array *arr) { return (void*)_upb_array_constptr(arr); } -/* Creates a new array on the given arena. */ -upb_array *_upb_array_new(upb_arena *a, upb_fieldtype_t type); +UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) { + UPB_ASSERT(elem_size_lg2 <= 4); + UPB_ASSERT(((uintptr_t)ptr & 7) == 0); + return (uintptr_t)ptr | (unsigned)elem_size_lg2; +} + +UPB_INLINE upb_array *_upb_array_new(upb_arena *a, size_t init_size, + int elem_size_lg2) { + const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_array), 8); + const size_t bytes = sizeof(upb_array) + (init_size << elem_size_lg2); + upb_array *arr = (upb_array*)upb_arena_malloc(a, bytes); + if (!arr) return NULL; + arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2); + arr->len = 0; + arr->size = init_size; + return arr; +} /* Resizes the capacity of the array to be at least min_size. */ bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena); /* Fallback functions for when the accessors require a resize. */ void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size, - upb_fieldtype_t type, upb_arena *arena); + int elem_size_lg2, upb_arena *arena); bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value, - upb_fieldtype_t type, upb_arena *arena); + int elem_size_lg2, upb_arena *arena); UPB_INLINE bool _upb_array_reserve(upb_array *arr, size_t size, upb_arena *arena) { @@ -1159,29 +1215,28 @@ UPB_INLINE void *_upb_array_mutable_accessor(void *msg, size_t ofs, } } -UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size, - upb_fieldtype_t type, - upb_arena *arena) { - upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array*); +UPB_INLINE void *_upb_array_resize_accessor2(void *msg, size_t ofs, size_t size, + int elem_size_lg2, + upb_arena *arena) { + upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array *); upb_array *arr = *arr_ptr; if (!arr || arr->size < size) { - return _upb_array_resize_fallback(arr_ptr, size, type, arena); + return _upb_array_resize_fallback(arr_ptr, size, elem_size_lg2, arena); } arr->len = size; return _upb_array_ptr(arr); } - -UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs, - size_t elem_size, - upb_fieldtype_t type, - const void *value, - upb_arena *arena) { - upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array*); +UPB_INLINE bool _upb_array_append_accessor2(void *msg, size_t ofs, + int elem_size_lg2, + const void *value, + upb_arena *arena) { + upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array *); + size_t elem_size = 1 << elem_size_lg2; upb_array *arr = *arr_ptr; - void* ptr; + void *ptr; if (!arr || arr->len == arr->size) { - return _upb_array_append_fallback(arr_ptr, value, type, arena); + return _upb_array_append_fallback(arr_ptr, value, elem_size_lg2, arena); } ptr = _upb_array_ptr(arr); memcpy(PTR_AT(ptr, arr->len * elem_size, char), value, elem_size); @@ -1189,6 +1244,42 @@ UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs, return true; } +/* Used by old generated code, remove once all code has been regenerated. */ +UPB_INLINE int _upb_sizelg2(upb_fieldtype_t type) { + switch (type) { + case UPB_TYPE_BOOL: + return 0; + case UPB_TYPE_FLOAT: + case UPB_TYPE_INT32: + case UPB_TYPE_UINT32: + case UPB_TYPE_ENUM: + return 2; + case UPB_TYPE_MESSAGE: + return UPB_SIZE(2, 3); + case UPB_TYPE_DOUBLE: + case UPB_TYPE_INT64: + case UPB_TYPE_UINT64: + return 3; + case UPB_TYPE_STRING: + case UPB_TYPE_BYTES: + return UPB_SIZE(3, 4); + } + UPB_UNREACHABLE(); +} +UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size, + upb_fieldtype_t type, + upb_arena *arena) { + return _upb_array_resize_accessor2(msg, ofs, size, _upb_sizelg2(type), arena); +} +UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs, + size_t elem_size, upb_fieldtype_t type, + const void *value, + upb_arena *arena) { + (void)elem_size; + return _upb_array_append_accessor2(msg, ofs, _upb_sizelg2(type), value, + arena); +} + /** upb_map *******************************************************************/ /* Right now we use strmaps for everything. We'll likely want to use @@ -1245,17 +1336,17 @@ UPB_INLINE void _upb_map_fromkey(upb_strview key, void* out, size_t size) { } } -UPB_INLINE upb_value _upb_map_tovalue(const void *val, size_t size, - upb_arena *a) { - upb_value ret = {0}; +UPB_INLINE bool _upb_map_tovalue(const void *val, size_t size, upb_value *msgval, + upb_arena *a) { if (size == UPB_MAPTYPE_STRING) { upb_strview *strp = (upb_strview*)upb_arena_malloc(a, sizeof(*strp)); + if (!strp) return false; *strp = *(upb_strview*)val; - memcpy(&ret, &strp, sizeof(strp)); + *msgval = upb_value_ptr(strp); } else { - memcpy(&ret, val, size); + memcpy(msgval, val, size); } - return ret; + return true; } UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) { @@ -1297,7 +1388,8 @@ UPB_INLINE void* _upb_map_next(const upb_map *map, size_t *iter) { UPB_INLINE bool _upb_map_set(upb_map *map, const void *key, size_t key_size, void *val, size_t val_size, upb_arena *arena) { upb_strview strkey = _upb_map_tokey(key, key_size); - upb_value tabval = _upb_map_tovalue(val, val_size, arena); + upb_value tabval = {0}; + if (!_upb_map_tovalue(val, val_size, &tabval, arena)) return false; upb_alloc *a = upb_arena_alloc(arena); /* TODO(haberman): add overwrite operation to minimize number of lookups. */ @@ -1382,7 +1474,7 @@ UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, size_t size) /* This is like _upb_map_tovalue() except the entry already exists so we can * reuse the allocated upb_strview for string fields. */ if (size == UPB_MAPTYPE_STRING) { - upb_strview *strp = (upb_strview*)ent->val.val; + upb_strview *strp = (upb_strview*)(uintptr_t)ent->val.val; memcpy(strp, val, sizeof(*strp)); } else { memcpy(&ent->val.val, val, size); @@ -1410,6 +1502,34 @@ bool upb_decode(const char *buf, size_t size, upb_msg *msg, #endif #endif /* UPB_DECODE_H_ */ + +#ifndef UPB_INT_H_ +#define UPB_INT_H_ + + +struct mem_block; +typedef struct mem_block mem_block; + +struct upb_arena { + _upb_arena_head head; + uint32_t *cleanups; + + /* Allocator to allocate arena blocks. We are responsible for freeing these + * when we are destroyed. */ + upb_alloc *block_alloc; + uint32_t last_size; + + /* When multiple arenas are fused together, each arena points to a parent + * arena (root points to itself). The root tracks how many live arenas + * reference it. */ + uint32_t refcount; /* Only used when a->parent == a */ + struct upb_arena *parent; + + /* Linked list of blocks to free/cleanup. */ + mem_block *freelist, *freelist_tail; +}; + +#endif /* UPB_INT_H_ */ /* ** upb_encode: parsing into a upb_msg using a upb_msglayout. */ @@ -1602,12 +1722,12 @@ UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorS return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); } UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet *msg, size_t len, upb_arena *arena) { - return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet *msg, upb_arena *arena) { struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1660,22 +1780,22 @@ UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_mutable_dependency(g return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len); } UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) { - return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena); + return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena); } UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val, arena); } UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto *msg, size_t *len) { return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len); } UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1683,12 +1803,12 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorP return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len); } UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(44, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1696,12 +1816,12 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescript return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len); } UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(48, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1709,12 +1829,12 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptor return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len); } UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 104), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 104), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(52, 104), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(52, 104), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1748,20 +1868,20 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependenc return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 112), len); } UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) { - return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(56, 112), len, UPB_TYPE_INT32, arena); + return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 112), len, 2, arena); } UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(56, 112), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(56, 112), 2, &val, arena); } UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 120), len); } UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) { - return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(60, 120), len, UPB_TYPE_INT32, arena); + return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(60, 120), len, 2, arena); } UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(60, 120), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(60, 120), 2, &val, arena); } UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) { @@ -1811,12 +1931,12 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); } UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto *msg, upb_arena *arena) { struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1824,12 +1944,12 @@ UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mut return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); } UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) { struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1837,12 +1957,12 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); } UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) { struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1850,12 +1970,12 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_Desc return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); } UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) { struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1863,12 +1983,12 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len); } UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto *msg, upb_arena *arena) { struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1889,12 +2009,12 @@ UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProt return (google_protobuf_OneofDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len); } UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto *msg, upb_arena *arena) { struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1902,12 +2022,12 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_Descr return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len); } UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) { struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -1915,10 +2035,10 @@ UPB_INLINE upb_strview* google_protobuf_DescriptorProto_mutable_reserved_name(go return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len); } UPB_INLINE upb_strview* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) { - return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_STRING, arena); + return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena); } UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(44, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &val, arena); } @@ -2014,12 +2134,12 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeO return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2039,59 +2159,59 @@ UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_pro } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); } -UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); } -UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_strview); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 3); } -UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t); } +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 1); } -UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); } +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); } -UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); } +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); } -UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); } -UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); } -UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const google_protobuf_FieldOptions*); } +UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const google_protobuf_FieldOptions*); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); } -UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t); } +UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 10); } -UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_strview); } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); } -UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); } +UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) { _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) { _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_strview) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) { _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) { _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(76, 120), google_protobuf_FieldOptions*) = value; + *UPB_PTR_AT(msg, UPB_SIZE(64, 104), google_protobuf_FieldOptions*) = value; } UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg); @@ -2104,15 +2224,15 @@ UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorP } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) { _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) { _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_strview) = value; } UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value; } /* google.protobuf.OneofDescriptorProto */ @@ -2184,12 +2304,12 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescri return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); } UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2210,12 +2330,12 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protob return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); } UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2223,10 +2343,10 @@ UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_mutable_reserved_nam return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); } UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) { - return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena); + return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena); } UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena); } @@ -2330,12 +2450,12 @@ UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescri return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); } UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto *msg, size_t len, upb_arena *arena) { - return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) { struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2429,138 +2549,138 @@ UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_Fil } UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); } -UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); } -UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 1); } -UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); } +UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); } UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); } -UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); } +UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); } -UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); } -UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); } +UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); } -UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool); } +UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); } -UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool); } +UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); } -UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); } +UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); } -UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); } +UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); } -UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool); } +UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); } -UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool); } +UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); } -UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); } -UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); } -UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); } -UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); } -UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); } -UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); } +UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); } UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 19); } -UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview); } +UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_strview); } UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 20); } -UPB_INLINE upb_strview google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview); } -UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 192)); } -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(108, 192), len); } +UPB_INLINE upb_strview google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_strview); } +UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184)); } +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(100, 184), len); } UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 11); - *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 12); - *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; } UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 13); - *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 7); - *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 8); - *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 9); - *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 14); - *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 15); - *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 16); - *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 17); - *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 18); - *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { _upb_sethas(msg, 10); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value; } UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 19); - *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_strview) = value; } UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_strview value) { _upb_sethas(msg, 20); - *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview) = value; + *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_strview) = value; } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions *msg, size_t *len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 192), len); + return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 184), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(108, 192), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(108, 192), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2610,12 +2730,12 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_ return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(8, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2635,54 +2755,54 @@ UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_Fi } UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 1); } -UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); } +UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); } UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); } -UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); } +UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); } UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); } -UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); } +UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); } UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); } -UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); } +UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); } UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); } -UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); } +UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); } UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 6); } -UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); } -UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); } -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); } +UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool); } +UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 16)); } +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(16, 16), len); } UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; } UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { _upb_sethas(msg, 3); - *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value; } UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { _upb_sethas(msg, 4); - *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value; } UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { _upb_sethas(msg, 5); - *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value; } UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; } UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { _upb_sethas(msg, 6); - *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value; } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t *len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); + return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 16), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 16), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(28, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(16, 16), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2708,12 +2828,12 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mu return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2751,12 +2871,12 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mut return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2788,12 +2908,12 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOption return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2825,12 +2945,12 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_ return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2850,30 +2970,30 @@ UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_M } UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); } -UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); } +UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); } UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 1); } -UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); } -UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); } -UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); } +UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); } +UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); } +UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); } UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) { _upb_sethas(msg, 2); - *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value; + *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value; } UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { _upb_sethas(msg, 1); - *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value; + *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value; } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t *len) { - return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len); + return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(20, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2911,12 +3031,12 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_Uninte return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 80), len); } UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption *msg, size_t len, upb_arena *arena) { - return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 80), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 80), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption *msg, upb_arena *arena) { struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(56, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(56, 80), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -2994,12 +3114,12 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeI return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); } UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo *msg, size_t len, upb_arena *arena) { - return (google_protobuf_SourceCodeInfo_Location**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_SourceCodeInfo_Location**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo *msg, upb_arena *arena) { struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -3030,20 +3150,20 @@ UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); } UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) { - return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_INT32, arena); + return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(20, 40), len, 2, arena); } UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(20, 40), 2, &val, arena); } UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len); } UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) { - return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_INT32, arena); + return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, 2, arena); } UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(24, 48), 2, &val, arena); } UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) { @@ -3058,10 +3178,10 @@ UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_mutable_leading_ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len); } UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) { - return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena); + return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena); } UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val, arena); } @@ -3086,12 +3206,12 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_Genera return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); } UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo *msg, size_t len, upb_arena *arena) { - return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena); + return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena) { struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena); - bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + bool ok = _upb_array_append_accessor2( + msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } @@ -3122,10 +3242,10 @@ UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(go return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); } UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t len, upb_arena *arena) { - return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len, UPB_TYPE_INT32, arena); + return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(20, 32), len, 2, arena); } UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t val, upb_arena *arena) { - return _upb_array_append_accessor(msg, UPB_SIZE(20, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val, + return _upb_array_append_accessor2(msg, UPB_SIZE(20, 32), 2, &val, arena); } UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_strview value) { @@ -3262,9 +3382,10 @@ typedef upb_inttable_iter upb_oneof_iter; const char *upb_oneofdef_name(const upb_oneofdef *o); const upb_msgdef *upb_oneofdef_containingtype(const upb_oneofdef *o); -int upb_oneofdef_numfields(const upb_oneofdef *o); uint32_t upb_oneofdef_index(const upb_oneofdef *o); bool upb_oneofdef_issynthetic(const upb_oneofdef *o); +int upb_oneofdef_fieldcount(const upb_oneofdef *o); +const upb_fielddef *upb_oneofdef_field(const upb_oneofdef *o, int i); /* Oneof lookups: * - ntof: look up a field by name. @@ -3278,11 +3399,8 @@ UPB_INLINE const upb_fielddef *upb_oneofdef_ntofz(const upb_oneofdef *o, } const upb_fielddef *upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num); -/* upb_oneof_iter i; - * for(upb_oneof_begin(&i, e); !upb_oneof_done(&i); upb_oneof_next(&i)) { - * // ... - * } - */ +/* DEPRECATED, slated for removal. */ +int upb_oneofdef_numfields(const upb_oneofdef *o); void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o); void upb_oneof_next(upb_oneof_iter *iter); bool upb_oneof_done(upb_oneof_iter *iter); @@ -3290,6 +3408,7 @@ upb_fielddef *upb_oneof_iter_field(const upb_oneof_iter *iter); void upb_oneof_iter_setdone(upb_oneof_iter *iter); bool upb_oneof_iter_isequal(const upb_oneof_iter *iter1, const upb_oneof_iter *iter2); +/* END DEPRECATED */ /* upb_msgdef *****************************************************************/ @@ -3315,21 +3434,21 @@ typedef upb_strtable_iter upb_msg_oneof_iter; const char *upb_msgdef_fullname(const upb_msgdef *m); const upb_filedef *upb_msgdef_file(const upb_msgdef *m); const char *upb_msgdef_name(const upb_msgdef *m); -int upb_msgdef_numfields(const upb_msgdef *m); -int upb_msgdef_numoneofs(const upb_msgdef *m); -int upb_msgdef_numrealoneofs(const upb_msgdef *m); upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m); bool upb_msgdef_mapentry(const upb_msgdef *m); upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m); bool upb_msgdef_iswrapper(const upb_msgdef *m); bool upb_msgdef_isnumberwrapper(const upb_msgdef *m); +int upb_msgdef_fieldcount(const upb_msgdef *m); +int upb_msgdef_oneofcount(const upb_msgdef *m); +const upb_fielddef *upb_msgdef_field(const upb_msgdef *m, int i); +const upb_oneofdef *upb_msgdef_oneof(const upb_msgdef *m, int i); const upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i); const upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name, size_t len); const upb_oneofdef *upb_msgdef_ntoo(const upb_msgdef *m, const char *name, size_t len); const upb_msglayout *upb_msgdef_layout(const upb_msgdef *m); -const upb_fielddef *_upb_msgdef_field(const upb_msgdef *m, int i); UPB_INLINE const upb_oneofdef *upb_msgdef_ntooz(const upb_msgdef *m, const char *name) { @@ -3361,19 +3480,10 @@ UPB_INLINE bool upb_msgdef_lookupnamez(const upb_msgdef *m, const char *name, const upb_fielddef *upb_msgdef_lookupjsonname(const upb_msgdef *m, const char *name, size_t len); -/* Iteration over fields and oneofs. For example: - * - * upb_msg_field_iter i; - * for(upb_msg_field_begin(&i, m); - * !upb_msg_field_done(&i); - * upb_msg_field_next(&i)) { - * upb_fielddef *f = upb_msg_iter_field(&i); - * // ... - * } - * - * For C we don't have separate iterators for const and non-const. - * It is the caller's responsibility to cast the upb_fielddef* to - * const if the upb_msgdef* is const. */ +/* DEPRECATED, slated for removal */ +int upb_msgdef_numfields(const upb_msgdef *m); +int upb_msgdef_numoneofs(const upb_msgdef *m); +int upb_msgdef_numrealoneofs(const upb_msgdef *m); void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m); void upb_msg_field_next(upb_msg_field_iter *iter); bool upb_msg_field_done(const upb_msg_field_iter *iter); @@ -3381,9 +3491,6 @@ upb_fielddef *upb_msg_iter_field(const upb_msg_field_iter *iter); void upb_msg_field_iter_setdone(upb_msg_field_iter *iter); bool upb_msg_field_iter_isequal(const upb_msg_field_iter * iter1, const upb_msg_field_iter * iter2); - -/* Similar to above, we also support iterating through the oneofs in a - * msgdef. */ void upb_msg_oneof_begin(upb_msg_oneof_iter * iter, const upb_msgdef *m); void upb_msg_oneof_next(upb_msg_oneof_iter * iter); bool upb_msg_oneof_done(const upb_msg_oneof_iter *iter); @@ -3391,6 +3498,7 @@ const upb_oneofdef *upb_msg_iter_oneof(const upb_msg_oneof_iter *iter); void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter * iter); bool upb_msg_oneof_iter_isequal(const upb_msg_oneof_iter *iter1, const upb_msg_oneof_iter *iter2); +/* END DEPRECATED */ /* upb_enumdef ****************************************************************/ @@ -3415,11 +3523,6 @@ UPB_INLINE bool upb_enumdef_ntoiz(const upb_enumdef *e, } const char *upb_enumdef_iton(const upb_enumdef *e, int32_t num); -/* upb_enum_iter i; - * for(upb_enum_begin(&i, e); !upb_enum_done(&i); upb_enum_next(&i)) { - * // ... - * } - */ void upb_enum_begin(upb_enum_iter *iter, const upb_enumdef *e); void upb_enum_next(upb_enum_iter *iter); bool upb_enum_done(upb_enum_iter *iter); @@ -3455,6 +3558,7 @@ int upb_symtab_filecount(const upb_symtab *s); const upb_filedef *upb_symtab_addfile( upb_symtab *s, const google_protobuf_FileDescriptorProto *file, upb_status *status); +size_t _upb_symtab_bytesloaded(const upb_symtab *s); /* For generated code only: loads a generated descriptor. */ typedef struct upb_def_init { @@ -3827,7 +3931,7 @@ extern "C" { #endif enum { - /* When set, emits 0/default values. TOOD(haberman): proto3 only? */ + /* When set, emits 0/default values. TODO(haberman): proto3 only? */ UPB_JSONENC_EMITDEFAULTS = 1, /* When set, use normal (snake_caes) field names instead of JSON (camelCase) @@ -3872,11 +3976,7 @@ size_t upb_json_encode(const upb_msg *msg, const upb_msgdef *m, #undef UPB_UNUSED #undef UPB_ASSUME #undef UPB_ASSERT -#undef UPB_ASSERT_DEBUGVAR #undef UPB_UNREACHABLE -#undef UPB_INFINITY -#undef UPB_NAN -#undef UPB_MSVC_VSNPRINTF -#undef _upb_snprintf -#undef _upb_vsnprintf -#undef _upb_va_copy +#undef UPB_POISON_MEMORY_REGION +#undef UPB_UNPOISON_MEMORY_REGION +#undef UPB_ASAN diff --git a/php/ext/google/protobuf/protobuf.c b/php/ext/google/protobuf/protobuf.c index fa1cc114b1f4dae4c44db0c77dd060347b2ba506..761eeeb5325788533e3b30decc80318d01225e5c 100644 --- a/php/ext/google/protobuf/protobuf.c +++ b/php/ext/google/protobuf/protobuf.c @@ -35,7 +35,6 @@ #include "arena.h" #include "array.h" -#include "bundled_php.h" #include "convert.h" #include "def.h" #include "map.h" @@ -162,10 +161,6 @@ static PHP_RINIT_FUNCTION(protobuf) { upb_symtab *symtab = PROTOBUF_G(saved_symtab); DescriptorPool_CreateWithSymbolTable(&PROTOBUF_G(generated_pool), symtab); - // Set up autoloader for bundled sources. - zend_eval_string("spl_autoload_register('protobuf_internal_loadbundled');", - NULL, "autoload_register.php"); - zend_hash_init(&PROTOBUF_G(object_cache), 64, NULL, NULL, 0); zend_hash_init(&PROTOBUF_G(name_msg_cache), 64, NULL, NULL, 0); zend_hash_init(&PROTOBUF_G(name_enum_cache), 64, NULL, NULL, 0); @@ -193,34 +188,6 @@ static PHP_RSHUTDOWN_FUNCTION(protobuf) { return SUCCESS; } -// ----------------------------------------------------------------------------- -// Bundled PHP sources -// ----------------------------------------------------------------------------- - -// We bundle PHP sources for well-known types into the C extension. There is no -// need to implement these in C. - -static PHP_FUNCTION(protobuf_internal_loadbundled) { - char *name = NULL; - zend_long size; - BundledPhp_File *file; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &size) != SUCCESS) { - return; - } - - for (file = bundled_files; file->filename; file++) { - if (strcmp(file->filename, name) == 0) { - zend_eval_string((char*)file->contents, NULL, (char*)file->filename); - return; - } - } -} - -ZEND_BEGIN_ARG_INFO_EX(arginfo_load_bundled_source, 0, 0, 1) - ZEND_ARG_INFO(0, class_name) -ZEND_END_ARG_INFO() - // ----------------------------------------------------------------------------- // Object Cache. // ----------------------------------------------------------------------------- @@ -303,7 +270,6 @@ const upb_enumdef *NameMap_GetEnum(zend_class_entry *ce) { // ----------------------------------------------------------------------------- zend_function_entry protobuf_functions[] = { - PHP_FE(protobuf_internal_loadbundled, arginfo_load_bundled_source) ZEND_FE_END }; @@ -345,7 +311,7 @@ zend_module_entry protobuf_module_entry = { PHP_RINIT(protobuf), // request shutdown PHP_RSHUTDOWN(protobuf), // request shutdown NULL, // extension info - "3.13.0", // extension version + PHP_PROTOBUF_VERSION, // extension version PHP_MODULE_GLOBALS(protobuf), // globals descriptor PHP_GINIT(protobuf), // globals ctor PHP_GSHUTDOWN(protobuf), // globals dtor diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 3188fe7dcbe148cef66a3eab4f422f2326c377ba..fe0b5a71477247828d30e88c3d2971d19f6a9be8 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -56,7 +56,7 @@ const zval *get_generated_pool(); // instead of zval* and zend_string* instead of zval* for property names. // https://github.com/php/php-src/blob/php-8.0.0beta1/UPGRADING.INTERNALS#L37-L39 #if PHP_VERSION_ID < 80000 -#define PROTO_VAL zval +#define PROTO_VAL zval #define PROTO_STR zval #define PROTO_MSG_P(obj) (Message*)Z_OBJ_P(obj) #define PROTO_STRVAL_P(obj) Z_STRVAL_P(obj) @@ -69,7 +69,7 @@ const zval *get_generated_pool(); #define PROTO_STRLEN_P(obj) ZSTR_LEN(obj) #endif -#define PHP_PROTOBUF_VERSION "3.13.0" +#define PHP_PROTOBUF_VERSION "3.14.0" // ptr -> PHP object cache. This is a weak map that caches lazily-created // wrapper objects around upb types: diff --git a/php/ext/google/protobuf/wkt.inc b/php/ext/google/protobuf/wkt.inc new file mode 100644 index 0000000000000000000000000000000000000000..573ff30c1478124451d1c411c14605882420e796 --- /dev/null +++ b/php/ext/google/protobuf/wkt.inc @@ -0,0 +1,3232 @@ +// This file is generated from the .proto files for the well-known +// types. Do not edit! +static void google_protobuf_any_proto_AddDescriptor(); +static void google_protobuf_api_proto_AddDescriptor(); +static void google_protobuf_duration_proto_AddDescriptor(); +static void google_protobuf_empty_proto_AddDescriptor(); +static void google_protobuf_field_mask_proto_AddDescriptor(); +static void google_protobuf_source_context_proto_AddDescriptor(); +static void google_protobuf_struct_proto_AddDescriptor(); +static void google_protobuf_type_proto_AddDescriptor(); +static void google_protobuf_timestamp_proto_AddDescriptor(); +static void google_protobuf_wrappers_proto_AddDescriptor(); +/* google/protobuf/any.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_Any_ce; + +const char google_protobuf_any_proto_descriptor [212] = { +'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', +'t', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '&', '\n', '\003', 'A', 'n', +'y', '\022', '\020', '\n', '\010', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', '\022', '\r', '\n', '\005', 'v', 'a', +'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\014', 'B', 'v', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\010', 'A', 'n', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ',', 'g', 'o', 'o', 'g', +'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', +'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n', '/', 'a', 'n', 'y', 'p', 'b', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', +'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', +'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_any_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/any.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/any.proto", google_protobuf_any_proto_descriptor, + sizeof(google_protobuf_any_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_Any, initOnce) { + google_protobuf_any_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_Any_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_Any, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_Any_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\Any", + GPBMetadata_Google_Protobuf_Any_methods); + + GPBMetadata_Google_Protobuf_Any_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_Any */ + +zend_class_entry* google_protobuf_Any_ce; + +static PHP_METHOD(google_protobuf_Any, __construct) { + google_protobuf_any_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Any, getTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "type_url"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Any, setTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "type_url"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Any, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Any, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Any_phpmethods[] = { + PHP_ME(google_protobuf_Any, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, getTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, setTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, is, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, pack, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, unpack, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Any_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Any", + google_protobuf_Any_phpmethods); + + google_protobuf_Any_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Any_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Any_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Any_ce, message_ce); +} + +/* google/protobuf/api.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_Api_ce; + +const char google_protobuf_api_proto_descriptor [751] = { +'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'p', 'i', '.', 'p', 'r', 'o', +'t', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\032', '$', 'g', 'o', 'o', 'g', +'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 'o', 'u', 'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', +'t', '.', 'p', 'r', 'o', 't', 'o', '\032', '\032', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', +'t', 'y', 'p', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\201', '\002', '\n', '\003', 'A', 'p', 'i', '\022', '\014', '\n', '\004', 'n', 'a', 'm', +'e', '\030', '\001', ' ', '\001', '(', '\t', '\022', '(', '\n', '\007', 'm', 'e', 't', 'h', 'o', 'd', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', +'\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', '\022', +'(', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', +'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'p', 't', 'i', 'o', 'n', '\022', '\017', '\n', '\007', 'v', 'e', 'r', 's', 'i', +'o', 'n', '\030', '\004', ' ', '\001', '(', '\t', '\022', '6', '\n', '\016', 's', 'o', 'u', 'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', +'t', '\030', '\005', ' ', '\001', '(', '\013', '2', '\036', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', +'.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '&', '\n', '\006', 'm', 'i', 'x', 'i', 'n', 's', '\030', +'\006', ' ', '\003', '(', '\013', '2', '\026', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', +'i', 'x', 'i', 'n', '\022', '\'', '\n', '\006', 's', 'y', 'n', 't', 'a', 'x', '\030', '\007', ' ', '\001', '(', '\016', '2', '\027', '.', 'g', 'o', +'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'y', 'n', 't', 'a', 'x', '\"', '\325', '\001', '\n', '\006', +'M', 'e', 't', 'h', 'o', 'd', '\022', '\014', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', '\022', '\030', '\n', '\020', 'r', +'e', 'q', 'u', 'e', 's', 't', '_', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l', '\030', '\002', ' ', '\001', '(', '\t', '\022', '\031', '\n', '\021', +'r', 'e', 'q', 'u', 'e', 's', 't', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\010', '\022', '\031', +'\n', '\021', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l', '\030', '\004', ' ', '\001', '(', '\t', +'\022', '\032', '\n', '\022', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\005', ' ', +'\001', '(', '\010', '\022', '(', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '\027', '.', 'g', 'o', +'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'p', 't', 'i', 'o', 'n', '\022', '\'', '\n', '\006', 's', +'y', 'n', 't', 'a', 'x', '\030', '\007', ' ', '\001', '(', '\016', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', +'o', 'b', 'u', 'f', '.', 'S', 'y', 'n', 't', 'a', 'x', '\"', '#', '\n', '\005', 'M', 'i', 'x', 'i', 'n', '\022', '\014', '\n', '\004', 'n', +'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', '\022', '\014', '\n', '\004', 'r', 'o', 'o', 't', '\030', '\002', ' ', '\001', '(', '\t', 'B', 'v', +'\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\010', 'A', 'p', +'i', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ',', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', +'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n', '/', 'a', +'p', 'i', 'p', 'b', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', +'3', +}; + +static void google_protobuf_api_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/api.proto")) return; + google_protobuf_source_context_proto_AddDescriptor(); + google_protobuf_type_proto_AddDescriptor(); + DescriptorPool_AddDescriptor("google/protobuf/api.proto", google_protobuf_api_proto_descriptor, + sizeof(google_protobuf_api_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_Api, initOnce) { + google_protobuf_api_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_Api_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_Api, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_Api_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\Api", + GPBMetadata_Google_Protobuf_Api_methods); + + GPBMetadata_Google_Protobuf_Api_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_Api */ + +zend_class_entry* google_protobuf_Api_ce; + +static PHP_METHOD(google_protobuf_Api, __construct) { + google_protobuf_api_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Api, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, getMethods) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "methods"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, setMethods) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "methods"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, getOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, setOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, getVersion) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "version"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, setVersion) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "version"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, getSourceContext) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "source_context"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, setSourceContext) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "source_context"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, getMixins) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "mixins"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, setMixins) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "mixins"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, getSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Api, setSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Api_phpmethods[] = { + PHP_ME(google_protobuf_Api, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getMethods, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setMethods, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getVersion, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setVersion, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getSourceContext, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setSourceContext, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getMixins, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setMixins, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setSyntax, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Api_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Api", + google_protobuf_Api_phpmethods); + + google_protobuf_Api_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Api_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Api_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Api_ce, message_ce); +} + +/* google_protobuf_Method */ + +zend_class_entry* google_protobuf_Method_ce; + +static PHP_METHOD(google_protobuf_Method, __construct) { + google_protobuf_api_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Method, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, getRequestTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "request_type_url"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, setRequestTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "request_type_url"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, getRequestStreaming) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "request_streaming"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, setRequestStreaming) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "request_streaming"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, getResponseTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "response_type_url"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, setResponseTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "response_type_url"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, getResponseStreaming) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "response_streaming"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, setResponseStreaming) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "response_streaming"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, getOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, setOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, getSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Method, setSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Method_phpmethods[] = { + PHP_ME(google_protobuf_Method, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getRequestTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setRequestTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getRequestStreaming, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setRequestStreaming, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getResponseTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setResponseTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getResponseStreaming, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setResponseStreaming, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setSyntax, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Method_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Method", + google_protobuf_Method_phpmethods); + + google_protobuf_Method_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Method_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Method_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Method_ce, message_ce); +} + +/* google_protobuf_Mixin */ + +zend_class_entry* google_protobuf_Mixin_ce; + +static PHP_METHOD(google_protobuf_Mixin, __construct) { + google_protobuf_api_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Mixin, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Mixin, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Mixin, getRoot) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "root"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Mixin, setRoot) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "root"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Mixin_phpmethods[] = { + PHP_ME(google_protobuf_Mixin, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, getRoot, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, setRoot, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Mixin_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Mixin", + google_protobuf_Mixin_phpmethods); + + google_protobuf_Mixin_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Mixin_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Mixin_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Mixin_ce, message_ce); +} + +/* google/protobuf/duration.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_Duration_ce; + +const char google_protobuf_duration_proto_descriptor [235] = { +'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', +'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', +'*', '\n', '\010', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\017', '\n', '\007', 's', 'e', 'c', 'o', 'n', 'd', 's', '\030', '\001', ' ', +'\001', '(', '\003', '\022', '\r', '\n', '\005', 'n', 'a', 'n', 'o', 's', '\030', '\002', ' ', '\001', '(', '\005', 'B', '\203', '\001', '\n', '\023', 'c', 'o', +'m', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\r', 'D', 'u', 'r', 'a', 't', 'i', +'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '1', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', +'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n', '/', +'d', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', +'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', +'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_duration_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/duration.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/duration.proto", google_protobuf_duration_proto_descriptor, + sizeof(google_protobuf_duration_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_Duration, initOnce) { + google_protobuf_duration_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_Duration_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_Duration, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_Duration_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\Duration", + GPBMetadata_Google_Protobuf_Duration_methods); + + GPBMetadata_Google_Protobuf_Duration_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_Duration */ + +zend_class_entry* google_protobuf_Duration_ce; + +static PHP_METHOD(google_protobuf_Duration, __construct) { + google_protobuf_duration_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Duration, getSeconds) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "seconds"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Duration, setSeconds) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "seconds"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Duration, getNanos) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "nanos"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Duration, setNanos) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "nanos"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Duration_phpmethods[] = { + PHP_ME(google_protobuf_Duration, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, getSeconds, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, setSeconds, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, getNanos, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, setNanos, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Duration_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Duration", + google_protobuf_Duration_phpmethods); + + google_protobuf_Duration_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Duration_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Duration_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Duration_ce, message_ce); +} + +/* google/protobuf/empty.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_GPBEmpty_ce; + +const char google_protobuf_empty_proto_descriptor [190] = { +'\n', '\033', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'e', 'm', 'p', 't', 'y', '.', 'p', +'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '\007', '\n', '\005', +'E', 'm', 'p', 't', 'y', 'B', '}', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', 'B', '\n', 'E', 'm', 'p', 't', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '.', 'g', 'o', 'o', 'g', 'l', 'e', +'.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', +'s', '/', 'k', 'n', 'o', 'w', 'n', '/', 'e', 'm', 'p', 't', 'y', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', +'\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', +'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_empty_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/empty.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/empty.proto", google_protobuf_empty_proto_descriptor, + sizeof(google_protobuf_empty_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_GPBEmpty, initOnce) { + google_protobuf_empty_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_GPBEmpty_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_GPBEmpty, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_GPBEmpty_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\GPBEmpty", + GPBMetadata_Google_Protobuf_GPBEmpty_methods); + + GPBMetadata_Google_Protobuf_GPBEmpty_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_Empty */ + +zend_class_entry* google_protobuf_Empty_ce; + +static PHP_METHOD(google_protobuf_Empty, __construct) { + google_protobuf_empty_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static zend_function_entry google_protobuf_Empty_phpmethods[] = { + PHP_ME(google_protobuf_Empty, __construct, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Empty_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\GPBEmpty", + google_protobuf_Empty_phpmethods); + + google_protobuf_Empty_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Empty_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Empty_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Empty_ce, message_ce); +} + +/* google/protobuf/field_mask.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_FieldMask_ce; + +const char google_protobuf_field_mask_proto_descriptor [223] = { +'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'f', 'i', 'e', 'l', 'd', '_', 'm', +'a', 's', 'k', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', +'f', '\"', '\032', '\n', '\t', 'F', 'i', 'e', 'l', 'd', 'M', 'a', 's', 'k', '\022', '\r', '\n', '\005', 'p', 'a', 't', 'h', 's', '\030', '\001', +' ', '\003', '(', '\t', 'B', '\205', '\001', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', 'B', '\016', 'F', 'i', 'e', 'l', 'd', 'M', 'a', 's', 'k', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '2', 'g', 'o', +'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', +'t', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n', '/', 'f', 'i', 'e', 'l', 'd', 'm', 'a', 's', 'k', 'p', 'b', '\370', '\001', +'\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', +'.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_field_mask_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/field_mask.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/field_mask.proto", google_protobuf_field_mask_proto_descriptor, + sizeof(google_protobuf_field_mask_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_FieldMask, initOnce) { + google_protobuf_field_mask_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_FieldMask_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_FieldMask, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_FieldMask_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\FieldMask", + GPBMetadata_Google_Protobuf_FieldMask_methods); + + GPBMetadata_Google_Protobuf_FieldMask_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_FieldMask */ + +zend_class_entry* google_protobuf_FieldMask_ce; + +static PHP_METHOD(google_protobuf_FieldMask, __construct) { + google_protobuf_field_mask_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_FieldMask, getPaths) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "paths"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_FieldMask, setPaths) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "paths"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_FieldMask_phpmethods[] = { + PHP_ME(google_protobuf_FieldMask, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FieldMask, getPaths, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FieldMask, setPaths, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_FieldMask_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\FieldMask", + google_protobuf_FieldMask_phpmethods); + + google_protobuf_FieldMask_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_FieldMask_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_FieldMask_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_FieldMask_ce, message_ce); +} + +/* google/protobuf/source_context.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_SourceContext_ce; + +const char google_protobuf_source_context_proto_descriptor [240] = { +'\n', '$', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 'o', 'u', 'r', 'c', 'e', '_', +'c', 'o', 'n', 't', 'e', 'x', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', +'t', 'o', 'b', 'u', 'f', '\"', '\"', '\n', '\r', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\021', '\n', +'\t', 'f', 'i', 'l', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\212', '\001', '\n', '\023', 'c', 'o', 'm', '.', +'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\022', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', +'n', 't', 'e', 'x', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '6', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', +'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', +'w', 'n', '/', 's', 'o', 'u', 'r', 'c', 'e', 'c', 'o', 'n', 't', 'e', 'x', 't', 'p', 'b', '\242', '\002', '\003', 'G', 'P', 'B', '\252', +'\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', +'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_source_context_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/source_context.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/source_context.proto", google_protobuf_source_context_proto_descriptor, + sizeof(google_protobuf_source_context_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_SourceContext, initOnce) { + google_protobuf_source_context_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_SourceContext_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_SourceContext, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_SourceContext_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\SourceContext", + GPBMetadata_Google_Protobuf_SourceContext_methods); + + GPBMetadata_Google_Protobuf_SourceContext_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_SourceContext */ + +zend_class_entry* google_protobuf_SourceContext_ce; + +static PHP_METHOD(google_protobuf_SourceContext, __construct) { + google_protobuf_source_context_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_SourceContext, getFileName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "file_name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_SourceContext, setFileName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "file_name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_SourceContext_phpmethods[] = { + PHP_ME(google_protobuf_SourceContext, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_SourceContext, getFileName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_SourceContext, setFileName, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_SourceContext_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\SourceContext", + google_protobuf_SourceContext_phpmethods); + + google_protobuf_SourceContext_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_SourceContext_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_SourceContext_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_SourceContext_ce, message_ce); +} + +/* google/protobuf/struct.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_Struct_ce; + +const char google_protobuf_struct_proto_descriptor [638] = { +'\n', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', +'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '\204', '\001', +'\n', '\006', 'S', 't', 'r', 'u', 'c', 't', '\022', '3', '\n', '\006', 'f', 'i', 'e', 'l', 'd', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', +'#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', '.', +'F', 'i', 'e', 'l', 'd', 's', 'E', 'n', 't', 'r', 'y', '\032', 'E', '\n', '\013', 'F', 'i', 'e', 'l', 'd', 's', 'E', 'n', 't', 'r', +'y', '\022', '\013', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', '\022', '%', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', +' ', '\001', '(', '\013', '2', '\026', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'V', 'a', +'l', 'u', 'e', ':', '\002', '8', '\001', '\"', '\352', '\001', '\n', '\005', 'V', 'a', 'l', 'u', 'e', '\022', '0', '\n', '\n', 'n', 'u', 'l', 'l', +'_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', +'t', 'o', 'b', 'u', 'f', '.', 'N', 'u', 'l', 'l', 'V', 'a', 'l', 'u', 'e', 'H', '\000', '\022', '\026', '\n', '\014', 'n', 'u', 'm', 'b', +'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\001', 'H', '\000', '\022', '\026', '\n', '\014', 's', 't', 'r', 'i', 'n', +'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'H', '\000', '\022', '\024', '\n', '\n', 'b', 'o', 'o', 'l', '_', 'v', +'a', 'l', 'u', 'e', '\030', '\004', ' ', '\001', '(', '\010', 'H', '\000', '\022', '/', '\n', '\014', 's', 't', 'r', 'u', 'c', 't', '_', 'v', 'a', +'l', 'u', 'e', '\030', '\005', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', +'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'H', '\000', '\022', '0', '\n', '\n', 'l', 'i', 's', 't', '_', 'v', 'a', 'l', 'u', 'e', +'\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', +'L', 'i', 's', 't', 'V', 'a', 'l', 'u', 'e', 'H', '\000', 'B', '\006', '\n', '\004', 'k', 'i', 'n', 'd', '\"', '3', '\n', '\t', 'L', 'i', +'s', 't', 'V', 'a', 'l', 'u', 'e', '\022', '&', '\n', '\006', 'v', 'a', 'l', 'u', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\026', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'V', 'a', 'l', 'u', 'e', '*', '\033', '\n', +'\t', 'N', 'u', 'l', 'l', 'V', 'a', 'l', 'u', 'e', '\022', '\016', '\n', '\n', 'N', 'U', 'L', 'L', '_', 'V', 'A', 'L', 'U', 'E', '\020', +'\000', 'B', '\177', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', +'\013', 'S', 't', 'r', 'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '/', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', +'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', +'n', 'o', 'w', 'n', '/', 's', 't', 'r', 'u', 'c', 't', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', +'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', +'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_struct_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/struct.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/struct.proto", google_protobuf_struct_proto_descriptor, + sizeof(google_protobuf_struct_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_Struct, initOnce) { + google_protobuf_struct_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_Struct_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_Struct, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_Struct_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\Struct", + GPBMetadata_Google_Protobuf_Struct_methods); + + GPBMetadata_Google_Protobuf_Struct_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_Struct */ + +zend_class_entry* google_protobuf_Struct_ce; + +static PHP_METHOD(google_protobuf_Struct, __construct) { + google_protobuf_struct_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Struct, getFields) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "fields"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Struct, setFields) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "fields"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Struct_phpmethods[] = { + PHP_ME(google_protobuf_Struct, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct, getFields, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct, setFields, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Struct_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Struct", + google_protobuf_Struct_phpmethods); + + google_protobuf_Struct_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Struct_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Struct_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Struct_ce, message_ce); +} + +/* google_protobuf_Struct_FieldsEntry */ + +zend_class_entry* google_protobuf_Struct_FieldsEntry_ce; + +static PHP_METHOD(google_protobuf_Struct_FieldsEntry, __construct) { + google_protobuf_struct_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Struct_FieldsEntry, getKey) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "key"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Struct_FieldsEntry, setKey) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "key"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Struct_FieldsEntry, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Struct_FieldsEntry, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Struct_FieldsEntry_phpmethods[] = { + PHP_ME(google_protobuf_Struct_FieldsEntry, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, getKey, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, setKey, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Struct_FieldsEntry_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Struct\\FieldsEntry", + google_protobuf_Struct_FieldsEntry_phpmethods); + + google_protobuf_Struct_FieldsEntry_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Struct_FieldsEntry_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Struct_FieldsEntry_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Struct_FieldsEntry_ce, message_ce); +} + +/* google_protobuf_Value */ + +zend_class_entry* google_protobuf_Value_ce; + +static PHP_METHOD(google_protobuf_Value, __construct) { + google_protobuf_struct_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Value, getNullValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "null_value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, setNullValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "null_value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, getNumberValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "number_value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, setNumberValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "number_value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, getStringValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "string_value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, setStringValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "string_value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, getBoolValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "bool_value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, setBoolValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "bool_value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, getStructValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "struct_value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, setStructValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "struct_value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, getListValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "list_value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, setListValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "list_value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Value, getKind) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_oneofdef *oneof = upb_msgdef_ntooz(intern->desc->msgdef, + "kind"); + const upb_fielddef *field = upb_msg_whichoneof(intern->msg, oneof); + RETURN_STRING(field ? upb_fielddef_name(field) : ""); +} +static zend_function_entry google_protobuf_Value_phpmethods[] = { + PHP_ME(google_protobuf_Value, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getNullValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setNullValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getNumberValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setNumberValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getStringValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setStringValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getBoolValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setBoolValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getStructValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setStructValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getListValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setListValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getKind, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Value_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Value", + google_protobuf_Value_phpmethods); + + google_protobuf_Value_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Value_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Value_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Value_ce, message_ce); +} + +/* google_protobuf_ListValue */ + +zend_class_entry* google_protobuf_ListValue_ce; + +static PHP_METHOD(google_protobuf_ListValue, __construct) { + google_protobuf_struct_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_ListValue, getValues) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "values"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_ListValue, setValues) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "values"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_ListValue_phpmethods[] = { + PHP_ME(google_protobuf_ListValue, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_ListValue, getValues, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_ListValue, setValues, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_ListValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\ListValue", + google_protobuf_ListValue_phpmethods); + + google_protobuf_ListValue_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_ListValue_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_ListValue_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_ListValue_ce, message_ce); +} + +/* google_protobuf_NullValue */ + +zend_class_entry* google_protobuf_NullValue_ce; + +PHP_METHOD(google_protobuf_NullValue, name) { + google_protobuf_struct_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.NullValue"); + const char *name; + zend_long value; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + FAILURE) { + return; + } + name = upb_enumdef_iton(e, value); + if (!name) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\NullValue has no name " + "defined for value " ZEND_LONG_FMT ".", + value); + return; + } + RETURN_STRING(name); +} + +PHP_METHOD(google_protobuf_NullValue, value) { + google_protobuf_struct_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.NullValue"); + char *name = NULL; + size_t name_len; + int32_t num; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + &name_len) == FAILURE) { + return; + } + if (!upb_enumdef_ntoi(e, name, name_len, &num)) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\NullValue has no value " + "defined for name %s.", + name); + return; + } + RETURN_LONG(num); +} + +static zend_function_entry google_protobuf_NullValue_phpmethods[] = { + PHP_ME(google_protobuf_NullValue, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_NullValue, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void google_protobuf_NullValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\NullValue", + google_protobuf_NullValue_phpmethods); + + google_protobuf_NullValue_ce = zend_register_internal_class(&tmp_ce); + zend_declare_class_constant_long(google_protobuf_NullValue_ce, "NULL_VALUE", + strlen("NULL_VALUE"), 0); +} + +/* google/protobuf/type.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_Type_ce; + +const char google_protobuf_type_proto_descriptor [1592] = { +'\n', '\032', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', '.', 'p', 'r', +'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\032', '\031', 'g', 'o', 'o', +'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'g', +'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 'o', 'u', 'r', 'c', 'e', '_', 'c', 'o', 'n', +'t', 'e', 'x', 't', '.', 'p', 'r', 'o', 't', 'o', '\"', '\327', '\001', '\n', '\004', 'T', 'y', 'p', 'e', '\022', '\014', '\n', '\004', 'n', 'a', +'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', '\022', '&', '\n', '\006', 'f', 'i', 'e', 'l', 'd', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', +'\026', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', '\022', '\016', +'\n', '\006', 'o', 'n', 'e', 'o', 'f', 's', '\030', '\003', ' ', '\003', '(', '\t', '\022', '(', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', +'\030', '\004', ' ', '\003', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', +'O', 'p', 't', 'i', 'o', 'n', '\022', '6', '\n', '\016', 's', 'o', 'u', 'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', +'\005', ' ', '\001', '(', '\013', '2', '\036', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', +'o', 'u', 'r', 'c', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\'', '\n', '\006', 's', 'y', 'n', 't', 'a', 'x', '\030', '\006', ' ', +'\001', '(', '\016', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'y', 'n', +'t', 'a', 'x', '\"', '\325', '\005', '\n', '\005', 'F', 'i', 'e', 'l', 'd', '\022', ')', '\n', '\004', 'k', 'i', 'n', 'd', '\030', '\001', ' ', '\001', +'(', '\016', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', +'d', '.', 'K', 'i', 'n', 'd', '\022', '7', '\n', '\013', 'c', 'a', 'r', 'd', 'i', 'n', 'a', 'l', 'i', 't', 'y', '\030', '\002', ' ', '\001', +'(', '\016', '2', '\"', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', +'d', '.', 'C', 'a', 'r', 'd', 'i', 'n', 'a', 'l', 'i', 't', 'y', '\022', '\016', '\n', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\003', +' ', '\001', '(', '\005', '\022', '\014', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\004', ' ', '\001', '(', '\t', '\022', '\020', '\n', '\010', 't', 'y', 'p', +'e', '_', 'u', 'r', 'l', '\030', '\006', ' ', '\001', '(', '\t', '\022', '\023', '\n', '\013', 'o', 'n', 'e', 'o', 'f', '_', 'i', 'n', 'd', 'e', +'x', '\030', '\007', ' ', '\001', '(', '\005', '\022', '\016', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\010', ' ', '\001', '(', '\010', '\022', '(', +'\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', +'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'p', 't', 'i', 'o', 'n', '\022', '\021', '\n', '\t', 'j', 's', 'o', 'n', '_', 'n', +'a', 'm', 'e', '\030', '\n', ' ', '\001', '(', '\t', '\022', '\025', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', +'e', '\030', '\013', ' ', '\001', '(', '\t', '\"', '\310', '\002', '\n', '\004', 'K', 'i', 'n', 'd', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', +'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'D', 'O', 'U', 'B', 'L', 'E', '\020', +'\001', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'F', 'L', 'O', 'A', 'T', '\020', '\002', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', +'_', 'I', 'N', 'T', '6', '4', '\020', '\003', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', '6', '4', '\020', '\004', +'\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'I', 'N', 'T', '3', '2', '\020', '\005', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', +'F', 'I', 'X', 'E', 'D', '6', '4', '\020', '\006', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'X', 'E', 'D', '3', '2', +'\020', '\007', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'B', 'O', 'O', 'L', '\020', '\010', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', +'_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\t', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'G', 'R', 'O', 'U', 'P', '\020', '\n', +'\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'S', 'S', 'A', 'G', 'E', '\020', '\013', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', +'E', '_', 'B', 'Y', 'T', 'E', 'S', '\020', '\014', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', '3', '2', '\020', +'\r', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '\020', '\016', '\022', '\021', '\n', '\r', 'T', 'Y', 'P', 'E', '_', +'S', 'F', 'I', 'X', 'E', 'D', '3', '2', '\020', '\017', '\022', '\021', '\n', '\r', 'T', 'Y', 'P', 'E', '_', 'S', 'F', 'I', 'X', 'E', 'D', +'6', '4', '\020', '\020', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '3', '2', '\020', '\021', '\022', '\017', '\n', '\013', +'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '6', '4', '\020', '\022', '\"', 't', '\n', '\013', 'C', 'a', 'r', 'd', 'i', 'n', 'a', 'l', +'i', 't', 'y', '\022', '\027', '\n', '\023', 'C', 'A', 'R', 'D', 'I', 'N', 'A', 'L', 'I', 'T', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', +'N', '\020', '\000', '\022', '\030', '\n', '\024', 'C', 'A', 'R', 'D', 'I', 'N', 'A', 'L', 'I', 'T', 'Y', '_', 'O', 'P', 'T', 'I', 'O', 'N', +'A', 'L', '\020', '\001', '\022', '\030', '\n', '\024', 'C', 'A', 'R', 'D', 'I', 'N', 'A', 'L', 'I', 'T', 'Y', '_', 'R', 'E', 'Q', 'U', 'I', +'R', 'E', 'D', '\020', '\002', '\022', '\030', '\n', '\024', 'C', 'A', 'R', 'D', 'I', 'N', 'A', 'L', 'I', 'T', 'Y', '_', 'R', 'E', 'P', 'E', +'A', 'T', 'E', 'D', '\020', '\003', '\"', '\316', '\001', '\n', '\004', 'E', 'n', 'u', 'm', '\022', '\014', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', +' ', '\001', '(', '\t', '\022', '-', '\n', '\t', 'e', 'n', 'u', 'm', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', '\032', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', +'e', '\022', '(', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', +'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'p', 't', 'i', 'o', 'n', '\022', '6', '\n', '\016', 's', 'o', 'u', +'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', +'\'', '\n', '\006', 's', 'y', 'n', 't', 'a', 'x', '\030', '\005', ' ', '\001', '(', '\016', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', +'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'y', 'n', 't', 'a', 'x', '\"', 'S', '\n', '\t', 'E', 'n', 'u', 'm', 'V', 'a', +'l', 'u', 'e', '\022', '\014', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', '\022', '\016', '\n', '\006', 'n', 'u', 'm', 'b', +'e', 'r', '\030', '\002', ' ', '\001', '(', '\005', '\022', '(', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', +'2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'p', 't', 'i', 'o', 'n', +'\"', ';', '\n', '\006', 'O', 'p', 't', 'i', 'o', 'n', '\022', '\014', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', '\022', +'#', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', '*', '.', '\n', '\006', 'S', 'y', 'n', 't', 'a', 'x', '\022', '\021', '\n', '\r', +'S', 'Y', 'N', 'T', 'A', 'X', '_', 'P', 'R', 'O', 'T', 'O', '2', '\020', '\000', '\022', '\021', '\n', '\r', 'S', 'Y', 'N', 'T', 'A', 'X', +'_', 'P', 'R', 'O', 'T', 'O', '3', '\020', '\001', 'B', '{', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\t', 'T', 'y', 'p', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '-', 'g', 'o', 'o', +'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', +'y', 'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n', '/', 't', 'y', 'p', 'e', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', +'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', +'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_type_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/type.proto")) return; + google_protobuf_any_proto_AddDescriptor(); + google_protobuf_source_context_proto_AddDescriptor(); + DescriptorPool_AddDescriptor("google/protobuf/type.proto", google_protobuf_type_proto_descriptor, + sizeof(google_protobuf_type_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_Type, initOnce) { + google_protobuf_type_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_Type_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_Type, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_Type_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\Type", + GPBMetadata_Google_Protobuf_Type_methods); + + GPBMetadata_Google_Protobuf_Type_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_Type */ + +zend_class_entry* google_protobuf_Type_ce; + +static PHP_METHOD(google_protobuf_Type, __construct) { + google_protobuf_type_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Type, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, getFields) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "fields"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, setFields) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "fields"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, getOneofs) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "oneofs"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, setOneofs) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "oneofs"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, getOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, setOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, getSourceContext) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "source_context"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, setSourceContext) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "source_context"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, getSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Type, setSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Type_phpmethods[] = { + PHP_ME(google_protobuf_Type, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getFields, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setFields, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getOneofs, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setOneofs, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getSourceContext, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setSourceContext, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setSyntax, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Type_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Type", + google_protobuf_Type_phpmethods); + + google_protobuf_Type_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Type_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Type_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Type_ce, message_ce); +} + +/* google_protobuf_Field */ + +zend_class_entry* google_protobuf_Field_ce; + +static PHP_METHOD(google_protobuf_Field, __construct) { + google_protobuf_type_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Field, getKind) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "kind"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setKind) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "kind"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getCardinality) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "cardinality"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setCardinality) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "cardinality"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getNumber) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "number"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setNumber) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "number"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "type_url"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setTypeUrl) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "type_url"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getOneofIndex) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "oneof_index"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setOneofIndex) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "oneof_index"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getPacked) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "packed"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setPacked) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "packed"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getJsonName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "json_name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setJsonName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "json_name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, getDefaultValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "default_value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Field, setDefaultValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "default_value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Field_phpmethods[] = { + PHP_ME(google_protobuf_Field, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getKind, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setKind, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getCardinality, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setCardinality, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getNumber, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setNumber, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setTypeUrl, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getOneofIndex, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setOneofIndex, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getPacked, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setPacked, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getJsonName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setJsonName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getDefaultValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setDefaultValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Field_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Field", + google_protobuf_Field_phpmethods); + + google_protobuf_Field_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Field_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Field_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Field_ce, message_ce); +} + +/* google_protobuf_Field_Kind */ + +zend_class_entry* google_protobuf_Field_Kind_ce; + +PHP_METHOD(google_protobuf_Field_Kind, name) { + google_protobuf_type_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Field.Kind"); + const char *name; + zend_long value; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + FAILURE) { + return; + } + name = upb_enumdef_iton(e, value); + if (!name) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\Field\\Kind has no name " + "defined for value " ZEND_LONG_FMT ".", + value); + return; + } + RETURN_STRING(name); +} + +PHP_METHOD(google_protobuf_Field_Kind, value) { + google_protobuf_type_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Field.Kind"); + char *name = NULL; + size_t name_len; + int32_t num; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + &name_len) == FAILURE) { + return; + } + if (!upb_enumdef_ntoi(e, name, name_len, &num)) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\Field\\Kind has no value " + "defined for name %s.", + name); + return; + } + RETURN_LONG(num); +} + +static zend_function_entry google_protobuf_Field_Kind_phpmethods[] = { + PHP_ME(google_protobuf_Field_Kind, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Field_Kind, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void google_protobuf_Field_Kind_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Field\\Kind", + google_protobuf_Field_Kind_phpmethods); + + google_protobuf_Field_Kind_ce = zend_register_internal_class(&tmp_ce); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_UNKNOWN", + strlen("TYPE_UNKNOWN"), 0); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_DOUBLE", + strlen("TYPE_DOUBLE"), 1); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_FLOAT", + strlen("TYPE_FLOAT"), 2); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_INT64", + strlen("TYPE_INT64"), 3); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_UINT64", + strlen("TYPE_UINT64"), 4); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_INT32", + strlen("TYPE_INT32"), 5); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_FIXED64", + strlen("TYPE_FIXED64"), 6); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_FIXED32", + strlen("TYPE_FIXED32"), 7); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_BOOL", + strlen("TYPE_BOOL"), 8); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_STRING", + strlen("TYPE_STRING"), 9); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_GROUP", + strlen("TYPE_GROUP"), 10); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_MESSAGE", + strlen("TYPE_MESSAGE"), 11); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_BYTES", + strlen("TYPE_BYTES"), 12); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_UINT32", + strlen("TYPE_UINT32"), 13); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_ENUM", + strlen("TYPE_ENUM"), 14); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_SFIXED32", + strlen("TYPE_SFIXED32"), 15); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_SFIXED64", + strlen("TYPE_SFIXED64"), 16); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_SINT32", + strlen("TYPE_SINT32"), 17); + zend_declare_class_constant_long(google_protobuf_Field_Kind_ce, "TYPE_SINT64", + strlen("TYPE_SINT64"), 18); +} + +/* google_protobuf_Field_Cardinality */ + +zend_class_entry* google_protobuf_Field_Cardinality_ce; + +PHP_METHOD(google_protobuf_Field_Cardinality, name) { + google_protobuf_type_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Field.Cardinality"); + const char *name; + zend_long value; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + FAILURE) { + return; + } + name = upb_enumdef_iton(e, value); + if (!name) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\Field\\Cardinality has no name " + "defined for value " ZEND_LONG_FMT ".", + value); + return; + } + RETURN_STRING(name); +} + +PHP_METHOD(google_protobuf_Field_Cardinality, value) { + google_protobuf_type_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Field.Cardinality"); + char *name = NULL; + size_t name_len; + int32_t num; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + &name_len) == FAILURE) { + return; + } + if (!upb_enumdef_ntoi(e, name, name_len, &num)) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\Field\\Cardinality has no value " + "defined for name %s.", + name); + return; + } + RETURN_LONG(num); +} + +static zend_function_entry google_protobuf_Field_Cardinality_phpmethods[] = { + PHP_ME(google_protobuf_Field_Cardinality, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Field_Cardinality, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void google_protobuf_Field_Cardinality_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Field\\Cardinality", + google_protobuf_Field_Cardinality_phpmethods); + + google_protobuf_Field_Cardinality_ce = zend_register_internal_class(&tmp_ce); + zend_declare_class_constant_long(google_protobuf_Field_Cardinality_ce, "CARDINALITY_UNKNOWN", + strlen("CARDINALITY_UNKNOWN"), 0); + zend_declare_class_constant_long(google_protobuf_Field_Cardinality_ce, "CARDINALITY_OPTIONAL", + strlen("CARDINALITY_OPTIONAL"), 1); + zend_declare_class_constant_long(google_protobuf_Field_Cardinality_ce, "CARDINALITY_REQUIRED", + strlen("CARDINALITY_REQUIRED"), 2); + zend_declare_class_constant_long(google_protobuf_Field_Cardinality_ce, "CARDINALITY_REPEATED", + strlen("CARDINALITY_REPEATED"), 3); +} + +/* google_protobuf_Enum */ + +zend_class_entry* google_protobuf_Enum_ce; + +static PHP_METHOD(google_protobuf_Enum, __construct) { + google_protobuf_type_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Enum, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, getEnumvalue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "enumvalue"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, setEnumvalue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "enumvalue"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, getOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, setOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, getSourceContext) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "source_context"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, setSourceContext) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "source_context"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, getSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Enum, setSyntax) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "syntax"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Enum_phpmethods[] = { + PHP_ME(google_protobuf_Enum, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getEnumvalue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setEnumvalue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getSourceContext, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setSourceContext, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setSyntax, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Enum_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Enum", + google_protobuf_Enum_phpmethods); + + google_protobuf_Enum_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Enum_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Enum_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Enum_ce, message_ce); +} + +/* google_protobuf_EnumValue */ + +zend_class_entry* google_protobuf_EnumValue_ce; + +static PHP_METHOD(google_protobuf_EnumValue, __construct) { + google_protobuf_type_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_EnumValue, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_EnumValue, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_EnumValue, getNumber) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "number"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_EnumValue, setNumber) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "number"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_EnumValue, getOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_EnumValue, setOptions) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "options"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_EnumValue_phpmethods[] = { + PHP_ME(google_protobuf_EnumValue, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, getNumber, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, setNumber, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, setOptions, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_EnumValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\EnumValue", + google_protobuf_EnumValue_phpmethods); + + google_protobuf_EnumValue_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_EnumValue_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_EnumValue_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_EnumValue_ce, message_ce); +} + +/* google_protobuf_Option */ + +zend_class_entry* google_protobuf_Option_ce; + +static PHP_METHOD(google_protobuf_Option, __construct) { + google_protobuf_type_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Option, getName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Option, setName) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "name"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Option, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Option, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Option_phpmethods[] = { + PHP_ME(google_protobuf_Option, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, setName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Option_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Option", + google_protobuf_Option_phpmethods); + + google_protobuf_Option_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Option_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Option_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Option_ce, message_ce); +} + +/* google_protobuf_Syntax */ + +zend_class_entry* google_protobuf_Syntax_ce; + +PHP_METHOD(google_protobuf_Syntax, name) { + google_protobuf_type_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Syntax"); + const char *name; + zend_long value; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + FAILURE) { + return; + } + name = upb_enumdef_iton(e, value); + if (!name) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\Syntax has no name " + "defined for value " ZEND_LONG_FMT ".", + value); + return; + } + RETURN_STRING(name); +} + +PHP_METHOD(google_protobuf_Syntax, value) { + google_protobuf_type_proto_AddDescriptor(); + const upb_symtab *symtab = DescriptorPool_GetSymbolTable(); + const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Syntax"); + char *name = NULL; + size_t name_len; + int32_t num; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + &name_len) == FAILURE) { + return; + } + if (!upb_enumdef_ntoi(e, name, name_len, &num)) { + zend_throw_exception_ex(NULL, 0, + "Google\\Protobuf\\Syntax has no value " + "defined for name %s.", + name); + return; + } + RETURN_LONG(num); +} + +static zend_function_entry google_protobuf_Syntax_phpmethods[] = { + PHP_ME(google_protobuf_Syntax, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Syntax, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void google_protobuf_Syntax_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Syntax", + google_protobuf_Syntax_phpmethods); + + google_protobuf_Syntax_ce = zend_register_internal_class(&tmp_ce); + zend_declare_class_constant_long(google_protobuf_Syntax_ce, "SYNTAX_PROTO2", + strlen("SYNTAX_PROTO2"), 0); + zend_declare_class_constant_long(google_protobuf_Syntax_ce, "SYNTAX_PROTO3", + strlen("SYNTAX_PROTO3"), 1); +} + +/* google/protobuf/timestamp.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_Timestamp_ce; + +const char google_protobuf_timestamp_proto_descriptor [239] = { +'\n', '\037', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'i', 'm', 'e', 's', 't', 'a', +'m', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', +'\"', '+', '\n', '\t', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\022', '\017', '\n', '\007', 's', 'e', 'c', 'o', 'n', 'd', 's', '\030', +'\001', ' ', '\001', '(', '\003', '\022', '\r', '\n', '\005', 'n', 'a', 'n', 'o', 's', '\030', '\002', ' ', '\001', '(', '\005', 'B', '\205', '\001', '\n', '\023', +'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\016', 'T', 'i', 'm', 'e', +'s', 't', 'a', 'm', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '2', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', +'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', +'w', 'n', '/', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', +'\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', +'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_timestamp_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/timestamp.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/timestamp.proto", google_protobuf_timestamp_proto_descriptor, + sizeof(google_protobuf_timestamp_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_Timestamp, initOnce) { + google_protobuf_timestamp_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_Timestamp_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_Timestamp, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_Timestamp_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\Timestamp", + GPBMetadata_Google_Protobuf_Timestamp_methods); + + GPBMetadata_Google_Protobuf_Timestamp_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_Timestamp */ + +zend_class_entry* google_protobuf_Timestamp_ce; + +static PHP_METHOD(google_protobuf_Timestamp, __construct) { + google_protobuf_timestamp_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Timestamp, getSeconds) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "seconds"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Timestamp, setSeconds) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "seconds"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static PHP_METHOD(google_protobuf_Timestamp, getNanos) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "nanos"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Timestamp, setNanos) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "nanos"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Timestamp_phpmethods[] = { + PHP_ME(google_protobuf_Timestamp, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, getSeconds, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, setSeconds, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, getNanos, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, setNanos, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, fromDateTime, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, toDateTime, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Timestamp_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Timestamp", + google_protobuf_Timestamp_phpmethods); + + google_protobuf_Timestamp_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Timestamp_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Timestamp_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Timestamp_ce, message_ce); +} + +/* google/protobuf/wrappers.proto */ + +zend_class_entry* GPBMetadata_Google_Protobuf_Wrappers_ce; + +const char google_protobuf_wrappers_proto_descriptor [455] = { +'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', +'s', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', +'\034', '\n', '\013', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', '\022', '\r', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\001', +' ', '\001', '(', '\001', '\"', '\033', '\n', '\n', 'F', 'l', 'o', 'a', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\r', '\n', '\005', 'v', 'a', 'l', +'u', 'e', '\030', '\001', ' ', '\001', '(', '\002', '\"', '\033', '\n', '\n', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', '\022', '\r', '\n', +'\005', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\003', '\"', '\034', '\n', '\013', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', +'u', 'e', '\022', '\r', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\004', '\"', '\033', '\n', '\n', 'I', 'n', 't', '3', +'2', 'V', 'a', 'l', 'u', 'e', '\022', '\r', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\005', '\"', '\034', '\n', '\013', +'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', '\022', '\r', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', +'\r', '\"', '\032', '\n', '\t', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', '\022', '\r', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\001', +' ', '\001', '(', '\010', '\"', '\034', '\n', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\r', '\n', '\005', 'v', 'a', +'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', '\"', '\033', '\n', '\n', 'B', 'y', 't', 'e', 's', 'V', 'a', 'l', 'u', 'e', '\022', '\r', +'\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\014', 'B', '\203', '\001', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', +'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\r', 'W', 'r', 'a', 'p', 'p', 'e', 'r', 's', 'P', 'r', 'o', +'t', 'o', 'P', '\001', 'Z', '1', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n', '/', 'w', 'r', 'a', 'p', 'p', +'e', 'r', 's', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', +'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', +'r', 'o', 't', 'o', '3', +}; + +static void google_protobuf_wrappers_proto_AddDescriptor() { + if (DescriptorPool_HasFile("google/protobuf/wrappers.proto")) return; + DescriptorPool_AddDescriptor("google/protobuf/wrappers.proto", google_protobuf_wrappers_proto_descriptor, + sizeof(google_protobuf_wrappers_proto_descriptor)); +} + +static PHP_METHOD(GPBMetadata_Google_Protobuf_Wrappers, initOnce) { + google_protobuf_wrappers_proto_AddDescriptor(); +} + +static zend_function_entry GPBMetadata_Google_Protobuf_Wrappers_methods[] = { + PHP_ME(GPBMetadata_Google_Protobuf_Wrappers, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static void GPBMetadata_Google_Protobuf_Wrappers_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "GPBMetadata\\Google\\Protobuf\\Wrappers", + GPBMetadata_Google_Protobuf_Wrappers_methods); + + GPBMetadata_Google_Protobuf_Wrappers_ce = zend_register_internal_class(&tmp_ce); +} + +/* google_protobuf_DoubleValue */ + +zend_class_entry* google_protobuf_DoubleValue_ce; + +static PHP_METHOD(google_protobuf_DoubleValue, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_DoubleValue, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_DoubleValue, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_DoubleValue_phpmethods[] = { + PHP_ME(google_protobuf_DoubleValue, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_DoubleValue, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_DoubleValue, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_DoubleValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\DoubleValue", + google_protobuf_DoubleValue_phpmethods); + + google_protobuf_DoubleValue_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_DoubleValue_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_DoubleValue_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_DoubleValue_ce, message_ce); +} + +/* google_protobuf_FloatValue */ + +zend_class_entry* google_protobuf_FloatValue_ce; + +static PHP_METHOD(google_protobuf_FloatValue, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_FloatValue, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_FloatValue, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_FloatValue_phpmethods[] = { + PHP_ME(google_protobuf_FloatValue, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FloatValue, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FloatValue, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_FloatValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\FloatValue", + google_protobuf_FloatValue_phpmethods); + + google_protobuf_FloatValue_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_FloatValue_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_FloatValue_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_FloatValue_ce, message_ce); +} + +/* google_protobuf_Int64Value */ + +zend_class_entry* google_protobuf_Int64Value_ce; + +static PHP_METHOD(google_protobuf_Int64Value, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Int64Value, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Int64Value, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Int64Value_phpmethods[] = { + PHP_ME(google_protobuf_Int64Value, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int64Value, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int64Value, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Int64Value_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Int64Value", + google_protobuf_Int64Value_phpmethods); + + google_protobuf_Int64Value_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Int64Value_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Int64Value_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Int64Value_ce, message_ce); +} + +/* google_protobuf_UInt64Value */ + +zend_class_entry* google_protobuf_UInt64Value_ce; + +static PHP_METHOD(google_protobuf_UInt64Value, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_UInt64Value, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_UInt64Value, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_UInt64Value_phpmethods[] = { + PHP_ME(google_protobuf_UInt64Value, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt64Value, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt64Value, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_UInt64Value_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\UInt64Value", + google_protobuf_UInt64Value_phpmethods); + + google_protobuf_UInt64Value_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_UInt64Value_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_UInt64Value_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_UInt64Value_ce, message_ce); +} + +/* google_protobuf_Int32Value */ + +zend_class_entry* google_protobuf_Int32Value_ce; + +static PHP_METHOD(google_protobuf_Int32Value, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_Int32Value, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_Int32Value, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_Int32Value_phpmethods[] = { + PHP_ME(google_protobuf_Int32Value, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int32Value, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int32Value, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_Int32Value_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\Int32Value", + google_protobuf_Int32Value_phpmethods); + + google_protobuf_Int32Value_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_Int32Value_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_Int32Value_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_Int32Value_ce, message_ce); +} + +/* google_protobuf_UInt32Value */ + +zend_class_entry* google_protobuf_UInt32Value_ce; + +static PHP_METHOD(google_protobuf_UInt32Value, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_UInt32Value, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_UInt32Value, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_UInt32Value_phpmethods[] = { + PHP_ME(google_protobuf_UInt32Value, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt32Value, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt32Value, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_UInt32Value_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\UInt32Value", + google_protobuf_UInt32Value_phpmethods); + + google_protobuf_UInt32Value_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_UInt32Value_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_UInt32Value_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_UInt32Value_ce, message_ce); +} + +/* google_protobuf_BoolValue */ + +zend_class_entry* google_protobuf_BoolValue_ce; + +static PHP_METHOD(google_protobuf_BoolValue, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_BoolValue, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_BoolValue, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_BoolValue_phpmethods[] = { + PHP_ME(google_protobuf_BoolValue, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BoolValue, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BoolValue, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_BoolValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\BoolValue", + google_protobuf_BoolValue_phpmethods); + + google_protobuf_BoolValue_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_BoolValue_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_BoolValue_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_BoolValue_ce, message_ce); +} + +/* google_protobuf_StringValue */ + +zend_class_entry* google_protobuf_StringValue_ce; + +static PHP_METHOD(google_protobuf_StringValue, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_StringValue, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_StringValue, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_StringValue_phpmethods[] = { + PHP_ME(google_protobuf_StringValue, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_StringValue, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_StringValue, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_StringValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\StringValue", + google_protobuf_StringValue_phpmethods); + + google_protobuf_StringValue_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_StringValue_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_StringValue_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_StringValue_ce, message_ce); +} + +/* google_protobuf_BytesValue */ + +zend_class_entry* google_protobuf_BytesValue_ce; + +static PHP_METHOD(google_protobuf_BytesValue, __construct) { + google_protobuf_wrappers_proto_AddDescriptor(); + zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + +static PHP_METHOD(google_protobuf_BytesValue, getValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval ret; + Message_get(intern, f, &ret); + RETURN_ZVAL(&ret, 1, 0); +} + +static PHP_METHOD(google_protobuf_BytesValue, setValue) { + Message* intern = (Message*)Z_OBJ_P(getThis()); + const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef, + "value"); + zval *val; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) + == FAILURE) { + return; + } + Message_set(intern, f, val); + RETURN_ZVAL(getThis(), 1, 0); +} + +static zend_function_entry google_protobuf_BytesValue_phpmethods[] = { + PHP_ME(google_protobuf_BytesValue, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BytesValue, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BytesValue, setValue, NULL, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void google_protobuf_BytesValue_ModuleInit() { + zend_class_entry tmp_ce; + + INIT_CLASS_ENTRY(tmp_ce, "Google\\Protobuf\\BytesValue", + google_protobuf_BytesValue_phpmethods); + + google_protobuf_BytesValue_ce = zend_register_internal_class(&tmp_ce); + google_protobuf_BytesValue_ce->ce_flags |= ZEND_ACC_FINAL; + google_protobuf_BytesValue_ce->create_object = Message_create; + zend_do_inheritance(google_protobuf_BytesValue_ce, message_ce); +} + +static void WellKnownTypes_ModuleInit() { + GPBMetadata_Google_Protobuf_Any_ModuleInit(); + google_protobuf_Any_ModuleInit(); + GPBMetadata_Google_Protobuf_Api_ModuleInit(); + google_protobuf_Api_ModuleInit(); + google_protobuf_Method_ModuleInit(); + google_protobuf_Mixin_ModuleInit(); + GPBMetadata_Google_Protobuf_Duration_ModuleInit(); + google_protobuf_Duration_ModuleInit(); + GPBMetadata_Google_Protobuf_GPBEmpty_ModuleInit(); + google_protobuf_Empty_ModuleInit(); + GPBMetadata_Google_Protobuf_FieldMask_ModuleInit(); + google_protobuf_FieldMask_ModuleInit(); + GPBMetadata_Google_Protobuf_SourceContext_ModuleInit(); + google_protobuf_SourceContext_ModuleInit(); + GPBMetadata_Google_Protobuf_Struct_ModuleInit(); + google_protobuf_Struct_ModuleInit(); + google_protobuf_Struct_FieldsEntry_ModuleInit(); + google_protobuf_Value_ModuleInit(); + google_protobuf_ListValue_ModuleInit(); + google_protobuf_NullValue_ModuleInit(); + GPBMetadata_Google_Protobuf_Type_ModuleInit(); + google_protobuf_Type_ModuleInit(); + google_protobuf_Field_ModuleInit(); + google_protobuf_Field_Kind_ModuleInit(); + google_protobuf_Field_Cardinality_ModuleInit(); + google_protobuf_Enum_ModuleInit(); + google_protobuf_EnumValue_ModuleInit(); + google_protobuf_Option_ModuleInit(); + google_protobuf_Syntax_ModuleInit(); + GPBMetadata_Google_Protobuf_Timestamp_ModuleInit(); + google_protobuf_Timestamp_ModuleInit(); + GPBMetadata_Google_Protobuf_Wrappers_ModuleInit(); + google_protobuf_DoubleValue_ModuleInit(); + google_protobuf_FloatValue_ModuleInit(); + google_protobuf_Int64Value_ModuleInit(); + google_protobuf_UInt64Value_ModuleInit(); + google_protobuf_Int32Value_ModuleInit(); + google_protobuf_UInt32Value_ModuleInit(); + google_protobuf_BoolValue_ModuleInit(); + google_protobuf_StringValue_ModuleInit(); + google_protobuf_BytesValue_ModuleInit(); +} diff --git a/php/generate_descriptor_protos.sh b/php/generate_descriptor_protos.sh index f636cc0ebb481cd45d33851d58cb3cfb12d4f7bf..9feaa96c8b51e4f078e58d5db0250038f93e9f47 100644 --- a/php/generate_descriptor_protos.sh +++ b/php/generate_descriptor_protos.sh @@ -3,6 +3,8 @@ # Run this script to regenerate descriptor protos after the protocol compiler # changes. +set -e + if test ! -e src/google/protobuf/stubs/common.h; then cat >&2 << __EOF__ Could not find source code. Make sure you are running this script from the @@ -13,4 +15,15 @@ fi pushd src ./protoc --php_out=internal:../php/src google/protobuf/descriptor.proto +./protoc --php_out=internal_generate_c_wkt:../php/src \ + google/protobuf/any.proto \ + google/protobuf/api.proto \ + google/protobuf/duration.proto \ + google/protobuf/empty.proto \ + google/protobuf/field_mask.proto \ + google/protobuf/source_context.proto \ + google/protobuf/struct.proto \ + google/protobuf/type.proto \ + google/protobuf/timestamp.proto \ + google/protobuf/wrappers.proto popd diff --git a/php/prepare_c_extension.sh b/php/prepare_c_extension.sh new file mode 100644 index 0000000000000000000000000000000000000000..84cd1aa3d155291657d248698e49070c875e6375 --- /dev/null +++ b/php/prepare_c_extension.sh @@ -0,0 +1,6 @@ + +# wyhash has to live in the base third_party directory. +# We copy it into the ext/google/protobuf directory for the build +# (and for the release to PECL). +mkdir -p ../ext/google/protobuf/third_party/wyhash +cp ../../third_party/wyhash/* ../ext/google/protobuf/third_party/wyhash diff --git a/php/release.sh b/php/release.sh index ec9ec0eeb3b0719541dfc27bb81b2d115ec74d54..6b0baac78ff578e08adfb2d6443821e65e52b2a4 100644 --- a/php/release.sh +++ b/php/release.sh @@ -10,8 +10,8 @@ set -ex VERSION=$1 -git clone git@github.com:protocolbuffers/protobuf-php.git -git clone git@github.com:protocolbuffers/protobuf.git +git clone https://github.com/protocolbuffers/protobuf-php.git +git clone https://github.com/protocolbuffers/protobuf.git # Clean old files pushd protobuf-php diff --git a/php/src/GPBMetadata/Google/Protobuf/Any.php b/php/src/GPBMetadata/Google/Protobuf/Any.php index 22cc25008fc8f482ef12e829e31e0d1018a9449b..fbce4bfdb10f93244f20fcdba619e29604d32509 100644 --- a/php/src/GPBMetadata/Google/Protobuf/Any.php +++ b/php/src/GPBMetadata/Google/Protobuf/Any.php @@ -14,15 +14,15 @@ class Any if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0acd010a19676f6f676c652f70726f746f6275662f616e792e70726f746f" . - "120f676f6f676c652e70726f746f62756622260a03416e7912100a087479" . - "70655f75726c180120012809120d0a0576616c756518022001280c426f0a" . - "13636f6d2e676f6f676c652e70726f746f6275664208416e7950726f746f" . - "50015a256769746875622e636f6d2f676f6c616e672f70726f746f627566" . - "2f7074797065732f616e79a20203475042aa021e476f6f676c652e50726f" . - "746f6275662e57656c6c4b6e6f776e5479706573620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + +google/protobuf/any.protogoogle.protobuf"& +Any +type_url (  +value ( Bv +com.google.protobufBAnyProtoPZ,google.golang.org/protobuf/types/known/anypbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/GPBMetadata/Google/Protobuf/Api.php b/php/src/GPBMetadata/Google/Protobuf/Api.php index b18e0d33ac03730369186cc0564c26fb698439d2..75e0ec63180563f33563d1c64b03ad663c557318 100644 --- a/php/src/GPBMetadata/Google/Protobuf/Api.php +++ b/php/src/GPBMetadata/Google/Protobuf/Api.php @@ -16,32 +16,31 @@ class Api } \GPBMetadata\Google\Protobuf\SourceContext::initOnce(); \GPBMetadata\Google\Protobuf\Type::initOnce(); - $pool->internalAddGeneratedFile(hex2bin( - "0ac8050a19676f6f676c652f70726f746f6275662f6170692e70726f746f" . - "120f676f6f676c652e70726f746f6275661a1a676f6f676c652f70726f74" . - "6f6275662f747970652e70726f746f2281020a03417069120c0a046e616d" . - "6518012001280912280a076d6574686f647318022003280b32172e676f6f" . - "676c652e70726f746f6275662e4d6574686f6412280a076f7074696f6e73" . - "18032003280b32172e676f6f676c652e70726f746f6275662e4f7074696f" . - "6e120f0a0776657273696f6e18042001280912360a0e736f757263655f63" . - "6f6e7465787418052001280b321e2e676f6f676c652e70726f746f627566" . - "2e536f75726365436f6e7465787412260a066d6978696e7318062003280b" . - "32162e676f6f676c652e70726f746f6275662e4d6978696e12270a067379" . - "6e74617818072001280e32172e676f6f676c652e70726f746f6275662e53" . - "796e74617822d5010a064d6574686f64120c0a046e616d65180120012809" . - "12180a10726571756573745f747970655f75726c18022001280912190a11" . - "726571756573745f73747265616d696e6718032001280812190a11726573" . - "706f6e73655f747970655f75726c180420012809121a0a12726573706f6e" . - "73655f73747265616d696e6718052001280812280a076f7074696f6e7318" . - "062003280b32172e676f6f676c652e70726f746f6275662e4f7074696f6e" . - "12270a0673796e74617818072001280e32172e676f6f676c652e70726f74" . - "6f6275662e53796e74617822230a054d6978696e120c0a046e616d651801" . - "20012809120c0a04726f6f7418022001280942750a13636f6d2e676f6f67" . - "6c652e70726f746f627566420841706950726f746f50015a2b676f6f676c" . - "652e676f6c616e672e6f72672f67656e70726f746f2f70726f746f627566" . - "2f6170693b617069a20203475042aa021e476f6f676c652e50726f746f62" . - "75662e57656c6c4b6e6f776e5479706573620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + +google/protobuf/api.protogoogle.protobufgoogle/protobuf/type.proto" +Api +name ( ( +methods ( 2.google.protobuf.Method( +options ( 2.google.protobuf.Option +version ( 6 +source_context ( 2.google.protobuf.SourceContext& +mixins ( 2.google.protobuf.Mixin\' +syntax (2.google.protobuf.Syntax" +Method +name (  +request_type_url (  +request_streaming ( +response_type_url (  +response_streaming (( +options ( 2.google.protobuf.Option\' +syntax (2.google.protobuf.Syntax"# +Mixin +name (  +root ( Bv +com.google.protobufBApiProtoPZ,google.golang.org/protobuf/types/known/apipbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/GPBMetadata/Google/Protobuf/Duration.php b/php/src/GPBMetadata/Google/Protobuf/Duration.php index b1c85ad8894e04c1507a99185d89b17d5dd1b5d4..5d8023e4db9e664b39d9e33c3b0e90ca0a3e0309 100644 --- a/php/src/GPBMetadata/Google/Protobuf/Duration.php +++ b/php/src/GPBMetadata/Google/Protobuf/Duration.php @@ -14,16 +14,15 @@ class Duration if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0ae3010a1e676f6f676c652f70726f746f6275662f6475726174696f6e2e" . - "70726f746f120f676f6f676c652e70726f746f627566222a0a0844757261" . - "74696f6e120f0a077365636f6e6473180120012803120d0a056e616e6f73" . - "180220012805427c0a13636f6d2e676f6f676c652e70726f746f62756642" . - "0d4475726174696f6e50726f746f50015a2a6769746875622e636f6d2f67" . - "6f6c616e672f70726f746f6275662f7074797065732f6475726174696f6e" . - "f80101a20203475042aa021e476f6f676c652e50726f746f6275662e5765" . - "6c6c4b6e6f776e5479706573620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + +google/protobuf/duration.protogoogle.protobuf"* +Duration +seconds ( +nanos (B +com.google.protobufB DurationProtoPZ1google.golang.org/protobuf/types/known/durationpbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/GPBMetadata/Google/Protobuf/FieldMask.php b/php/src/GPBMetadata/Google/Protobuf/FieldMask.php index 5812be1e2447406b1eb8e8ff69a79c23924340e3..f31bcc00124505ca8b605689da19ba7fb9260e21 100644 --- a/php/src/GPBMetadata/Google/Protobuf/FieldMask.php +++ b/php/src/GPBMetadata/Google/Protobuf/FieldMask.php @@ -14,16 +14,14 @@ class FieldMask if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0ae3010a20676f6f676c652f70726f746f6275662f6669656c645f6d6173" . - "6b2e70726f746f120f676f6f676c652e70726f746f627566221a0a094669" . - "656c644d61736b120d0a0570617468731801200328094289010a13636f6d" . - "2e676f6f676c652e70726f746f627566420e4669656c644d61736b50726f" . - "746f50015a39676f6f676c652e676f6c616e672e6f72672f67656e70726f" . - "746f2f70726f746f6275662f6669656c645f6d61736b3b6669656c645f6d" . - "61736ba20203475042aa021e476f6f676c652e50726f746f6275662e5765" . - "6c6c4b6e6f776e5479706573620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + + google/protobuf/field_mask.protogoogle.protobuf" + FieldMask +paths ( B +com.google.protobufBFieldMaskProtoPZ2google.golang.org/protobuf/types/known/fieldmaskpbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php b/php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php index 88f42a11a46244258bfe4c09f13bed18514386dd..5e42536f270c916fcf3c07797cecf1d2abca6d45 100644 --- a/php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php +++ b/php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php @@ -14,15 +14,14 @@ class GPBEmpty if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0ab7010a1b676f6f676c652f70726f746f6275662f656d7074792e70726f" . - "746f120f676f6f676c652e70726f746f62756622070a05456d7074794276" . - "0a13636f6d2e676f6f676c652e70726f746f627566420a456d7074795072" . - "6f746f50015a276769746875622e636f6d2f676f6c616e672f70726f746f" . - "6275662f7074797065732f656d707479f80101a20203475042aa021e476f" . - "6f676c652e50726f746f6275662e57656c6c4b6e6f776e54797065736206" . - "70726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + +google/protobuf/empty.protogoogle.protobuf" +EmptyB} +com.google.protobufB +EmptyProtoPZ.google.golang.org/protobuf/types/known/emptypbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/GPBMetadata/Google/Protobuf/SourceContext.php b/php/src/GPBMetadata/Google/Protobuf/SourceContext.php index 495c6de410ec8bae95b7f7ecd1ae9c1db69c9883..797732d9f326104bba770aecfacf0b71be240455 100644 --- a/php/src/GPBMetadata/Google/Protobuf/SourceContext.php +++ b/php/src/GPBMetadata/Google/Protobuf/SourceContext.php @@ -14,17 +14,14 @@ class SourceContext if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0afb010a24676f6f676c652f70726f746f6275662f736f757263655f636f" . - "6e746578742e70726f746f120f676f6f676c652e70726f746f6275662222" . - "0a0d536f75726365436f6e7465787412110a0966696c655f6e616d651801" . - "200128094295010a13636f6d2e676f6f676c652e70726f746f6275664212" . - "536f75726365436f6e7465787450726f746f50015a41676f6f676c652e67" . - "6f6c616e672e6f72672f67656e70726f746f2f70726f746f6275662f736f" . - "757263655f636f6e746578743b736f757263655f636f6e74657874a20203" . - "475042aa021e476f6f676c652e50726f746f6275662e57656c6c4b6e6f77" . - "6e5479706573620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + +$google/protobuf/source_context.protogoogle.protobuf"" + SourceContext + file_name ( B +com.google.protobufBSourceContextProtoPZ6google.golang.org/protobuf/types/known/sourcecontextpbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/GPBMetadata/Google/Protobuf/Struct.php b/php/src/GPBMetadata/Google/Protobuf/Struct.php index 8e6191dc7a269c13aae33b8d5e089fe450c78a37..888a81adee4075a2c04ab9805212f7c132174f4e 100644 Binary files a/php/src/GPBMetadata/Google/Protobuf/Struct.php and b/php/src/GPBMetadata/Google/Protobuf/Struct.php differ diff --git a/php/src/GPBMetadata/Google/Protobuf/Timestamp.php b/php/src/GPBMetadata/Google/Protobuf/Timestamp.php index 373665c977c048d932bda0a446455bde895f600b..09437271a91c0e52c3746a723477847e2cc2f2b4 100644 --- a/php/src/GPBMetadata/Google/Protobuf/Timestamp.php +++ b/php/src/GPBMetadata/Google/Protobuf/Timestamp.php @@ -14,16 +14,15 @@ class Timestamp if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0ae7010a1f676f6f676c652f70726f746f6275662f74696d657374616d70" . - "2e70726f746f120f676f6f676c652e70726f746f627566222b0a0954696d" . - "657374616d70120f0a077365636f6e6473180120012803120d0a056e616e" . - "6f73180220012805427e0a13636f6d2e676f6f676c652e70726f746f6275" . - "66420e54696d657374616d7050726f746f50015a2b6769746875622e636f" . - "6d2f676f6c616e672f70726f746f6275662f7074797065732f74696d6573" . - "74616d70f80101a20203475042aa021e476f6f676c652e50726f746f6275" . - "662e57656c6c4b6e6f776e5479706573620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + +google/protobuf/timestamp.protogoogle.protobuf"+ + Timestamp +seconds ( +nanos (B +com.google.protobufBTimestampProtoPZ2google.golang.org/protobuf/types/known/timestamppbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/GPBMetadata/Google/Protobuf/Type.php b/php/src/GPBMetadata/Google/Protobuf/Type.php index 8fbe8cbfe0d469cf68265860bfe70b3e1d3d8570..7d0bfbb533a2af7e63c43fd4b02e5bf41c61ac3c 100644 Binary files a/php/src/GPBMetadata/Google/Protobuf/Type.php and b/php/src/GPBMetadata/Google/Protobuf/Type.php differ diff --git a/php/src/GPBMetadata/Google/Protobuf/Wrappers.php b/php/src/GPBMetadata/Google/Protobuf/Wrappers.php index dd72ff48ce0ed87392dc4503ed972a7cb8035e27..e7ea1a3b95162872d4501227bb56401cf6c0844b 100644 --- a/php/src/GPBMetadata/Google/Protobuf/Wrappers.php +++ b/php/src/GPBMetadata/Google/Protobuf/Wrappers.php @@ -14,23 +14,34 @@ class Wrappers if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0abf030a1e676f6f676c652f70726f746f6275662f77726170706572732e" . - "70726f746f120f676f6f676c652e70726f746f627566221c0a0b446f7562" . - "6c6556616c7565120d0a0576616c7565180120012801221b0a0a466c6f61" . - "7456616c7565120d0a0576616c7565180120012802221b0a0a496e743634" . - "56616c7565120d0a0576616c7565180120012803221c0a0b55496e743634" . - "56616c7565120d0a0576616c7565180120012804221b0a0a496e74333256" . - "616c7565120d0a0576616c7565180120012805221c0a0b55496e74333256" . - "616c7565120d0a0576616c756518012001280d221a0a09426f6f6c56616c" . - "7565120d0a0576616c7565180120012808221c0a0b537472696e6756616c" . - "7565120d0a0576616c7565180120012809221b0a0a427974657356616c75" . - "65120d0a0576616c756518012001280c427c0a13636f6d2e676f6f676c65" . - "2e70726f746f627566420d577261707065727350726f746f50015a2a6769" . - "746875622e636f6d2f676f6c616e672f70726f746f6275662f7074797065" . - "732f7772617070657273f80101a20203475042aa021e476f6f676c652e50" . - "726f746f6275662e57656c6c4b6e6f776e5479706573620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' + +google/protobuf/wrappers.protogoogle.protobuf" + DoubleValue +value (" + +FloatValue +value (" + +Int64Value +value (" + UInt64Value +value (" + +Int32Value +value (" + UInt32Value +value ( " + BoolValue +value (" + StringValue +value ( " + +BytesValue +value ( B +com.google.protobufB WrappersProtoPZ1google.golang.org/protobuf/types/known/wrapperspbGPBGoogle.Protobuf.WellKnownTypesbproto3' + , true); static::$is_initialized = true; } diff --git a/php/src/Google/Protobuf/Any.php b/php/src/Google/Protobuf/Any.php index 2c7bc75454035493f3058c63bb941bf517589b2c..8fdc3c483d22ad6174b26cdc71a96b2aecffdae4 100644 --- a/php/src/Google/Protobuf/Any.php +++ b/php/src/Google/Protobuf/Any.php @@ -5,7 +5,6 @@ namespace Google\Protobuf; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\Message; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; @@ -39,10 +38,13 @@ use Google\Protobuf\Internal\GPBUtil; * ... * Example 4: Pack and unpack a message in Go * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } * ... * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * if err := any.UnmarshalTo(foo); err != nil { * ... * } * The pack methods provided by protobuf library will by default use @@ -76,11 +78,12 @@ use Google\Protobuf\Internal\GPBUtil; * * Generated from protobuf message google.protobuf.Any */ -class Any extends \Google\Protobuf\Internal\Message +class Any extends \Google\Protobuf\Internal\AnyBase { /** * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). @@ -104,15 +107,13 @@ class Any extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string type_url = 1; */ - private $type_url = ''; + protected $type_url = ''; /** * Must be a valid serialized protocol buffer of the above specified type. * * Generated from protobuf field bytes value = 2; */ - private $value = ''; - - const TYPE_URL_PREFIX = 'type.googleapis.com/'; + protected $value = ''; /** * Constructor. @@ -122,7 +123,8 @@ class Any extends \Google\Protobuf\Internal\Message * * @type string $type_url * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). @@ -154,7 +156,8 @@ class Any extends \Google\Protobuf\Internal\Message /** * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). @@ -186,7 +189,8 @@ class Any extends \Google\Protobuf\Internal\Message /** * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). @@ -246,78 +250,5 @@ class Any extends \Google\Protobuf\Internal\Message return $this; } - /** - * This method will try to resolve the type_url in Any message to get the - * targeted message type. If failed, an error will be thrown. Otherwise, - * the method will create a message of the targeted type and fill it with - * the decoded value in Any. - * @return Message unpacked message - * @throws \Exception Type url needs to be type.googleapis.com/fully-qualified. - * @throws \Exception Class hasn't been added to descriptor pool. - * @throws \Exception cannot decode data in value field. - */ - public function unpack() - { - // Get fully qualified name from type url. - $url_prifix_len = strlen(GPBUtil::TYPE_URL_PREFIX); - if (substr($this->type_url, 0, $url_prifix_len) != - GPBUtil::TYPE_URL_PREFIX) { - throw new \Exception( - "Type url needs to be type.googleapis.com/fully-qulified"); - } - $fully_qualifed_name = - substr($this->type_url, $url_prifix_len); - - // Create message according to fully qualified name. - $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); - $desc = $pool->getDescriptorByProtoName($fully_qualifed_name); - if (is_null($desc)) { - throw new \Exception("Class ".$fully_qualifed_name - ." hasn't been added to descriptor pool"); - } - $klass = $desc->getClass(); - $msg = new $klass(); - - // Merge data into message. - $msg->mergeFromString($this->value); - return $msg; - } - - /** - * The type_url will be created according to the given message’s type and - * the value is encoded data from the given message.. - * @param message: A proto message. - */ - public function pack($msg) - { - if (!$msg instanceof Message) { - trigger_error("Given parameter is not a message instance.", - E_USER_ERROR); - return; - } - - // Set value using serialized message. - $this->value = $msg->serializeToString(); - - // Set type url. - $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); - $desc = $pool->getDescriptorByClassName(get_class($msg)); - $fully_qualifed_name = $desc->getFullName(); - $this->type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name; - } - - /** - * This method returns whether the type_url in any_message is corresponded - * to the given class. - * @param klass: The fully qualified PHP class name of a proto message type. - */ - public function is($klass) - { - $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); - $desc = $pool->getDescriptorByClassName($klass); - $fully_qualifed_name = $desc->getFullName(); - $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name; - return $this->type_url === $type_url; - } } diff --git a/php/src/Google/Protobuf/Api.php b/php/src/Google/Protobuf/Api.php index db37ffb0194e4a6aa3c66192ffa01b85ececdad0..773397565c08ea37434cc2f162e3c8cf0d5aec26 100644 --- a/php/src/Google/Protobuf/Api.php +++ b/php/src/Google/Protobuf/Api.php @@ -28,7 +28,7 @@ class Api extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The methods of this interface, in unspecified order. * @@ -62,14 +62,14 @@ class Api extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 4; */ - private $version = ''; + protected $version = ''; /** * Source context for the protocol buffer service represented by this * message. * * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; */ - private $source_context = null; + protected $source_context = null; /** * Included interfaces. See [Mixin][]. * @@ -81,7 +81,7 @@ class Api extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Syntax syntax = 7; */ - private $syntax = 0; + protected $syntax = 0; /** * Constructor. @@ -275,7 +275,17 @@ class Api extends \Google\Protobuf\Internal\Message */ public function getSourceContext() { - return $this->source_context; + return isset($this->source_context) ? $this->source_context : null; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); } /** diff --git a/php/src/Google/Protobuf/BoolValue.php b/php/src/Google/Protobuf/BoolValue.php index 13872eb1e464bb2f0d9dcf74d21b44683fca5aa5..ecdbf4dcc26562bc4c61068335789d14a90b03d2 100644 --- a/php/src/Google/Protobuf/BoolValue.php +++ b/php/src/Google/Protobuf/BoolValue.php @@ -21,7 +21,7 @@ class BoolValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool value = 1; */ - private $value = false; + protected $value = false; /** * Constructor. diff --git a/php/src/Google/Protobuf/BytesValue.php b/php/src/Google/Protobuf/BytesValue.php index f1b381718564218f2e898c09720c6d1a3ab1b647..1582e14acd903e15cda176743197a6cfcadba21b 100644 --- a/php/src/Google/Protobuf/BytesValue.php +++ b/php/src/Google/Protobuf/BytesValue.php @@ -21,7 +21,7 @@ class BytesValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes value = 1; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/php/src/Google/Protobuf/DoubleValue.php b/php/src/Google/Protobuf/DoubleValue.php index 236d918223549eaab0ebc3f1f41e8b883b07d9bb..b72399f460d68e0a2c12f48a1341736e906758d2 100644 --- a/php/src/Google/Protobuf/DoubleValue.php +++ b/php/src/Google/Protobuf/DoubleValue.php @@ -21,7 +21,7 @@ class DoubleValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double value = 1; */ - private $value = 0.0; + protected $value = 0.0; /** * Constructor. diff --git a/php/src/Google/Protobuf/Duration.php b/php/src/Google/Protobuf/Duration.php index 414a1868b7489468950a4225a7d40c03b4cd4b5a..531cd50b57915509b6f93a75200b2d99937ac24d 100644 --- a/php/src/Google/Protobuf/Duration.php +++ b/php/src/Google/Protobuf/Duration.php @@ -25,7 +25,7 @@ use Google\Protobuf\Internal\GPBUtil; * if (duration.seconds < 0 && duration.nanos > 0) { * duration.seconds += 1; * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { + * } else if (duration.seconds > 0 && duration.nanos < 0) { * duration.seconds -= 1; * duration.nanos += 1000000000; * } @@ -66,7 +66,7 @@ class Duration extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 seconds = 1; */ - private $seconds = 0; + protected $seconds = 0; /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 @@ -77,7 +77,7 @@ class Duration extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 nanos = 2; */ - private $nanos = 0; + protected $nanos = 0; /** * Constructor. diff --git a/php/src/Google/Protobuf/Enum.php b/php/src/Google/Protobuf/Enum.php index 243c40d2899d1de3890ad05dfed0a6213b1b4c6d..ed5afc447fecd222349c85c8ce48f717e2b603f7 100644 --- a/php/src/Google/Protobuf/Enum.php +++ b/php/src/Google/Protobuf/Enum.php @@ -20,7 +20,7 @@ class Enum extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Enum value definitions. * @@ -38,13 +38,13 @@ class Enum extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; */ - private $source_context = null; + protected $source_context = null; /** * The source syntax. * * Generated from protobuf field .google.protobuf.Syntax syntax = 5; */ - private $syntax = 0; + protected $syntax = 0; /** * Constructor. @@ -155,7 +155,17 @@ class Enum extends \Google\Protobuf\Internal\Message */ public function getSourceContext() { - return $this->source_context; + return isset($this->source_context) ? $this->source_context : null; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); } /** diff --git a/php/src/Google/Protobuf/EnumValue.php b/php/src/Google/Protobuf/EnumValue.php index 1dc3c7a6eee03717ad43b475b0d31950240b0d18..905f4ad14b2980418fc52a57496a500f6e405912 100644 --- a/php/src/Google/Protobuf/EnumValue.php +++ b/php/src/Google/Protobuf/EnumValue.php @@ -20,13 +20,13 @@ class EnumValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Enum value number. * * Generated from protobuf field int32 number = 2; */ - private $number = 0; + protected $number = 0; /** * Protocol buffer options. * diff --git a/php/src/Google/Protobuf/Field.php b/php/src/Google/Protobuf/Field.php index 8da43e34da4f197b6125d02d142df95a18108d65..76a505ea567d8d3426de97c561b9b4fba1642bb6 100644 --- a/php/src/Google/Protobuf/Field.php +++ b/php/src/Google/Protobuf/Field.php @@ -20,45 +20,45 @@ class Field extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; */ - private $kind = 0; + protected $kind = 0; /** * The field cardinality. * * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; */ - private $cardinality = 0; + protected $cardinality = 0; /** * The field number. * * Generated from protobuf field int32 number = 3; */ - private $number = 0; + protected $number = 0; /** * The field name. * * Generated from protobuf field string name = 4; */ - private $name = ''; + protected $name = ''; /** * The field type URL, without the scheme, for message or enumeration * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. * * Generated from protobuf field string type_url = 6; */ - private $type_url = ''; + protected $type_url = ''; /** * The index of the field type in `Type.oneofs`, for message or enumeration * types. The first type has index 1; zero means the type is not in the list. * * Generated from protobuf field int32 oneof_index = 7; */ - private $oneof_index = 0; + protected $oneof_index = 0; /** * Whether to use alternative packed wire representation. * * Generated from protobuf field bool packed = 8; */ - private $packed = false; + protected $packed = false; /** * The protocol buffer options. * @@ -70,13 +70,13 @@ class Field extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string json_name = 10; */ - private $json_name = ''; + protected $json_name = ''; /** * The string value of the default value of this field. Proto2 syntax only. * * Generated from protobuf field string default_value = 11; */ - private $default_value = ''; + protected $default_value = ''; /** * Constructor. @@ -133,7 +133,7 @@ class Field extends \Google\Protobuf\Internal\Message */ public function setKind($var) { - GPBUtil::checkEnum($var, \Google\Protobuf\Field_Kind::class); + GPBUtil::checkEnum($var, \Google\Protobuf\Field\Kind::class); $this->kind = $var; return $this; @@ -159,7 +159,7 @@ class Field extends \Google\Protobuf\Internal\Message */ public function setCardinality($var) { - GPBUtil::checkEnum($var, \Google\Protobuf\Field_Cardinality::class); + GPBUtil::checkEnum($var, \Google\Protobuf\Field\Cardinality::class); $this->cardinality = $var; return $this; diff --git a/php/src/Google/Protobuf/Field/Cardinality.php b/php/src/Google/Protobuf/Field/Cardinality.php index 479dc0bfc2db680362a94a4630bc492a02a92303..a42219957696e874e54cfe0c61b65ca8134a239e 100644 --- a/php/src/Google/Protobuf/Field/Cardinality.php +++ b/php/src/Google/Protobuf/Field/Cardinality.php @@ -54,6 +54,7 @@ class Cardinality return self::$valueToName[$value]; } + public static function value($name) { $const = __CLASS__ . '::' . strtoupper($name); diff --git a/php/src/Google/Protobuf/Field/Kind.php b/php/src/Google/Protobuf/Field/Kind.php index f30bd2f59bdf3a5b9939faaaedda6a2f33a790ae..2d8dd77c1cb46b7c9d50778fc01d453fd1cc5c01 100644 --- a/php/src/Google/Protobuf/Field/Kind.php +++ b/php/src/Google/Protobuf/Field/Kind.php @@ -159,6 +159,7 @@ class Kind return self::$valueToName[$value]; } + public static function value($name) { $const = __CLASS__ . '::' . strtoupper($name); diff --git a/php/src/Google/Protobuf/FieldMask.php b/php/src/Google/Protobuf/FieldMask.php index 8fb38cbfb22c7b76df21a82ea2b2ffe0de987c71..0b9659d38f5cb3b0ba7fd2452dc7467e7d871425 100644 --- a/php/src/Google/Protobuf/FieldMask.php +++ b/php/src/Google/Protobuf/FieldMask.php @@ -62,45 +62,39 @@ use Google\Protobuf\Internal\GPBUtil; * and leave the others untouched. If a resource is passed in to * describe the updated values, the API ignores the values of all * fields not covered by the mask. - * If a repeated field is specified for an update operation, the existing - * repeated values in the target resource will be overwritten by the new values. - * Note that a repeated field is only allowed in the last position of a `paths` - * string. + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. * If a sub-message is specified in the last position of the field mask for an - * update operation, then the existing sub-message in the target resource is - * overwritten. Given the target message: + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * For example, given the target message: * f { * b { - * d : 1 - * x : 2 + * d: 1 + * x: 2 * } - * c : 1 + * c: [1] * } * And an update message: * f { * b { - * d : 10 + * d: 10 * } + * c: [2] * } * then if the field mask is: - * paths: "f.b" + * paths: ["f.b", "f.c"] * then the result will be: * f { * b { - * d : 10 - * } - * c : 1 - * } - * However, if the update mask was: - * paths: "f.b.d" - * then the result would be: - * f { - * b { - * d : 10 - * x : 2 + * d: 10 + * x: 2 * } - * c : 1 + * c: [1, 2] * } + * An implementation may provide options to override this default behavior for + * repeated and message fields. * In order to reset a field's value to the default, the field must * be in the mask and set to the default value in the provided resource. * Hence, in order to reset all fields of a resource, provide a default @@ -165,7 +159,7 @@ use Google\Protobuf\Internal\GPBUtil; * ## Field Mask Verification * The implementation of any API method which has a FieldMask type field in the * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + * `INVALID_ARGUMENT` error if any path is unmappable. * * Generated from protobuf message google.protobuf.FieldMask */ diff --git a/php/src/Google/Protobuf/FloatValue.php b/php/src/Google/Protobuf/FloatValue.php index 47ba52e6af3a4973e853219b82992090924fbdd2..4285358d5e8c728b9141c464c2d9d3886ec782f7 100644 --- a/php/src/Google/Protobuf/FloatValue.php +++ b/php/src/Google/Protobuf/FloatValue.php @@ -21,7 +21,7 @@ class FloatValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field float value = 1; */ - private $value = 0.0; + protected $value = 0.0; /** * Constructor. diff --git a/php/src/Google/Protobuf/Int32Value.php b/php/src/Google/Protobuf/Int32Value.php index d7fd528d21bf502c1cccdfc4bc204119bf2c6396..cfd73cdc90f50536239ca1d1151034b1dd4b100c 100644 --- a/php/src/Google/Protobuf/Int32Value.php +++ b/php/src/Google/Protobuf/Int32Value.php @@ -21,7 +21,7 @@ class Int32Value extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 value = 1; */ - private $value = 0; + protected $value = 0; /** * Constructor. diff --git a/php/src/Google/Protobuf/Int64Value.php b/php/src/Google/Protobuf/Int64Value.php index ca663055839cf744f8a950923c014cb0986346c3..143474fcd7cffef38702a877f5a4ab422d21e9cc 100644 --- a/php/src/Google/Protobuf/Int64Value.php +++ b/php/src/Google/Protobuf/Int64Value.php @@ -21,7 +21,7 @@ class Int64Value extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 value = 1; */ - private $value = 0; + protected $value = 0; /** * Constructor. diff --git a/php/src/Google/Protobuf/Internal/AnyBase.php b/php/src/Google/Protobuf/Internal/AnyBase.php new file mode 100644 index 0000000000000000000000000000000000000000..cba922d475474292bb9f6a00f05eaaac6e2ca52d --- /dev/null +++ b/php/src/Google/Protobuf/Internal/AnyBase.php @@ -0,0 +1,86 @@ +type_url, 0, $url_prifix_len) != + GPBUtil::TYPE_URL_PREFIX) { + throw new \Exception( + "Type url needs to be type.googleapis.com/fully-qulified"); + } + $fully_qualifed_name = + substr($this->type_url, $url_prifix_len); + + // Create message according to fully qualified name. + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByProtoName($fully_qualifed_name); + if (is_null($desc)) { + throw new \Exception("Class ".$fully_qualifed_name + ." hasn't been added to descriptor pool"); + } + $klass = $desc->getClass(); + $msg = new $klass(); + + // Merge data into message. + $msg->mergeFromString($this->value); + return $msg; + } + + /** + * The type_url will be created according to the given message’s type and + * the value is encoded data from the given message.. + * @param message: A proto message. + */ + public function pack($msg) + { + if (!$msg instanceof Message) { + trigger_error("Given parameter is not a message instance.", + E_USER_ERROR); + return; + } + + // Set value using serialized message. + $this->value = $msg->serializeToString(); + + // Set type url. + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName(get_class($msg)); + $fully_qualifed_name = $desc->getFullName(); + $this->type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name; + } + + /** + * This method returns whether the type_url in any_message is corresponded + * to the given class. + * @param klass: The fully qualified PHP class name of a proto message type. + */ + public function is($klass) + { + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + $fully_qualifed_name = $desc->getFullName(); + $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name; + return $this->type_url === $type_url; + } +} diff --git a/php/src/Google/Protobuf/Internal/TimestampBase.php b/php/src/Google/Protobuf/Internal/TimestampBase.php new file mode 100644 index 0000000000000000000000000000000000000000..653d1e99d71c0d26a67ce4d3edeb7b11ef2ef590 --- /dev/null +++ b/php/src/Google/Protobuf/Internal/TimestampBase.php @@ -0,0 +1,32 @@ +seconds = $datetime->getTimestamp(); + $this->nanos = 1000 * $datetime->format('u'); + } + + /** + * Converts Timestamp to PHP DateTime. + * + * @return \DateTime $datetime + */ + public function toDateTime() + { + $time = sprintf('%s.%06d', $this->seconds, $this->nanos / 1000); + return \DateTime::createFromFormat('U.u', $time); + } +} diff --git a/php/src/Google/Protobuf/Method.php b/php/src/Google/Protobuf/Method.php index 8e803506885cf3a267aa9bbbca55506f9de28f78..2755baa0e8b070c1db8b580347a4c7801c4598ad 100644 --- a/php/src/Google/Protobuf/Method.php +++ b/php/src/Google/Protobuf/Method.php @@ -20,31 +20,31 @@ class Method extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * A URL of the input message type. * * Generated from protobuf field string request_type_url = 2; */ - private $request_type_url = ''; + protected $request_type_url = ''; /** * If true, the request is streamed. * * Generated from protobuf field bool request_streaming = 3; */ - private $request_streaming = false; + protected $request_streaming = false; /** * The URL of the output message type. * * Generated from protobuf field string response_type_url = 4; */ - private $response_type_url = ''; + protected $response_type_url = ''; /** * If true, the response is streamed. * * Generated from protobuf field bool response_streaming = 5; */ - private $response_streaming = false; + protected $response_streaming = false; /** * Any metadata attached to the method. * @@ -56,7 +56,7 @@ class Method extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Syntax syntax = 7; */ - private $syntax = 0; + protected $syntax = 0; /** * Constructor. diff --git a/php/src/Google/Protobuf/Mixin.php b/php/src/Google/Protobuf/Mixin.php index a2ea59c757847cfd1f386e05cc91a521c38846e6..4f7bf844ccfe1ce05be04df3c4d206cae1317a3d 100644 --- a/php/src/Google/Protobuf/Mixin.php +++ b/php/src/Google/Protobuf/Mixin.php @@ -46,7 +46,7 @@ use Google\Protobuf\Internal\GPBUtil; * The mixin construct implies that all methods in `AccessControl` are * also declared with same name and request/response types in * `Storage`. A documentation generator or annotation processor will - * see the effective `Storage.GetAcl` method after inherting + * see the effective `Storage.GetAcl` method after inheriting * documentation and annotations as follows: * service Storage { * // Get the underlying ACL object. @@ -81,14 +81,14 @@ class Mixin extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * If non-empty specifies a path under which inherited HTTP paths * are rooted. * * Generated from protobuf field string root = 2; */ - private $root = ''; + protected $root = ''; /** * Constructor. diff --git a/php/src/Google/Protobuf/Option.php b/php/src/Google/Protobuf/Option.php index 22ecfc5f5c6cf336de3eebf9c3964702c2bd6382..9b2cc6c22c323f9a356ed099a2e8e4dda75968c2 100644 --- a/php/src/Google/Protobuf/Option.php +++ b/php/src/Google/Protobuf/Option.php @@ -24,7 +24,7 @@ class Option extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The option's value packed in an Any message. If the value is a primitive, * the corresponding wrapper type defined in google/protobuf/wrappers.proto @@ -33,7 +33,7 @@ class Option extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Any value = 2; */ - private $value = null; + protected $value = null; /** * Constructor. @@ -101,7 +101,17 @@ class Option extends \Google\Protobuf\Internal\Message */ public function getValue() { - return $this->value; + return isset($this->value) ? $this->value : null; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); } /** diff --git a/php/src/Google/Protobuf/SourceContext.php b/php/src/Google/Protobuf/SourceContext.php index cbc50c6842608cbbbc203631a755da60056a4779..8b3ea11220cd5e82e4885bbd0a89bbe05f66f77e 100644 --- a/php/src/Google/Protobuf/SourceContext.php +++ b/php/src/Google/Protobuf/SourceContext.php @@ -22,7 +22,7 @@ class SourceContext extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string file_name = 1; */ - private $file_name = ''; + protected $file_name = ''; /** * Constructor. diff --git a/php/src/Google/Protobuf/StringValue.php b/php/src/Google/Protobuf/StringValue.php index 8fb354f3881e2b20e5ded424d7c928c1ae109b9d..ad98316b22475016739be3f7bd77f695969e9c62 100644 --- a/php/src/Google/Protobuf/StringValue.php +++ b/php/src/Google/Protobuf/StringValue.php @@ -21,7 +21,7 @@ class StringValue extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string value = 1; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/php/src/Google/Protobuf/Syntax.php b/php/src/Google/Protobuf/Syntax.php index 9812669dacacd96fd0ec5223f78739e527f8c553..10952bfd42ceadb9790e3621d138376f01bb52c3 100644 --- a/php/src/Google/Protobuf/Syntax.php +++ b/php/src/Google/Protobuf/Syntax.php @@ -40,6 +40,7 @@ class Syntax return self::$valueToName[$value]; } + public static function value($name) { $const = __CLASS__ . '::' . strtoupper($name); diff --git a/php/src/Google/Protobuf/Timestamp.php b/php/src/Google/Protobuf/Timestamp.php index 6d26f6c5cfdfe00dbd46edb036e0b9c65c668908..a12f48520bf2f9590144684e07b78c9a5c1d3d02 100644 --- a/php/src/Google/Protobuf/Timestamp.php +++ b/php/src/Google/Protobuf/Timestamp.php @@ -9,17 +9,17 @@ use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * # Examples * Example 1: Compute Timestamp from POSIX `time()`. * Timestamp timestamp; @@ -44,7 +44,12 @@ use Google\Protobuf\Internal\GPBUtil; * long millis = System.currentTimeMillis(); * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. + * Instant now = Instant.now(); + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * Example 6: Compute Timestamp from current time in Python. * timestamp = Timestamp() * timestamp.GetCurrentTime() * # JSON Mapping @@ -61,17 +66,19 @@ use Google\Protobuf\Internal\GPBUtil; * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past * 01:30 UTC on January 15, 2017. * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D * ) to obtain a formatter capable of generating timestamps in this format. * * Generated from protobuf message google.protobuf.Timestamp */ -class Timestamp extends \Google\Protobuf\Internal\Message +class Timestamp extends \Google\Protobuf\Internal\TimestampBase { /** * Represents seconds of UTC time since Unix epoch @@ -80,7 +87,7 @@ class Timestamp extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 seconds = 1; */ - private $seconds = 0; + protected $seconds = 0; /** * Non-negative fractions of a second at nanosecond resolution. Negative * second values with fractions must still have non-negative nanos values @@ -89,7 +96,7 @@ class Timestamp extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 nanos = 2; */ - private $nanos = 0; + protected $nanos = 0; /** * Constructor. @@ -175,26 +182,5 @@ class Timestamp extends \Google\Protobuf\Internal\Message return $this; } - /* - * Converts PHP DateTime to Timestamp. - * - * @param \DateTime $datetime - */ - public function fromDateTime(\DateTime $datetime) - { - $this->seconds = $datetime->getTimestamp(); - $this->nanos = 1000 * $datetime->format('u'); - } - - /** - * Converts Timestamp to PHP DateTime. - * - * @return \DateTime $datetime - */ - public function toDateTime() - { - $time = sprintf('%s.%06d', $this->seconds, $this->nanos / 1000); - return \DateTime::createFromFormat('U.u', $time); - } } diff --git a/php/src/Google/Protobuf/Type.php b/php/src/Google/Protobuf/Type.php index 1b47811050a4c4ee47052d2915f11ddb5dd8be3c..f60686665cd3a9eadb46223e64834444c2b344b2 100644 --- a/php/src/Google/Protobuf/Type.php +++ b/php/src/Google/Protobuf/Type.php @@ -20,7 +20,7 @@ class Type extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The list of fields. * @@ -44,13 +44,13 @@ class Type extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; */ - private $source_context = null; + protected $source_context = null; /** * The source syntax. * * Generated from protobuf field .google.protobuf.Syntax syntax = 6; */ - private $syntax = 0; + protected $syntax = 0; /** * Constructor. @@ -189,7 +189,17 @@ class Type extends \Google\Protobuf\Internal\Message */ public function getSourceContext() { - return $this->source_context; + return isset($this->source_context) ? $this->source_context : null; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); } /** diff --git a/php/src/Google/Protobuf/UInt32Value.php b/php/src/Google/Protobuf/UInt32Value.php index f5a522d2e8eff54f9acf53ac788a522f8305b50f..ae5fc5b42c8d171382061327ff3f33c5c724df83 100644 --- a/php/src/Google/Protobuf/UInt32Value.php +++ b/php/src/Google/Protobuf/UInt32Value.php @@ -21,7 +21,7 @@ class UInt32Value extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 value = 1; */ - private $value = 0; + protected $value = 0; /** * Constructor. diff --git a/php/src/Google/Protobuf/UInt64Value.php b/php/src/Google/Protobuf/UInt64Value.php index 89e69cd892063637865b97b720520140e09d3dfd..aa9686726b9353264a6080f0bd0a46a1c14778d6 100644 --- a/php/src/Google/Protobuf/UInt64Value.php +++ b/php/src/Google/Protobuf/UInt64Value.php @@ -21,7 +21,7 @@ class UInt64Value extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint64 value = 1; */ - private $value = 0; + protected $value = 0; /** * Constructor. diff --git a/php/tests/ArrayTest.php b/php/tests/ArrayTest.php index 2cb4b3910de2f023eddec336a0da8d70f6a3c550..d167331364dd181e6f5c6864c525e983f959fd5f 100644 --- a/php/tests/ArrayTest.php +++ b/php/tests/ArrayTest.php @@ -590,4 +590,35 @@ class ArrayTest extends \PHPUnit\Framework\TestCase $end = memory_get_usage(); $this->assertLessThan($start, $end); } + + ######################################################### + # Test equality + ######################################################### + + public function testEquality() + { + $arr = new RepeatedField(GPBType::INT32); + $arr2 = new RepeatedField(GPBType::INT32); + + $this->assertTrue($arr == $arr2); + + $arr[] = 0; + $arr[] = 1; + $arr[] = 2; + + $this->assertFalse($arr == $arr2); + + $arr2[] = 0; + $arr2[] = 1; + $arr2[] = 2; + + $this->assertTrue($arr == $arr2); + + // Arrays of different types always compare false. + $this->assertFalse(new RepeatedField(GPBType::INT32) == + new RepeatedField(GPBType::INT64)); + $this->assertFalse( + new RepeatedField(GPBType::MESSAGE, TestMessage::class) == + new RepeatedField(GPBType::MESSAGE, Sub::class)); + } } diff --git a/php/tests/DescriptorsTest.php b/php/tests/DescriptorsTest.php index 60a6292cb61d767a753081010cd6c492cdc3e708..b2c5e0144d4bcae888fb8e867319fa5e18c653dd 100644 --- a/php/tests/DescriptorsTest.php +++ b/php/tests/DescriptorsTest.php @@ -108,7 +108,7 @@ class DescriptorsTest extends TestBase public function testEnumDescriptor() { - // WARNINIG - we need to do this so that TestDescriptorsEnum is registered!!? + // WARNING - we need to do this so that TestDescriptorsEnum is registered!!? new TestDescriptorsMessage(); $pool = DescriptorPool::getGeneratedPool(); diff --git a/php/tests/GeneratedClassTest.php b/php/tests/GeneratedClassTest.php index f49c4e970c60fde798a19db5f31cff29ae95ef3f..037bd1be9c5cb133a16571974d6de0239f9c20c8 100644 --- a/php/tests/GeneratedClassTest.php +++ b/php/tests/GeneratedClassTest.php @@ -1529,6 +1529,165 @@ class GeneratedClassTest extends TestBase $m->setOptionalString($values[0]); } + ######################################################### + # Test equality + ######################################################### + + public function testShallowEquality() + { + $m1 = new TestMessage([ + 'optional_int32' => -42, + 'optional_int64' => -43, + 'optional_uint32' => 42, + 'optional_uint64' => 43, + 'optional_sint32' => -44, + 'optional_sint64' => -45, + 'optional_fixed32' => 46, + 'optional_fixed64' => 47, + 'optional_sfixed32' => -46, + 'optional_sfixed64' => -47, + 'optional_float' => 1.5, + 'optional_double' => 1.6, + 'optional_bool' => true, + 'optional_string' => 'a', + 'optional_bytes' => 'bbbb', + 'optional_enum' => TestEnum::ONE, + ]); + $data = $m1->serializeToString(); + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $this->assertTrue($m1 == $m2); + + $m1->setOptionalInt32(1234); + $this->assertTrue($m1 != $m2); + } + + public function testDeepEquality() + { + $m1 = new TestMessage([ + 'optional_int32' => -42, + 'optional_int64' => -43, + 'optional_uint32' => 42, + 'optional_uint64' => 43, + 'optional_sint32' => -44, + 'optional_sint64' => -45, + 'optional_fixed32' => 46, + 'optional_fixed64' => 47, + 'optional_sfixed32' => -46, + 'optional_sfixed64' => -47, + 'optional_float' => 1.5, + 'optional_double' => 1.6, + 'optional_bool' => true, + 'optional_string' => 'a', + 'optional_bytes' => 'bbbb', + 'optional_enum' => TestEnum::ONE, + 'optional_message' => new Sub([ + 'a' => 33 + ]), + 'repeated_int32' => [-42, -52], + 'repeated_int64' => [-43, -53], + 'repeated_uint32' => [42, 52], + 'repeated_uint64' => [43, 53], + 'repeated_sint32' => [-44, -54], + 'repeated_sint64' => [-45, -55], + 'repeated_fixed32' => [46, 56], + 'repeated_fixed64' => [47, 57], + 'repeated_sfixed32' => [-46, -56], + 'repeated_sfixed64' => [-47, -57], + 'repeated_float' => [1.5, 2.5], + 'repeated_double' => [1.6, 2.6], + 'repeated_bool' => [true, false], + 'repeated_string' => ['a', 'c'], + 'repeated_bytes' => ['bbbb', 'dddd'], + 'repeated_enum' => [TestEnum::ZERO, TestEnum::ONE], + 'repeated_message' => [new Sub(['a' => 34]), + new Sub(['a' => 35])], + 'map_int32_int32' => [-62 => -62], + 'map_int64_int64' => [-63 => -63], + 'map_uint32_uint32' => [62 => 62], + 'map_uint64_uint64' => [63 => 63], + 'map_sint32_sint32' => [-64 => -64], + 'map_sint64_sint64' => [-65 => -65], + 'map_fixed32_fixed32' => [66 => 66], + 'map_fixed64_fixed64' => [67 => 67], + 'map_sfixed32_sfixed32' => [-68 => -68], + 'map_sfixed64_sfixed64' => [-69 => -69], + 'map_int32_float' => [1 => 3.5], + 'map_int32_double' => [1 => 3.6], + 'map_bool_bool' => [true => true], + 'map_string_string' => ['e' => 'e'], + 'map_int32_bytes' => [1 => 'ffff'], + 'map_int32_enum' => [1 => TestEnum::ONE], + 'map_int32_message' => [1 => new Sub(['a' => 36])], + ]); + $data = $m1->serializeToString(); + + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $this->assertTrue($m1 == $m2); + + # Nested sub-message is checked. + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $m2->getOptionalMessage()->setA(1234); + $this->assertTrue($m1 != $m2); + + # Repeated field element is checked. + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $m2->getRepeatedInt32()[0] = 1234; + $this->assertTrue($m1 != $m2); + + # Repeated field length is checked. + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $m2->getRepeatedInt32()[] = 1234; + $this->assertTrue($m1 != $m2); + + # SubMessage inside repeated field is checked. + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $m2->getRepeatedMessage()[0]->setA(1234); + $this->assertTrue($m1 != $m2); + + # Map value is checked. + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $m2->getMapInt32Int32()[-62] = 1234; + $this->assertTrue($m1 != $m2); + + # Map size is checked. + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $m2->getMapInt32Int32()[1234] = 1234; + $this->assertTrue($m1 != $m2); + + # SubMessage inside map field is checked. + $m2 = new TestMessage(); + $m2->mergeFromString($data); + $m2->getMapInt32Message()[1]->setA(1234); + $this->assertTrue($m1 != $m2); + + # TODO: what about unknown fields? + } + + ######################################################### + # Test hasOneof methods exists and working + ######################################################### + + public function testHasOneof() { + $m = new TestMessage(); + $this->assertFalse($m->hasOneofInt32()); + $m->setOneofInt32(42); + $this->assertTrue($m->hasOneofInt32()); + $m->setOneofString("bar"); + $this->assertFalse($m->hasOneofInt32()); + $this->assertTrue($m->hasOneofString()); + $m->clear(); + $this->assertFalse($m->hasOneofInt32()); + $this->assertFalse($m->hasOneofString()); + } + ######################################################### # Test no segfault when error happens ######################################################### diff --git a/php/tests/MapFieldTest.php b/php/tests/MapFieldTest.php index 577be681bf69437b738349c0793a6b38be6e8c17..4ed4b09cffe0e6a1e3f12a230647a9ddd0f6b124 100644 --- a/php/tests/MapFieldTest.php +++ b/php/tests/MapFieldTest.php @@ -479,6 +479,35 @@ class MapFieldTest extends \PHPUnit\Framework\TestCase { $m->setMapInt32Message($values); } + ######################################################### + # Test equality + ######################################################### + + public function testEquality() + { + $map = new MapField(GPBType::INT32, GPBType::INT32); + $map2 = new MapField(GPBType::INT32, GPBType::INT32); + + $this->assertTrue($map == $map2); + + $map[1] = 2; + + $this->assertFalse($map == $map2); + + $map2[1] = 2; + + $this->assertTrue($map == $map2); + + // Arrays of different types always compare false. + $this->assertFalse(new MapField(GPBType::INT32, GPBType::INT32) == + new MapField(GPBType::INT32, GPBType::INT64)); + $this->assertFalse(new MapField(GPBType::INT32, GPBType::INT32) == + new MapField(GPBType::INT64, GPBType::INT32)); + $this->assertFalse( + new MapField(GPBType::INT32, GPBType::MESSAGE, TestMessage::class) == + new MapField(GPBType::INT32, GPBType::MESSAGE, Sub::class)); + } + ######################################################### # Test memory leak ######################################################### diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh index d1417d92353352014b33099fc7a22c69b9373f6d..7e44cce06b4051a7991fa6c47692e8e7174bd899 100644 --- a/php/tests/compatibility_test.sh +++ b/php/tests/compatibility_test.sh @@ -103,7 +103,7 @@ composer install # TODO(teboring): Temporarily disable encode_decode_test.php. In 3.13.0-rc1, # repeated primitive field encoding is changed to packed, which is a bug fix. # However, this fails the compatibility test which hard coded old encoding. -# Will reenable the test after making a release. After the version bump, the +# Will re-enable the test after making a release. After the version bump, the # compatibility test will use the updated test code. tests=( array_test.php generated_class_test.php map_field_test.php well_known_test.php ) sed -i.bak '/php_implementation_test.php/d' phpunit.xml diff --git a/php/tests/compile_extension.sh b/php/tests/compile_extension.sh index d6dcabcbbb8d2f9c0eca8926b6cd359fcfc9d73b..85c73c6eb5ddcf86cbc44bcbaff8cbbedec2d4a1 100644 --- a/php/tests/compile_extension.sh +++ b/php/tests/compile_extension.sh @@ -4,10 +4,10 @@ set -ex cd $(dirname $0) +../prepare_c_extension.sh pushd ../ext/google/protobuf phpize --clean rm -f configure.in configure.ac -php make-preload.php phpize if [ "$1" = "--release" ]; then ./configure --with-php-config=$(which php-config) diff --git a/php/tests/test.sh b/php/tests/test.sh index 29511326af6c1aca774611561af198860c5ebf7c..91ea56ec8f5b533a3293fca82e5b2903b46ccb1f 100644 --- a/php/tests/test.sh +++ b/php/tests/test.sh @@ -58,7 +58,7 @@ valgrind --suppressions=valgrind.supp --leak-check=yes php -dextension=../ext/go valgrind --suppressions=valgrind.supp --leak-check=yes php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php # TODO(teboring): Only for debug (phpunit has memory leak which blocks this beging used by -# regresssion test.) +# regression test.) # for t in "${tests[@]}" # do diff --git a/post_process_dist.sh b/post_process_dist.sh deleted file mode 100644 index 5b14de672080bf1aae572510d864652dd4bf0023..0000000000000000000000000000000000000000 --- a/post_process_dist.sh +++ /dev/null @@ -1,64 +0,0 @@ -#! /bin/sh - -# This script takes the result of "make dist" and: -# 1) Unpacks it. -# 2) Ensures all contents are user-writable. Some version control systems -# keep code read-only until you explicitly ask to edit it, and the normal -# "make dist" process does not correct for this, so the result is that -# the entire dist is still marked read-only when unpacked, which is -# annoying. So, we fix it. -# 3) Convert MSVC project files to MSVC 2005, so that anyone who has version -# 2005 *or* 2008 can open them. (In version control, we keep things in -# MSVC 2008 format since that's what we use in development.) -# 4) Uses the result to create .tar.gz, .tar.bz2, and .zip versions and -# deposites them in the "dist" directory. In the .zip version, all -# non-testdata .txt files are converted to Windows-style line endings. -# 5) Cleans up after itself. - -if [ "$1" == "" ]; then - echo "USAGE: $0 DISTFILE" >&2 - exit 1 -fi - -if [ ! -e $1 ]; then - echo $1": File not found." >&2 - exit 1 -fi - -set -ex - -LANGUAGES="cpp csharp java js objectivec python ruby php all" -BASENAME=`basename $1 .tar.gz` -VERSION=${BASENAME:9} - -# Create a directory called "dist", copy the tarball there and unpack it. -mkdir dist -cp $1 dist -cd dist -tar zxvf $BASENAME.tar.gz -rm $BASENAME.tar.gz - -# Set the entire contents to be user-writable. -chmod -R u+w $BASENAME -cd $BASENAME - -for LANG in $LANGUAGES; do - # Build the dist again in .tar.gz - ./configure DIST_LANG=$LANG - make dist-gzip - mv $BASENAME.tar.gz ../protobuf-$LANG-$VERSION.tar.gz -done - -# Convert all text files to use DOS-style line endings, then build a .zip -# distribution. -todos *.txt */*.txt - -for LANG in $LANGUAGES; do - # Build the dist again in .zip - ./configure DIST_LANG=$LANG - make dist-zip - mv $BASENAME.zip ../protobuf-$LANG-$VERSION.zip -done - -cd .. -rm -rf $BASENAME diff --git a/protobuf-init.el b/protobuf-init.el new file mode 100644 index 0000000000000000000000000000000000000000..008bdeffc15187dada0840c7abcff26c9c0657fd --- /dev/null +++ b/protobuf-init.el @@ -0,0 +1,6 @@ +; Protobuf major mode, init file by Tim Niemueller [www.niemueller.de], BSD +; Add mode to automatically recognized modes +(setq auto-mode-alist (cons '("\\.proto$" . protobuf-mode) auto-mode-alist)) +(autoload 'protobuf-mode "protobuf-mode" "Google protobuf editing mode." t) +; Turn on colorization by default +(add-hook 'protobuf-mode-hook 'turn-on-font-lock) diff --git a/protobuf.bzl b/protobuf.bzl index 050eafc5487d11ce76eb69913a42ec664406946b..12d3edb947565e462290fea0436f3a9b9396b888 100644 --- a/protobuf.bzl +++ b/protobuf.bzl @@ -352,6 +352,7 @@ def _internal_gen_well_known_protos_java_impl(ctx): inputs = descriptors, outputs = [srcjar], arguments = [args], + use_default_shell_env = True, ) return [ diff --git a/protobuf.spec b/protobuf.spec new file mode 100644 index 0000000000000000000000000000000000000000..c6d43369a2675cb497911029e2d8f13fcced0aaf --- /dev/null +++ b/protobuf.spec @@ -0,0 +1,447 @@ +# Build -python subpackage +%bcond_without python +# Build -java subpackage +%bcond_without java + +#global rcver rc2 + +Summary: Protocol Buffers - Google's data interchange format +Name: protobuf +Version: 3.14.0 +Release: 8 +License: BSD +URL: https://github.com/protocolbuffers/protobuf +Source: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}%{?rcver}/%{name}-all-%{version}%{?rcver}.tar.gz +Source1: protobuf-init.el + +Patch9000: 0001-add-secure-compile-option-in-Makefile.patch +Patch9001: 0002-add-secure-compile-fs-check-in-Makefile.patch +Patch9002: 0003-fix-CVE-2021-22570.patch +Patch9003: 0004-Improve-performance-of-parsing-unknown-fields-in-Jav.patch +Patch9004: 0005-fix-CVE-2022-1941.patch +Patch9005: 0006-fix-CVE-2022-3171.patch +Patch9006: 0007-add-coverage-compile-option.patch + +BuildRequires: make autoconf automake emacs gcc-c++ libtool pkgconfig zlib-devel + +%description + +Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, +platform-neutral, extensible mechanism for serializing structured data. +You can find protobuf's documentation on the Google Developers site. + +%package compiler +Summary: Protocol Buffers compiler +Requires: %{name} = %{version}-%{release} +Obsoletes: protobuf-emacs < %{version} +Obsoletes: protobuf-emacs-el < %{version} +Obsoletes: protobuf2-compiler +Requires: emacs-filesystem >= %{_emacs_version} + +%description compiler +This package containers Protocol Buffers compiler for all programming languages. + + +%package devel +Summary: Protocol Buffers C++ headers and libraries +Requires: %{name} = %{version}-%{release} +Requires: %{name}-compiler = %{version}-%{release} +Requires: zlib-devel pkgconfig vim-enhanced +Provides: %{name}-static +Provides: %{name}-vim +Obsoletes: %{name}-static < %{version} +Obsoletes: %{name}-vim < %{version} +Obsoletes: protobuf2-devel +Obsoletes: protobuf2-vim +Obsoletes: protobuf2-static + + +%description devel +This package contains Protocol Buffers compiler for all languages and +C++ headers and libraries + +%package lite +Summary: Protocol Buffers LITE_RUNTIME libraries + +%description lite +Protocol Buffers built with optimize_for = LITE_RUNTIME. + +The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code +which only depends libprotobuf-lite, which is much smaller than libprotobuf but +lacks descriptors, reflection, and some other features. + +%package lite-devel +Summary: Protocol Buffers LITE_RUNTIME development libraries +Requires: %{name}-devel = %{version}-%{release} +Requires: %{name}-lite = %{version}-%{release} +Provides: %{name}-lite-static +Obsoletes: %{name}-lite-static < %{version} +Obsoletes: protobuf2-lite-devel +Obsoletes: protobuf2-lite-static + +%description lite-devel +This package contains development libraries built with +optimize_for = LITE_RUNTIME. + +The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code +which only depends libprotobuf-lite, which is much smaller than libprotobuf but +lacks descriptors, reflection, and some other features. + +%if %{with python} +%package -n python%{python3_pkgversion}-%{name} +Summary: Python 3 bindings for Google Protocol Buffers +BuildArch: noarch +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-wheel +Requires: python%{python3_pkgversion}-six >= 1.9 +Conflicts: %{name}-compiler > %{version}-%{release} +Conflicts: %{name}-compiler < %{version}-%{release} +Provides: %{name}-python3 = %{version}-%{release} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}} + +%description -n python%{python3_pkgversion}-%{name} +This package contains Python 3 libraries for Google Protocol Buffers +%endif + + +%if %{with java} +%package java +Summary: Java Protocol Buffers runtime library +BuildArch: noarch +BuildRequires: maven-local +BuildRequires: mvn(com.google.code.gson:gson) +BuildRequires: mvn(com.google.guava:guava) +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) +BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) +BuildRequires: mvn(org.easymock:easymock) +Obsoletes: %{name}-javanano < 3.6.0 + +%description java +This package contains Java Protocol Buffers runtime library. + +%package javalite +Summary: Java Protocol Buffers lite runtime library +BuildArch: noarch + +%description javalite +This package contains Java Protocol Buffers lite runtime library. + +%package java-util +Summary: Utilities for Protocol Buffers +BuildArch: noarch + +%description java-util +Utilities to work with protos. It contains JSON support +as well as utilities to work with proto3 well-known types. + +%package javadoc +Summary: Javadoc for %{name}-java +BuildArch: noarch + +%description javadoc +This package contains the API documentation for %{name}-java. + +%package parent +Summary: Protocol Buffer Parent POM +BuildArch: noarch + +%description parent +Protocol Buffer Parent POM. + +%package bom +Summary: Protocol Buffer BOM POM +BuildArch: noarch + +%description bom +Protocol Buffer BOM POM. + +%endif + +%prep +%setup -q -n %{name}-%{version}%{?rcver} +%autopatch -p1 +find -name \*.cc -o -name \*.h | xargs chmod -x +chmod 644 examples/* +%if %{with java} +#%pom_remove_dep com.google.truth:truth java/pom.xml +#%pom_remove_dep org.easymock:easymockclassextension java/pom.xml java/*/pom.xml +%pom_remove_dep org.easymock:easymockclassextension java/pom.xml java/core/pom.xml java/lite/pom.xml java/util/pom.xml +%pom_remove_dep com.google.truth:truth java/pom.xml java/util/pom.xml java/lite/pom.xml java/core/pom.xml +%pom_remove_dep com.google.errorprone:error_prone_annotations java/util/pom.xml +%pom_remove_dep com.google.guava:guava-testlib java/pom.xml java/util/pom.xml + +# These use easymockclassextension +rm java/core/src/test/java/com/google/protobuf/ServiceTest.java + +#rm -r java/core/src/test + +# These use truth or error_prone_annotations or guava-testlib +rm java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java +rm java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java +rm java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java +rm java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java +rm java/core/src/test/java/com/google/protobuf/TextFormatTest.java +rm java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java +rm java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java +rm -r java/util/src/test/java/com/google/protobuf/util +rm -r java/util/src/main/java/com/google/protobuf/util + +# Make OSGi dependency on sun.misc package optional +%pom_xpath_inject "pom:configuration/pom:instructions" "sun.misc;resolution:=optional,*" java/core + +# Backward compatibility symlink +%mvn_file :protobuf-java:jar: %{name}/%{name}-java %{name} + +# This test is incredibly slow on arm +# https://github.com/protocolbuffers/protobuf/issues/2389 +%ifarch %{arm} +mv java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java \ + java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java.slow +mv java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \ + java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java.slow +%endif +%endif + +rm -f src/solaris/libstdc++.la + +%build +iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8 +mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt +export PTHREAD_LIBS="-lpthread" +./autogen.sh +%configure +%make_build CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits" + +%if %{with python} +pushd python +%py3_build +popd +%endif + +%if %{with java} +%mvn_build -s -- -f java/pom.xml +%endif + +%{_emacs_bytecompile} editors/protobuf-mode.el + + +%check +# Java tests fail on s390x +%ifarch s390x +fail=0 +%else +fail=1 +%endif +%make_build check CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits" || exit $fail + + +%install +%make_install %{?_smp_mflags} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" +find %{buildroot} -type f -name "*.la" -exec rm -f {} \; + +%if %{with python} +pushd python +#python ./setup.py install --root=%{buildroot} --single-version-externally-managed --record=INSTALLED_FILES --optimize=1 +%py3_install +find %{buildroot}%{python3_sitelib} -name \*.py | + xargs sed -i -e '1{\@^#!@d}' +popd +%endif +install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim + +%if %{with java} +%mvn_install +%endif + +mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name} +install -p -m 0644 editors/protobuf-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name} +install -p -m 0644 editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/%{name} +mkdir -p %{buildroot}%{_emacs_sitestartdir} +install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} + +%ldconfig_scriptlets +%ldconfig_scriptlets lite +%ldconfig_scriptlets compiler + +%files +%doc CHANGES.txt CONTRIBUTORS.txt README.md +%license LICENSE +%{_libdir}/libprotobuf.so.25* + +%files compiler +%{_bindir}/protoc +%{_libdir}/libprotoc.so.25* +%{_emacs_sitelispdir}/%{name}/ +%{_emacs_sitestartdir}/protobuf-init.el +%license LICENSE +%doc README.md + + +%files devel +%dir %{_includedir}/google +%{_includedir}/google/protobuf/ +%{_libdir}/libprotobuf.so +%{_libdir}/libprotoc.so +%{_libdir}/pkgconfig/protobuf.pc +%doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md +%{_libdir}/libprotobuf.a +%{_libdir}/libprotoc.a +%{_datadir}/vim/vimfiles/syntax/proto.vim + +%files lite +%{_libdir}/libprotobuf-lite.so.25* + +%files lite-devel +%{_libdir}/libprotobuf-lite.so +%{_libdir}/pkgconfig/protobuf-lite.pc +%{_libdir}/libprotobuf-lite.a + +%if %{with python} +%files -n python%{python3_pkgversion}-protobuf +%dir %{python3_sitelib}/google +%{python3_sitelib}/google/protobuf/ +%{python3_sitelib}/protobuf-%{version}%{?rcver}-py3.*.egg-info/ +%{python3_sitelib}/protobuf-%{version}%{?rcver}-py3.*-nspkg.pth +%doc python/README.md +%doc examples/add_person.py examples/list_people.py examples/addressbook.proto +%endif + +%if %{with java} +%files java -f .mfiles-protobuf-java +%doc examples/AddPerson.java examples/ListPeople.java +%doc java/README.md +%license LICENSE + +%files java-util -f .mfiles-protobuf-java-util + +%files javadoc -f .mfiles-javadoc +%license LICENSE + +%files parent -f .mfiles-protobuf-parent +%license LICENSE + +%files bom -f .mfiles-protobuf-bom +%license LICENSE + +%files javalite -f .mfiles-protobuf-javalite +%license LICENSE +%endif + +%changelog +* Wed Dec 06 2023 konglidong - 3.14.0-8 +- obsolets protobuf2 for fix install conflict + +* Mon Nov 21 2022 chengzeruizhi - 3.14.0-7 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: add compile option for coverage + +* Tue Oct 18 2022 chengzeruizhi - 3.14.0-6 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix CVE-2022-3171 + +* Tue Oct 11 2022 chengzeruizhi - 3.14.0-5 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix CVE-2022-1941 + +* Wed Apr 27 2022 wangxiaochao - 3.14.0-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: Improve performance of parsing unknown fields in Java + +* Fri Mar 18 2022 wangxiaochao - 3.14.0-3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix CVE-2021-22570 + +* Thu Mar 10 2022 wangxiaochao - 3.14.0-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix mainline compile failed + +* Fri Jul 30 2021 liyanan - 3.14.0-1 +- update to 3.14.0 + +* Mon Apr 26 2021 haozi007 - 3.12.3-16 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: split compiler from devel + +* Sat Feb 20 2021 haozi007 - 3.12.3-15 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: add fstack check + +* Tue Sep 1 2020 wutao - 3.12.3-14 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: enhance java function and fix build errors + +* Sat Aug 29 2020 openEuler Buildteam - 3.12.3-13 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: remove Conflicts + +* Fri Aug 28 2020 openEuler Buildteam - 3.12.3-12 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: invalid version of Conflicts + +* Thu Jul 23 2020 openEuler Buildteam - 3.12.3-11 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: drop python2-protobuf and refactor .spec file + +* Thu Jul 16 2020 openEuler Buildteam - 3.12.3-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:upgrade from 3.9.0 to 3.12.3 + +* Wed Apr 08 2020 openEuler Buildteam - 3.9.0-9 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: remove unnecessary files + +* Thu Dec 12 2019 openEuler Buildteam - 3.9.0-8.h3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:add bind now secure compile option + +* Wed Nov 27 2019 openEuler Buildteam - 3.9.0-8.h2 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:compatible to centos 7.5 + +* Tue Nov 26 2019 openEuler Buildteam - 3.9.0-8.h1 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:upgrade from 3.5.0 to 3.9.0 + +* Fri Nov 01 2019 openEuler Buildteam - 3.5.0-8.h1 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:change patch's names according to new rules diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index a1603323af88ed22f9d421f6cc82f2884513a519..a95008501b7f30f1aa54fadd02822ef9d9747a9f 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -51,9 +51,9 @@ def protobuf_deps(): if not native.existing_rule("rules_proto"): http_archive( name = "rules_proto", - sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208", - strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313", - urls = ["https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz"], + sha256 = "aa1ee19226f707d44bee44c720915199c20c84a23318bb0597ed4e5c873ccbd5", + strip_prefix = "rules_proto-40298556293ae502c66579620a7ce867d5f57311", + urls = ["https://github.com/bazelbuild/rules_proto/archive/40298556293ae502c66579620a7ce867d5f57311.tar.gz"], ) if not native.existing_rule("rules_python"): diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md deleted file mode 100644 index 2c45fefe780e879aa0f503d3f131809bf03723e3..0000000000000000000000000000000000000000 --- a/protoc-artifacts/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# Build scripts that publish pre-compiled protoc artifacts -``protoc`` is the compiler for ``.proto`` files. It generates language bindings -for the messages and/or RPC services from ``.proto`` files. - -Because ``protoc`` is a native executable, the scripts under this directory -build and publish a ``protoc`` executable (a.k.a. artifact) to Maven -repositories. The artifact can be used by build automation tools so that users -would not need to compile and install ``protoc`` for their systems. - -If you would like us to publish protoc artifact for a new platform, please send -us a pull request to add support for the new platform. You would need to change -the following files: - -* [build-protoc.sh](build-protoc.sh): script to cross-build the protoc for your - platform. -* [pom.xml](pom.xml): script to upload artifacts to maven. -* [build-zip.sh](build-zip.sh): script to package published maven artifacts in - our release page. - -## Maven Location -The published protoc artifacts are available on Maven here: - - http://central.maven.org/maven2/com/google/protobuf/protoc/ - -## Versioning -The version of the ``protoc`` artifact must be the same as the version of the -Protobuf project. - -## Artifact name -The name of a published ``protoc`` artifact is in the following format: -``protoc---.exe``, e.g., ``protoc-3.6.1-linux-x86_64.exe``. - -Note that artifacts for linux/macos also have the `.exe` suffix but they are -not windows binaries. - -## System requirement -Install [Apache Maven](http://maven.apache.org/) if you don't have it. - -The scripts only work under Unix-like environments, e.g., Linux, MacOSX, and -Cygwin or MinGW for Windows. Please see ``README.md`` of the Protobuf project -for how to set up the build environment. - -## Building from a freshly checked-out source - -If you just checked out the Protobuf source from github, you need to -generate the configure script. - -Under the protobuf project directory: - - -``` -$ ./autogen.sh -``` - -### Build the artifact for each platform - -Run the build-protoc.sh script under this protoc-artifacts directory to build the protoc -artifact for each platform. For example: - -``` -$ cd protoc-artifacts -$ ./build-protoc.sh linux x86_64 protoc -``` - -The above command will produce a `target/linux/x86_64/protoc` binary under the -protoc-artifacts directory. - -For a list of supported platforms, see the comments in the build-protoc.sh -script. We only use this script to build artifacts on Ubuntu and MacOS (both -with x86_64, and do cross-compilation for other platforms. - -### Tips for building for Linux -We build on Centos 6.9 to provide a good compatibility for not very new -systems. We have provided a ``Dockerfile`` under this directory to build the -environment. It has been tested with Docker 1.6.1. - -To build a image: - -``` -$ docker build -t protoc-artifacts . -``` - -To run the image: - -``` -$ docker run -it --rm=true protoc-artifacts bash -``` - -To checkout protobuf (run within the container): - -``` -$ # Replace v3.5.1 with the version you want -$ wget -O - https://github.com/protocolbuffers/protobuf/archive/v3.5.1.tar.gz | tar xvzp -``` - -### Windows build -We no longer use scripts in this directory to build windows artifacts. Instead, -we use Visual Studio 2015 to build our windows release artifacts. See our -[kokoro windows build scripts here](../kokoro/release/protoc/windows/build.bat). - -To upload windows artifacts, copy the built binaries into this directory and -put it into the target/windows/(x86_64|x86_32) directory the same way as the -artifacts for other platforms. That will allow the maven script to find and -upload the artifacts to maven. - -## To push artifacts to Maven Central -Before you can upload artifacts to Maven Central repository, make sure you have -read [this page](http://central.sonatype.org/pages/apache-maven.html) on how to -configure GPG and Sonatype account. - -Before you do the deployment, make sure you have built the protoc artifacts for -every supported platform and put them under the target directory. Example -target directory layout: - - + pom.xml - + target - + linux - + x86_64 - protoc.exe - + x86_32 - protoc.exe - + aarch_64 - protoc.exe - + ppcle_64 - protoc.exe - + s390x - protoc.exe - + osx - + x86_64 - protoc.exe - + x86_32 - protoc.exe - + windows - + x86_64 - protoc.exe - + x86_32 - protoc.exe - -You will need to build the artifacts on multiple machines and gather them -together into one place. - -Use the following command to deploy artifacts for the host platform to a -staging repository. - -``` -$ mvn deploy -P release -``` - -It creates a new staging repository. Go to -https://oss.sonatype.org/#stagingRepositories and find the repository, usually -in the name like ``comgoogle-123``. Verify that the staging repository has all -the binaries, close and release this repository. - - -## Tested build environments -We have successfully built artifacts on the following environments: -- Linux x86_32 and x86_64: - - Centos 6.9 (within Docker 1.6.1) - - Ubuntu 14.04.5 64-bit -- Linux aarch_64: Cross compiled with `g++-aarch64-linux-gnu` on Ubuntu 14.04.5 64-bit -- Mac OS X x86_32 and x86_64: Mac OS X 10.9.5 diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh deleted file mode 100644 index 7f65d37643370dd6716b7bb188e2e322f1c91b20..0000000000000000000000000000000000000000 --- a/protoc-artifacts/build-protoc.sh +++ /dev/null @@ -1,294 +0,0 @@ -#!/bin/bash - -# Builds protoc executable into target///protoc.exe; optionally builds -# protoc plugins into target///protoc-gen-*.exe -# -# Usage: ./build-protoc.sh -# -# can be "protoc" or "protoc-gen-javalite". Supported -# combinations: -# HOST -# cygwin windows x86_32 Requires: i686-w64-mingw32-gcc -# cygwin windows x86_64 Requires: x86_64-w64-mingw32-gcc -# linux linux aarch_64 Requires: g++-aarch64-linux-gnu -# linux linux x86_32 -# linux linux x86_64 -# linux windows x86_32 Requires: i686-w64-mingw32-gcc -# linux windows x86_64 Requires: x86_64-w64-mingw32-gcc -# macos osx x86_32 -# macos osx x86_64 -# mingw windows x86_32 -# mingw windows x86_64 -# -# Before running this script, make sure you have generated the configure script -# in the parent directory (i.e., run ./autogen.sh there). - -OS=$1 -ARCH=$2 -MAKE_TARGET=$3 - -if [[ $# < 3 ]]; then - echo "Not enough arguments provided." - exit 1 -fi - -case $MAKE_TARGET in - protoc-gen-javalite) - ;; - protoc) - ;; - *) - echo "Target ""$MAKE_TARGET"" invalid." - exit 1 -esac - -# Under Cygwin, bash doesn't have these in PATH when called from Maven which -# runs in Windows version of Java. -export PATH="/bin:/usr/bin:$PATH" - -############################################################################ -# Helper functions -############################################################################ -E_PARAM_ERR=98 -E_ASSERT_FAILED=99 - -# Usage: -fail() -{ - echo "ERROR: $1" - echo - exit $E_ASSERT_FAILED -} - -# Usage: assertEq VAL1 VAL2 $LINENO -assertEq () -{ - lineno=$3 - if [ -z "$lineno" ]; then - echo "lineno not given" - exit $E_PARAM_ERR - fi - - if [[ "$1" != "$2" ]]; then - echo "Assertion failed: \"$1\" == \"$2\"" - echo "File \"$0\", line $lineno" # Give name of file and line number. - exit $E_ASSERT_FAILED - fi -} - -# Checks the artifact is for the expected architecture -# Usage: checkArch -checkArch () -{ - echo - echo "Checking file format ..." - if [[ "$OS" == windows || "$OS" == linux ]]; then - format="$(objdump -f "$1" | grep -o "file format .*$" | grep -o "[^ ]*$")" - echo Format=$format - if [[ "$OS" == linux ]]; then - host_machine="$(uname -m)"; - if [[ "$ARCH" == x86_32 ]]; then - assertEq $format "elf32-i386" $LINENO - elif [[ "$ARCH" == x86_64 ]]; then - assertEq $format "elf64-x86-64" $LINENO - elif [[ "$ARCH" == aarch_64 ]]; then - assertEq $format "elf64-little" $LINENO - elif [[ "$ARCH" == s390x ]]; then - if [[ $host_machine == s390x ]];then - assertEq $format "elf64-s390" $LINENO - else - assertEq $format "elf64-big" $LINENO - fi - elif [[ "$ARCH" == ppcle_64 ]]; then - if [[ $host_machine == ppc64le ]];then - assertEq $format "elf64-powerpcle" $LINENO - else - assertEq $format "elf64-little" $LINENO - fi - else - fail "Unsupported arch: $ARCH" - fi - else - # $OS == windows - if [[ "$ARCH" == x86_32 ]]; then - assertEq $format "pei-i386" $LINENO - elif [[ "$ARCH" == x86_64 ]]; then - assertEq $format "pei-x86-64" $LINENO - else - fail "Unsupported arch: $ARCH" - fi - fi - elif [[ "$OS" == osx ]]; then - format="$(file -b "$1" | grep -o "[^ ]*$")" - echo Format=$format - if [[ "$ARCH" == x86_32 ]]; then - assertEq $format "i386" $LINENO - elif [[ "$ARCH" == x86_64 ]]; then - assertEq $format "x86_64" $LINENO - else - fail "Unsupported arch: $ARCH" - fi - else - fail "Unsupported system: $OS" - fi - echo -} - -# Checks the dependencies of the artifact. Artifacts should only depend on -# system libraries. -# Usage: checkDependencies -checkDependencies () -{ - if [[ "$OS" == windows ]]; then - dump_cmd='objdump -x '"$1"' | fgrep "DLL Name"' - white_list="KERNEL32\.dll\|msvcrt\.dll" - elif [[ "$OS" == linux ]]; then - host_machine="$(uname -m)"; - dump_cmd='ldd '"$1" - if [[ "$ARCH" == x86_32 ]]; then - white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2" - elif [[ "$ARCH" == x86_64 ]]; then - white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2" - elif [[ "$ARCH" == s390x ]]; then - if [[ $host_machine != s390x ]];then - dump_cmd='objdump -p '"$1"' | grep NEEDED' - fi - white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libz\.so\.1\|ld64\.so\.1" - elif [[ "$ARCH" == ppcle_64 ]]; then - if [[ $host_machine != ppc64le ]];then - dump_cmd='objdump -p '"$1"' | grep NEEDED' - fi - white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libz\.so\.1\|ld64\.so\.2" - elif [[ "$ARCH" == aarch_64 ]]; then - dump_cmd='objdump -p '"$1"' | grep NEEDED' - white_list="libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-aarch64\.so\.1" - fi - elif [[ "$OS" == osx ]]; then - dump_cmd='otool -L '"$1"' | fgrep dylib' - white_list="libz\.1\.dylib\|libstdc++\.6\.dylib\|libSystem\.B\.dylib" - fi - if [[ -z "$white_list" || -z "$dump_cmd" ]]; then - fail "Unsupported platform $OS-$ARCH." - fi - echo "Checking for expected dependencies ..." - eval $dump_cmd | grep -i "$white_list" || fail "doesn't show any expected dependencies" - echo "Checking for unexpected dependencies ..." - eval $dump_cmd | grep -i -v "$white_list" - ret=$? - if [[ $ret == 0 ]]; then - fail "found unexpected dependencies (listed above)." - elif [[ $ret != 1 ]]; then - fail "Error when checking dependencies." - fi # grep returns 1 when "not found", which is what we expect - echo "Dependencies look good." - echo -} -############################################################################ - -echo "Building protoc, OS=$OS ARCH=$ARCH TARGET=$MAKE_TARGET" - -CONFIGURE_ARGS="--disable-shared" - -if [[ "$OS" == windows ]]; then - MAKE_TARGET="${MAKE_TARGET}.exe" -fi - -# Override the default value set in configure.ac that has '-g' which produces -# huge binary. -CXXFLAGS="-DNDEBUG" -LDFLAGS="" - -if [[ "$(uname)" == CYGWIN* ]]; then - assertEq "$OS" windows $LINENO - # Use mingw32 compilers because executables produced by Cygwin compiler - # always have dependency on Cygwin DLL. - if [[ "$ARCH" == x86_64 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32" - elif [[ "$ARCH" == x86_32 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-pc-mingw32" - else - fail "Unsupported arch by CYGWIN: $ARCH" - fi -elif [[ "$(uname)" == MINGW32* ]]; then - assertEq "$OS" windows $LINENO - assertEq "$ARCH" x86_32 $LINENO -elif [[ "$(uname)" == MINGW64* ]]; then - assertEq "$OS" windows $LINENO - assertEq "$ARCH" x86_64 $LINENO -elif [[ "$(uname)" == Linux* ]]; then - if [[ "$OS" == linux ]]; then - if [[ "$ARCH" == x86_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - elif [[ "$ARCH" == x86_32 ]]; then - CXXFLAGS="$CXXFLAGS -m32" - elif [[ "$ARCH" == aarch_64 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=aarch64-linux-gnu" - elif [[ "$ARCH" == ppcle_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=powerpc64le-linux-gnu" - elif [[ "$ARCH" == s390x ]]; then - CXXFLAGS="$CXXFLAGS -m64" - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=s390x-linux-gnu" - else - fail "Unsupported arch: $ARCH" - fi - elif [[ "$OS" == windows ]]; then - # Cross-compilation for Windows - CONFIGURE_ARGS="$CONFIGURE_ARGS" - if [[ "$ARCH" == x86_64 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32" - elif [[ "$ARCH" == x86_32 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-w64-mingw32" - else - fail "Unsupported arch: $ARCH" - fi - else - fail "Cannot build $OS on $(uname)" - fi -elif [[ "$(uname)" == Darwin* ]]; then - assertEq "$OS" osx $LINENO - # Make the binary compatible with OSX 10.7 and later - CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.7" - if [[ "$ARCH" == x86_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - elif [[ "$ARCH" == x86_32 ]]; then - CXXFLAGS="$CXXFLAGS -m32" - else - fail "Unsupported arch: $ARCH" - fi -else - fail "Unsupported system: $(uname)" -fi - -# Statically link libgcc and libstdc++. -# -s to produce stripped binary. -if [[ "$OS" == windows ]]; then - # Also static link libpthread required by mingw64 - LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -s" -elif [[ "$OS" != osx ]]; then - # And they don't work under Mac. - LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -s" -fi - -export CXXFLAGS LDFLAGS - -# Nested double quotes are unintuitive, but it works. -cd "$(dirname "$0")" - -WORKING_DIR="$(pwd)" -BUILD_DIR="build/$OS/$ARCH" -TARGET_FILE="target/$OS/$ARCH/$MAKE_TARGET.exe" - -mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR" && - ../../../../configure $CONFIGURE_ARGS && - cd src && make $MAKE_TARGET -j8 && - cd "$WORKING_DIR" && mkdir -p $(dirname $TARGET_FILE) && - cp $BUILD_DIR/src/$MAKE_TARGET $TARGET_FILE || - exit 1 - -if [[ "$OS" == osx ]]; then - # Since Mac linker doesn't accept "-s", we need to run strip - strip $TARGET_FILE || exit 1 -fi - -checkArch $TARGET_FILE && checkDependencies $TARGET_FILE diff --git a/protoc-artifacts/build-zip.sh b/protoc-artifacts/build-zip.sh deleted file mode 100644 index 2a25d3cd7e17034353ff8eed0920d0713e39a536..0000000000000000000000000000000000000000 --- a/protoc-artifacts/build-zip.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash - -if [ $# -ne 2 ]; then - cat < - -TARGET: protoc | protoc-gen-javalite - -Example: - $ $0 protoc 3.0.0 - $ $0 protoc-gen-javalite 3.0.0 - -This script will download pre-built protoc or protoc plugin binaries from maven -repository and create .zip packages suitable to be included in the github -release page. If the target is protoc, well-known type .proto files will also be -included. Each invocation will create 8 zip packages: - dist/--win32.zip - dist/--win64.zip - dist/--osx-x86_64.zip - dist/--linux-x86_32.zip - dist/--linux-x86_64.zip - dist/--linux-aarch_64.zip - dist/--linux-ppcle_64.zip - dist/--linux-s390x.zip -EOF - exit 1 -fi - -TARGET=$1 -VERSION_NUMBER=$2 - -# pairs. -declare -a FILE_NAMES=( \ - win32.zip windows-x86_32.exe \ - win64.zip windows-x86_64.exe \ - osx-x86_64.zip osx-x86_64.exe \ - linux-x86_32.zip linux-x86_32.exe \ - linux-x86_64.zip linux-x86_64.exe \ - linux-aarch_64.zip linux-aarch_64.exe \ - linux-ppcle_64.zip linux-ppcle_64.exe \ - linux-s390x.zip linux-s390x.exe \ -) - -# List of all well-known types to be included. -declare -a WELL_KNOWN_TYPES=( \ - google/protobuf/descriptor.proto \ - google/protobuf/any.proto \ - google/protobuf/api.proto \ - google/protobuf/duration.proto \ - google/protobuf/empty.proto \ - google/protobuf/field_mask.proto \ - google/protobuf/source_context.proto \ - google/protobuf/struct.proto \ - google/protobuf/timestamp.proto \ - google/protobuf/type.proto \ - google/protobuf/wrappers.proto \ - google/protobuf/compiler/plugin.proto \ -) - -set -e - -# A temporary working directory to put all files. -DIR=$(mktemp -d) - -# Copy over well-known types. -mkdir -p ${DIR}/include/google/protobuf/compiler -for PROTO in ${WELL_KNOWN_TYPES[@]}; do - cp -f ../src/${PROTO} ${DIR}/include/${PROTO} -done - -# Create a readme file. -cat < ${DIR}/readme.txt -Protocol Buffers - Google's data interchange format -Copyright 2008 Google Inc. -https://developers.google.com/protocol-buffers/ - -This package contains a precompiled binary version of the protocol buffer -compiler (protoc). This binary is intended for users who want to use Protocol -Buffers in languages other than C++ but do not want to compile protoc -themselves. To install, simply place this binary somewhere in your PATH. - -If you intend to use the included well known types then don't forget to -copy the contents of the 'include' directory somewhere as well, for example -into '/usr/local/include/'. - -Please refer to our official github site for more installation instructions: - https://github.com/protocolbuffers/protobuf -EOF - -mkdir -p dist -mkdir -p ${DIR}/bin -# Create a zip file for each binary. -for((i=0;i<${#FILE_NAMES[@]};i+=2));do - ZIP_NAME=${FILE_NAMES[$i]} - if [ ${ZIP_NAME:0:3} = "win" ]; then - BINARY="$TARGET.exe" - else - BINARY="$TARGET" - fi - BINARY_NAME=${FILE_NAMES[$(($i+1))]} - BINARY_URL=https://repo1.maven.org/maven2/com/google/protobuf/$TARGET/${VERSION_NUMBER}/$TARGET-${VERSION_NUMBER}-${BINARY_NAME} - if ! wget ${BINARY_URL} -O ${DIR}/bin/$BINARY &> /dev/null; then - echo "[ERROR] Failed to download ${BINARY_URL}" >&2 - echo "[ERROR] Skipped $TARGET-${VERSION_NAME}-${ZIP_NAME}" >&2 - continue - fi - TARGET_ZIP_FILE=`pwd`/dist/$TARGET-${VERSION_NUMBER}-${ZIP_NAME} - pushd $DIR &> /dev/null - chmod +x bin/$BINARY - if [ "$TARGET" = "protoc" ]; then - zip -r ${TARGET_ZIP_FILE} include bin readme.txt &> /dev/null - else - zip -r ${TARGET_ZIP_FILE} bin &> /dev/null - fi - rm bin/$BINARY - popd &> /dev/null - echo "[INFO] Successfully created ${TARGET_ZIP_FILE}" -done diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml deleted file mode 100644 index 27315e83f45b087647be5a9ee55b0aba4b32920a..0000000000000000000000000000000000000000 --- a/protoc-artifacts/pom.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - 4.0.0 - - com.google - google - 1 - - com.google.protobuf - protoc - 3.13.0 - pom - Protobuf Compiler - - Protobuf Compiler (protoc) is a compiler for .proto files. It generates - language-specific code for Protobuf messages and RPC interfaces. - - 2008 - https://developers.google.com/protocol-buffers/ - - - 3-Clause BSD License - https://opensource.org/licenses/BSD-3-Clause - repo - - - - https://github.com/protocolbuffers/protobuf - - scm:git:https://github.com/protocolbuffers/protobuf.git - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - attach-artifacts - package - - attach-artifact - - - - - ${basedir}/target/linux/x86_64/protoc.exe - linux-x86_64 - exe - - - ${basedir}/target/linux/x86_32/protoc.exe - linux-x86_32 - exe - - - ${basedir}/target/windows/x86_64/protoc.exe - windows-x86_64 - exe - - - ${basedir}/target/windows/x86_32/protoc.exe - windows-x86_32 - exe - - - ${basedir}/target/osx/x86_64/protoc.exe - osx-x86_64 - exe - - - ${basedir}/target/linux/aarch_64/protoc.exe - linux-aarch_64 - exe - - - ${basedir}/target/linux/ppcle_64/protoc.exe - linux-ppcle_64 - exe - - - ${basedir}/target/linux/s390x/protoc.exe - linux-s390x - exe - - - - - - - - - - - release - - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 - true - - sonatype-nexus-staging - https://oss.sonatype.org/ - true - false - ${staging.repository} - - - - - - - diff --git a/protoc-artifacts/scl-enable-devtoolset.sh b/protoc-artifacts/scl-enable-devtoolset.sh deleted file mode 100644 index 30895585f3a9d347612fea42aadf7b66ba365aef..0000000000000000000000000000000000000000 --- a/protoc-artifacts/scl-enable-devtoolset.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -quote() { - local arg - for arg in "$@"; do - printf "'" - printf "%s" "$arg" | sed -e "s/'/'\\\\''/g" - printf "' " - done -} - -exec scl enable devtoolset-2 "$(quote "$@")" diff --git a/protos/BUILD b/protos/BUILD deleted file mode 100644 index d037b60ac9dec65110f593123ffd4b2c092ff9e5..0000000000000000000000000000000000000000 --- a/protos/BUILD +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright (c) 2009-2021, Google LLC -# All rights reserved. -# -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file or at -# https://developers.google.com/open-source/licenses/bsd - -load( - "//bazel:build_defs.bzl", - "UPB_DEFAULT_CPPOPTS", -) -load( - "//protos/bazel:upb_cc_proto_library.bzl", - "upb_cc_proto_library_copts", -) - -# begin:google_only -# package(default_applicable_licenses = ["//upb:license"]) -# end:google_only - -licenses(["notice"]) - -cc_library( - name = "repeated_field", - hdrs = [ - "repeated_field.h", - "repeated_field_iterator.h", - ], - copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//visibility:public"], - deps = [ - ":protos", - ":protos_traits", - "//upb:base", - "//upb:mem", - "//upb:message", - "//upb:message_copy", - "//upb:message_types", - "//upb:port", - "@com_google_absl//absl/base:core_headers", - "@com_google_absl//absl/strings", - ], -) - -cc_library( - name = "protos", - srcs = [ - "protos.cc", - ], - hdrs = [ - "protos.h", - ], - copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//visibility:public"], - deps = [ - ":protos_extension_lock", - "//upb:base", - "//upb:mem", - "//upb:message_accessors_internal", - "//upb:message_copy", - "//upb:message_internal", - "//upb:message_promote", - "//upb:message_types", - "//upb:mini_table", - "//upb:wire", - "//upb:wire_types", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", - ], -) - -# Internally used type traits. -cc_library( - name = "protos_traits", - hdrs = [ - "protos_traits.h", - ], - copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//visibility:private"], -) - -cc_library( - name = "protos_internal", - hdrs = ["protos_internal.h"], - copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//visibility:public"], - deps = [ - ":protos", - "//upb:mem", - "//upb:message", - "//upb:mini_table", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings:str_format", - ], -) - -cc_library( - name = "protos_extension_lock", - srcs = ["protos_extension_lock.cc"], - hdrs = ["protos_extension_lock.h"], - copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//visibility:public"], - deps = [ - "//upb:message", - "@com_google_absl//absl/base:core_headers", - "@com_google_absl//absl/synchronization", - ], -) - -# Common support code for C++ generated code. -cc_library( - name = "generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - hdrs = [ - "protos_internal.h", - ], - copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//visibility:public"], - deps = [ - ":protos", - ":protos_internal", - ":repeated_field", - "//upb:mem", - "//upb:message", - ], -) - -cc_test( - name = "protos_internal_test", - srcs = ["protos_internal_test.cc"], - copts = UPB_DEFAULT_CPPOPTS, - deps = [ - ":protos_internal", - "@com_google_googletest//:gtest_main", - "//upb:mem", - "//protos_generator/tests:test_model_upb_cc_proto", - "//protos_generator/tests:test_model_upb_proto", - ], -) - -upb_cc_proto_library_copts( - name = "upb_cc_proto_library_copts__for_generated_code_only_do_not_use", - copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//visibility:public"], -) - -cc_test( - name = "repeated_field_iterator_test", - srcs = ["repeated_field_iterator_test.cc"], - deps = [ - ":repeated_field", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "protos_extension_lock_test", - srcs = ["protos_extension_lock_test.cc"], - deps = [ - "@com_google_googletest//:gtest_main", - "//upb:mem", - "//protos", - "//protos:protos_extension_lock", - "//protos_generator/tests:test_model_upb_cc_proto", - "@com_google_absl//absl/hash", - "@com_google_absl//absl/log:absl_check", - ], -) diff --git a/protos/README.md b/protos/README.md deleted file mode 100644 index dc0920163ccb73967d0cf640312e8c80d8b667b2..0000000000000000000000000000000000000000 --- a/protos/README.md +++ /dev/null @@ -1,7 +0,0 @@ -`protos` C++ API -=============== - -`protos` is a C++ protobuf implementation backed by μpb, introduced in 2022. -The API is currently experimental and may undergo incompatible changes without -notice. The supported C++ implementation is -[here](https://github.com/protocolbuffers/protobuf/tree/main/src). diff --git a/protos/bazel/BUILD b/protos/bazel/BUILD deleted file mode 100644 index ea91541adf39b573319e6c421c03a5eb2b5f8e09..0000000000000000000000000000000000000000 --- a/protos/bazel/BUILD +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2009-2021, Google LLC -# All rights reserved. -# -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file or at -# https://developers.google.com/open-source/licenses/bsd - -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -# begin:google_only -# package(default_applicable_licenses = ["//upb:license"]) -# end:google_only - -licenses(["notice"]) - -bzl_library( - name = "upb_cc_proto_library_bzl", - srcs = ["upb_cc_proto_library.bzl"], - visibility = ["//visibility:public"], - deps = [ - "@bazel_skylib//lib:paths", - "//bazel:upb_proto_library_bzl", - "@bazel_tools//tools/cpp:toolchain_utils.bzl", - ], -) diff --git a/protos/bazel/upb_cc_proto_library.bzl b/protos/bazel/upb_cc_proto_library.bzl deleted file mode 100644 index b59ae65e573e679cf529cac1aa41e48b6b570d96..0000000000000000000000000000000000000000 --- a/protos/bazel/upb_cc_proto_library.bzl +++ /dev/null @@ -1,289 +0,0 @@ -# Copyright (c) 2009-2021, Google LLC -# All rights reserved. -# -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file or at -# https://developers.google.com/open-source/licenses/bsd - -"""Public rules for using upb protos: - - upb_cc_proto_library() -""" - -load("@bazel_skylib//lib:paths.bzl", "paths") -load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") - -# begin:google_only -# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") -# -# end:google_only -# begin:github_only -# Compatibility code for Bazel 4.x. Remove this when we drop support for Bazel 4.x. -load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") - -def use_cpp_toolchain(): - return ["@bazel_tools//tools/cpp:toolchain_type"] -# end:github_only - -# Generic support code ######################################################### - -# begin:github_only -_is_google3 = False -# end:github_only - -# begin:google_only -# _is_google3 = True -# end:google_only - -def _get_real_short_path(file): - # For some reason, files from other archives have short paths that look like: - # ../com_google_protobuf/google/protobuf/descriptor.proto - short_path = file.short_path - if short_path.startswith("../"): - second_slash = short_path.index("/", 3) - short_path = short_path[second_slash + 1:] - - # Sometimes it has another few prefixes like: - # _virtual_imports/any_proto/google/protobuf/any.proto - # benchmarks/_virtual_imports/100_msgs_proto/benchmarks/100_msgs.proto - # We want just google/protobuf/any.proto. - virtual_imports = "_virtual_imports/" - if virtual_imports in short_path: - short_path = short_path.split(virtual_imports)[1].split("/", 1)[1] - return short_path - -def _get_real_root(file): - real_short_path = _get_real_short_path(file) - return file.path[:-len(real_short_path) - 1] - -def _generate_output_file(ctx, src, extension): - real_short_path = _get_real_short_path(src) - real_short_path = paths.relativize(real_short_path, ctx.label.package) - output_filename = paths.replace_extension(real_short_path, extension) - ret = ctx.actions.declare_file(output_filename) - return ret - -def _filter_none(elems): - out = [] - for elem in elems: - if elem: - out.append(elem) - return out - -def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos): - """Like cc_library(), but callable from rules. - - Args: - ctx: Rule context. - name: Unique name used to generate output files. - hdrs: Public headers that can be #included from other rules. - srcs: C/C++ source files. - copts: Additional options for cc compilation. - dep_ccinfos: CcInfo providers of dependencies we should build/link against. - - Returns: - CcInfo provider for this compilation. - """ - - compilation_contexts = [info.compilation_context for info in dep_ccinfos] - linking_contexts = [info.linking_context for info in dep_ccinfos] - toolchain = find_cpp_toolchain(ctx) - feature_configuration = cc_common.configure_features( - ctx = ctx, - cc_toolchain = toolchain, - requested_features = ctx.features, - unsupported_features = ctx.disabled_features, - ) - - (compilation_context, compilation_outputs) = cc_common.compile( - actions = ctx.actions, - feature_configuration = feature_configuration, - cc_toolchain = toolchain, - name = name, - srcs = srcs, - public_hdrs = hdrs, - user_compile_flags = copts, - compilation_contexts = compilation_contexts, - ) - - # buildifier: disable=unused-variable - (linking_context, linking_outputs) = cc_common.create_linking_context_from_compilation_outputs( - actions = ctx.actions, - name = name, - feature_configuration = feature_configuration, - cc_toolchain = toolchain, - compilation_outputs = compilation_outputs, - linking_contexts = linking_contexts, - ) - - return CcInfo( - compilation_context = compilation_context, - linking_context = linking_context, - ) - -# Dummy rule to expose select() copts to aspects ############################## - -UpbCcProtoLibraryCoptsInfo = provider( - "Provides copts for upb cc proto targets", - fields = { - "copts": "copts for upb_cc_proto_library()", - }, -) - -def upb_cc_proto_library_copts_impl(ctx): - return UpbCcProtoLibraryCoptsInfo(copts = ctx.attr.copts) - -upb_cc_proto_library_copts = rule( - implementation = upb_cc_proto_library_copts_impl, - attrs = {"copts": attr.string_list(default = [])}, -) - -_UpbCcWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"]) -_WrappedCcGeneratedSrcsInfo = provider("Provider for generated sources", fields = ["srcs"]) - -def _compile_upb_cc_protos(ctx, generator, proto_info, proto_sources): - if len(proto_sources) == 0: - return GeneratedSrcsInfo(srcs = [], hdrs = []) - - tool = getattr(ctx.executable, "_gen_" + generator) - srcs = [_generate_output_file(ctx, name, ".upb.proto.cc") for name in proto_sources] - hdrs = [_generate_output_file(ctx, name, ".upb.proto.h") for name in proto_sources] - hdrs += [_generate_output_file(ctx, name, ".upb.fwd.h") for name in proto_sources] - transitive_sets = proto_info.transitive_descriptor_sets.to_list() - - args = ctx.actions.args() - args.use_param_file(param_file_arg = "@%s") - args.set_param_file_format("multiline") - - args.add("--" + generator + "_out=" + _get_real_root(srcs[0])) - args.add("--plugin=protoc-gen-" + generator + "=" + tool.path) - args.add("--descriptor_set_in=" + ctx.configuration.host_path_separator.join([f.path for f in transitive_sets])) - args.add_all(proto_sources, map_each = _get_real_short_path) - - ctx.actions.run( - inputs = depset( - direct = [proto_info.direct_descriptor_set], - transitive = [proto_info.transitive_descriptor_sets], - ), - tools = [tool], - outputs = srcs + hdrs, - executable = ctx.executable._protoc, - arguments = [args], - progress_message = "Generating upb cc protos for :" + ctx.label.name, - ) - return GeneratedSrcsInfo(srcs = srcs, hdrs = hdrs) - -def _upb_cc_proto_rule_impl(ctx): - if len(ctx.attr.deps) != 1: - fail("only one deps dependency allowed.") - dep = ctx.attr.deps[0] - - if _WrappedCcGeneratedSrcsInfo in dep: - srcs = dep[_WrappedCcGeneratedSrcsInfo].srcs - else: - fail("proto_library rule must generate _WrappedCcGeneratedSrcsInfo (aspect should have " + - "handled this).") - - if _UpbCcWrappedCcInfo in dep: - cc_info = dep[_UpbCcWrappedCcInfo].cc_info - elif UpbWrappedCcInfo in dep: - cc_info = dep[UpbWrappedCcInfo].cc_info - else: - fail("proto_library rule must generate UpbWrappedCcInfo or " + - "_UpbCcWrappedCcInfo (aspect should have handled this).") - - lib = cc_info.linking_context.linker_inputs.to_list()[0].libraries[0] - files = _filter_none([ - lib.static_library, - lib.pic_static_library, - lib.dynamic_library, - ]) - return [ - DefaultInfo(files = depset(files + srcs.hdrs + srcs.srcs)), - srcs, - cc_info, - ] - -def _upb_cc_proto_aspect_impl(target, ctx, generator, cc_provider, file_provider): - proto_info = target[ProtoInfo] - files = _compile_upb_cc_protos(ctx, generator, proto_info, proto_info.direct_sources) - deps = ctx.rule.attr.deps + getattr(ctx.attr, "_" + generator) - dep_ccinfos = [dep[CcInfo] for dep in deps if CcInfo in dep] - dep_ccinfos += [dep[UpbWrappedCcInfo].cc_info for dep in deps if UpbWrappedCcInfo in dep] - dep_ccinfos += [dep[_UpbCcWrappedCcInfo].cc_info for dep in deps if _UpbCcWrappedCcInfo in dep] - if UpbWrappedCcInfo not in target: - fail("Target should have UpbWrappedCcInfo provider") - dep_ccinfos.append(target[UpbWrappedCcInfo].cc_info) - cc_info = _cc_library_func( - ctx = ctx, - name = ctx.rule.attr.name + "." + generator, - hdrs = files.hdrs, - srcs = files.srcs, - copts = ctx.attr._ccopts[UpbCcProtoLibraryCoptsInfo].copts, - dep_ccinfos = dep_ccinfos, - ) - return [cc_provider(cc_info = cc_info), file_provider(srcs = files)] - -def _upb_cc_proto_library_aspect_impl(target, ctx): - return _upb_cc_proto_aspect_impl(target, ctx, "upbprotos", _UpbCcWrappedCcInfo, _WrappedCcGeneratedSrcsInfo) - -_upb_cc_proto_library_aspect = aspect( - attrs = { - "_ccopts": attr.label( - default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", - ), - "_gen_upbprotos": attr.label( - executable = True, - cfg = "exec", - default = "//protos_generator:protoc-gen-upb-protos", - ), - "_protoc": attr.label( - executable = True, - cfg = "exec", - default = "//:protoc", - ), - "_cc_toolchain": attr.label( - default = "@bazel_tools//tools/cpp:current_cc_toolchain", - ), - "_upbprotos": attr.label_list( - default = [ - # TODO: Add dependencies for cc runtime (absl/string etc..) - "//upb:generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - "//protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/status:statusor", - "//protos", - "//protos:repeated_field", - ], - ), - }, - implementation = _upb_cc_proto_library_aspect_impl, - provides = [ - _UpbCcWrappedCcInfo, - _WrappedCcGeneratedSrcsInfo, - ], - required_aspect_providers = [ - UpbWrappedCcInfo, - ], - attr_aspects = ["deps"], - fragments = ["cpp"], - toolchains = use_cpp_toolchain(), - incompatible_use_toolchain_transition = True, -) - -upb_cc_proto_library = rule( - output_to_genfiles = True, - implementation = _upb_cc_proto_rule_impl, - attrs = { - "deps": attr.label_list( - aspects = [ - upb_proto_library_aspect, - _upb_cc_proto_library_aspect, - ], - allow_rules = ["proto_library"], - providers = [ProtoInfo], - ), - "_ccopts": attr.label( - default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", - ), - }, -) diff --git a/protos/protos.cc b/protos/protos.cc deleted file mode 100644 index 29b9fbe254350d8d478a69bb7cce63787c16cfbe..0000000000000000000000000000000000000000 --- a/protos/protos.cc +++ /dev/null @@ -1,221 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "protos/protos.h" - -#include -#include - -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/str_format.h" -#include "absl/strings/string_view.h" -#include "protos/protos_extension_lock.h" -#include "upb/mem/arena.h" -#include "upb/message/copy.h" -#include "upb/message/internal/extension.h" -#include "upb/message/promote.h" -#include "upb/message/types.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/extension_registry.h" -#include "upb/mini_table/message.h" -#include "upb/wire/decode.h" -#include "upb/wire/encode.h" - -namespace protos { - -// begin:google_only -// absl::Status MessageAllocationError(SourceLocation loc) { -// return absl::Status(absl::StatusCode::kInternal, -// "Upb message allocation error", loc); -// } -// -// absl::Status ExtensionNotFoundError(int extension_number, SourceLocation loc) { -// return absl::Status( -// absl::StatusCode::kInternal, -// absl::StrFormat("Extension %d not found", extension_number), loc); -// } -// -// absl::Status MessageEncodeError(upb_EncodeStatus status, SourceLocation loc) { -// return absl::Status(absl::StatusCode::kInternal, -// absl::StrFormat("Upb message encoding error %d", status), -// loc -// -// ); -// } -// -// absl::Status MessageDecodeError(upb_DecodeStatus status, SourceLocation loc -// -// ) { -// return absl::Status(absl::StatusCode::kInternal, -// absl::StrFormat("Upb message parse error %d", status), loc -// -// ); -// } -// end:google_only - -// begin:github_only -absl::Status MessageAllocationError(SourceLocation loc) { - return absl::Status(absl::StatusCode::kUnknown, - "Upb message allocation error"); -} - -absl::Status ExtensionNotFoundError(int ext_number, SourceLocation loc) { - return absl::Status(absl::StatusCode::kUnknown, - absl::StrFormat("Extension %d not found", ext_number)); -} - -absl::Status MessageEncodeError(upb_EncodeStatus s, SourceLocation loc) { - return absl::Status(absl::StatusCode::kUnknown, "Encoding error"); -} - -absl::Status MessageDecodeError(upb_DecodeStatus status, SourceLocation loc - -) { - return absl::Status(absl::StatusCode::kUnknown, "Upb message parse error"); -} -// end:github_only - -namespace internal { - -upb_ExtensionRegistry* GetUpbExtensions( - const ExtensionRegistry& extension_registry) { - return extension_registry.registry_; -} - -/** - * MessageLock(msg) acquires lock on msg when constructed and releases it when - * destroyed. - */ -class MessageLock { - public: - explicit MessageLock(const upb_Message* msg) : msg_(msg) { - UpbExtensionLocker locker = - upb_extension_locker_global.load(std::memory_order_acquire); - unlocker_ = (locker != nullptr) ? locker(msg) : nullptr; - } - MessageLock(const MessageLock&) = delete; - void operator=(const MessageLock&) = delete; - ~MessageLock() { - if (unlocker_ != nullptr) { - unlocker_(msg_); - } - } - - private: - const upb_Message* msg_; - UpbExtensionUnlocker unlocker_; -}; - -bool HasExtensionOrUnknown(const upb_Message* msg, - const upb_MiniTableExtension* eid) { - MessageLock msg_lock(msg); - return _upb_Message_Getext(msg, eid) != nullptr || - upb_MiniTable_FindUnknown(msg, eid->field.number, 0).status == - kUpb_FindUnknown_Ok; -} - -const upb_Message_Extension* GetOrPromoteExtension( - upb_Message* msg, const upb_MiniTableExtension* eid, upb_Arena* arena) { - MessageLock msg_lock(msg); - const upb_Message_Extension* ext = _upb_Message_Getext(msg, eid); - if (ext == nullptr) { - upb_GetExtension_Status ext_status = upb_MiniTable_GetOrPromoteExtension( - (upb_Message*)msg, eid, 0, arena, &ext); - if (ext_status != kUpb_GetExtension_Ok) { - ext = nullptr; - } - } - return ext; -} - -absl::StatusOr Serialize(const upb_Message* message, - const upb_MiniTable* mini_table, - upb_Arena* arena, int options) { - MessageLock msg_lock(message); - size_t len; - char* ptr; - upb_EncodeStatus status = - upb_Encode(message, mini_table, options, arena, &ptr, &len); - if (status == kUpb_EncodeStatus_Ok) { - return absl::string_view(ptr, len); - } - return MessageEncodeError(status); -} - -void DeepCopy(upb_Message* target, const upb_Message* source, - const upb_MiniTable* mini_table, upb_Arena* arena) { - MessageLock msg_lock(source); - upb_Message_DeepCopy(target, source, mini_table, arena); -} - -upb_Message* DeepClone(const upb_Message* source, - const upb_MiniTable* mini_table, upb_Arena* arena) { - MessageLock msg_lock(source); - return upb_Message_DeepClone(source, mini_table, arena); -} - -absl::Status MoveExtension(upb_Message* message, upb_Arena* message_arena, - const upb_MiniTableExtension* ext, - upb_Message* extension, upb_Arena* extension_arena) { - upb_Message_Extension* msg_ext = - _upb_Message_GetOrCreateExtension(message, ext, message_arena); - if (!msg_ext) { - return MessageAllocationError(); - } - if (message_arena != extension_arena) { - // Try fuse, if fusing is not allowed or fails, create copy of extension. - if (!upb_Arena_Fuse(message_arena, extension_arena)) { - msg_ext->data.ptr = - DeepClone(extension, msg_ext->ext->sub.submsg, message_arena); - return absl::OkStatus(); - } - } - msg_ext->data.ptr = extension; - return absl::OkStatus(); -} - -absl::Status SetExtension(upb_Message* message, upb_Arena* message_arena, - const upb_MiniTableExtension* ext, - const upb_Message* extension) { - upb_Message_Extension* msg_ext = - _upb_Message_GetOrCreateExtension(message, ext, message_arena); - if (!msg_ext) { - return MessageAllocationError(); - } - // Clone extension into target message arena. - msg_ext->data.ptr = - DeepClone(extension, msg_ext->ext->sub.submsg, message_arena); - return absl::OkStatus(); -} - -} // namespace internal - -} // namespace protos diff --git a/protos/protos.h b/protos/protos.h deleted file mode 100644 index 195d79354043fc1bcf622351e4e36d12f80dbace..0000000000000000000000000000000000000000 --- a/protos/protos.h +++ /dev/null @@ -1,551 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef UPB_PROTOS_PROTOS_H_ -#define UPB_PROTOS_PROTOS_H_ - -#include -#include - -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "upb/base/status.hpp" -#include "upb/mem/arena.hpp" -#include "upb/message/copy.h" -#include "upb/message/internal/accessors.h" -#include "upb/message/internal/extension.h" -#include "upb/wire/decode.h" -#include "upb/wire/encode.h" - -namespace protos { - -using Arena = ::upb::Arena; -class ExtensionRegistry; - -template -using Proxy = std::conditional_t::value, - typename std::remove_const_t::CProxy, - typename T::Proxy>; - -// Provides convenient access to Proxy and CProxy message types. -// -// Using rebinding and handling of const, Ptr and Ptr -// allows copying const with T* const and avoids using non-copyable Proxy types -// directly. -template -class Ptr final { - public: - Ptr() = delete; - - // Implicit conversions - Ptr(T* m) : p_(m) {} // NOLINT - Ptr(const Proxy* p) : p_(*p) {} // NOLINT - Ptr(Proxy p) : p_(p) {} // NOLINT - Ptr(const Ptr& m) = default; - - Ptr& operator=(Ptr v) & { - Proxy::Rebind(p_, v.p_); - return *this; - } - - Proxy operator*() const { return p_; } - Proxy* operator->() const { - return const_cast*>(std::addressof(p_)); - } - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wclass-conversion" -#endif - template ::value, int> = 0> - operator Ptr() const { - Proxy p(p_); - return Ptr(&p); - } -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - - private: - Ptr(void* msg, upb_Arena* arena) : p_(msg, arena) {} // NOLINT - - friend class Ptr; - friend typename T::Access; - - Proxy p_; -}; - -inline absl::string_view UpbStrToStringView(upb_StringView str) { - return absl::string_view(str.data, str.size); -} - -// TODO: update bzl and move to upb runtime / protos.cc. -inline upb_StringView UpbStrFromStringView(absl::string_view str, - upb_Arena* arena) { - const size_t str_size = str.size(); - char* buffer = static_cast(upb_Arena_Malloc(arena, str_size)); - memcpy(buffer, str.data(), str_size); - return upb_StringView_FromDataAndSize(buffer, str_size); -} - -template -typename T::Proxy CreateMessage(::protos::Arena& arena) { - return typename T::Proxy(upb_Message_New(T::minitable(), arena.ptr()), - arena.ptr()); -} - -// begin:github_only -// This type exists to work around an absl type that has not yet been -// released. -struct SourceLocation { - static SourceLocation current() { return {}; } - absl::string_view file_name() { return ""; } - int line() { return 0; } -}; -// end:github_only - -// begin:google_only -// using SourceLocation = absl::SourceLocation; -// end:google_only - -absl::Status MessageAllocationError( - SourceLocation loc = SourceLocation::current()); - -absl::Status ExtensionNotFoundError( - int extension_number, SourceLocation loc = SourceLocation::current()); - -absl::Status MessageDecodeError(upb_DecodeStatus status, - SourceLocation loc = SourceLocation::current()); - -absl::Status MessageEncodeError(upb_EncodeStatus status, - SourceLocation loc = SourceLocation::current()); - -namespace internal { -struct PrivateAccess { - template - static auto* GetInternalMsg(T&& message) { - return message->msg(); - } - template - static auto Proxy(void* p, upb_Arena* arena) { - return typename T::Proxy(p, arena); - } - template - static auto CProxy(const void* p, upb_Arena* arena) { - return typename T::CProxy(p, arena); - } -}; - -template -auto* GetInternalMsg(T&& message) { - return PrivateAccess::GetInternalMsg(std::forward(message)); -} - -template -T CreateMessage() { - return T(); -} - -template -typename T::Proxy CreateMessageProxy(void* msg, upb_Arena* arena) { - return typename T::Proxy(msg, arena); -} - -template -typename T::CProxy CreateMessage(const upb_Message* msg, upb_Arena* arena) { - return PrivateAccess::CProxy(msg, arena); -} - -class ExtensionMiniTableProvider { - public: - constexpr explicit ExtensionMiniTableProvider( - const upb_MiniTableExtension* mini_table_ext) - : mini_table_ext_(mini_table_ext) {} - const upb_MiniTableExtension* mini_table_ext() const { - return mini_table_ext_; - } - - private: - const upb_MiniTableExtension* mini_table_ext_; -}; - -// ------------------------------------------------------------------- -// ExtensionIdentifier -// This is the type of actual extension objects. E.g. if you have: -// extend Foo { -// optional MyExtension bar = 1234; -// } -// then "bar" will be defined in C++ as: -// ExtensionIdentifier bar(&namespace_bar_ext); -template -class ExtensionIdentifier : public ExtensionMiniTableProvider { - public: - using Extension = ExtensionType; - using Extendee = ExtendeeType; - - constexpr explicit ExtensionIdentifier( - const upb_MiniTableExtension* mini_table_ext) - : ExtensionMiniTableProvider(mini_table_ext) {} -}; - -template -upb_Arena* GetArena(Ptr message) { - return static_cast(message->GetInternalArena()); -} - -template -upb_Arena* GetArena(T* message) { - return static_cast(message->GetInternalArena()); -} - -template -const upb_MiniTable* GetMiniTable(const T*) { - return T::minitable(); -} - -template -const upb_MiniTable* GetMiniTable(Ptr) { - return T::minitable(); -} - -upb_ExtensionRegistry* GetUpbExtensions( - const ExtensionRegistry& extension_registry); - -absl::StatusOr Serialize(const upb_Message* message, - const upb_MiniTable* mini_table, - upb_Arena* arena, int options); - -bool HasExtensionOrUnknown(const upb_Message* msg, - const upb_MiniTableExtension* eid); - -const upb_Message_Extension* GetOrPromoteExtension( - upb_Message* msg, const upb_MiniTableExtension* eid, upb_Arena* arena); - -void DeepCopy(upb_Message* target, const upb_Message* source, - const upb_MiniTable* mini_table, upb_Arena* arena); - -upb_Message* DeepClone(const upb_Message* source, - const upb_MiniTable* mini_table, upb_Arena* arena); - -absl::Status MoveExtension(upb_Message* message, upb_Arena* message_arena, - const upb_MiniTableExtension* ext, - upb_Message* extension, upb_Arena* extension_arena); - -absl::Status SetExtension(upb_Message* message, upb_Arena* message_arena, - const upb_MiniTableExtension* ext, - const upb_Message* extension); - -} // namespace internal - -template -void DeepCopy(Ptr source_message, Ptr target_message) { - static_assert(!std::is_const_v); - ::protos::internal::DeepCopy( - internal::GetInternalMsg(target_message), - internal::GetInternalMsg(source_message), T::minitable(), - static_cast(target_message->GetInternalArena())); -} - -template -typename T::Proxy CloneMessage(Ptr message, upb_Arena* arena) { - return internal::PrivateAccess::Proxy( - ::protos::internal::DeepClone(internal::GetInternalMsg(message), - T::minitable(), arena), - arena); -} - -template -void DeepCopy(Ptr source_message, T* target_message) { - static_assert(!std::is_const_v); - DeepCopy(source_message, protos::Ptr(target_message)); -} - -template -void DeepCopy(const T* source_message, Ptr target_message) { - static_assert(!std::is_const_v); - DeepCopy(protos::Ptr(source_message), target_message); -} - -template -void DeepCopy(const T* source_message, T* target_message) { - static_assert(!std::is_const_v); - DeepCopy(protos::Ptr(source_message), protos::Ptr(target_message)); -} - -template -void ClearMessage(Ptr message) { - static_assert(!std::is_const_v, ""); - upb_Message_Clear(internal::GetInternalMsg(message), T::minitable()); -} - -template -void ClearMessage(T* message) { - ClearMessage(protos::Ptr(message)); -} - -class ExtensionRegistry { - public: - ExtensionRegistry( - const std::vector& - extensions, - const upb::Arena& arena) - : registry_(upb_ExtensionRegistry_New(arena.ptr())) { - if (registry_) { - for (const auto& ext_provider : extensions) { - const auto* ext = ext_provider->mini_table_ext(); - bool success = upb_ExtensionRegistry_AddArray(registry_, &ext, 1); - if (!success) { - registry_ = nullptr; - break; - } - } - } - } - - private: - friend upb_ExtensionRegistry* ::protos::internal::GetUpbExtensions( - const ExtensionRegistry& extension_registry); - upb_ExtensionRegistry* registry_; -}; - -template -using EnableIfProtosClass = std::enable_if_t< - std::is_base_of::value && - std::is_base_of::value>; - -template -using EnableIfMutableProto = std::enable_if_t::value>; - -template > -ABSL_MUST_USE_RESULT bool HasExtension( - Ptr message, - const ::protos::internal::ExtensionIdentifier& id) { - return ::protos::internal::HasExtensionOrUnknown( - ::protos::internal::GetInternalMsg(message), id.mini_table_ext()); -} - -template > -ABSL_MUST_USE_RESULT bool HasExtension( - const T* message, - const ::protos::internal::ExtensionIdentifier& id) { - return HasExtension(protos::Ptr(message), id); -} - -template , typename = EnableIfMutableProto> -void ClearExtension( - Ptr message, - const ::protos::internal::ExtensionIdentifier& id) { - static_assert(!std::is_const_v, ""); - _upb_Message_ClearExtensionField(internal::GetInternalMsg(message), - id.mini_table_ext()); -} - -template > -void ClearExtension( - T* message, - const ::protos::internal::ExtensionIdentifier& id) { - ClearExtension(::protos::Ptr(message), id); -} - -template , typename = EnableIfMutableProto> -absl::Status SetExtension( - Ptr message, - const ::protos::internal::ExtensionIdentifier& id, - const Extension& value) { - static_assert(!std::is_const_v); - auto* message_arena = static_cast(message->GetInternalArena()); - return ::protos::internal::SetExtension(internal::GetInternalMsg(message), - message_arena, id.mini_table_ext(), - internal::GetInternalMsg(&value)); -} - -template , typename = EnableIfMutableProto> -absl::Status SetExtension( - Ptr message, - const ::protos::internal::ExtensionIdentifier& id, - Extension&& value) { - Extension ext = std::move(value); - static_assert(!std::is_const_v); - auto* message_arena = static_cast(message->GetInternalArena()); - auto* extension_arena = static_cast(ext.GetInternalArena()); - return ::protos::internal::MoveExtension( - internal::GetInternalMsg(message), message_arena, id.mini_table_ext(), - internal::GetInternalMsg(&ext), extension_arena); -} - -template > -absl::Status SetExtension( - T* message, - const ::protos::internal::ExtensionIdentifier& id, - const Extension& value) { - return ::protos::SetExtension(::protos::Ptr(message), id, value); -} - -template > -absl::Status SetExtension( - T* message, - const ::protos::internal::ExtensionIdentifier& id, - Extension&& value) { - return ::protos::SetExtension(::protos::Ptr(message), id, - std::forward(value)); -} - -template > -absl::StatusOr> GetExtension( - Ptr message, - const ::protos::internal::ExtensionIdentifier& id) { - // TODO: Fix const correctness issues. - const upb_Message_Extension* ext = ::protos::internal::GetOrPromoteExtension( - const_cast(internal::GetInternalMsg(message)), - id.mini_table_ext(), ::protos::internal::GetArena(message)); - if (!ext) { - return ExtensionNotFoundError(id.mini_table_ext()->field.number); - } - return Ptr(::protos::internal::CreateMessage( - ext->data.ptr, ::protos::internal::GetArena(message))); -} - -template > -absl::StatusOr> GetExtension( - const T* message, - const ::protos::internal::ExtensionIdentifier& id) { - return GetExtension(protos::Ptr(message), id); -} - -template -ABSL_MUST_USE_RESULT bool Parse(Ptr message, absl::string_view bytes) { - static_assert(!std::is_const_v); - upb_Message_Clear(internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message)); - auto* arena = static_cast(message->GetInternalArena()); - return upb_Decode(bytes.data(), bytes.size(), - internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message), - /* extreg= */ nullptr, /* options= */ 0, - arena) == kUpb_DecodeStatus_Ok; -} - -template -ABSL_MUST_USE_RESULT bool Parse( - Ptr message, absl::string_view bytes, - const ::protos::ExtensionRegistry& extension_registry) { - static_assert(!std::is_const_v); - upb_Message_Clear(internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message)); - auto* arena = static_cast(message->GetInternalArena()); - return upb_Decode(bytes.data(), bytes.size(), - internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message), - /* extreg= */ - ::protos::internal::GetUpbExtensions(extension_registry), - /* options= */ 0, arena) == kUpb_DecodeStatus_Ok; -} - -template -ABSL_MUST_USE_RESULT bool Parse( - T* message, absl::string_view bytes, - const ::protos::ExtensionRegistry& extension_registry) { - static_assert(!std::is_const_v); - return Parse(protos::Ptr(message, bytes, extension_registry)); -} - -template -ABSL_MUST_USE_RESULT bool Parse(T* message, absl::string_view bytes) { - static_assert(!std::is_const_v); - upb_Message_Clear(internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message)); - auto* arena = static_cast(message->GetInternalArena()); - return upb_Decode(bytes.data(), bytes.size(), - internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message), - /* extreg= */ nullptr, /* options= */ 0, - arena) == kUpb_DecodeStatus_Ok; -} - -template -absl::StatusOr Parse(absl::string_view bytes, int options = 0) { - T message; - auto* arena = static_cast(message.GetInternalArena()); - upb_DecodeStatus status = - upb_Decode(bytes.data(), bytes.size(), message.msg(), - ::protos::internal::GetMiniTable(&message), - /* extreg= */ nullptr, /* options= */ 0, arena); - if (status == kUpb_DecodeStatus_Ok) { - return message; - } - return MessageDecodeError(status); -} - -template -absl::StatusOr Parse(absl::string_view bytes, - const ::protos::ExtensionRegistry& extension_registry, - int options = 0) { - T message; - auto* arena = static_cast(message.GetInternalArena()); - upb_DecodeStatus status = - upb_Decode(bytes.data(), bytes.size(), message.msg(), - ::protos::internal::GetMiniTable(&message), - ::protos::internal::GetUpbExtensions(extension_registry), - /* options= */ 0, arena); - if (status == kUpb_DecodeStatus_Ok) { - return message; - } - return MessageDecodeError(status); -} - -template -absl::StatusOr Serialize(const T* message, upb::Arena& arena, - int options = 0) { - return ::protos::internal::Serialize( - internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message), arena.ptr(), options); -} - -template -absl::StatusOr Serialize(Ptr message, upb::Arena& arena, - int options = 0) { - return ::protos::internal::Serialize( - internal::GetInternalMsg(message), - ::protos::internal::GetMiniTable(message), arena.ptr(), options); -} - -} // namespace protos - -#endif // UPB_PROTOS_PROTOS_H_ diff --git a/protos/protos_extension_lock.cc b/protos/protos_extension_lock.cc deleted file mode 100644 index dbb2fc2ed2e84b69c6194f1d9cf1b78c83b3e97f..0000000000000000000000000000000000000000 --- a/protos/protos_extension_lock.cc +++ /dev/null @@ -1,39 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "protos/protos_extension_lock.h" - -#include - -namespace protos::internal { - -std::atomic upb_extension_locker_global; - -} // namespace protos::internal diff --git a/protos/protos_extension_lock.h b/protos/protos_extension_lock.h deleted file mode 100644 index 36d66f12d62b3974fd18cc218d96360099f033c2..0000000000000000000000000000000000000000 --- a/protos/protos_extension_lock.h +++ /dev/null @@ -1,54 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef UPB_PROTOS_PROTOS_EXTENSION_LOCK_H_ -#define UPB_PROTOS_PROTOS_EXTENSION_LOCK_H_ - -#include - -namespace protos::internal { - -// TODO: Temporary locking api for cross-language -// concurrency issue around extension api that uses lazy promotion -// from unknown data to upb_MiniTableExtension. Will be replaced by -// a core runtime solution in the future. -// -// Any api(s) using unknown or extension data (GetOrPromoteExtension, -// Serialize and others) call lock/unlock to provide a way for -// mixed language implementations to avoid race conditions) -using UpbExtensionUnlocker = void (*)(const void*); -using UpbExtensionLocker = UpbExtensionUnlocker (*)(const void*); - -// TODO: Expose as function instead of global. -extern std::atomic upb_extension_locker_global; - -} // namespace protos::internal - -#endif // UPB_PROTOS_PROTOS_EXTENSION_LOCK_H_ diff --git a/protos/protos_extension_lock_test.cc b/protos/protos_extension_lock_test.cc deleted file mode 100644 index a0ce399cc1c28e16c663585f572b994a1ad2b79d..0000000000000000000000000000000000000000 --- a/protos/protos_extension_lock_test.cc +++ /dev/null @@ -1,147 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "protos/protos_extension_lock.h" - -#include -#include -#include -#include - -#include -#include -#include "absl/hash/hash.h" -#include "absl/log/absl_check.h" -#include "protos/protos.h" -#include "protos_generator/tests/test_model.upb.proto.h" -#include "upb/mem/arena.hpp" - -#ifndef ASSERT_OK -#define ASSERT_OK(x) ASSERT_TRUE(x.ok()) -#endif // ASSERT_OK -#ifndef EXPECT_OK -#define EXPECT_OK(x) EXPECT_TRUE(x.ok()) -#endif // EXPECT_OK - -namespace protos_generator::test::protos { - -namespace { - -std::string GenerateTestData() { - TestModel model; - model.set_str1("str"); - ThemeExtension extension1; - extension1.set_ext_name("theme"); - ABSL_CHECK_OK(::protos::SetExtension(&model, theme, extension1)); - ThemeExtension extension2; - extension2.set_ext_name("theme_extension"); - ABSL_CHECK_OK(::protos::SetExtension(&model, ThemeExtension::theme_extension, - extension2)); - ::upb::Arena arena; - auto bytes = ::protos::Serialize(&model, arena); - ABSL_CHECK_OK(bytes); - return std::string(bytes->data(), bytes->size()); -} - -std::mutex m[8]; -void unlock_func(const void* msg) { m[absl::HashOf(msg) & 0x7].unlock(); } -::protos::internal::UpbExtensionUnlocker lock_func(const void* msg) { - m[absl::HashOf(msg) & 0x7].lock(); - return &unlock_func; -} - -void TestConcurrentExtensionAccess(::protos::ExtensionRegistry registry) { - ::protos::internal::upb_extension_locker_global.store( - &lock_func, std::memory_order_release); - const std::string payload = GenerateTestData(); - TestModel parsed_model = - ::protos::Parse(payload, registry).value(); - const auto test_main = [&] { EXPECT_EQ("str", parsed_model.str1()); }; - const auto test_theme = [&] { - ASSERT_TRUE(::protos::HasExtension(&parsed_model, theme)); - auto ext = ::protos::GetExtension(&parsed_model, theme); - ASSERT_OK(ext); - EXPECT_EQ((*ext)->ext_name(), "theme"); - }; - const auto test_theme_extension = [&] { - auto ext = - ::protos::GetExtension(&parsed_model, ThemeExtension::theme_extension); - ASSERT_OK(ext); - EXPECT_EQ((*ext)->ext_name(), "theme_extension"); - }; - const auto test_serialize = [&] { - ::upb::Arena arena; - EXPECT_OK(::protos::Serialize(&parsed_model, arena)); - }; - const auto test_copy_constructor = [&] { - TestModel copy_a = parsed_model; - TestModel copy_b = parsed_model; - EXPECT_EQ(copy_a.has_str1(), copy_b.has_str1()); - }; - std::thread t1(test_main); - std::thread t2(test_main); - std::thread t3(test_theme); - std::thread t4(test_theme); - std::thread t5(test_theme_extension); - std::thread t6(test_theme_extension); - std::thread t7(test_serialize); - std::thread t8(test_copy_constructor); - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - t6.join(); - t7.join(); - t8.join(); - test_main(); - test_theme(); - test_theme_extension(); -} - -TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothLazy) { - ::upb::Arena arena; - TestConcurrentExtensionAccess({{}, arena}); -} - -TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceOneLazyOneEager) { - ::upb::Arena arena; - TestConcurrentExtensionAccess({{&theme}, arena}); - TestConcurrentExtensionAccess({{&ThemeExtension::theme_extension}, arena}); -} - -TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothEager) { - ::upb::Arena arena; - TestConcurrentExtensionAccess( - {{&theme, &ThemeExtension::theme_extension}, arena}); -} - -} // namespace -} // namespace protos_generator::test::protos diff --git a/protos/protos_internal.h b/protos/protos_internal.h deleted file mode 100644 index 0a1f194d3adf629c14a663ffe17fcbf981f2ede9..0000000000000000000000000000000000000000 --- a/protos/protos_internal.h +++ /dev/null @@ -1,48 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef UPB_PROTOS_PROTOS_INTERNAL_H_ -#define UPB_PROTOS_PROTOS_INTERNAL_H_ - -#include "upb/mem/arena.h" -#include "upb/message/message.h" - -namespace protos::internal { - -// Moves ownership of a message created in a source arena. -// -// Utility function to provide a way to move ownership across languages or VMs. -template -T MoveMessage(upb_Message* msg, upb_Arena* arena) { - return T(msg, arena); -} - -} // namespace protos::internal -#endif diff --git a/protos/protos_internal_test.cc b/protos/protos_internal_test.cc deleted file mode 100644 index a173665accb5fccbd97614cb28fb7b0d53d87901..0000000000000000000000000000000000000000 --- a/protos/protos_internal_test.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "protos/protos_internal.h" - -#include -#include -#include "protos_generator/tests/test_model.upb.h" -#include "protos_generator/tests/test_model.upb.proto.h" -#include "upb/mem/arena.h" - -namespace protos::testing { -namespace { -using ::protos_generator::test::protos::TestModel; - -TEST(CppGeneratedCode, InternalMoveMessage) { - // Generate message (simulating message created in another VM/language) - upb_Arena* source_arena = upb_Arena_New(); - protos_generator_test_TestModel* message = - protos_generator_test_TestModel_new(source_arena); - ASSERT_NE(message, nullptr); - protos_generator_test_TestModel_set_int_value_with_default(message, 123); - - // Move ownership. - TestModel model = - protos::internal::MoveMessage(message, source_arena); - // Now that we have moved ownership, free original arena. - upb_Arena_Free(source_arena); - EXPECT_EQ(model.int_value_with_default(), 123); -} - -} // namespace -} // namespace protos::testing diff --git a/protos/protos_traits.h b/protos/protos_traits.h deleted file mode 100644 index 92b9dc33b67c05d4289c415d445b56af5441fd25..0000000000000000000000000000000000000000 --- a/protos/protos_traits.h +++ /dev/null @@ -1,44 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef THIRD_PARTY_UPB_PROTOS_PROTOS_TRAITS_H_ -#define THIRD_PARTY_UPB_PROTOS_PROTOS_TRAITS_H_ - -#include - -namespace protos::internal { - -template -using add_const_if_T_is_const = - std::conditional_t, const T2, T2>; - -} // namespace protos::internal - -#endif // THIRD_PARTY_UPB_PROTOS_PROTOS_TRAITS_H_ diff --git a/protos/repeated_field.h b/protos/repeated_field.h deleted file mode 100644 index da42c44bc140d000e7729ac7895139a0c4128a97..0000000000000000000000000000000000000000 --- a/protos/repeated_field.h +++ /dev/null @@ -1,325 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef UPB_PROTOS_REPEATED_FIELD_H_ -#define UPB_PROTOS_REPEATED_FIELD_H_ - -#include -#include -#include - -#include "absl/strings/string_view.h" -#include "protos/protos.h" -#include "protos/protos_traits.h" -#include "protos/repeated_field_iterator.h" -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" -#include "upb/message/array.h" -#include "upb/message/copy.h" -#include "upb/message/types.h" - -// Must be last: -#include "upb/port/def.inc" - -namespace protos { - -namespace internal { - -// Shared implementation of repeated fields for absl::string_view and -// message types for mutable and immutable variants. -// -// Immutable (const accessor), constructs this class with a nullptr upb_Array* -// when the underlying array in the message is empty. -// -// Mutable accessors on the other hand, will allocate a new empty non-null -// upb_Array* for the message when the RepeatedFieldProxy is constructed. -template -class RepeatedFieldProxyBase { - using Array = add_const_if_T_is_const; - - public: - explicit RepeatedFieldProxyBase(Array* arr, upb_Arena* arena) - : arr_(arr), arena_(arena) {} - - size_t size() const { return arr_ != nullptr ? upb_Array_Size(arr_) : 0; } - - bool empty() const { return size() == 0; } - - protected: - // Returns upb_Array message member. - inline upb_Message* GetMessage(size_t n) const; - - Array* arr_; - upb_Arena* arena_; -}; - -template -upb_Message* RepeatedFieldProxyBase::GetMessage(size_t n) const { - auto** messages = - static_cast(upb_Array_MutableDataPtr(this->arr_)); - return messages[n]; -} - -template -class RepeatedFieldProxyMutableBase : public RepeatedFieldProxyBase { - public: - RepeatedFieldProxyMutableBase(upb_Array* arr, upb_Arena* arena) - : RepeatedFieldProxyBase(arr, arena) {} - - void clear() { upb_Array_Resize(this->arr_, 0, this->arena_); } -}; - -// RepeatedField proxy for repeated messages. -template -class RepeatedFieldProxy - : public std::conditional_t, RepeatedFieldProxyBase, - RepeatedFieldProxyMutableBase> { - static_assert(!std::is_same_v, ""); - static_assert(!std::is_same_v, ""); - static_assert(!std::is_arithmetic_v, ""); - static constexpr bool kIsConst = std::is_const_v; - - public: - using value_type = std::remove_const_t; - using size_type = size_t; - using difference_type = ptrdiff_t; - using iterator = internal::Iterator>; - using reference = typename iterator::reference; - using pointer = typename iterator::pointer; - using reverse_iterator = std::reverse_iterator; - - explicit RepeatedFieldProxy(const upb_Array* arr, upb_Arena* arena) - : RepeatedFieldProxyBase(arr, arena) {} - RepeatedFieldProxy(upb_Array* arr, upb_Arena* arena) - : RepeatedFieldProxyMutableBase(arr, arena) {} - // Constructor used by ::protos::Ptr. - RepeatedFieldProxy(const RepeatedFieldProxy&) = default; - - // T::CProxy [] operator specialization. - typename T::CProxy operator[](size_t n) const { - upb_MessageValue message_value = upb_Array_Get(this->arr_, n); - return ::protos::internal::CreateMessage>( - (upb_Message*)message_value.msg_val, this->arena_); - } - - // TODO : Audit/Finalize based on Iterator Design. - // T::Proxy [] operator specialization. - template > - typename T::Proxy operator[](size_t n) { - return ::protos::internal::CreateMessageProxy(this->GetMessage(n), - this->arena_); - } - - // Mutable message reference specialization. - template > - void push_back(const T& t) { - upb_MessageValue message_value; - message_value.msg_val = upb_Message_DeepClone( - PrivateAccess::GetInternalMsg(&t), ::protos::internal::GetMiniTable(&t), - this->arena_); - upb_Array_Append(this->arr_, message_value, this->arena_); - } - - // Mutable message add using move. - template > - void push_back(T&& msg) { - upb_MessageValue message_value; - message_value.msg_val = PrivateAccess::GetInternalMsg(&msg); - upb_Arena_Fuse(GetArena(&msg), this->arena_); - upb_Array_Append(this->arr_, message_value, this->arena_); - T moved_msg = std::move(msg); - } - - iterator begin() const { - return iterator({static_cast( - const_cast(upb_Array_DataPtr(this->arr_))), - this->arena_}); - } - iterator end() const { return begin() + this->size(); } - reverse_iterator rbegin() const { return reverse_iterator(end()); } - reverse_iterator rend() const { return reverse_iterator(begin()); } - - private: - friend class ::protos::Ptr; -}; - -// RepeatedField proxy for repeated strings. -template -class RepeatedFieldStringProxy - : public std::conditional_t, RepeatedFieldProxyBase, - RepeatedFieldProxyMutableBase> { - static_assert(std::is_same_v || - std::is_same_v, - ""); - static constexpr bool kIsConst = std::is_const_v; - - public: - using value_type = std::remove_const_t; - using size_type = size_t; - using difference_type = ptrdiff_t; - using iterator = internal::Iterator>; - using reference = typename iterator::reference; - using pointer = typename iterator::pointer; - using reverse_iterator = std::reverse_iterator; - - // Immutable constructor. - explicit RepeatedFieldStringProxy(const upb_Array* arr, upb_Arena* arena) - : RepeatedFieldProxyBase(arr, arena) {} - // Mutable constructor. - RepeatedFieldStringProxy(upb_Array* arr, upb_Arena* arena) - : RepeatedFieldProxyMutableBase(arr, arena) {} - // Constructor used by ::protos::Ptr. - RepeatedFieldStringProxy(const RepeatedFieldStringProxy&) = default; - - reference operator[](size_t n) const { return begin()[n]; } - - template > - void push_back(T t) { - upb_MessageValue message_value; - // Copy string to arena. - UPB_ASSERT(this->arena_); - char* data = (char*)upb_Arena_Malloc(this->arena_, t.size()); - UPB_ASSERT(data); - memcpy(data, t.data(), t.size()); - message_value.str_val = upb_StringView_FromDataAndSize(data, t.size()); - upb_Array_Append(this->arr_, message_value, this->arena_); - } - - iterator begin() const { return iterator({this->arr_, this->arena_, 0}); } - iterator end() const { - return iterator({this->arr_, this->arena_, this->size()}); - } - reverse_iterator rbegin() const { return reverse_iterator(end()); } - reverse_iterator rend() const { return reverse_iterator(begin()); } -}; - -// RepeatedField proxy for repeated scalar types. -template -class RepeatedFieldScalarProxy - : public std::conditional_t, RepeatedFieldProxyBase, - RepeatedFieldProxyMutableBase> { - static_assert(std::is_arithmetic_v, ""); - static constexpr bool kIsConst = std::is_const_v; - - public: - using value_type = std::remove_const_t; - using size_type = size_t; - using difference_type = ptrdiff_t; - using iterator = internal::Iterator>; - using reference = typename iterator::reference; - using pointer = typename iterator::pointer; - using reverse_iterator = std::reverse_iterator; - - explicit RepeatedFieldScalarProxy(const upb_Array* arr, upb_Arena* arena) - : RepeatedFieldProxyBase(arr, arena) {} - RepeatedFieldScalarProxy(upb_Array* arr, upb_Arena* arena) - : RepeatedFieldProxyMutableBase(arr, arena) {} - // Constructor used by ::protos::Ptr. - RepeatedFieldScalarProxy(const RepeatedFieldScalarProxy&) = default; - - T operator[](size_t n) const { - upb_MessageValue message_value = upb_Array_Get(this->arr_, n); - typename std::remove_const_t val; - memcpy(&val, &message_value, sizeof(T)); - return val; - } - - template > - void push_back(T t) { - upb_MessageValue message_value; - memcpy(&message_value, &t, sizeof(T)); - upb_Array_Append(this->arr_, message_value, this->arena_); - } - - iterator begin() const { return iterator({unsafe_array()}); } - iterator cbegin() const { return begin(); } - iterator end() const { return iterator({unsafe_array() + this->size()}); } - iterator cend() const { return end(); } - - // Reverse iterator support. - reverse_iterator rbegin() const { return reverse_iterator(end()); } - reverse_iterator rend() const { return reverse_iterator(begin()); } - reverse_iterator crbegin() const { return reverse_iterator(end()); } - reverse_iterator crend() const { return reverse_iterator(begin()); } - - private: - T* unsafe_array() const { - if (kIsConst) { - const void* unsafe_ptr = ::upb_Array_DataPtr(this->arr_); - return static_cast(const_cast(unsafe_ptr)); - } - if (!kIsConst) { - void* unsafe_ptr = - ::upb_Array_MutableDataPtr(const_cast(this->arr_)); - return static_cast(unsafe_ptr); - } - } -}; - -} // namespace internal - -template -class RepeatedField { - static constexpr bool kIsString = std::is_same_v; - static constexpr bool kIsScalar = std::is_arithmetic_v; - - public: - using Proxy = std::conditional_t< - kIsScalar, internal::RepeatedFieldScalarProxy, - std::conditional_t, - internal::RepeatedFieldProxy>>; - using CProxy = std::conditional_t< - kIsScalar, internal::RepeatedFieldScalarProxy, - std::conditional_t, - internal::RepeatedFieldProxy>>; - // TODO: T supports incomplete type from fwd.h forwarding headers - // We would like to reference T::CProxy. Validate forwarding header design. - using ValueProxy = std::conditional_t< - kIsScalar, T, - std::conditional_t>>; - using ValueCProxy = std::conditional_t< - kIsScalar, const T, - std::conditional_t>>; - using Access = std::conditional_t< - kIsScalar, internal::RepeatedFieldScalarProxy, - std::conditional_t, - internal::RepeatedFieldProxy>>; -}; - -} // namespace protos - -#include "upb/port/undef.inc" - -#endif // UPB_PROTOS_REPEATED_FIELD_H_ diff --git a/protos/repeated_field_iterator.h b/protos/repeated_field_iterator.h deleted file mode 100644 index 6ae25de14c74bf5743ce2f8b0be73a56bba0e692..0000000000000000000000000000000000000000 --- a/protos/repeated_field_iterator.h +++ /dev/null @@ -1,396 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef UPB_PROTOS_REPEATED_FIELD_ITERATOR_H_ -#define UPB_PROTOS_REPEATED_FIELD_ITERATOR_H_ - -#include -#include -#include -#include - -#include "absl/strings/string_view.h" -#include "protos/protos.h" -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" -#include "upb/message/array.h" -#include "upb/message/copy.h" - -// Must be last: -#include "upb/message/types.h" -#include "upb/port/def.inc" - -namespace protos { -namespace internal { - -// TODO: Implement std iterator for messages -template -class RepeatedFieldScalarProxy; -template -class RepeatedFieldStringProxy; - -struct IteratorTestPeer; - -template -class Iterator; - -template -class ReferenceProxy; - -template -class InjectedRelationalsImpl { - using RP = ReferenceProxy; - using V = typename PolicyT::value_type; - friend bool operator==(RP a, V b) { return static_cast(a) == b; } - friend bool operator==(V a, RP b) { return a == static_cast(b); } - friend bool operator==(RP a, RP b) { - return static_cast(a) == static_cast(b); - } - friend bool operator!=(RP a, V b) { return static_cast(a) != b; } - friend bool operator!=(V a, RP b) { return a != static_cast(b); } - friend bool operator!=(RP a, RP b) { - return static_cast(a) != static_cast(b); - } - friend bool operator<(RP a, V b) { return static_cast(a) < b; } - friend bool operator<(V a, RP b) { return a < static_cast(b); } - friend bool operator<(RP a, RP b) { - return static_cast(a) < static_cast(b); - } - friend bool operator<=(RP a, V b) { return static_cast(a) <= b; } - friend bool operator<=(V a, RP b) { return a <= static_cast(b); } - friend bool operator<=(RP a, RP b) { - return static_cast(a) <= static_cast(b); - } - friend bool operator>(RP a, V b) { return static_cast(a) > b; } - friend bool operator>(V a, RP b) { return a > static_cast(b); } - friend bool operator>(RP a, RP b) { - return static_cast(a) > static_cast(b); - } - friend bool operator>=(RP a, V b) { return static_cast(a) >= b; } - friend bool operator>=(V a, RP b) { return a >= static_cast(b); } - friend bool operator>=(RP a, RP b) { - return static_cast(a) >= static_cast(b); - } -}; -class NoInjectedRelationalsImpl {}; - -// We need to inject relationals for the string references because the -// relationals for string_view are templates and won't allow for implicit -// conversions from ReferenceProxy to string_view before deduction. -template -using InjectedRelationals = std::conditional_t< - std::is_same_v, - absl::string_view>, - InjectedRelationalsImpl, NoInjectedRelationalsImpl>; - -template -class ReferenceProxy : InjectedRelationals { - using value_type = typename PolicyT::value_type; - - public: - ReferenceProxy(const ReferenceProxy&) = default; - ReferenceProxy& operator=(const ReferenceProxy& other) { - // Assign through the references - // TODO: Make this better for strings to avoid the copy. - it_.Set(other.it_.Get()); - return *this; - } - friend void swap(ReferenceProxy a, ReferenceProxy b) { a.it_.swap(b.it_); } - - operator value_type() const { return it_.Get(); } - void operator=(const value_type& value) const { it_.Set(value); } - void operator=(value_type&& value) const { it_.Set(std::move(value)); } - Iterator operator&() const { return Iterator(it_); } - - private: - friend IteratorTestPeer; - friend ReferenceProxy; - friend Iterator; - - explicit ReferenceProxy(typename PolicyT::Payload elem) : it_(elem) {} - typename PolicyT::Payload it_; -}; - -template